Line-spectroscopy confocal calibration method, system, device and storage medium
By acquiring the spectral center point and fitting the set curve, the line spectrum confocal calibration parameters are calculated, which solves the problem that the sensor cannot be directly calibrated in the spectral confocal system. It realizes the conversion and position mapping of sensor pixels to spatial points, and improves calibration accuracy and efficiency.
Patent Information
- Application Number
- CN202311202169.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-18
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2043-09-18
AI Technical Summary
In existing spectral confocal systems, the sensor only records the returned spectral information and does not directly acquire the object image, making it difficult to perform conventional calibration. Furthermore, the line spectral confocal calibration method only calibrates the axial position and cannot calibrate the actual lateral position of each point on the sensor image.
By collecting the spectral center point fed back by the calibration material, a set curve is fitted. The set curve segment between the central feature point and the adjacent feature points on both sides is selected, and the intersection point or extended intersection point is fitted. The correspondence between the coordinates of the intersection point and the real feature point is established. The calibration parameters of the line spectrum confocalization are calculated, and the least squares method is used for fitting and verification to improve the calibration accuracy.
It realizes the conversion of sensor pixels to spatial points, completes the axial and lateral position mapping between the two-dimensional plane of the line spectrum confocal system and the actual space. The process is simple, easy to operate, saves labor and time costs, and improves calibration accuracy.
Smart Images

