Optical path system calibration method, device and computer readable storage medium

文档序号:223909 发布日期:2021-11-09 浏览:6次 中文

阅读说明:本技术 光路系统标定方法、设备、计算机可读存储介质 (Optical path system calibration method, device and computer readable storage medium ) 是由 杨延竹 王海 张旭堂 于波 张华� 于 2021-07-23 设计创作,主要内容包括:本申请公开了一种光路系统标定方法、设备、计算机可读存储介质。本申请光路系统标定方法包括:获取标定范围内的高度信息数据集及对应的像点坐标数据集;对像点坐标数据集进行拟合处理得到拟合数据集;根据高度信息数据集、拟合数据集计算得到目标函数集;根据目标函数集选取分段节点;根据分段节点将标定范围划分为多个子区域,分别对每个子区域拟合;根据拟合后的子区域对待测面进行标定。本申请提供的光路系统标定方法,通过将标定范围划分为多个子区域分别进行拟合,避免对标定范围内的全部像点坐标进行拟合造成参数耦合,使每个子区域的拟合曲线都尽量贴近实际的高度值,从而提高了标定精度,保证最小拟合误差。(The application discloses a method and equipment for calibrating a light path system and a computer readable storage medium. The method for calibrating the optical path system comprises the following steps: acquiring a height information data set and a corresponding image point coordinate data set within a calibration range; fitting the image point coordinate data set to obtain a fitting data set; calculating according to the height information data set and the fitting data set to obtain a target function set; selecting a segmentation node according to the target function set; dividing the calibration range into a plurality of sub-regions according to the segmented nodes, and respectively fitting each sub-region; and calibrating the surface to be measured according to the fitted sub-region. According to the optical path system calibration method, the calibration range is divided into the plurality of sub-regions to be respectively fitted, parameter coupling caused by fitting of all image point coordinates in the calibration range is avoided, and the fitting curve of each sub-region is close to the actual height value as much as possible, so that the calibration precision is improved, and the minimum fitting error is guaranteed.)

1. The calibration method of the optical path system is applied to the optical path system, the optical path system comprises a reference surface and a surface to be measured, and the surface to be measured is positioned on one side of the reference surface, and the calibration method of the optical path system is characterized by comprising the following steps of:

acquiring a height information data set in a calibration range, and acquiring a corresponding image point coordinate data set; the height information data set comprises a plurality of height information data, and the height information data is the distance from the reference surface to the surface to be measured;

fitting the image point coordinate data set to obtain a fitting data set;

calculating according to the height information data set and the fitting data set to obtain a target function set;

selecting a segmentation node according to the target function set;

dividing the calibration range into a plurality of sub-regions according to the segmented nodes, and respectively fitting each sub-region;

and calibrating the surface to be measured according to the fitted sub-region.

2. The method for calibrating an optical path system according to claim 1, wherein the acquiring the height information data set within the calibration range includes:

controlling the distance between the surface to be measured and the reference surface according to a plurality of preset distances, and generating a plurality of height information data;

and obtaining a height information data set according to the plurality of height information data.

3. The method for calibrating an optical path system according to claim 2, wherein the optical path system further includes a photosensitive module, and the acquiring a corresponding data set of coordinate information of the image point includes:

extracting a plurality of light spot stripe central points reflected to the photosensitive module by the surface to be detected to obtain a plurality of image point coordinate data;

and obtaining an image point coordinate data set according to the plurality of image point coordinate data.

4. The method for calibrating an optical path system according to claim 3, wherein the fitting the coordinates of the image points to obtain a fitting data set comprises:

and fitting the image point coordinate data set according to a preset second-order polynomial model to obtain a fitting data set.

5. The method for calibrating an optical path system according to claim 4, wherein the fitting data set includes a plurality of fitting data, and the calculating an objective function set according to the height information data set and the fitting data set includes:

obtaining an objective function value according to the height information data and the fitting data;

and obtaining an objective function set according to the plurality of objective function values.

6. The method for calibrating an optical path system according to claim 5, wherein at least one node is predefined, the nodes respectively corresponding to one of the pixel coordinate data sets, and the obtaining an objective function value according to the height information data and the fitting data comprises:

and traversing each image point coordinate data in the image point coordinate data set by the node to obtain a plurality of undetermined area combinations divided by the node, and calculating to obtain an objective function value of each undetermined area combination.

