Laser confocal scanning microscope, scanning image distortion correction method and acquisition card

CN120405922BActive Publication Date: 2026-08-14MOTIC CHINA GROUP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-01
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0004]本申请的目的旨在至少能解决上述的技术缺陷之一,特别是现有技术中采用检流计/共振的双振镜扫描方式对样品进行扫描时,受机械运动误差和电信号延迟等因素影响,导致扫描获得的图像发生畸变,进而影响图像质量的技术缺陷

Benefits of technology

[0068]本申请提供的激光共焦扫描显微镜、扫描图像畸变校正方法及采集卡,该激光共焦扫描显微镜不仅包括激光光源、共振振镜、检流计振镜、分光镜、激发光路、共焦光路和第一探测器,还包括在共振振镜和检流计振镜之间固定安装的透反镜,在透反镜的透射方向设置的监测光路和第二探测器,以及分别与第一探测器和第二探测器连接的采集卡;其中,本申请的显微镜在对样品进行扫描时,激光光源发射的光束通过分光镜反射至共振振镜,共振振镜对入射的光束进行首次偏转后发射至透反镜,透反镜将大部分光束反射至检流计振镜,检流计振镜对入射的光束进行二次偏转后,通过激发光路将偏转后的光束聚焦至样品表面,样品表面被激发的反射光沿原路返回,经分光镜透射至共焦光路,并由共焦光路到达第一探测器,透反镜将小部分光束透射至监测光路,并由监测光路将共振振镜的实时偏转角度转换为光栅信号后,发送至第二探测器;采集卡同步等时采集第一探测器输出的共焦信号和第二探测器输出的光栅信号,并生成与共焦信号对应的物面图像以及与光栅信号对应的光栅图像后,将物面图像分解为奇数行物面子图和偶数行物面子图,以及将光栅图像分解为奇数行光栅子图和偶数行光栅子图后,利用奇数行光栅子图对奇数行物面子图进行畸变校正,同时利用偶数行光栅子图对所述偶数行物面子图进行畸变校正,并将校正后的奇数行物面子图与校正后的偶数行物面子图进行合并,即可得到目标图像。该过程中,采集卡同步等时采集到的共焦信号和光栅信号为时间和空间上的孪生图像,其中由光栅信号形成的光栅图像刻画了扫描过程中共振振镜的运动,因此,本申请通过对光栅图像的畸变分析,即可对与其孪生的物面图像进行畸变校正,从而有效提高校正精准度,且不易受环境、寿命以及光路偏差等因素的影响。并且,本申请充分考虑振镜在运动过程中可能产生的以及数据采集过程中存在的延时误差等影响因素,在畸变校正过程中,将光栅图像和物面图像均分解成对应的奇数行子图和偶数行子图,并利用奇数行子图和偶数行子图分别进行校正,以此来进一步提高畸变校正的准确度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120405922B_ABST
    Figure CN120405922B_ABST
Patent Text Reader

Abstract

This application provides a laser confocal scanning microscope, a scanning image distortion correction method, and a data acquisition card. The laser confocal scanning microscope includes a mirror fixedly installed between a resonant galvanometer mirror and a galvanometer mirror; a monitoring optical path and a second detector positioned along the transmission direction of the mirror; and a data acquisition card connected to both the first and second detectors. The confocal signal and grating signal, synchronously and isochronously acquired by the data acquisition card, form temporal and spatial twin images. The grating image formed by the grating signal depicts the motion of the resonant galvanometer mirror during scanning. Therefore, this application can correct the distortion of its twin object surface image by analyzing the distortion of the grating image, thereby effectively improving the correction accuracy and making it less susceptible to environmental factors, lifespan, and optical path deviations. Furthermore, this application performs correction using odd-numbered and even-numbered row subimages separately during the distortion correction process to further improve the accuracy of distortion correction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to a laser confocal scanning microscope, a scanning image distortion correction method, and an acquisition card. Background Technology

[0002] Industrial confocal microscopes, as high-precision, high-value-added measuring instruments, are powerful tools for measuring the surface morphology of objects, playing a crucial role in the research, development, production, and testing of materials including ceramics, metals, and semiconductors. Currently, confocal laser scanning has evolved into various scanning imaging methods, including galvanometer / resonance-based dual-mirror scanning, MEMS (Micro-Electro-Mechanical Systems) based galvanometer scanning, Nipkow-based disk scanning, and line scanning. Among these, galvanometer / resonance-based dual-mirror scanning has become mainstream due to its cost and technological maturity. Dual-mirror scanning includes unidirectional and bidirectional scanning modes. In unidirectional scanning, the galvanometer mirror on the Y-axis immediately steps a step when the resonant mirror on the X-axis reaches one end (e.g., the left end). After the step is completed, the X-axis begins the next scan, and the above process is repeated. In bidirectional scanning, the galvanometer mirror steps a step when the resonant mirror reaches either end, thus achieving rapid scanning of the sample.

[0003] In theory, resonant scanning is designed to perform simple harmonic motion at a predetermined resonant frequency, with its angular velocity being maximum at the center and zero at both ends. This causes distortion in the images acquired using isochronous sampling. Furthermore, due to possible mechanical motion errors and electrical signal delays, the image signals acquired during bidirectional scanning will also experience aliasing in the horizontal direction, resulting in even greater distortion and lower image quality in the final product. Summary of the Invention

[0004] The purpose of this application is to at least solve one of the above-mentioned technical defects, in particular the technical defect in the prior art where the scanning of a sample using a galvanometer / resonance dual-mirror scanning method is affected by factors such as mechanical motion error and electrical signal delay, resulting in image distortion and thus affecting image quality.

[0005] This application provides a laser confocal scanning microscope, including a laser source, a resonant galvanometer, a galvanometer galvanometer, a beam splitter, an excitation optical path, a confocal optical path, and a first detector. The microscope also includes: a transflector fixedly installed between the resonant galvanometer and the galvanometer galvanometer, a monitoring optical path and a second detector arranged in the transmission direction of the transflector, and a data acquisition card connected to the first detector and the second detector respectively.

[0006] In this process, when the microscope scans the sample, the laser light emitted by the laser source is reflected by the beam splitter to the resonant mirror. The resonant mirror deflects the incident light beam for the first time and then emits it to the transmission mirror. The transmission mirror reflects most of the light beam to the galvanometer mirror. The galvanometer mirror deflects the incident light beam a second time and then focuses the deflected light beam onto the sample surface through the excitation optical path. The reflected light excited by the sample surface returns along the original path, is transmitted through the beam splitter to the confocal optical path, and reaches the first detector through the confocal optical path. The transmission mirror transmits a small portion of the light beam to the monitoring optical path, and the monitoring optical path converts the real-time deflection angle of the resonant mirror into a grating signal, which is then sent to the second detector.

[0007] The acquisition card synchronously and isochronously acquires the confocal signal output by the first detector and the grating signal output by the second detector, and generates an object surface image corresponding to the confocal signal and a grating image corresponding to the grating signal. The object surface image is then decomposed into odd-row object surface sub-images and even-row object surface sub-images, and the grating image is also decomposed into odd-row grating sub-images and even-row grating sub-images. Distortion correction is performed on the odd-row object surface sub-images using the odd-row grating sub-images, and on the even-row object surface sub-images using the even-row grating sub-images. Finally, the corrected odd-row object surface sub-images and the corrected even-row object surface sub-images are merged to obtain the target image.

[0008] Optionally, the monitoring optical path includes an attenuator and a Ronche grating;

[0009] The attenuator attenuates the transmitted light beam before it is emitted to the Ronchi grating, and the Ronchi grating converts the real-time deflection angle of the resonant mirror into a grating signal based on the attenuated light beam.

[0010] This application also provides a scanning image distortion correction method, applied to the acquisition card in the laser confocal scanning microscope described in any of the above embodiments, the method comprising:

[0011] The confocal signal output by the first detector and the grating signal output by the second detector are acquired synchronously and isochronously, and an object surface image corresponding to the confocal signal and a grating image corresponding to the grating signal are generated.

[0012] The object surface image is decomposed into odd-row object surface sub-images and even-row object surface sub-images, and the raster image is decomposed into odd-row raster sub-images and even-row raster sub-images.

[0013] Distortion correction is performed on the odd-numbered row object surface sub-image using the odd-numbered row raster sub-image, and distortion correction is performed on the even-numbered row object surface sub-image using the even-numbered row raster sub-image;

[0014] The corrected odd-numbered object surface image is merged with the corrected even-numbered object surface image to obtain the target image.

[0015] Optionally, before performing distortion correction on the odd-numbered row object surface sub-image using the odd-numbered row raster sub-image, and before performing distortion correction on the even-numbered row object surface sub-image using the even-numbered row raster sub-image, the method further includes:

[0016] When bidirectional scanning of the resonant mirror is detected, the grid sequence of the odd-numbered row grating sub-image is aligned with that of the even-numbered row grating sub-image, and the odd-numbered row object surface sub-image is distorted using the aligned odd-numbered row grating sub-image, and the even-numbered row object surface sub-image is distorted using the aligned even-numbered row grating sub-image.

[0017] Optionally, aligning the raster sequences of the odd-row raster sub-image and the even-row raster sub-image to obtain aligned odd-row and even-row raster sub-images includes:

[0018] Peak fitting is performed on each column of the odd-numbered row raster sub-image to obtain a first peak sequence, and a first interval sequence is determined based on the interval between adjacent peaks in the first peak sequence.

[0019] Peak fitting is performed on each column of the even-numbered row raster sub-image to obtain a second peak sequence, and a second interval sequence is determined based on the interval between adjacent peaks in the second peak sequence.

[0020] Based on the first interval sequence and the second interval sequence, a first subsequence overlapping with the second peak sequence is extracted from the first peak sequence, and a second subsequence overlapping with the first peak sequence is extracted from the second peak sequence;

[0021] After extracting the gratings located in the interval determined by the beginning and end of the first subsequence from the odd-row raster subgraph, an aligned odd-row raster subgraph is formed; and after extracting the gratings located in the interval determined by the beginning and end of the second subsequence from the even-row raster subgraph, an aligned even-row raster subgraph is formed.

[0022] Optionally, the step of extracting a first subsequence overlapping with the second peak sequence from the first peak sequence based on the first interval sequence and the second interval sequence, and extracting a second subsequence overlapping with the first peak sequence from the second peak sequence, includes:

[0023] Identify overlapping subsequences in the first interval sequence and the second interval sequence whose similarity exceeds a preset similarity threshold;

[0024] Based on the overlapping subsequences, a first subsequence overlapping with the second peak sequence is extracted from the first peak sequence, and a second subsequence overlapping with the first peak sequence is extracted from the second peak sequence.

[0025] Optionally, the step of using the odd-numbered row raster sub-image to perform distortion correction on the odd-numbered row object surface sub-image to obtain the target image includes:

[0026] Determine the position of at least one grid cell in each pixel row of the odd-numbered row raster sub-image;

[0027] The odd-numbered row object surface sub-image is corrected row by row based on the position of the at least one grid in each pixel row to obtain the target image.

[0028] Optionally, determining the position of at least one grid cell in the odd-numbered row raster sub-image within each pixel row includes:

[0029] If the current scene is a high-precision scene, then determine the position of all grids in each pixel row of the odd-numbered raster sub-image;

[0030] If the current scene is a real-time scene and the resonant galvanometer is scanned in one direction, then the position of the raster of interest in each pixel row of the odd-numbered row raster sub-image is determined.

[0031] Optionally, determining the position of all gratings in each pixel row of the odd-numbered row raster sub-image includes:

[0032] Determine the row brightness curve corresponding to the column brightness value in each pixel row of the odd-numbered row raster sub-image;

[0033] The row brightness curves of each pixel row are smoothed, and peak fitting is performed on the smoothed row brightness curves until the number of peaks in each pixel row is equal, thus obtaining the third peak sequence of each pixel row.

[0034] The positions of all gratings in each pixel row of the odd-numbered raster submap are determined based on the third peak sequence of each pixel row.

[0035] Optionally, the process of smoothing the row brightness curves of each pixel row and performing peak fitting on the smoothed row brightness curves until the number of peaks in each pixel row is equal, to obtain the third peak sequence of each pixel row, includes:

[0036] Set the current value of the smoothing radius;

[0037] Based on the current values, the row brightness curves of each pixel row are smoothed, and peak fitting is performed on the smoothed row brightness curves to obtain the preliminary peak position sequence of each pixel row.

[0038] The initial peak position sequence of each pixel row is compared. If the number of peaks in at least one pixel row is not equal to the number of peaks in other pixel rows, the current value is updated, and the smoothing process of the row brightness curve of each pixel row based on the current value and subsequent steps are continued until the number of peaks in each pixel row is equal.

[0039] If the number of peaks in each pixel row is equal, then the preliminary peak position sequence of each pixel row is taken as the final third peak sequence.

[0040] Optionally, determining the position of the raster in each pixel row of the region of interest in the odd-row raster sub-image includes:

[0041] The column mean brightness curve corresponding to the brightness value of each pixel row in each column of the odd-numbered row raster sub-image is determined, and the fourth peak sequence is obtained by performing peak fitting on the column mean brightness curve of each column.

[0042] The region of interest in the odd-row raster sub-image is cropped according to the fourth peak sequence, and the peak position of each pixel row is extracted from the cropped odd-row raster sub-image as the position of the raster of the region of interest in each pixel row.

[0043] Optionally, the step of cropping the region of interest of the odd-row raster sub-image according to the fourth peak sequence includes:

[0044] Determine the number of peaks in the fourth peak sequence;

[0045] Based on the number of peaks in the fourth peak sequence, determine the starting and ending positions when clipping the odd-numbered row raster sub-image;

[0046] The regions of interest in the odd-numbered raster sub-images are cropped based on the starting and ending positions.

[0047] Optionally, the step of performing row-by-row correction on the odd-row object surface image based on the position of the at least one grid in each pixel row to obtain the corrected odd-row object surface image includes:

[0048] Obtain the first blank image to be filled, wherein the image height of the first blank image is the same as the image height of the odd-numbered row object sub-image;

[0049] Based on the positions of all grids in the odd-row raster sub-image at each pixel row, the brightness values ​​of the corresponding pixel rows in the odd-row object surface sub-image are sampled in segments, and the sampled brightness values ​​are sequentially filled into the first blank image to obtain the corrected odd-row object surface sub-image.

[0050] Optionally, the step of performing row-by-row correction on the odd-row object surface image based on the position of the at least one grid in each pixel row to obtain the corrected odd-row object surface image includes:

[0051] Based on the position of the raster in the region of interest in the odd-numbered raster sub-image in each pixel row, the odd-numbered raster sub-image is aligned row by row to obtain the aligned odd-numbered raster sub-image.

[0052] Based on the position of the raster of interest in each pixel row in the odd-row raster sub-image, the odd-row object surface sub-image is aligned row by row to obtain the aligned odd-row object surface image.

[0053] The aligned odd-row object surface sub-image is corrected row by row based on the aligned odd-row raster sub-image to obtain the corrected odd-row object surface sub-image.

[0054] Optionally, the step of aligning the odd-row raster sub-image row by row according to the position of the raster in the region of interest in each pixel row to obtain the aligned odd-row raster sub-image includes:

[0055] Based on the position of the raster of interest in the odd-row raster sub-image in each pixel row, determine the maximum and minimum values ​​of the positions in all pixel rows, and determine the original image width of the odd-row raster sub-image;

[0056] The sampling interval for resampling the odd-numbered raster sub-image is determined based on the maximum value, the minimum value, and the original image width;

[0057] Obtain the second blank image to be filled, the image height of the second blank image being the same as the image height of the odd-numbered row raster sub-image;

[0058] The odd-numbered raster sub-image is resampled within the sampling interval, and the resampled brightness values ​​are sequentially filled into the second blank image to obtain the aligned odd-numbered raster sub-image.

[0059] Optionally, the step of aligning the odd-row object surface sub-image row by row according to the position of the raster of interest in each pixel row in the odd-row raster sub-image to obtain the aligned odd-row object surface image includes:

[0060] Obtain the third blank image to be filled, wherein the image height of the third blank image is the same as the image height of the odd-numbered row object sub-image;

[0061] The odd-numbered object surface sub-image is resampled within the sampling interval, and the resampled brightness values ​​are sequentially filled into the third blank image to obtain the aligned odd-numbered object surface sub-image.

[0062] Optionally, the step of performing row-by-row correction on the aligned odd-row object surface sub-image based on the aligned odd-row raster sub-image to obtain the corrected odd-row object surface image includes:

[0063] The column mean curve corresponding to the brightness value of each pixel row in each column of the aligned odd-row raster sub-image is determined, and after peak fitting of each column mean curve, multiple fifth peak sequences are obtained.

[0064] Obtain the fourth blank image to be filled, wherein the image height of the fourth blank image is the same as the image height of the aligned odd-numbered row object sub-image;

[0065] Based on the position of each fifth peak sequence, the brightness values ​​of the corresponding pixel rows in the aligned odd-row object surface sub-image are sampled in segments, and the sampled brightness values ​​are sequentially filled into the fourth blank image to obtain the corrected odd-row object surface sub-image.

[0066] This application also provides a data acquisition card that stores computer-readable instructions. When executed by one or more processors, the computer-readable instructions cause the one or more processors to perform the steps of the scanned image distortion correction method as described in any of the above embodiments.

[0067] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:

[0068] This application provides a laser confocal scanning microscope, a scanning image distortion correction method, and a data acquisition card. The laser confocal scanning microscope includes not only a laser source, a resonant mirror, a galvanometer mirror, a beam splitter, an excitation optical path, a confocal optical path, and a first detector, but also a reflective mirror fixedly installed between the resonant mirror and the galvanometer mirror, a monitoring optical path and a second detector positioned along the transmission direction of the reflective mirror, and a data acquisition card connected to both the first and second detectors. When scanning a sample, the laser beam emitted by the microscope is reflected by the beam splitter to the resonant mirror. The resonant mirror initially deflects the incident beam before reflecting it to the reflective mirror. The reflective mirror then reflects most of the beam to the galvanometer mirror. The galvanometer mirror performs a secondary deflection on the incident beam and focuses the deflected beam onto the sample surface via the excitation optical path. The reflected light excited on the sample surface travels along the original path... The beam returns and is transmitted through a beam splitter to a confocal optical path, which then reaches the first detector. A small portion of the beam is transmitted through a mirror to a monitoring optical path, where the real-time deflection angle of the resonant mirror is converted into a grating signal and sent to the second detector. The acquisition card synchronously acquires the confocal signal output from the first detector and the grating signal output from the second detector, generating an object surface image corresponding to the confocal signal and a grating image corresponding to the grating signal. The object surface image is then decomposed into odd-row and even-row object surface sub-images, and the grating image is decomposed into odd-row and even-row grating sub-images. The odd-row object surface sub-images are then distorted using the odd-row grating sub-images, and the even-row object surface sub-images are distorted using the even-row grating sub-images. Finally, the distorted odd-row and even-row object surface sub-images are merged to obtain the target image. In this process, the confocal signal and grating signal acquired synchronously and isochronously by the acquisition card form temporal and spatial twin images. The grating image formed by the grating signal depicts the motion of the resonant galvanometer during scanning. Therefore, this application can correct the distortion of its twin object surface image by analyzing the distortion of the grating image, thereby effectively improving the correction accuracy and making it less susceptible to factors such as environment, lifespan, and optical path deviation. Furthermore, this application fully considers the influencing factors such as the delay error that may occur during the movement of the galvanometer and the delay error that exists during data acquisition. During the distortion correction process, both the grating image and the object surface image are decomposed into corresponding odd-numbered row subimages and even-numbered row subimages, and correction is performed using the odd-numbered row subimages and even-numbered row subimages respectively, thereby further improving the accuracy of distortion correction. Attached Figure Description

[0069] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0070] Figure 1 A schematic diagram of the structure of a laser confocal scanning microscope provided in this application embodiment;

[0071] Figure 2 This application provides an example of an optical path diagram illustrating beam splitting using a mirror.

[0072] Figure 3 A diagram illustrating a raster image during unidirectional scanning, provided in an embodiment of this application;

[0073] Figure 4 A diagram illustrating a raster image during bidirectional scanning, provided in an embodiment of this application;

[0074] Figure 5 A diagram illustrating the object surface image during unidirectional scanning provided in an embodiment of this application;

[0075] Figure 6 A diagram illustrating the object surface image during bidirectional scanning provided in an embodiment of this application;

[0076] Figure 7 This application provides a flowchart illustrating a method for correcting distortion in scanned images.

[0077] Figure 8 An illustration showing a deviation in the brightest position between two adjacent rows of the same grating provided in this application embodiment;

[0078] Figure 9 A schematic diagram of the row brightness curve corresponding to a pixel row in a raster image provided in an embodiment of this application;

[0079] Figure 10 A schematic diagram of the peak fitting result for one pixel row provided in an embodiment of this application;

[0080] Figure 11 This application provides a diagram illustrating the region of interest at the center of an odd-row raster sub-map as shown in the embodiments of this application.

[0081] Figure 12 This image illustrates the distortion correction performed on an odd-numbered object surface sub-image using a full raster alignment distortion correction algorithm, as provided in an embodiment of this application.

[0082] Figure 13This application provides a magnified comparison of the odd-numbered row raster sub-images before and after alignment in an embodiment of the present application.

[0083] Figure 14 The following are magnified comparison images of odd-numbered row surface maps before and after alignment, provided for embodiments of this application.

[0084] Figure 15 This is an image illustration showing the distortion correction of an odd-numbered object surface sub-image using a local raster alignment correction algorithm, as provided in an embodiment of this application. Detailed Implementation

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

[0086] In one embodiment, such as Figure 1 As shown, Figure 1 This is a schematic diagram of the structure of a laser confocal scanning microscope provided in an embodiment of this application. This application provides a laser confocal scanning microscope, including a laser source, a resonant galvanometer, a galvanometer, a beam splitter, an excitation optical path, a confocal optical path, and a first detector. The microscope also includes: a transflector fixedly installed between the resonant galvanometer and the galvanometer, a monitoring optical path and a second detector arranged in the transmission direction of the transflector, and a data acquisition card connected to the first detector and the second detector respectively.

[0087] In this process, when the microscope scans the sample, the laser beam emitted by the laser source is reflected by the beam splitter to the resonant mirror. The resonant mirror deflects the incident beam for the first time and then emits it to the transmission mirror. The transmission mirror reflects most of the beam to the galvanometer mirror. The galvanometer mirror deflects the incident beam a second time and then focuses the deflected beam onto the sample surface through the excitation optical path. The reflected light excited by the sample surface returns along the original path, is transmitted through the beam splitter to the confocal optical path, and reaches the first detector through the confocal optical path. The transmission mirror transmits a small portion of the beam to the monitoring optical path, and the monitoring optical path converts the real-time deflection angle of the resonant mirror into a grating signal, which is then sent to the second detector.

[0088] The acquisition card synchronously and isochronously acquires the confocal signal output by the first detector and the grating signal output by the second detector, and generates an object surface image corresponding to the confocal signal and a grating image corresponding to the grating signal. The object surface image is then decomposed into odd-row object surface sub-images and even-row object surface sub-images, and the grating image is also decomposed into odd-row grating sub-images and even-row grating sub-images. Distortion correction is performed on the odd-row object surface sub-images using the odd-row grating sub-images, and on the even-row object surface sub-images using the even-row grating sub-images. Finally, the corrected odd-row object surface sub-images and the corrected even-row object surface sub-images are merged to obtain the target image.

[0089] In this embodiment, as Figure 1 As shown, this application adds a motion acquisition optical path for a resonant galvanometer to the existing laser confocal scanning microscope equipped with a two-dimensional galvanometer. This acquisition optical path consists of a reflective mirror positioned between the resonant galvanometer and the galvanometer mirror, a monitoring optical path and a second detector positioned in the transmission direction of the reflective mirror, and acquisition cards connected to the first and second detectors respectively. Since the reflective mirror can selectively transmit or reflect light according to its wavelength, this application can reflect most of the excitation light to the sample while transmitting a small portion for monitoring the motion of the resonant galvanometer. This allows for real-time recording of the nonlinear motion (such as a sinusoidal waveform) of the resonant galvanometer using the monitoring optical path and the second detector. The acquisition card in this application can record two signals using the same timestamp, ensuring pixel-level alignment and allowing the pixel position remapping of the object surface image acquired by the first detector using the galvanometer motion data acquired by the second detector, thereby eliminating sinusoidal scanning distortion.

[0090] In this application, the transflector is fixedly mounted in the optical path between the resonant galvanometer and the galvanometer galvanometer. This ensures a constant beam splitting ratio and direction, and simplifies system calibration. Furthermore, the beam splitting ratio of the transflector can be set. For example, 95% of the energy in the beam received by the transflector can be used for sample scanning, and 5% can be used to feedback the galvanometer status. The specific ratio can be set according to actual conditions and is not limited here. This ensures that a high-resolution object surface image is obtained while the grating image acquired by the second detector eliminates scanning distortion of the object surface image.

[0091] Furthermore, the laser source of this application can provide monochromatic, high-brightness excitation light (such as Argon ion laser, semiconductor laser, etc.); the resonant mirror of this application can be a high-frequency resonant mirror (such as 4-12 kHz), and the galvanometer mirror can be a low-speed galvanometer mirror (such as 1-30 Hz); the excitation optical path of this application can include a scanning lens and an objective lens, which can focus the beam deflected by the galvanometer mirror onto the sample surface and collect the reflection / fluorescence signal; the confocal optical path of this application is located in front of the first detector to block the defocused light signal and improve the axial resolution; the first and second detectors of this application can use photomultiplier tubes (PMTs) or avalanche photodiodes (APDs) to convert the optical signal into an electrical signal.

[0092] For example, when performing unidirectional or bidirectional scanning on a sample, the resonant galvanometer oscillates at a high frequency in the form of a sine wave, driving the laser beam to scan rapidly back and forth on the sample surface. This process only utilizes the linear range of the sine wave (such as near the peaks or troughs) to acquire signals. In unidirectional scanning, the laser is usually turned off or data is discarded during the retrace phase (nonlinear range), while in bidirectional scanning, the laser beam effectively processes data in both directions. During this process, the galvanometer galvanometer steps in a sawtooth wave pattern, moving at least one step (corresponding to one row of pixels in the image) after completing each X-axis scan, and quickly resetting to the starting position at the end of the frame. After being deflected by the two-dimensional galvanometer and reflected by the mirror, the laser beam is focused onto the sample surface through the scanning lens and objective lens. The fluorescence or reflected light excited by the sample returns along the original path, is separated by the beam splitter, and reaches the first detector through the confocal optical path. The first detector converts the optical signal into an electrical signal and synchronizes it with the galvanometer position to construct a two-dimensional image pixel by pixel, i.e., the object surface image in this application. Furthermore, the mirror in this application can also transmit a small portion of the laser beam. This portion of the laser beam is collected by the monitoring optical path to convert the real-time deflection angle of the resonant mirror into a grating signal. The monitoring optical path is connected to a second detector, allowing the grating signal to be sent to the acquisition card. After image processing, the acquisition card obtains a grating image. Next, this application can use the grating image to correct distortion in the object surface image, thus obtaining the target image. For example, by determining the location of each grid cell in the grating image (the location of the maximum local brightness), the distortion level between two adjacent locations can be determined, and distortion correction can be performed based on this distortion level.

[0093] Furthermore, in the process of using raster images to correct distortion in object surface images, this application specifically notes that when the user selects bidirectional scanning, the galvanometer galvanometer on the Y-axis steps one step at each of the two key endpoints (such as the starting and returning ends) of the resonant galvanometer on the X-axis. Based on this phenomenon, we can clearly observe that all data acquisition processes starting from the starting end invariably result in image data that constitutes the odd-numbered rows of the image; correspondingly, data acquisition activities initiated from the returning end naturally form the even-numbered rows of the image. Therefore, to more accurately correct image distortion and fully consider the influencing factors such as the delay errors that may occur during galvanometer movement and data acquisition, this application proposes an innovative processing method: First, this application can decompose the object surface image into two parts: an odd-numbered row object surface sub-image and an even-numbered row object surface sub-image; similarly, this application also decomposes the raster image used for correction into an odd-numbered row raster sub-image and an even-numbered row raster sub-image accordingly. Based on this, the odd-row object surface sub-images are subjected to targeted distortion correction using odd-row raster sub-images, while the even-row object surface sub-images are subjected to corresponding distortion correction using even-row raster sub-images. Finally, the precisely corrected odd-row object surface sub-images and even-row object surface sub-images are seamlessly merged. Through this series of processing steps, a target image with effectively corrected distortion and significantly improved quality is finally generated.

[0094] In the above embodiments, the laser confocal scanning microscope includes not only a laser source, a resonant mirror, a galvanometer mirror, a beam splitter, an excitation optical path, a confocal optical path, and a first detector, but also a reflective mirror fixedly installed between the resonant mirror and the galvanometer mirror, a monitoring optical path and a second detector arranged in the transmission direction of the reflective mirror, and a data acquisition card connected to the first detector and the second detector respectively. When the microscope scans a sample, the laser beam emitted by the laser source is reflected by the beam splitter to the resonant mirror. The resonant mirror deflects the incident beam initially and then emits it to the reflective mirror. The reflective mirror reflects most of the beam to the galvanometer mirror. The galvanometer mirror deflects the incident beam a second time and then focuses the deflected beam onto the sample surface through the excitation optical path. The reflected light excited on the sample surface returns along the original path and is transmitted through the beam splitter to the confocal mirror. The optical path is established, and the light beam reaches the first detector via the confocal optical path. A small portion of the light beam is transmitted to the monitoring optical path via the mirror, and the real-time deflection angle of the resonant mirror is converted into a grating signal by the monitoring optical path and then sent to the second detector. The acquisition card synchronously and isochronously acquires the confocal signal output by the first detector and the grating signal output by the second detector, and generates an object surface image corresponding to the confocal signal and a grating image corresponding to the grating signal. The object surface image is then decomposed into odd-row object surface sub-images and even-row object surface sub-images, and the grating image is decomposed into odd-row grating sub-images and even-row grating sub-images. The odd-row object surface sub-images are then distorted using the odd-row grating sub-images, and the even-row object surface sub-images are distorted using the even-row grating sub-images. The distorted odd-row object surface sub-images and the distorted even-row object surface sub-images are then merged to obtain the target image. In this process, the confocal signal and grating signal acquired synchronously and isochronously by the acquisition card form temporal and spatial twin images. The grating image formed by the grating signal depicts the motion of the resonant galvanometer during scanning. Therefore, this application can correct the distortion of its twin object surface image by analyzing the distortion of the grating image, thereby effectively improving the correction accuracy and making it less susceptible to factors such as environment, lifespan, and optical path deviation. Furthermore, this application fully considers the influencing factors such as the delay error that may occur during the movement of the galvanometer and the delay error that exists during data acquisition. During the distortion correction process, both the grating image and the object surface image are decomposed into corresponding odd-numbered row subimages and even-numbered row subimages, and correction is performed using the odd-numbered row subimages and even-numbered row subimages respectively, thereby further improving the accuracy of distortion correction.

[0095] In one embodiment, such as Figure 2 As shown, Figure 2 This is a diagram illustrating the optical path for beam splitting using a mirror, as provided in an embodiment of this application. The monitoring optical path may include an attenuator and a Ronchi grating.

[0096] The attenuator attenuates the transmitted light beam before it is emitted to the Ronchi grating, and the Ronchi grating converts the real-time deflection angle of the resonant mirror into a grating signal based on the attenuated light beam.

[0097] In this embodiment, the monitoring optical path set in the transmission direction of the transflector may include an attenuator and a Ronche grating. The attenuator attenuates the transmitted light beam before it is emitted to the Ronche grating, preventing high-power laser (transmitted beam) from damaging the second detector. The Ronche grating converts the real-time deflection angle of the resonant mirror into a grating signal based on the attenuated beam. For example, the Ronche grating of this application can utilize the deflection of the resonant mirror to move the light beam on the grating, thereby generating a periodic light intensity signal. This periodic light intensity signal is the grating signal of this application, which directly maps to the real-time deflection angle of the resonant mirror. After processing by the acquisition card, the signal can be obtained as shown below. Figure 3 The grating image generated during unidirectional scanning shown corresponds to the horizontal direction of the resonant mirror's motion. Each image row corresponds to one resonant mirror motion cycle, and the distance between the grids reflects the mirror's motion, i.e., the distortion level at each location. Alternatively, it can be obtained as follows: Figure 4 The grating image generated during bidirectional scanning, as shown, has overlapping or sticking at multiple locations because the galvanometer mirror on the Y-axis steps one step at both key endpoints (such as the starting and returning ends) of the resonant mirror on the X-axis during bidirectional scanning. This application can process this through a subsequent distortion correction process to obtain a target image with higher image quality.