Figure CN117173253B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of spectral confocal imaging, and in particular relates to a line spectrum confocal imaging calibration method, system, equipment and storage medium. Background Art
[0002] Spectral confocal microscopy is a non-contact 3D measurement technique that utilizes optical methods. It uses a dispersive lens to converge a broad spectrum of polychromatic light emitted by a light source at different axial positions. Only monochromatic light that meets the confocal conditions can be detected by the spectrometer to the greatest extent possible. By measuring the peak wavelength, the axial distance to the object's surface can be inferred. Based on the measurement method, these systems can be categorized as point confocal systems or line confocal systems. Both require inferring the true spatial coordinates from the pattern captured by the sensor. However, due to factors such as nonlinear dispersion, distortion from the dispersive lens, and distortion from the imaging spectrometer, distortion correction is required for confocal systems.
[0003] Traditional distortion correction methods often use Zhang's calibration method and its improved method. However, in the spectral confocal system, the sensor only records the returned spectral information and does not directly obtain the image of the photographed object, making it difficult to calibrate using conventional methods.
[0004] The spectral confocal measurement system, based on spectral confocal technology, utilizes a dispersive objective lens system to disperse the light source after it is focused by the lens. This creates a continuous monochromatic focus on the optical axis, with varying distances from the dispersive lens. This establishes a correspondence between wavelength and axial distance. A spectrometer is then used to obtain spectral information after reflection from the surface of the object being measured, thereby obtaining corresponding position information. If the light source is a pinhole, the resulting focused image is a point, known as point scanning confocal. If the light source is a line source passing through a slit, the resulting image is a scanned line, known as line scanning confocal.
[0005] Patent CN114754676A discloses a line spectrum confocal calibration method, device, equipment, system, and storage medium. The method utilizes a calibration plate within the range of a line spectrum confocal sensor to capture the sensor image formed by measuring the calibration plate. Line position calibration, peak calibration, and spacing testing are then performed to obtain the sensor calibration results. This method, similar to the calibration process for point confocal systems, calibrates only the axial direction of the system—that is, only calibrates the sensor image and axial position—and fails to calibrate the actual lateral position corresponding to each point on the sensor image.
[0006] In summary, the existing technology mainly has the following deficiencies:
[0007] (1) In traditional spectral confocal systems, the sensor only records the returned spectral information and does not directly obtain the image of the object being photographed, making it difficult to calibrate using conventional methods;
[0008] (2) In the existing line spectrum confocal calibration method, only the sensor image and the axial position are calibrated, and the actual lateral position corresponding to each point on the sensor image cannot be calibrated. Summary of the Invention
[0009] The purpose of the present invention is to overcome the above problems existing in the prior art and provide a line spectrum confocal calibration method, system, equipment and storage medium.
[0010] In order to achieve the above technical objectives and the above technical effects, the present invention is implemented through the following technical solutions:
[0011] A line spectrum confocal calibration method, the method comprising the following steps:
[0012] Collect the center point of the spectrum fed back by the calibration object and fit it into a collection curve;
[0013] Select any central feature point in the collection curve, determine the collection curve segment between it and the two adjacent feature points on both sides, and fit the intersection point or extended intersection point of the two collection curve segments;
[0014] The corresponding relationship between the coordinates of the intersection point and the coordinates of the corresponding real feature point is established, and the calibration parameters of the line spectrum confocal are calculated.
[0015] Furthermore, the collection curve segment is directly connected to the central feature point or connected through a continuous collection curve.
[0016] Furthermore, the collection curve has characteristic points at different heights relative to the line light source.
[0017] Furthermore, the calibration parameters are calculated using the least squares method.
[0018] Furthermore, it also includes calibration verification, which is used to detect whether the calibration parameters are successful. By replacing or moving the calibration object, the coordinates of the feature points after the calibration object is transformed are collected. Based on the calibration parameters, the difference between the calibration coordinate value and the actual coordinate value of the corresponding feature point after the calibration object is transformed is calculated to see whether it is within the verification threshold range.
[0019] Furthermore, there is a known corresponding curve equation on the surface of the calibration object.
[0020] Furthermore, if the number of feature points in the aggregate curve is small or zero, the distance between the calibration object and the line light source is adjusted to increase the number of feature points in the aggregate curve, thereby improving the calibration accuracy.
[0021] The present invention also proposes a line spectrum confocal calibration system, comprising:
[0022] The linear light source module irradiates the surface of the calibration object after being dispersed by the lens group;
[0023] Calibration reflection module: the calibration object is illuminated by a linear light source and there are multiple feature points at different heights relative to the linear light source. The relative positions of several feature points are known.
[0024] The calibration operation module is used to execute the above calibration method.
[0025] The present invention also proposes a device, including a memory and a processor, wherein the memory stores a computer program executed by the processor, and the computer program is configured to execute the above-mentioned calibration method when running.
[0026] The present invention also provides a computer-readable storage medium, comprising a computer program, which implements the above-mentioned calibration method when executed by a processor.
[0027] The beneficial effects of the present invention are:
[0028] (1) The present invention establishes a one-to-one correspondence between spatial points and pixel points, completing the conversion from pixel points to spatial points, thereby realizing the calibration of the line spectrum confocal system;
[0029] (2) The present invention utilizes the constructed spatial feature points to simultaneously calibrate the axial and lateral position mapping relationship between the two-dimensional plane of the sensor and the actual space;
[0030] (3) The process of the present invention is simple, easy to operate, and effectively saves labor and time costs;
[0031] (4) The fitting model in the present invention is simple and universal, which improves the calibration accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0033] Figure 1 This is a flow chart of the line spectrum confocal calibration method of the present invention;
[0034] Figure 2 Schematic diagram of the implementation of the line spectrum confocal calibration method of the present invention;
[0035] Figure 3 Schematic diagram of a first embodiment of a cross section of a calibration object and a measurement signal obtained by a line spectrum confocal sensor in the present invention;
[0036] Figure 4 2. It is a schematic diagram of a second embodiment of a calibration object cross section and a measurement signal obtained by a line spectrum confocal sensor in the present invention;
[0037] Figure 5Schematic diagram of a third embodiment of the cross section of a calibration object and a measurement signal obtained by a line spectrum confocal sensor in the present invention. Implementation Method
[0038] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of the present invention.
[0039] like Figure 1 As shown, this embodiment first provides a line spectrum confocal calibration method, which includes the following steps:
[0040] S1: Collect the center point of the spectrum fed back by the calibration object and fit it into a collection curve;
[0041] like Figure 2 As shown in the figure, the calibration object is placed under the line light source of the line spectrum confocal and installed within the measuring range of the line spectrum confocal sensor. The wide spectrum line light source is emitted by the line light source, and after being dispersed by the dispersive objective lens in the lens, the light of different wavelengths is focused at different positions and forms a confocal plane, which is then irradiated onto the surface of the calibration object.
[0042] The surfaces of the calibration object at different heights reflect light from different focal planes of the linear light source. The reflected light passes through the original illumination optical path of a single-axis system or the imaging optical path of a dual-axis system, passes through the conjugate slit of the spectrometer, and is focused onto the area array sensor.
[0043] The spectrometer decodes the spectral data of the reflected light collected by the array sensor to obtain the surface depth information of the calibration object in the area covered by the incident light.
[0044] The center of the line light incident on the calibration object's surface corresponds to the spectral center of the corresponding pixel on the area array sensor. Several spectral center points can be fitted to a collection of curves representing the real-space curves of the line light covering the calibration object's surface.
[0045] Only light focused on the surface of the calibration object enters the imaging optical path and is captured by the area array camera. Out-of-focus light is greatly attenuated. Therefore, the surface depth of the calibration object obtained by the spectrometer does not exceed the dispersion range of the line light source. Therefore, the aggregate curve may contain discontinuities. If the number of feature points in the aggregate curve is small or zero, adjust the distance of the calibration object relative to the line light source to increase the number of feature points in the aggregate curve to improve calibration accuracy.
[0046] The sensor is used to collect the spectral distribution image corresponding to the reflected scan line, and the coordinate points of the spectral information peak are extracted by row or column. The sensor pixel coordinates corresponding to the surface curve of the calibration object and the feature points are obtained by fitting each coordinate point.
[0047] The calibration object is a three-dimensional calibration plate, which includes several inclined surfaces with known spacing. The intersection lines of adjacent planes are parallel to each other and have known spacing, and the scan line plane is perpendicular to the bottom surface of the three-dimensional calibration plate and the intersection line of its inclined surfaces.
[0048] In order to further improve the calibration accuracy, in addition to the known feature point information of the calibration object surface, the curve equation corresponding to the calibration object surface can also be provided to provide accuracy support for the fitting of pixel coordinates.
[0049] The surface curve of the calibration object is obtained by fitting by setting peaks and troughs of different known heights and extracting the characteristic points therein. The peaks and troughs can be curves. If the peaks or troughs are curves, the corresponding laser line center point coordinates should be fitted as a curve. The corresponding curve equation should be:
[0050] Where a is the fitting coefficient, and the curve fitting method also uses the random consistency sampling algorithm. Common curve equations include polynomial curve equations.
[0051] S2: Select any central feature point in the collection curve, determine the collection curve segment between it and the two adjacent feature points on both sides, and fit the intersection or extended intersection of the two collection curve segments.
[0052] The feature points are points with greater curvature on the edge of the image, namely, peak points, trough points, and inflection points of the curve.
[0053] In the collection curve, any feature point is selected, and the feature point is taken as the central feature point. The collection curve segment between the two adjacent feature points on both sides of the feature point is selected, and the intersection point or extended intersection point of the two collection curve segments is fitted.
[0054] If there is a set curve segment between non-adjacent feature points on either side of the central feature point, the fitted extended intersection point cannot correspond to the central feature point.
[0055] Extract the pixel coordinates of the intersection of the scan line and the inclined surface from the spectral distribution image. The specific steps are as follows:
[0056] S201, assuming that the spectral distribution image is I1, I1 is subjected to Gaussian filtering, median filtering, and thresholding in sequence to obtain a processed image I2; the spectral distribution of the processed image is more obvious, which facilitates the operation of extracting the center point and improves the accuracy of subsequent calibration;
[0057] S202, extract the coordinates of the spectral center point corresponding to the reflected linear dispersion light in I2, and record it as pointsWhen incident linearly dispersed light strikes an object, the spectrum returned is not an ideal monochromatic light, but rather has a spectral distribution with a certain width. Therefore, it is necessary to extract the center point of the spectral distribution and then construct a center line, which is the ideal spectral signal. Common techniques for extracting line center points include the grayscale centroid method and Gaussian fitting.
[0058] S203, extracting pixel coordinates u and v of the intersection of the reflected linear dispersion light and the inclined surface in the I2 image; specifically, this step further includes the following steps:
[0059] S2031, extract the center point coordinates of the spectrum points After smoothing, a sequence curve S can be obtained;
[0060] like Figure 3 As shown in the first embodiment, the sequence curve S is formed by two intersecting straight lines, as follows:
[0061] S2032a. Obtain the coordinates of the peaks and valleys in the sequence curve S, denoted as u0 and v0, and filter out other interfering peak and valley coordinates.
[0062] S2033a, in points Find the coordinate points whose horizontal coordinates are in the range of [v0-n,v0+n], and use the preset least squares method to fit the coordinate points in the range of [v0-n,v0+m] and [v0+m,v0+n] respectively, and obtain the straight line equations y1=k1x+b1 and y2=k2x+b2 corresponding to the inclined surfaces on both sides of the intersection; where k1, b1, k2, and b2 are fitting coefficients, m and n are preset parameters, and n>m>0;
[0063] S2034a. Calculate the intersection coordinates of the two straight lines. These coordinates are the pixel coordinates u and v of the intersection point of the inclined surface intersection line and the incident linear dispersion light to be extracted.
[0064] like Figure 4 As shown in FIG. 1 , as a second embodiment, the sequence curve S may also be formed by the intersection of a straight line and a sine curve, as follows:
[0065] S2032b. Obtain the coordinates corresponding to the peaks and troughs in the sequence curve S, denoted as u0 and v0, and filter out other interfering peak and trough coordinates;
[0066] S2033b, in pointsFind the coordinate points whose horizontal coordinates are in the range of [v0-n,v0+n], and use the preset least squares method to fit the coordinate points in the range of [v0-n,v0-m] and [v0+m,v0+n] respectively, to obtain the straight line equation y1=k1x+b1 and the sine curve equation y=Asin(ωx+φ)+B corresponding to the inclined surfaces on both sides of the intersection; where k1, b1, A, ω, φ, and B are fitting coefficients, m and n are preset parameters, and n>m>0;
[0067] S2034b. Calculate the coordinates of the intersection of the straight line and the sine curve. These coordinates are the pixel coordinates u and v of the intersection point of the inclined surface intersection line and the incident linear dispersion light to be extracted.
[0068] like Figure 5 As shown in FIG. 3 , as a third embodiment, the sequence curve S can also be formed by intersecting two sine curves, as follows:
[0069] S2032c. Obtain the coordinates corresponding to the peaks and troughs in the sequence curve S, denoted as u0 and v0, and filter out the coordinates of other interfering peaks and troughs;
[0070] S2033c, in points Find the coordinate points whose horizontal coordinates are in the range of [v0-n,v0+n], and use the preset least squares method to fit the coordinate points in the range of [v0-n,v0-m] and [v0+m,v0+n] respectively, and get the two sinusoidal curve equations y1=A1sin(ω1x+φ1)+B1 and y2=A2sin(ω2x+φ2)+B2 corresponding to the inclined surfaces on both sides of the intersection; Among them, A1, ω1, φ1, B 1、 A2, ω2, φ2, and B2 are all fitting coefficients, m and n are preset parameters, n>m>0;
[0071] S2034c. Calculate the coordinates of the intersection of the two sine curves. These coordinates are the pixel coordinates u and v of the intersection point of the inclined surface intersection line and the incident linear dispersion light that need to be extracted.
[0072] S3: Establishing the corresponding relationship between the coordinates of the intersection point and the coordinates of the corresponding real feature point, and calculating the calibration parameters of the line spectrum confocal;
[0073] First, the real feature point coordinates (X, Z) corresponding to each intersection point in step S2 are extracted, and the pixel coordinates (u, v) of the feature points on the entire sensor plane are mapped one-to-one with the real feature point coordinates (X, Z);
[0074] Secondly, establish a fitting model of the real feature point coordinates X and Z relative to the pixel coordinates:
[0075]
[0076] Where N is the highest term number, a and b are fitting coefficients;
[0077] Finally, the preset least squares method is used to calculate the above model parameters to obtain the calibration parameters of the line scanning confocal system.
[0078] The collection curve segments between the central feature point and the two adjacent feature points on its two sides can be connected directly or via a continuous collection curve. When selecting the collection curve segments between the two adjacent feature points on both sides, there are collection curve segments that include the central feature point or that do not include the central feature point.
[0079] When the selected collection curve segment includes the central feature point, the collection curve segment is directly connected to the central feature point to fit the collection curve segment;
[0080] When the selected collection curve segment does not include the central feature point, the collection curve segment is connected to the central feature point through a continuous collection curve. In combination with the actual curve equation type of the calibration object covered by the line light source, a collection curve segment that meets the curve equation type is fitted, and combined with the actual curve equation, it is extended to the central feature point.
[0081] Two fitted collection curve segments intersect or extend to intersect, forming an intersection point.
[0082] For the calculated calibration parameters, you can also use calibration verification to check whether the calibration parameters are successful. You can replace or move the calibration object, collect the coordinates of the feature points after the calibration object is transformed, and calculate the difference between the calibration coordinate value and the actual coordinate value of the corresponding feature point after the calibration object is transformed based on the calibration parameters to see if it is within the verification threshold range. The specific steps are as follows:
[0083] S401, controlling the scanning line of the line scanning confocal system to hit the calibration object;
[0084] S402, randomly moving the high-precision translation stage, controlling the sensor of the line scanning confocal system to collect a scan line reflection spectrum at each random movement position, and simultaneously recording each movement position;
[0085] S403, recording several positions and collecting several spectral images, and selecting one position as a reference position;
[0086] S404: Identify the pixel coordinates of the intersection of the scan line and the inclined surface in each image, convert the center pixel coordinates into spatial coordinates based on the calibration parameters obtained above, and calculate the calibration coordinates of the current intersection by subtracting the coordinates of the reference position from the current coordinates;
[0087] S405, obtaining the real coordinates of the current intersection relative to the reference position by subtracting the reference position from the current position;
[0088] S406, calculating the difference between the real coordinates and the calculated calibration coordinates;
[0089] S407, determining whether the difference is less than a given threshold;
[0090] S408: Determine whether the difference values of all positions are less than a given threshold. If so, the calibration is considered successful. Otherwise, the calibration is unsuccessful, and a calibration failure is output.
[0091] A second aspect of the present invention further provides a line spectrum confocal calibration system, comprising:
[0092] The linear light source module irradiates the surface of the calibration object after being dispersed by the lens group;
[0093] Calibration reflection module: the calibration object is illuminated by a linear light source and there are multiple feature points at different heights relative to the linear light source. The relative positions of several feature points are known.
[0094] The calibration operation module executes the above-mentioned line spectrum confocal calibration method.
[0095] The third aspect of the present invention further provides a device, comprising a memory and a processor, wherein the memory stores a computer program executed by the processor, and the computer program is configured to execute the above-mentioned line spectrum confocal calibration method when running.
[0096] The fourth aspect of the present invention further provides a computer-readable storage medium, comprising a computer program, characterized in that when the computer program is executed by a processor, the above-mentioned line spectrum confocal calibration method is implemented.
[0097] The above-mentioned storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory, a random access memory, a mobile hard disk, a magnetic disk, or an optical disk.
[0098] Throughout this specification, references to terms such as "one embodiment," "example," and "specific example" indicate that the specific features, structures, materials, or characteristics described in conjunction with that embodiment or example are included in at least one embodiment or example of the present invention. In this specification, schematic representations of these terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
[0099] The basic principles, main features, and advantages of the present invention are shown and described above. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions are merely illustrative of the principles of the present invention. Various changes and modifications may be made to the present invention without departing from the spirit and scope of the present invention, and such changes and modifications fall within the scope of the invention as claimed.
Claims
1. A line spectrum confocal calibration method, characterized in that: The method comprises the following steps: The center point of the spectrum fed back by the calibration object is collected and fitted into a collection curve; the corresponding curve equation is known on the surface of the calibration object; Select any central feature point in the collection curve, determine the collection curve segment between it and the two adjacent feature points on both sides, and fit the intersection or extended intersection of the two collection curve segments: smooth the extracted spectral center point coordinates points to obtain a sequence curve; obtain the coordinates corresponding to the peak and trough in the sequence curve, recorded as u0 and v0; find the coordinate points with horizontal coordinates in the range of [v0-n,v0+n] in points, and use the preset least squares method to fit the coordinate points in the range of [v0-n,v0-m] and [v0+m,v0+n] respectively, to obtain the straight line equations corresponding to the inclined surfaces on both sides of the intersection; calculate the coordinates of the intersection of the two straight lines, which are the pixel coordinates of the intersection of the inclined surface intersection line and the incident linear dispersion light to be extracted; Establish the corresponding relationship between the coordinates of the intersection point and the coordinates of the corresponding real feature point, and calculate the calibration parameters of the line spectrum confocal; Replace or move the calibration object, collect the coordinates of the feature points after the calibration object is transformed, and calculate the difference between the calibration coordinate value and the true coordinate value of the corresponding feature point after the calibration object is transformed based on the calibration parameters to determine whether it is within the test threshold range. The specific steps are as follows: control the scanning line of the line scanning confocal system to hit the calibration object; randomly move the high-precision translation stage, control the sensor of the line scanning confocal system to collect a scan line reflection spectrum at each random movement position, and simultaneously record each movement position; record several positions and collect several spectral images, and select one position as a reference position; identify the pixel coordinates of the intersection of the scan line and the inclined surface in each image; convert the center pixel coordinates into spatial coordinates based on the calibration parameters obtained above, and calculate the calibration coordinates of the current intersection by subtracting the coordinates of the reference position from the current coordinates; obtain the true coordinates of the current intersection relative to the reference position by subtracting the reference position from the current position; calculate the difference between the true coordinates and the calculated calibration coordinates; determine whether the difference is less than a given threshold; determine whether the differences of all positions are less than the given threshold. If so, the calibration is considered successful; otherwise, the calibration is unsuccessful, and a calibration failure is output.
2. A line spectrum confocal calibration method according to claim 1, characterized in that: The collection curve segment is connected to the central feature point directly or through a continuous collection curve.
3. The line spectrum confocal calibration method according to claim 1, characterized in that: The collection curve has characteristic points at different heights relative to the line light source.
4. The line spectrum confocal calibration method according to claim 1, characterized in that: The calibration parameters are calculated using the least squares method.
5. A line spectrum confocal calibration system, characterized in that: include: The linear light source module irradiates the surface of the calibration object after being dispersed by the lens group; Calibration reflection module: the calibration object is illuminated by a linear light source and there are multiple feature points at different heights relative to the linear light source. The relative positions of several feature points are known. The calibration operation module is used to execute the calibration method according to any one of claims 1 to 4.
6. A device, characterized in that The method comprises a memory and a processor, wherein the memory stores a computer program executed by the processor, and the computer program is configured to execute the calibration method according to any one of claims 1 to 4 when running.
7. A computer-readable storage medium comprising a computer program, characterized in that When the computer program is executed by a processor, the calibration method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Line structured light visual sensor calibration method based on sawtooth target
CN107218904A
Line spectrum confocal calibration method, device, equipment, system and storage medium
CN114754676A
Cited By
Calibration method based on two-dimensional image, three-dimensional reconstruction method and medium
CN121582350A