7. The method for calibrating an optical path system according to claim 6, wherein the selecting a segment node according to the set of objective functions includes:

acquiring a minimum objective function value in the objective function set;

and obtaining the corresponding segmented node according to the minimum objective function value.

8. The method for calibrating an optical system according to claim 7, wherein the dividing a calibration range into sub-regions according to the segmentation node, and fitting each sub-region separately comprises:

dividing a calibration range into a plurality of sub-regions according to the segmented nodes;

fitting the sub-regions according to the image point coordinate data corresponding to each sub-region to obtain a plurality of sub-fitting data sets;

the calibrating the surface to be measured according to the fitted sub-region comprises the following steps:

and calibrating the surface to be measured according to the sub-fitting data set.

9. A computer-readable storage medium storing computer-executable instructions for: performing the optical path system calibration method of any one of claims 1 to 8.

10. An apparatus, characterized in that it comprises: a processor;

a memory having stored thereon a computer program operable on the processor; wherein the computer program realizes the steps of the optical path system calibration method according to any one of claims 1 to 8 when being executed by the processor.

Technical Field

The invention relates to the technical field of optical measurement, in particular to a method and equipment for calibrating an optical path system and a computer readable storage medium.

Background

In the related art, a laser measurement system which performs measurement by using a trigonometry principle is widely applied to geometric measurement and precision measurement, and in the precision measurement process, a plurality of factors influencing the accuracy of a measurement result exist, wherein the calibration accuracy of the measurement system is a main influencing factor.

The conventional calibration method directly calibrates all parameters in the range, so that a calibration model of the laser measurement system is complex, or all parameters of the laser measurement system are coupled, which affects the calibration of the laser measurement system, and finally, the measurement accuracy of the laser measurement system is low.

Disclosure of Invention

The present invention is directed to solving at least one of the problems of the prior art. Therefore, the invention provides a calibration method of an optical path system, which can divide a calibration range into a plurality of sub-areas to respectively perform fitting on the premise of not modifying original calibration data, thereby realizing calibration of the optical path system with higher accuracy.

In a first aspect, the present application provides a method for calibrating an optical path system, which is applied to an optical path system, where the optical path system includes a reference surface and a surface to be measured, the surface to be measured is located on one side of the reference surface, and the method for calibrating an optical path system includes:

acquiring a height information data set in a calibration range, and acquiring a corresponding image point coordinate data set; the height information data set comprises a plurality of height information data, and the height information data is the distance from the reference surface to the surface to be measured;

fitting the image point coordinate data set to obtain a fitting data set;

calculating according to the height information data set and the fitting data set to obtain a target function set;

selecting a segmentation node according to the target function set;

dividing the calibration range into a plurality of sub-regions according to the segmented nodes, and respectively fitting each sub-region;

and calibrating the surface to be measured according to the fitted sub-region.

The calibration method of the optical path system in the embodiment of the application has the following technical effects: the method comprises the steps of obtaining a height information data set and an image point coordinate data set through a light path system, obtaining a fitting data set through calculation, obtaining a target function set through calculation according to the fitting data set and the height information data set, selecting segmentation nodes in the target function set, dividing a calibration range into a plurality of sub-regions according to the segmentation nodes, fitting each sub-region respectively, enabling a fitting curve of each sub-region to be close to an actual height value as much as possible, and avoiding excessive coordinates of image points participating in fitting, large errors between the fitting curve and the discrete values and further influencing the accuracy of fitting.

In some embodiments, the acquiring the height information data set within the calibration range includes:

controlling the distance between the surface to be measured and the reference surface according to a plurality of preset distances, and generating a plurality of height information data;

and obtaining a height information data set according to the plurality of height information data.

In some embodiments, the optical path system further includes a photosensitive module, and the acquiring the corresponding data set of the coordinate information of the image point includes:

extracting a plurality of light spot stripe central points reflected to the photosensitive module by the surface to be detected to obtain a plurality of image point coordinate data;

and obtaining an image point coordinate data set according to the plurality of image point coordinate data.

In some embodiments, the fitting the coordinates of the image points to obtain a fitting data set includes:

and fitting the image point coordinate data set according to a preset second-order polynomial model to obtain a fitting data set.

In some embodiments, the fitting data set includes a plurality of fitting data, and the calculating a set of objective functions from the height information data set and the fitting data set includes:

