A method, system, and medium for adjusting a line source based on line spectral confocalization.

By analyzing the spectral response curve in real time and dynamically adjusting the brightness of the line light source to adapt to changes in the reflectivity of the object under test, the problem of signal overexposure in line spectral confocal technology is solved, achieving high-precision and stable three-dimensional measurement.

CN123066980APending Publication Date: 2026-11-10HEFEI I TEK OPTOELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611253291.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-18
Publication Date
2026-11-10

AI Technical Summary

Technical Problem

Linear spectral confocal techniques suffer from signal overexposure due to differences in reflectivity at different locations on the surface of the analyte, which affects measurement accuracy. Existing technologies cannot adaptively adjust the brightness of the light source to cope with dynamic changes in reflectivity.

Method used

By acquiring the spectral response curves of the transverse pixel positions on the surface of the object under test in real time, analyzing overexposure and underexposure, dynamically adjusting the brightness of the line light source, and controlling the light source brightness using overexposure rate and underexposure rate thresholds, adaptive adjustment is achieved.

Benefits of technology

It effectively solves the problem of signal overexposure caused by the difference in surface reflectivity of the test object, improves the measurement accuracy and stability, and is suitable for online high-precision three-dimensional measurement of complex test objects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123066980A_ABST
    Figure CN123066980A_ABST
Patent Text Reader

Abstract

This invention discloses a method, system, and medium for adjusting a line light source based on line spectral confocalization. The adjustment method includes: acquiring spectral response curves of all pixel positions in the current lateral region of interest on the surface of the object under test (AUT) where the brightness peak value is greater than a lower threshold; analyzing whether each spectral response curve is overexposed; determining whether the overexposure rate of all spectral response curves is greater than an overexposure rate threshold: if not, maintaining the current brightness; if so, reducing the brightness of the line light source; repeating the above steps until the AUT detection is completed; after the AUT detection is completed, restoring the brightness of the line light source to the initial brightness value. This invention effectively solves the signal overexposure problem caused by the difference in reflectivity at different positions on the AUT surface by dynamically adjusting the brightness of the line light source in real time by acquiring the spectral response curves corresponding to all pixel positions in the lateral direction of the AUT and judging the overexposure state pixel by pixel, using the overexposure rate as the control basis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of machine vision, and particularly relates to a method, system and medium for adjusting a line light source based on line spectral confocalization. Background Technology

[0002] Spectral confocal microscopy is a high-precision optical measurement method based on the principle of wavelength displacement encoding. This technique utilizes a specially designed dispersive objective lens to focus polychromatic light containing multiple wavelengths onto the optical axis in an increasing or decreasing wavelength sequence, forming a continuous series of focal points. When the surface of the object under test is at a certain focal point, the light of the corresponding wavelength is precisely focused and reflected back. A miniature spectrometer analyzes the spectrum of the reflected light to identify the peak wavelength with the highest intensity. Then, using a pre-calibrated wavelength-displacement correspondence, the absolute position of the object's surface can be accurately calculated. Spectral confocal sensors can achieve nanometer-level measurement resolution and can complete absolute length measurements without axial scanning, greatly improving measurement efficiency.

[0003] Linear confocal microscopy is a spatial extension of point-spectral confocal microscopy. Through special optical design, it expands a point beam into a narrow line beam, allowing the simultaneous acquisition of three-dimensional coordinate information for thousands of points along a straight line in a single exposure. In industrial online inspection scenarios, the object under test typically moves longitudinally, while the linear beam emitted by the line source is distributed laterally. Scanning allows for rapid reconstruction of the complete three-dimensional shape of the object. Due to its non-contact, high-precision, and high-efficiency characteristics, line-spectral confocal microscopy has been widely applied in dimensional measurement and surface defect detection in high-end manufacturing fields such as 3C electronics, semiconductors, precision machining, and new energy batteries.

[0004] However, line spectral confocal microscopy faces a long-standing technical challenge in practical applications: signal overexposure due to differences in reflectivity at different locations on the surface of the test object. Different materials and surface conditions (such as metal and plastic, polished and rough surfaces, coatings and substrates) significantly affect the reflectivity of the test object's surface. Regions with excessively high reflectivity are prone to spectral response signal saturation (i.e., overexposure), causing the peak of the spectral curve to be "cropped," thus blurring or even losing peak wavelength information, directly affecting measurement accuracy. Regions with excessively low reflectivity may lead to insufficient signal-to-noise ratio, similarly affecting the accurate extraction of wavelength peaks. In existing technologies, a fixed light source brightness is typically used for measurement, which cannot adapt to the dynamic changes in the reflectivity of the test object's surface. When the test object moves longitudinally, the reflectivity at different lateral and longitudinal positions on its surface may continuously change. A fixed light source brightness will either cause overexposure due to local high reflectivity areas or insufficient signal due to low reflectivity areas, making it difficult to obtain a stable and reliable spectral signal along the entire measurement line.

