CN116989664A - Spectral peak value calculation method and system based on spectral confocal displacement sensor - Google Patents

Spectral peak value calculation method and system based on spectral confocal displacement sensor Download PDF

Info

Publication number
CN116989664A
CN116989664A CN202311255346.1A CN202311255346A CN116989664A CN 116989664 A CN116989664 A CN 116989664A CN 202311255346 A CN202311255346 A CN 202311255346A CN 116989664 A CN116989664 A CN 116989664A
Authority
CN
China
Prior art keywords
peak
spectral
curve
displacement sensor
spectrum
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202311255346.1A
Other languages
Chinese (zh)
Other versions
CN116989664B (en
Inventor
吴征宇
陈宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Slate Intelligent Technology Shenzhen Co ltd
Original Assignee
Slate Intelligent Technology Shenzhen Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Slate Intelligent Technology Shenzhen Co ltd filed Critical Slate Intelligent Technology Shenzhen Co ltd
Priority to CN202311255346.1A priority Critical patent/CN116989664B/en
Publication of CN116989664A publication Critical patent/CN116989664A/en
Application granted granted Critical
Publication of CN116989664B publication Critical patent/CN116989664B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B9/00Measuring instruments characterised by the use of optical techniques
    • G01B9/02Interferometers
    • G01B9/02041Interferometers characterised by particular imaging or detection techniques
    • G01B9/02042Confocal imaging
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/02Measuring arrangements characterised by the use of optical techniques for measuring length, width or thickness
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration using local operators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

The application relates to a spectral peak value calculation method and a system based on a spectral confocal displacement sensor, wherein the method comprises the following steps: preprocessing a dispersion image data matrix acquired by a spectral confocal displacement sensor to obtain a target gray peak curve meeting preset requirements; carrying out mean value filtering treatment and spectral peak trend fitting treatment on the target gray peak curve; performing spectrum peak rough positioning treatment on a target gray peak curve fitted with spectrum peak trend based on a first-order gradient method to determine position coordinates of spectrum peak candidate points; determining an effective spectrum data segment on the target gray peak curve according to the position coordinates of the spectrum peak candidate points; and calculating the spectral peak value of the spectral confocal displacement sensor through the effective spectral data segment. The application processes the dispersion image data matrix acquired by the optical confocal displacement sensor in various modes, eliminates the influence of the environment, determines the effective data segment of the spectrum and realizes the accurate calculation of the peak value of the spectrum peak.

Description

Spectral peak value calculation method and system based on spectral confocal displacement sensor
Technical Field
The application relates to the technical field of structure measurement, in particular to a spectral peak value calculation method and a detection system based on a spectral confocal displacement sensor.
Background
The spectral confocal displacement sensor is a photoelectric sensor with ultra-high precision and ultra-high stability, and has wide application in the fields of micro displacement, micro deformation, surface morphology detection and the like.
According to the principle of spectral dispersion, light can form a series of continuously distributed focusing light spots with different spectral peaks and peaks on an optical axis after passing through a dispersion objective lens, the spectral peaks and the focusing distances have a one-to-one quantitative mapping relation, and the corresponding focusing distances can be obtained after the spectral peaks and the peaks are obtained by decoding the mapping relation.
However, in the actual production process, due to different factors such as measurement environment, reflectivity of the surface of the measured object, roughness and the like, the spectrum information is complex and changeable, and the traditional mode of decoding the spectrum information by using a centroid method cannot obtain a high-precision result in spectrum peak positioning, so that the spectrum peak and peak measurement precision of the sensor is affected.
Disclosure of Invention
In view of the above, it is necessary to provide a spectral peak value calculation method and a detection system based on a spectral confocal displacement sensor, so as to solve the problem that in the prior art, because of different factors such as measurement environment, reflectivity, roughness and the like of the surface of a measured object, the spectral information is complex and changeable, and the result of high precision is difficult to obtain in the positioning of the spectral peak, thereby influencing the measurement precision of the spectral peak value of the sensor.
In order to achieve the technical purpose, the application adopts the following technical scheme:
in a first aspect, the present application provides a spectral peak-to-peak value calculation method based on a spectral confocal displacement sensor, including:
preprocessing a dispersion image data matrix acquired by a spectral confocal displacement sensor to obtain a target gray peak curve meeting preset requirements;
carrying out mean value filtering treatment and spectral peak trend fitting treatment on the target gray peak curve;
performing spectrum peak rough positioning treatment on a target gray peak curve fitted with spectrum peak trend based on a first-order gradient method to determine position coordinates of spectrum peak candidate points;
determining an effective spectrum data segment on a target gray peak curve according to the position coordinates of spectrum peak candidate points;
and calculating the spectral peak value of the spectral confocal displacement sensor through the effective spectral data segment.
In some possible implementations, preprocessing a dispersion image data matrix acquired by an optical confocal displacement sensor to obtain a target gray peak curve meeting preset requirements, including:
denoising the dispersion image data matrix acquired by the spectral confocal displacement sensor;
determining an effective data column according to the column gray value difference threshold and the column gray value of the denoised dispersion image data matrix;
performing Gaussian fitting on the effective data columns to obtain effective data points;
performing least square fitting according to the effective data points to obtain an effective peak value curve;
and screening out a target gray peak curve meeting preset requirements from the effective peak curve based on the dispersion image data matrix.
In some possible implementations, the mean value filtering process and the spectral peak trend fitting process are performed on the target gray peak curve, including:
calculating a first-order gradient curve of the target gray peak value curve after mean value filtering;
based on a preset positioning principle, positioning a starting pixel point of a flat point data segment according to a gradient curve of a target gray peak value curve after mean value filtering;
and carrying out trend fitting on the flat point data segment according to the initial pixel point.
In some possible implementations, the first positioning principle and the second positioning principle are included based on a preset positioning principle; based on a preset positioning principle, positioning a start pixel point of a flat point data segment according to a gradient curve, wherein the method comprises the following steps:
according to a first positioning principle, when the first-order gradient value of the pixel points in the target gray peak value curve is zero and the first-order gradient values of the continuous preset number of pixel points before the current pixel point are all larger than zero, the current pixel point is the starting pixel point;
according to the second positioning principle, when the first-order gradient value of the pixel point in the target gray peak value curve is zero, the gray value of the current pixel point is equal to the gray value of the next adjacent pixel point and is smaller than the gray value of the previous adjacent pixel point, the current pixel point is the starting pixel point.
In some possible implementations, based on a first-order gradient method, performing a spectrum peak coarse positioning process on a target gray peak curve after the spectrum peak trend fitting to determine position coordinates of spectrum peak candidate points, including:
calculating a first-order gradient curve of a target gray peak curve after spectral peak trend fitting;
and carrying out spectrum peak rough positioning on a gradient curve of the target gray peak curve after spectrum peak trend fitting based on a preset rough positioning rule, and determining the position coordinates of spectrum peak candidate points.
In some possible implementations, determining the valid spectral data segment on the target gray peak curve according to the position coordinates of the spectral peak candidate points includes:
determining data segment interval parameters according to the position coordinates of the spectrum peak candidate points and the target gray peak curve;
and determining an effective spectrum data segment by taking the spectrum peak candidate point as a center and taking the data segment interval parameter.
In some possible implementations, calculating the spectral peak-to-peak value of the spectral confocal displacement sensor from the effective spectral data segment includes:
carrying out Gaussian fitting on the effective spectrum data segment to obtain Gaussian fitting results;
and calculating the spectral peak value of the spectral confocal displacement sensor according to the Gaussian fitting result and a preset calculation formula.
In a second aspect, the present application also provides a spectral peak-to-peak value calculation system based on a spectral confocal displacement sensor, including:
the preprocessing module is used for preprocessing the dispersion image data matrix acquired by the optical confocal displacement sensor to obtain a target gray peak curve meeting the preset requirement;
the trend fitting module is used for carrying out mean value filtering treatment and spectral peak trend fitting treatment on the target gray peak curve;
the coarse positioning module is used for performing spectrum peak coarse positioning processing on the target gray peak curve after spectrum peak trend fitting based on a first-order gradient method to determine the position coordinates of spectrum peak candidate points;
the data segment module is used for determining an effective spectrum data segment on the target gray peak curve according to the position coordinates of the spectrum peak candidate points;
and the peak value calculation module is used for positioning the spectral peak value of the spectral confocal displacement sensor through the effective spectral data segment.
In a third aspect, the application also provides an electronic device comprising a memory and a processor, wherein,
a memory for storing a program;
and a processor coupled to the memory for executing the program stored in the memory to implement the steps in the spectral peak-to-peak calculation method based on the spectral confocal displacement sensor in any one of the above implementations.
In a fourth aspect, the present application further provides a computer readable storage medium storing a computer readable program or instructions, which when executed by a processor, enable the steps in the spectral peak-to-peak value calculation method based on a spectral confocal displacement sensor in any one of the above implementations.
The beneficial effects of adopting the embodiment are as follows: a spectral peak value calculation method and system based on a spectral confocal displacement sensor, wherein the method comprises the following steps: preprocessing a dispersion image data matrix acquired by a spectral confocal displacement sensor to obtain a target gray peak curve meeting preset requirements; carrying out mean value filtering treatment and spectral peak trend fitting treatment on the target gray peak curve; performing spectrum peak rough positioning treatment on a target gray peak curve fitted with spectrum peak trend based on a first-order gradient method to determine position coordinates of spectrum peak candidate points; determining an effective spectrum data segment on the target gray peak curve according to the position coordinates of the spectrum peak candidate points; and calculating the spectral peak value of the spectral confocal displacement sensor through the effective spectral data segment. According to the application, the dispersion image data matrix acquired by the spectral confocal displacement sensor is subjected to pretreatment, mean value filtering treatment, spectral peak trend fitting treatment and spectral peak coarse positioning treatment in sequence to determine an effective spectral data segment, so that the influence of different environmental factors on spectral peak calculation is eliminated, thus a spectral effective data segment is determined, and the spectral peak value of the spectral confocal displacement sensor is obtained by calculating the spectral effective data segment, so that complicated and changeable spectral information can be dealt with, and the aim of improving the spectral peak positioning precision is fulfilled, and the measurement precision of the sensor is improved.
Drawings
FIG. 1 is a schematic flow chart of an embodiment of a spectral peak-to-peak calculation method based on a spectral confocal displacement sensor according to the present application;
FIG. 2 is a flowchart illustrating an embodiment of the step S101 in FIG. 1;
FIG. 3 is a flowchart illustrating an embodiment of the step S102 in FIG. 1;
FIG. 4 is a schematic diagram of a spectral peak positioning system based on a spectral confocal displacement sensor according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The following detailed description of preferred embodiments of the application is made in connection with the accompanying drawings, which form a part hereof, and together with the description of the embodiments of the application, are used to explain the principles of the application and are not intended to limit the scope of the application.
In the description of the present application, the meaning of "a plurality" is two or more, unless explicitly defined otherwise.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
The application provides a spectral peak value calculation method and a detection system based on a spectral confocal displacement sensor, which are respectively described below.
Referring to fig. 1, fig. 1 is a flow chart of an embodiment of a spectral peak value calculation method based on a spectral confocal displacement sensor according to the present application, and a specific embodiment of the present application discloses a spectral peak value calculation method based on a spectral confocal displacement sensor, which includes:
s101, preprocessing a dispersion image data matrix acquired by a spectral confocal displacement sensor to obtain a target gray peak curve meeting preset requirements;
s102, carrying out mean value filtering treatment and spectral peak trend fitting treatment on a target gray peak curve;
s103, performing spectrum peak rough positioning treatment on a target gray peak curve subjected to spectrum peak trend fitting based on a first-order gradient method to determine position coordinates of spectrum peak candidate points;
s104, determining an effective spectrum data segment on a target gray peak curve according to the position coordinates of the spectrum peak candidate points;
s105, calculating the spectral peak value of the spectral confocal displacement sensor through the effective spectral data segment.
In the above embodiment, more noise may exist in the dispersive image data matrix acquired by the spectral confocal displacement sensor at first, the dispersive image data matrix is preprocessed to eliminate part of the noise, and an optimal gray peak curve meeting the requirement is determined based on the preprocessed dispersive image data matrix, that is, the target gray peak curve.
The average value filtering is carried out on the optimal gray peak value curve, so that random noise of the peak value curve is further removed, spectral peak trend fitting treatment is carried out on the gray peak value curve after the average value filtering, so that data smoothing segments around spectral characteristic peaks are eliminated, and more regular spectral characteristic peaks are obtained.
The position coordinates of the spectrum peak candidate points can be preliminarily determined, the positions of the spectrum peaks can be preliminarily determined through the position coordinates of the spectrum peak candidate points, and the accurate spectrum peak value can be calculated in the follow-up process.
After the position coordinates of the spectrum peak candidate points are determined, firstly, the data section interval parameters are required to be determined, the length of the effective data section is determined by the data section interval parameters, and all the pixel points in the length range of the effective data section are possible to be the pixel points of the spectrum peak, so that the accurate determination of the data section interval parameters is beneficial to accurately positioning the spectrum peak pixel points.
The method comprises the steps of calculating the result of the spectral peak value of all pixel points in an effective spectral data segment through a preset calculation formula, wherein the maximum numerical value in the calculated result is the spectral peak value of the current effective spectral data segment, and through the process, the influence of different environmental factors on the spectral peak positioning is eliminated, and finally, the calculated spectral peak value has high precision.
Compared with the prior art, the spectral peak value calculation method based on the spectral confocal displacement sensor provided by the embodiment comprises the following steps: preprocessing a dispersion image data matrix acquired by a spectral confocal displacement sensor to obtain a target gray peak curve meeting preset requirements; carrying out mean value filtering treatment and spectral peak trend fitting treatment on the target gray peak curve; performing spectrum peak rough positioning treatment on a target gray peak curve fitted with spectrum peak trend based on a first-order gradient method to determine position coordinates of spectrum peak candidate points; determining an effective spectrum data segment on the target gray peak curve according to the position coordinates of the spectrum peak candidate points; and calculating the spectral peak value of the spectral confocal displacement sensor through the effective spectral data segment. According to the application, the dispersion image data matrix acquired by the spectral confocal displacement sensor is subjected to pretreatment, mean value filtering treatment, spectral peak trend fitting treatment and spectral peak coarse positioning treatment in sequence to determine an effective spectral data segment, so that the influence of different environmental factors on spectral peak calculation is eliminated, thus a spectral effective data segment is determined, and the spectral peak value of the spectral confocal displacement sensor is obtained by calculating the spectral effective data segment, so that complicated and changeable spectral information can be dealt with, and the aim of improving the spectral peak positioning precision is fulfilled, and the measurement precision of the sensor is improved.
Referring to fig. 2, fig. 2 is a flowchart of an embodiment of step S101 in fig. 1, in some embodiments of the present application, preprocessing a dispersion image data matrix acquired by a confocal displacement sensor to obtain a target gray-scale peak curve meeting a preset requirement, including:
s201, denoising a dispersion image data matrix acquired by a spectral confocal displacement sensor;
s202, determining an effective data column according to a column gray value difference threshold and a column gray value of the denoised dispersion image data matrix;
s203, performing Gaussian fitting on the effective data column to obtain effective data points;
s204, performing least square fitting according to the effective data points to obtain an effective peak value curve;
s205, screening out a target gray peak curve meeting preset requirements from the effective peak curves based on the dispersion image data matrix.
In the above embodiment, the dispersion image is acquired at the spectral confocal displacement sensor receiving end CCD according to the optical path principle. The dispersion image comprises position coordinates and gray values of a plurality of pixel points, and the dispersion image data matrix is preprocessed to obtain an optimal gray peak value curve.
The preprocessing comprises the steps of denoising the image data matrix, judging the denoised image data according to columns, and enabling the difference value of the gray value maximum value in the columns to be larger than the column gray value difference value threshold valueQ 1 Is defined as an effective data column, gaussian fitting is carried out on the effective data column to obtain effective data points, an effective peak curve is obtained through least square fitting according to coordinates of the effective data points, and one row of data closest to the effective peak curve in an image data matrix is taken as dataThe optimal gray peak curve. Wherein, the liquid crystal display device comprises a liquid crystal display device,Q 1 is a column gray value difference threshold. The columns are vertical to the dispersion direction, and for the point-spectrum confocal displacement sensor, the dispersion direction of the point-spectrum confocal displacement sensor is transversely coincident with the CCD at the sensor end.
As a preferred embodiment, the size of the matrix of the dispersed image data acquired by the CCD at the receiving end of the spectral confocal displacement sensor is as followsm*lThe order of the steps is that,mandlis a positive integer. And selecting a median filter with a proper window size for denoising. Judging the processed image data according to the columns, namely when the difference between the maximum gray value of the columns and the minimum gray value of the columns is larger than the difference threshold value of the gray values of the columnsQ 1 When=10, the column is the valid column. Performing Gaussian fitting on the effective columns one by one to obtain the point with the maximum column gray valuex a , y b ) Noted as valid data points. Least squares fitting is performed on all valid data points to obtain a bar such asy=kx+hIs used for the effective peak value curve of (a),his a positive number. Taking an image data matrixl=h 0 Is an optimal gray peak curve, wherein,h 0 equal tohRounded values. Wherein, the method comprises the following steps ofx a , y b ) Position coordinates representing valid data points, 1≤a≤m,1≤b≤lmAndlthe number of columns and the number of rows of the image data matrix, respectively.
It should be noted that, the window size of the column gray value difference threshold and the median filtering can be set according to the actual situation, and the application does not limit this further, but meets the preset requirement in the several gray peak curves obtained by the target gray peak curveyThe value of the ordinate rounding of the axis intersection point is equal to the matrix order of the dispersed image datalGray peak curves of values.
The resulting optimum gray peak curve is shown below:
{(x 1 ,z 1 ), (x 2 ,z 2 ),…, (x n ,z n )};
wherein, the liquid crystal display device comprises a liquid crystal display device,x i representing the first in the optimal gray peak curveiThe position coordinates of the individual pixel points,z i represent the firstiGray value of each pixel point, 1≤i≤nnThe total number of pixels for the optimal gray peak curve.
Referring to fig. 3, fig. 3 is a flowchart illustrating an embodiment of step S102 in fig. 1, and in some embodiments of the present application, the average filtering and the spectral peak trend fitting of the target gray peak curve include:
s301, calculating a first-order gradient curve of a target gray peak curve after mean value filtering;
s302, positioning a starting pixel point of a flat point data segment according to a gradient curve of a target gray peak curve after mean value filtering based on a preset positioning principle;
s303, carrying out trend fitting on the flat point data segment according to the initial pixel point.
In the above embodiment, the following steps are takenz 1 ,z 2 ,……,z n ) For the gray value distribution of the optimal gray peak curve, the curve is subjected to mean filtering with a window size of 3, and the calculation formula of the mean filtering is as follows:
z i =(z i-1 +z i +z i+1 )/3
and (3) carrying out spectral peak trend fitting treatment on the gray peak curve after mean value filtering, and eliminating a data smoothing section around the spectral characteristic peak to obtain a more regular spectral characteristic peak.
Further, the spectral peak trend fitting process includes: and (3) a first-order gradient curve of the target gray peak value curve after mean value filtering is obtained, a section of data segment with equal gray values, which is generated by median filtering and is close to the target gray peak value Qu Xianpu peak, is positioned according to the gradient curve characteristics, namely, a flat point data segment, and the flat point data segment is processed by a trend fitting method to obtain a more regular spectrum characteristic peak.
The first-order gradient curve of the target gray peak value curve after mean value filtering is expressed as follows:
{(x 1 ,d 1 ),(x 2 ,d 2 ),……,(x n ,d n )};
wherein, the liquid crystal display device comprises a liquid crystal display device,x i representing the first of the mean-filtered target gray peak curvesiThe position coordinates of the individual pixel points,d i represent the firstiFirst-order gradient value of each pixel point, 1≤i≤nnAnd the total number of pixels of the target gray peak value curve after mean value filtering.
The first order gradient is calculated as follows:
d i =z i+1 -z i
z i representing the first of the mean-filtered target gray peak curvesiGray values of individual pixels.
As a preferred embodiment, the spectral peak trend fitting process comprises locating the initial pixel point coordinate position of the flat point data segment through one-step gradient curve characteristic of the target gray peak curve after mean value filteringx h Trend fitting is carried out on the flat point data segment, and the fitting calculation mode is as follows:
z h =(z h-1 +z h+1 )/2
wherein, the liquid crystal display device comprises a liquid crystal display device,x h representing the coordinate position of the start pixel point of the flat point data segment,z h the gray value of the starting pixel is represented.
In some embodiments of the present application, the preset positioning rules include a first positioning rule and a second positioning rule; based on a preset positioning principle, positioning a start pixel point of a flat point data segment according to a gradient curve, wherein the method comprises the following steps:
according to a first positioning principle, when the first-order gradient value of the pixel points in the target gray peak value curve is zero and the first-order gradient values of the continuous preset number of pixel points before the current pixel point are all larger than zero, the current pixel point is the starting pixel point;
according to the second positioning principle, when the first-order gradient value of the pixel point in the target gray peak value curve is zero, the gray value of the current pixel point is equal to the gray value of the next adjacent pixel point and is smaller than the gray value of the previous adjacent pixel point, the current pixel point is the starting pixel point.
In the above embodiment, the preset positioning rules include two rules, namely a first positioning rule and a second positioning rule, where the first positioning rule of the initial pixel point of the flat point data segment is expressed as follows:
such asd h =0 and 0d h-5 ,d h-4 ,d h-3 ,d h-2 ,d h-1 All greater than 0, thenx h Is the starting pixel point coordinate position.
The second positioning principle of the initial pixel point of the flat point data segment is as follows:
such asd h =0And z h-1 >z h =z h+1 Thenx h Is the starting pixel point coordinate position.
In some embodiments of the present application, based on a first-order gradient method, performing a spectrum peak coarse positioning process on a target gray peak curve after a spectrum peak trend fitting to determine a position coordinate of a spectrum peak candidate point, including:
calculating a first-order gradient curve of a target gray peak curve after spectral peak trend fitting;
and carrying out spectrum peak rough positioning on a gradient curve of the target gray peak curve after spectrum peak trend fitting based on a preset rough positioning rule, and determining the position coordinates of spectrum peak candidate points.
In the above embodiment, a first-order gradient curve of the target gray peak curve after the spectral peak trend fitting is obtained, and the first-order gradient curve is represented as follows:
{(x 1 ,f 1 ),(x 2 ,f 2 ),…,(x n ,f n )};
wherein, the liquid crystal display device comprises a liquid crystal display device,x i the first of the target gray peak curves after the trend fitting of the spectrum peakiIndividual pixelsThe position coordinates of the points are determined,f i represent the firstiFirst-order gradient value of each pixel point, 1≤i≤n,nAnd (5) the total number of pixel points of the target gray peak curve after the spectrum peak trend fitting is adopted.
As a preferred embodiment, the coarse positioning of the spectral peak position based on the preset coarse positioning rule includes a first-order gradient curve of the target gray peak curve fitted according to the spectral peak trend, finding the front-to-back gradient value to match positive negative negative regular and gray value greater than image background noise gray thresholdQ 2 Is defined as a plurality of spectral peak candidate pointsm 1 ,m 2 ,…, m j ,…,m s . Wherein, the liquid crystal display device comprises a liquid crystal display device,sand the number of the spectrum peak candidate points is the number of the spectrum peak candidate points.
Wherein, the liquid crystal display device comprises a liquid crystal display device,m j position coordinates representing spectral peak candidate points, 1≤j≤n,nAnd (5) the total number of pixel points of the target gray peak curve after the spectrum peak trend fitting is adopted.
Wherein, the positioning rule of the rough positioning spectrum peak candidate points is expressed as follows:
such asf j-5 ,f j-4 ,f j-3 ,f j-2 ,f j-1 Are all greater than 0 andf j+1 ,f j+2 ,f j+3 ,f j+4 ,f j+5 are all smaller than 0 andz j >5thenm j Is a spectral peak candidate point.
In some embodiments of the present application, determining an effective spectral data segment on a target gray peak curve from position coordinates of spectral peak candidate points includes:
determining data segment interval parameters according to the position coordinates of the spectrum peak candidate points and the target gray peak curve;
and determining an effective spectrum data segment by taking the spectrum peak candidate point as a center and taking the data segment interval parameter.
In the above embodiment, the rough positioning information is used to determine the data segment interval parameter centered on the spectral peak candidate point on the target gray peak curveQ 3 Is provided for the effective spectral data segment. Wherein, the liquid crystal display device comprises a liquid crystal display device,Q 3 and the distance between the position of the spectrum peak candidate point and the positions of the two ends of the target gray peak curve is determined.
The effective spectral data segments are represented as follows:
{(m j-Q3 ,z j-Q3 ),…,(m j ,z j ),…,(m j+Q3 ,z j+Q3 )};
wherein, the liquid crystal display device comprises a liquid crystal display device,Q 3 is a positive integer 1≤j-Q 3 ,j+Q 3 ≤n,nThe total number of pixels of the target gray peak curve.
As a preferred embodiment, the spectral peak candidate points obtained by coarse positioning are utilizedx j Coordinate position of (c) contrastm j Starting point of peak curve of target gray levelx 1 Endpoint withx n The distance between them, i.e. contrast |m j -x 1 I and Im j -x n Magnitude of I, letQ 3 = min(|m j -x 1 |,|x n -m j |). Determining a target gray peak curvem j Is centered and the interval size isQ 3 Is provided for the effective spectral data segment.
If the detection object of the spectral confocal displacement sensor is a plurality of layers of transparent materials. According to the principle of spectral dispersion, a plurality of layers of materials existing on an optical axis reflect a plurality of incident light rays to a receiving end of a spectral confocal displacement sensor, and a plurality of focusing light spots can appear at a CCD (charge coupled device) at the receiving end. Obtaining multiple spectral peak candidate points by using the coarse positioningm j1 ,m j2 ,…,m js . Wherein, the liquid crystal display device comprises a liquid crystal display device,sand the number of the spectrum peak candidate points is the number of the spectrum peak candidate points.
Further, the coordinate positions of the plurality of spectrum peak candidate points are utilized to determine corresponding positionsQ 3 And then determining a plurality of valid spectral data segments. Wherein, the spectrum peak candidate points at different positions correspond toQ 3 There are different determination rules for the values of (a).
If the spectrum peak candidate point ism j1 ThenQ 3 =min(|m j1 -x 1 |,|x j1 -x j2 |)
If the spectrum peak candidate point ism j2 ,…,m jr ,…,m js-1 ThenQ 3 =min(|m jr -m jr-1 |,|m jr -m jr+1 |). Wherein 2 is≤r≤s-1rIs a positive integer.
If the spectrum peak candidate point ism js ThenQ 3 =min(|m js -m js-1 |,|m js -x n |)
In some embodiments of the application, calculating spectral peak-to-peak values of a spectral confocal displacement sensor from valid spectral data segments comprises:
carrying out Gaussian fitting on the effective spectrum data segment to obtain Gaussian fitting results;
and calculating the spectral peak value of the spectral confocal displacement sensor according to the Gaussian fitting result and a preset calculation formula.
In the above embodiment, since the spectrum peak shape is similar to the gaussian peak shape, the gaussian fitting method is used to fit the effective spectrum data segment, and the spectrum peak value, that is, the wavelength value corresponding to the position with the maximum spectrum energy, can be accurately obtained from the fitting result.
As a preferred embodiment, the preset calculation formula of the spectral peak value of the spectral confocal displacement sensor is:
in the method, in the process of the application,b i the peak position of the Gaussian peak, namely the abscissa of the spectral peak of the spectral confocal displacement sensor,xas a function of the amount of the independent variable,a i the value range is positive number for the peak value of the Gaussian peak,c i is the standard deviation of the gaussian peak.xAndyfor all of the valid spectral data segments enteredIs defined by the abscissa of the pixel points.
In order to better implement the spectral peak positioning method based on the spectral confocal displacement sensor in the embodiment of the present application, referring to fig. 4 correspondingly on the basis of the spectral peak positioning method based on the spectral confocal displacement sensor, fig. 4 is a schematic structural diagram of an embodiment of a spectral peak positioning system based on the spectral confocal displacement sensor provided by the present application, and the embodiment of the present application provides a spectral peak positioning system 400 based on the spectral confocal displacement sensor, which includes:
the preprocessing module 410 is configured to preprocess the dispersive image data matrix acquired by the optical confocal displacement sensor to obtain a target gray peak curve that meets a preset requirement;
the trend fitting module 420 is configured to perform mean value filtering processing and spectral peak trend fitting processing on the target gray peak curve;
the coarse positioning module 430 is configured to perform a spectral peak coarse positioning process on the target gray peak curve after the spectral peak trend fitting based on a first-order gradient method to determine a position coordinate of a spectral peak candidate point;
a data segment module 440, configured to determine an effective spectrum data segment on the target gray peak curve according to the position coordinates of the spectrum peak candidate point;
a peak calculation module 450 for locating the spectral peak-to-peak value of the spectral confocal displacement sensor through the effective spectral data segment.
What needs to be explained here is: the system 400 provided in the foregoing embodiments may implement the technical solutions described in the foregoing method embodiments, and the specific implementation principles of the foregoing modules or units may be referred to the corresponding content in the foregoing method embodiments, which is not repeated herein.
Referring to fig. 5, fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the application. Based on the spectral peak positioning method based on the spectral confocal displacement sensor, the application also correspondingly provides spectral peak positioning equipment based on the spectral confocal displacement sensor, and the spectral peak positioning equipment based on the spectral confocal displacement sensor can be computing equipment such as a mobile terminal, a desktop computer, a notebook computer, a palm computer, a server and the like. The spectral peak positioning apparatus based on a spectral confocal displacement sensor includes a processor 510, a memory 520, and a display 530. Fig. 5 shows only some of the components of the electronic device, but it should be understood that not all of the illustrated components are required to be implemented and that more or fewer components may be implemented instead.
The memory 520 may in some embodiments be an internal storage unit of a spectral peak positioning device based on a spectral confocal displacement sensor, such as a hard disk or a memory of the spectral peak positioning device based on a spectral confocal displacement sensor. The memory 520 may also be an external memory device based on a spectral peak positioning device of the spectral confocal displacement sensor in other embodiments, such as a plug-in hard disk, smart Media Card (SMC), secure Digital (SD) Card, flash Card (Flash Card) or the like, which is provided on the spectral peak positioning device of the spectral confocal displacement sensor. Further, the memory 520 may also include both an internal memory unit and an external memory device of the spectral peak positioning apparatus based on the spectral confocal displacement sensor. The memory 520 is used for storing application software and various data installed on the spectral peak positioning apparatus based on the spectral confocal displacement sensor, for example, program codes installed on the spectral peak positioning apparatus based on the spectral confocal displacement sensor. Memory 520 may also be used to temporarily store data that has been output or is to be output. In an embodiment, the memory 520 stores a spectral peak positioning program 540 based on a spectral confocal displacement sensor, and the spectral peak positioning program 540 based on the spectral confocal displacement sensor can be executed by the processor 510, so as to implement the spectral peak positioning method based on the spectral confocal displacement sensor according to the embodiments of the present application.
The processor 510 may be a central processing unit (Central Processing Unit, CPU), microprocessor or other data processing chip in some embodiments for running program code or processing data stored in the memory 520, for example performing spectral peak localization methods based on spectral confocal displacement sensors, etc.
The display 530 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like in some embodiments. Display 530 is used to display information at the spectral peak locating device based on the spectral confocal displacement sensor and to display a visual user interface. The components 510-530 of the spectral peak positioning apparatus based on the spectral confocal displacement sensor communicate with each other via a system bus.
In one embodiment, the steps in the spectral peak positioning method based on spectral confocal displacement sensors as described above are implemented when processor 510 executes spectral peak positioning program 540 based on spectral confocal displacement sensors in memory 520.
The present embodiment also provides a computer-readable storage medium having stored thereon a spectral peak positioning program based on a spectral confocal displacement sensor, which when executed by a processor, implements the steps of:
preprocessing a dispersion image data matrix acquired by a spectral confocal displacement sensor to obtain a target gray peak curve meeting preset requirements;
carrying out mean value filtering treatment and spectral peak trend fitting treatment on the target gray peak curve;
performing spectrum peak rough positioning treatment on a target gray peak curve fitted with spectrum peak trend based on a first-order gradient method to determine position coordinates of spectrum peak candidate points;
determining an effective spectrum data segment on a target gray peak curve according to the position coordinates of spectrum peak candidate points;
and locating the spectral peak value of the spectral confocal displacement sensor through the effective spectral data segment.
In summary, the method and system for calculating a spectral peak value based on a spectral confocal displacement sensor provided in this embodiment, the method includes: preprocessing a dispersion image data matrix acquired by a spectral confocal displacement sensor to obtain a target gray peak curve meeting preset requirements; carrying out mean value filtering treatment and spectral peak trend fitting treatment on the target gray peak curve; performing spectrum peak rough positioning treatment on a target gray peak curve fitted with spectrum peak trend based on a first-order gradient method to determine position coordinates of spectrum peak candidate points; determining an effective spectrum data segment on the target gray peak curve according to the position coordinates of the spectrum peak candidate points; and calculating the spectral peak value of the spectral confocal displacement sensor through the effective spectral data segment. According to the application, the dispersion image data matrix acquired by the spectral confocal displacement sensor is subjected to pretreatment, mean value filtering treatment, spectral peak trend fitting treatment and spectral peak coarse positioning treatment in sequence to determine an effective spectral data segment, so that the influence of different environmental factors on spectral peak calculation is eliminated, thus a spectral effective data segment is determined, and the spectral peak value of the spectral confocal displacement sensor is obtained by calculating the spectral effective data segment, so that complicated and changeable spectral information can be dealt with, and the aim of improving the spectral peak positioning precision is fulfilled, and the measurement precision of the sensor is improved.
The present application is not limited to the above-mentioned embodiments, and any changes or substitutions that can be easily understood by those skilled in the art within the technical scope of the present application are intended to be included in the scope of the present application.