obtaining an objective function value according to the height information data and the fitting data;

and obtaining an objective function set according to the plurality of objective function values.

In some embodiments, predefining at least one node, the nodes respectively corresponding to one of the sets of image point coordinate data, the deriving an objective function value from the height information data and the fitting data, comprises:

and traversing each image point coordinate data in the image point coordinate data set by the node to obtain a plurality of undetermined area combinations divided by the node, and calculating to obtain an objective function value of each undetermined area combination.

In some embodiments, said selecting a segmentation node according to the set of objective functions includes:

acquiring a minimum objective function value in the objective function set;

and obtaining the corresponding segmented node according to the minimum objective function value.

In some embodiments, the dividing the calibration range into sub-regions according to the segmentation node, and respectively fitting each sub-region, includes:

dividing a calibration range into a plurality of sub-regions according to the segmented nodes;

fitting the sub-regions according to the image point coordinate data corresponding to each sub-region to obtain a plurality of sub-fitting data sets;

the calibrating the surface to be measured according to the fitted sub-region comprises the following steps:

and calibrating the surface to be measured according to the sub-fitting data set.

In a second aspect, the present application further provides a computer-readable storage medium storing computer-executable instructions for performing the optical system calibration method according to the first aspect.

In a third aspect, the present application further provides an apparatus, comprising: a processor; a memory having stored thereon a computer program operable on the processor; wherein the computer program realizes the steps of the optical path system calibration method according to the first aspect when being executed by the processor.

Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.

Drawings

The invention is further described with reference to the following figures and examples, in which:

fig. 1 is a flowchart of a calibration method for an optical system according to an embodiment of the present application;

fig. 2 is a schematic diagram of a calibration method of an optical path system according to an embodiment of the present application;

fig. 3 is a flowchart of a calibration method for an optical system according to still another embodiment of the present application;

FIG. 4 is a block diagram of an apparatus according to an embodiment of the present application;

reference numerals: 1. an optical path system; 11. a laser; 12. a focusing lens; 2. equipment; 21. a processor; 22. a memory.

Detailed Description

Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention.

In the description of the present invention, it should be understood that the orientation or positional relationship referred to in the description of the orientation, such as the upper, lower, front, rear, left, right, etc., is based on the orientation or positional relationship shown in the drawings, and is only for convenience of description and simplification of description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus, should not be construed as limiting the present invention.

In the description of the present invention, the meaning of a plurality is one or more, the meaning of a plurality is two or more, and the above, below, exceeding, etc. are understood as excluding the present numbers, and the above, below, within, etc. are understood as including the present numbers. If the first and second are described for the purpose of distinguishing technical features, they are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated or implicitly indicating the precedence of the technical features indicated.

In the description of the present invention, unless otherwise explicitly limited, terms such as arrangement, installation, connection and the like should be understood in a broad sense, and those skilled in the art can reasonably determine the specific meanings of the above terms in the present invention in combination with the specific contents of the technical solutions.

In the description of the present invention, reference to the description of the terms "one embodiment," "some embodiments," "an illustrative embodiment," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

It should be noted that, in the following embodiments, the calibration represents a process of determining a system measurement model by solving measurement parameters in the optical path system according to an imaging relationship.

The measurement parameters and the model of the optical path system directly influence the measurement accuracy, so the calibration of the optical path system is a key link for determining the measurement accuracy, and meanwhile, the selection of a proper measurement model can improve the measurement accuracy and speed. Based on this, the embodiment of the application provides a method and device for calibrating an optical path system, and a computer-readable storage medium.

Referring to fig. 1, the present application provides a method for calibrating an optical path system, which is applied to an optical path system, where the optical path system includes a reference surface and a surface to be measured, the surface to be measured is located on one side of the reference surface, and the method for calibrating an optical path system includes: s101, acquiring a height information data set in a calibration range, and acquiring a corresponding image point coordinate data set; the height information data set comprises a plurality of height information data, and the height information data is the distance from the reference surface to the surface to be measured; step S102, fitting the image point coordinate data set to obtain a fitting data set; step S103, calculating according to the height information data set and the fitting data set to obtain a target function set; s104, selecting segmented nodes according to the target function set; step S105, dividing the calibration range into a plurality of sub-regions according to the segmented nodes, and respectively fitting each sub-region; and S106, calibrating the surface to be measured according to the fitted sub-region.

Referring to fig. 2, in the present embodiment, the optical path system 1 includes a laser 11, a focusing lens 12, and a sensor. The light beam emitted by the laser 11 is incident on a plane within a calibration range, which is a movable range of the surface to be measured, i.e., a measurable range of the optical path system 1. The plane comprises a plane to be measured and a reference plane, wherein the horizontal plane where H is located is the plane to be measured, the horizontal plane where O is located is the reference plane, P is the reference plane imaging point, N is the imaging point of the plane to be measured, theta is the included angle between the laser reflected from the reference plane and the vertical direction, and alpha is the included angle between the laser reflected from the reference plane and the sensor imaging plane. The surface to be measured and the reference surface respectively reflect the incident laser to obtain two beams of reflected laser, and the reflected laser passes through the focusing lens 12 and then enters the sensor to form an image. The sensor receives two beams of laser reflected by the surface to be measured and the reference surface, and generates corresponding laser stripes on the imaging plane, wherein the imaging position of the reference surface in the sensor is unchanged, and the positions of the stripes imaged in the sensor by the surface to be measured at different distances from the reference surface are different, and the imaging positions are different in the vertical coordinate. Therefore, by calculating the vertical coordinate of the stripe corresponding to the surface to be measured at a different height from the reference surface, the relational expression between the height of the surface to be measured and the vertical coordinate of the stripe within the calibration range can be obtained, thereby realizing the calibration of the region to be measured within the calibration range of the optical path system 1.

Specifically, in the calibration range, the height of the surface to be measured is changed one by one, and height information data is acquired to form a height information data set, wherein the height information data is obtained by actual physical measurement of the height information data from the surface to be measured to the reference surface. When the height of the surface to be measured is changed, the imaging position of the reflected laser in the sensor is changed, namely, the light stripe in the image of the sensor moves along with the movement of the surface to be measured, and the stripe coordinates on the corresponding image of different height information data are different. And recording coordinate data of the stripes corresponding to the height of each surface to be measured to obtain a height information data set and a corresponding image point coordinate data set, wherein the image point coordinate data set is a set of vertical coordinate data of different stripes.

It can be understood that, in the present embodiment, establishing the parameter model to calibrate the measurement region needs to use a functional expression to express the relationship between the image point coordinate data and the height information data, that is, to fit the image point coordinate data set. Specifically, fitting refers to connecting a series of discrete points by a smooth curve, and there are countless possibilities for connecting the curves of discrete values, so that the fitting manner is various, and the curve obtained by fitting can be expressed by a functional expression. The image point coordinate data are discrete values, a fitting data set is obtained through calculation of the discrete values of the image point coordinate data set, and the fitting data set is close to actual height information data on the whole. In an actual measurement operation, the image point coordinate data corresponding to the linearly changing height information data is nonlinearly changed due to laser jitter, lens distortion, laser search accuracy, depth of field limitation of an incident beam, and the like in the optical path system 1. Fitting data obtained by calculating coordinate data of image points reflects an expected value of the height of a surface to be measured obtained by calculating the vertical coordinates of the image points through a measurement model of the optical path system 1, the expected value of the height obtained by fitting is different from an actual height value, and in order to reduce the difference between the expected value and the actual value of the fitting, namely improve the measurement accuracy of the optical path system 1, a proper fitting mode needs to be selected, so that the fitting data is close to actual height information data as much as possible.

It can be understood that, in this embodiment, after the initial fitting is performed on the image point coordinate data set, in order to improve the calibration accuracy of the optical path system 1, further processing is required on the fitting data. Specifically, a target function set is obtained through calculation according to the height information data set and the fitting data set, the target function set comprises a plurality of target functions, and the target functions are the sum of absolute values of difference values of a plurality of height information data and corresponding drawn data. The height information data refers to height values obtained through actual physical measurement, the fitting data refers to height expected values measured through the optical path system 1, therefore, the target function reflects the sum of errors between the measurement result and the actual height, and therefore the target function set can intuitively embody errors from different fitting data sets to the height information data set, and accordingly, the selection of appropriate segmented nodes according to the target function set is guided.

Specifically, the target function set is calculated, a suitable segmentation node is selected from the target function set according to a calculation result, the segmentation node divides the calibration range into a plurality of sub-regions, and different fitting functions can be obtained by respectively fitting each sub-region. Different fitting curves are adopted for the image point coordinate data subsets of each sub-region to obtain different fitting expressions, so that the fitting curve of each sub-region is close to the actual height value as much as possible, and the phenomenon that the fitting accuracy is influenced due to the fact that too many image point coordinates participate in fitting can be avoided.