[0005] Therefore, there is an urgent need for a method that can dynamically adjust the brightness of the line light source during the measurement process to adaptively respond to the spatial changes in the reflectivity of the object surface and improve the detection accuracy. Summary of the Invention

[0006] The purpose of this invention is to overcome the above-mentioned problems in the prior art and provide a method, system and medium for adjusting a line light source based on line spectral confocalization, so as to adaptively respond to the spatial variation of the surface reflectivity of the object to be measured and improve the detection accuracy.

[0007] To achieve the above-mentioned technical objectives and effects, the present invention is implemented through the following technical solution: A method for adjusting a line source based on line spectral confocalization includes: Collect the spectral response curves of all pixel positions in the current lateral region of interest on the surface of the object under test where the brightness peak is greater than the lower threshold. Analyze the ratio of the wavelength span corresponding to the saturation brightness range to the wavelength span corresponding to the effective brightness range in each spectral response curve. If the ratio is greater than the overexposure threshold, the corresponding spectral response curve is considered overexposed. Determine whether the overexposure rate of all spectral response curves is greater than the overexposure rate threshold: if not, maintain the current brightness; if the overexposure rate is greater than the overexposure rate threshold and the underexposure rate is less than or equal to the underexposure rate threshold, reduce the brightness of the line light source, and re-determine the overexposure rate of all spectral response curves after each reduction, until the overexposure rate is less than or equal to the overexposure rate threshold or the brightness of the line light source reaches the preset safety lower limit. In this system, the object under test moves longitudinally, and the linear light beam emitted by the line source is distributed laterally; the saturation brightness range represents a value greater than or equal to a preset upper threshold, and the effective brightness range represents a value greater than or equal to a preset lower threshold; the overexposure rate is the ratio of the number of overexposed spectral response curves to the total number of spectral response curves collected from all pixel positions laterally; the underexposure rate is the ratio of the number of underexposed spectral response curves to the total number of spectral response curves collected from all pixel positions laterally, wherein the underexposure indicates that the brightness peak of the spectral response curve is less than or equal to a preset underexposure threshold, and the lower threshold is less than the underexposure threshold.

[0008] Furthermore, the reduction of the line light source brightness includes: gradually reducing the driving voltage of the line light source step by step according to a preset fixed step size, and after each reduction, re-determining whether the overexposure rate of all spectral response curves is greater than the overexposure rate threshold, until the overexposure rate is less than or equal to the overexposure rate threshold or the line light source brightness reaches a preset safety lower limit value.

[0009] Furthermore, if the number of overexposed spectral response curves is greater than or equal to the first selection threshold, after reducing the brightness of the line source, the target driving voltage of the line source is calculated using the following formula: U j=U j-1 +k1×(T over_2 -R over )×U s1 ; U j U is the target driving voltage corresponding to the position in row j. j-1 For the target driving voltage corresponding to the (j-1)th row position, in the first iteration, U j-1 To calibrate the default driving voltage of the line light source at the start, k1 is a preset first proportional coefficient, T over_2 R is the overexposure threshold. over For overexposure rate, U s1 This is the preset first voltage parameter.

[0010] Furthermore, if the number of overexposed spectral response curves is less than the first selection threshold, after reducing the brightness of the line light source, the formula for calculating the target driving voltage of the line light source is: U j =U j-1 +k2×(T over_1 -X over )×U s2 ; U j U is the target driving voltage corresponding to the position in row j. j-1 For the target driving voltage corresponding to the (j-1)th row position, in the first iteration, U j-1 To calibrate the default driving voltage of the line light source at the start, k2 is a preset second proportional coefficient, and T over_1 X is the overexposure threshold. over U is the average overexposure value, which is the average of the ratios corresponding to the spectral response curves of all overexposures. s2 This is the preset second voltage parameter.

[0011] Furthermore, while determining whether the overexposure rate is greater than the overexposure rate threshold, it is also determined that: If the overexposure rate is less than or equal to the overexposure rate threshold and the underexposure rate is greater than the underexposure rate threshold, then increase the brightness of the line light source. If the overexposure rate is greater than the overexposure rate threshold and the underexposure rate is greater than or equal to the underexposure rate threshold, then the current brightness will remain unchanged.

