PCR tube sidewall fluorescence image correction method and system based on self-calibration inversion
Patent Information
- Application Number
- CN202610803797.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-05
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2046-06-05
AI Technical Summary
[0011]本发明为克服现有技术中在PCR管光片荧光显微成像过程中,因外侧介质、管壁及管内介质的折射率差异,光线经两次折射导致管内微滴出现表观压缩、位置偏移及层间不一致等空间失真问题,而现有固定参数模型校正不准、图像增强无法恢复几何关系、折射率匹配工艺条件苛刻,且局部ROI采集缺少完整壁边界导致传统参数估计稳定性差,无法满足无额外标定、裸管空气环境下对液滴成像的几何校正与批量一致性分析需求等问题
本发明所述的基于自校准反演的PCR管侧壁荧光图像校正方法及系统不再依赖固定名义几何参数,而是从图像本身自动反演管轴位置、过渡行位置、有效内半径、锥角、折射率比值以及管轴倾角,从而使校正模型能够适应实际PCR管制造误差、装夹偏差(包括管轴相对于图像垂线的微小倾角)、外侧介质折射率配置(如裸管空气环境与折射率匹配浸没环境)以及拍摄ROI变化,提高了几何校正精度。同时,本发明结合光片荧光检测光路系统中的激发、成像与采集条件进行协同约束,使校正结果更贴近真实光学传播过程。
Smart Images