[0098] Simultaneously, the acquisition card of this application can also process the acquired confocal signal, which reflects the fluorescence / reflection light intensity distribution of the sample and is spatiotemporally aligned with the grating signal. Therefore, this application can generate an image such as... after image processing of the confocal signal. Figure 5 The object surface image shown during unidirectional scanning, or as... Figure 6 The object surface image shown is obtained during bidirectional scanning. Then, the galvanometer motion data reflected in the grating image is used to correct the distortion of the object surface image, thereby effectively improving the accuracy of distortion correction while avoiding the influence of factors such as environment, lifespan, and optical path deviation.

[0099] In one embodiment, such as Figure 7 As shown, Figure 7 This application provides a flowchart illustrating a scanning image distortion correction method according to an embodiment of the present application. The present application also provides a scanning image distortion correction method applied to the acquisition card in a laser confocal scanning microscope as described in any of the above embodiments. The method may include:

[0100] S110: Synchronously acquire the confocal signal output by the first detector and the grating signal output by the second detector, and generate an object surface image corresponding to the confocal signal and a grating image corresponding to the grating signal.

[0101] S120: Decompose the object surface image into odd-row object surface sub-images and even-row object surface sub-images, and decompose the raster image into odd-row raster sub-images and even-row raster sub-images;

[0102] S130: Perform distortion correction on odd-row object surface sub-images using odd-row raster sub-images, and perform distortion correction on even-row object surface sub-images using even-row raster sub-images;

[0103] S140: Merge the corrected odd-numbered object surface image with the corrected even-numbered object surface image to obtain the target image.

[0104] In this embodiment, as Figure 1 As shown, this application adds a motion acquisition optical path for a resonant galvanometer to the existing laser confocal scanning microscope equipped with a two-dimensional galvanometer. This acquisition optical path consists of a reflective mirror positioned between the resonant galvanometer and the galvanometer mirror, a monitoring optical path and a second detector positioned in the transmission direction of the reflective mirror, and acquisition cards connected to the first and second detectors respectively. Since the reflective mirror can selectively transmit or reflect light according to its wavelength, this application can reflect most of the excitation light to the sample while transmitting a small portion for monitoring the motion of the resonant galvanometer. This allows for real-time recording of the nonlinear motion (such as a sinusoidal waveform) of the resonant galvanometer using the monitoring optical path and the second detector. The acquisition card in this application can record two signals using the same timestamp, ensuring pixel-level alignment and allowing the pixel position remapping of the object surface image acquired by the first detector using the galvanometer motion data acquired by the second detector, thereby eliminating sinusoidal scanning distortion.

[0105] In one specific implementation, when the sample is scanned unidirectionally or bidirectionally, the resonant galvanometer oscillates at a high frequency in the form of a sine wave, driving the laser beam to scan back and forth rapidly on the sample surface. This process only utilizes the linear range of the sine wave (such as near the peak or trough) to acquire signals. During the unidirectional scan, the laser is usually turned off or data is discarded during the retrace phase (nonlinear range), while during bidirectional scanning, the laser beam effectively processes data in both directions. During this process, the galvanometer galvanometer steps in the form of a sawtooth wave, moving at least one step (corresponding to one row of pixels in the image) after completing each X-axis scan, and quickly resetting to the starting position at the end of the frame. After being deflected by the two-dimensional galvanometer and reflected by the transmission mirror, the laser beam is focused onto the sample surface through the scanning lens and objective lens. The fluorescence or reflected light excited by the sample returns along the original path, is separated by the beam splitter, and reaches the first detector through the confocal optical path. The first detector converts the optical signal into an electrical signal and synchronizes it with the position of the galvanometer to construct a two-dimensional image pixel by pixel, i.e., the object surface image in this application. Furthermore, the mirror in this application can also transmit a small portion of the laser beam. This portion of the laser beam is collected by the monitoring optical path to convert the real-time deflection angle of the resonant mirror into a grating signal. The monitoring optical path is connected to a second detector, allowing the grating signal to be sent to the acquisition card. After image processing, the acquisition card obtains a grating image. Next, this application can use the grating image to correct distortion in the object surface image, thus obtaining the target image. For example, by determining the location of each grid cell in the grating image (the location of the maximum local brightness), the distortion level between two adjacent locations can be determined, and distortion correction can be performed based on this distortion level.

[0106] Furthermore, in the process of using raster images to correct distortion in object surface images, this application specifically notes that when the user selects bidirectional scanning mode, the galvanometer galvanometer on the Y-axis steps one step at both key endpoints (such as the starting and returning ends) of the resonant galvanometer on the X-axis. Based on this phenomenon, we can clearly observe that all data acquisition processes starting from the starting end invariably result in image data that constitutes the odd-numbered rows of the image; correspondingly, data acquisition activities initiated from the returning end naturally form the even-numbered rows of the image. Therefore, to more accurately correct image distortion and fully consider the influencing factors such as the delay errors that may occur during galvanometer movement and data acquisition, this application proposes an innovative processing method: First, this application can decompose the object surface image into two parts: an odd-numbered row object surface sub-image and an even-numbered row object surface sub-image; similarly, this application also decomposes the raster image used for correction into an odd-numbered row raster sub-image and an even-numbered row raster sub-image accordingly. Based on this, the odd-row object surface sub-images are subjected to targeted distortion correction using odd-row raster sub-images, while the even-row object surface sub-images are subjected to corresponding distortion correction using even-row raster sub-images. Finally, the precisely corrected odd-row object surface sub-images and even-row object surface sub-images are seamlessly merged. Through this series of processing steps, a target image with effectively corrected distortion and significantly improved quality is finally generated.

[0107] In this application, when decomposing an object surface image into odd-row and even-row object surface sub-images, and when decomposing a raster image into odd-row and even-row raster sub-images, the decomposition can be performed using the traditional odd-even decomposition method, or image processing algorithms, such as image segmentation techniques, can be employed to accurately decompose the image into odd-row and even-row sub-images. This process ensures that each row of data matches its corresponding galvanometer motion state, thereby improving the accuracy of distortion correction. Simultaneously, during image decomposition, this application can also preprocess the image, such as denoising and contrast enhancement, to improve the subsequent distortion correction effect. When using odd-row and even-row raster sub-images to perform distortion correction on the corresponding object surface sub-images, this application can employ advanced image registration and distortion correction algorithms. These algorithms can accurately calculate the positional offset of each pixel based on the raster distribution and distortion in the raster image, and adjust the pixel positions in the object surface sub-image accordingly. This process not only eliminates image distortion caused by the nonlinear motion of the galvanometer, but also reduces the impact of delay errors during data acquisition on image quality. After distortion correction, this application can seamlessly merge the precisely corrected odd-row object surface subimages with even-row object surface subimages. During the merging process, this application can also employ image fusion algorithms to ensure visual consistency and continuity of the merged image.

[0108] Image processing algorithms, such as image segmentation techniques, can be used to accurately decompose an image into odd-row and even-row sub-images. This process ensures that each row of data matches its corresponding galvanometer motion state, thereby improving the accuracy of distortion correction. Simultaneously, during image decomposition, this application also performs preprocessing, such as noise reduction and contrast enhancement, to improve the subsequent distortion correction effect. When using odd-row and even-row raster sub-images to perform distortion correction on the corresponding object surface sub-image, this application employs advanced image registration and distortion correction algorithms. These algorithms can accurately calculate the positional offset of each pixel based on the raster distribution and distortion in the raster image and adjust the pixel positions in the object surface sub-image accordingly. This process not only eliminates image distortion caused by the nonlinear motion of the galvanometer but also reduces the impact of latency errors during data acquisition on image quality. After completing distortion correction, this application seamlessly merges the precisely corrected odd-row and even-row object surface sub-images. During the merging process, this application employs an image fusion algorithm to ensure visual consistency and continuity in the merged image. Through this series of processing steps, this application ultimately generates a target image with effectively corrected distortion and significantly improved quality. This innovative processing method not only improves the image quality of laser confocal scanning microscopy but also provides a more accurate and reliable data foundation for subsequent image analysis and processing.

[0109] In the above embodiments, the confocal signal and grating signal acquired synchronously and isochronously by the acquisition card are temporal and spatial twin images. The grating image formed by the grating signal depicts the motion of the resonant galvanometer during the scanning process. Therefore, this application can perform distortion correction on the twin object surface image by analyzing the distortion of the grating image, thereby effectively improving the correction accuracy and being less affected by factors such as environment, lifespan, and optical path deviation. Furthermore, this application fully considers the influencing factors such as the delay error that may occur during the movement of the galvanometer and the delay error that exists during data acquisition. During the distortion correction process, both the grating image and the object surface image are decomposed into corresponding odd-numbered row subimages and even-numbered row subimages, and the odd-numbered row subimages and even-numbered row subimages are used for correction respectively, thereby further improving the accuracy of distortion correction.

[0110] In one embodiment, before performing distortion correction on the odd-numbered row object surface sub-image using the odd-numbered row raster sub-image and on the even-numbered row object surface image using the even-numbered row raster sub-image in step S120, the process may further include:

[0111] S111: When it is detected that the resonant galvanometer is using bidirectional scanning, the grid sequence of the odd-numbered row grating sub-image is aligned with that of the even-numbered row grating sub-image, and the odd-numbered row object surface sub-image is distorted using the aligned odd-numbered row grating sub-image, and the even-numbered row object surface sub-image is distorted using the aligned even-numbered row grating sub-image.

[0112] In this embodiment, when the resonant mirror uses bidirectional scanning, the galvanometer mirror on the Y-axis steps one step at each of the two key endpoints (such as the start and return ends) of the resonant mirror on the X-axis. This causes a misalignment of the grid sequence between the odd-row and even-row raster sub-images. To ensure the accuracy of distortion correction, this application can align the grid sequences of the odd-row and even-row raster sub-images before performing distortion correction on the corresponding object surface sub-image using the odd-row and even-row raster sub-images.

[0113] For example, this application can identify the grid positions in odd-numbered and even-numbered raster sub-images using image processing algorithms, then calculate the misalignment between them based on these grid positions, and finally perform corresponding translation transformations on the odd-numbered or even-numbered raster sub-images to align the grid sequences. Alternatively, alignment can be achieved through other methods. The aligned odd-numbered and even-numbered raster sub-images will more accurately reflect the actual motion of the resonant galvanometer, thus enabling more effective distortion correction of the odd-numbered and even-numbered object surface sub-images. This step further improves the distortion correction accuracy in bidirectional scanning mode, ensuring higher quality in the final target image.

[0114] In one embodiment, aligning the raster sequences of the odd-row raster sub-image and the even-row raster sub-image in step S111 to obtain aligned odd-row and even-row raster sub-images may include:

[0115] S1111: Perform peak fitting on each column of the odd-numbered row raster sub-image to obtain a first peak sequence, and determine a first interval sequence based on the interval between adjacent peaks in the first peak sequence.

[0116] S1112: Perform peak fitting on each column of the even-numbered row raster sub-image to obtain a second peak sequence, and determine a second interval sequence based on the interval between adjacent peaks in the second peak sequence.

[0117] S1113: Based on the first interval sequence and the second interval sequence, extract a first subsequence that overlaps with the second peak sequence from the first peak sequence, and extract a second subsequence that overlaps with the first peak sequence from the second peak sequence.

[0118] S1114: After extracting the grid cells located in the interval determined by the beginning and end of the first subsequence from the odd-row raster subgraph, an aligned odd-row raster subgraph is formed; and after extracting the grid cells located in the interval determined by the beginning and end of the second subsequence from the even-row raster subgraph, an aligned even-row raster subgraph is formed.

[0119] In this embodiment, to accurately align the raster sequences of odd-row and even-row raster sub-images, this application employs a series of image processing steps. First, this application can identify the raster peak positions in each column of the odd-row raster sub-image by performing peak fitting on each column, and determine a first interval sequence based on the interval between adjacent peaks. This step can accurately depict the distribution of the raster in the odd-row raster sub-image. Similarly, this application also performs peak fitting on each column of the even-row raster sub-image, obtaining a second peak sequence and a corresponding second interval sequence.

[0120] With this foundational data, this application can further analyze the raster sequence misalignment between odd-row and even-row raster sub-images. Specifically, based on the first and second interval sequences, this application can extract a first sub-sequence overlapping with the second peak sequence from the first peak sequence, and simultaneously extract a second sub-sequence overlapping with the first peak sequence from the second peak sequence. The extraction of these two sub-sequences provides crucial information for subsequently determining the amount of misalignment between the odd-row and even-row raster sub-images. Finally, based on the extracted first and second sub-sequences, this application can extract the gratings located in the intervals determined by the beginning and end of the corresponding sub-sequences from the odd-row and even-row raster sub-images, respectively, forming aligned odd-row and even-row raster sub-images. This process ensures accurate alignment of the raster sequences of the odd-row and even-row raster sub-images in bidirectional scanning mode, thereby improving the accuracy of subsequent distortion correction.

[0121] By aligning the raster sequences of odd-numbered and even-numbered raster sub-images as described above, this application can achieve high-quality distortion correction for laser confocal scanning microscope images.

[0122] In one embodiment, step S1113, extracting a first sub-sequence overlapping with the second peak sequence from the first peak sequence and extracting a second sub-sequence overlapping with the first peak sequence from the second peak sequence, based on the first interval sequence and the second interval sequence, may include:

[0123] S11131: Determine overlapping subsequences in the first interval sequence and the second interval sequence whose similarity exceeds a preset similarity threshold.

[0124] S11132: Based on the overlapping subsequence, extract a first subsequence that overlaps with the second peak sequence from the first peak sequence, and extract a second subsequence that overlaps with the first peak sequence from the second peak sequence.

[0125] In this embodiment, when determining the raster sequence alignment between odd-row and even-row raster sub-images, this application can identify overlapping sub-sequences whose similarity exceeds a preset similarity threshold through in-depth analysis of the first and second interval sequences. The preset similarity threshold can be determined based on the actual image quality and distortion to ensure accurate capture of the true correspondence between raster sequences.

[0126] Once the overlapping subsequences are identified, this application can extract a first subsequence that overlaps with the second peak sequence from the first peak sequence, and a second subsequence that overlaps with the first peak sequence from the second peak sequence, based on these overlapping portions. The accurate extraction of these two subsequences is crucial for subsequent raster sequence alignment.

[0127] In one specific implementation, this application decomposes the raster image to obtain an odd-row raster sub-image consisting of an odd number of rows. Even-row raster sub-image composed of even-row rows Next, this application can compute the odd-numbered row raster sub-image. and even-numbered row raster sub-graph Column mean brightness curve and and respectively and Peak fitting was performed to obtain the first peak sequence. Second peak sequence ,in, and They are respectively and The number of peaks. Next, this application can calculate the first interval sequence. Second interval sequence ,in, , = Furthermore, after obtaining the first interval sequence and the second interval sequence, this application can calculate the overlapping subsequence of the first interval sequence and the second interval sequence using the following formula. and , length is The specific formula is as follows:

[0128]

[0129] in, The search scope is from arrive d is a distance metric, such as the Pearson correlation coefficient. To preset the similarity threshold, for example, T=0.9 can be chosen.

[0130] The overlapping subsequence is calculated using the above formula. and Then, this application can extract the first subsequence that overlaps with the second peak sequence from the first peak sequence. And, extracting a second subsequence from the second peak sequence that overlaps with the first peak sequence. .

[0131] Through the above image processing steps, this application not only achieves accurate alignment of the raster sequences of odd-numbered and even-numbered raster sub-images, but also further improves the accuracy and stability of distortion correction.

[0132] In one embodiment, S130, which uses the odd-numbered row raster sub-image to perform distortion correction on the odd-numbered row object surface sub-image to obtain the target image, may include:

[0133] S131: Determine the position of at least one grid cell in the odd-numbered row raster sub-image in each pixel row.

[0134] S132: The odd-numbered row object surface sub-image is corrected row by row according to the position of the at least one grid in each pixel row to obtain the target image.

[0135] In this embodiment, when using the odd-row raster sub-image to correct the distortion of the odd-row object surface sub-image, the position of at least one grid in the odd-row raster sub-image in each pixel row can be determined first. In this way, the odd-row object surface sub-image can be corrected according to the position of at least one grid in each pixel row to obtain the target image.

[0136] In this application, when determining the position of at least one grid in the odd-row raster sub-image within each pixel row, the number of grids to be determined can be determined based on the current scene. For example, if the current scene requires high precision, the odd-row object surface sub-image can be corrected by using the positions of all grids in the odd-row raster sub-image within each pixel row. If the current scene requires relatively low precision but high real-time performance, the odd-row object surface sub-image can be corrected by filtering local grids, thus meeting the real-time requirements.

[0137] In one embodiment, determining the position of at least one grid cell in the odd-row raster sub-image in each pixel row in S131 may include:

[0138] S1311: If the current scene is a high-precision scene, then determine the position of all grids in each pixel row of the odd-numbered raster sub-image.

[0139] S1312: If the current scene is a real-time scene and the resonant galvanometer is scanned in one direction, then determine the position of the raster of interest in each pixel row in the odd-numbered row raster sub-image.

[0140] In this embodiment, when determining the position of at least one grid in the odd-row raster sub-image within each pixel row, the scene characteristics of the current scene can be determined first. If the current scene is a high-precision scene, i.e., a scene where the accuracy requirement for image distortion correction is higher than a preset accuracy threshold, such as micro-nano fabrication, super-resolution imaging, precision measurement, and other application scenarios, the preset accuracy threshold can be a threshold in one dimension, such as error or resolution, or it can be a threshold in multiple dimensions. The specific threshold can be set according to the actual situation and is not limited here. When the current scene is determined to be a high-precision scene, this application can correct the odd-row object surface sub-image by using the positions of all grids in the odd-row raster sub-image within each pixel row, thereby achieving accurate distortion correction of the odd-row object surface sub-image.

[0141] Furthermore, if the current scene is a real-time scene, and the resonant galvanometer is unidirectionally scanning—that is, a scene where the real-time requirement for image distortion correction is higher than a preset duration threshold, and the adjacent motion cycles of the resonant galvanometer only deviate at the starting point—such as applications like laser processing, high-speed imaging, and dynamic displays, the preset duration threshold in these scenarios can be set according to the actual situation and is not limited here. When this application determines that the current scene is a real-time scene, the raster of interest in the odd-numbered row raster sub-image can be determined by filtering local gratings. The raster of interest can be the raster at the center of the odd-numbered row raster sub-image or a raster at a non-center location, depending on the actual situation and is not limited here. This application corrects the odd-numbered row object surface sub-image by using the raster of interest, which can greatly shorten the processing time for distortion correction and thus meet the real-time requirements.

[0142] In one embodiment, determining the position of all gratings in the odd-row raster sub-image in each pixel row in S1311 may include:

[0143] S13111: Determine the row brightness curve corresponding to the column brightness value in each pixel row of the odd-numbered row raster sub-image.

[0144] S13112: Smooth the row brightness curve of each pixel row, and perform peak fitting on the smoothed row brightness curve until the number of peaks in each pixel row is equal, thus obtaining the third peak sequence of each pixel row.

[0145] S12113: Determine the position of all gratings in each pixel row of the odd-numbered raster sub-map based on the third peak sequence of each pixel row.

[0146] In this embodiment, the process of using odd-row raster sub-images to correct distortion of odd-row object surface sub-images is the same as the process of using even-row raster sub-images to correct distortion of even-row object surface sub-images. Therefore, this application mainly describes the process of using odd-row raster sub-images to correct distortion of odd-row object surface sub-images. Similarly, the process of correcting distortion of even-row object surface sub-images can be obtained.

[0147] In this application, when determining the position of all gratings in each pixel row of the odd-numbered row raster sub-image, mechanical motion errors and electronic noise cause a certain degree of misalignment between the brightest positions of the same grating in adjacent rows (corresponding to two adjacent motion cycles of the resonant mirror) in the odd-numbered row raster sub-image. (Illustratively, as shown...) Figure 8 As shown, Figure 8 An illustration showing a deviation in the brightest position between two adjacent rows of the same grating provided in this application embodiment; Figure 8 The positional deviation can be attributed to the discrepancy between the starting points of adjacent motion cycles of the resonant mirror and the time it takes to reach the same grid. This means that it is not possible to simply treat a grid as a position for correction.

[0148] Based on this, when determining the position of each grid cell in the odd-numbered row raster sub-image, this application can first determine the brightness value of each column in each pixel row of the odd-numbered row raster sub-image, and form the row brightness curve corresponding to each pixel row. = c=1, ..., C (where C is the image width of the odd-numbered raster sub-image, i.e., the number of pixel columns). This represents the brightness value of the pixel in the r-th row and c-th column of the odd-numbered raster sub-image. This brightness value represents the lightness or color intensity at that location and can be directly determined from the odd-numbered raster sub-image. (Illustratively, as shown...) Figure 7 As shown, Figure 9 This is a schematic diagram of the row brightness curve corresponding to a pixel row in an odd-numbered row raster sub-image provided in an embodiment of this application. Figure 9 In the grid, each peak corresponds to one grid cell.

[0149] Furthermore, since the odd-row raster sub-images and even-row raster sub-images decomposed during unidirectional scanning have the same number of gratings and their positions are strictly aligned, no alignment processing is required. For the odd-row raster sub-images obtained by bidirectional scanning, since alignment processing is required, this application, when determining the position of all gratings in each pixel row of the odd-row raster sub-image, can extract the gratings located in the interval determined by the beginning and end of the first sub-sequence from the odd-row raster sub-image to form an aligned odd-row raster sub-image, and determine the row brightness curve corresponding to the column brightness value in each pixel row of the aligned odd-row raster sub-image.

[0150] Next, this application can smooth the row brightness curve of each pixel row to highlight the main trend or structure of the row brightness curve by suppressing noise or irrelevant details, thereby improving the readability, analyzability or visual effect of the row brightness curve, and providing a more accurate data basis for subsequent peak fitting.

[0151] After smoothing the row brightness curves of each pixel row in this application, peak fitting can be performed on the smoothed row brightness curves to determine the number of peaks in each pixel row. When the number of peaks in each pixel row is equal, the third peak sequence of each pixel row can be obtained. i=1, ..., ,in Let be the number of peaks obtained by fitting the row brightness curve of row r to the current smoothing radius, schematically, as shown below. Figure 10 As shown, Figure 10 A schematic diagram of the peak fitting result for one pixel row provided in an embodiment of this application; Figure 10 The red line in the graph represents the position of the brightest pixel in the grid area, and the green line represents the fitted position. Obviously, the fitted position is more reasonable.

[0152] Based on the above processing, this application can obtain the third peak sequence corresponding to each pixel row. Since this third peak sequence indicates the peak positions of multiple peaks fitted to each pixel row under the current smoothing radius, this application can determine the positions of all grids in each pixel row of the odd-numbered raster sub-image based on the third peak sequence of each pixel row, and form the corresponding grid position matrix. Where r=1, ..., R, i=1, ..., N, R is the image height of the odd-numbered raster sub-image, i.e., the number of pixel rows, and N is the number of grid cells per row. When performing bidirectional scanning... , Let be the position (i.e., the horizontal coordinate) of the i-th cell in the r-th row within the raster subgraph of odd-numbered rows.

[0153] In one embodiment, step S13112 involves smoothing the row brightness curves of each pixel row and performing peak fitting on the smoothed row brightness curves until the number of peaks in each pixel row is equal, thus obtaining a third peak sequence for each pixel row. This step may include:

[0154] S131121: Sets the current value of the smoothing radius.

[0155] S131122: Based on the current value, smooth the row brightness curve of each pixel row, and perform peak fitting on the smoothed row brightness curve to obtain the preliminary peak position sequence of each pixel row.

[0156] S131123: Compare the preliminary peak position sequence of each pixel row. If the number of peaks in at least one pixel row is not equal to the number of peaks in other pixel rows, update the current value and continue to perform the smoothing process of the row brightness curve of each pixel row based on the current value and subsequent steps until the number of peaks in each pixel row is equal.

[0157] S131124: If the number of peaks in each pixel row is equal, then the preliminary peak position sequence of each pixel row is taken as the final third peak sequence.

[0158] In this embodiment, when smoothing the row brightness curve of each pixel row, the choice of smoothing radius (or smoothing window size) directly affects the quality of the processing effect and the degree of feature preservation. Therefore, this application can first set the current value of the smoothing radius, which can be an initial value. Then, based on the current value, the row brightness curve of each pixel row is smoothed, and then peak fitting is performed. After obtaining the preliminary peak position sequence of each pixel row, the number of peaks in the preliminary peak position sequence of each pixel row can be compared. If the number of peaks in at least one pixel row is not equal to the number of peaks in other pixel rows, the current value of the smoothing radius is updated. For example, when the initial value s=1, the updated current value can be s=s+1. Then, this application can continue to smooth the row brightness curve of each pixel row based on the updated current value, and perform peak fitting on the smoothed row brightness curve to obtain the preliminary peak position sequence of each pixel row. The number of peaks in the preliminary peak position sequence of each pixel row is compared until the number of peaks in each pixel row is equal. At this time, the preliminary peak position sequence of each pixel row can be used as the final third peak sequence. This application can determine the position of all grids in each pixel row of the odd-numbered raster sub-image based on the third peak sequence of each pixel row, and perform distortion correction on the odd-numbered object surface sub-image based on the position of each grid in each pixel row, so as to obtain accurate correction results.

[0159] In one embodiment, determining the position of the raster of the region of interest in the odd-row raster sub-image in each pixel row in S1312 may include:

[0160] S13121: Determine the column mean brightness curve corresponding to the brightness value of each pixel row in each column of the odd-numbered row raster sub-image, and obtain the fourth peak sequence by performing peak fitting on the column mean brightness curve of each column.

[0161] S13122: The region of interest of the odd-row raster sub-image is cropped according to the fourth peak sequence, and the peak position of each pixel row is extracted from the cropped odd-row raster sub-image as the position of the raster of the region of interest in each pixel row.

[0162] In this embodiment, if the current scene is a real-time scene, and the resonant galvanometer is unidirectionally scanning—that is, a scene where the real-time requirement for image distortion correction is higher than a preset time threshold, and the adjacent motion cycles of the resonant galvanometer only deviate at the starting point—such as applications like laser processing, high-speed imaging, and dynamic display, the raster of interest in the odd-numbered row raster sub-image can be determined by filtering local raster grids. This raster of interest can be a raster at the center of the odd-numbered row raster sub-image or a raster at a non-center location; the choice depends on the actual situation and is not limited here. This application corrects the odd-numbered row object surface sub-image using the raster of interest, which can greatly shorten the distortion correction processing time and thus meet real-time requirements.

[0163] Specifically, when determining the position of the raster of interest in each pixel row of the odd-row raster sub-image, this application can first determine the column mean brightness curve corresponding to the brightness value of each pixel row in each column of the odd-row raster sub-image, and then perform peak fitting on the column mean brightness curve of each column to obtain a fourth peak sequence. Then, this application can crop the region of interest in the odd-row raster sub-image according to the fourth peak sequence, and extract the peak position of each pixel row from the cropped odd-row raster sub-image. The peak position is the position of the raster of interest in each pixel row of the odd-row raster sub-image.

[0164] For example, when this application calculates the column mean brightness curve corresponding to the brightness value of each pixel row in each column of the odd-numbered row raster sub-image... After that, you can... Peak fitting was performed to obtain the fourth peak sequence. Let k = 1, ..., K, where K is the number of peaks. Since the fourth peak sequence indicates the number of gratings in the odd-row raster sub-image, and the resonant mirror in this application is unidirectionally scanning, this application can select the region with the lowest distortion level in the odd-row raster sub-image as the region of interest based on the scanning characteristics of the resonant mirror and the number of gratings in the odd-row raster sub-image. After cropping the region of interest, the peak position of each pixel row is extracted from the cropped odd-row raster sub-image. This peak position is the position of the grating in the region of interest in each pixel row of the odd-row raster sub-image. In this way, during distortion correction, only one region of interest in the odd-row raster sub-image needs to be detected row by row, thereby greatly shortening the correction time and meeting the real-time requirements.

[0165] In one embodiment, cropping the region of interest of the odd-row raster sub-image according to the fourth peak sequence in S13122 may include:

[0166] S131221: Determine the number of peaks in the fourth peak sequence.

[0167] S131222: Determine the starting and ending positions when clipping the odd-numbered row raster sub-image based on the number of peaks in the fourth peak sequence.

[0168] S131223: The region of interest of the odd-numbered raster sub-image is cropped according to the starting position and the ending position.

[0169] In this embodiment, when cropping the region of interest of the odd-row raster sub-image according to the fourth peak sequence, the region of interest can be the central region of the odd-row raster sub-image or a non-central region. The specific choice can be made according to the actual situation and is not limited here.

[0170] In one specific implementation, when the central region of the odd-row raster sub-image is selected as the region of interest, the number of peaks in the fourth peak sequence can be determined first. Then, based on the number of peaks in the fourth peak sequence, the starting and ending positions for cropping the odd-row raster sub-image can be determined. In this way, the region of interest of the odd-row raster sub-image can be cropped based on the starting and ending positions.

[0171] For example, when the fourth peak sequence of this application is When k=1, ...,K, where K is the number of peaks, this application can set the start position and end position as follows:

[0172]

[0173] in, That is, the midpoint of the fourth peak sequence. Starting position The final position, The midpoint peak of the fourth peak sequence. The peak preceding the midpoint of the fourth peak sequence. The peak following the midpoint of the fourth peak sequence, after cropping the odd-numbered raster sub-image using the aforementioned start and end positions, can be obtained as follows: Figure 11 The region of interest (ROI) at the center of the odd-numbered raster sub-image shown is a region of interest containing only the brightness data of one raster. By using this ROI to perform row-by-row correction on the odd-numbered object surface sub-image, the final target image can be obtained, thus meeting the real-time requirements.

[0174] In one embodiment, step S132, which involves performing row-by-row correction on the odd-row object surface sub-image based on the position of the at least one grid in each pixel row to obtain a corrected odd-row object surface image, may include:

[0175] S1321: Obtain the first blank image to be filled, wherein the image height of the first blank image is the same as the image height of the odd-numbered row object sub-image.

[0176] S1322: Based on the position of all grids in each pixel row of the odd-row raster sub-image, the brightness values ​​of the corresponding pixel rows in the odd-row object surface sub-image are sampled in segments, and the sampled brightness values ​​are sequentially filled into the first blank image to obtain the corrected odd-row object surface sub-image.

[0177] In this embodiment, if the current scene is a high-precision scene, that is, a scene where the accuracy requirement for image distortion correction is higher than the preset accuracy threshold, such as micro-nano processing, super-resolution imaging, precision measurement and other application scenarios, this application can correct the odd-numbered row object surface sub-image by the position of all grids in each pixel row of the odd-numbered row raster sub-image, thereby achieving accurate distortion correction of the odd-numbered row object surface sub-image.

[0178] Specifically, this application can obtain a first blank image to be filled. The image height of the first blank image The image height can be consistent with the odd-row object subimage, and the image width W can be a pre-specified value, such as W=1024. Next, this application can sequentially extract the r-th row image of the odd-row object subimage. = r=1, ..., R, c=1, ..., C, where R is the maximum number of rows in the odd-row object subgraph, and C is the maximum number of columns in the odd-row object subgraph. Given the brightness value of the r-th row and c-th column of the odd-row object surface submap, this application can then perform the following mapping:

[0179]

[0180] Where T can be either a linear or nonlinear mapping, and J = W / (N-1). This mapping is equivalent to... lie in The brightness curve segment in the image is sampled linearly or nonlinearly, with J sampling points. The number of sampling points can be set according to the actual situation. Then, the sampled data is filled into the corresponding positions in the first blank image to obtain the corrected odd-row object sub-image. The corrected odd-row object sub-image is shown below. Figure 12 As shown, by Figure 12 As can be seen, this application can achieve accurate distortion correction of odd-numbered row object subgraphs by performing distortion correction on the odd-numbered row object subgraphs using the above distortion correction method.

[0181] In one embodiment, step S132, which involves performing row-by-row correction on the odd-row object surface sub-image based on the position of the at least one grid in each pixel row to obtain a corrected odd-row object surface image, may include:

[0182] S321: Based on the position of the raster of interest in each pixel row in the odd-numbered row raster sub-image, the odd-numbered row raster sub-image is aligned row by row to obtain the aligned odd-numbered row raster sub-image.