[0012] Furthermore, if the number of underexposed spectral response curves is greater than or equal to the second selection threshold, the target driving voltage of the line light source is calculated using the following formula after increasing the brightness of the line light source: U j =U j-1 +k3×(R under -T under_2 )×U s3 ; U jU is the target driving voltage corresponding to the position in row j. j-1 For the target driving voltage corresponding to the (j-1)th row position, in the first iteration, U j-1 To calibrate the default driving voltage of the line light source at the start, k3 is a preset third proportional coefficient, R under Due to underexposure, T under_2 U is the underexposure threshold. s3 This is the preset third voltage parameter.

[0013] Furthermore, if the number of underexposed spectral response curves is less than the second selection threshold, the target driving voltage of the line light source is calculated using the following formula after increasing the brightness of the line light source: U j =U j-1 +k4×(X under -T under_1 )×U s4 ; U j U is the target driving voltage corresponding to the position in row j. j-1 For the target driving voltage corresponding to the (j-1)th row position, in the first iteration, U j-1 To calibrate the default driving voltage of the line light source at the start, k4 is the preset fourth proportional coefficient, X under This is the average underexposure value, which is the average difference between the brightness peak value and the underexposure threshold value of all underexposure spectral response curves. T under_1 U is the underexposure threshold. s4 This is the preset fourth voltage parameter.

[0014] Furthermore, the driving voltage of the current line light source is monitored in real time. If the calculated adjusted driving voltage deviates from the safe threshold range, the current driving voltage is maintained unchanged, and subsequent steps are executed.

[0015] The present invention also provides a line source adjustment system based on line spectral confocalization, comprising: The spectral acquisition module is used to acquire the spectral response curves of all pixel positions in the current lateral region of interest on the surface of the object under test, where the brightness peak value is greater than the lower threshold. The overexposure analysis module is used to analyze the ratio of the wavelength span corresponding to the saturation brightness range to the wavelength span corresponding to the effective brightness range in each spectral response curve. If the ratio is greater than the overexposure threshold, the corresponding spectral response curve is considered overexposed. The underexposure analysis module is used to analyze whether the brightness peak in each spectral response curve is less than or equal to the preset underexposure threshold. If so, the corresponding spectral response curve is considered underexposure. The brightness adjustment module is used to adjust and control the brightness of the line light source; The overexposure judgment module is used to determine whether the overexposure rate of all spectral response curves is greater than the overexposure rate threshold. If not, the current brightness remains unchanged. If so, the brightness adjustment module is triggered to reduce the brightness of the line light source, and the overexposure rate of all spectral response curves is re-judged after each reduction until the overexposure rate is less than or equal to the overexposure rate threshold or the brightness of the line light source reaches the preset safety lower limit. In this system, the object under test moves longitudinally, and the linear light beam emitted by the line light source is distributed laterally; the saturation brightness range represents a value greater than or equal to a preset upper threshold, and the effective brightness range represents a value greater than or equal to a preset lower threshold; the overexposure rate is the ratio of the number of overexposed spectral response curves to the total number of spectral response curves collected from all pixel positions in the horizontal direction; the underexposure rate is the ratio of the number of underexposed spectral response curves to the total number of spectral response curves collected from all pixel positions in the horizontal direction.

[0016] The present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described adjustment method.

[0017] The beneficial effects of this invention are: This invention effectively solves the signal overexposure problem caused by differences in reflectivity at different locations on the surface of the object under test (AUT) by dynamically adjusting the brightness of the line light source based on the overexposure rate, thereby acquiring the spectral response curves of all pixels on the AUT surface in real time and determining the overexposure state pixel by pixel. Compared with the traditional method of fixing the light source brightness, this invention can continuously and adaptively adjust the light source brightness during the longitudinal movement of the AUT, keeping the spectral response signal within the effective measurement range as much as possible and reducing the loss of peak wavelength information and the decrease in measurement accuracy caused by overexposure. At the same time, by setting an overexposure rate threshold, it avoids system jitter caused by frequent adjustments, ensuring the stability and efficiency of the measurement process. This invention can be widely applied to online high-precision 3D measurement scenarios for complex AUT objects containing various materials and surface conditions. Attached Figure Description