Claims (10)

1. The spectral peak value calculation method based on the spectral confocal displacement sensor is characterized by comprising the following steps of:
preprocessing a dispersion image data matrix acquired by a spectral confocal displacement sensor to obtain a target gray peak curve meeting preset requirements;
carrying out mean value filtering treatment and spectral peak trend fitting treatment on the target gray peak curve;
performing spectrum peak rough positioning treatment on a target gray peak curve fitted with spectrum peak trend based on a first-order gradient method to determine position coordinates of spectrum peak candidate points;
determining an effective spectrum data segment on the target gray peak curve according to the position coordinates of the spectrum peak candidate points;
and calculating the spectral peak value of the spectral confocal displacement sensor through the effective spectral data segment.
2. The spectral peak-to-peak value calculation method based on a spectral confocal displacement sensor according to claim 1, wherein the preprocessing of the dispersive image data matrix acquired by the spectral confocal displacement sensor to obtain a target gray-scale peak value curve meeting a preset requirement comprises:
denoising the dispersion image data matrix acquired by the spectral confocal displacement sensor;
determining an effective data column according to the column gray value difference threshold and the column gray value of the denoised dispersion image data matrix;
performing Gaussian fitting on the effective data columns to obtain effective data points;
performing least square fitting according to the effective data points to obtain an effective peak value curve;
and screening a target gray peak curve meeting preset requirements from the effective peak curve based on the dispersion image data matrix.
3. The spectral peak-to-peak value calculation method based on a spectral confocal displacement sensor according to claim 1, wherein the performing a mean value filtering process and a spectral peak trend fitting process on the target gray peak curve comprises:
calculating a first-order gradient curve of the target gray peak value curve after mean value filtering;
based on a preset positioning principle, positioning a starting pixel point of a flat point data segment according to a gradient curve of the target gray peak value curve after mean value filtering;
and carrying out trend fitting on the flat point data segment according to the initial pixel point.
4. The spectral peak-to-peak calculation method based on a spectral confocal displacement sensor according to claim 3, wherein said preset positioning principle comprises a first positioning principle and a second positioning principle; the positioning the initial pixel point of the flat point data segment according to the one-step degree curve based on the preset positioning principle comprises the following steps:
according to the first positioning principle, when the first-order gradient value of the pixel points in the target gray peak value curve is zero and the first-order gradient values of the continuous preset number of pixel points before the current pixel point are all larger than zero, the current pixel point is the starting pixel point;
according to the second positioning principle, when the first-order gradient value of the pixel point in the target gray peak value curve is zero, and the gray value of the current pixel point is equal to the gray value of the next adjacent pixel point and smaller than the gray value of the previous adjacent pixel point, the current pixel point is the starting pixel point.
5. The method for calculating the spectral peak value based on the spectral confocal displacement sensor according to claim 1, wherein the step of performing the spectral peak rough positioning processing on the target gray peak curve after the spectral peak trend fitting to determine the position coordinates of the spectral peak candidate points based on the first-order gradient method comprises the following steps:
calculating a first-order gradient curve of a target gray peak curve after spectral peak trend fitting;
and carrying out spectrum peak rough positioning on a gradient curve of the target gray peak curve after the spectrum peak trend fitting based on a preset rough positioning rule, and determining the position coordinates of spectrum peak candidate points.
6. The spectral peak-to-peak value calculation method based on a spectral confocal displacement sensor according to claim 5, wherein said determining an effective spectral data segment on said target gray-scale peak curve according to the position coordinates of said spectral peak candidate points comprises:
determining a data segment interval parameter according to the position coordinates of the spectrum peak candidate points and the target gray peak curve;
and determining an effective spectrum data segment by taking the spectrum peak candidate point as a center and taking the data segment interval parameter.
7. The spectral peak-to-peak value calculation method based on a spectral confocal displacement sensor according to claim 6, wherein said calculating the spectral peak-to-peak value of the spectral confocal displacement sensor from said effective spectral data segment comprises:
carrying out Gaussian fitting on the effective spectrum data segment to obtain a Gaussian fitting result;
and calculating the spectral peak value of the spectral confocal displacement sensor according to the Gaussian fitting result and a preset calculation formula.
8. A spectral peak-to-peak computing system based on a spectral confocal displacement sensor, comprising:
the preprocessing module is used for preprocessing the dispersion image data matrix acquired by the optical confocal displacement sensor to obtain a target gray peak curve meeting the preset requirement;
the trend fitting module is used for carrying out mean value filtering processing and spectral peak trend fitting processing on the target gray peak curve;
the coarse positioning module is used for performing spectrum peak coarse positioning processing on the target gray peak curve after spectrum peak trend fitting based on a first-order gradient method to determine the position coordinates of spectrum peak candidate points;
the data segment module is used for determining an effective spectrum data segment on the target gray peak curve according to the position coordinates of the spectrum peak candidate points;
and the peak value calculation module is used for positioning the spectral peak value of the spectral confocal displacement sensor through the effective spectral data segment.
9. An electronic device comprising a memory and a processor, wherein,
the memory is used for storing programs;
the processor, coupled to the memory, is configured to execute the program stored in the memory to implement the steps in the spectral peak-to-peak calculation method based on a spectral confocal displacement sensor according to any one of claims 1 to 7.
10. A computer readable storage medium storing a computer readable program or instructions which, when executed by a processor, is capable of carrying out the steps of the spectral peak-to-peak calculation method based on a spectral confocal displacement sensor according to any one of claims 1 to 7.
CN202311255346.1A 2023-09-27 2023-09-27 Spectral peak value calculation method and system based on spectral confocal displacement sensor Active CN116989664B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311255346.1A CN116989664B (en) 2023-09-27 2023-09-27 Spectral peak value calculation method and system based on spectral confocal displacement sensor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311255346.1A CN116989664B (en) 2023-09-27 2023-09-27 Spectral peak value calculation method and system based on spectral confocal displacement sensor