In the embodiment of the application, the height information data set and the image point coordinate data set are obtained through the optical path system 1, a fitting data set is obtained through calculation, a target function set is obtained through calculation according to the fitting data set and the height information data set, a segmentation node is selected in the target function set, finally, a calibration range is divided into a plurality of sub-regions according to the segmentation node, fitting is conducted on each sub-region respectively, the fitting curve of each sub-region is close to the actual height value as much as possible, the excessive coordinates of the image points participating in fitting can be avoided, the errors of the fitting curve and the discrete values are large, and therefore the fitting accuracy is affected.

In some embodiments, the step S101 of "acquiring the height information data set within the calibration range" includes the sub-steps of: controlling the distance between the surface to be measured and the reference surface according to a plurality of preset distances, and generating a plurality of height information data; and obtaining a height information data set according to the plurality of height information data.

Specifically, a surface to be measured and a reference surface are provided in a region to be measured of the optical path system 1, and the surface to be measured is located on one side of the reference surface. By changing the distance between the surface to be measured and the reference surface, a plurality of actual height information data can be obtained, wherein the height information data is the physical height value from the surface to be measured to the reference surface. In the actual calibration process, different distances between the surface to be measured and the reference surface can be preset according to the requirement of the calibration precision and the performance of the optical path system 1, so as to obtain appropriate height information data to form a height information data set.

For example, the reference surface is kept unchanged, the surface to be measured is moved by using a spiral shifter, the distance between the surface to be measured and the reference surface is preset to be a plurality of data with a fixed interval of 0.5mm, and the preset distance can be adjusted according to actual conditions. Specifically, the preset distances are distributed in sequence, the difference between the preset distances in adjacent sequences is 0.5mm, the distance between the preset distance in the first sequence and the reference plane is-12.5 mm, and the distance between the preset distance in the last sequence and the reference plane is 12.5 mm. It can be understood that, in the present embodiment, the spiral shifter steps by 0.5mm each time, so that the surface to be measured steps from-12.5 mm away from the reference surface to 12.5mm away from the reference surface for multiple times, so as to obtain multiple sets of height information data, thereby generating the height information data set. For example, the spiral shifter moves to 0.5mm scale, and the distance between the surface to be measured and the reference surface is 0.5mm at this time, that is, the height information data of the surface to be measured is 0.5 mm; the spiral shifter moves to 1.0mm scale, and the distance between the surface to be measured and the reference surface is 1.0mm at the moment, namely the height information data of the surface to be measured is 1.0 mm. And the spiral shifter moves to the preset distance in sequence, height information data from the surface to be measured to the reference surface corresponding to the preset distance are generated, and a height information data set is obtained according to the height information data.

In the present embodiment, the calibration range is-12.5 mm to 12.5mm, and it is understood that in other possible embodiments, the calibration range may be other ranges, and the present application is not limited thereto.

Referring to fig. 2 again, in some embodiments, the optical path system 1 further includes a photosensitive module, and the step S101 of acquiring the corresponding data set of the image point coordinate information includes the sub-steps of: extracting a plurality of light spot stripe central points reflected to the photosensitive module by the surface to be detected to obtain a plurality of image point coordinate data; and obtaining an image point coordinate data set according to the plurality of image point coordinate data.

It can be understood that, the laser in the optical path system 1 is reflected by the surface to be measured and the reference surface, then enters the sensor through the focusing lens 12, and generates a laser stripe on the sensor imaging plane through the photosensitive module of the sensor. Since the reference plane remains unchanged, the position coordinates of the fringes generated by the laser light reflected by the reference plane remain unchanged. The spiral shifter moves the surface to be measured, namely, the distance from the surface to be measured to the reference surface in the optical path system 1 is changed, according to the following trigonometric principle formula:

it can be deduced that:

HO is height information data from a to-be-measured surface to a reference surface, H is a to-be-measured surface, O is a reference surface, P is a reference surface imaging point, N is a to-be-measured surface imaging point, PN is an offset between the to-be-measured surface imaging point and the reference surface imaging point, OQ is an imaging object distance of laser reflected from the reference surface passing through the focusing lens 12, QP is an imaging image distance of the laser reflected from the reference surface passing through the focusing lens 12, theta is an included angle between the laser reflected from the reference surface and a vertical direction, and alpha is an included angle between the laser reflected from the reference surface and a sensor imaging plane.