[0018] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings: Figure 1 This is a flowchart of the adjustment method in this invention; Figure 2 This is a spectral response curve of a specific embodiment of the adjustment method in this invention; Figure 3 This is a block diagram of the adjustment system structure in this invention. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] To address the signal overexposure problem caused by differences in reflectivity at different locations on the surface of the object under test, such as... Figure 1 As shown, this embodiment first provides a method for adjusting a line source based on line spectral confocalization, including: The process involves acquiring spectral response curves for all pixel positions in the current lateral region of interest on the surface of the object under test (AUT), where the peak brightness exceeds a lower threshold. The AUT moves longitudinally, and the line light source emits a linear beam distributed laterally. If no effective spectral response curve exists at the current lateral position, the current brightness of the line light source is maintained, and the AUT continues to move. The effective spectral response curve is the one where the peak brightness exceeds the lower threshold. The "line" in line spectral confocal focusing is composed of thousands of closely arranged independent measurement "points." The precision spectrometer inside the sensor can process the spectral signals of all reflection points along the entire line in parallel, simultaneously acquiring spectral data from thousands of points on a straight line in a single exposure. This parallel acquisition method utilizes the spatial resolution of line spectral confocal focusing to spatially separate and independently record the spectral signals at different lateral pixel positions. The spectral response curve refers to the "intensity-wavelength" distribution curve acquired by the detector inside the spectrometer after the polychromatic light emitted by the line light source is projected onto the surface of the AUT through the dispersive objective lens and reflected back. The detector's Y-axis corresponds to the spectral distribution, and the X-axis corresponds to different lateral pixel positions on the AUT surface. The final set of curves corresponding to all pixel positions on the surface of the object under test constitutes the surface morphology spectral dataset of the next line of the object under test at the current moment.

[0021] Analyze the ratio of the wavelength span corresponding to the saturation brightness range to the wavelength span corresponding to the effective brightness range in each spectral response curve. If the ratio is greater than the overexposure threshold, the corresponding spectral response curve is considered overexposed. The saturation brightness range represents a value greater than or equal to a preset upper threshold, while the effective brightness range represents a value greater than or equal to a preset lower threshold. In a normal spectral response curve, the wavelength span corresponding to the effective brightness range should be much larger than the wavelength span corresponding to the saturation brightness range, meaning that the saturated portion of the spectral peak only accounts for a small proportion of the entire effective signal range. When excessive reflectivity leads to signal saturation, the peak region of the spectral curve is "cropped," and the wavelength span corresponding to the saturation brightness range increases significantly, while the wavelength span corresponding to the effective brightness range changes relatively little. Therefore, the ratio between the two increases significantly. This ratio is essentially a quantitative indicator of the degree of signal saturation; the larger the ratio, the more severe the saturation. By setting an overexposure threshold, spectral response curves with saturation exceeding the acceptable range can be filtered out. Compared to simply using whether peak brightness exceeds the upper limit threshold as an overexposure criterion, this feature, through ratio judgment, can more accurately reflect the substantial impact of saturation on the effective signal. Even if the peak is slightly saturated, as long as the proportion of the saturated wavelength range to the effective signal range is small, the signal can still be considered usable; conversely, even if the peak exceeds the upper limit only slightly but the saturated wavelength range is large, it is judged as overexposure. This criterion is more scientific and robust. As a specific embodiment, such as... Figure 2 As shown in the figure, line segment cd corresponds to the wavelength span of the saturated brightness range, and line segment ab corresponds to the wavelength span of the effective brightness range.