Figure CN122367825B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of fluorescence image processing, and more specifically to a method and system for correcting fluorescence images of the sidewalls of PCR tubes based on self-calibration inversion. Background Technology
[0002] In PCR tube light-panel fluorescence microscopy, rapid imaging of droplets or reaction units within the PCR tube via the tube sidewall is often required to support droplet identification, localization, counting, and quantitative analysis in digital PCR scenarios. In practical engineering applications, systems often directly acquire the effective region of interest (ROI) inside the PCR tube to improve throughput and simplify mechanical and optical structures. This necessitates that similar droplets exhibit as consistent an apparent size and positional relationship as possible across different lateral positions and heights, facilitating subsequent segmentation, counting, and statistical analysis using standardized parameters. However, when imaging via the PCR tube sidewall, droplets near the outer edge are prone to apparent compression, positional shifts, or inconsistencies between upper and lower layers. This makes it difficult to consistently apply the same set of identification thresholds and geometric criteria to the entire image, becoming a practical problem affecting batch consistency analysis in digital PCR.
[0003] The root cause of the above problem lies in the fact that before the light collected by the camera enters the target inside the tube, it passes through the outer wall interface between the outer medium and the polypropylene tube wall, and then through the inner wall interface between the polypropylene tube wall and the aqueous medium inside the tube. These two refractions jointly contribute to the formation of the imaging geometry. Due to the combined influence of the refractive index differences among the outer medium, polypropylene, and aqueous medium, spatial distortion occurs between the apparent position and the true position of the target in the image. For the cylindrical section, the distortion is mainly manifested as lateral compression; for the conical section, due to the local inner radius changing longitudinally and the interface normal direction continuously changing, in addition to lateral compression, height-related non-uniform distortion and vertical offset also occur.
[0004] The aforementioned distortions directly cause inconsistencies in the apparent size, lateral position, and interlayer relationships of similar droplets at different heights. This not only affects droplet center positioning, segmentation, counting, and quantitative analysis but also reduces the comparability and stability of results across the entire tube. Especially under engineering conditions where refractive index matching is not implemented, bare tube air environment imaging is used, only local ROIs are acquired, and additional calibration steps are lacking, how to automatically recover geometric relationships that more closely approximate the true spatial position from the current imaging image has become a key issue with clear application requirements in PCR tube-slice fluorescence microscopy.
[0005] In existing technologies, one approach establishes a fixed geometric model based on the nominal outer diameter, wall thickness, cone angle, and refractive index of the PCR tube. However, variations in manufacturing tolerances, clamping posture (including the slight tilt angle of the tube axis relative to the vertical line of the image), refractive index configuration of the outer medium (such as the difference between the bare tube air environment and the refractive index matching immersion environment), ROI cropping position, and magnification can lead to inconsistencies between the nominal model and the actual imaging state.
[0006] Therefore, fixed-parameter models are prone to problems such as undercorrection, local overcorrection, or inconsistent correction in different height regions in engineering applications, making it difficult to adapt to the real geometric state corresponding to the current image.
[0007] Another type of approach focuses more on image enhancement processing such as stripe suppression, illumination correction, and background subtraction. While this type of approach can improve the image's appearance and local contrast, it cannot directly restore the geometric relationship between the real spatial location and pixel coordinates.
[0008] Existing technologies achieve optical transparency of emulsions by precisely matching the refractive indices of the aqueous and oil phase media, thereby avoiding the need for refractive correction at the inner wall interface. However, this approach places high demands on the emulsion formulation, oil phase purity, and refractive index matching process. It is difficult to directly adapt to implementation scenarios that do not implement refractive index matching processes, use bare tube air environment imaging, or have a high demand for process simplification. Furthermore, it fails to infer the actual geometric parameters corresponding to the current clamping posture, outer medium configuration, and manufacturing tolerances from the image itself.
[0009] In addition, engineering systems often only collect ROI inside PCR tubes, and the images lack complete left and right wall boundaries, which reduces the stability of traditional parameter estimation methods that rely on outer contours or edge fitting; however, ROI images still contain information that can be used to invert geometric parameters, such as mirror symmetry, brightness peaks near the axis, and longitudinal statistical changes.
[0010] Therefore, it is necessary to propose a sidewall image correction method for PCR tube-slide fluorescence microscopy based on self-calibrated geometric optics inversion. Without the need for additional calibration plates, this method automatically obtains geometric parameters that better match the current imaging state by combining image statistical information with the known optical conditions of the tube-slide fluorescence detection optical path system, and completes zonal correction and post-processing. Summary of the Invention
[0011] This invention overcomes the spatial distortion problems in existing PCR tube sidewall fluorescence microscopy imaging processes caused by the refractive index differences between the outer medium, tube wall, and inner medium, resulting in double refraction of light and apparent compression, positional shift, and interlayer inconsistency of droplets within the tube. Furthermore, existing fixed-parameter models suffer from inaccurate calibration, image enhancement cannot restore geometric relationships, refractive index matching processes are demanding, and the lack of intact wall boundaries in local ROI acquisition leads to poor stability of traditional parameter estimation. These issues prevent the invention from meeting the requirements for geometric correction and batch consistency analysis of droplet imaging in bare tubes under air conditions without additional calibration. Therefore, this invention proposes a self-calibrated inversion-based method and system for correcting PCR tube sidewall fluorescence images. The invention achieves these technical problems through the following technical solution: Option 1: This invention proposes a method for correcting PCR tube sidewall fluorescence images based on self-calibration inversion, the method comprising the following steps: Step 1: Obtain the fluorescence image of the PCR tube sidewall and preprocess the fluorescence image of the PCR tube sidewall to obtain the image to be corrected; Step 2: Perform initial geometric detection on the image to be corrected in Step 1 to determine the tube axis position, the prior tilt angle of the tube axis relative to the perpendicular line of the image, and the prior transition position between the cylindrical and conical segments, and obtain the initial values of relevant parameters. Step 3: Construct the parameter vector to be inverted. Perform a phased self-calibration search based on the initial values of the relevant parameters obtained in Step 2. Construct an inverse mapping table for the candidate parameters based on the refraction models of the cylindrical and conical segments of the PCR tube, respectively. Resample the image to be calibrated to obtain candidate calibration images. Evaluate the candidate calibration images and determine the self-calibration geometric parameters corresponding to the current imaging state. Step 4: Establish the final remapping table based on the self-calibrated geometric parameters. For the cylindrical segment, establish a monotonic mapping between the apparent coordinates and the true coordinates based on the strict non-paraxial refraction relationship considering the two refractions from the outer medium to the polypropylene pipe wall and from the polypropylene pipe wall to the inner medium. For the conical segment, establish a lateral correction and vertical displacement compensation mapping based on the vector refraction relationship of the inclined interface on the basis of local radius changes. Combine the pipe axis inclination angle to complete the partitioned geometric correction and obtain the geometric correction image. Step 5: Perform restoration processing on the geometrically corrected image and output the final corrected image and the corresponding self-calibration geometric parameters.
[0012] Furthermore, in a preferred embodiment, the method for preprocessing the fluorescence image of the PCR tube sidewall in step 1 is as follows: I g =Gray(I in ), I f =float32(I g ) When max(H, W) > Lmax At that time, according to the scaling factor scale=L max / max(H, W) downsamples the image to obtain I s =Resize(I f (scale).
[0013] Furthermore, a preferred embodiment is provided, wherein the method for determining the tube axis position, the prior tilt angle of the tube axis relative to the image perpendicular line, and the prior transition position between the cylindrical and conical segments in step 2 to obtain the initial values of the relevant parameters is as follows: When visible tube wall boundaries are present in the fluorescence image of the PCR tube sidewall, initial values of relevant parameters are obtained by combining edge detection and half-width segment fitting; when the image only contains the ROI region inside the tube, initial values of relevant parameters are obtained based on mirror symmetry, brightness peak, strip symmetry and row statistical features.
[0014] Furthermore, a preferred embodiment is provided, wherein the parameter vector to be inverted in step 3 includes at least the lateral position of the tube axis, the transition line position between the cylindrical segment and the conical segment, the half angle of the conical segment, the effective inner radius pixel value, the refractive index ratio, and the tilt angle of the tube axis relative to the vertical line of the image.
[0015] Furthermore, a preferred embodiment is provided, wherein the method for evaluating the candidate correction image in step 3 and determining the self-calibration geometric parameters corresponding to the current imaging state is as follows: the evaluation is based on one or more consistency indicators among mirror symmetry, gradient isotropy, axis consistency, transition zone stability and boundary mapping effectiveness, and the self-calibration geometric parameters corresponding to the current imaging state are determined.
[0016] Furthermore, a preferred embodiment is provided in which the resampling in step 3 adopts bilinear interpolation and the boundary mode adopts reflective boundary to eliminate edge sampling artifacts.
[0017] Furthermore, a preferred embodiment is provided in which the restoration processing of the geometrically corrected image in step 5 includes at least one of stripe suppression, background subtraction, illumination flattening, and dynamic range.
[0018] Option 2: A PCR tube sidewall fluorescence image correction system based on self-calibration inversion, the system comprising: An image acquisition module is used to acquire fluorescence images of the PCR tube sidewall and preprocess the fluorescence images of the PCR tube sidewall to obtain an image to be corrected. The initial geometry detection module is used to perform initial geometry detection on the image to be corrected in the image acquisition module, determine the tube axis position, the prior tilt angle of the tube axis relative to the perpendicular line of the image, and the prior transition position between the cylindrical and conical segments, and obtain the initial values of relevant parameters. The self-calibration geometric parameter acquisition module is used to construct the parameter vector to be inverted, perform a phased self-calibration search based on the initial values of relevant parameters obtained in the initial geometric detection module, construct an inverse mapping table for candidate parameters based on the refraction models of the cylindrical and conical segments of the PCR tube, resample the image to be calibrated to obtain candidate calibrated images, evaluate the candidate calibrated images, and determine the self-calibration geometric parameters corresponding to the current imaging state. The geometric correction image module is used to establish a final remapping table based on the self-calibrated geometric parameters. The cylindrical segment establishes a monotonic mapping between the apparent coordinates and the true coordinates based on the strict non-paraxial refraction relationship considering the two refractions from the outer medium to the polypropylene pipe wall and from the polypropylene pipe wall to the inner medium. The conical segment establishes a lateral correction and vertical displacement compensation mapping based on the vector refraction relationship of the inclined interface on the basis of local radius changes, and completes the partitioned geometric correction by combining the pipe axis inclination angle to obtain the geometric correction image. The output module is used to perform restoration processing on the geometrically corrected image and output the final corrected image and the corresponding self-calibrated geometric parameters.
[0019] Option 3: A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described in Option 1.
[0020] Option 4: A computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor runs the computer program stored in the memory, the processor executes the method described in Option 1.
[0021] The advantages of this invention are: The PCR tube sidewall fluorescence image correction method and system based on self-calibration inversion described in this invention no longer relies on fixed nominal geometric parameters. Instead, it automatically inverts the tube axis position, transition row position, effective inner radius, cone angle, refractive index ratio, and tube axis tilt angle from the image itself. This allows the correction model to adapt to actual PCR tube manufacturing errors, clamping deviations (including small tilt angles of the tube axis relative to the image perpendicular line), refractive index configuration of the outer medium (such as bare tube air environment versus refractive index matching immersion environment), and changes in the captured ROI, thus improving geometric correction accuracy. Simultaneously, this invention combines the excitation, imaging, and acquisition conditions in the optical path system of the light sheet fluorescence detection system for synergistic constraints, making the correction results closer to the actual optical propagation process.
[0022] The PCR tube sidewall fluorescence image correction method and system based on self-calibration inversion described in this invention can achieve parameter estimation without the need for a complete visible tube wall boundary in ROI mode. It establishes an axis prior by fusing global mirror symmetry, brightness peak, and strip symmetry information, and introduces axis consistency and transition zone stability constraints into the self-calibration objective function, thereby improving robustness under internal region imaging conditions. At the same time, this scheme can be directly adapted to the engineering implementation method of light sheet fluorescence detection optical path system that only collects the effective observation area inside the tube.
[0023] The PCR tube sidewall fluorescence image correction method and system based on self-calibration inversion described in this invention distinguishes between cylindrical and conical segments based on a strict non-paraxial refraction model. For the cylindrical segment, Bouguer invariants plus vector Snell analytical ray tracing are used, simultaneously considering two refractions: one from the outer medium to the tube wall and the other from the tube wall to the inner medium. When the refractive indices of the outer medium and the tube wall are matched, this degenerates into the same analytical formula as for single refraction. For the conical segment, vector refraction is applied to the two tilted interfaces based on local inner radius changes, introducing lateral correction and vertical displacement compensation related to the local inner radius and surface tilt angle. Vertical compensation is smoothly connected in the transition region. Compared to schemes using only a unified geometric model, paraxial approximation, or only considering single refraction, this method more accurately recovers the position-related distortion of the conical segment region and is compatible with both bare tube air environments and refractive index-matched immersion environments. Furthermore, combining light sheet excitation and telecentric imaging further enhances the technical integrity and feasibility of the method.
[0024] The PCR tube sidewall fluorescence image correction method and system based on self-calibration inversion described in this invention employs a staged search and objective function evaluation mechanism, combined with a one-dimensional lookup table inverse transformation based on monotonic mapping. While ensuring controllable implementation complexity, it also takes into account mirror symmetry, gradient direction balance, axis reestimation consistency, and mapping boundary effectiveness. It can complete image-specific geometric and optical self-calibration without the need for an additional calibration plate, and improves engineering implementation efficiency. At the same time, it provides sufficient specification support for subsequent expansion from methodological technical solutions to system, device, or computer program product technical solutions.
[0025] The PCR tube sidewall fluorescence image correction method and system based on self-calibration inversion described in this invention, under typical implementation conditions (cylinder diameter D = 6.5 mm, wall thickness t), wall=0.50mm, cone half-angle α=14.0°, excitation wavelength λ=525nm, total magnification M=4.0), the method of the present invention can complete self-calibration and image correction in about 2 seconds without the need for a calibration plate; after correction, the apparent lateral width ratio of the outer edge droplet to the paraxial droplet is restored from about 0.90 to less than 1.03, the horizontal fringe energy ratio decreases by about 61%, and the gradient isotropic and transition region stability indices are improved by about 45% and 30%, respectively, which confirms the significant gains of the present invention in geometric restoration and artifact suppression.
[0026] This invention is also applicable to the fields of optical sheet fluorescence detection optical path systems and digital PCR imaging correction. Attached Figure Description
[0027] Figure 1 This is a schematic flowchart of the PCR tube sidewall fluorescence image correction method based on self-calibration inversion described in Embodiment 1. Detailed Implementation
[0028] 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 only a part of the embodiments of this application, and not all of them.
[0029] Implementation Method 1, see [link] Figure 1 This embodiment describes a method for correcting PCR tube sidewall fluorescence images based on self-calibration inversion. Addressing the different refractive mechanisms of cylindrical and conical sections of PCR tubes, after obtaining the original fluorescence image, the method first automatically estimates the tube axis position, the tube axis angle relative to the image's vertical line, and the transition position from the cylindrical to the conical section. Then, it constructs a vector of geometric parameters to be inverted. Through a phased search based on image consistency indices, it obtains specific parameters such as the effective inner radius, refractive index ratio, cone angle, transition position, and tube axis angle. Combining this with a strictly non-paraxial refraction model considering two refractions—from the outer medium to the polypropylene tube wall and from the polypropylene tube wall to the inner aqueous phase—it establishes a monotonically reversible mapping relationship between the cylindrical and conical sections. Using the self-calibration parameters, it generates a remapping table and completes zonal geometric correction and post-processing, thereby improving the reliability of subsequent fluorescence droplet detection and quantitative analysis. The method includes the following steps: Step 1: Obtain the fluorescence image of the PCR tube sidewall using the optical path system shown in the figure below. The image can be a single-channel fluorescence image; when the input is a color image, it is first converted to a grayscale image, and then uniformly converted to a floating-point array for subsequent gradient calculation, remapping sampling, and frequency domain processing. For a single image, the calibration process can be directly initiated; for batch images, the same processing can be performed image by image in the order of the catalog.
[0030] In step 1, the preprocessing can be represented as: I g =Gray(I in ), I f =float32(I g When max(H, W) > L max At that time, according to the scaling factor scale=L max / max(H, W) downsamples the image to obtain I s =Resize(I f (scale). In one implementation, L max A maximum side length of no more than 448 pixels can be chosen to reduce the computational cost of self-calibration search. Furthermore, self-calibration can be performed based on the downsampled image, while the final remapping table is still built for the original resolution image, balancing computational efficiency and output accuracy. Where I in For the input raw fluorescence image, I g For the grayscale result, I f For floating-point arrays, I s The image is downsampled; H and W are the height and width (in pixels) of the image, respectively, and max(H, W) is the larger of the two.
[0031] Step 2: To obtain initial values for the self-calibration parameters, perform initial geometric detection on the image. Axis detection can be performed first, and then the image can be directed to either the full-pipe detection path or the ROI detection path depending on whether a visible pipe wall boundary exists. The axis detection can integrate three types of results: global mirror symmetry, brightness peaks near the axis, and stripe symmetry, to improve robustness under ROI conditions.
[0032] In step 2, the average intensity distribution along the column direction is assumed to be as follows:
[0033] Where I(y, x) represents the gray value of the pixel in the y-th row and x-th column of the image, and H is the image height. After smoothing p(x), cross-correlation is performed with its inverse sequence. If the shift corresponding to the correlation peak is τ... peak Then the global center of symmetry can be represented as c. sym =(W-1-τ peak ) / 2. Additionally, let c be the peak position of the column distribution after large-scale smoothing. brt Let c be the midline obtained by strip symmetry. row Therefore, c = 0.45·c can be used. sym +0.40·c row +0.15·c brt As a prior for the axis, the confidence level of the axis can be constructed by combining the dispersion of the three axis estimates and the standard deviation of the strip estimate; when the confidence level is lower than a preset threshold, it regresses to the prior near the image center.
[0034] When visible pipe wall boundaries exist in the image, Gaussian smoothing can be performed on the image first, and then the horizontal Sobel gradient can be calculated row by row. I / x, and determine the left boundary l(y) and right boundary r(y) for each row. From this, we can obtain the center sequence c(y) = (l(y) + r(y)) / 2 and the half-width sequence h(y) = (r(y) - l(y)) / 2. Then, we perform piecewise fitting on h(y): when y <y t When h(y) = R0; when y ≥ y t h(y) = R0 - k·(yy) t The effective half-width R0 of the cylindrical segment and the transition line y can be obtained from the fitting parameters. t And the half-angle α of the cone segment is α = arctan|k|.
[0035] When the image only contains the ROI region within the tube and the left and right boundaries cannot be stably extracted, a statistical detection path is used. The lateral gradient energy g(y) = mean(| I / x|), edge contrast e(y) = mean(I center )-0.5·[mean(I left )+mean(I right The standard deviation of the row is v(y) = std(I(y:y)), and after smoothing and normalization, a comprehensive response q(y) = norm(g(y)) + norm(e(y)) - 0.3·norm(v(y)) is formed. Then, the first-order change of q(y) is analyzed within a preset search interval, and the position where the change of q(y) is most significant is used as the initial value of the transition row between the cylindrical and conical segments; if the response is insufficient, it reverts to the prior transition ratio. Where I... center I left I right These represent subsets of pixels within the three column ranges of the image's center, left, and right sides, respectively.
[0036] In step 2, further, in the row-by-row axis sequence obtained by strip symmetry {c(y i )} and the corresponding built-in confidence weights {w i Based on this, a weighted linear fitting can be performed: c(y) = c0 + tan(φ)·(yy) ref The prior angle of the tube axis relative to the perpendicular line of the image is calculated by inversely from the slope, φ0 = arctan(slope). The ratio of the fitted residual to the original dispersion is used as the acceptance threshold (acceptable if the residual ratio is less than 0.85 and the number of segments is not less than 3). Simultaneously, the sample is truncated by |φ0|≤6° before being fed into the subsequent self-calibration search to improve the observability of the objective function for the tube axis tilt. Where c(y i) represents the horizontal position of the axis obtained from the i-th strip, w i c0 represents the built-in confidence weight for the corresponding row, and c0 represents the reference row y. ref (Default is to take the transition line y) t The lateral position of the axis at point ( ), where φ0 is the initial tilt angle estimate.
[0037] Step 3: After obtaining the initial geometric results, construct the parameter vector to be inverted, p = (c, y). t , α, R, ρ, φ), where c is the lateral position of the tube axis, y t For the transition row position, α is the half-angle of the cone segment, R is the effective inner radius pixel value, and ρ is the refractive index ratio (in the implementation where the refractive index of the outer medium matches that of the pipe wall, ρ=n). PP / n water In an implementation where the refractive index of the outer medium does not match that of the pipe wall, ρ=n outside / n water φ is the tilt angle of the tube axis relative to the perpendicular line of the image. It is stipulated that when φ>0, the bottom of the tube axis deflects in the +x direction. The reference point is taken as the transition line (c, y). t The refractive index can be automatically determined based on the excitation wavelength λ: n water (λ) = 1.32429 + 3.25 × 10 -3 / λ um 2 n PP (λ) = 1.48062 + 4.35 × 10 -3 / λ um 2 , where λ um The wavelength is measured in micrometers. Furthermore, the object-side pixel size can be expressed as p. eff =p raw / M, pixel density can be expressed as px permm =1000 / p eff From this, we can obtain the nominal inner radius R. nom =(D / 2-t wall )·px permm Where D is the outer diameter of the cylindrical section of the PCR tube (mm), and t wall Where M is the tube wall thickness (mm), and p is the total magnification of the optical path. raw p is the original pixel size of the camera (μm). eff The object's equivalent pixel size (μm), px permm This represents the number of pixels per millimeter of the object.
[0038] Step 3: To retrieve geometric parameters from the image that better match the current sample and imaging state, this invention performs a phased self-calibration search. The search prioritizes evaluating and inversely mapping candidate parameters for birefringence imaging models where the refractive indices of the outer medium and the polypropylene tube wall do not match; when the refractive indices of the outer medium and the tube wall match, the corresponding model naturally degenerates into a single-refractive special case. In non-fast mode, a three-level search (coarse, medium, and fine) is employed; in fast mode, a two-level search is used. For the non-fast mode, a set of step sizes is set as follows: Δc = {0.030W, 0.016W, 0.008W}, Δyt = {0.120H, 0.070H, 0.035H}, Δα = {4.0°, 2.0°, 0.9°}, ΔR = {0.14R, 0.08R, 0.04R}, Δρ = {0.050, 0.025, 0.012}, Δφ = {1.20°, 0.50°, 0.15°}; in the fast mode, the search level and number of iterations are reduced accordingly. Here, W and H represent the image width and height, respectively, and R is the effective inner radius of the current candidate.
[0039] In step 3, the local search logic is as follows: the search step size is organized in stages as {Δ stage} (stage=1, 2, 3 correspond to coarse, medium, and fine levels respectively), for each parameter to be optimized within each stage, key∈{c, y t Given the parameters α, R, ρ, φ, construct two perturbation candidate parameters CAND centered on the current optimal parameter set best. + =clip(best key +Δ stage,key ),cand - =clip(best key -Δ stage,key If S(cand) + ) or S(cand - If the score is greater than the current best score S(best), then the corresponding candidate is used to update best; this process is repeated parameter by parameter and level by level until any perturbation of any parameter within the current level can no longer bring improvement. Furthermore, the boundaries of each parameter are set to c∈[0.08W, 0.92W], y t ∈[0.05H, 0.95H], α∈[3°, 32°], R∈[0.18W, R up ], ρ∈[1.005, 1.30] (In the implementation where the refractive index of the outer medium does not match that of the tube wall, the lower bound is changed to approximately 1 / n accordingly. water +0.005 to accommodate the low refractive index ratio case of a bare tube in air environment), φ∈[-6°, +6°]. Scoring results for the same candidate parameter can be cached to avoid duplicate calculations. Where R... upThe upper bound for the effective inner radius search is given by best, which represents the current optimal parameter set, and cand. + with cand - These represent the candidate parameter sets obtained from perturbations in the positive and negative directions, respectively.
[0040] In step 3, for each set of candidate parameters, an inverse remapping table is established based on the different refractive models of the cylindrical and conical sections of the PCR tube. In the more generalized implementation where the refractive index of the outer medium and the tube wall is mismatched, the cylindrical section preferentially adopts a strictly non-paraxial analytical ray tracing model that considers two refractions: one from the outer medium to the polypropylene tube wall and another from the polypropylene tube wall to the water phase inside the tube. In the immersion implementation where the refractive index of the outer medium and the tube wall is matched (i.e., noutside=nPP), the above two-refraction model degenerates into a single-refraction form.
[0041] In step 3, for the cylindrical segment double refraction model, the light is refracted sequentially at the outer wall interface (outer medium to polypropylene) and the inner wall interface (polypropylene to water phase). Based on the conservation of the Bouguer invariant n·r·sin(φ) along the same straight line segment, it can be deduced that the refraction direction angle of the light after entering the water phase satisfies sin(θexit)=(Ro / Ri)·(noutside / nwater)·so, where so=x / Ro is the camera end apparent coordinate normalized according to the outer radius, Ro and Ri are the outer radius and inner radius of the pipe wall, respectively, and θexit is the refraction direction angle of the light after entering the water phase; further, the outer wall incident point is given by Po=Ro·(so, sqrt(1-so2)), the vector Snell gives the propagation direction inside the pipe wall, and the intersection with the inner wall cylindrical surface is used to obtain the inner wall exit point Pi. Then, the true lateral position xreal is obtained by propagating along the straight line from the inner wall exit direction to the light sheet plane z=0, and then sreal=xreal / Ri. It is worth noting that the refractive index nPP of polypropylene only affects the propagation path of light within the tube wall and the position of the incident point Pi on the inner wall, and does not affect the final exit angle. Therefore, nPP is eliminated in the angle deflection formula; this conclusion is given by the Bouguer invariant. When noutside = nPP, the above two-fold refraction model degenerates into a single-fold refraction result, and the true normalized lateral coordinates of the cylindrical segment can be expressed as: sreal = sapp·ρ / [ρ·sapp2 + sqrt((1-sapp2)·(1-ρ2·sapp2))]. Since this relationship is monotonic within the effective domain, sapp is obtained by using a one-dimensional lookup table to achieve the reverse mapping from the true coordinates to the input sampling coordinates. Here, x is the lateral position of the pixel relative to the tube axis, and Rinner is the effective inner radius under this candidate parameter.
[0042] In step 3, for the conical region, in the more generalized implementation of the refractive index mismatch between the outer medium and the pipe wall, the conical refraction is achieved by a hierarchical analytical series of vector Snell formulas for the two tilted interfaces.
[0043] Let the half-angle of the cone segment be α, and the outer normal vector be denoted as nhat = (s·cosα, sinα, cosα·sqrt(1-s2)). First, establish the following for the outer cone surface using the refractive index ratio noutside / nPP: sin2θi = sin2α + cos2α·s2, sinθt = (noutside / nPP)·sinθi, K = (noutside / nPP)·cosθi - cosθt, t = cosα·sqrt(1-s2) / [(noutside / nPP)·sin2θi + co [sα·sqrt(1-s2)·cosθt], and calculate (dx / R)1=t·K·s·cosα, (dy / R)1=t·K·sinα, to obtain the intermediate apparent position smid=s+(dx / R)1; then apply the same vector Snell formula to the inner cone surface with the refractive index ratio nPP / nwater to obtain sreal=smid+(dx / R)2, and sum the normalized longitudinal displacement introduced by the two inclined interfaces according to dy / R=(dy / R)1+(dy / R)2, thereby calculating the lateral correction and vertical compensation.
[0044] In step 3, in the immersion embodiment where the refractive index of the outer medium matches that of the pipe wall, the aforementioned series refraction process of the two inclined interfaces of the cone segment degenerates into a single refraction result.
[0045] At this point, let the refractive index ratio be ρ. Based on the cone segment half angle α and the external normal vector nhat=(s·cosα,sinα,cosα·sqrt(1-s2)), according to the vector Snell's law, we establish: sin2θi=sin2α+cos2α·s2,sinθt=ρ·sinθi,K=ρ·cosθi-cosθt,t=cosα·sqrt(1-s2) / [ρ·sin2θi+cosα·sqrt(1-s2)·cosθt],dx / R=t·K·s·cosα,dy / R=t·K·sinα,and calculate the lateral correction and vertical compensation using sreal=sapp+dx / R,yreal=yapp+(dy / R)·Rrow·conesign. Where s is the normalized lateral position at the refraction point (synonymous with sapp, the same below), θi and θt are the incident angle and the refraction angle, respectively, K and t are two scalar coefficients derived from the vector Snell's law (K is the refraction direction offset coefficient, t is the normalized path parameter of the light ray tracing back from the refraction point to the light plate plane), dx / R and dy / R are the normalized lateral and longitudinal displacements introduced by the cone geometry, R is the local inner radius of the row, yapp and yreal represent the apparent longitudinal position and the actual longitudinal position of the cone, respectively, and conesign is the cone direction marker (+1 indicates that the cone tip is below the cylindrical segment, and -1 indicates that the cone tip is above the cylindrical segment).
[0046] In step 3, the image corresponding to the current candidate parameters is resampled using the inverse mapping table to obtain the candidate correction image I. cand Resampling can employ bilinear interpolation, and the boundary pattern uses reflective boundaries to reduce edge sampling artifacts. Multiple consistency metrics are also constructed for I. cand An evaluation is conducted to determine whether the candidate parameters are superior to the current parameters.
[0047] In step 3, the mirror symmetry index can be expressed as S. sym =clip[1-MSE(I left ,flip(I right )) / (mean(I cand 2 The gradient isotropic index can be expressed as S + ε). iso =clip[1-|ln((mean|G x |+ε) / (mean|G y |+ε))| / ln3];The axis consistency index can be expressed as S axis =clip[0.6·(1-|c'-c| / (0.08W))+0.4·conf axis The stability index of the transition region can be expressed as S.trans =clip[1-MSE(P up, P dn ) / (mean(I cand 2 )+ε)]; The boundary mapping penalty term can be expressed as: P border =mean(1_{map x ≤1ormap x ≥W-2ormap y ≤1ormap y ≥H-2}), where MSE represents the mean square error between the two images, ε is a small positive number to prevent the denominator from being zero, and G x G y , c', and c' represent the gradients along the horizontal and vertical axes of the corrected image, respectively; c' represents the re-detected tube axis position on the corrected image; c represents the current candidate tube axis position; conf axis P represents the confidence level for axis detection (range [0, 1]). up With P dn These are the column mean profiles of the adjacent pixel bands above and below the transition row, respectively.
[0048] In step 4, the objective function can be expressed as: S = 0.35 × S sym +0.30×S iso +0.20×S axis +0.15×S trans -0.12×P border .
[0049] Among them, S sym S represents the score for mirror symmetry. iso S represents the gradient isotropic score. axis S represents the axis consistency score. trans P represents the stability score of the transition region. border This represents the boundary mapping penalty. By comparing the objective function values corresponding to different candidate parameters, the parameter vector with the largest objective function value is selected as the final self-calibration geometric parameters.
[0050] Step 4: Establish the final mapping table based on the determined self-calibration geometric parameters, and perform inverse remapping on the original resolution image to obtain the geometrically corrected image. Geometric correction is mainly used to restore the lateral compression of the cylindrical segment, the lateral distortion related to the position of the conical segment, and the vertical offset of the conical segment caused by the refraction of the inner wall of polypropylene, so that the output image is closer to the real spatial distribution of the droplet.
[0051] In step 4, when the tube axis inclination angle φ is non-zero, first use (c, y) tA rigid body rotation of -φ is performed on the image coordinates (x, y) with rotation center φ, entering the pipe's normal coordinate system (u, v), where u = (xc)cosφ - (yy)cosφ. t )sinφ,v=(xc)sinφ+(yy t cosφ; In this standard coordinate system, the cylindrical segment is aligned along the v-axis, and all Snell formulas are completely consistent with the case of φ=0. After completing the reverse remapping of the cylindrical and conical segments, the sampling positions in the standard coordinate system of the tube are transformed back to the image coordinate system by a positive rotation +φ, and recorded in the map. x map y When φ=0, the rotation degenerates into an identity transformation, which is completely consistent with the implementation without the introduction of the tilt parameter.
[0052] In step 4, s can be constructed first on the valid domain. grid The forward mapping meshes for the cylindrical and conical segments are calculated separately, and then the inverse mapping is obtained using monotonically accumulated data and one-dimensional interpolation. Its implementation is as follows: s app =interp(s real s realgrid s grid ); map x =c+s app ·R row ;map y =y real -cone sign ·dy norm ·R row To prevent tearing at the junction of the cylindrical and conical sections, a width of BLEND can be set near the transition row. PX A smooth transition band for map y Perform continuous blending. For pixels with excessively small local radii at the bottom of the cone and outside the estimated tube region, either maintain the identity mapping or weaken the mapping. Where s grid For the apparent normalized lateral coordinate sampling grid, s realgrid For the corresponding true normalized coordinate grid (obtained point-by-point from the forward refraction mapping), interp represents one-dimensional linear interpolation, and map... x map y These are the horizontal and vertical components of the final reverse remapping table, R. row The local inner radius (in pixels) of this row is determined by the cone half-angle α and the transition row y. t (to be jointly determined), dy norm BLEND represents the normalized result of dy / R in the cone segment formula. PX The width of the smoothing mixing band in the transition zone.
[0053] Step 5: Perform stripe suppression, background subtraction, illumination flattening, and dynamic range restoration sequentially on the geometrically corrected image obtained in Step 4. Stripe suppression can be represented as I... stripe =IFFT(FFT(I geo )·M notch ), where M notch For k x Suppression is applied to the narrow band near =0; background subtraction can be expressed as B=Open(I stripe, K r ), I bg =max(I stripe -B,0); Illumination flattening can be expressed as L=GaussianBlur(I bg, σ),I flat =I bg / max(L,ε)×target.
[0054] Dynamic range recovery can be represented as I out =I flat ·Q 99.5 (I in ) / Q 99.5 (I flat In this embodiment, background subtraction can be performed before illumination flattening to avoid the homogenized background being misinterpreted as a valid signal. Wherein I geo The geometrically corrected image is the output of step five. FFT and IFFT are the two-dimensional discrete Fourier transform and its inverse transform, respectively. M notch For frequency domain notch masks, k x For the horizontal frequency coordinates, Open represents the morphological opening operation, and K... r Let be the rolling sphere structural element (whose equivalent radius determines the scale of the removable background), σ be the standard deviation of the Gaussian blur, ε be the lower limit of the positive value to prevent the divisor from being too small (preferably the larger of the lower percentile value of the illumination estimation map L and 1), target be the target reference brightness (in one embodiment, the median value of the effective pixels of the input image), and Q be the target reference brightness. 99.5 I represents the 99.5th percentile of the image. stripe I bg I flat I out These are intermediate or final results after stripe suppression, background subtraction, illumination flattening, and dynamic range restoration, respectively.
[0055] The method described in this embodiment can be encapsulated as a complete calibration pipeline. The calibration pipeline may include a geometric parameter module, a region detection module, a self-calibration inversion module, a geometric correction module, and a workflow orchestration module. The corresponding implementations can be configured as PCRTubeGeometry, TubeRegionDetector, SelfCalibrator, AberrationCorrector, and CorrectionPipeline, respectively. The workflow orchestration module is responsible for connecting the "detection—self-calibration—remapping—post-processing" steps and outputting the original image, region information, overlay results, correction results, and self-calibration parameters.
[0056] Furthermore, the method can be deployed in both graphical user interface (GUI) and command-line (CLO) applications. In one embodiment, the GUI supports switching between ROI mode and full-pipe mode, axis detection, self-calibration switch, and result view switching; the CLO interface can expose optical parameters such as input path, output path, batch processing, cylinder diameter, wall thickness, cone angle, wavelength, refractive index, pixel size, magnification, working distance, and numerical aperture to adapt to different optical sheet fluorescence detection optical path systems.
[0057] In addition to the final corrected image, the output results can also simultaneously output information such as transition line position, tube axis position, cone half-angle, effective inner radius, refractive index ratio, objective function score, search iteration count, downsampling ratio, and axis detection confidence level. This information is used for quality assessment, system debugging, and parameter feedback for the optical path system of the light sheet fluorescence detection system. The above outputs can serve both single-image processing and batch image catalog processing.
[0058] Furthermore, a specific embodiment is provided to further illustrate the implementation of steps one through six above. In this embodiment, the typical configuration of the light sheet fluorescence detection optical path system is as follows: excitation wavelength λ = 525 nm, camera original pixel size p raw =3.2μm, total optical magnification M=4.0, effective sensor area 13.1mm×9.83mm, resolution 4096×3072, objective lens focal length f=45mm, working distance WD=17.15mm; PCR tube cylindrical section outer diameter D=6.5mm, wall thickness t wall =0.50mm, nominal half-angle α of the cone segment =14.0°. The above parameters can be encapsulated into the PCRTubeGeometry class, serving as a unified parameter interface for subsequent steps.
[0059] In step 1 of this embodiment, a threshold L for the maximum downsampling side length can be set. max =448 pixels; when the max(H, W) of the input image exceeds L maxFirst, perform grayscale conversion and floating-point conversion, then scale by L. max / max(H, W) performs downsampling for self-calibration search, while the final remapping table is still built for the original resolution image. The PCRTubeGeometry class internally automatically calculates the refractive index at λ=525nm according to the Cauchy dispersion relation: n water (λ) = 1.32429 + 3.25 × 10 -3 / λ um ²≈1.3361, n PP (λ) = 1.48062 + 4.35 × 10 -3 / λ um ²≈1.4964, refractive index ratio ρ=n PP / n water ≈1.1200; and by p eff =p raw / M=0.80μm and px permm =1250px / mm Further, the nominal inner radius R of the cylindrical segment is obtained. nom =(D / 2-t wall )·px permm ≈3437.5px.
[0060] In step two of this embodiment, the `TubeRegionDetector` class can be used to perform initial geometric detection, where the Gaussian smoothing standard deviation `blur_sigma` is 3.0, the Sobel peak value ratio `edge_threshold_fraction` is 0.12, the minimum tube width `min_tube_width_px` is 15, and the median filter window `smoothing` is 7. When the ratio of the number of effective rows obtained by row-by-row edge detection to the image height is less than 0.30, the system automatically enters ROI mode and estimates the initial value of the transition rows using row statistical feature paths. The axis prior is given by the `AxisFinder` class, where the smoothing scale ratio `smoothing_sigma_frac` is 0.04, the striped window `window_rows` is 30, the minimum confidence threshold `min_confidence` is 0.25, and c = 0.45·c sym +0.40·c row +0.15·c brt The weighted fusion of three estimation results: global mirror symmetry center, strip symmetry median, and large-scale brightness peak position.
[0061] In step 3 of this embodiment, the parameter vector to be inverted, p=(c, y), can be constructed. tThe initial values (α, R, ρ, φ) are set according to the above optical path configuration. The tube axis tilt angle prior φ0 is obtained by weighted linear fitting of the AxisFinder's line-by-line axis (typical range |φ0|≤3°), and whether to enable it is determined by the fitting acceptance threshold tilt_confidence≥0.30. The refractive index ratio ρ is selected according to the corresponding physical meaning based on the outer medium configuration, and the outer medium defaults to n. outside =1.00 (bare tube air environment, corresponding to two refraction models). In step four of this embodiment, the SelfCalibrator class can be used to perform a staged self-calibration search: the upper limit of the downsampling scale of the self-calibration input image is max_side=448, the number of lookup table sampling points N=2001 when performing one-dimensional inverse mapping, and the sampling interval is [-0.95 / ρ, +0.95 / ρ]; in the non-fast mode, a three-level search is used, with each level looping cycles_per_stage=2 times, and the step sizes of the three levels are Δc={0.030W, 0.016W, 0.008W}, Δy t ={0.120H, 0.070H, 0.035H}, Δα={4.0°, 2.0°, 0.9°}, ΔR={0.14R, 0.08R, 0.04R}, Δρ={0.050, 0.025, 0.012}, Δφ={1.20°, 0.50°, 0.15°}; In fast mode, a two-level search is used, with each level looping once, corresponding to step sizes of Δc={0.020W, 0.010W}, Δy t ={0.080H, 0.040H}, Δα={2.5°, 1.2°}, ΔR={0.10R, 0.05R}, Δρ={0.030, 0.015}, Δφ={1.00°, 0.35°}. The boundary conditions for each parameter are set as c∈[0.08W, 0.92W], y t ∈[0.05H, 0.95H], α∈[3°, 32°], R∈[0.18W, R up ], ρ∈[1.005, 1.30] (In embodiments where the refractive index of the outer medium does not match that of the tube wall, the lower bound is correspondingly relaxed to about 1 / n) water +0.005≈0.753), φ∈[-6°, +6°], where R up To determine the upper bound of the effective inner radius search, we can take R. up =max(2.0W,1.5R nom, 1.5R); the objective function is defined as S=0.35·S sym +0.30·S iso +0.20·S axis +0.15·S trans -0.12·P borderA comprehensive evaluation is conducted, and the scoring results of candidate parameters are cached to avoid duplicate calculations.
[0062] Furthermore, a sensitivity analysis is performed on the weights of each term in the objective function: while keeping the sum of the remaining weights constant, S... sym The weights are in the range [0.25, 0.45], S iso The weights are in the range [0.20, 0.40], S axis When the weights are independently perturbed within the range of [0.15, 0.30], the final self-calibration parameter corresponds to S. iso With S trans The changes in the evaluation indicators did not exceed 5%; when the boundary penalty coefficient was adjusted within the range of [-0.20, -0.05], the drift of the effective inner radius R to the refractive index ratio ρ in the self-calibration results was less than 2% and 1%, respectively; this result shows that the weights of each item in the objective function are not sensitive to the final correction quality within a relatively wide and reasonable range, avoiding the dependence on excessive parameter tuning, and also indicating that the selected weight combination is not an isolated optimum but a representative value within the stable interval.
[0063] Furthermore, the staged coordinate descent self-calibration search, combined with a caching mechanism for candidate parameter scoring results, can control the number of candidate evaluations in the 6-dimensional parameter space to approximately 70. Compared to an independent exhaustive search of each dimension (assuming approximately 10 candidates per dimension, the total number of evaluations would be approximately 10), this significantly reduces the number of evaluations. 6 =10 6 The number of evaluations is reduced by approximately four orders of magnitude. Simultaneously, self-calibration is performed at a scale of approximately 448 pixels, downsampling the maximum side length of the original image, further significantly reducing the floating-point computation and image sampling count per candidate evaluation. While maintaining correction accuracy, the proposed scheme keeps the computational hardware resource consumption and processing latency of the self-calibration process within an acceptable engineering range (approximately 2.4 seconds per frame for self-calibration on a general-purpose desktop CPU), thereby improving hardware processing efficiency.
[0064] In step 4 of this embodiment, the AberrationCorrector class can be used to establish the final inverse remapping table for the original resolution image based on the determined self-calibration geometric parameters: First, the image coordinates are rigidly rotated according to the determined tube axis tilt angle φ to align the tube axis with the v direction of the normal coordinate system, and all Snell formulas are executed within this normal coordinate system; then, s is established in the cylindrical segment region according to the strictly non-paraxial refraction relationship. app With s real A monotonic mapping between them, and only for those satisfying |xc|<0.995·R top Intra-pixel correction is performed; in the conical region, lateral correction s is simultaneously calculated according to the vector Snell's law. real =sapp +dx / R and normalized vertical compensation dy / R, and for the local inner radius R row Less than max(0.05·R) top The region of 8.0 pixels maintains an identity mapping. Furthermore, in the transition line y... t A smooth blending band with a width of BLENDPX = 12.0 pixels is set below to perform linear transitions on the vertical mapping mapy to avoid tearing at the junction of the cylindrical and conical segments. When the refractive index of the outer medium does not match the tube wall (e.g., in the default implementation n...), outside When the ratio is 1.00 (bare tube in air environment), the cylindrical section uses Bouguer invariant plus vector Snell's two-fold refraction analytical ray tracing, and the conical section uses the front and rear inclined interface vector Snell's series approximation. The ratio of the outer to inner radius R is... o / R i =(D / 2) / (D / 2-t wall )≈3.25 / 2.75≈1.1818; When the refractive index of the outer medium matches that of the pipe wall, it degenerates into a single refraction formula. After completing the inverse mapping in the above-mentioned normal coordinate system, the sampling position is transformed back to the image coordinate system by a positive rotation +φ. Finally, the cv2.remap function is called to perform bilinear interpolation resampling on the original image and apply reflective boundary processing to output the geometrically corrected image I. geo .
[0065] In step 5 of this embodiment, I can be... geo The following steps are performed sequentially: FFT notch filtering with stripe suppression (notch_width = 3 pixels, and preservation of the central DC radius dc_r = 3 pixels); rolling ball background subtraction based on morphological opening operation (structuring element radius bg_ball_radius = 50 pixels); Gaussian illumination flattening (smoothing scale σ = max(30.0, 0.08·min(H, W)) pixels, with background subtraction preferably performed before illumination flattening to avoid the homogenized background being misjudged as a valid signal); and dynamic range recovery matched to the 99.5th percentile, i.e., I... out =I flat ·Q 99.5 (I in ) / Q 99.5 (I flat This ensures that the peak brightness of the final output image is not lower than the corresponding quantile of the original input.
[0066] To further verify the effectiveness of the self-calibrated geometric optics inversion method in the above embodiments, a control experiment was performed on the fluorescence images of the PCR tube sidewalls containing known droplet distributions under the same optical sheet fluorescence detection optical path system: the self-calibrated geometric parameters obtained in step four were used for the inverse remapping and post-processing in steps five and six to obtain the corrected images; at the same time, the original images not processed by the method of this invention were retained as a control group. Uniform droplet detection and parameter statistics were performed on the two sets of images to quantify the actual gains of the method of this invention in terms of geometric restoration, artifact suppression, and subsequent droplet detection stability.
[0067] Under the optical path parameters described in the typical embodiment (cylinder diameter D = 6.5 mm, wall thickness t), wall =0.50mm, cone half-angle α=14.0°, excitation wavelength λ=525nm, total amplification M=4.0, outer medium n outside =1.00 bare tube air environment), after the phased self-calibration search in step four (including tilt angle dimension, with about 6 new candidate evaluations added at each level), convergence was completed within about 70 candidate evaluations. The comprehensive objective function score S was improved from about 0.35 for the initial parameters to over 0.49. The self-calibration time was about 2.4 seconds when the single frame resolution was about 720×960 pixels. For the synthetic test image with a tube axis tilt angle of ±2°, the present invention can control the tilt angle recovery error within 3 times the finest search step size Δφ=0.15° (i.e., about 0.5° accuracy). Further, using the apparent lateral size of the same type of droplet in the image before and after correction as an indicator: in the original image, the ratio of the apparent lateral width of the paraxial droplet in the cylindrical section to that of the outer edge droplet is about 0.90 (i.e., the outer edge droplet is compressed by about 10% due to the difference in refractive index); after correction by the method of the present invention, this ratio is restored to about 1.03, close to the ideal symmetry value of 1.00, and the residual does not exceed 3%. The above results show that the strictly non-paraxial refraction model considering two refractions and its one-dimensional single-investigation table inverse mapping established in this invention can effectively recover the transverse compression distortion caused by the sequential refraction from the outer medium to the polypropylene pipe wall and from the polypropylene pipe wall to the water phase inside the pipe.
[0068] Regarding artifact suppression and quality evaluation metrics, after correction using the method of this invention: frequency domain notch filtering reduced the proportion of horizontal fringe energy from approximately 0.368 in the original image to approximately 0.144, a reduction of approximately 61%; the gradient isotropic index Siso increased from approximately 0.552 to approximately 0.797, an improvement of approximately 45%; the transition region stability index Strans increased from approximately 0.564 to approximately 0.734, an improvement of approximately 30%; and the mirror symmetry index Ssym remained above 0.94 both before and after correction, while the boundary mapping penalty Pborder remained at a low level of approximately 0.006, indicating that the inverse remapping table is stable and reversible within its effective domain and did not significantly disrupt the original left-right symmetry structure due to overcorrection. Based on the above results of geometric restoration, artifact suppression, and improvement of evaluation indicators, it can be seen that the PCR tube-slice fluorescence microscopy sidewall image correction method proposed in this invention, based on self-calibrated geometric optics inversion, can automatically estimate specific geometric parameters of an image and significantly improve the correction quality using only a single frame image without the need for an additional calibration plate. This provides a more consistent and reliable input for subsequent droplet positioning, segmentation, and counting.
[0069] The mirror symmetry, gradient isotropy, axis consistency, transition zone stability, and boundary penalty used in the above embodiments are only optional evaluation indicators. For those skilled in the art, without departing from the core concept of this invention, other evaluation items that can reflect the quality of PCR tube sidewall fluorescence image correction can be substituted, such as droplet roundness consistency, droplet lateral size dispersion, or layer position continuity, etc., and these equivalent modifications should all be considered within the scope of protection of this invention.
[0070] Those skilled in the art will understand that the above description is merely a preferred embodiment of the present invention, and the features described in the various embodiments and / or technical solutions of this disclosure can be combined or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. This is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
[0071] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended technical solutions are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the present invention. Clearly, those skilled in the art can make various modifications and variations to the present invention without departing from its spirit and scope. Thus, if these modifications and variations of the present invention fall within the scope of the present invention and its equivalents, the present invention also intends to include these modifications and variations.
Claims
1. A method for correcting PCR tube sidewall fluorescence images based on self-calibration inversion, characterized in that, The method includes the following steps: Step 1: Obtain the fluorescence image of the PCR tube sidewall and preprocess the fluorescence image of the PCR tube sidewall to obtain the image to be corrected; Step 2: Perform initial geometric detection on the image to be corrected in Step 1 to determine the tube axis position, the prior tilt angle of the tube axis relative to the perpendicular line of the image, and the prior transition position between the cylindrical and conical segments, and obtain the initial values of relevant parameters. Step 3: Construct the parameter vector to be inverted. Perform a phased self-calibration search based on the initial values of the relevant parameters obtained in Step 2. Construct an inverse mapping table for the candidate parameters based on the refraction models of the cylindrical and conical segments of the PCR tube, respectively. Resample the image to be calibrated to obtain candidate calibration images. Evaluate the candidate calibration images and determine the self-calibration geometric parameters corresponding to the current imaging state. Step 4: Establish the final remapping table based on the self-calibrated geometric parameters. For the cylindrical segment, establish a monotonic mapping between the apparent coordinates and the true coordinates based on the strict non-paraxial refraction relationship considering the two refractions from the outer medium to the polypropylene pipe wall and from the polypropylene pipe wall to the inner medium. For the conical segment, establish a lateral correction and vertical displacement compensation mapping based on the vector refraction relationship of the inclined interface on the basis of local radius changes. Combine the pipe axis inclination angle to complete the partitioned geometric correction and obtain the geometric correction image. Step 5: Perform restoration processing on the geometrically corrected image and output the final corrected image and the corresponding self-calibration geometric parameters.
2. The PCR tube sidewall fluorescence image correction method based on self-calibration inversion according to claim 1, characterized in that, The method for preprocessing the fluorescence image of the PCR tube sidewall in step 1 is as follows: I g =Gray(I in ),I f =float32(I g ) When max(H, W) > L max At that time, according to the scaling factor scale=L max / max(H, W) downsamples the image to obtain I s =Resize(I f (, scale); Among them, I g For grayscale images, I in For the original input image, I f It is a floating-point array, where H is the image height, W is the image width, and I is the image height. s This is the image to be corrected after downsampling.
3. The PCR tube sidewall fluorescence image correction method based on self-calibration inversion according to claim 1, characterized in that, In step 2, the method for determining the tube axis position, the prior tilt angle of the tube axis relative to the image perpendicular line, and the prior transition position between the cylindrical and conical segments to obtain the initial values of the relevant parameters is as follows: When visible tube wall boundaries are present in the fluorescence image of the PCR tube sidewall, initial values of relevant parameters are obtained by combining edge detection and half-width segment fitting; when the image only contains the ROI region inside the tube, initial values of relevant parameters are obtained based on mirror symmetry, brightness peak, strip symmetry and row statistical features.
4. The PCR tube sidewall fluorescence image correction method based on self-calibration inversion according to claim 1, characterized in that, The parameter vector to be inverted in step 3 includes at least the lateral position of the tube axis, the transition line position between the cylindrical and conical segments, the half angle of the conical segment, the effective inner radius pixel value, the refractive index ratio, and the tilt angle of the tube axis relative to the vertical line of the image.
5. The PCR tube sidewall fluorescence image correction method based on self-calibration inversion according to claim 1, characterized in that, The method for evaluating the candidate corrected image in step 3 and determining the self-calibration geometric parameters corresponding to the current imaging state is as follows: the evaluation is based on one or more consistency indicators among mirror symmetry, gradient isotropy, axis consistency, transition zone stability and boundary mapping effectiveness, and the self-calibration geometric parameters corresponding to the current imaging state are determined.
6. The PCR tube sidewall fluorescence image correction method based on self-calibration inversion according to claim 1, characterized in that, The resampling described in step 3 uses bilinear interpolation and a reflective boundary pattern to eliminate edge sampling artifacts.
7. The PCR tube sidewall fluorescence image correction method based on self-calibration inversion according to claim 1, characterized in that, Step 5 involves restoring the geometrically corrected image by at least one of the following: stripe suppression, background subtraction, illumination flattening, and dynamic range adjustment.
8. A PCR tube sidewall fluorescence image correction system based on self-calibration inversion, characterized in that, The system includes: An image acquisition module is used to acquire fluorescence images of the PCR tube sidewall and preprocess the fluorescence images of the PCR tube sidewall to obtain an image to be corrected. The initial geometry detection module is used to perform initial geometry detection on the image to be corrected in the image acquisition module, determine the tube axis position, the prior tilt angle of the tube axis relative to the perpendicular line of the image, and the prior transition position between the cylindrical and conical segments, and obtain the initial values of relevant parameters. The self-calibration geometric parameter acquisition module is used to construct the parameter vector to be inverted, perform a phased self-calibration search based on the initial values of relevant parameters obtained in the initial geometric detection module, construct an inverse mapping table for candidate parameters according to the refraction model of the cylindrical and conical segments of the PCR tube, resample the image to be calibrated to obtain candidate calibrated images, evaluate the candidate calibrated images, and determine the self-calibration geometric parameters corresponding to the current imaging state. The geometric correction image module is used to establish a final remapping table based on the self-calibrated geometric parameters. The cylindrical segment establishes a monotonic mapping between the apparent coordinates and the true coordinates based on the strict non-paraxial refraction relationship considering the two refractions from the outer medium to the polypropylene pipe wall and from the polypropylene pipe wall to the inner medium. The conical segment establishes a lateral correction and vertical displacement compensation mapping based on the vector refraction relationship of the inclined interface on the basis of local radius changes, and completes the partitioned geometric correction by combining the pipe axis inclination angle to obtain the geometric correction image. The output module is used to perform restoration processing on the geometrically corrected image and output the final corrected image and the corresponding self-calibrated geometric parameters.
9. A computer storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1-7.
10. A computer device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, the processor executing the program to implement the method of any one of claims 1-7.
Citation Information
Patent Citations
High-precision automatic analyzer and water quality analysis method
CN118624543A
Automatic refraction distortion correction method and system for SPIV experiment
CN121458594A