According to the trigonometric theory formula, when HO representing height information data from the surface to be measured to the reference surface changes, the offset of the imaging point N of the surface to be measured and the imaging point P of the reference surface also changes, namely when the surface to be measured is moved, the coordinate of the imaging stripe of the surface to be measured moves along with the change, and the object point and the image point have one-to-one correspondence relationship. Therefore, in the process of moving the surface to be measured by the spiral shifter, the photosensitive module of the sensor generates stripes for the reflected laser, the positions of the stripes are processed, and the vertical coordinates of the imaging points of the surface to be measured at different stages can be obtained.

Specifically, because the reflected laser has thickness, the formation of image through the sensitization module generates the laser stripe that has certain width, and on the formation of image plane, the laser stripe that has certain width occupies a plurality of pixel. In order to accurately calculate the vertical coordinate of the imaging stripe of the surface to be measured, the pixel points of the imaging plane need to be converted into a corresponding coordinate system, and the coordinate of the central point is found out according to the coordinates of a plurality of pixel points occupied by the laser stripe, namely, the central point of the laser stripe is extracted.

Specifically, the step of extracting the central point of the stripe is as follows:

the coordinates of any pixel point are (x, y), and the image is convolved with a two-dimensional Gaussian template g (x, y) to obtain a first-order partial derivative rx、rySecond partial derivative rxx、ryy、rxy. The following matrix H (x, y) is constructed from the second partial derivatives:

at point (x)0,y0) The eigenvector corresponding to the maximum eigenvalue of the matrix is (n)x,ny) The gray distribution function r (tn) of the light bar imagex,tny) Performing a second order taylor expansion, wherein t is an offset coefficient, and then:

the first derivative at the central characteristic point of the conventional stripe crosses zero and the amplitude of the second derivative is maximum, that is, the first derivative of the gray extreme point of the normal phase of the light stripe image is 0, then:

if (tn)x,tny)∈[-0.5,0.5]And if the second-order gradient value of the pixel point is greater than a given threshold value, determining the point as the central point of the laser stripe.

And obtaining the coordinate of the central point of the laser stripe, namely the coordinate data of the image point of the surface to be measured. And moving the surface to be measured according to a preset distance to obtain a plurality of corresponding image point coordinate data, wherein the plurality of image point coordinate data form an image point coordinate data set. The image point coordinate data set refers to an image point coordinate set of the imaging of the to-be-measured surfaces with different heights in the optical path system 1.

In some embodiments, the step S102 of fitting the image point coordinate data set to obtain a fitting data set includes the sub-steps of: and fitting the image point coordinate data set according to a preset second-order polynomial model to obtain a fitting data set.

It can be understood that, since the height information data and the image point coordinate data have a one-to-one correspondence relationship, in order to calibrate the optical path system 1, a function model expressing the relationship between the height information and the image point coordinate needs to be solved. In this embodiment, the obtained image point coordinate data is a discrete value, and a function model approximating the discrete image point coordinate may be solved by using a curve fitting method. Curve fitting refers to a data processing method for comparing the functional relationship between coordinates represented by discrete point groups on a plane through a curve, namely, solving a fitting curve to ensure that the coordinates of image points are distributed near the curve, wherein the fitting curve reflects the overall distribution of the coordinates of the image points, and the deviation of a functional model of the fitting curve and a known height information data set on the whole is minimized.

Specifically, the second-order polynomial model h ═ a is adopted in the present embodiment0+a1y+a2y2As a function model for describing the coordinate and height information of the image point, wherein y is the coordinate data of the image point, h is the fitting data solved by the second-order polynomial model and corresponding to the coordinate data y of the image point, and the fitting data refers toUnder the condition that the fringe central line coordinates of the imaging of the surface to be measured are known, the expected value of the height information data calculated by the function model calibrated by the optical path system 1 may have errors with the height information data obtained by actual physical measurement, and the errors are called fitting errors. In order to reduce the fitting error and improve the calibration accuracy of the optical path system 1, the established second-order polynomial model needs to select a proper polynomial coefficient a0、a1、a2. The following steps are taken to solve the polynomial coefficients:

