Optical path and light source cooperative self-calibration method, device and storage medium
By acquiring bright-field images of standard targets in a digital pathology scanning system, calculating similarity values using the SSIM evaluation function, and simultaneously adjusting the optical path and light source, the problem of low calibration efficiency for optical path perpendicularity and light source uniformity is solved, achieving efficient collaborative calibration and improving the imaging quality and stability of the system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN SHENGQIANG TECH
- Filing Date
- 2026-04-21
- Publication Date
- 2026-07-03
Smart Images

Figure CN122063049B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of digital pathology scanning calibration technology, and in particular to a method, device and storage medium for collaborative self-calibration of optical path and light source. Background Technology
[0002] The imaging quality of a digital pathology scanning system directly determines the accuracy of pathological diagnosis and medical research, and optical path perpendicularity and light source uniformity are core parameters affecting imaging quality. Currently, calibration methods mainly include manual calibration and semi-automatic calibration: manual calibration relies on professionals visually observing test cards and manually adjusting the optical path and light source components, which is time-consuming, labor-intensive, and prone to human error. Semi-automatic calibration uses a single evaluation index to independently calibrate the optical path and light source, requiring multiple iterations to reconstruct the spectrum, resulting in low efficiency. Neither of these calibration methods can meet the real-time calibration requirements of digital pathology scanning systems for optical path perpendicularity and light source uniformity.
[0003] The above content is only used to help understand the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention
[0004] The main objective of this application is to provide a method, device, and storage medium for collaborative self-calibration of optical path and light source, aiming to solve the technical problem of low calibration efficiency of optical path perpendicularity and light source uniformity in digital pathology scanning systems.
[0005] To achieve the above objectives, embodiments of this application provide a method for coordinated self-calibration of optical path and light source, the method comprising:
[0006] Bright-field images of multiple preset locations on a standard target are acquired, and the similarity value between each bright-field image and the reference image is calculated using the SSIM evaluation function.
[0007] Based on the similarity value and the corresponding image features of the bright field image, determine the optical path perpendicularity deviation and the light source uniformity deviation;
[0008] Based on the optical path perpendicularity deviation and the light source uniformity deviation, adjust the optical path adjustment mechanism and the light source adjustment mechanism until the optical axis is perpendicular to the standard target plane and the brightness distribution is uniform.
[0009] In one embodiment, the step of acquiring bright-field images of multiple preset locations on a standard target includes:
[0010] Control the camera to move so that the camera's scanning field of view is aligned with multiple preset positions of the standard target, including the center area, the upper left area, the upper right area, and the lower right area;
[0011] When each region is located at the center of the scanning field of view, the camera is controlled to acquire the corresponding bright field image.
[0012] In one embodiment, the step of calculating the similarity value between each brightfield image and the reference image using the SSIM evaluation function includes:
[0013] The bright-field image corresponding to the central region of the standard target is used as the reference image, and the bright-field images at other preset positions are used as images to be evaluated.
[0014] The image to be evaluated and the reference image are converted to grayscale.
[0015] The SSIM evaluation function is used to calculate the similarity value between each of the images to be evaluated after grayscale processing and the reference image.
[0016] In one embodiment, the step of determining the optical path perpendicularity deviation and the light source uniformity deviation based on the similarity value and the corresponding image features of the bright field image includes:
[0017] The similarity values of each image to be evaluated and the reference image are compared with a preset threshold.
[0018] When any of the similarity values is lower than the preset threshold, the image features corresponding to the image to be evaluated are extracted, and the image features include edge distortion parameters and brightness distribution parameters.
[0019] If the edge distortion parameter exceeds the first threshold, a spatial plane is fitted based on the spatial offset of the feature points in the image to be evaluated, and the optical path perpendicularity deviation is calculated based on the fitted spatial plane. The optical path perpendicularity deviation includes the offset angle of the optical path perpendicularity.
[0020] If the brightness distribution parameter exceeds the second threshold, the light source uniformity deviation is calculated based on the grayscale histograms of all the bright field images.
[0021] In one embodiment, the step of fitting a spatial plane based on the spatial offset of feature points in the image to be evaluated, and calculating the optical path perpendicularity deviation based on the fitted spatial plane, wherein the optical path perpendicularity deviation includes the offset angle of the optical path perpendicularity, includes:
[0022] Frequency domain analysis is performed on the image to be evaluated to extract the spatial coordinate information of feature points in the image to be evaluated;
[0023] Using the reference image as a reference, the spatial offset of the feature points in each of the images to be evaluated relative to the reference image is calculated, thereby constructing a feature point set based on the spatial coordinate information and the corresponding spatial offset;
[0024] A spatial fitting algorithm is used to fit the feature point set to a spatial plane to obtain the tilt coefficient of the fitted spatial plane.
[0025] The offset angle of the optical path perpendicularity is calculated based on the tilt coefficient.
[0026] In one embodiment, the step of calculating the light source uniformity deviation based on the gray-level histograms of all the bright-field images includes:
[0027] Each of the bright field images is converted to grayscale to generate a grayscale histogram corresponding to the bright field image;
[0028] Extract the mean gray level of the corresponding bright field image from each of the gray level histograms, and determine the maximum and minimum mean gray level.
[0029] The ratio of the difference between the maximum and minimum grayscale average values to the maximum grayscale average value is determined as the uniformity deviation of the light source.
[0030] In one embodiment, the step of adjusting the optical path adjustment mechanism and the light source adjustment mechanism according to the optical path perpendicularity deviation and the light source uniformity deviation until the optical axis is perpendicular to the standard target plane and the brightness distribution is uniform includes:
[0031] Compare the quantized values of the optical path perpendicularity deviation and the light source uniformity deviation;
[0032] If the optical path perpendicularity deviation is greater than the light source uniformity deviation, the optical path adjustment mechanism is first driven according to the optical path perpendicularity deviation, and then the light source adjustment mechanism is adjusted according to the light source uniformity deviation.
[0033] If the uniformity deviation of the light source is greater than the perpendicularity deviation of the optical path, then the light source adjustment mechanism is first adjusted according to the uniformity deviation of the light source, and then the optical path adjustment mechanism is driven according to the perpendicularity deviation of the optical path.
[0034] After each adjustment operation of any adjustment mechanism is completed, the steps of acquiring bright-field images of multiple preset positions on the standard target and calculating the similarity value between each bright-field image and the reference image are repeated until the optical axis is perpendicular to the plane of the standard target and the brightness distribution is uniform.
[0035] In one embodiment, after the step of adjusting the optical path adjustment mechanism and the light source adjustment mechanism according to the optical path perpendicularity deviation and the light source uniformity deviation until the optical axis is perpendicular to the standard target plane and the brightness distribution is uniform, the optical path and light source collaborative self-calibration method further includes:
[0036] After the calibration operation is completed, bright-field images of multiple preset positions on the standard target are acquired again, and the similarity values between each calibrated bright-field image and the reference image are calculated to determine the optical path perpendicularity deviation and light source uniformity deviation after calibration.
[0037] Verify whether the optical path perpendicularity deviation and the light source uniformity deviation after calibration reach the preset calibration reference threshold;
[0038] If all of them reach the preset calibration benchmark threshold, the calibration is deemed successful, and the calibration parameters of the optical path adjustment mechanism and the light source adjustment mechanism corresponding to the current calibration operation are stored.
[0039] If any deviation does not reach the preset calibration reference threshold, then return to the step of adjusting the optical path adjustment mechanism and the light source adjustment mechanism according to the optical path perpendicularity deviation and the light source uniformity deviation.
[0040] This application embodiment also provides an optical path and light source collaborative self-calibration device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. The computer program is configured to implement the steps of the optical path and light source collaborative self-calibration method as described above.
[0041] This application embodiment also provides a storage medium, which is a computer-readable storage medium, and stores a computer program thereon. When the computer program is executed by a processor, it implements the steps of the optical path and light source collaborative self-calibration method described above.
[0042] One or more technical solutions proposed in this application have at least the following technical effects:
[0043] This application acquires bright-field images of multiple preset positions on a standard target and uses the SSIM evaluation function to calculate the similarity value between each bright-field image and a reference image, thereby unifying optical path perpendicularity and light source uniformity into the same quantitative evaluation system. Based on the similarity value and the image characteristics of the corresponding bright-field image, the optical path perpendicularity deviation and light source uniformity deviation are determined simultaneously, avoiding the parameter mismatch problem caused by independent calibration using different evaluation indicators. Furthermore, based on the determined optical path perpendicularity deviation and light source uniformity deviation, the optical path adjustment mechanism and the light source adjustment mechanism are driven synchronously until the optical axis is perpendicular to the plane of the standard target and the brightness distribution is uniform. This achieves coordinated calibration of the optical path and the light source, avoiding the asynchrony problem caused by separate adjustment, and eliminating the need for multiple rounds of iterative spectrum reconstruction, significantly improving the calibration efficiency of the digital pathology scanning system. Attached Figure Description
[0044] Figure 1This is a flowchart illustrating an embodiment of the optical path and light source collaborative self-calibration method of this application.
[0045] Figure 2 A simplified flowchart illustrating the first embodiment of the optical path and light source collaborative self-calibration method of this application;
[0046] Figure 3 This is a schematic diagram of the structure of the optical path and light source collaborative self-calibration device in the hardware operating environment involved in the optical path and light source collaborative self-calibration method in the embodiments of this application.
[0047] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0048] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0049] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0050] The imaging quality of a digital pathology scanning system directly determines the accuracy of pathological diagnosis and medical research, and optical path perpendicularity and light source uniformity are core parameters affecting imaging quality. In high-resolution scanning scenarios, both must meet industry requirements of ≤5% brightness difference across the entire field of view and ≤±0.01° optical path perpendicularity deviation. Currently, calibration methods mainly include manual calibration and semi-automatic calibration: manual calibration relies on professionals using the USAF 1951 resolution test chart and standard color chart to visually observe and manually adjust the optical path and light source components, which is time-consuming, labor-intensive, and prone to human error. Semi-automatic calibration uses single evaluation indicators such as MSE and PSNR to independently calibrate the optical path and light source, requiring multiple iterations to reconstruct the spectrum, resulting in low efficiency. The aforementioned technical solutions have significant limitations: low calibration efficiency, time-consuming manual calibration, and lengthy semi-automatic calibration iteration processes, failing to meet real-time calibration requirements; asynchronous calibration, employing different evaluation indicators and lacking a unified quantitative system, easily leading to cumulative biases and image artifacts; limited calibration accuracy, with a single indicator unable to match human visual perception of image structure, easily getting trapped in local optima; and complex operation, requiring professional personnel, placing high demands on hardware acquisition, hindering widespread equipment adoption. Therefore, none of the above calibration methods can meet the real-time calibration requirements of digital pathology scanning systems for optical path perpendicularity and light source uniformity.
[0051] In view of the above problems, this application proposes a method for collaborative self-calibration of optical path and light source. This method involves acquiring bright-field images at multiple preset positions on a standard target and calculating the similarity value between each bright-field image and a reference image using the SSIM evaluation function. Based on the similarity value and the corresponding image features of the bright-field image, the optical path perpendicularity deviation and the light source uniformity deviation are determined. Based on the optical path perpendicularity deviation and the light source uniformity deviation, the optical path adjustment mechanism and the light source adjustment mechanism are adjusted until the optical axis is perpendicular to the plane of the standard target and the brightness distribution is uniform.
[0052] This application provides a solution that acquires bright-field images of multiple preset positions on a standard target and uses the SSIM evaluation function to calculate the similarity value between each bright-field image and a reference image, thereby unifying optical path perpendicularity and light source uniformity into the same quantitative evaluation system. Based on the similarity value and the image characteristics of the corresponding bright-field images, the optical path perpendicularity deviation and light source uniformity deviation are simultaneously determined, avoiding parameter mismatch problems caused by independent calibration using different evaluation indicators. Furthermore, based on the determined optical path perpendicularity deviation and light source uniformity deviation, the optical path adjustment mechanism and the light source adjustment mechanism are synchronously driven until the optical axis is perpendicular to the plane of the standard target and the brightness distribution is uniform. This achieves coordinated calibration of the optical path and the light source, avoiding the asynchrony problem caused by separate adjustment, and eliminating the need for multiple rounds of iterative spectrum reconstruction, significantly improving the calibration efficiency of the digital pathology scanning system.
[0053] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a computer, an embedded control system, or an electronic device or an optical path and light source collaborative self-calibration device capable of the above functions. The following description uses a digital pathology scanning system as an example to illustrate this embodiment and the subsequent embodiments.
[0054] The optical path and light source coordinated self-calibration method proposed in the first embodiment of this application can be found in [reference needed]. Figure 1 The method includes steps S10 to S30:
[0055] Step S10: Obtain bright-field images of multiple preset positions on a standard target, and use the SSIM evaluation function to calculate the similarity value between each bright-field image and the reference image.
[0056] It should be noted that a standard target refers to a reference object with known pattern or resolution characteristics, used to calibrate the imaging quality of the optical system. In this embodiment, the USAF 1951 resolution test chart is used as the standard target, which is placed at the pathology slide scanning station, ensuring that the target plane is completely aligned with the scanning platform. A bright-field image refers to a transmitted or reflected bright-field image acquired under uniform illumination conditions, clearly reflecting the edges, details, and grayscale distribution of the target. The SSIM evaluation function, or structural similarity index function, is a full-reference image quality evaluation method that measures the similarity between two images in three dimensions: brightness, contrast, and structure. Its value ranges from -1 to 1, with values closer to 1 indicating greater similarity. The reference image is a baseline image selected from multiple bright-field images acquired on the standard target. Typically, an image of the target's central region is chosen as the reference for comparison calculations with images from other locations.
[0057] As one possible implementation, step S10 includes steps S110 to S120:
[0058] Step S110: Control the camera to move so that the scanning field of view of the camera is aligned with multiple preset positions of the standard target, including the center area, the upper left area, the upper right area and the lower right area.
[0059] Step S120: When each region is located at the center of the scanning field of view, control the camera to acquire the corresponding bright field image.
[0060] In this embodiment, a collaborative calibration module is embedded in the digital pathology scanning system (hereinafter referred to as the system). This module integrates an image acquisition unit, an SSIM evaluation unit, a deviation positioning unit, and an execution drive unit, and establishes a communication connection with the system's original optical path adjustment mechanism (electric mirror, objective lens adjustment mount) and light source adjustment mechanism (LED array, light datum adjustment assembly).
[0061] In this embodiment, the image acquisition unit in the collaborative calibration module drives the system's camera to acquire bright-field images of the standard target at four key locations (the target center, upper left, upper right, and lower right regions). Specifically, the system controls the camera's movement, sequentially aligning the camera's scanning field of view with the target's center, upper left, upper right, and lower right regions. When each region is precisely centered within the scanning field of view, the camera is triggered to acquire the corresponding bright-field image. The acquisition parameters are set to standard system scanning parameters, such as a resolution of 1024×768 pixels and an exposure time of 10 milliseconds, ensuring the images are free of significant noise and blur. After acquisition, the four bright-field images are transmitted to the SSIM evaluation unit and simultaneously stored in the system cache for subsequent deviation quantification.
[0062] Further, step S10 includes steps S130 to S150:
[0063] Step S130: Use the bright-field image corresponding to the central region of the standard target as the reference image, and use the bright-field images at other preset positions as images to be evaluated.
[0064] Step S140: Perform grayscale processing on the image to be evaluated and the reference image.
[0065] Step S150: Using the SSIM evaluation function, calculate the similarity value between each of the grayscale images to be evaluated and the reference image.
[0066] In this embodiment, when calculating the similarity value, a unified deviation evaluation system is constructed using the SSIM evaluation function to simultaneously quantify the optical path perpendicularity deviation and the light source uniformity deviation. This embodiment uses the bright-field image of the central region of a standard target as the reference image, and the other three bright-field images as the images to be evaluated. Since the original images captured by the camera are color images, and the SSIM evaluation function is usually calculated based on the luminance component, and color information contributes little to the discrimination of structural similarity, each image to be evaluated and the reference image are first converted to grayscale. For example, a weighted average method (grayscale value = 0.299×R + 0.587×G + 0.114×B) is used to convert the RGB three channels into a single-channel grayscale image. Subsequently, the SSIM evaluation function is used to calculate the SSIM value between each image to be evaluated and the reference image. The SSIM value calculation formula is:
[0067]
[0068] in, , These are the grayscale mean values of the reference image and the image to be evaluated, respectively. , These are the grayscale standard deviations of the reference image and the image to be evaluated, respectively. The covariance between the reference image and the image to be evaluated. , It is a constant used to avoid the denominator being 0 and to improve computational stability.
[0069] As an example, if the exposure time under the system's normal scanning parameters is adjusted to 8 milliseconds or 12 milliseconds, a bright field image that meets the requirements can also be acquired, but it is necessary to ensure that the same acquisition parameters are used for all preset positions to maintain consistency.
[0070] This embodiment can complete subsequent deviation quantification by acquiring four images at key locations, eliminating the need for additional image acquisition and iteration. Therefore, this embodiment significantly reduces hardware acquisition pressure, minimizes fatigue wear on the camera and light source, and improves calibration efficiency. By introducing the SSIM evaluation function, this embodiment establishes a common evaluation benchmark for the subsequent unified quantification of optical path perpendicularity deviation and light source uniformity deviation, avoiding the asynchronous calibration, increased structural complexity, and increased cost caused by using different indicators to independently calibrate the optical path and light source in traditional methods.
[0071] Step S20: Determine the optical path perpendicularity deviation and the light source uniformity deviation based on the similarity value and the corresponding image features of the bright field image.
[0072] It should be noted that optical path perpendicularity deviation refers to the degree of deviation between the optical axis and the standard target plane (i.e., the pathological slide plane). Specifically, it manifests as the tilt angle of the optical axis relative to the ideal vertical direction. This deviation can lead to edge distortion, local defocusing, or blurred details in the image. Light source uniformity deviation refers to the unevenness of brightness distribution across the entire field of view. It is usually caused by abnormal brightness in individual light-emitting units within an LED array or by the misalignment of the light-diffusing sheet. Specifically, it manifests as grayscale differences in different areas of the image. Image features include visual attributes such as edge sharpness, detail retention, and grayscale histogram distribution, which can be used to distinguish the types of deviations.
[0073] As one possible implementation, step S20 includes steps S210 to S240:
[0074] Step S210: Compare the similarity values of each of the images to be evaluated and the reference images with a preset threshold.
[0075] Step S220: When any of the similarity values is lower than the preset threshold, extract the image features corresponding to the image to be evaluated. The image features include edge distortion parameters and brightness distribution parameters.
[0076] Step S230: If the edge distortion parameter exceeds the first threshold, then fit a spatial plane based on the spatial offset of the feature points in the image to be evaluated, and calculate the optical path perpendicularity deviation based on the fitted spatial plane. The optical path perpendicularity deviation includes the offset angle of the optical path perpendicularity.
[0077] Step S240: If the brightness distribution parameter exceeds the second threshold, the light source uniformity deviation is calculated based on the grayscale histograms of all the bright field images.
[0078] In this embodiment, the similarity values of each image to be evaluated and the reference image are compared with a preset threshold (e.g., 0.95). When any similarity value (SSIM value) is lower than the preset threshold, the image features of the corresponding image to be evaluated are further extracted, and the deviation type is determined based on the image features: if the image mainly shows edge distortion or blurred details, and the brightness difference between different regions is not obvious, it is determined to be a light path perpendicularity deviation; if the image mainly shows significant brightness differences between different regions, while the edges and details remain relatively clear, it is determined to be a light source uniformity deviation; if both phenomena exist simultaneously, they are simultaneously marked as double deviations. The edge distortion parameter is used to characterize the degree of blurring or geometric deformation of the edges in the image, and the brightness distribution parameter is used to characterize the degree of grayscale difference between different regions of the image.
[0079] Specifically, image features include edge distortion parameters and brightness distribution parameters. If the edge distortion parameter exceeds a first threshold, the RANSAC spatial fitting algorithm is used to quantize the optical path perpendicularity offset angle based on the spatial offset of feature points in the image to be evaluated, outputting the optical path perpendicularity deviation. The optical path perpendicularity deviation includes the optical path perpendicularity offset angle. If the brightness distribution parameter exceeds a second threshold, the grayscale mean of each region is calculated based on the grayscale histograms of all brightfield images, and the percentage of the maximum grayscale difference across the entire field of view is calculated, outputting the light source uniformity deviation. If both parameters exceed their respective thresholds, dual deviations are simultaneously marked, and the values of both deviations are quantized in the manner described above. Finally, a deviation quantization report containing the quantization results of both deviations is generated and transmitted to the execution drive unit.
[0080] As an example, when the SSIM value is 0.92 and the image in the upper left corner is significantly darker but the edges are clear, it can be determined as a deviation in light source uniformity; if the SSIM value is 0.88 and the images in all four corners show varying degrees of ghosting or blurring, it can be determined as a deviation in light path perpendicularity.
[0081] After determining the type of deviation, the specific values of the two deviations are quantified using the deviation positioning unit. For the optical path perpendicularity deviation, the RANSAC spatial fitting algorithm is used to locate the optical path offset nodes (such as mirror angle offset and objective lens height deviation) in the frequency domain, and the offset angle of the optical path perpendicularity is quantified. Specifically, step S230 includes steps S2310~S2340:
[0082] Step S2310: Perform frequency domain analysis on the image to be evaluated to extract the spatial coordinate information of feature points in the image to be evaluated.
[0083] Step S2320: Using the reference image as a reference, calculate the spatial offset of the feature points in each of the images to be evaluated relative to the reference image, thereby constructing a feature point set based on the spatial coordinate information and the corresponding spatial offset.
[0084] Step S2330: Use a spatial fitting algorithm to fit the feature point set to a spatial plane to obtain the tilt coefficient of the fitted spatial plane.
[0085] Step S2340: Calculate the offset angle of the optical path perpendicularity based on the tilt coefficient.
[0086] In this embodiment, frequency domain analysis is performed on the image to be evaluated to extract the spatial coordinate information of edge feature points or structural feature points in the image. Using the brightfield image of the central region (i.e., the reference image) as a reference, the spatial offset of feature points in the upper left, upper right, and lower right regions of the image to be evaluated relative to the reference image is calculated using the phase correlation method or optical flow method, forming a dataset (i.e., feature point set) containing N feature points. ,in Indicates the first Estimated axial offset of each feature point on the focal plane Its planar coordinates.
[0087] Next, the RANSAC spatial fitting algorithm is used to perform spatial plane fitting on this feature point set. It is assumed that the optical path perpendicularity deviation exhibits a linear trend of the defocus amount of each point in the image changing with the plane position; that is, ideally, if the optical axis is perfectly perpendicular, all feature points within the entire field of view... It should approach 0 or be uniformly distributed; if there is a deviation in the perpendicularity of the optical path, then It is distributed in a spatially tilted plane.
[0088] The RANSAC algorithm is used to fit the feature point set to the spatial plane, and the target model is: The specific fitting process is as follows: First, random sampling is performed from the feature point set. Randomly selected points ( Used to initialize planar model parameters Next, model assumptions are made, and the plane model parameters are solved using least-squares fitting based on these sampling points. Then, interior point determination is performed, calculating all points... The vertical distance to the hypothetical plane (i.e., the plane represented by the target model). The formula is as follows:
[0089] Interior point distance formula:
[0090] like ( If an interior point threshold is set (e.g., 0.001 mm), it is then determined to be an interior point.
[0091] Continue iterative optimization, repeating the above process of random sampling, parameter solving, and interior point determination. Next, the planar model with the most interior points is selected as the best-fit model. Finally, the model is refined by recalculating the final planar model parameters using the least squares method based on all interior points. Thus, the tilt coefficient of the fitted spatial plane is obtained. .
[0092] Next, based on the tilt coefficient of the fitted spatial plane... Calculate the offset angle of the optical path perpendicularity. Specifically, the plane normal vector of the fitted spatial plane is... The normal vector in the ideal perpendicular case is Then the angle between the optical axis and the ideal perpendicular direction (i.e., the perpendicularity deviation) is: If separate quantification is required... direction and The offset component of the direction, then The final output optical path perpendicularity deviation angle The unit is degrees. The accuracy can reach 0.001°.
[0093] Further, step S240 includes steps S2410 to S2430:
[0094] Step S2410: Perform grayscale processing on each of the bright field images to generate a grayscale histogram corresponding to the bright field image.
[0095] Step S2420: Extract the mean gray level of the corresponding bright field image from each of the gray level histograms, and determine the maximum mean gray level and the minimum mean gray level.
[0096] Step S2430: The ratio of the difference between the maximum grayscale mean and the minimum grayscale mean to the maximum grayscale mean is determined as the light source uniformity deviation.
[0097] In this embodiment, the uniformity deviation of the light source is quantified by analyzing the image grayscale histogram. Specifically, firstly, each brightfield image is converted to grayscale to generate a corresponding grayscale histogram; then, the mean grayscale value of each brightfield image is extracted from each grayscale histogram, and the maximum and minimum mean grayscale values are determined; finally, the difference between the maximum and minimum mean grayscale values is divided by the maximum mean grayscale value to obtain the percentage of brightness difference across the entire field of view, which is the uniformity deviation of the light source. The calculation formula is as follows:
[0098]
[0099] This embodiment simultaneously identifies two types of deviations based on a unified SSIM evaluation system. This avoids the increased structural complexity and cost caused by using different indicators to independently calibrate the optical path and light source in traditional methods. Furthermore, by using image features to assist in the identification, the accuracy of deviation type recognition is improved, providing a reliable quantitative basis for subsequent coordinated adjustment.
[0100] Step S30: Adjust the optical path adjustment mechanism and the light source adjustment mechanism according to the optical path perpendicularity deviation and the light source uniformity deviation until the optical axis is perpendicular to the standard target plane and the brightness distribution is uniform.
[0101] It should be noted that the optical path adjustment mechanism refers to the optical element driving device in the scanning system used to adjust the direction of the optical path, including a motorized mirror and an objective lens adjustment mount. The motorized mirror is used to change the angle of the optical axis, and the objective lens adjustment mount is used to fine-tune the height and tilt of the objective lens relative to the target plane. The light source adjustment mechanism refers to the device used to control the uniformity of the illumination system output, including an LED array and a beam equalizer adjustment assembly. Each light-emitting unit in the LED array can independently adjust its brightness, and the beam equalizer adjustment assembly is used to change the position of the beam equalizer to optimize the beam shaping effect. The optical axis being perpendicular to the standard target plane refers to the ideal state where the optical axis of the optical path coincides with the normal direction of the target plane; at this point, the focusing consistency is optimal across the entire field of view. Uniform brightness distribution means that the grayscale difference in each area across the entire field of view is controlled within a preset range.
[0102] As one possible implementation, step S30 includes steps S310 to S340:
[0103] Step S310: Compare the quantized values of the optical path perpendicularity deviation and the light source uniformity deviation.
[0104] Step S320: If the optical path perpendicularity deviation is greater than the light source uniformity deviation, the optical path adjustment mechanism is first driven according to the optical path perpendicularity deviation, and then the light source adjustment mechanism is adjusted according to the light source uniformity deviation.
[0105] Step S330: If the uniformity deviation of the light source is greater than the perpendicularity deviation of the optical path, the light source adjustment mechanism is first adjusted according to the uniformity deviation of the light source, and then the optical path adjustment mechanism is driven according to the perpendicularity deviation of the optical path.
[0106] Step S340: After each adjustment operation of any adjustment mechanism is completed, the step of acquiring bright-field images of multiple preset positions on the standard target and calculating the similarity value between each bright-field image and the reference image is executed again until the optical axis is perpendicular to the plane of the standard target and the brightness distribution is uniform.
[0107] In this embodiment, the execution drive unit synchronously drives the optical path adjustment mechanism and the light source adjustment mechanism according to the deviation quantification report quantified in step S20. The specific adjustment process is as follows: First, the magnitude of the optical path perpendicularity deviation and the light source uniformity deviation exceeding their respective calibration reference thresholds are compared, and the deviation with the larger magnitude is adjusted first. For example, if the optical path perpendicularity deviation is 0.03° (threshold ±0.01°, exceeding 0.02°), and the light source uniformity deviation is 6% (threshold 5%, exceeding 1%), then the optical path is adjusted first according to the quantified value of the optical path perpendicularity deviation. That is, the motorized mirror is first driven to rotate the corresponding angle (the adjustment accuracy can reach 0.001°), and the height of the objective lens adjustment mount is adjusted at the same time to gradually restore the optical axis to the direction perpendicular to the target plane (i.e., the pathological slide plane). During the adjustment process, the bright field image of the central area of the standard target is acquired in real time to monitor the changing trend of the SSIM value.
[0108] After completing the optical path adjustment, the brightness of the corresponding area of the LED array is fine-tuned (adjustment accuracy ±1%) based on the quantified brightness difference percentage in the light source uniformity deviation. Simultaneously, the position of the light-diffusing plate is adjusted to make the brightness across the entire field of view more uniform. Bright-field images of multiple preset positions on the standard target are simultaneously acquired to ensure that the brightness difference gradually decreases to within its corresponding calibration reference threshold (e.g., to within 5%). Conversely, if the light source uniformity deviation is greater than the optical path perpendicularity deviation, the light source adjustment mechanism is adjusted first based on the light source uniformity deviation. Once the light source uniformity meets the standard, the optical path adjustment mechanism is then driven based on the optical path perpendicularity deviation. The specific adjustment process corresponds to the aforementioned steps of prioritizing optical path adjustment.
[0109] After each adjustment is completed, bright-field images of the four preset positions of the standard target are reacquired, and the SSIM values of each bright-field image and the reference image, as well as various deviations, are recalculated to ensure that the adjustment of the optical path and the light source are matched to each other, and to avoid new deviations caused by unilateral over-adjustment.
[0110] As an example, if the optical path perpendicularity deviation is 0.03° and the brightness difference is only 3%, then the motorized reflector should be rotated by 0.03° first, and the LED brightness should be fine-tuned after the SSIM value rises back to above 0.95. Conversely, if the brightness difference is 8% and the optical path deviation is only 0.005°, then the LED units in the darker areas of the LED array should be adjusted first, with each adjustment not exceeding ±2%, and the changes in the grayscale histogram should be observed.
[0111] As another feasible implementation, steps S40 to S70 are included after step S30:
[0112] Step S40: After the calibration operation is completed, bright-field images of multiple preset positions on the standard target are acquired again, and the similarity values between each calibrated bright-field image and the reference image are calculated to determine the optical path perpendicularity deviation and light source uniformity deviation after calibration.
[0113] Step S50: Verify whether the perpendicularity deviation of the calibrated optical path and the uniformity deviation of the light source have reached the preset calibration reference threshold.
[0114] Step S60: If all the preset calibration reference thresholds are reached, the calibration is deemed successful, and the calibration parameters of the optical path adjustment mechanism and the light source adjustment mechanism corresponding to the current calibration operation are stored.
[0115] Step S70: If any deviation does not reach the preset calibration reference threshold, then return to the step of adjusting the optical path adjustment mechanism and the light source adjustment mechanism according to the optical path perpendicularity deviation and the light source uniformity deviation.
[0116] In this embodiment, after the calibration operation is completed, bright-field images of multiple preset positions (center, upper left, upper right, and lower right) on the standard target are acquired again, and the similarity values between each calibrated bright-field image and the calibrated reference image are calculated to determine the calibrated optical path perpendicularity deviation and light source uniformity deviation. Then, it is verified whether these two deviations meet the corresponding preset calibration benchmark thresholds (e.g., SSIM ≥ 0.95, brightness difference ≤ 5%, optical path perpendicularity deviation ≤ ±0.01°). If all indicators meet the standards, the calibration is deemed successful, and the calibration parameters (including mirror angle, objective lens height, brightness values of each LED, and position of the light diffuser) of the optical path adjustment mechanism and light source adjustment mechanism corresponding to this calibration operation are stored in the system memory for recall during the next system startup, thereby shortening subsequent calibration time.
[0117] If any deviation fails to reach the corresponding preset calibration benchmark threshold, the system will return to the previous steps of adjusting the optical path adjustment mechanism and the light source adjustment mechanism according to the optical path perpendicularity deviation and the light source uniformity deviation, performing a second fine-tuning until all indicators meet the requirements. If the second fine-tuning still fails to meet the standards, the system will automatically issue a prompt to troubleshoot hardware faults (such as LED attenuation or reflector wear) to ensure calibration reliability.
[0118] Furthermore, during actual pathological slide scanning, the system automatically initiates a simplified calibration after each preset scanning duration (e.g., 2 hours). This simplified calibration acquires a bright-field image of the central region of the standard target and calculates the SSIM value by comparing it with bright-field images of other regions (upper left, upper right, and lower right) stored during the system's last complete calibration. This assesses the stability of the optical path and light source. If the SSIM value drops significantly (e.g., below a preset threshold, or the drop exceeds a preset range), corresponding fine-tuning is performed to avoid light source attenuation or optical path shift caused by prolonged scanning, ensuring stable image quality. Simultaneously, the system can adapt to different scanning magnifications (e.g., 20x, 40x) and automatically match the corresponding calibration parameters without manual resetting.
[0119] This embodiment achieves coordinated adjustment of the optical path and the light source instead of separate and independent adjustment, thus avoiding the mutual interference problems caused by adjusting the optical path first and then the light source or adjusting the light source first and then the optical path in traditional methods. For example, adjusting the optical path may cause changes in the originally uniform brightness distribution. This embodiment, through real-time monitoring of the SSIM value and the control logic of prioritizing the adjustment of parameters with larger deviations, makes the two adjustment processes match each other, significantly shortening the calibration convergence time and improving the calibration accuracy and system stability.
[0120] This implementation method acquires bright-field images of four key locations on a standard target and calculates the corresponding SSIM values. Only a small number of images are needed to quantify the deviation, reducing hardware acquisition pressure and system overhead. By using an SSIM-based evaluation system and image feature-assisted discrimination, it simultaneously identifies optical path perpendicularity deviation and light source uniformity deviation, avoiding the time-consuming and labor-intensive nature and human error of traditional manual calibration. It also avoids the need for multiple rounds of iterative spectrum reconstruction required for independent calibration with different indicators, thus solving the problems of low calibration efficiency and asynchronous calibration. Through coordinated adjustment of the optical path adjustment mechanism and the light source adjustment mechanism, and by prioritizing the adjustment of parameters with larger deviations, synchronous calibration of the optical path and light source is achieved, avoiding mutual interference caused by separate adjustments. This significantly shortens the calibration convergence time and improves calibration accuracy and system stability.
[0121] For example, to help understand the implementation process of the optical path and light source collaborative self-calibration method in this embodiment, please refer to... Figure 2 , Figure 2 A simplified flowchart of a collaborative self-calibration method for optical path and light source is provided, specifically:
[0122] After the calibration process is initiated, the calibration module is first built and system parameters are initialized, including embedding the collaborative calibration module and setting various calibration benchmark thresholds. Then, standard target images are acquired to obtain basic calibration data, specifically bright-field images of the standard target at four preset positions. Next, dual deviations are quantified based on the SSIM evaluation function, simultaneously determining the optical path perpendicularity deviation and the light source uniformity deviation. Then, the optical path and light source are collaboratively adjusted to achieve synchronous calibration, driving the optical path adjustment mechanism and the light source adjustment mechanism based on the deviation quantification results. After adjustment, the calibration effect is verified and various indicators are calculated to determine if all indicators meet the standards. If all indicators meet the standards, the calibration parameters are stored in the system memory, and dynamic calibration optimization is performed to adapt to the actual scanning scenario. Finally, calibration is completed and continuous dynamic monitoring is conducted. If any indicators fail to meet the standards, it is further determined whether a second fine-tuning has been performed: if no second fine-tuning has been performed, it is performed and the calibration effect is re-verified; if a second fine-tuning has been performed but the standards are still not met, the system issues a prompt to troubleshoot hardware faults and ensure calibration reliability. Through the above closed-loop process, collaborative automatic calibration of the optical path and light source is achieved.
[0123] This application's collaborative self-calibration technology for optical path and light source using the SSIM evaluation function brings the following benefits: First, this technology significantly improves calibration efficiency, eliminating the need for manual operation and multiple iterations. Full-field calibration can be completed with only four images, and the calibration time is only 0.5 seconds with GPU parallel acceleration, reducing the time by more than 80% compared to traditional manual calibration and improving it by more than 5 times compared to semi-automatic calibration, meeting the real-time requirements of high-speed, high-throughput scanning. Second, this technology solves the problem of calibration asynchrony. Using the SSIM evaluation function as a unified quantitative indicator, it synchronously identifies and adjusts deviations in the optical path and light source, avoiding the superposition of deviations caused by separate calibrations. This ensures optimal image quality after calibration, effectively eliminating artifacts caused by image distortion and uneven brightness, and improving the accuracy of pathological slide observation. Secondly, calibration accuracy is significantly improved. The SSIM function can accurately match the human eye's perception of image structure and detail, avoiding the local optima problem caused by traditional single indicators (MSE, PSNR). Combined with the RANSAC spatial fitting algorithm, the optical path perpendicularity deviation can be controlled within ±0.01°, and the light source uniformity meets the industry standard of ≤5% brightness difference across the entire field of view, adapting to high-resolution scanning requirements. Furthermore, this technical solution is easy to operate, with one-click automatic calibration, requiring no professional technicians. Calibration parameters can be stored and reused, and it has a dynamic simple calibration function, extending the calibration cycle and reducing maintenance costs. Finally, it has strong compatibility, adapting to different models and years of use of digital pathology scanning systems without significant hardware modifications, only requiring the embedding of a calibration module and updating the software algorithm. It can also adapt to scanning requirements for different slide types such as HE staining and IHC staining.
[0124] This application provides an optical path and light source collaborative self-calibration device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the optical path and light source collaborative self-calibration method in the above embodiment 1.
[0125] The following is for reference. Figure 3 The diagram illustrates a structural schematic suitable for implementing the optical path and light source collaborative self-calibration device according to the embodiments of this application. The optical path and light source collaborative self-calibration device in the embodiments of this application may include various hardware and software components for implementing the optical path and light source collaborative self-calibration method. Figure 3 The optical path and light source collaborative self-calibration device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0126] like Figure 3 As shown, the optical path and light source collaborative self-calibration device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the optical path and light source collaborative self-calibration device. The processing unit 1001, the ROM 1002, and the RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the optical path and light source collaborative self-calibration device to communicate wirelessly or wiredly with other devices to exchange data. Although the figure shows optical path and light source collaborative self-calibration devices with various systems, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.
[0127] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from read-only memory 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0128] The optical path and light source collaborative self-calibration device provided in this application, employing the optical path and light source collaborative self-calibration method described in the above embodiments, can solve the technical problem of low calibration efficiency for optical path perpendicularity and light source uniformity in digital pathology scanning systems. Compared with the prior art, the beneficial effects of the optical path and light source collaborative self-calibration device provided in this application are the same as those of the optical path and light source collaborative self-calibration method described in the above embodiments, and other technical features of this optical path and light source collaborative self-calibration device are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0129] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0130] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0131] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, which are used to execute the optical path and light source collaborative self-calibration method described in the above embodiments.
[0132] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, radio frequency (RF), etc., or any suitable combination thereof.
[0133] The aforementioned computer-readable storage medium may be included in the optical path and light source co-calibration device; or it may exist independently and not be assembled into the optical path and light source co-calibration device.
[0134] The aforementioned computer-readable storage medium carries one or more programs. When these programs are executed by the optical path and light source collaborative self-calibration device, the optical path and light source collaborative self-calibration device: acquires bright-field images at multiple preset positions on a standard target, and calculates the similarity value between each bright-field image and a reference image using the SSIM evaluation function; determines the optical path perpendicularity deviation and the light source uniformity deviation based on the similarity value and the image features corresponding to the bright-field image; and adjusts the optical path adjustment mechanism and the light source adjustment mechanism based on the optical path perpendicularity deviation and the light source uniformity deviation until the optical axis is perpendicular to the plane of the standard target and the brightness distribution is uniform.
[0135] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0136] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0137] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0138] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described optical path and light source collaborative self-calibration method. This solves the technical problem of low calibration efficiency for optical path perpendicularity and light source uniformity in digital pathology scanning systems. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the optical path and light source collaborative self-calibration method provided in the above embodiments, and will not be elaborated upon here.
[0139] This application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described optical path and light source collaborative self-calibration method.
[0140] The computer program product provided in this application can solve the technical problem of low calibration efficiency of optical path perpendicularity and light source uniformity in digital pathology scanning systems. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as the beneficial effects of the optical path and light source collaborative self-calibration method provided in the above embodiments, and will not be repeated here.
[0141] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent scope of this application.
[0142] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system 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 system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0143] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.
[0144] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method for self-calibration of an optical path in cooperation with a light source, characterized in that, The optical path and light source collaborative self-calibration method includes: Acquire bright-field images of multiple preset locations on a standard target, wherein the preset locations include the center region, the upper left region, the upper right region, and the lower right region; The bright-field image corresponding to the central region of the standard target is used as the reference image, and the bright-field images at other preset positions are used as the images to be evaluated. The image to be evaluated and the reference image are converted to grayscale. The SSIM evaluation function is used to calculate the similarity value between each of the grayscale images to be evaluated and the reference images. The similarity values of each image to be evaluated and the reference image are compared with a preset threshold. When any of the similarity values is lower than the preset threshold, the image features corresponding to the image to be evaluated are extracted, and the image features include edge distortion parameters and brightness distribution parameters. If the edge distortion parameter exceeds the first threshold, a spatial plane is fitted based on the spatial offset of the feature points in the image to be evaluated, and the optical path perpendicularity deviation is calculated based on the fitted spatial plane. The optical path perpendicularity deviation includes the offset angle of the optical path perpendicularity. If the brightness distribution parameter exceeds the second threshold, the light source uniformity deviation is calculated based on the gray-level histograms of all the bright field images. Based on the optical path perpendicularity deviation and the light source uniformity deviation, adjust the optical path adjustment mechanism and the light source adjustment mechanism until the optical axis is perpendicular to the standard target plane and the brightness distribution is uniform.
2. The optical path and light source collaborative self-calibration method as described in claim 1, characterized in that, The steps for acquiring bright-field images at multiple preset locations on a standard target include: Control the camera to move so that the camera's scanning field of view is aligned with multiple preset positions of the standard target; When each region is located at the center of the scanning field of view, the camera is controlled to acquire the corresponding bright field image.
3. The optical path and light source collaborative self-calibration method as described in claim 1, characterized in that, The step of fitting a spatial plane based on the spatial offset of feature points in the image to be evaluated, and calculating the optical path perpendicularity deviation based on the fitted spatial plane, wherein the optical path perpendicularity deviation includes the offset angle of the optical path perpendicularity, includes: Frequency domain analysis is performed on the image to be evaluated to extract the spatial coordinate information of feature points in the image to be evaluated; Using the reference image as a reference, the spatial offset of the feature points in each of the images to be evaluated relative to the reference image is calculated, thereby constructing a feature point set based on the spatial coordinate information and the corresponding spatial offset; A spatial fitting algorithm is used to fit the feature point set to a spatial plane to obtain the tilt coefficient of the fitted spatial plane. The offset angle of the optical path perpendicularity is calculated based on the tilt coefficient.
4. The optical path and light source collaborative self-calibration method as described in claim 1, characterized in that, The step of calculating the light source uniformity deviation based on the gray-level histograms of all the bright-field images includes: Each of the bright field images is converted to grayscale to generate a grayscale histogram corresponding to the bright field image; Extract the mean gray level of the corresponding bright field image from each of the gray level histograms, and determine the maximum and minimum mean gray level. The ratio of the difference between the maximum and minimum grayscale average values to the maximum grayscale average value is determined as the uniformity deviation of the light source.
5. The optical path and light source collaborative self-calibration method as described in claim 1, characterized in that, The step of adjusting the optical path adjustment mechanism and the light source adjustment mechanism according to the optical path perpendicularity deviation and the light source uniformity deviation until the optical axis is perpendicular to the standard target plane and the brightness distribution is uniform includes: Compare the quantized values of the optical path perpendicularity deviation and the light source uniformity deviation; If the optical path perpendicularity deviation is greater than the light source uniformity deviation, the optical path adjustment mechanism is first driven according to the optical path perpendicularity deviation, and then the light source adjustment mechanism is adjusted according to the light source uniformity deviation. If the uniformity deviation of the light source is greater than the perpendicularity deviation of the optical path, then the light source adjustment mechanism is first adjusted according to the uniformity deviation of the light source, and then the optical path adjustment mechanism is driven according to the perpendicularity deviation of the optical path. After each adjustment operation of any adjustment mechanism is completed, the steps of acquiring bright-field images of multiple preset positions on the standard target and calculating the similarity value between each bright-field image and the reference image are repeated until the optical axis is perpendicular to the plane of the standard target and the brightness distribution is uniform.
6. The optical path and light source collaborative self-calibration method as described in claim 1, characterized in that, After the step of adjusting the optical path adjustment mechanism and the light source adjustment mechanism according to the optical path perpendicularity deviation and the light source uniformity deviation until the optical axis is perpendicular to the standard target plane and the brightness distribution is uniform, the optical path and light source collaborative self-calibration method further includes: After the calibration operation is completed, bright-field images of multiple preset positions on the standard target are acquired again, and the similarity values between each calibrated bright-field image and the reference image are calculated to determine the optical path perpendicularity deviation and light source uniformity deviation after calibration. Verify whether the optical path perpendicularity deviation and the light source uniformity deviation after calibration reach the preset calibration reference threshold; If all of them reach the preset calibration benchmark threshold, the calibration is deemed successful, and the calibration parameters of the optical path adjustment mechanism and the light source adjustment mechanism corresponding to the current calibration operation are stored. If any deviation does not reach the preset calibration reference threshold, then return to the step of adjusting the optical path adjustment mechanism and the light source adjustment mechanism according to the optical path perpendicularity deviation and the light source uniformity deviation.
7. A self-calibrating device for coordinated optical path and light source, characterized in that, The optical path and light source collaborative self-calibration device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the optical path and light source collaborative self-calibration method as described in any one of claims 1 to 6.
8. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the optical path and light source collaborative self-calibration method as described in any one of claims 1 to 6.