Publications (2)

Publication Number Publication Date
CN116989664A true CN116989664A (en) 2023-11-03
CN116989664B CN116989664B (en) 2023-12-19

Family

ID=88530611

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311255346.1A Active CN116989664B (en) 2023-09-27 2023-09-27 Spectral peak value calculation method and system based on spectral confocal displacement sensor

Country Status (1)

Country Link
CN (1) CN116989664B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109186458A (en) * 2018-09-28 2019-01-11 华中科技大学 A kind of compensation fitting differential signal method for the confocal peak extraction of dispersion
WO2021031711A1 (en) * 2019-08-19 2021-02-25 苏州瑞派宁科技有限公司 Method and apparatus for identifying location spectrum, and computer storage medium
CN112462349A (en) * 2020-11-20 2021-03-09 武汉烽火凯卓科技有限公司 Wavelength calculation method, system, server and storage medium for spectrum confocal displacement sensor
CN114370820A (en) * 2022-03-22 2022-04-19 武汉精立电子技术有限公司 Peak extraction method, detection method and system of spectrum confocal displacement sensor
CN115859080A (en) * 2022-11-23 2023-03-28 湖北民族大学 Optical fiber Bragg grating signal peak value detection algorithm based on asymmetric Gaussian model
CN116089824A (en) * 2023-03-30 2023-05-09 奥谱天成(厦门)光电有限公司 Peak extraction method, system and medium of spectrum confocal displacement sensor

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109186458A (en) * 2018-09-28 2019-01-11 华中科技大学 A kind of compensation fitting differential signal method for the confocal peak extraction of dispersion
WO2021031711A1 (en) * 2019-08-19 2021-02-25 苏州瑞派宁科技有限公司 Method and apparatus for identifying location spectrum, and computer storage medium
CN112462349A (en) * 2020-11-20 2021-03-09 武汉烽火凯卓科技有限公司 Wavelength calculation method, system, server and storage medium for spectrum confocal displacement sensor
CN114370820A (en) * 2022-03-22 2022-04-19 武汉精立电子技术有限公司 Peak extraction method, detection method and system of spectrum confocal displacement sensor
CN115859080A (en) * 2022-11-23 2023-03-28 湖北民族大学 Optical fiber Bragg grating signal peak value detection algorithm based on asymmetric Gaussian model
CN116089824A (en) * 2023-03-30 2023-05-09 奥谱天成(厦门)光电有限公司 Peak extraction method, system and medium of spectrum confocal displacement sensor