wherein, yiAs pixel coordinate data, hiFor fitting data, N is the number of coordinate data participating in fitting image points, a0、a1、a2To solve for the coefficients of the fit data h. Solving a polynomial coefficient a0、a1、a2Post-substitution second-order polynomial model h ═ a0+a1y+ a2y2And calculating to obtain a corresponding fitting data set through the image point coordinate data set.

In this embodiment, a second-order polynomial model is used as a function model calibrated by the optical path system 1, so that the calculation model is simplified, and the complexity of solution is greatly reduced.

In some embodiments, the fitting data set includes a plurality of fitting data, and the step S103 of calculating an objective function set according to the height information data set and the fitting data set includes: obtaining an objective function value according to the height information data and the fitting data; and obtaining an objective function set according to the plurality of objective function values.

Specifically, in order to improve calibration accuracy and optimize polynomial coefficients, an absolute value of an error from a height information data set of actual physical measurement to a fitting data set point is defined as a fitting error, and the fitting error reflects an error between a measurement result and actual height. Fitting the image point coordinate data set of a certain area to obtain fitting errors of all image point coordinate data in the area and the corresponding height information book, summing the fitting errors to obtain a target function, and enabling the target function set to visually represent errors from the fitting data sets of different areas to the height information data set. The expression for solving the objective function is as follows:

wherein the content of the first and second substances,in order to be the height information data,to fit the data, G is the objective function. Corresponding fitting error sums can be obtained by calculating objective functions of different image point coordinate areas. The sum of the fitting errors is an objective function, and the objective function can measure the accuracy of the calibration model of the region.

In some embodiments, predefining at least one node, the nodes respectively corresponding to one of the sets of image point coordinate data, the deriving an objective function value from the height information data and the fitting data, comprises: and traversing each image point coordinate data in the image point coordinate data set by the node to obtain a plurality of undetermined area combinations divided by the node, and calculating to obtain an objective function value of each undetermined area combination.

Specifically, a is obtained by establishing a second-order polynomial model h ═ a0+a1y+a2y2The fitting image point coordinate data set generates a corresponding fitting data set, however, the fitting data set and the actual height information data set have fitting errors according to the calculation result of the objective function. In order to reduce the fitting error, in the embodiment of the application, the calibration region is divided into a plurality of sub-regions, and a second-order polynomial model with different coefficients is respectively established for each region. Compared with the fitting of the global calibration area, when the independent sub-areas are respectively fitted after the sub-areas are divided, the sub-areas are matchedFewer coordinate data of image points in the domain, i.e. fewer coordinate points participating in the fitting, a suitable calibration model can be selected, so that the sum of errors of the calibrated fitting curve and the actual height information data set is smaller.

It will be appreciated that the solution to the segmentation nodes used to partition the sub-regions is required before partitioning the sub-regions. In this embodiment, each node corresponds to one pixel coordinate data in the pixel coordinate data set by predefining at least one node. Each defined node traverses each image point coordinate data in the image point coordinate data set, wherein the traversal means that each node sequentially corresponds to each image point coordinate data in the image point coordinate data set according to a certain sequence to obtain a plurality of undetermined area combinations divided by the node, and when the number of the divided sub-areas is n, the number of the nodes needing to be predefined is n-1. When the node corresponds to a part of the coordinates of the image points in the image point coordinate function set, the combination of the undetermined areas is meaningless for this embodiment, for example, when a node is defined to divide the calibration area into two sub-areas, when the node is located on the first or last coordinates of the image points, the calibration area cannot be divided into two areas. Therefore, in the following description of the present application, these cases are not discussed.

For example, referring to fig. 3, in the present embodiment, the calibration range is divided into three sub-regions, and the segmented node is solved according to the following steps:

step S201, predefining head node yfirstNodeAnd tail node ylastNode

Wherein y isfirstNodeThe head node is represented by y in the pixel coordinate data setiAs a starting point, ylastNodeTail node with yn-iIs a starting point, where i is the node's subscript, an integer starting from 1, yiI.e. the ith pixel coordinate data, and defining the tail node as an initial tail node.

Step S202, calculating a target function of the undetermined area combination;

step S203, end node ylastNodeA subscript-1;

specifically, the first node is kept unchanged, the footer of the tail node is gradually-1, and the newly-arranged tail node ylastNodeAnd the head node yfirstNodeAnd forming a new undetermined area combination, and recalculating the objective function of the undetermined area combination. End node ylastNodeCalculating objective function value G by reverse order traversal11、G12、G13…, the traversal termination condition is that in step S204, the difference between the subscripts of the head node and the tail node is 1. Record objective function value G in the traversal process11、G12、G13Objective function value combined by a plurality of equal undetermined areas and corresponding node yfirstNode1,ylastNode i. When the difference between the subscripts of the head node and the tail node is not 1, the step S202 is repeated, and the objective function of the combination of the undetermined areas is calculated; when the difference value of the subscripts of the head node and the tail node is 1, executing the following steps:

step S205, a first node is subjected to a pin mark +1, and a tail node is reset;

step S206, the difference value of the footmarks of the head node and the tail node is 1;

when the difference value of the subscripts of the head node and the tail node is not 1, returning to the step S202 again, and calculating the target function of the combination of the undetermined areas; when the difference between the subscripts of the head node and the tail node is 1, step S207 is executed to generate the target function.

For example, head node yfirstNode+1Tail node ylastNodeReset to initial tail node, hold yfirstNode+1Node is unchanged by ylastNodeCalculating objective function value G by reverse order traversal21、G22、G23…, the traversal termination condition is that the difference value of the subscripts of the head node and the tail node is 1. Recording target function G in traversal process11、G12、G13… and corresponding node yfirstNode2,ylastNode i. Repeating the steps to ensure that the first node finishes traversing all the image point coordinate data, wherein the termination condition is that the first node i-lastNode is 1, namely when the first node which starts traversing from the first image point coordinate traverses to the last-but-one image point coordinate data in sequence, the difference between the footmarks of the tail node and the first node is 1. At the moment, the head node and the tail node traverse the image point to sitAnd marking all the coordinates of the image points in the data set to generate all combinations of the undetermined areas, wherein the combinations of the undetermined areas refer to all combinations which can be divided when the subsection nodes divide the sub-areas. And substituting the corresponding height information data set and the fitting data set according to the calculation method of the target function to obtain the target function of each undetermined area combination to form a target function set.

In some embodiments, the step S104 of selecting a segmentation node according to the target function set includes: acquiring a minimum objective function value in the objective function set; and obtaining the corresponding segmented node according to the minimum objective function value.

It can be understood that the objective function of the undetermined area combination reflects the sum of errors from the fitting data set to the height information data set calibrated by different undetermined area combinations, that is, the objective function included in the objective function set corresponds to the calibration accuracy of the undetermined area combination generated by different segmentation methods, and the smaller the objective function is, the smaller the sum of errors from the fitting data set to the height information data set calibrated by the corresponding undetermined area combination is. Therefore, the node corresponding to the objective function with the minimum objective function set is selected as the segmented node, so that the calibration precision of the optical path system 1 can be effectively improved, and the error is reduced.

In some embodiments, the step S105 of dividing the calibration range into sub-regions according to the segmentation node, and respectively fitting each sub-region includes: dividing a calibration range into a plurality of sub-regions according to the segmented nodes; and respectively fitting the sub-regions according to the image point coordinate data corresponding to each sub-region to obtain a plurality of sub-fitting data sets.

Specifically, after the calibration range is divided according to the segmented nodes, a second-order polynomial model is respectively established for each sub-region, and polynomial coefficients are respectively solved to obtain the calibration model of each sub-region and obtain fitting data sets of different sub-regions.

In some embodiments, the step S106 of calibrating the surface to be measured according to the fitted sub-region includes: and calibrating the surface to be measured according to the sub-fitting data set.

The calibration range is divided into a plurality of sub-regions by the calibration method of the optical path system to be respectively fitted, so that the parameter coupling phenomenon caused by fitting all image point coordinate data in the calibration range is avoided, the fitting curve of each sub-region is close to the actual height value as much as possible, the calibration precision is improved, and the minimum fitting error is ensured.

In some embodiments, a computer-readable storage medium stores computer-executable instructions for performing the optical system calibration method described in any of the above embodiments.

Referring to fig. 4, in some embodiments, the apparatus 2 includes: a processor 21; a memory 22 on which a computer program executable on the processor 21 is stored; wherein the computer program is executed by the processor 21 to implement the steps of the optical system calibration method according to any one of the above embodiments.

15页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种橡筋寻股检测结构

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!