A spectral confocal echo position calibration method, device, medium and computer equipment
By planting seed points and expansion points in the spectral confocal system, forming echo position connection lines, and using their uniform distribution characteristics to correct deviations, the impact of optical distortion on the spectral confocal system is solved, the measurement accuracy is improved and the calibration process is simplified.
Patent Information
- Application Number
- CN202110434519.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-22
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2041-04-22
AI Technical Summary
The existing spectral confocal echo position calibration methods are difficult to accurately handle optical distortion, resulting in a reduced measurement accuracy.
By planting seed points in the tightly arranged direction of the light source echo spectrum image and expanding seed points in the direction perpendicular to the tightly arranged direction, forming an echo position connection line, correcting the deviation based on its uniform distribution characteristics, and recording the overall echo curve distribution as the calibration result.
It effectively solves the impact of optical distortion on the spectral confocal system, improves measurement accuracy, simplifies the calibration process, and saves time and cost.
Smart Images

Figure CN115235625B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of spectral confocal measurement, and in particular relates to a spectral confocal echo position calibration method, device, computer equipment and storage medium. Background Art
[0002] With the continuous development and transformation and upgrading of the manufacturing industry, the corresponding measurement technology is required to develop in the direction of high precision, non-destructive and real-time. Representative technologies can be roughly divided into two categories: contact measurement and non-contact measurement. Among them, non-contact measurement has been a research hotspot in recent years, and various measurement devices and instruments based on optics, acoustics, electromagnetism, etc. have emerged. The dispersion spectrum confocal measurement method is an ultra-high precision non-contact measurement method based on the principle of optical dispersion and realized by color coding technology. This method has broad industry prospects due to its wide material adaptability, high measurement accuracy, and online real-time measurement.
[0003] Linear spectrum confocal technology realizes linear close arrangement of measurable points based on the traditional single-point spectrum confocal technology. The measurement speed and efficiency are increased exponentially. However, since the echoes generated by these closely-packed dispersion spectra during the measurement process are usually recorded by the same spectrometer or CCD, in order to accurately analyze the measurement values of these measurement points, the echo positions of each closely-packed spectrum must be calibrated in advance, otherwise it will be difficult to distinguish the respective echo positions, resulting in measurement deviation and affecting the measurement accuracy.
[0004] There are relatively few methods for calibrating the position of spectral confocal echoes that are currently available. They can be divided into two categories: (1) When the distortion of the imaging system is small, the echo position is calibrated directly using a straight line based on the number of close-packed images and the optical system parameters; (2) Using a distortion correction algorithm, the echo spectrum is first corrected and then calibrated using a method similar to that shown in (1).
[0005] Optical distortion of industrial lenses exists objectively, such as the most common barrel distortion, pincushion distortion and beard distortion. Generally, the smaller the focal length of the lens, the more serious the distortion. The method of calibrating the echo position with a straight line directly based on the number of close-packed lenses and optical system parameters ignores the optical distortion. In order to ensure the intensiveness of the spectral confocal system and avoid the measurement position being too far away from the system, short-focus lenses are inevitable. Obviously, the system distortion in this case cannot be ignored, so the method of using a straight line calibration is not advisable.
[0006] In the field of imaging, calibration plate calibration or line drawing calibration are often used to determine the optical distortion coefficient of the imaging system, and then the image is distorted. However, in the implementation of spectral confocal, the system only records the measured echo information and does not obtain images, so it is difficult to calibrate using these methods. The distortion parameters obtained by simulation methods do not take into account individual differences caused by manufacturing, installation, etc. Therefore, this distortion correction method is also inaccurate. Summary of the invention
[0007] The purpose of the present invention is to provide a method to solve the problems existing in the prior art.
[0008] To achieve the above object, the present invention provides a spectral confocal echo position calibration method, comprising the following steps:
[0009] S1 selects any column in the densely packed direction of the light source echo spectrum image as a target column, and plants a plurality of seed points on the target column, wherein the distance between two adjacent seed points is determined according to a first preset spacing;
[0010] S2 takes each of the seed points as a starting point, and extends and plants a plurality of extension points along a preset direction, wherein the preset direction is a direction perpendicular to the densely packed direction in the light source echo spectrum image, and determines the distance between two adjacent extension points according to a second preset spacing;
[0011] S3, correcting the positions of the seed point and the expansion point that are deviated according to the uniform distribution characteristics of the echo position connection line;
[0012] S4 records the corrected overall echo curve distribution as the calibration result.
[0013] Preferably, in step S1, the column where the center position of the light source echo spectrum image is located is selected as the target column;
[0014] Or, the column where the points with relatively large gray values in the light source echo spectrum image are located is selected as the target column.
[0015] Preferably, the size of the first preset spacing is determined according to the close-packed spacing and optical zoom factor parameters of the spectral confocal system;
[0016] Or, the spacing between adjacent bright lines in the light source echo spectrum image is obtained as the first preset spacing; wherein the bright line is a set of echo positions formed by dispersion of multiple measurement points along a preset direction.
[0017] Preferably, starting from the first seed point, other seed points are planted extending in both directions along the dense arrangement direction.
[0018] Preferably, bidirectionally extending and planting other seed points along the dense arrangement direction includes the following steps:
[0019] S121, taking the two ends of the line segment formed by the n seed points that have been planted as starting points, respectively, and determining two first-type pre-planting points of the n+1th seed point according to a first preset spacing, wherein n<the number of closely spaced measurement points N;
[0020] S122 obtains grayscale distribution characteristic values of two pre-planting points of the first type, and selects the pre-planting point with the larger grayscale distribution characteristic value as the final planting position of the n+1th seed point;
[0021] S123 repeats step S121 and step S122 until all seed points in the target column are planted.
[0022] Preferably, step S2 comprises the following steps:
[0023] S21 takes the planted seed point or extension point as the starting point, and extends a second preset distance along a preset direction to obtain a second type of pre-planting point to be planted in the next round of extension points;
[0024] S22 takes the second type of pre-planting point as the base point, and expands along the close-packed direction and the preset direction to form a judgment area R of C*K, wherein K is not greater than the first preset spacing setting, and C is not greater than the second preset spacing setting;
[0025] S23 obtains the pixel grayscale feature value of each row in the judgment area R, and selects the intersection of the row where the maximum pixel grayscale feature value is located and the column where the second type of pre-planting point is located as the final planting position of the current round of expansion points.
[0026] Preferably, step S3 comprises the following steps:
[0027] S31 obtains the intersection point P of each echo position line and the specified column n , the echo position connection line is a linear or approximately linear arc formed by the seed point and the corresponding plurality of expansion points;
[0028] S32 determines each intersection point P n Whether it meets the uniform distribution characteristics, if it meets the uniform distribution characteristics, it is retained; if it does not meet the uniform distribution characteristics, the intersection point P is determined. n The corresponding extension point position is wrong, according to the intersection point P n The adjacent intersection point P n-1 , P n+1 Get the intersection point P n The corresponding theoretical position and replace it.
[0029] Furthermore, in step S32, if the intersection point P n If the difference between the position where the intersection point P is located and the position where the standard value is located is greater than a preset threshold, then the intersection point P is determined to be n It does not conform to the uniform distribution characteristics, where the standard value is the intersection point P n The mean value of the coordinates of two adjacent extension points on the corresponding echo position line in the preset direction;
[0030] In the step S31, the designated columns are all the columns included in the light source echo spectrum image; or, the designated columns are obtained by sampling all the columns included in the light source echo spectrum image.
[0031] The present invention also discloses a spectral confocal echo position calibration device, comprising:
[0032] A seed point planting module, used to plant a plurality of seed points on any one column along the densely packed direction of the light source echo spectrum image as a target column, wherein the distance between two adjacent seed points is determined according to a first preset spacing;
[0033] An extension point planting module, used to take each of the seed points as a starting point, extend and plant multiple extension points along a preset direction, wherein the preset direction is a direction perpendicular to the densely packed direction in the light source echo spectrum image, and determine the distance between two adjacent extension points according to a second preset spacing;
[0034] A deviation correction module, used for correcting the positions of the seed points and the extension points that have deviations according to the uniform distribution characteristics of the echo position connection line;
[0035] The calibration acquisition module is used to record the corrected overall echo curve distribution as the calibration result.
[0036] Preferably, in the seed point planting module, the column where the center position of the light source echo spectrum image is located is selected as the target column;
[0037] Or, the column where the points with relatively large gray values in the light source echo spectrum image are located is selected as the target column.
[0038] Preferably, in the seed point planting module, the size of the first preset spacing is determined according to the close-packed spacing and optical zoom factor parameters of the spectral confocal system;
[0039] Or, the spacing between adjacent bright lines in the light source echo spectrum image is obtained as the first preset spacing; wherein the bright line is a set of echo positions formed by dispersion of multiple measurement points along a preset direction, and is expressed as a linear or arc-shaped bright line.
[0040] Preferably, in the seed point planting module, the first seed point is taken as a starting point, and other seed points are planted in bidirectional extension along the dense arrangement direction.
[0041] Preferably, the seed point planting module includes:
[0042] A first type pre-planting point acquisition submodule is used to determine two first type pre-planting points of the n+1th seed point according to a first preset spacing, with the two ends of the line segment formed by the n seed points that have been planted as starting points, wherein n<the number of closely spaced measurement points N;
[0043] The first final planting position determination submodule is used to obtain the grayscale distribution characteristic values of the two first-type pre-planting points, select the pre-planting point with the larger grayscale distribution characteristic value as the final planting position of the n+1th seed point; and re-call the first-type pre-planting point acquisition submodule until all the seed points in the target column are planted.
[0044] Preferably, the extension point planting module includes:
[0045] The second type of pre-planting point acquisition submodule is used to take the planted seed point / extension point as the starting point and extend the second preset distance along the preset direction to acquire the second type of pre-planting point of the next round of extension points to be planted;
[0046] A judgment area acquisition submodule is used to take the second type of pre-planting points as a base point, and expand them along the close-packed direction and the preset direction to form a judgment area R of C*K, wherein K is not greater than the first preset spacing setting, and C is not greater than the second preset spacing setting;
[0047] The second final planting position determination submodule is used to obtain the pixel grayscale feature value of each row in the judgment area R, and take the intersection of the row where the maximum pixel grayscale feature value is located and the column where the second type of pre-planting point is located as the final planting position of this round of expansion points.
[0048] Preferably, the deviation correction module includes
[0049] The intersection point acquisition submodule is used to obtain the intersection point P of each echo position line and the specified column n , the echo position connection line is a linear or approximately linear arc formed by the seed point and the corresponding plurality of expansion points;
[0050] The correction submodule is used to determine each intersection point P n Whether it meets the uniform distribution characteristics, if it meets the uniform distribution characteristics, it is retained; if it does not meet the uniform distribution characteristics, the intersection point P is determined. n The corresponding extension point position is wrong, according to the intersection point P n The adjacent intersection point P n-1 , P n+1 Get the intersection point P n The corresponding theoretical position and replace it.
[0051] Furthermore, in the correction submodule, if the intersection point P n If the difference between the position where the intersection point P is located and the position where the standard value is located is greater than a preset threshold, then the intersection point P is determined to be n It does not conform to the uniform distribution characteristics, where the standard value is the intersection point P n The mean value of the coordinates of two adjacent extension points on the corresponding echo position line in the preset direction;
[0052] Furthermore, in the intersection acquisition submodule, the designated columns are all the columns included in the light source echo spectrum image; or the designated columns are obtained by sampling all the columns included in the light source echo spectrum image.
[0053] The present application also discloses a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the above methods when executing the computer program.
[0054] The present application also discloses a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods are implemented.
[0055] To achieve the above-mentioned purpose, the present invention provides a spectral confocal echo position calibration method, device, storage medium and computer equipment to calibrate the spectral confocal echo position while fully considering the existence of distortion. It does not correct the distortion, but uses a curve method for calibration to establish the corresponding relationship between the echo positions of these closely spaced position points after distortion. For a certain spectral confocal system, its distortion is certain, and the corresponding relationship between the echo positions of these closely spaced position points after distortion is certain, which fully guarantees the individual distortion difference of the system, omits the distortion correction steps in the calibration and actual measurement process, saves the time cost of measurement, and has high engineering practicability.
[0056] Specifically, the present invention shows a spectral confocal echo position calibration method, which first determines a row of seed points in the densely packed direction of the light source echo spectrum image, and expands the seed points in the direction perpendicular to the densely packed direction, i.e., the expanded points, so as to determine the set of all possible echo positions of the measurement points corresponding to the seed points and the expanded points (the positions of all points in the set are connected in sequence, generally as a curve), i.e., determines the preliminary echo positions of all measurement points, and then based on the distribution characteristics of the echo position connection lines and utilizing their uniform distribution characteristics, corrects the positions that may be calibrated incorrectly, and finally obtains data characterizing the spectral dispersion imaging position of the echo light of the spectral confocal system, i.e., the distribution of the overall echo curve, wherein the overall echo curve is a two-dimensional vector, wherein the size of the first dimension is equal to the number of densely packed measurement points of the spectral confocal system, and the second dimension is a number of points representing the image coordinate positions (rows, columns), and the curvature of the overall echo curve characterizes the degree of distortion of the spectral confocal system in the densely packed direction. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 A schematic diagram of the working process of a spectral confocal echo position calibration method of the present invention;
[0058] Figure 2(a) and Figure 2(b) are schematic diagrams of light source echo spectrum images in different image directions;
[0059] Figure 3 A schematic diagram for determining the target column;
[0060] Figure 4 This is a schematic diagram of the planting workflow for seed points;
[0061] Figure 5 It is a planting diagram of the extension point;
[0062] Figure 6 Schematic diagram of echo position connection;
[0063] Figure 7 Seed point / extension point correction diagram;
[0064] Figure 8 It is a structural block diagram of an embodiment of a spectral confocal echo position calibration device of the present invention;
[0065] Fig. 9 The hardware architecture of one embodiment of the computer device of the present application. DETAILED DESCRIPTION
[0066] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not intended to limit the scope of protection of the present invention in any way.
[0067] Throughout the specification, the same reference numerals refer to the same elements. The expression "and / or" includes any and all combinations of one or more of the associated listed items. In the drawings, the thickness, size and shape of the objects have been slightly exaggerated for ease of explanation. The drawings are only examples and are not drawn strictly to scale.
[0068] It should also be understood that the terms “comprises,” “including,” “having,” “includes,” and / or “comprising,” when used in this specification, indicate the presence of stated features, steps, integers, operations, elements, and / or parts, but do not exclude the presence or addition of one or more other features, steps, integers, operations, elements, parts, and / or combinations thereof.
[0069] As used in the specification, the terms "substantially," "approximately," and the like are intended to serve as terms of approximation rather than terms of degree, and are intended to account for the inherent deviations in measurements or calculations that would be recognized by those of ordinary skill in the art.
[0070] Unless otherwise defined, all terms (including technical terms and scientific terms) used in this article have the same meaning as commonly understood by ordinary technicians in the field to which this application belongs. It should also be understood that terms (such as terms defined in commonly used dictionaries) should be interpreted as having the same meaning as their meaning in the context of the relevant technology, and will not be interpreted in an idealized or overly formal sense unless explicitly defined in this article.
[0071] It should be noted that, in the absence of conflict, the embodiments of the present application and the features therein may be combined with each other.
[0072] like Figure 1 As shown, the present invention discloses a spectral confocal echo position calibration method, comprising the following steps:
[0073] S1 selects any column in the densely packed direction of the light source echo spectrum image as a target column, and plants a plurality of seed points on the target column, wherein the distance between two adjacent seed points is determined according to a first preset spacing;
[0074] S2 takes each of the seed points as a starting point, and extends and plants a plurality of extension points along a preset direction, wherein the preset direction is a direction perpendicular to the densely packed direction in the light source echo spectrum image, and determines the distance between two adjacent extension points according to a second preset spacing;
[0075] S3 correcting the positions of the seed point and the extension point that are deviated according to the uniform distribution characteristics of the echo position connection line, wherein the echo position connection line is a linear or approximately linear arc formed by the seed point and the corresponding plurality of extension points;
[0076] S4 records the corrected overall echo curve distribution as the calibration result.
[0077] The present invention shows a spectral confocal echo position calibration method, which calibrates the spectral confocal echo position while fully considering the existence of distortion. The method does not correct the distortion, but uses a curve method to calibrate to establish the corresponding relationship between the echo positions of these closely spaced position points after distortion. For a certain spectral confocal system, its distortion is certain, and the corresponding relationship between the echo positions of these closely spaced position points after distortion is certain, which fully guarantees the individual distortion difference of the system, omits the distortion correction steps in the calibration and actual measurement process, saves the time cost of measurement, and has high engineering practicability.
[0078] Specifically, the present invention shows a spectral confocal echo position calibration method, which first determines a row of seed points in the densely packed direction of the light source echo spectrum image, and expands the seed points in the direction perpendicular to the densely packed direction, i.e., the expanded points, so as to determine the set of all possible echo positions of the measurement points corresponding to the seed points and the expanded points (the positions of all points in the set are connected in sequence, generally as a curve), i.e., determines the preliminary echo positions of all measurement points, and then based on the distribution characteristics of the echo position connection lines and utilizing their uniform distribution characteristics, corrects the positions that may be calibrated incorrectly, and finally obtains data characterizing the spectral dispersion imaging position of the echo light of the spectral confocal system, i.e., the distribution of the overall echo curve, wherein the overall echo curve is a two-dimensional vector, wherein the size of the first dimension is equal to the number of densely packed measurement points of the spectral confocal system, and the second dimension is a number of points representing the image coordinate positions (rows, columns), and the curvature of the overall echo curve characterizes the degree of distortion of the spectral confocal system in the densely packed direction.
[0079] FIG. 2(a) and FIG. 2(b) show examples of light source echo spectrum images in different image directions. The actual light source echo spectrum image includes but is not limited to these two forms, but the calibration method is similar. The following will take FIG. 2(a) as an example to explain the specific calibration process of a spectral confocal echo position calibration method shown in the present invention.
[0080] S1 selects any column in the densely packed direction of the light source echo spectrum image as a target column, and plants a plurality of seed points on the target column, wherein the distance between two adjacent seed points is determined according to a first preset spacing;
[0081] To determine the seed point planting position in the densely packed direction is to determine the approximate distribution area of the seed points. In step S1, firstly, a plurality of seed points are planted in any column position in the densely packed direction. In this embodiment, Figure 4 As shown by the vertical line in , the column where the center position of the light source echo spectrum image is located can be selected as the target column; or the column where the point with relatively large gray value in the light source echo spectrum image is located can be selected as the target column. After the target column is determined, the first seed point can be determined according to the gray distribution of the target column position, and then other seed points can be planted in both directions along the densely packed direction with the first seed point as the starting point.
[0082] In this embodiment, the grayscale maximum position in the target column, or any peak position of the grayscale distribution waveform signal in the target column can be selected as the planting position of the first seed point, and then the first seed point is used as the starting point to plant other seed points in a bidirectional manner along the close-packed direction. When planting the next seed point, the size of the first preset spacing can be determined according to the close-packed spacing and optical zoom factor parameters of the spectral confocal system; or the spacing between adjacent bright lines in the light source echo spectrum image is obtained as the first preset spacing; the bright line is a collection of echo positions formed by the dispersion of multiple measurement points along a preset direction, which is expressed as a linear or arc-shaped bright line.
[0083] The purpose of seed point planting is to quickly obtain a specific position point of the echo position of each measurement point. Since the number of densely packed measurement points (i.e., the number of bright lines on the light source spectrum) is determined by the design, and the spacing between lines can be determined by the densely packed spacing of measurement points on the system hardware, the zoom ratio of the optical system, etc. Therefore, it is only necessary to accurately find a certain echo position point (the first seed point) of a measurement position point on the light source spectrum, that is, a certain position point on a certain line on the light source spectrum, and then plant along the densely packed direction according to the spacing between lines.
[0084] In this embodiment, as a preferred solution, in step S1, the position of the first seed point is first determined and planted, and then the first seed point is used as the starting point to extend and plant other seed points along the densely packed direction, which specifically includes the following steps:
[0085] S11 selects any column position from the densely packed direction as a target column, and selects any point from the intersection of the target column and the bright line to plant the first seed point.
[0086] In this embodiment, Figure 3 As shown, the position at the center of the light source echo spectrum image or the position with relatively large grayscale can be selected as the seed point distribution position, that is, the target column. After the target column is determined, a point is selected from the target column as the position of the first seed point. In this embodiment, the position of the first seed point can be determined according to the grayscale distribution of the target column. For example, the position of the maximum grayscale in the target column or any peak position of the grayscale distribution waveform signal in the target column can be selected as the first seed point position.
[0087] S12 takes the first seed point as a starting point and extends in both directions along the close-packed direction to plant other seed points.
[0088] As mentioned above, the process of planting other seed points can determine the size of the first preset distance according to the position between the above-mentioned bright lines, and can also determine the size of the first preset distance according to the close-packed spacing and optical zoom magnification parameters of the spectral confocal system. In this embodiment, the steps of planting other seed points extending bidirectionally along the close-packed direction are described by determining the size of the first preset distance according to the position between the bright lines:
[0089] S121, taking the two ends of the line segment formed by the n seed points that have been planted as starting points, respectively, and determining two first-type pre-planting points of the n+1th seed point according to a first preset spacing, wherein n<the number of closely spaced measurement points N;
[0090] S122 obtains grayscale distribution characteristic values of two pre-planting points of the first type, and selects the pre-planting point with the larger grayscale distribution characteristic value as the final planting position of the n+1th seed point;
[0091] S123 repeats step S121 and step S122 until all seed points in the target column are planted.
[0092] In the process of planting seed points, assuming that n seed points have been planted (n<the number of closely spaced measurement points N), when planting the n+1 seed point, only one direction in the closely spaced direction can be selected for planting, that is, it is necessary to determine the specific direction to expand. In this embodiment, firstly, both ends of the planted n seed points are used as pre-planting points, and then according to the grayscale distribution around the two pre-planting points, the pre-planting point with a larger grayscale distribution characteristic value is selected as the final planting position of the n+1 seed point.
[0093] Since there may be errors between the calculated spacing between bright lines and the spacing between bright lines on the actual light source echo spectrum image, during the planting process, the planting positions of the two pre-planting points can be determined based on the calculated spacing between bright lines, and then the two pre-planting points can be used as anchor points, and the average grayscale or grayscale sum of the matrix of M*M pixels (1≤M<spacing between bright lines) around the pre-planting points is used as the eigenvalue, and the pre-planting point with the larger eigenvalue is selected as the final planting position of the n+1th seed point.
[0094] Repeat the above steps until all seed points are planted and proceed to step S2 to plant multiple extension points along a direction perpendicular to the densely packed direction, taking each seed point as a starting point.
[0095] Due to the existence of distortion, there is a deviation between the theoretical echo distribution position and the actual echo distribution position. In order to take the deviation into account, as a preferred solution, in this embodiment, step S2 may specifically include the following steps:
[0096] S21 takes the planted seed point / extension point as the starting point, and extends a second preset distance along a preset direction to obtain a second type of pre-planting point for the next round of extension points to be planted;
[0097] S22 takes the second type of pre-planting point as the base point, and expands along the close-packed direction and the preset direction to form a judgment area R of C*K, wherein K is not greater than the first preset spacing setting, and C is not greater than the second preset spacing setting;
[0098] In this embodiment, after all seed points or the expansion points of this round are planted, the planted seed points / extension points are used as the starting point, and W pixel spacing (i.e., the second preset distance) is skipped along the preset direction to serve as the second type of pre-planted points for the next round of expansion points to be planted. The value of the second preset spacing can be determined according to the curvature of the echo position connection line and the accuracy requirement of image fusion. The greater the curvature or the higher the image fusion accuracy requirement, the smaller the value of the second preset spacing, and the minimum value can be 1 pixel.
[0099] S23 obtains the pixel grayscale feature value of each row in the judgment area R, and takes the intersection of the row where the maximum pixel grayscale feature value is located and the column where the second type of pre-planting point is located as the final planting position of the current round of expansion points.
[0100] like Figure 5 As shown, in step S2, in order to determine the final expansion point position, firstly, the planted seed point / expansion point is extended by the second preset interval to obtain a second type of pre-planted point, and then the second type of pre-planted point is extended on both sides to form a C*K judgment area R; in the judgment area R, the sum or average value of the pixel grayscale of each row along the expansion direction is used as the eigenvalue of the row to form a 1*K pixel matrix area M. Each pixel in the area M is a possible expansion point position. In this embodiment, the pixel point position corresponding to the row with the largest eigenvalue in the area M is selected as the final expansion point position.
[0101] Due to the existence of distortion, the new extension point may not be on the same straight line as the determined extension point. Finally, connect this seed point and all the extension points extended from this seed point as the echo position of the corresponding measurement point, such as Figure 6 As shown, the line connecting the seed point and all the extension points extended from the seed point is generally a curve.
[0102] S3 corrects the deviation of the expansion point position according to the uniform distribution characteristics of the echo position connection line;
[0103] Due to possible uncertainty issues in the system, such as dust, optical blur, etc., it may be impossible to accurately determine the echo position of the light source echo spectrum image through grayscale at some locations, resulting in deviations in the connection lines between the extension points.
[0104] In this embodiment, the deviation is corrected based on the uniform distribution characteristics of all echo position lines. Figure 7 As shown, for the extension points included in any specified column, deviation judgment and correction can be performed according to the following steps.
[0105] S31 obtains the intersection point P of each echo position line and the specified column n , the echo position connection line is a linear or approximately linear arc formed by the seed point and the corresponding plurality of expansion points;
[0106] The designated columns are all the columns included in the light source echo spectrum image; or the designated columns are obtained by sampling all the columns included in the light source echo spectrum image. That is, you can choose to traverse all the columns, or you can sample from all the columns to obtain the planting points with deviations. If the designated columns are obtained by sampling, you can extract several columns from the image as designated columns according to the equal spacing rule or other sampling methods that can cover the entire image area.
[0107] S32 determines each intersection point P n Whether it meets the uniform distribution characteristics, if it meets the uniform distribution characteristics, it is retained; if it does not meet the uniform distribution characteristics, the intersection point P is determined. n The corresponding extension point position is wrong, according to the intersection point P n The adjacent intersection point P n-1 , P n+1 Get the intersection point P n The corresponding theoretical position and replace it.
[0108] In step S32, a threshold is set. If the intersection point P n If the difference between the position where the intersection point P is located and the position where the standard value is located is greater than a preset threshold, then the intersection point P is determined to be n It does not conform to the uniform distribution characteristic, wherein the standard value is the mean value of the coordinates of two adjacent expansion points on the echo position line corresponding to the intersection point P in the direction perpendicular to the densely packed direction (row direction or column direction).
[0109] Generally, if the measurement points are evenly spaced in the hardware positions, the spacing between two adjacent intersections should be equal or approximately equal. If the measurement points are non-evenly spaced in the hardware positions, the spacing between two adjacent intersections divided by the corresponding hardware spacing is also equal or approximately equal. Assume that the intersection point P n If the position is wrong, the difference between it and the two adjacent position points will be large. If it exceeds the preset threshold, the intersection point P can be determined based on this. n The position calibration is wrong, and then P is inferred from the positions of its two adjacent points. n to the correct position of the sensor, thereby correcting the calibration result.
[0110] Continue with Figure 7Take the example of traversing the intersection of the echo position line formed by each measurement point extension and the specified column (i.e., the vertical dotted line), and record the intersection point P n-2 ,P n-1 ,P n ,P n+1 ,P n+2 Under normal circumstances, the row IDs of these intersections are distributed approximately equally spaced. n If the position is wrong, the difference between it and the two adjacent position points will be large, that is, if the difference between a certain intersection point ID and the calculated value of the equal spacing rule is greater than the threshold, the position is considered to be wrong. Delete the two extension points adjacent to the intersection point ID on the corresponding echo position line, and insert the calculated value into the extension point as the correct position after correction.
[0111] S4 records the corrected overall echo curve distribution as the calibration result.
[0112] The overall echo curve is a two-dimensional vector, in which the first dimension is equal to the number of densely packed measurement points of the spectral confocal system, and the second dimension is a number of points representing the image coordinate positions (rows, columns). The curvature of the overall echo curve characterizes the degree of distortion of the spectral confocal system in the densely packed direction.
[0113] Embodiment 2
[0114] like Figure 8 As shown, the present invention also discloses a spectral confocal echo position calibration device 10, comprising:
[0115] A seed point planting module 11 is used to plant a plurality of seed points on any column along the densely packed direction of the light source echo spectrum image as a target column, wherein the distance between two adjacent seed points is determined according to a first preset spacing;
[0116] An extension point planting module 12 is used to take each of the seed points as a starting point and extend and plant multiple extension points along a preset direction, wherein the preset direction is a direction perpendicular to the densely packed direction in the light source echo spectrum image, and the distance between two adjacent extension points is determined according to a second preset spacing;
[0117] The deviation correction module 13 is used to correct the positions of the seed points and the extension points that have deviations according to the uniform distribution characteristics of the echo position connection line;
[0118] The calibration acquisition module 14 is used to record the corrected overall echo curve distribution as a calibration result.
[0119] Preferably, in the seed point planting module 11, the column where the center position of the light source echo spectrum image is located is selected as the target column; or, the column where the points with relatively large grayscale values in the light source echo spectrum image are located is selected as the target column.
[0120] Preferably, in the seed point planting module 11, the size of the first preset spacing is determined according to the close-packed spacing and optical zoom factor parameters of the spectral confocal system; or, the spacing between adjacent bright lines in the light source echo spectral image is obtained as the first preset spacing; wherein the bright line is a collection of echo positions formed by the dispersion of multiple measurement points along a preset direction, and appears as a linear or arc-shaped bright line.
[0121] Preferably, in the seed point planting module 11, the first seed point is taken as a starting point, and other seed points are planted bidirectionally extending along the dense arrangement direction.
[0122] Preferably, the seed point planting module 11 includes:
[0123] A first type pre-planting point acquisition submodule is used to determine two first type pre-planting points of the n+1th seed point according to a first preset spacing, with the two ends of the line segment formed by the n seed points that have been planted as starting points, wherein n<the number of closely spaced measurement points N;
[0124] The first final planting position determination submodule is used to obtain the grayscale distribution characteristic values of the two first-type pre-planting points, select the pre-planting point with the larger grayscale distribution characteristic value as the final planting position of the n+1th seed point; and re-call the first-type pre-planting point acquisition submodule until all the seed points in the target column are planted.
[0125] Preferably, the extension point planting module 12 includes:
[0126] The second type of pre-planting point acquisition submodule is used to take the planted seed point / extension point as the starting point and extend the second preset distance along the preset direction to acquire the second type of pre-planting point of the next round of extension points to be planted;
[0127] A judgment area acquisition submodule is used to take the second type of pre-planting points as a base point, and expand them along the close-packed direction and the preset direction to form a judgment area R of C*K, wherein K is not greater than the first preset spacing setting, and C is not greater than the second preset spacing setting;
[0128] The second final planting position determination submodule is used to obtain the pixel grayscale feature value of each row in the judgment area R, and take the intersection of the row where the maximum pixel grayscale feature value is located and the column where the second type of pre-planting point is located as the final planting position of this round of expansion points.
[0129] Preferably, the deviation correction module 13 includes
[0130] The intersection point acquisition submodule is used to obtain the intersection point P of each echo position line and the specified column n , the echo position connection line is a linear or approximately linear arc formed by the seed point and the corresponding plurality of expansion points;
[0131] The correction submodule is used to determine each intersection point P n Whether it meets the uniform distribution characteristics, if it meets the uniform distribution characteristics, it is retained; if it does not meet the uniform distribution characteristics, the intersection point P is determined. n The corresponding extension point position is wrong, according to the intersection point P n The adjacent intersection point P n-1 , P n+1 Get the intersection point P n The corresponding theoretical position and replace it.
[0132] Furthermore, in the correction submodule, if the intersection point P n If the difference between the position where the intersection point P is located and the position where the standard value is located is greater than a preset threshold, then the intersection point P is determined to be n It does not conform to the uniform distribution characteristics, where the standard value is the intersection point P n The mean value of the coordinates of two adjacent extension points on the corresponding echo position line in the preset direction;
[0133] Furthermore, in the intersection acquisition submodule, the designated columns are all the columns included in the light source echo spectrum image; or the designated columns are obtained by sampling all the columns included in the light source echo spectrum image.
[0134] Embodiment 3
[0135] Fig. 9 The figure is a schematic diagram of the structure of a computer device provided by an embodiment of the present invention, such as a smart phone, tablet computer, laptop computer, desktop computer, rack server, blade server, tower server or cabinet server (including an independent server, or a server cluster composed of multiple servers) that can execute programs. The computer device 20 of this embodiment includes at least but is not limited to: a memory 21 and a processor 22 that can communicate with each other via a system bus, such as Fig. 9 It should be pointed out that Fig. 9 Only computer device 20 is shown with components 21 - 22 , but it should be understood that implementing all of the components shown is not a requirement, and more or fewer components may alternatively be implemented.
[0136] In this embodiment, the memory 21 (i.e., readable storage medium) includes flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), and the memory 21 can also be an external storage device of the computer device 20, such as a plug-in hard disk equipped on the computer device 20, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the memory 21 can also include both the internal storage unit of the computer device 20 and its external storage device. In this embodiment, the memory 21 is generally used to store the operating system and various application software installed on the computer device 20, such as the program code of the spectral confocal echo position calibration method of the method embodiment. In addition, the memory 21 can also be used to temporarily store various types of data that have been output or are to be output.
[0137] The processor 22 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 22 is generally used to control the overall operation of the computer device 20. In this embodiment, the processor 22 is used to run the program code stored in the memory 21 or process data, such as running the spectral confocal echo position calibration device 10 to implement the spectral confocal echo position calibration method in the method embodiment.
[0138] Embodiment 4
[0139] The present application also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a disk, an optical disk, a server, an App application store, etc., on which a computer program is stored, and the program realizes corresponding functions when executed by a processor. The computer-readable storage medium of this embodiment is used to store the program code of the spectral confocal echo position calibration device, and when executed by the processor, the spectral confocal echo position calibration method in the method embodiment is realized.
[0140] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0141] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A spectral confocal echo position calibration method, characterized in that: The steps include: S1 selects any column in the densely packed direction of the light source echo spectrum image as a target column, and plants a plurality of seed points on the target column, wherein the distance between two adjacent seed points is determined according to a first preset spacing; S2 takes each of the seed points as a starting point, and extends and plants a plurality of extension points along a preset direction, wherein the preset direction is a direction perpendicular to the densely packed direction in the light source echo spectrum image, and determines the distance between two adjacent extension points according to a second preset spacing; S3, correcting the positions of the seed point and the expansion point that are deviated according to the uniform distribution characteristics of the echo position connection line; S4 records the corrected overall echo curve distribution as the calibration result.
2. A spectral confocal echo position calibration method according to claim 1, characterized in that: In the step S1, the column where the center position of the light source echo spectrum image is located is selected as the target column; Or, the column where the points with relatively large gray values in the light source echo spectrum image are located is selected as the target column.
3. A spectral confocal echo position calibration method according to claim 1, characterized in that: In the step S1, the size of the first preset spacing is determined according to the close-packed spacing and optical zoom factor parameters of the spectral confocal system; Or, the spacing between adjacent bright lines in the light source echo spectrum image is obtained as the first preset spacing; wherein the bright line is a set of echo positions formed by dispersion of multiple measurement points along a preset direction.
4. The spectral confocal echo position calibration method according to claim 1, characterized in that: In the step S1, the first seed point is taken as a starting point, and other seed points are planted bidirectionally along the close-packing direction.
5. A spectral confocal echo position calibration method according to claim 4, characterized in that: Extending in both directions along the densely packed direction to plant other seed points includes the following steps: S121, taking the two ends of the line segment formed by the n seed points that have been planted as starting points, respectively, and determining two first-type pre-planting points of the n+1th seed point according to a first preset spacing, wherein n<the number of closely spaced measurement points N; S122 obtains grayscale distribution characteristic values of two pre-planting points of the first type, and selects the pre-planting point with the larger grayscale distribution characteristic value as the final planting position of the n+1th seed point; S123 repeats step S121 and step S122 until all seed points in the target column are planted.
6. A spectral confocal echo position calibration method according to claim 1, characterized in that: The step S2 comprises the following steps: S21 takes the planted seed point or extension point as the starting point, and extends a second preset distance along a preset direction to obtain a second type of pre-planting point to be planted in the next round of extension points; S22 takes the second type of pre-planting point as the base point, and expands along the close-packed direction and the preset direction to form a judgment area R of C*K, wherein K is not greater than the first preset spacing setting, and C is not greater than the second preset spacing setting; S23 obtains the pixel grayscale feature value of each row in the judgment area R, and selects the intersection of the row where the maximum pixel grayscale feature value is located and the column where the second type of pre-planting point is located as the final planting position of the current round of expansion points.
7. The spectral confocal echo position calibration method according to claim 1, characterized in that: The step S3 comprises the following steps: S31 obtains the intersection point P of each echo position line and the specified column n , the echo position connection line is a linear or approximately linear arc formed by the seed point and the corresponding plurality of expansion points; S32 determines each intersection point P n Whether it meets the uniform distribution characteristics, if it meets the uniform distribution characteristics, it is retained; if it does not meet the uniform distribution characteristics, the intersection point P is determined. n The corresponding extension point position is wrong, according to the intersection point P n The adjacent intersection point P n-1 , P n+1 Get the intersection point P n The corresponding theoretical position and replace it.
8. A spectral confocal echo position calibration method according to claim 7, characterized in that: In step S32, if the intersection point P n If the difference between the position where the intersection point P is located and the position where the standard value is located is greater than a preset threshold, then the intersection point P is determined to be n It does not conform to the uniform distribution characteristics, where the standard value is the intersection point P n The mean value of the coordinates of two adjacent extension points on the corresponding echo position line in the preset direction; In the step S31, the designated columns are all the columns included in the light source echo spectrum image; or, the designated columns are obtained by sampling all the columns included in the light source echo spectrum image.
9. A spectral confocal echo position calibration device, characterized in that ,include: A seed point planting module, used to plant a plurality of seed points on any one column along the densely packed direction of the light source echo spectrum image as a target column, wherein the distance between two adjacent seed points is determined according to a first preset spacing; An extension point planting module, used to take each of the seed points as a starting point, extend and plant multiple extension points along a preset direction, wherein the preset direction is a direction perpendicular to the densely packed direction in the light source echo spectrum image, and determine the distance between two adjacent extension points according to a second preset spacing; A deviation correction module, used for correcting the positions of the seed points and the extension points that have deviations according to the uniform distribution characteristics of the echo position connection line; The calibration acquisition module is used to record the corrected overall echo curve distribution as the calibration result.
10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 8 when executing the computer program.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Multi-longitudinal-mode high-spectral-resolution lidar based on interference spectrum frequency detector
CN106019312A
Fresnel zone plate spectrum confocal measurement method
CN109059762A