[0022] The system determines whether the overexposure rate of all spectral response curves is greater than the overexposure rate threshold. If not, the current brightness remains unchanged. If the overexposure rate is greater than the overexposure rate threshold, and the underexposure rate is less than or equal to the underexposure rate threshold, the line light source brightness is reduced. After each reduction, the overexposure rate of all spectral response curves is re-evaluated until the overexposure rate is less than or equal to the overexposure rate threshold or the line light source brightness reaches a preset safety lower limit. The overexposure rate is the ratio of the number of overexposed spectral response curves to the total number of spectral response curves collected from all pixel positions in the horizontal direction. The underexposure rate is the ratio of the number of underexposed spectral response curves to the total number of spectral response curves collected from all pixel positions in the horizontal direction. Underexposure indicates that the brightness peak of the spectral response curve is less than or equal to a preset underexposure threshold, and the lower limit threshold is less than the underexposure threshold. The overexposure rate reflects the severity of signal saturation along the entire measurement line. The overexposure rate threshold is a tolerance parameter that allows a small number of pixel positions to be overexposed without triggering adjustment, in order to avoid excessive response to local, instantaneous reflectivity fluctuations that could cause frequent light source jitter. When the overexposure rate exceeds the overexposure rate threshold, it indicates that the overexposure has spread to a point where it cannot be ignored, requiring a reduction in light source brightness to alleviate the overall saturation. Reducing the light source brightness decreases the signal intensity in high-reflectivity regions, lessens saturation, and consequently reduces the overexposure rate. By introducing the statistical indicator of overexposure rate and the tolerance parameter of the overexposure rate threshold, a control strategy of "adjusting on demand" rather than "adjusting upon exposure" is achieved. This ensures signal quality while avoiding unnecessary frequent adjustments, improving system stability and measurement efficiency. Underexposure indicates that the brightness peak of the spectral response curve is too low, resulting in insufficient signal-to-noise ratio, which also affects measurement accuracy. By introducing underexposure detection, the system can simultaneously handle both overexposure and underexposure anomalies. This enables bidirectional dynamic adjustment of the line light source brightness, allowing for both brightness reduction to suppress overexposure and brightness increase to improve underexposure, enabling the system to adapt to a wider range of reflectivity variations.

[0023] Repeat the above steps until the object under test is detected. After detection, restore the brightness of the line light source to its initial value. As the object moves longitudinally, the material and reflective properties of its surface may continuously change at different locations. The adjusted light source brightness may become unsuitable again as the object moves to a new area, thus requiring continuous monitoring and dynamic adjustment. Brightness restoration after detection ensures the system is in a known initial state at the start of the next detection. This achieves full-process dynamic closed-loop control of the line light source brightness, adaptively following spatial changes in the reflective properties of the object's surface, ensuring signal quality remains controllable throughout the detection process. Furthermore, the consistent initial state for each detection guarantees measurement consistency and repeatability.

[0024] As a first embodiment for reducing the brightness of a line light source, the method specifically includes: gradually reducing the driving voltage of the line light source in preset fixed step sizes; after each step reduction, re-evaluating whether the overexposure rate of all spectral response curves is greater than the overexposure rate threshold, until the overexposure rate is less than or equal to the overexposure rate threshold or the brightness of the line light source reaches a preset safety lower limit. Adjusting the brightness of a light source by changing the driving voltage is a conventional control method for line light sources. Fixed-step gradual adjustment is a simple and reliable closed-loop control strategy. Feedback judgment is performed after each adjustment, avoiding a one-time over-adjustment that could cause the signal to change directly from overexposure to underexposure. The implementation is simple, the control logic is clear, and the reliability is high. The method of gradually approaching the target value effectively avoids adjustment overshoot and ensures system stability.

[0025] As a second embodiment for reducing the brightness of a line light source, it specifically includes: if the number of overexposed spectral response curves is greater than or equal to a first selection threshold, after reducing the brightness of the line light source, the target driving voltage of the line light source is calculated using the following formula: U j =U j-1 +k1×(T over_2 -R over )×U s1 ; U j U is the target driving voltage corresponding to the position in row j. j-1 For the target driving voltage corresponding to the (j-1)th row position, in the first iteration, U j-1 To calibrate the default driving voltage of the line light source at the start, k1 is a preset first proportional coefficient, T over_2 R is the overexposure threshold. over For overexposure rate, U s1 This is the preset first voltage parameter.

[0026] When the overexposure rate R over greater than the overexposure threshold T over_2 At that time, (T) over_2 -R over A negative ΔU value indicates that brightness needs to be reduced (a negative ΔU indicates a reduction). The larger the difference, the more severe the overexposure, and the greater the adjustment required. Compared to fixed-step adjustment, this mapping function-based adjustment method can dynamically adjust the adjustment range according to the severity of overexposure. It provides a large adjustment for rapid response when overexposure is severe, and a small adjustment for fine control when overexposure is slight, achieving a balance between adjustment efficiency and adjustment precision.

[0027] As a third embodiment for reducing the brightness of a line light source, it specifically includes: if the number of overexposed spectral response curves is less than a first selection threshold, after reducing the brightness of the line light source, the target driving voltage calculation formula for the line light source is: U j =U j-1 +k2×(Tover_1 -X over )×U s2 ; U j U is the target driving voltage corresponding to the position in row j. j-1 For the target driving voltage corresponding to the (j-1)th row position, in the first iteration, U j-1 To calibrate the default driving voltage of the line light source at the start, k2 is a preset second proportional coefficient, and T over_1 X is the overexposure threshold. over U is the average overexposure value, which is the average of the ratios corresponding to the spectral response curves of all overexposures. s2 This is the preset second voltage parameter.

[0028] Overexposure rate reflects the "quantity" of overexposure, while average overexposure value reflects the "degree" of overexposure; a higher ratio indicates more severe saturation. The mapping function described above uses the difference between the average overexposure value and the overexposure threshold to measure the severity of overexposure; the larger the difference, the greater the adjustment required. Specific adjustments can be made based on the actual needs of the scenario.

[0029] While overexposure is a critical concern, in actual testing, it's possible for the surface of the object to simultaneously contain both high-reflectivity areas (leading to overexposure) and low-reflectivity areas (leading to underexposure) in a horizontal position. Therefore, in addition to determining whether the overexposure rate exceeds the overexposure rate threshold, it's also necessary to determine: If the overexposure rate is less than or equal to the overexposure rate threshold and the underexposure rate is greater than the underexposure rate threshold, then increase the brightness of the line light source. If the overexposure rate is greater than the overexposure rate threshold and the underexposure rate is greater than or equal to the underexposure rate threshold, then the current brightness will remain unchanged.

[0030] When overexposure and underexposure coexist (indicating a significant difference in reflectivity), maintaining the current brightness will prevent ineffective adjustments that compromise one aspect for the other.

[0031] As a first embodiment for increasing the brightness of a line light source, the specific implementation includes: if the number of underexposed spectral response curves is greater than or equal to a second selection threshold, the target driving voltage of the line light source is calculated using the following formula after increasing the brightness: U j =U j-1 +k3×(R under -T under_2 )×U s3 ; U j U is the target driving voltage corresponding to the position in row j. j-1 For the target driving voltage corresponding to the (j-1)th row position, in the first iteration, U j-1To calibrate the default driving voltage of the line light source at the start, k3 is a preset third proportional coefficient, R under Due to underexposure, T under_2 U is the underexposure threshold. s3 This is the preset third voltage parameter.

[0032] When underexposure R under Exceeding the underexposure threshold T under_2 At this time, it is necessary to increase the brightness of the line light source to enhance the signal strength in low reflectivity areas. The larger the difference, the more severe the underexposure, and the greater the required brightness increase. Quantitative adjustment based on the underexposure rate is achieved, with the adjustment range positively correlated with the severity of underexposure, balancing response speed and adjustment accuracy.

[0033] As a second embodiment for increasing the brightness of a line light source, it specifically includes: if the number of underexposed spectral response curves is less than a second selection threshold, the target driving voltage of the line light source is calculated using the following formula after increasing the brightness: U j =U j-1 +k4×(X under -T under_1 )×U s4 ; U j U is the target driving voltage corresponding to the position in row j. j-1 For the target driving voltage corresponding to the (j-1)th row position, in the first iteration, U j-1 To calibrate the default driving voltage of the line light source at the start, k4 is the preset fourth proportional coefficient, X under This is the average underexposure value, which is the average difference between the brightness peak value and the underexposure threshold value of all underexposure spectral response curves. T under_1 U is the underexposure threshold. s4 This is the preset fourth voltage parameter.

[0034] The average underexposure value reflects the severity of underexposure. The larger the difference between the peak brightness and the underexposure threshold, the more severe the underexposure, and the greater the required increase in brightness. Specific strategies can be adjusted according to the actual needs of the scenario.

[0035] To ensure proper adjustment of the line light source, the driving voltage of the current line light source is monitored in real time. If the calculated adjusted driving voltage deviates from the safe threshold range, the current brightness is maintained. The driving voltage of the line light source has a safe upper limit (to prevent damage to the light source) and a safe lower limit (to ensure normal operation of the light source). The calculated adjustment range may cause the driving voltage to exceed this safe range. In this case, canceling the adjustment can protect the hardware from damage, improving the safety and reliability of the system.

[0036] like Figure 3As shown, the present invention also provides a line source adjustment system based on line spectral confocalization, comprising: The spectral acquisition module is used to acquire the spectral response curves of all pixel positions in the current lateral region of interest on the surface of the object under test, where the brightness peak value is greater than the lower threshold. The overexposure analysis module is used to analyze the ratio of the wavelength span corresponding to the saturation brightness range to the wavelength span corresponding to the effective brightness range in each spectral response curve. If the ratio is greater than the overexposure threshold, the corresponding spectral response curve is considered overexposed. The underexposure analysis module is used to analyze whether the brightness peak in each spectral response curve is less than or equal to the preset underexposure threshold. If so, the corresponding spectral response curve is considered underexposure. The brightness adjustment module is used to adjust and control the brightness of the line light source; The overexposure judgment module is used to determine whether the overexposure rate of all spectral response curves is greater than the overexposure rate threshold. If not, the current brightness remains unchanged. If so, the brightness adjustment module is triggered to reduce the brightness of the line light source, and the overexposure rate of all spectral response curves is re-judged after each reduction until the overexposure rate is less than or equal to the overexposure rate threshold or the brightness of the line light source reaches the preset safety lower limit. In this system, the object under test moves longitudinally, and the linear light beam emitted by the line light source is distributed laterally; the saturation brightness range represents a value greater than or equal to a preset upper threshold, and the effective brightness range represents a value greater than or equal to a preset lower threshold; the overexposure rate is the ratio of the number of overexposed spectral response curves to the total number of spectral response curves collected from all pixel positions in the horizontal direction; the underexposure rate is the ratio of the number of underexposed spectral response curves to the total number of spectral response curves collected from all pixel positions in the horizontal direction.

[0037] The actual operation of the adjustment system can refer to the adjustment method described above, and will not be repeated here.

[0038] The present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described adjustment method.

[0039] In practical applications, a computer-readable storage medium can be any combination of one or more computer-readable media. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this embodiment, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0040] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit programs for use by or in connection with an instruction execution system, apparatus, or device.

[0041] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wire, optical fiber, RF, or any suitable combination thereof.

[0042] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via an Internet service provider).

[0043] In the description of this specification, references to terms such as "an embodiment," "example," and "specific example" indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0044] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claimed invention.

Claims

1. A method for adjusting a line source based on line spectral confocalization, characterized in that, include: Collect the spectral response curves of all pixel positions in the current lateral region of interest on the surface of the object under test where the brightness peak is greater than the lower threshold. Analyze the ratio of the wavelength span corresponding to the saturation brightness range to the wavelength span corresponding to the effective brightness range in each spectral response curve. If the ratio is greater than the overexposure threshold, the corresponding spectral response curve is considered overexposed. Determine whether the overexposure rate of all spectral response curves is greater than the overexposure rate threshold: if not, maintain the current brightness; if the overexposure rate is greater than the overexposure rate threshold and the underexposure rate is less than or equal to the underexposure rate threshold, reduce the brightness of the line light source, and re-determine the overexposure rate of all spectral response curves after each reduction, until the overexposure rate is less than or equal to the overexposure rate threshold or the brightness of the line light source reaches the preset safety lower limit. In this system, the object under test moves longitudinally, and the linear light beam emitted by the line source is distributed laterally; the saturation brightness range represents a value greater than or equal to a preset upper threshold, and the effective brightness range represents a value greater than or equal to a preset lower threshold; the overexposure rate is the ratio of the number of overexposed spectral response curves to the total number of spectral response curves collected from all pixel positions laterally; the underexposure rate is the ratio of the number of underexposed spectral response curves to the total number of spectral response curves collected from all pixel positions laterally, wherein the underexposure indicates that the brightness peak of the spectral response curve is less than or equal to a preset underexposure threshold, and the lower threshold is less than the underexposure threshold.

2. The method for adjusting a line source based on line spectral confocalization according to claim 1, characterized in that, The reduction of line light source brightness includes: gradually reducing the driving voltage of the line light source in a preset fixed step size, and after each reduction, re-evaluating whether the overexposure rate of all spectral response curves is greater than the overexposure rate threshold, until the overexposure rate is less than or equal to the overexposure rate threshold or the line light source brightness reaches the preset safety lower limit.

3. The method for adjusting a line source based on line spectral confocalization according to claim 1, characterized in that, If the number of overexposed spectral response curves is greater than or equal to the first selection threshold, after reducing the brightness of the line source, the formula for calculating the target driving voltage of the line source is: U j =U j-1 +k1×(T over_2 -R over )×U s1 ; U j U is the target driving voltage corresponding to the position in row j. j-1 For the target driving voltage corresponding to the (j-1)th row position, in the first iteration, U j-1 To calibrate the default driving voltage of the line light source at the start, k1 is a preset first proportional coefficient, T over_2 R is the overexposure threshold. over For overexposure rate, U s1 This is the preset first voltage parameter.

4. The method for adjusting a line source based on line spectral confocalization according to claim 1, characterized in that, If the number of overexposed spectral response curves is less than the first selection threshold, after reducing the brightness of the line source, the formula for calculating the target driving voltage of the line source is: U j =U j-1 +k2×(T over_1 -X over )×U s2 ; U j U is the target driving voltage corresponding to the position in row j. j-1 For the target driving voltage corresponding to the (j-1)th row position, in the first iteration, U j-1 To calibrate the default driving voltage of the line light source at the start, k2 is a preset second proportional coefficient, and T over_1 X is the overexposure threshold. over U is the average overexposure value, which is the average of the ratios corresponding to the spectral response curves of all overexposures. s2 This is the preset second voltage parameter.

5. The method for adjusting a line source based on line spectral confocalization according to claim 1, characterized in that, While determining whether the overexposure rate is greater than the overexposure rate threshold, it is also determined that: If the overexposure rate is less than or equal to the overexposure rate threshold and the underexposure rate is greater than the underexposure rate threshold, then increase the brightness of the line light source. If the overexposure rate is greater than the overexposure rate threshold and the underexposure rate is greater than or equal to the underexposure rate threshold, then the current brightness will remain unchanged.

6. The method for adjusting a line source based on line spectral confocalization according to claim 5, characterized in that, After increasing the brightness of the line light source, if the number of underexposed spectral response curves is greater than or equal to the second selection threshold, the formula for calculating the target driving voltage of the line light source is: U j =U j-1 +k3×(R under -T under_2 )×U s3 ; U j U is the target driving voltage corresponding to the position in row j. j-1 For the target driving voltage corresponding to the (j-1)th row position, in the first iteration, U j-1 To calibrate the default driving voltage of the line light source at the start, k3 is a preset third proportional coefficient, R under Due to underexposure, T under_2 U is the underexposure threshold. s3 This is the preset third voltage parameter.

7. The method for adjusting a line source based on line spectral confocalization according to claim 5, characterized in that, If the number of underexposed spectral response curves is less than the second selection threshold, the formula for calculating the target driving voltage of the line light source after increasing its brightness is as follows: U j =U j-1 +k4×(X under -T under_1 )×U s4 ; U j U is the target driving voltage corresponding to the position in row j. j-1 For the target driving voltage corresponding to the (j-1)th row position, in the first iteration, U j-1 To calibrate the default driving voltage of the line light source at the start, k4 is the preset fourth proportional coefficient, X under This is the average underexposure value, which is the average difference between the brightness peak value and the underexposure threshold value of all underexposure spectral response curves. T under_1 U is the underexposure threshold. s4 This is the preset fourth voltage parameter.

8. A method for adjusting a line source based on line spectral confocalization according to any one of claims 1-7, characterized in that, The driving voltage of the current line light source is monitored in real time. If the calculated adjusted driving voltage is found to be outside the safe threshold range, the current driving voltage is maintained and the subsequent steps are executed.

9. A line source adjustment system based on line spectral confocalization, characterized in that, include: The spectral acquisition module is used to acquire the spectral response curves of all pixel positions in the current lateral region of interest on the surface of the object under test, where the brightness peak value is greater than the lower threshold. The overexposure analysis module is used to analyze the ratio of the wavelength span corresponding to the saturation brightness range to the wavelength span corresponding to the effective brightness range in each spectral response curve. If the ratio is greater than the overexposure threshold, the corresponding spectral response curve is considered overexposed. The underexposure analysis module is used to analyze whether the brightness peak in each spectral response curve is less than or equal to the preset underexposure threshold. If so, the corresponding spectral response curve is considered underexposure. The brightness adjustment module is used to adjust and control the brightness of the line light source; The overexposure detection module is used to determine whether the overexposure rate of all spectral response curves is greater than the overexposure rate threshold at this time: if not, the current brightness is maintained. If so, the brightness adjustment module is triggered to reduce the brightness of the line light source, and after each reduction, the overexposure rate of all spectral response curves is re-evaluated until the overexposure rate is less than or equal to the overexposure rate threshold or the brightness of the line light source reaches the preset safety lower limit. In this system, the object under test moves longitudinally, and the linear light beam emitted by the line light source is distributed laterally; the saturation brightness range represents a value greater than or equal to a preset upper threshold, and the effective brightness range represents a value greater than or equal to a preset lower threshold; the overexposure rate is the ratio of the number of overexposed spectral response curves to the total number of spectral response curves collected from all pixel positions in the horizontal direction; the underexposure rate is the ratio of the number of underexposed spectral response curves to the total number of spectral response curves collected from all pixel positions in the horizontal direction.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the adjustment method as described in any one of claims 1-8.