Also Published As

Publication number Publication date
CN116989664B (en) 2023-12-19

Similar Documents

Publication Publication Date Title
CN114494045B (en) Large spur gear geometric parameter measurement system and method based on machine vision
CN115861291B (en) Chip circuit board production defect detection method based on machine vision
CN111488874A (en) Method and system for correcting inclination of pointer instrument
CN109816639B (en) Real-time straight line segment detection system and method based on LSD algorithm
US9070016B2 (en) Biometric authentication apparatus, biometric authentication method and recording medium
CN111444964B (en) Multi-target rapid image matching method based on adaptive ROI (region of interest) division
CN107967477B (en) Improved SIFT feature combined matching method
CN110634137A (en) Bridge deformation monitoring method, device and equipment based on visual perception
CN104715491A (en) Subpixel edge detection method based on one-dimensional gray moment
CN117689655B (en) Metal button surface defect detection method based on computer vision
CN116989664B (en) Spectral peak value calculation method and system based on spectral confocal displacement sensor
CN114358166A (en) Multi-target positioning method based on self-adaptive k-means clustering
CN110557622B (en) Depth information acquisition method and device based on structured light, equipment and medium
CN111832634A (en) Foreign matter detection method, system, terminal device and storage medium
CN115619678B (en) Correction method and device for image deformation, computer equipment and storage medium
Liu et al. A self-adaptive selection of subset size method in digital image correlation based on shannon entropy
CN115049810A (en) Coloring method, device and equipment for solid-state laser radar point cloud and storage medium
CN111401377B (en) Meter data reading method and device, electronic equipment and storage medium
CN113408551A (en) Pointer instrument reading identification method, system, equipment and computer storage medium
CN108256525B (en) Guide rail target position detection method based on image processing
CN111189413A (en) Double-camera line structured light measurement system optimization method and terminal equipment
Ziomek et al. Evaluation of interest point detectors in presence of noise
CN117115275B (en) Distortion parameter determination method and device and computer equipment
CN113469162B (en) Pointer instrument identification method, device, equipment and medium based on double-scale segmentation
CN115423855B (en) Template matching method, device, equipment and medium for image

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant