Static focusing device and method based on spectral confocal, electronic equipment and medium
By combining the first spectral confocal module to detect height information in advance and the second spectral confocal module to detect defocus, the contradiction between the axial detection range and resolution of the spectral confocal device is resolved, achieving a balance between high focusing range and high focusing accuracy, and improving focusing efficiency and accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-27
- Publication Date
- 2026-03-27
AI Technical Summary
Existing autofocus devices based on spectral confocal imaging have a contradiction between axial detection range and resolution, which limits focusing accuracy and speed, and the hysteresis of microscope objectives affects focusing efficiency.
The first spectral confocal module is used to detect the height information of the area to be measured in advance, and the second spectral confocal module is used to detect the defocus amount. The distance between the microscope objective and the area to be measured is adjusted by the processor to ensure that a high focusing range and high focusing accuracy are achieved within the depth of field.
It improves focusing efficiency and accuracy, reduces the moving distance of the microscope objective during focusing, avoids focusing inaccuracies caused by height information errors, and achieves a highly efficient and accurate focusing process.
Smart Images

Figure CN121742003A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of auto-focusing, and particularly relates to a static focusing device, method, electronic device and medium based on spectral confocal. BACKGROUND
[0002] In order to expand the application scenarios of the auto-focusing device and improve the detection efficiency, the prior art can construct an auto-focusing device based on spectral confocal, and detect the defocus amount of a microscopic imaging module by using spectral confocal technology to realize focusing. For the spectral confocal technology, a series of continuous measurement points are formed by focusing complex light containing multiple wavelengths on the optical axis in an increasing or decreasing manner of wavelength, and an internal spectrometer detects the focused light wave on the workpiece surface to form a peak wavelength. Subsequently, the peak wavelength is converted into corresponding height information according to the corresponding relationship between the wavelength and the focal position which is pre-calibrated.
[0003] However, for a single spectral confocal sensor, it is usually impossible to have both the high axial detection range and the high axial resolution of the spectral confocal, so that the application scenarios or focusing accuracy of the auto-focusing device based on spectral confocal are limited, and the focusing rate of the microscopic objective lens still needs to be improved due to the hysteresis of the movement of the microscopic objective lens. SUMMARY
[0004] The present application proposes a focusing device, method, electronic device and medium based on spectral confocal, which is used to improve the focusing accuracy and efficiency on the basis of ensuring the axial detection range.
[0005] To achieve the above object, the present application proposes the following technical solutions: In the first aspect of the present application, a static focusing device based on spectral confocal is provided, comprising: a microscopic imaging module comprising a microscopic objective lens, configured to collect an image of a to-be-measured region; a first spectral confocal module arranged at the front side of the scanning path of the microscopic imaging module, configured to detect the height information of the to-be-measured region by a plurality of image frame fields of the microscopic objective lens in advance compared with the microscopic imaging module; wherein the first spectral confocal module is parallel to the microscopic imaging module; and the change amount of the height information is not higher than the height adjustment range of the microscopic objective lens; a second spectral confocal module comprising the microscopic objective lens, configured to detect the defocus amount between the microscopic objective lens and the to-be-measured region when the image frame field of the microscopic objective lens covers the to-be-measured region; wherein the axial measurement range of the second spectral confocal module is lower than that of the first spectral confocal module, but the axial resolution is higher than that of the first spectral confocal module; The processor acquires the height information and the defocus amount, and is configured to, before an image frame field of view of the microscope objective covers the to-be-measured region, take the first spectral confocal module as a calibration object, adjust a first distance between the microscope objective and the to-be-measured region according to the height information, and when the image frame field of view of the microscope objective covers the to-be-measured region, adjust the first distance according to the defocus amount, so that the to-be-measured region is within the depth of field range; and the first spectral confocal module remains static.
[0006] Optionally, adjusting the first distance according to the defocus amount comprises: determining whether the defocus amount is within the depth of field range of the microscope objective, if yes, keeping the height of the microscope objective unchanged, and if no, continuously adjusting the first distance according to the defocus amount, so that the to-be-measured region is within the depth of field range.
[0007] Optionally, the processor stores first spectral relationships and second spectral relationships corresponding to the first spectral confocal module and the second spectral confocal module; wherein, based on the first spectral relationships, the processor calculates a focus position corresponding to a peak wavelength in the first spectral confocal module as the height information; based on the second spectral relationships, the processor calculates a height difference between focus positions corresponding to the peak wavelength and a target wavelength in the second spectral confocal module as the defocus amount; the spectral relationships represent the correspondence between the wavelength and the focus position; in the coaxial light path of the second spectral confocal module, the light ray of the target wavelength is parallel to the light ray in the imaging light path.
[0008] Optionally, after the processor acquires the height information and the defocus amount, and is configured to, before an image frame field of view of the microscope objective covers the to-be-measured region, take the first spectral confocal module as a calibration object, adjust a first distance between the microscope objective and the to-be-measured region according to the height information, the processor further comprises: when the image frame field of view of the microscope objective covers the to-be-measured region, determining a blur kernel matrix corresponding to the defocus amount based on a preset third calibration relationship, and performing deblurring processing on an image of the to-be-measured region according to the blur kernel matrix, so as to improve the definition of the image; wherein, the third calibration relationship represents the correspondence between the blur kernel matrix and the defocus amount.
[0009] Optionally, one measurement point is arranged in one image frame field of view; before the static focusing device works, the position relationship between the measurement points of the first spectral confocal module and the second spectral confocal module is calibrated according to a three-prism calibration object with a known slope, so that the measurement point positions of the first spectral confocal module and the second spectral confocal module are the same in the same image frame field of view.
[0010] Optionally, the process of calibrating the position relationship between the measurement points of the first spectral confocal module and the second spectral confocal module according to the three-prism calibration object with a known slope comprises: The scanning direction of the static focusing device is set along the longitudinal direction to obtain the height values of the inclined plane detection by the first spectral confocal module and the second spectral confocal module at the same time; wherein, the longitudinal direction represents the direction in which the height of the inclined plane along the triangular prism calibration object does not change; the scanning direction represents the direction of movement of the static focusing device relative to the object being measured during the detection process; the slope of the inclined plane is known; Based on the difference between the two height values and the slope of the inclined plane, the second distance along the lateral direction between the measurement points in the first and second spectral confocal modules is calculated; where lateral direction refers to the direction perpendicular to the longitudinal direction on the horizontal plane. Adjust the position of the measurement point in the first or second spectral confocal module along the lateral direction so that the value of the second distance is zero; Along the scanning direction of the horizontally set static focusing device, when the microscopic imaging module acquires the first frame image of the inclined surface in the triangular prism calibration object, the measurement point of the first spectral confocal module on the inclined surface is marked as a marker point, and the height value of the marker point is obtained based on the first spectral confocal module. The static focusing device scans the inclined plane along the scanning direction until the image frame field of view of the microscopic imaging module covers the marked point, and then stops scanning to obtain the height value of the measurement point of the second spectral confocal module in the current image frame field of view; wherein, the height of the dispersive objective and the microscope objective remains unchanged during the scanning process; Calculate the difference between the height value of the marker point and the height value of the measurement point in the current image frame's field of view. Combine this with the slope of the inclined plane to calculate the third distance along the lateral direction between the marker point and the measurement point. Adjust the position of the measurement point in the first or second spectral confocal module along the lateral direction so that the value of the third distance is zero.
[0011] In a second aspect of this application, a static focusing method is provided, applied to the static focusing apparatus described in any one of the first aspects, the static focusing method comprising: Based on the first spectral confocal module, the height information of the area to be tested is detected in the field of view of several image frames of the microscope objective before the microscope imaging module. Based on the second spectral confocal module, the defocus amount between the microscope objective and the area to be tested is detected when the field of view of the image frame of the microscope objective covers the area to be tested. The microscopic imaging module includes a microscope objective for acquiring images of the area to be measured; a first spectral confocal module is positioned in front of the scanning path of the microscopic imaging module; a second spectral confocal module includes the microscope objective; the axial measurement range of the second spectral confocal module is lower than that of the first spectral confocal module, but its axial resolution is higher; the first spectral confocal module is parallel to the microscopic imaging module; the change in height information is not higher than the height adjustment range of the microscope objective. Based on the height information and the defocus amount obtained by the processor, before the field of view of the image frame of the microscope objective covers the area to be tested, the first distance between the microscope objective and the area to be tested is adjusted according to the height information using the first spectral confocal module as a calibration object, and when the field of view of the image frame of the microscope objective covers the area to be tested, the first distance is adjusted according to the defocus amount so that the area to be tested is within the depth of field; wherein, the first spectral confocal module remains stationary.
[0012] Optionally, a measurement point is set within the field of view of an image frame; before the static focusing device operates, the static focusing method further includes: Using a triangular prism calibration object with a known slope, the positional relationship of the measurement points between the first and second spectral confocal modules is calibrated so that the measurement points of the first and second spectral confocal modules are at the same position within the field of view of the same image frame.
[0013] In a third aspect of this application, an electronic device is provided, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus. Memory, used to store computer programs; The processor, when executing a program stored in memory, implements the static focusing method described in any of the second aspects.
[0014] In a fourth aspect of this application, a computer-readable storage medium is provided, wherein a computer program is stored therein, and when executed by a processor, the computer program implements the static focusing method described in any of the second aspects.
[0015] The beneficial effects of this application are as follows: This application provides a static focusing device based on spectral confocal focusing, comprising: The microscopic imaging module includes a microscope objective lens, used to acquire images of the area to be tested; The first spectral confocal module is positioned in front of the scanning path of the microscopic imaging module. It is used to detect the height information of the area to be measured several image frames ahead of the microscopic imaging module. The first spectral confocal module is parallel to the microscopic imaging module. The change in the height information is not higher than the height adjustment range of the microscopic objective. The second spectral confocal module, including the microscope objective, is used to detect the defocusing amount between the microscope objective and the area under test when the field of view of the image frame of the microscope objective covers the area under test; wherein, the axial measurement range of the second spectral confocal module is lower than that of the first spectral confocal module, but the axial resolution is higher than that of the first spectral confocal module. The processor acquires the height information and the defocus amount, and uses the first spectral confocal module as a calibration object to adjust the first distance between the microscope objective and the area to be measured according to the height information before the image frame field of view of the microscope objective covers the area to be measured, and adjusts the first distance according to the defocus amount when the image frame field of view of the microscope objective covers the area to be measured, so that the area to be measured is within the depth of field; wherein the first spectral confocal module remains stationary.
[0016] Based on the aforementioned configuration, this application incorporates a first spectral confocal module with a large focusing range but low precision, and a second spectral confocal module with a small focusing range but high precision in the static focusing device. During the adjustment of the first distance between the microscope objective and the area to be measured, the processor can utilize the height information provided by the first spectral confocal module and the defocus amount provided by the second spectral confocal module to ensure the focusing range of the focusing device and the focusing precision by using the defocus amount, thus achieving a balance between a large focusing range and high focusing precision.
[0017] Before the field of view of the microscope objective image frame covers the area to be tested, the first spectral confocal module not only detects the height information of the area to be tested in advance, but also adjusts the first distance in advance according to the height information. This shortens the distance that the microscope objective needs to move when focusing when the field of view of the microscope objective image frame covers the area to be tested, effectively reducing the time spent in the focusing process of the microscope objective and improving the focusing efficiency.
[0018] The processor in this application, by determining whether the defocus amount is within the depth of field range of the microscope objective, can not only avoid secondary focusing due to the defocus amount after accurate focusing based on the height information, thus ensuring focusing efficiency, but also calibrate the result of adjusting the first distance based on the height information, thus avoiding the problem of the microscope objective failing to focus accurately due to incorrect height information.
[0019] Compared to the technical solution disclosed in Chinese Patent CN120370528A, the technical means and the technical problem solved in this application are different. Specifically, this application uses a first spectral confocal module to detect the height information of the area to be measured in advance, which is an absolute value, rather than the relative distance between the distance measuring device and the surface of the object being measured as in existing patents. This application uses the first spectral confocal module as a calibration object, and adjusts the first distance by moving a second spectral confocal module in conjunction with the height information. This eliminates the need to simultaneously move the distance detection device and the autofocus device, thus ensuring focusing efficiency.
[0020] The technical problem solved in the existing patent CN120370528A is how to avoid the height difference from exceeding the adjustment range of the autofocus device. This application, however, limits the change in height information to no more than the height adjustment range of the microscope objective. It utilizes the fact that the axial measurement range of the second spectral confocal module is lower than that of the first spectral confocal module, but its axial resolution is higher. By combining the two spectral confocal modules, a balance between a wide focusing range and high focusing accuracy is achieved. Attached Figure Description
[0021] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings: Figure 1 This is a schematic diagram of a static focusing process provided in this application; Figure 2 This is a structural diagram of a static focusing device provided in this application; Figure 3 This is a diagram of the optical path structure for a polychromatic light source beam splitting provided in this application; Figure 4 This is a structural diagram of another static focusing device based on spectral confocal focusing provided in this application; Figure 5 This is a schematic diagram of a measurement point calibration device provided in this application; Figure 6 This is a schematic diagram of a triangular prism calibration object provided in this application; Figure 7 This is a schematic diagram of the distribution of measurement points under the field of view of an image frame provided in this application; Figure 8 This is a flowchart of a measurement point calibration method provided in this application; Figure 9 This is a schematic diagram illustrating the principle of the second distance calculation provided in this application; Figure 10 This is a schematic diagram illustrating the principle of the third distance calculation provided in this application; Figure 11 This is a flowchart of a static focusing method provided in this application; Figure 12 This is a flowchart of another static focusing method provided in this application; Figure 13 This is a structural diagram of an electronic device provided in this application. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, 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 some embodiments of this application, but not all embodiments.
[0023] In the testing process of autofocus devices, there are two types: static focusing and dynamic tracking focusing. Static focusing in this application can be understood as automatically focusing on a stationary area to be tested, or, during the testing of the object, using the area covered by a single microscope objective frame as the unit of movement, the object moves relative to the autofocus device, and the autofocus device focuses while remaining stationary relative to the area covered by each microscope objective frame. Figure 1 As shown. Dynamic tracking focus means that the autofocus device performs real-time focusing on a moving object. The solution provided in this application is applied to the aforementioned static focusing scenario.
[0024] In this application, the image frame field of view refers to the area of the object's surface covered by the field of view when a frame of photographs is generated based on a microscope objective. During the detection of the object, to ensure proper image stitching, adjacent image frame fields of view typically have a certain overlap area, such as... Figure 1 As shown. In the static focusing scheme provided in this application, for each image frame's field of view covering the area of the object under test, one measurement point for calculating the defocus amount is usually retained to maximize autofocus efficiency. Alternatively, multiple measurement points can be set, but the detection result of one of the measurement points is selected as the defocus amount during focusing. Furthermore, during microscopic autofocus, although the microscope objective moves along the vertical direction, the moving distance is relatively short. Therefore, in this application or the actual scheme, it can be directly assumed that the size of the image frame's field of view remains constant during microscopic autofocus.
[0025] In static focusing scenarios, a single spectral confocal sensor often cannot simultaneously achieve both a high axial measurement range and high axial resolution, limiting the applicability and focusing accuracy of spectral confocal-based autofocus devices. Specifically, for spectral confocal sensors, with a constant light source, expanding the axial measurement range increases the interval between focal positions corresponding to different wavelengths, reducing axial resolution and consequently lowering the focusing accuracy of the autofocus device. Similarly, increasing the axial resolution of a spectral confocal sensor reduces the axial measurement range, shrinking the detection range of the autofocus device and limiting its applicability. Furthermore, due to the hysteresis of microscope objective movement, the objective focusing rate still needs improvement.
[0026] To address the above issues, this application provides a focusing device based on spectral confocal focusing, such as... Figure 2As shown, the focusing device includes: The microscopic imaging module, including a microscope objective, is used to acquire images of the area to be tested.
[0027] The first spectral confocal module is positioned in front of the scanning path of the microscopic imaging module. It is used to detect the height information of the region to be measured several image frames ahead of the microscopic imaging module. The first spectral confocal module is parallel to the microscopic imaging module; the change in height information does not exceed the height adjustment range of the microscopic objective.
[0028] The second spectral confocal module, including the microscope objective, is used to detect the defocusing amount between the microscope objective and the area under test when the field of view of the image frame of the microscope objective covers the area under test. The axial measurement range of the second spectral confocal module is shorter than that of the first spectral confocal module, but its axial resolution is higher.
[0029] The processor acquires the height information and the defocus amount, and uses the first spectral confocal module as a calibration object to adjust the first distance between the microscope objective and the area to be measured according to the height information before the image frame field of view of the microscope objective covers the area to be measured, and adjusts the first distance according to the defocus amount when the image frame field of view of the microscope objective covers the area to be measured, so that the area to be measured is within the depth of field; wherein the first spectral confocal module remains stationary.
[0030] In one implementation, the process of adjusting the first distance based on the defocus amount may include the following: Determine whether the defocus amount is within the depth of field of the microscope objective. If yes, keep the height of the microscope objective unchanged; otherwise, continue to adjust the first distance according to the defocus amount so that the area to be measured is within the depth of field.
[0031] Based on the aforementioned configuration, this application incorporates a first spectral confocal module with a large focusing range but low precision, and a second spectral confocal module with a small focusing range but high precision in the static focusing device. During the adjustment of the first distance between the microscope objective and the area to be measured, the processor can utilize the height information provided by the first spectral confocal module and the defocus amount provided by the second spectral confocal module to ensure the focusing range of the focusing device and the focusing precision by using the defocus amount, thus achieving a balance between a large focusing range and high focusing precision.
[0032] Before the field of view of the microscope objective image frame covers the area to be tested, the first spectral confocal module not only detects the height information of the area to be tested in advance, but also adjusts the first distance in advance according to the height information. This shortens the distance that the microscope objective needs to move when focusing when the field of view of the microscope objective image frame covers the area to be tested, effectively reducing the time spent in the focusing process of the microscope objective and improving the focusing efficiency.
[0033] The processor in this application, by determining whether the defocus amount is within the depth of field range of the microscope objective, can not only avoid secondary focusing due to the defocus amount after accurate focusing based on the height information, thus ensuring focusing efficiency, but also calibrate the result of adjusting the first distance based on the height information, thus avoiding the problem of the microscope objective failing to focus accurately due to incorrect height information.
[0034] The technical solution disclosed in Chinese patent CN120370528A uses a first height difference between first height information and first standard height information to control the focusing of the target microscope objective. In the prior art, the height information essentially represents the relative distance between the measured surface and the ranging device. Therefore, to ensure that the first height difference can be used as the defocusing amount of the target microscope objective, the ranging device and the target microscope objective must remain relatively stationary.
[0035] This application, based on the principle of spectral confocalization, detects the height information of the object's surface using a first spectral confocal module, which is an absolute height value. Simultaneously, the first spectral confocal module remains stationary. During the process of pre-adjusting the first distance using the height information, the second spectral confocal module can be moved independently to adjust the first distance, using the first spectral confocal module as a calibration object. This eliminates the need for the ranging device and the target microscope objective to remain stationary, as in the aforementioned prior art, thus improving focusing efficiency.
[0036] Compared to the technical solution disclosed in Chinese Patent CN120370528A, the technical means and the technical problem solved in this application are different. Specifically, this application uses a first spectral confocal module to detect the height information of the area to be measured in advance, which is an absolute value, rather than the relative distance between the distance measuring device and the surface of the object being measured as in existing patents. Therefore, this application uses the first spectral confocal module as a calibration object, and adjusts the first distance by moving the second spectral confocal module in conjunction with the height information, without the need to simultaneously move the distance detection device and the autofocus device, thus ensuring focusing efficiency.
[0037] The technical problem solved in the existing patent CN120370528A is how to avoid the height difference from exceeding the adjustment range of the autofocus device. This application, on the other hand, limits the change in height information to no more than the height adjustment range of the microscope objective. It utilizes the fact that the axial measurement range of the second spectral confocal module is lower than that of the first spectral confocal module, but the axial resolution is higher than that of the first spectral confocal module. By using the combination of the two spectral confocal modules, a balance between a high focusing range and high focusing accuracy is achieved.
[0038] For the microscopic imaging module, a microscope objective and an image sensor are arranged along the imaging optical path to acquire images of the area under test. The imaging light rays in the imaging optical path are provided by an illumination source. The imaging light rays pass parallel to the Z-axis (i.e., perpendicular to the direction) through the microscope objective, converge, and after reflection from the surface of the object under test, enter the image sensor for imaging. The image sensor can be a linear array sensor or a planar array sensor.
[0039] In some embodiments, the microscopic imaging module further includes an eyepiece and a filter, disposed between the image sensor and the microscope objective. The imaging light reflected from the surface of the object under test is filtered by the filter and then coupled into the image sensor through the eyepiece. In this application, by adjusting the height of the microscope objective vertically, the distance between the microscope objective and the area under test is changed, so that the area under test is within the depth of field of the microscope objective, i.e., the depth of field of the microscope objective covers the area under test. The area under test refers to the area on the surface of the object under test used for detection; it can be the entire area covered by the field of view of a certain image frame, or a portion of the area covered by the field of view of an image frame.
[0040] In the focusing device provided in this application, the first spectral confocal module and the second spectral confocal module use different polychromatic light sources. Or, as... Figure 3 As shown, the first and second spectral confocal modules share a single polychromatic light source. The polychromatic light emitted from this source is split into two beams by a beam splitter, which serve as the incident light for the first and second spectral confocal modules, respectively. The beam splitter can be a planar beam splitter, a cubic beam splitter, or a thin-film beam splitter, etc., and the type is not specifically limited. Furthermore, the polychromatic light entering the first spectral confocal module serves as the first split beam, and the polychromatic light entering the second spectral confocal module serves as the second split beam.
[0041] For the first spectral confocal module, such as Figure 4As shown, the first focusing optical path of the first spectral confocal module is off-axis from the imaging optical path and is positioned in the field of view of one or more preceding image frames of the microscopic imaging module. Inside the first spectral confocal module, along the first focusing optical path, are sequentially arranged a first beam splitter, a dispersive objective, a first conjugate aperture, and a first spectrometer. The first beam of light undergoes spectral dispersion after passing through the first beam splitter and the dispersive objective. The beam reflected back from the surface of the object being measured is reflected by the first beam splitter and passes through the first conjugate aperture into the first spectrometer, where it is used to obtain height information based on the peak wavelength within the spectrometer. The first beam of light refers to the beam emitted by the polychromatic light source and entering the first spectral confocal module. The first focusing optical path represents the optical path within the first spectral confocal module used to detect height information.
[0042] Specifically, the first beam of light undergoes spectral dispersion after passing through the first beam splitter and the dispersive objective, forming continuous monochromatic light focal points along the optical axis of the dispersive objective. Each monochromatic light focal point is at a different distance from the surface to be measured. When the object under test is located within the measurement range, only light of a specific wavelength is focused on the surface of the object. Because this wavelength satisfies the confocal condition, it can be reflected from the surface of the object, reflected again by the first beam splitter, and then pass through the first conjugate aperture into the first spectrometer. Most other light rays cannot enter the spectrometer. The wavelength value at the point of maximum light intensity (i.e., the peak wavelength) is obtained by decoding with the first spectrometer, thus obtaining the distance value corresponding to the measurement point in the test area on the surface of the object.
[0043] A first spectral confocal module is positioned in the field of view of one or more image frames preceding the microscopic imaging module. The position of the first spectral confocal module can be understood as being located in front of the microscopic imaging module along its scanning direction, allowing for the early detection of the height information of the area to be measured during the detection process. The focusing optical path and imaging optical path of the first spectral confocal module are designed off-axis, meaning there is no overlap between the two optical paths. In the focusing device provided in this application, the position of the dispersive objective is fixed during the detection process, serving as a reference for adjusting the height of the microscopic objective. The height of the microscopic objective in the vertical direction is adjusted according to the height information of the surface to be measured.
[0044] For the second spectral confocal module, such as Figure 4 As shown, the second focusing optical path and the imaging optical path of the first spectral confocal module are designed to be coaxial, and a second beam splitter, a dispersive lens group, a collimating lens group, a third beam splitter, a microscope objective, a second conjugate aperture, and a second spectrometer are arranged sequentially along the second focusing optical path.
[0045] In this system, the second beam splits into different wavelengths after passing through the second beam splitter and the dispersive objective. Each wavelength of light passes through a collimating lens group, is reflected by the third beam splitter, and then enters the microscope objective. The microscope objective focuses the light to form focal points of different heights. After reflection from the surface of the object under test, the light passes through the microscope objective, is reflected by the third beam splitter, and then passes through the collimating lens group, the dispersive lens group, the second beam splitter, and the second conjugate aperture before entering the second spectrometer. The defocusing amount is determined by the distance difference between the peak wavelength and the target wavelength corresponding to the focal point in the second spectrometer. The target wavelength light is modulated into collimated light after passing through the collimating lens group and is parallel to the imaging light in the imaging optical path. The second focusing optical path, located in the second spectral confocal module, is the optical path used to detect the defocusing amount.
[0046] Specifically, the second beam splitter enters the dispersive lens group after passing through the second beam splitter, where it separates light rays of different wavelengths. Then, multiple light rays of different wavelengths pass through the collimating lens group, which collimates and parallels the light ray of the target wavelength. The collimating lens group is usually a negative lens group, used to modulate and collimate the beam of the target wavelength among multiple beams of different wavelengths, while modulating the beams of other wavelengths into converging or diverging light.
[0047] The light of the target wavelength is modulated and collimated by the collimating lens group, becoming parallel to the imaging light in the imaging optical path. Therefore, in the second spectral confocal module, the focal position corresponding to the target wavelength coincides with the focal position of the microscope objective. The coaxial optical path between the second spectral confocal module and the microscope imaging module is the optical path between the third beam splitter and the surface of the object being tested.
[0048] Subsequently, the beam passing through the collimating lens group is reflected by the third beam splitter and enters the microscope objective. After being focused by the microscope objective, it forms focal points at different heights on the same principal optical axis. Finally, the second beam splitter is reflected by the surface to be tested, passes through the microscope objective, is reflected by the third beam splitter, passes through the collimating lens group and the dispersive lens group, passes through the second beam splitter, and then passes through the second conjugate aperture into the second spectrometer. The second spectrometer decodes the peak wavelength, and the distance difference between the focal position corresponding to the peak wavelength and the target wavelength is used as the defocusing amount of the microscope objective.
[0049] The dispersive objective lens of the first spectral confocal module and the dispersive lens group of the second spectral confocal module differ in their objective lens structures. When a polychromatic beam passes through the dispersive objective lens of the first spectral confocal module, the dispersive range is larger, thus achieving the goal that the axial measurement range of the first spectral confocal module is higher than that of the second spectral confocal module. For example, the dispersive objective lens can adopt a structure of multiple sets of cemented doublet lenses cascaded to make the dispersive range larger than that of the dispersive lens group. Here, the axial measurement range in this application represents the maximum height difference along the optical axis (i.e., the vertical direction or the Z-axis direction) of the focal positions corresponding to each wavelength in the polychromatic light source, which can be understood as the measurement range of the first spectral confocal module and the second spectral confocal module.
[0050] Furthermore, the structures of the first conjugate through-hole and the second conjugate through-hole, as well as the first spectrometer and the second spectrometer, can remain consistent and do not need to differ.
[0051] Considering that the first and second spectral confocal modules are based on the same polychromatic light source, but their axial measurement ranges differ (i.e., the dispersion ranges of the polychromatic light source are different), the spectral relationships of the different modules are different. Here, the spectral relationship represents the correspondence between wavelength and focal position. In this application, the spectral relationship includes a first spectral relationship and a second spectral relationship, corresponding to the spectral relationship of the first and second spectral confocal modules, respectively.
[0052] In the aforementioned case, the processor provided in this application stores a first spectral relationship and a second spectral relationship corresponding to the first spectral confocal module and the second spectral confocal module. Based on the first spectral relationship, the processor calculates the focal position corresponding to the peak wavelength in the first spectral confocal module, which serves as height information. Based on the second spectral relationship, the processor calculates the height difference between the focal positions corresponding to the peak wavelength and the target wavelength in the second spectral confocal module, which serves as the defocusing amount.
[0053] Considering that the second spectral confocal module and the microscopic imaging module share a single microscope objective, in order to prevent the second spectral relationship from changing during the movement of the microscope objective, the static focusing device provided in this application also includes a focusing mechanism. By moving the second spectral confocal module as a whole, the height of the microscope objective in the vertical direction is changed to achieve the adjustment of the first distance.
[0054] In some embodiments, the processor in this static focusing device is connected to a first spectral confocal module, a second spectral confocal module, and a focusing mechanism. It is used to acquire the height information of the area to be measured using the first spectral confocal module before the image frame field of view of the microscope objective covers the area to be measured. Then, as the microscope objective moves to the area to be measured, using the first spectral confocal module as a calibration object, the height point of the microscope objective is determined based on the aforementioned height information. The second spectral confocal module is then moved along the Z-axis by the focusing mechanism to adjust the first distance, thereby maximizing the coverage of the depth of field of the microscope objective over the area to be measured.
[0055] During the operation of the static focusing device, the height of the dispersive objective lens in the first spectral confocal module remains unchanged. On the one hand, it can serve as a reference in the height information calculation process. On the other hand, during the adjustment of the first distance, the dispersive objective lens also serves as a reference. Combined with the height value of the measurement point in the area to be measured, the moving distance of the microscope objective lens is calculated, thereby realizing the adjustment of the first distance.
[0056] Specifically, the adjustment process for the first distance can be as follows: Based on the height information measured by the first spectral confocal module, during the adjustment of the first distance, the first spectral confocal module is used as a reference (i.e., the position of the dispersive lens within the first spectral confocal module is used as the calibration height), combined with the known depth of field length of the microscope objective, to determine the height point at which the microscope objective completes focusing. Subsequently, based on the aforementioned reference and the height point at focusing, the direction and distance of movement of the microscope objective along the Z-axis (i.e., the defocusing amount) are calculated. Then, the second spectral confocal module can be moved as a whole by the focusing mechanism to complete the focusing process of the microscope objective.
[0057] Alternatively, the initial height of the microscope objective can be marked before the focusing device operates. Subsequently, the distance and direction of movement of the microscope objective along the Z-axis are recorded each time it moves between adjacent image frames, and the height value of the microscope objective is updated in real time. Thus, after knowing the height information, the required movement direction and distance of the microscope objective (i.e., the defocusing amount) can be directly calculated.
[0058] When the field of view of the microscope objective image frame covers the area to be tested, the defocus amount between the microscope objective and the area to be tested is detected based on the second spectral confocal module. Then, it is determined whether this defocus amount is within the depth of field of the microscope objective. If so, it indicates that during the process of the microscope imaging module moving to the area to be tested, the microscope imaging module has already achieved focusing of the microscope objective based on the height information calculated by the first spectral confocal module. Therefore, it is not necessary to adjust the first distance based on the defocus amount. Thus, the height of the microscope objective remains unchanged, and the image of the area to be tested is directly acquired through the microscope imaging module.
[0059] If the defocus amount is not within the depth of field range of the microscope objective, it indicates that the microscope objective has not been focused based on the height information, or that the height information value is inaccurate, causing the microscope objective to fail to focus accurately. In response, the processor controls the focusing mechanism to adjust the focus by a first distance based on the defocus amount, so that the depth of field range of the microscope objective covers the area to be measured.
[0060] Since the second spectral confocal module and the microscopic imaging module share the same microscope objective and have a coaxial optical path along the optical axis of the microscope objective, the field of view of the microscope objective image frame covering the area to be measured can be understood as the microscope imaging module moving above the area to be measured and being used to acquire the image of the area to be measured.
[0061] The first and second spectral confocal modules use point light sources, and both measure height information or defocus amount based on point spectral confocalization. The height information or defocus amount of the area to be measured is obtained by measuring the focal point of the light rays in the area. In this application, the focal point of the light rays is also referred to as the measurement point, indicating the location used for spectral confocal detection.
[0062] In the static focusing scheme provided in this application, to ensure the consistency of the detection results between the second and first spectral confocal modules for the same area to be measured, the measurement point positions of the two spectral confocal modules at different times are required to be the same. To minimize deviations in the measurement point positions of the two spectral confocal modules for the same area to be measured, typically, for any area covered by the field of view of an image frame, each of the two spectral confocal modules retains only one measurement point for detecting the height information or defocus amount of the area to be measured. In practice, within the field of view of an image frame, the two spectral confocal modules can perform multiple spectral confocal measurements, but only the measurement value of one detection point is selected as the height information or defocus amount of this application; this detection point is the measurement point of this application.
[0063] To ensure that the measurement points of the two spectral confocal modules are at the same position within the same image frame field of view, the static focusing scheme provided in this application calibrates the positional relationship of the measurement points between the first and second spectral confocal modules using a triangular prism calibration object with a known slope before the static focusing device operates, so that the measurement points of the first and second spectral confocal modules are at the same position within the same image frame field of view.
[0064] like Figure 5 As shown, during the calibration of the measurement points, the triangular prism calibration object provided in this application is placed horizontally on the moving platform. The slope of the inclined plane in the triangular prism calibration object is fixed and known. Furthermore, the triangular prism calibration object provided in this application is preferably a right-angled triangular prism with an isosceles right-angled triangle as its base.
[0065] To clearly illustrate the orientation in the calibration scenario of this application, such as Figure 5 , 6 As shown, the direction along the inclined plane of the triangular prism in the three-dimensional coordinate system of this scene that does not change in height is defined as the longitudinal direction, also known as the y-axis, and the longitudinal direction is parallel to the highest side of the triangular prism calibration object. If the contact surface between the triangular prism calibration object and the moving platform is rectangular, then this longitudinal direction is parallel to the long side of the rectangle.
[0066] In the aforementioned three-dimensional coordinate system, the x-axis is the horizontal direction, also known as the horizontal direction, which is perpendicular to the vertical direction on the horizontal plane, meaning it is parallel to the width of the rectangular contact surface. The Z-axis represents the direction perpendicular to the horizontal plane, combined with... Figure 4 As can be seen from the content, the Z-axis is parallel to the optical axis of the microscope objective and the dispersive objective, and can be simply referred to as the vertical direction, which belongs to the direction of movement of the microscope objective.
[0067] Within the same image frame field of view, the measurement point used for detecting height information based on the first spectral confocal module is designated as measurement point 1, and the measurement point used for detecting defocus amount based on the second spectral confocal module is designated as measurement point 2. Assuming the static focusing device scans the inclined surface of the triangular prism calibration object along a direction parallel to the X-axis, the positional deviation between measurement point 1 and measurement point 2 within the same image frame field of view is as follows: Figure 6 , Figure 7 As shown in the diagram. The distance between two measurement points along the y-axis is defined as the second distance x1, and the distance along the x-axis is defined as the third distance x2. Note that... Figure 6 , Figure 7 The two measurement points shown in the same image frame field of view correspond to the measurement points of the two spectral confocal modules at different times.
[0068] To measure the distance between two measurement points within the same image frame's field of view, this application employs a process of calibrating the positional relationship between the measurement points of the first and second spectral confocal modules using a triangular prism calibration object with a known slope. Figure 8 As shown, it includes the following steps: S1. Set the scanning direction of the static focusing device along the longitudinal direction to obtain the height values of the inclined plane detected by the first spectral confocal module and the second spectral confocal module at the same time.
[0069] Where, longitudinal direction represents the direction along the inclined plane of the triangular prism calibration object where the height remains unchanged. Scanning direction represents the direction of movement of the static focusing device relative to the object being measured during the detection process. (Refer to...) Figure 5 The longitudinal direction can also be understood as the y-axis direction, and the height values detected by the two spectral confocal modules along the longitudinal direction do not change.
[0070] S2. Based on the difference between the two height values and the slope of the inclined plane, calculate the second distance along the lateral direction between the measurement points in the first and second spectral confocal modules. Here, lateral direction refers to the direction perpendicular to the longitudinal direction on the horizontal plane.
[0071] When the scanning direction of the static focusing device is set along the longitudinal direction, combined with Figure 5 , 6 It is evident that if the coordinates of measurement point 1 and measurement point 2 along the x-axis are the same (which can be understood as: the line connecting the measurement points of the two spectral confocal modules is parallel to the y-axis), then the detected height values should be the same. Similarly, if there is a difference in the height values at the two locations, it indicates that there is a deviation between the two measurement points along the x-axis. Combining the known slope θ of the inclined plane of the triangular prism calibration object with trigonometric formulas, such as... Figure 9 As shown, the formula for calculating the second distance is: x1 = h1 * cotθ. Here, x1 represents the second distance, h1 represents the difference between two height values, and cotθ represents the cotangent formula for a known slope θ.
[0072] S3. Adjust the position of the measurement point in the first or second spectral confocal module along the lateral direction so that the value of the second distance is zero. Based on the above processing, when the scanning direction of the static focusing device is set along the longitudinal direction, the line connecting the measurement points of the two spectral confocal modules can be made parallel to the y-axis.
[0073] In some embodiments, for steps S1 to S3, a ruler or a two-dimensional calibration object (such as a calibration plate) with coordinate information can be used to mark the measurement points of the first spectral confocal module and the second spectral confocal module at the same time when the scanning direction of the static focusing device is set along the longitudinal direction. Then, the second distance between the two measurement points along the x-axis can be directly measured using the ruler, or the second distance between the two measurement points along the x-axis can be calculated based on the coordinate information on the two-dimensional calibration object.
[0074] S4. Along the scanning direction of the horizontally set static focusing device, when the microscopic imaging module acquires the first frame image of the inclined surface in the triangular prism calibration object, the measurement point of the first spectral confocal module on the inclined surface is marked as a marker point, and the height value of the marker point is obtained based on the first spectral confocal module.
[0075] For step S4, based on the aforementioned steps S1-S3, the scanning direction of the static focusing device is reset to horizontal, i.e., as follows: Figure 5 The x-axis direction is shown. Then, when the microscopic imaging module acquires an image of the inclined surface in the triangular prism calibration object, the marker point of the first spectral confocal module on the inclined surface is obtained, and the height value of the marker point is calculated using the first spectral confocal module. Furthermore, during the operation of the static focusing device provided in this application, when the microscopic imaging module acquires an image of the surface of the object under test, the height information acquired by the first spectral confocal module is used as the basis for adjusting the first distance during the subsequent movement of the microscopic imaging module to ensure that the field of view of the microscope objective image frame covers the area to be measured.
[0076] S5. The static focusing device scans the inclined plane along the scanning direction until the image frame field of view of the microscopic imaging module covers the marked point, at which point the scanning stops, and the height value of the measurement point of the second spectral confocal module in the current image frame field of view is obtained. During the scanning process, the heights of the dispersive objective and the microscope objective remain constant.
[0077] For step S5, the moment when the image frame field of view of the microscopic imaging module covers the marker point indicates that, in the normal static focusing mode of the static focusing device, the microscopic imaging module acquires images of the inclined plane frame by frame according to the preset image frame field of view, and acquires an image containing the marker point. Furthermore, since the height of the microscope objective remains constant, the height value of the measurement point in the current image frame field of view can be directly detected by the second spectral confocal module. If the measurement point of the second spectral confocal module is at the same position as the aforementioned marker point, then their height values should be the same. Conversely, if they are not, it indicates that, with the scanning direction of the static focusing device set laterally, the measurement points of the two spectral confocal modules in the same image frame field of view have deviated in lateral position.
[0078] S6. Calculate the difference between the height value of the marker point and the height value of the measurement point in the current image frame's field of view. Combined with the slope of the inclined plane, calculate the third distance along the horizontal direction between the marker point and the measurement point.
[0079] Similar to the formula for calculating the second distance in step S2, based on the characteristic that the slope of the triangular prism calibration object is fixed, such as... Figure 10 As shown, when the scanning direction of the static focusing device is set horizontally, the formula for calculating the third distance can be obtained as: x2 = h2 * cotθ. Here, x2 represents the third distance, and h2 represents the difference between the height of the marker point and the height of the measured point in the current image frame's field of view.
[0080] S7. Adjust the position of the measurement point in the first or second spectral confocal module along the horizontal direction so that the value of the third distance is zero. Thus, when the scanning direction of the static focusing device is set horizontally, the line connecting the measurement points of the two spectral confocal modules in the same image frame field of view can be made parallel to the x-axis.
[0081] Based on the aforementioned processing, the static focusing scheme provided in this application utilizes a triangular prism calibration object and, in conjunction with different scanning direction settings, calculates the distances along the x and y axes of the measurement points of the two spectral confocal modules in the same image frame field of view. The positions of the two measurement points are then adjusted to ensure that their positions are consistent. During the detection process, the height information and the position of the measurement point corresponding to the defocus amount are the same in the static focusing device provided in this application, thus ensuring the accuracy of the autofocus effect.
[0082] In some embodiments, the focusing device provided in this application can use the height information detected by the first spectral confocal module to focus the microscope objective, and use the defocus amount detected by the second spectral confocal module to compensate the image quality of the image generated by the image sensor, thereby improving the clarity of the image of the surface to be detected while ensuring the high efficiency of off-axis autofocus and avoiding the problem of image blurring at high speeds.
[0083] In one implementation, the processor adjusts the first distance based on the height information during the process of moving the microscopic imaging module so that the field of view of the microscope objective image frame covers the area to be tested. Furthermore, when the field of view of the microscope objective image frame covers the area to be tested, the processor performs deblurring processing on the image of the surface to be tested based on the defocus amount. This replaces the methods of determining whether the defocus amount is within the depth of field range of the microscope objective and subsequent techniques, directly improving image clarity through image quality compensation. Specifically, this includes the following: After acquiring the height information and the defocus amount, and adjusting the first distance between the microscope objective and the area to be measured based on the height information using the first spectral confocal module as a calibration object before the image frame field of view of the microscope objective covers the area to be measured, the processor further includes: When the field of view of the image frame of the microscope objective covers the area to be tested, the blur kernel matrix corresponding to the defocus amount is determined based on the preset third calibration relationship. The image of the area to be tested is deblurred according to the blur kernel matrix to improve the image clarity. The third calibration relationship represents the correspondence between the blur kernel matrix and the defocus amount.
[0084] Based on the above processing, the image of the area to be detected can be deblurred using a fuzzy kernel matrix, thereby improving the image clarity. This eliminates the need for secondary adjustment of the initial distance between the microscope objective and the area to be detected, thus improving the detection efficiency of the static focusing device.
[0085] After acquiring the height information, the processor adjusts the first distance via the focusing mechanism according to the height information during the process of moving the microscopic imaging module so that the field of view of the microscope objective image frame covers the area to be measured.
[0086] The processor is connected to an image sensor and is used to determine the corresponding blur kernel matrix based on the defocus amount when the field of view of the microscope objective image frame covers the area to be tested; and to perform deblurring processing on the image of the area to be tested acquired by the image sensor based on the blur kernel matrix to improve the image clarity; wherein, the values of the blur kernel matrix and the defocus amount are in one-to-one correspondence, and the correspondence relationship is the third calibration relationship.
[0087] In the aforementioned image quality compensation process, the focusing mechanism focuses based on the height information generated by the first spectral confocal module, while the defocus amount generated by the second spectral confocal module is used to compensate for the image quality of the image generated by the image sensor. Therefore, this application can not only achieve active focusing using height information, but also use the defocus amount to calculate the blur kernel matrix in real time to perform image deblurring on the image generated by the image sensor, thereby improving the image blurring problem caused by poor real-time focusing performance and meeting the autofocus requirements in applications requiring higher precision and speed.
[0088] In one implementation, before the processor determines the corresponding blur kernel matrix based on the defocus amount, the following is also included. The processor pre-calculates the blur kernel matrix corresponding to different defocus amounts, obtaining a set of blur kernel matrices. From this set, the blur kernel matrix corresponding to the current defocus amount is obtained.
[0089] In the aforementioned image quality compensation embodiment, the calculation of the blur kernel matrix can be achieved through a calibration combined with interpolation. Specifically, during factory calibration, the blur kernel matrix is calculated and pre-stored using a pre-defined known defocus amount. In actual operation, the pre-stored blur kernel matrix is addressed based on the calculated defocus amount, directly reading the blur kernel matrix at the corresponding address. If the address is not an integer, two blur kernel matrices are read (upper and lower integers), and a weighted interpolation algorithm is used to calculate the blur kernel matrix in real time for image blur correction.
[0090] Based on the same inventive concept, this application also provides a static focusing method, applied to the aforementioned focusing device, such as... Figure 11 As shown, the focusing method includes the following steps: Step 1: Based on the first spectral confocal module, the height information of the area to be tested is detected in several image frames of the microscope objective before the microscope imaging module. Based on the second spectral confocal module, the defocusing amount between the microscope objective and the area to be tested is detected when the image frame field of view of the microscope objective covers the area to be tested.
[0091] The microscopic imaging module includes a microscope objective for acquiring images of the area to be measured; a first spectral confocal module is positioned in front of the scanning path of the microscopic imaging module; a second spectral confocal module includes the microscope objective; the axial measurement range of the second spectral confocal module is lower than that of the first spectral confocal module, but its axial resolution is higher; the first spectral confocal module is parallel to the microscopic imaging module; and the change in height information is not higher than the height adjustment range of the microscope objective.
[0092] Step 2: Based on the height information and the defocus amount obtained by the processor, before the field of view of the image frame of the microscope objective covers the area to be tested, the first distance between the microscope objective and the area to be tested is adjusted according to the height information, using the first spectral confocal module as a calibration object; and when the field of view of the image frame of the microscope objective covers the area to be tested, the first distance is adjusted according to the defocus amount so that the area to be tested is within the depth of field; wherein, the first spectral confocal module remains stationary.
[0093] Based on the aforementioned configuration, this application incorporates a first spectral confocal module with a large focusing range but low precision, and a second spectral confocal module with a small focusing range but high precision in the static focusing device. During the adjustment of the first distance between the microscope objective and the area to be measured, the processor can utilize the height information provided by the first spectral confocal module and the defocus amount provided by the second spectral confocal module to ensure the focusing range of the focusing device and the focusing precision by using the defocus amount, thus achieving a balance between a large focusing range and high focusing precision.
[0094] Before the field of view of the microscope objective image frame covers the area to be tested, the first spectral confocal module not only detects the height information of the area to be tested in advance, but also adjusts the first distance in advance according to the height information. This shortens the distance that the microscope objective needs to move when focusing when the field of view of the microscope objective image frame covers the area to be tested, effectively reducing the time spent in the focusing process of the microscope objective and improving the focusing efficiency.
[0095] The processor in this application, by determining whether the defocus amount is within the depth of field range of the microscope objective, can not only avoid secondary focusing due to the defocus amount after accurate focusing based on the height information, thus ensuring focusing efficiency, but also calibrate the result of adjusting the first distance based on the height information, thus avoiding the problem of the microscope objective failing to focus accurately due to incorrect height information.
[0096] In the static focusing method provided in this application, a measurement point is set within the field of view of an image frame; before the static focusing device operates, i.e. before step one, the static focusing method further includes the following steps: Step 3: Based on the triangular prism calibration object with a known slope, calibrate the positional relationship of the measurement points between the first and second spectral confocal modules so that the measurement points of the first and second spectral confocal modules are in the same position within the field of view of the same image frame.
[0097] In some embodiments, the specific implementation process of step three is as follows: Figure 8 For detailed explanations of steps S1 to S7 shown, please refer directly to the descriptions of S1 to S7 above; they will not be repeated here.
[0098] For step one, the calculation process for altitude information and defocus amount includes the following: Step a: Based on the first spectral relationship, the processor calculates the focal position corresponding to the peak wavelength in the first spectral confocal module, which is used as height information. Based on the second spectral relationship, the processor calculates the height difference between the focal positions corresponding to the peak wavelength and the target wavelength in the second spectral confocal module, which is used as defocusing amount.
[0099] In some embodiments, after step one, such as Figure 12As shown, the focusing method provided in this application further includes the following steps: Step 4: After receiving the height information, the processor adjusts the first distance according to the height information while moving the microscopic imaging module so that the field of view of the microscope objective image frame covers the area to be measured.
[0100] Step 5: When the field of view of the microscope objective image frame covers the area to be tested, the processor receives the height information and determines the corresponding blur kernel matrix based on the defocus amount.
[0101] Step Six: Deblur the image of the test area acquired by the image sensor based on the blur kernel matrix to improve the image clarity. The blur kernel matrix and the defocus amount correspond one-to-one.
[0102] Based on the aforementioned processing, the microscope objective is focused using the height information detected by the first spectral confocal module, and the image quality of the image generated by the image sensor is compensated using the defocus amount detected by the second spectral confocal module. This improves the clarity of the image of the surface to be detected while ensuring the high efficiency of off-axis autofocus, thus avoiding imaging blurring at high speeds.
[0103] In some embodiments, before the processor determines the corresponding blur kernel matrix based on the defocus amount, the focusing method provided in this application further includes the following steps: Step 7: The processor pre-calculates the corresponding blur kernel matrix under different defocus amounts, and obtains a set of blur kernel matrices.
[0104] Step 8: In the set of blur kernel matrices, obtain the blur kernel matrix corresponding to the current defocus amount based on the defocus amount.
[0105] Furthermore, for a detailed description of the focusing method in this application, please refer directly to the description of the focusing device mentioned above; no further explanation will be provided here.
[0106] This application also provides an electronic device, such as... Figure 13 As shown, it includes a processor 1301, a communication interface 1302, a memory 1303, and a communication bus 1304. The processor 1301, the communication interface 1302, and the memory 1303 communicate with each other through the communication bus 1304. Memory 1303 is used to store computer programs; The processor 1301 is used to execute any of the above-mentioned static focusing methods when executing the program stored in the memory 1303.
[0107] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not indicate that there is only one bus or one type of bus.
[0108] The communication interface is used for communication between the aforementioned electronic devices and other devices.
[0109] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0110] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0111] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements any of the above-described static focusing method steps.
[0112] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform any of the static focusing method steps in the above embodiments.
[0113] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A static focusing device based on spectral confocal, characterized in that, The application relates to a microscope imaging system, comprising: a microscopic imaging module comprising a microscopic objective lens, used for collecting images of a to-be-detected region; a first spectral confocal module arranged on the front side of the scanning path of the microscopic imaging module, used for detecting height information of the to-be-detected region in advance of the microscopic imaging module by a plurality of image frame fields of view of the microscopic objective lens; wherein the first spectral confocal module is parallel to the microscopic imaging module; the change amount of the height information is not higher than the height adjustment range of the microscopic objective lens; a second spectral confocal module comprising the microscopic objective lens, used for detecting the defocus amount between the microscopic objective lens and the to-be-detected region when the image frame field of view of the microscopic objective lens covers the to-be-detected region; wherein the axial measurement range of the second spectral confocal module is lower than that of the first spectral confocal module, but the axial resolution is higher than that of the first spectral confocal module; a processor, used for obtaining the height information and the defocus amount, used for adjusting a first distance between the microscopic objective lens and the to-be-detected region according to the height information before the image frame field of view of the microscopic objective lens covers the to-be-detected region, taking the first spectral confocal module as a calibration object, and adjusting the first distance according to the defocus amount when the image frame field of view of the microscopic objective lens covers the to-be-detected region, so that the to-be-detected region is in the depth of field range; wherein the first spectral confocal module remains static.
2. The apparatus of claim 1, wherein Adjusting the first distance according to the defocus amount comprises: judging whether the defocus amount is in the depth of field range of the microscopic objective lens, if yes, keeping the height of the microscopic objective lens unchanged, if not, continuously adjusting the first distance according to the defocus amount, so that the to-be-detected region is in the depth of field range.
3. The apparatus of claim 1, wherein, The first spectral relationship and the second spectral relationship corresponding to the first spectral confocal module and the second spectral confocal module are stored in the processor; wherein based on the first spectral relationship, the processor calculates the focus position corresponding to the peak wavelength in the first spectral confocal module as the height information; based on the second spectral relationship, the processor calculates the height difference between the focus positions corresponding to the peak wavelength and the target wavelength in the second spectral confocal module as the defocus amount; the spectral relationship represents the corresponding relationship between the wavelength and the focus position; in the coaxial light path of the second spectral confocal module, the light ray of the target wavelength is parallel to the light ray in the imaging light path.
4. The apparatus of claim 1, wherein, After the processor obtains the height information and the defocus amount, and adjusts the first distance between the microscopic objective lens and the to-be-detected region according to the height information before the image frame field of view of the microscopic objective lens covers the to-be-detected region, taking the first spectral confocal module as a calibration object, the processor further comprises: when the image frame field of view of the microscopic objective lens covers the to-be-detected region, determining the blur kernel matrix corresponding to the defocus amount based on a preset third calibration relationship, and performing deblurring processing on the image of the to-be-detected region according to the blur kernel matrix, so as to improve the definition of the image; wherein the third calibration relationship represents the corresponding relationship between the blur kernel matrix and the defocus amount.
5. The apparatus of claim 1, wherein A measuring point is arranged in the field of view of an image frame; before the static focusing device works, the positional relationship between the measuring points of the first spectral confocal module and the second spectral confocal module is calibrated according to a three-prism calibration object with a known slope, so that the measuring points of the first spectral confocal module and the second spectral confocal module are in the same position in the same field of view of an image frame.
6. The apparatus of claim 5, wherein, The process of calibrating the positional relationship between the measuring points of the first spectral confocal module and the second spectral confocal module according to the three-prism calibration object with a known slope comprises: A scanning direction of the static focusing device is arranged along the longitudinal direction, and the height values of the first spectral confocal module and the second spectral confocal module for detecting the slope at the same time are obtained; wherein the longitudinal direction represents a direction along which the height of the slope of the three-prism calibration object does not change; the scanning direction represents the moving direction of the static focusing device relative to the measured object in the detection process of the measured object; the slope of the slope is known; A second distance of the measuring points of the first spectral confocal module and the second spectral confocal module in the transverse direction is calculated according to the difference between the two height values and the slope of the slope; wherein the transverse direction represents a direction perpendicular to the longitudinal direction in the horizontal plane; The position of the measuring point in the first spectral confocal module or the second spectral confocal module in the transverse direction is adjusted so that the value of the second distance is zero; A scanning direction of the static focusing device is arranged along the transverse direction, and when the first frame image of the slope in the three-prism calibration object is collected by the microscopic imaging module, the measuring point of the first spectral confocal module on the slope is marked as a marker point, and the height value of the marker point is obtained based on the first spectral confocal module; The static focusing device is caused to scan the slope along the scanning direction until the image frame field of view of the microscopic imaging module covers the marker point, and the height value of the measuring point in the current image frame field of view of the second spectral confocal module is obtained; wherein the height of the dispersive objective lens and the microscopic objective lens remains unchanged during the scanning process; The difference between the height value of the marker point and the height value of the measuring point in the current image frame field of view is calculated, and a third distance between the marker point and the measuring point in the transverse direction is calculated in combination with the slope of the slope; The position of the measuring point in the first spectral confocal module or the second spectral confocal module in the transverse direction is adjusted so that the value of the third distance is zero.
7. A static focusing method, characterized by, The static focusing method is applied to the static focusing device of any one of claims 1-6, and the static focusing method comprises: The height information of the to-be-detected region is detected by the first spectral confocal module in advance compared with the image frame field of view of the microscopic objective lens of the microscopic imaging module, and the defocus amount between the microscopic objective lens and the to-be-detected region is detected by the second spectral confocal module when the image frame field of view of the microscopic objective lens covers the to-be-detected region; The microscopic imaging module comprises a microscopic objective lens and is used to collect images of the to-be-detected region; the first spectral confocal module is arranged on the front side of the scanning path of the microscopic imaging module; the second spectral confocal module comprises the microscopic objective lens; the axial measurement range of the second spectral confocal module is lower than that of the first spectral confocal module, but the axial resolution is higher than that of the first spectral confocal module; the first spectral confocal module is parallel to the microscopic imaging module; and the change amount of the height information is not higher than the height adjustment range of the microscopic objective lens. The first distance between the microscopic objective and the region to be measured is adjusted according to the height information before the image frame field of view of the microscopic objective covers the region to be measured, and the first distance is adjusted according to the defocus amount when the image frame field of view of the microscopic objective covers the region to be measured, so that the region to be measured is within the depth of field range; wherein the first spectral confocal module remains static.
8. The static focusing method according to claim 7, characterized in that, One measurement point is arranged in one image frame field of view; before the static focusing device works, the static focusing method further comprises: The position relationship of the measurement point between the first spectral confocal module and the second spectral confocal module is calibrated according to the three-prism calibration object with known slope, so that the measurement point positions of the first spectral confocal module and the second spectral confocal module are the same in the same image frame field of view.
9. An electronic device, comprising: The processor, the communication interface, the memory and the communication bus complete mutual communication through the communication bus; The memory is used for storing the computer program; The processor is used for executing the program stored on the memory, and realizes the static focusing method in any one of claims 7 or 8.
10. A computer-readable storage medium, characterized in that, The computer program is stored in the computer readable storage medium, and the computer program is executed by the processor to realize the static focusing method in any one of claims 7 or 8.
Citation Information
Patent Citations
Focusing distance out-of-range pre-adjusting device and method and automatic focusing system and method
CN120370528A