[0183] S322: Based on the position of the raster of interest in each pixel row in the odd-row raster sub-image, the odd-row object surface sub-image is aligned row by row to obtain the aligned odd-row object surface sub-image.

[0184] S323: The aligned odd-row object surface sub-image is corrected row by row according to the aligned odd-row raster sub-image to obtain the corrected odd-row object surface sub-image.

[0185] In this embodiment, if the current scene is a real-time scene and the resonant galvanometer is a unidirectional scanning scene, that is, a scene where the real-time requirement for image distortion correction is higher than the preset time threshold and the adjacent motion cycles of the resonant galvanometer only deviate at the starting point, such as laser processing, high-speed imaging, dynamic display and other application scenarios, the grid of the region of interest in the odd-numbered row raster sub-image can be determined by filtering local grids, and the odd-numbered row object surface sub-image can be corrected by using the grid of the region of interest. This can greatly shorten the processing time of distortion correction and thus meet the real-time requirements.

[0186] Specifically, when performing row-by-row correction of the odd-row object surface sub-image based on the position of the raster of the region of interest in each pixel row in the odd-row raster sub-image, this application can first align the odd-row raster sub-image row by row based on the position of the raster of the region of interest in each pixel row to obtain an aligned odd-row raster sub-image. Then, it can align the odd-row object surface sub-image row by row based on the position of the raster of the region of interest in each pixel row to obtain an aligned odd-row object surface sub-image. Finally, it can use the aligned odd-row raster sub-image to perform row-by-row correction on the aligned odd-row object surface sub-image, thus obtaining the corrected odd-row object surface sub-image. Moreover, the time required to obtain the target image by this method is significantly shorter than the time required to obtain the corrected odd-row object surface sub-image by performing row-by-row correction on the odd-row object surface sub-image based on the position of all rasters in the odd-row raster sub-image in each pixel row. Therefore, it can meet the real-time requirements to a great extent.

[0187] In one embodiment, step S321, aligning the odd-row raster sub-image row by row according to the position of the raster of the region of interest in each pixel row to obtain the aligned odd-row raster sub-image, may include:

[0188] S3211: Based on the position of the raster of interest in each pixel row in the odd-row raster sub-image, determine the maximum and minimum values ​​of the positions in all pixel rows, and determine the original image width of the odd-row raster sub-image.

[0189] S3212: Determine the sampling interval for resampling the odd-numbered raster sub-image based on the maximum value, the minimum value, and the original image width.

[0190] S3213: Obtain the second blank image to be filled, wherein the image height of the second blank image is the same as the image height of the odd-numbered row raster sub-image.

[0191] S3214: The odd-numbered row raster sub-image is resampled within the sampling interval, and the resampled brightness values ​​are sequentially filled into the second blank image to obtain the aligned odd-numbered row raster sub-image.

[0192] In this embodiment, when aligning the odd-row raster sub-image row by row according to the position of the raster of interest region in each pixel row, this application can first determine the maximum and minimum values ​​of the positions in all pixel rows based on the position of the raster of interest region in each pixel row, and determine the original image width of the odd-row raster sub-image. In this way, the sampling interval for resampling the odd-row raster sub-image can be determined based on the maximum and minimum values ​​of the positions in all pixel rows and the original image width. Then, this application can obtain a second blank image to be filled. The image height of the second blank image is the same as the image height of the odd-row raster sub-image. In this way, the odd-row raster sub-image can be resampled within the sampling interval, and the resampled brightness values ​​are sequentially filled into the second blank image to obtain the aligned odd-row raster sub-image. The image height of the aligned odd-row raster sub-image is the same as the image height before alignment, but the image width is changed.

[0193] In one specific implementation, this application can extract the peak position on each pixel row of the region of interest in the odd-numbered raster sub-image described above. r=1, ..., R, where R is the image height, i.e., the number of pixel rows. Then, the odd-row raster sub-image is aligned row by row using the following mapping to obtain the aligned odd-row raster sub-image, denoted as A:

[0194]

[0195] in, and These are the r-th row images of the odd-numbered raster sub-image I before alignment and the odd-numbered raster sub-image A after alignment, respectively. It can be selected as a linear mapping or a nonlinear mapping, which is equivalent to... In the interval Resampling is performed during this process. L is the original image width of the odd-numbered row raster subimage, and A is the pixel width of A. This represents the maximum value at all row peak positions. Let be the minimum value at all row peak positions, and we have:

[0196]

[0197] After the above mapping, we can obtain the following: Figure 11 The image shown is a magnified comparison of the odd-numbered raster sub-images before and after alignment. Figure 13 The left side shows the local odd-row raster sub-image before alignment, and the right side shows the local odd-row raster sub-image after alignment. Figure 13As can be seen, the misalignment between the brightest positions of the same grid cells in adjacent rows of the aligned odd-numbered raster sub-image is small. By using the aligned odd-numbered raster sub-image to perform row-by-row correction on the odd-numbered object surface sub-image, a more accurate correction result can be obtained.

[0198] In one embodiment, step S322, aligning the odd-row object surface sub-image row by row according to the position of the raster of the region of interest in each pixel row in the odd-row raster sub-image to obtain the aligned odd-row object surface image, may include:

[0199] S3221: Obtain the third blank image to be filled, wherein the image height of the third blank image is the same as the image height of the odd-numbered row object sub-image.

[0200] S3222: The odd-numbered object surface image is resampled within the sampling interval, and the resampled brightness values ​​are sequentially filled into the third blank image to obtain the aligned odd-numbered object surface image.

[0201] In this embodiment, when aligning the odd-row object surface sub-image row by row according to the position of the raster of interest in each pixel row in the odd-row raster sub-image, this application can first obtain the third blank image to be filled. The image height of the third blank image is the same as the image height of the odd-row object surface sub-image. Then, this application can align the odd-row object surface image row by row using the above-described method of aligning the odd-row raster sub-image to obtain the aligned odd-row object surface image, denoted as B.

[0202]

[0203] in, and Let G be the odd-row object sub-image before alignment, and B be the odd-row object sub-image after alignment, representing the r-th row of the sub-image. It can be selected as a linear mapping or a nonlinear mapping, which is equivalent to... In the interval Resampling was performed during the process, and the magnified comparison of the odd-numbered row surface sub-images before and after alignment is shown in the following figure. Figure 14 As shown, Figure 14 The left side shows a magnified view of the area before alignment, and the right side shows a magnified view of the area after alignment. Figure 14 As can be seen, the aligned odd-numbered row surface sub-image of this application is clearer, and some distortion has been eliminated.

[0204] In one embodiment, step S323, which involves performing row-by-row correction on the aligned odd-row object surface sub-image based on the aligned odd-row raster sub-image to obtain the corrected odd-row raster sub-image, may include:

[0205] S3231: Determine the column mean curve corresponding to the brightness value of each pixel row in each column of the aligned odd-row raster sub-image, and obtain multiple fifth peak sequences by performing peak fitting on the column mean curve of each column.

[0206] S3232: Obtain the fourth blank image to be filled, wherein the image height of the fourth blank image is the same as the image height of the aligned odd-numbered row object sub-image.

[0207] S3233: Based on the position of each fifth peak sequence, the brightness values ​​of the corresponding pixel rows in the aligned odd-row object surface sub-image are sampled in segments, and the sampled brightness values ​​are sequentially filled into the fourth blank image to obtain the corrected odd-row raster sub-image.

[0208] In this embodiment, after obtaining the aligned odd-row raster sub-image and the aligned odd-row object surface sub-image, this application can perform row-by-row correction on the aligned odd-row object surface sub-image based on the aligned odd-row raster sub-image to obtain the corrected odd-row raster sub-image.

[0209] Specifically, this application can first determine the column mean curve corresponding to the brightness value of each pixel row in each column of the aligned odd-row raster sub-image, and then perform peak fitting on the column mean curve of each column to obtain multiple fifth peak sequences. Then, a fourth blank image to be filled is obtained. The image height of the fourth blank image is the same as the image height of the aligned odd-row object surface sub-image. In this way, based on the position of each fifth peak sequence, the brightness value of the corresponding pixel row in the aligned odd-row object surface sub-image can be sampled in segments, and the sampled brightness values ​​are sequentially filled into the fourth blank image to obtain the corrected odd-row raster sub-image.

[0210] For example, this application can first calculate the column mean curve corresponding to the brightness value of each pixel row in each column of the aligned odd-row raster sub-image A. Then on Peak fitting was performed to obtain the fifth peak sequence. Let k = 1, ..., K, where K is the number of peaks. Next, this application can perform row-by-row correction on the aligned odd-row object sub-image B to obtain the final target image D. During the correction process, a fourth blank image D to be filled can be prepared first, with its pixel height the same as the odd-row object sub-image and its width W a pre-specified value, such as W = 1024. Then, the r-th row image of B is extracted sequentially. = , r=1,…,R,c=1,…,L, Given the brightness value of image B in row r and column c, this application can finally perform the following mapping for... After segmentation, alignment, and sampling, fill the remaining space into the fourth blank image:

[0211]

[0212] in, It can be a linear mapping or a nonlinear mapping. = W / (K-1). This mapping is equivalent to... lie in The brightness curve segment is sampled linearly or nonlinearly, with the number of sampling points being [number missing]. Then, the sampled data is filled into the corresponding positions of the fourth blank image to obtain the corrected odd-row raster sub-image; the corrected odd-row raster sub-image is as follows. Figure 15 As shown, compare it with Figure 12 A comparison of the corrected odd-row raster sub-images shows that the effect is not much different from that obtained by using the full raster alignment correction algorithm. However, since this algorithm only needs to perform row-by-row peak detection on one region of interest of the odd-row raster sub-image, it can greatly shorten the correction time and thus meet the real-time requirements.

[0213] In one embodiment, this application also provides a data acquisition card storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the distortion correction method as described in any of the above embodiments.

[0214] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0215] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.

[0216] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A laser confocal scanning microscope, comprising a laser source, a resonant mirror, a galvanometer mirror, a beam splitter, an excitation optical path, a confocal optical path, and a first detector, characterized in that, The microscope further includes: a transflecting mirror fixedly installed between the resonant galvanometer mirror and the galvanometer mirror; a monitoring optical path and a second detector arranged in the transmission direction of the transflecting mirror; and a data acquisition card connected to the first detector and the second detector respectively. In this process, when the microscope scans the sample, the laser light emitted by the laser source is reflected by the beam splitter to the resonant mirror. The resonant mirror deflects the incident light beam for the first time and then emits it to the transmission mirror. The transmission mirror reflects most of the light beam to the galvanometer mirror. The galvanometer mirror deflects the incident light beam a second time and then focuses the deflected light beam onto the sample surface through the excitation optical path. The reflected light excited by the sample surface returns along the original path, is transmitted through the beam splitter to the confocal optical path, and reaches the first detector through the confocal optical path. The transmission mirror transmits a small portion of the light beam to the monitoring optical path, and the monitoring optical path converts the real-time deflection angle of the resonant mirror into a grating signal, which is then sent to the second detector. The acquisition card synchronously and isochronously acquires the confocal signal output by the first detector and the grating signal output by the second detector, and generates an object surface image corresponding to the confocal signal and a grating image corresponding to the grating signal. Then, it decomposes the object surface image into odd-row object surface sub-images and even-row object surface sub-images, and decomposes the grating image into odd-row grating sub-images and even-row grating sub-images. The odd-row grating sub-images are then used to correct distortion in the odd-row object surface sub-images, and the even-row grating sub-images are used to correct distortion in the even-row object surface sub-images. Finally, the corrected odd-row object surface sub-images and the corrected even-row object surface sub-images are merged to obtain the target image. The monitoring optical path includes an attenuator and a Ronchi grating; The attenuator attenuates the transmitted light beam before it is emitted to the Ronchi grating, and the Ronchi grating converts the real-time deflection angle of the resonant mirror into a grating signal based on the attenuated light beam.

2. A method for correcting scanning image distortion, applied to the acquisition card in the laser confocal scanning microscope of claim 1, characterized in that, The method includes: The confocal signal output by the first detector and the grating signal output by the second detector are acquired synchronously and isochronously, and an object surface image corresponding to the confocal signal and a grating image corresponding to the grating signal are generated. The object surface image is decomposed into odd-row object surface sub-images and even-row object surface sub-images, and the raster image is decomposed into odd-row raster sub-images and even-row raster sub-images. Distortion correction is performed on the odd-numbered row object surface sub-image using the odd-numbered row raster sub-image, and distortion correction is performed on the even-numbered row object surface sub-image using the even-numbered row raster sub-image; The corrected odd-numbered object surface image is merged with the corrected even-numbered object surface image to obtain the target image.

3. The method for correcting distortion of scanned images according to claim 2, characterized in that, Before performing distortion correction on the odd-numbered row object surface sub-image using the odd-numbered row raster sub-image, and before performing distortion correction on the even-numbered row object surface image using the even-numbered row raster sub-image, the method further includes: When bidirectional scanning of the resonant mirror is detected, the grid sequence of the odd-numbered row grating sub-image is aligned with that of the even-numbered row grating sub-image, and the odd-numbered row object surface sub-image is distorted using the aligned odd-numbered row grating sub-image, and the even-numbered row object surface sub-image is distorted using the aligned even-numbered row grating sub-image.

4. The method for correcting distortion of scanned images according to claim 3, characterized in that, The step of aligning the raster sequences of the odd-row raster sub-images and the even-row raster sub-images to obtain aligned odd-row and even-row raster sub-images includes: Peak fitting is performed on each column of the odd-numbered row raster sub-image to obtain a first peak sequence, and a first interval sequence is determined based on the interval between adjacent peaks in the first peak sequence. Peak fitting is performed on each column of the even-numbered row raster sub-image to obtain a second peak sequence, and a second interval sequence is determined based on the interval between adjacent peaks in the second peak sequence. Based on the first interval sequence and the second interval sequence, a first subsequence overlapping with the second peak sequence is extracted from the first peak sequence, and a second subsequence overlapping with the first peak sequence is extracted from the second peak sequence; After extracting the gratings located in the interval determined by the beginning and end of the first subsequence from the odd-row raster subgraph, an aligned odd-row raster subgraph is formed; and after extracting the gratings located in the interval determined by the beginning and end of the second subsequence from the even-row raster subgraph, an aligned even-row raster subgraph is formed.

5. The method for correcting distortion of scanned images according to claim 4, characterized in that, The step of extracting a first subsequence overlapping with the second peak sequence from the first peak sequence and extracting a second subsequence overlapping with the first peak sequence from the second peak sequence, based on the first interval sequence and the second interval sequence, includes: Identify overlapping subsequences in the first interval sequence and the second interval sequence whose similarity exceeds a preset similarity threshold; Based on the overlapping subsequences, a first subsequence overlapping with the second peak sequence is extracted from the first peak sequence, and a second subsequence overlapping with the first peak sequence is extracted from the second peak sequence.

6. The method for correcting distortion of scanned images according to any one of claims 2-5, characterized in that, The step of using the odd-numbered row raster sub-image to perform distortion correction on the odd-numbered row object surface sub-image to obtain the target image includes: Determine the position of at least one grid cell in each pixel row of the odd-numbered row raster sub-image; The odd-numbered row object surface sub-image is corrected row by row based on the position of the at least one grid in each pixel row to obtain the target image.

7. The method for correcting distortion of scanned images according to claim 6, characterized in that, Determining the position of at least one raster in the odd-numbered row raster sub-image within each pixel row includes: If the current scene is a high-precision scene, then determine the position of all grids in each pixel row of the odd-numbered raster sub-image; If the current scene is a real-time scene, then determine the position of the raster of interest in each pixel row of the odd-numbered row raster sub-image.

8. The method for correcting distortion of scanned images according to claim 7, characterized in that, Determining the position of all gratings in each pixel row of the odd-numbered row raster sub-image includes: Determine the row brightness curve corresponding to the column brightness value in each pixel row of the odd-numbered row raster sub-image; The row brightness curves of each pixel row are smoothed, and peak fitting is performed on the smoothed row brightness curves until the number of peaks in each pixel row is equal, thus obtaining the third peak sequence of each pixel row. The positions of all gratings in each pixel row of the odd-numbered raster submap are determined based on the third peak sequence of each pixel row.

9. The method for correcting distortion of scanned images according to claim 8, characterized in that, The process involves smoothing the row brightness curves of each pixel row and then performing peak fitting on the smoothed row brightness curves until the number of peaks in each pixel row is equal, resulting in a third peak sequence for each pixel row, including: Set the current value of the smoothing radius; Based on the current values, the row brightness curves of each pixel row are smoothed, and peak fitting is performed on the smoothed row brightness curves to obtain the preliminary peak position sequence of each pixel row. The initial peak position sequence of each pixel row is compared. If the number of peaks in at least one pixel row is not equal to the number of peaks in other pixel rows, the current value is updated, and the smoothing process of the row brightness curve of each pixel row based on the current value and subsequent steps are continued until the number of peaks in each pixel row is equal. If the number of peaks in each pixel row is equal, then the preliminary peak position sequence of each pixel row is taken as the final third peak sequence.

10. The method for correcting distortion of scanned images according to claim 7, characterized in that, Determining the position of the raster in each pixel row of the region of interest in the odd-row raster sub-image includes: The column mean brightness curve corresponding to the brightness value of each pixel row in each column of the odd-numbered row raster sub-image is determined, and the fourth peak sequence is obtained by performing peak fitting on the column mean brightness curve of each column. The region of interest in the odd-row raster sub-image is cropped according to the fourth peak sequence, and the peak position of each pixel row is extracted from the cropped odd-row raster sub-image as the position of the raster of the region of interest in each pixel row.

11. The method for correcting distortion of scanned images according to claim 10, characterized in that, The step of cropping the region of interest of the odd-row raster sub-image according to the fourth peak sequence includes: Determine the number of peaks in the fourth peak sequence; Based on the number of peaks in the fourth peak sequence, determine the starting and ending positions when clipping the odd-numbered row raster sub-image; The regions of interest in the odd-numbered raster sub-images are cropped based on the starting and ending positions.

12. The method for correcting distortion of scanned images according to claim 7, characterized in that, The step of performing row-by-row correction on the odd-numbered row object surface image based on the position of the at least one grid in each pixel row to obtain the corrected odd-numbered row object surface image includes: Obtain the first blank image to be filled, wherein the image height of the first blank image is the same as the image height of the odd-numbered row object sub-image; Based on the positions of all grids in the odd-row raster sub-image at each pixel row, the brightness values ​​of the corresponding pixel rows in the odd-row object surface sub-image are sampled in segments, and the sampled brightness values ​​are sequentially filled into the first blank image to obtain the corrected odd-row object surface sub-image.

13. The method for correcting distortion of scanned images according to claim 7, characterized in that, The step of performing row-by-row correction on the odd-numbered row object surface image based on the position of the at least one grid in each pixel row to obtain the corrected odd-numbered row object surface image includes: Based on the position of the raster in the region of interest in the odd-numbered raster sub-image in each pixel row, the odd-numbered raster sub-image is aligned row by row to obtain the aligned odd-numbered raster sub-image. Based on the position of the raster of interest in each pixel row in the odd-row raster sub-image, the odd-row object surface sub-image is aligned row by row to obtain the aligned odd-row object surface image. The aligned odd-row object surface sub-image is corrected row by row based on the aligned odd-row raster sub-image to obtain the corrected odd-row object surface sub-image.

14. The method for correcting distortion of scanned images according to claim 13, characterized in that, The step of aligning the odd-row raster sub-image row by row according to the position of the raster in the region of interest in each pixel row to obtain the aligned odd-row raster sub-image includes: Based on the position of the raster of interest in the odd-row raster sub-image in each pixel row, determine the maximum and minimum values ​​of the positions in all pixel rows, and determine the original image width of the odd-row raster sub-image; The sampling interval for resampling the odd-numbered raster sub-image is determined based on the maximum value, the minimum value, and the original image width; Obtain the second blank image to be filled, the image height of the second blank image being the same as the image height of the odd-numbered row raster sub-image; The odd-numbered raster sub-image is resampled within the sampling interval, and the resampled brightness values ​​are sequentially filled into the second blank image to obtain the aligned odd-numbered raster sub-image.

15. The method for correcting distortion of scanned images according to claim 14, characterized in that, The step of aligning the odd-row object surface sub-image row by row according to the position of the raster of interest in each pixel row in the odd-row raster sub-image to obtain the aligned odd-row object surface image includes: Obtain the third blank image to be filled, wherein the image height of the third blank image is the same as the image height of the odd-numbered row object sub-image; The odd-numbered object surface sub-image is resampled within the sampling interval, and the resampled brightness values ​​are sequentially filled into the third blank image to obtain the aligned odd-numbered object surface sub-image.

16. The method for correcting distortion of scanned images according to claim 13, characterized in that, The step of performing row-by-row correction on the aligned odd-row object surface sub-image based on the aligned odd-row raster sub-image to obtain the corrected odd-row object surface image includes: The column mean curve corresponding to the brightness value of each pixel row in each column of the aligned odd-row raster sub-image is determined, and after peak fitting of each column mean curve, multiple fifth peak sequences are obtained. Obtain the fourth blank image to be filled, wherein the image height of the fourth blank image is the same as the image height of the aligned odd-numbered row object sub-image; Based on the position of each fifth peak sequence, the brightness values ​​of the corresponding pixel rows in the aligned odd-row object surface sub-image are sampled in segments, and the sampled brightness values ​​are sequentially filled into the fourth blank image to obtain the corrected odd-row object surface sub-image.

17. A data acquisition card, characterized in that, The acquisition card stores computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the scan image distortion correction method as described in any one of claims 2 to 16.

Citation Information

Patent Citations

  • Confocal microscope parallel scanning device and scanning method based on scanning galvanometer and semiconductor laser

    CN107085290A

  • Confocal laser scanning imaging method and system and confocal laser scanning device

    CN118759713A