A fast parfocal method and device for magnified imaging system
By using heterochromatic point light sources and motion units in the magnified imaging system to calculate and adjust the sample to the parfocal plane, the problem of low parfocal accuracy and low efficiency in the existing technology is solved, and a fast and economical parfocal process is achieved, which is suitable for for a variety of microscopy systems.
Patent Information
- Application Number
- CN202111319974.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-09
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-11-09
AI Technical Summary
Existing magnified imaging systems require expensive external auxiliary facilities and high-precision ranging tools to achieve parfocality, and require high motion accuracy, resulting in high time consumption and high cost, and it is difficult to effectively estimate the ambiguity caused by diffraction effects in practical applications. .
Using a sample carrying unit, amplification unit and image acquisition unit with a common optical axis, two monochromatic channel images are acquired through heterochromatic point light source illumination, the offset and defocus distance are calculated, and the movement unit is used to quickly adjust the sample to the parfocal plane. And the offset calculation is optimized through the mutual information calculation method or the feature point matching method, combined with the light source spatial distribution evaluation and fitness evaluation to achieve fast parfocality.
There is no need to add expensive external facilities to achieve fast parfocality, reduce costs, and improve parfocal accuracy and efficiency. It is suitable for a variety of microscopy systems, including upright or inverted microscopy systems, transmission or reflection microscopy systems.
Smart Images

Figure CN114205519B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of digital pathological imaging, and in particular to a fast parfocal method and device for an amplified imaging system. Background Art
[0002] In the field of digital pathology, one of the important goals is to replace manual operations and to capture and record microscopic structures that have been magnified at high magnification without distortion.
[0003] like Figure 1 , Figure 2 As shown, the purpose of fast parfocality in the magnified imaging system is to accurately place the observed sample on the object plane of the optical magnification system on the optical axis (usually vertically up and down), so that the camera fixed on the designed image plane can capture a clear and sharp projection (i.e. parfocality) under the premise of unchanged magnification. If the sample leaves the object plane, the image captured by the camera will not only be blurred due to diffraction, but also cannot be reconstructed through calculation due to the loss of information. In order to achieve stronger optical resolution, the microscope needs to use an objective lens with a very high numerical aperture, so that the depth of field is very shallow, and therefore the motion accuracy of the focus is very high.
[0004] Existing solutions generally apply one of the following principles:
[0005] 1. Maximum contrast method. In the parfocal state, the diffraction effect is minimal, the degree of "blur" is also the lowest, that is, the contrast is the highest. Therefore, by comparing the contrast at different positions, the distance of parfocality can be found. Representative inventions include 201610508675.6 and 201510961654.5. However, the degree of "blur" at a certain distance cannot reveal its distance and direction from the parfocal position, so it is often necessary to explore and compare the sharpness on many planes to find the parfocal position, which takes a lot of time.
[0006] 2. Diffraction effect estimation method. The defocus distance is estimated by estimating certain indicators of the concentric point spread function distribution caused by the diffraction effect. Representative inventions include 201510330496.3. In practical applications, the diffraction effect image is greatly interfered by the sample image itself and is difficult to estimate. If the defocus degree is slightly higher, it will appear as a uniform, continuous blur, which cannot be estimated.
[0007] 3. Distance measurement method: Use ultra-high precision distance measurement tools to measure the distance from the sample to a preset position (usually a point on the optical path). Such distance measurement tools are expensive and have a low upper limit of accuracy, such as 201610589541.1 and 201510239075.X.
[0008] 4. Phase difference method. Use a semi-transparent and semi-reflective mirror to divide the optical path into multiple "copies", and the design "image" plane of each copy is the same. Placing a secondary imaging element in front of or behind the design image plane of each copy is approximately equivalent to measuring the contrast at multiple distances at the same time. For uniform and continuous samples, the change in the parfocal distance of the sample is also uniform and continuous. When in focus, the contrast of the main imaging element is higher than that of the secondary imaging element; when out of focus to a certain extent, the contrast of a certain secondary imaging element will be higher than that of the main imaging element and other imaging elements. In this way, by comparing the contrast of each imaging element, the change in the parfocal distance can be monitored and the corresponding compensation movement can be performed. The complexity of such an optical system is greatly increased, and there is also the problem of consistency between the "mirror" optical paths, and the cost is relatively high. Summary of the invention
[0009] The technical problem to be solved by the present invention is to provide a method and a device capable of quickly achieving parfocality of a magnified imaging system without adding expensive external auxiliary facilities.
[0010] The technical solution (I) proposed by the present invention to solve the above technical problems is: a fast parfocal method of a magnified imaging system, the system comprising a sample carrying unit, a magnifying unit and an image acquisition unit on a common optical axis, and also comprising a motion unit, the motion unit being suitable for driving the sample carrying unit and / or the magnifying unit to reciprocate along its optical axis,
[0011] The method comprises the following characteristic steps:
[0012] Acquire two monochromatic channel images A and B corresponding to the sample under the illumination of a pair of heterochromatic point light sources, wherein the illumination points of the pair of heterochromatic point light sources are respectively located on both sides of the optical axis of the imaging element;
[0013] The offset p between the two images is calculated by using the image A and the image B, and the defocus distance l of the current distance between the sample and the target focal plane of the amplification unit, that is, the target movement value h, is calculated according to the offset p;
[0014] The sample is placed at the target parfocal plane of the magnification unit by the motion unit according to the target movement value h.
[0015] Furthermore, when calculating the offset p, the image likelihood values y of image A to image B or image B to image A after horizontally moving 1 to n pixels are exhaustively calculated, and the y values calculated each time are recorded, and the horizontal movement pixel value x corresponding to the highest y value is taken as the offset p.
[0016] Furthermore, when calculating the likelihood value y, based on the mutual information calculation method or the feature point matching method,
[0017] When based on the mutual information calculation method,
[0018] Consider grayscale images A and B. For each pixel value y1, the proportion of pixels in image A that have the value y1 is p. A (y1); for each pixel value y2, the proportion of pixels in image B that have the value y2 is p B (y2);
[0019] For each pair of pixel values (y1, y2), the ratio of two pixels with the same coordinates in images A and B to take y1 in image A and y2 in image B is p A,B (y1, y2), the mutual information of the two images is
[0020]
[0021] The mutual information between image A and the shifted image B can be calculated by the same formula for all pixel levels of image B. This is repeated to arrange the mutual information within the preset offset range, and the deviation likelihood curve is obtained.
[0022] The grayscale image input for mutual information calculation here can be either the original grayscale image of the monochrome channel or the image after gradient filtering or similar filtering operations. The typical gradient filtering method is to use the Laplacian operator, that is, the matrix Perform convolution operation with the original image;
[0023] Based on the feature point matching method,
[0024] SURF or SIFT feature point processing algorithms are used in images A and B respectively, and feature point description vectors are used to record the time-frequency domain characteristics of the pixels adjacent to the feature points.
[0025] After all the feature points of image B are aligned, the square of the difference between their description vectors and the feature points in image A in the adjacent position is calculated. If there is no adjacent position, the square of the difference is taken. Then the mean of the square of the difference is calculated and the inverse is taken to obtain the feature matching error of the two images. This process is repeated to arrange all the feature matching errors within the preset offset range to obtain the deviation likelihood curve.
[0026] Furthermore, when calculating the defocus distance l, it is performed by a table lookup method, and the table is preset.
[0027] When setting up the table, first search for the parfocal plane through general methods such as the maximum sharpness method, then operate the focus system to leave the focal plane a known distance, and then activate the point light source, image and calculate the offset. The known defocus distance l and the calculated offset p are recorded in the table, and then the above process is repeated to establish a corresponding table.
[0028] Furthermore, the system includes a combination of multiple pairs of heterochromatic point light sources with different spacing distributions. After calculating the offset p, the spatial distribution of the light source is evaluated, and the subsequent optional steps are performed according to the evaluation results. During the evaluation,
[0029] If the absolute value |p| of the offset p is between a preset lower threshold μmin and a preset upper threshold μmax, the activated point light source is suitable;
[0030] If |p| is less than the lower threshold μmin, it means that the current defocus distance is short, and a combination of heterochromatic point light sources with a larger spacing is selected, and all steps are executed again;
[0031] If |p| is greater than the upper threshold μmax, it is known that the current defocus distance is greater than the measurement range, and a pair of heterochromatic point light sources with a smaller spacing is selected and all steps are executed again.
[0032] Furthermore, the system includes a plurality of pairs of heterochromatic point light sources having different contrast color combinations,
[0033] The method also includes evaluating whether the sample matches the color of the current light sources O and P, and performing subsequent optional steps according to the evaluation result.
[0034] For the n recorded y values, obtain several local maxima {S Max,i}, the median S is obtained by statistics Med and the standard fourth-order central moment (i.e. the ratio of the fourth-order central moment to the square of the variance) S krt ;
[0035] In calculating the local maximum {S Max,i}, for every 1<x<N-1, if f(x-1)<f(x) and f(x+1)<f(x), then this x is a local maximum;
[0036] In calculating the median S Med When y is arranged from small to large, if n is an odd number, the y arranged at the (n+1) / 2th position is taken as the median; if n is an even number, the average of the two y arranged at the n / 2th and n / 2+1th positions is taken as the median;
[0037] In calculating the standard fourth-order central moment S krt When y=f(x) is regarded as a marginal probability distribution curve, its standard fourth-order center distance is calculated. First, its mean is calculated. Recalculate the variance Finally, the standard fourth-order center distance is calculated,
[0038] Take {S Max,1 The maximum value SMax,0 , the second largest value S Max,1 , calculate the first sample fitness and the second sample fitness
[0039] If both the first sample fitness and the second sample fitness are higher than the preset threshold, no light source switching operation is performed;
[0040] If either the first sample fitness degree or the second sample fitness degree is lower than the preset threshold, and there is an alternative light source combination solution, select to start the alternative light source solution, and re-execute all steps again;
[0041] If either the first sample fitness or the second sample fitness is lower than the preset threshold and there is no alternative light source pair combination, the light source pair combination with the highest historical first sample fitness and second sample fitness is selected and the remaining steps in the fast focusing method are implemented.
[0042] The technical solution (II) proposed by the present invention to solve the above technical problems is: a fast parfocal device of a magnifying imaging system, the magnifying imaging system comprising a sample carrying unit, a magnifying unit, an image acquisition unit, a motion unit and a central control unit on a common optical axis, the motion unit being suitable for driving the sample carrying unit and / or the magnifying unit to reciprocate along its optical axis, the controlled ends of the image acquisition unit and the motion unit being connected to the control end of the central control unit;
[0043] The fast parfocal device comprises a point light source unit,
[0044] The point light source unit comprises at least one pair of heterochromatic point light sources, any of which emits monochromatic light, the luminous colors of the pair of heterochromatic point light sources are different and contrasting, and the irradiation points of the pair of heterochromatic point light sources are respectively located on both sides of the optical axis of the imaging element; the point light source unit also comprises a point light source control module, which is suitable for controlling the point light source to switch on and off;
[0045] The central control unit includes a deviation calculation module
[0046] The central control unit is adapted to control the image acquisition unit to acquire two monochrome channel images A and B corresponding to the sample under the illumination of the pair of heterochromatic point light sources;
[0047] The deviation calculation module is adapted to calculate the offset p between the two images through the image A and the image B, and calculate the defocus distance l of the current sample from the target focal plane according to the offset p, that is, the target movement value h;
[0048] The central control unit is adapted to control the motion unit to place the sample at the parfocal plane of the magnification unit according to the target movement value h.
[0049] Furthermore, when calculating the offset p, the deviation calculation module exhaustively calculates the image likelihood values y of image A to image B or image B to image A after horizontally moving 1 to n pixels, and records the y values calculated each time, and takes the horizontally moved pixel value x corresponding to the highest y value as the offset, specifically based on the mutual information calculation method or the feature point matching method.
[0050] When based on the mutual information calculation method,
[0051] Consider grayscale images A and B. For each pixel value y1, the proportion of pixels in image A that have the value y1 is p. Λ (y1); for each pixel value y2, the proportion of pixels in image B that have the value y2 is p B (y2);
[0052] For each pair of pixel values (y1, y2), the ratio of two pixels with the same coordinates in images A and B to take y1 in image A and y2 in image B is p A,B (y1, y2), the mutual information of the two images is
[0053]
[0054] The mutual information between image A and the shifted image B can be calculated by the same formula for all pixel levels of image B. This is repeated to arrange the mutual information within the preset offset range, and the deviation likelihood curve is obtained.
[0055] The grayscale image input for mutual information calculation here can be either the original grayscale image of the monochrome channel or the image after gradient filtering or similar filtering operations. The typical gradient filtering method is to use the Laplacian operator, that is, the matrix Perform convolution operation with the original image;
[0056] Based on the feature point matching method,
[0057] SURF or SIFT feature point processing algorithms are used in images A and B respectively, and feature point description vectors are used to record the time-frequency domain characteristics of the pixels adjacent to the feature points.
[0058] After all the feature points of image B are aligned, the square of the difference between their description vectors and the feature points in image A in the adjacent position is calculated. If there is no adjacent position, the square of the difference is taken. Then the mean of the square of the difference is calculated and the inverse is taken to obtain the feature matching error of the two images. This process is repeated to arrange all the feature matching errors within the preset offset range to obtain the deviation likelihood curve.
[0059] Furthermore, the point light source unit includes a plurality of pairs of heterochromatic point light sources distributed at different intervals.
[0060] The central control unit further comprises a light source spatial distribution evaluation module, which is adapted to evaluate the interval relationship between the calculated absolute value |p| of the offset p and a preset lower threshold μmin and a preset upper threshold μmax.
[0061] If |p| is between the preset lower threshold μmin and the preset upper threshold μmax, the activated point light source is suitable;
[0062] If |p| is less than the lower threshold μmin, it is known that the current defocus distance is short, and the central control unit selects to turn on a combination of heterochromatic point light sources with a larger spacing through the point light source control module, and re-performs the parfocal plane detection;
[0063] If |p| is greater than the upper threshold value μmax, it can be known that the current defocus distance is greater than the measurement range. The central control unit selects to turn on a pair of heterochromatic point light sources with a smaller spacing through the point light source control module and re-performs the parfocal plane detection.
[0064] Furthermore, the point light source unit includes a plurality of pairs of heterochromatic point light sources with different contrast color combinations.
[0065] The central control unit also includes a sample light source color matching evaluation module, which is suitable for evaluating whether the sample matches the current light source O and P.
[0066] For the n recorded y values, obtain several local maxima {S Max,i}, the median S is obtained by statistics Med and the standard fourth-order central moment (i.e. the ratio of the fourth-order central moment to the square of the variance) S krt ;
[0067] In calculating the local maximum {S Max,i}, for every 1<x<N-1, if f(x-1)<f(x) and f(x+1)<f(x), then this x is a local maximum;
[0068] In calculating the median S Med When y is arranged from small to large, if n is an odd number, the y arranged at the (n+1) / 2th position is taken as the median; if n is an even number, the average of the two y arranged at the n / 2th and n / 2+1th positions is taken as the median;
[0069] In calculating the standard fourth-order central moment S krt When y=f(x) is regarded as a marginal probability distribution curve, its standard fourth-order center distance is calculated. First, its mean is calculated. Recalculate the variance Finally, the standard fourth-order center distance is calculated,
[0070] Take {S Max,i The maximum value S Max,0 , the second largest value S Max,1 , calculate the first sample fitness and the second sample fitness
[0071] If both the first sample fitness and the second sample fitness are higher than the preset threshold, no light source switching operation is performed;
[0072] If either the first sample fitness degree or the second sample fitness degree is lower than the preset threshold, and there is an alternative light source combination scheme, the central control unit selects to start the alternative light source scheme through the point light source control module, and re-performs the parfocal plane detection;
[0073] If either the first sample fitness or the second sample fitness is lower than the preset threshold and there is no alternative light source pair combination, the light source pair combination with the highest historical first sample fitness and second sample fitness is selected and re-focus plane detection is performed.
[0074] The beneficial effects of the present invention are:
[0075] Through the method and system of the present invention, it is possible to quickly perform focal plane detection, and the sample can be quickly placed in the focal position of the magnifying imaging system through the motion mechanism. In terms of hardware, the components such as the microscope objective lens and the imaging element are not changed, and the white light source used to collect the microscopic image is not changed. It is only necessary to add a monochromatic point light source and a corresponding control module. This system can be used in a variety of microscopic systems: upright or inverted microscopic systems, and transmission or reflection microscopic systems. The pixels of the imaging element can be arranged in a common rectangle.
[0076] The technical solution of the present invention utilizes the characteristic that when the sample is out of focus, an offset imaging will occur under the illumination of a biased point light source. The point light sources offset on both sides of the optical axis of the imaging element are cleverly set to illuminate the sample simultaneously or successively to obtain offset imaging of different degrees, and the distance that should be moved up and down to the focal plane (corresponding to the positive and negative numbers of the offset) is calculated according to the offset degree, so as to finally achieve accurate focusing. BRIEF DESCRIPTION OF THE DRAWINGS
[0077] The rapid parfocal method and device of the magnifying imaging system of the present invention will be further described below in conjunction with the accompanying drawings.
[0078] Figure 1 It is a block diagram of the structural modules of the classic magnified imaging system;
[0079] Figure 2 yes Figure 1 Schematic diagram of the magnified imaging working principle of the system;
[0080] Figure 3 This is a schematic diagram of the positional offset of the image when the point light source is biased to the left of the central axis and the sample is below the parfocal plane;
[0081] Figure 4 This is a schematic diagram of the position of the image when the point light source is on the left side of the central axis and the sample is on the parfocal plane;
[0082] Figure 5 This is a schematic diagram of the positional offset of the image when the point light source is biased to the left of the central axis and the sample is above the parfocal plane;
[0083] Figure 6 This is a schematic diagram of the positional offset of the image when the point light source is offset to the right of the central axis and the sample is below the parfocal plane;
[0084] Figure 7 is a schematic diagram of the displacement of the imaging when the sample is below the parfocal plane when a pair of heterochromatic point light sources are used in the first embodiment;
[0085] Figure 8 Yes Figure 7 Simulation diagram of the optical path;
[0086] Fig. 9 is a schematic diagram of the displacement of the imaging when the sample is above the parfocal plane when a pair of heterochromatic point light sources are used in the first embodiment;
[0087] Fig.10 Yes Fig. 9 Simulation diagram of the optical path
[0088] Fig.11 It is a structural block diagram of a further optimization scheme of the fast parfocal device;
[0089] Fig.12 is a logic flow chart of the rapid parfocal method in Embodiment 1;
[0090] Fig.13 It is a logical flow chart for the evaluation of the spatial distribution of light sources;
[0091] Fig.14 It is a logic flow chart for evaluating the suitability of light source samples;
[0092] Fig.15 is a schematic diagram of the distribution of point light sources when there are multiple pairs of point light sources in Embodiment 1;
[0093] Fig.16 It is a structural schematic diagram of a reflective magnifying imaging system;
[0094] Fig.17 It is a structural schematic diagram of an inverted magnifying imaging system. DETAILED DESCRIPTION
[0095] Embodiment 1
[0096] The present embodiment relates to a rapid parfocal method for a magnifying imaging system, wherein the magnifying imaging system includes a sample-carrying unit, a magnifying unit, and an image acquisition unit (i.e., an imaging element) on a common optical central axis (referred to as the central axis or optical axis), and also includes a motion unit, which is suitable for driving the sample-carrying unit and / or the magnifying unit to reciprocate along its optical axis.
[0097] By applying the method in this embodiment, in terms of hardware, there is no need to change components such as the microscope objective lens and the imaging element, nor is there any need to change the white light source used to collect microscopic images. It is only necessary to add multiple monochromatic point light sources and corresponding control modules. The spectrum of these monochromatic light sources is narrower but does not need to be strictly single frequency like a laser, that is, it is sufficient to satisfy the relative characteristics described later. Every two monochromatic point light sources with different luminous colors can be configured as a pair. To improve performance and simplify calculations, the irradiation points of a pair of heterochromatic point light sources are located on both sides of the optical axis of the imaging element and are symmetrical with the optical center axis of the imaging element, but this form is not strictly required. In this embodiment, if Fig.15 As shown, there are 12 monochromatic point light sources, which are configured into 6 groups (ie, A1A2, B1B2, etc.), and the monochromatic point light sources in each group are distributed in a mirror-symmetrical manner about the central axis of the imaging element.
[0098] like Figure 1 , Figure 2 As shown in the figure, when a point light source with a wide emission angle illuminates the sample, an "image" of the sample is generated on the imaging element. When the sample is at the parfocal distance of the magnifying unit (that is, conjugate with the imaging element), the "image" is sharpest (that is, in focus). At this time, on the one hand, according to the basic principles of geometric optics, no matter how the light source is located relative to the central axis of the optical path, the position of the "image" relative to the central axis of the optical path will not change. On the other hand, for an amplifying unit with a constant magnification and a constant image distance (that is, the distance between the imaging element and the principal point on the image side), its parfocal distance remains unchanged.
[0099] The inventors found that if Figure 3 , Figure 4 , Figure 5 , Figure 6 As shown in the figure, when the point light source deviates from the central axis but the position is fixed, and the sample is away from the parfocal distance, the deviation of the center of the "image" relative to the central axis is approximately linearly related to the defocus distance, that is, when the defocus distance increases, the deviation of the "image" increases, and when the sample is above or below the parfocal plane, the direction of the "image" deviation is opposite; when the sample deviates from the defocus plane but the defocus distance is fixed, the position of the point light source deviates from the central axis, and the deviation of the center of the "image" relative to the central axis deviates accordingly. In particular, when the light source deviates to one side, the "image" will deviate to the other side.
[0100] like Figure 7 , Figure 8 , Fig. 9 , Fig.10 As shown in the figure, if two point light sources that do not interfere with each other in imaging (typically two monochromatic lights, one red and one green, will form red and green "images" respectively) are placed at different positions relative to the optical axis (for example, on both sides of symmetry), when the two light sources are lit to form an image of a defocused sample, each will form an "image" that deviates from the central axis; even if the two images overlap, they are in different color channels and therefore do not interfere with each other, and become two independent images after separating their channels. By collecting the "image" formed by the imaging element and calculating the relative deviation relationship of the pair of "images" in the image, the defocus distance of the sample can be inferred.
[0101] like Fig.12 As shown, the method in this embodiment includes the following steps:
[0102] Step i: Obtain two monochromatic channel images A and B corresponding to the sample under the illumination of a pair of heterochromatic point light sources, the illumination points of the pair of heterochromatic point light sources are respectively located on both sides of the optical axis of the imaging element. Specifically, the acquisition is performed by the imaging element. The so-called heterochromatic refers to two monochromatic point light sources with different luminous colors.
[0103] More specifically, a pair of different-color point light sources emit red and green light respectively, and when the red and green lights illuminate the sample, the imaging element takes a picture. The total image after taking the picture is channel-separated to separate the grayscale images of the corresponding color channels, namely, image A and image B.
[0104] Step ii: The offset p between the two images is calculated by using the image A and the image B, and the defocus distance l of the current distance of the sample from the target focal plane of the magnification unit, ie, the target movement value h, is calculated according to the offset p.
[0105] It can be preferred that: when calculating the offset p, the image likelihood values y of image A to image B or image B to image A after horizontally moving 1 to n pixels are exhaustively calculated, and the y values calculated each time are recorded, and the horizontally moved pixel value x corresponding to the highest y value is taken as the offset p. During calculation, the positive or negative value of the offset p is determined according to different moving directions, so that the motion unit can be further controlled according to the positive or negative value in the future.
[0106] As a further preferred step, when calculating the likelihood value y, based on the mutual information calculation method or the feature point matching method,
[0107] When based on the mutual information calculation method,
[0108] Consider grayscale images A and B. For each pixel value y1, the proportion of pixels in image A that have the value y1 is p. A (y1); for each pixel value y2, the proportion of pixels in image B that have the value y2 is p B (y2);
[0109] For each pair of pixel value combinations (y1, y2), the ratio of the two pixels with the same coordinates in images A and B, where y1 is taken from image A and y2 is taken from image B, is p A,B (y1, y2), the mutual information between the two images is
[0110]
[0111] If all the pixels of image B are arranged horizontally, the mutual information between image A and the shifted image B can be calculated using the same formula. Repeating this process and arranging the mutual information within all the preset offset ranges will yield the deviation likelihood curve
[0112] Here, the grayscale image input for mutual information calculation can be either the original single-channel grayscale image or the image after gradient filtering or similar filtering operations. A typical gradient filtering method is to use the Laplacian operator, i.e., the matrix to perform a convolution operation with the original image
[0113] When using the feature point matching method
[0114] In images A and B, the SURF or SIFT feature point processing algorithm is used respectively, and the feature point description vector is used to record the time-frequency domain characteristics of the pixels adjacent to the feature points
[0115] After all the feature points of image B are arranged horizontally, calculate the square of the difference between the description vectors of each feature point in image A within the adjacent positions. If there is no adjacent point, take the square of itself. Then calculate the mean of these squared differences and take the reciprocal to obtain the feature matching error between the two images. Repeating this process and arranging the feature matching errors within all the preset offset ranges will yield the deviation likelihood curve
[0116] Theoretically, the results of the above two algorithms are the same, but their computational complexity characteristics are different: the computational complexity of the algorithm based on mutual information is proportional to the search range and increases rapidly; the computational complexity of the algorithm based on feature point matching has a part that is independent of the search range and a part that increases slightly with the growth of the search range. Therefore, if the known offset is small, the algorithm based on mutual information can be performed only within a small range to save computational complexity; if the offset is uncertain or large, the algorithm based on feature point matching can save computational complexity
[0117] According to the aforementioned definition, the results obtained by both algorithms are curves, which can be represented as y = f(x) respectively, where x is the relative offset pixel number and y is the likelihood at that offset pixel number. The obtained deviation likelihood curve should be a curve shaped like a "V". The deviation corresponding to the maximum likelihood in the curve is the relative offset of the "image"
[0118] In addition, it is preferred that: when calculating the defocus distance l according to the offset p, it is specifically performed by a table lookup method, and the table is preset.
[0119] When setting up the table, first search for the parfocal plane through general methods such as the maximum sharpness method, then operate the focus system to leave the focal plane a known distance, and then activate the paired point light sources, image and calculate the offset. The known defocus distance l and the calculated offset p are recorded in the table, and then the above process is repeated to establish a corresponding table.
[0120] Alternatively, a pre-modeling method may be used, that is, the above-mentioned lookup table is fitted into a model curve, and then the defocus distance is calculated by the model curve and the obtained offset. The model may be a linear model, which will not be described in detail here.
[0121] Step iii: The sample is placed into the target parfocal plane of the magnification unit by the motion unit according to the target movement value h.
[0122] It can be preferred that: after step ii, if the system includes a plurality of pairs of heterochromatic point light sources with different spacing distributions, after calculating the offset p, the spatial distribution of the light sources is evaluated, and the subsequent optional steps are performed according to the evaluation results. Fig.13 As shown, when evaluating,
[0123] If the absolute value |p| of the offset p is between a preset lower threshold μmin and a preset upper threshold μmax, the activated point light source is suitable;
[0124] If |p| is less than the lower threshold μmin, it means that the current defocus distance is short, and a combination of heterochromatic point light sources with a larger spacing is selected, and all steps are executed again;
[0125] If |p| is greater than the upper threshold μmax, it is known that the current defocus distance is greater than the measurement range, and a pair of heterochromatic point light sources with a smaller spacing is selected and all steps are executed again.
[0126] It can be preferred that: after step ii, if the system includes a plurality of pairs of heterochromatic point light sources with different contrast color combinations,
[0127] The method also includes evaluating whether the sample matches the color of the current light source O and P, and performing subsequent optional steps based on the evaluation results. Fig.14 As shown, during the evaluation, for the n recorded y values, several local maxima {S Max,i}, the median S is obtained by statistics Med and the standard fourth-order central moment (i.e. the ratio of the fourth-order central moment to the square of the variance) S krt .
[0128] In calculating the local maximum {S Max,i}, for every 1<x<N-1, if f(x-1)<f(x) and f(x+1)<f(x), then this x is a local maximum.
[0129] In calculating the median S Med When , arrange the y from small to large. If n is an odd number, take the y arranged at the (n+1) / 2th position as the median; if n is an even number, take the average of the two y arranged at the n / 2th and n / 2+1th positions as the median.
[0130] In calculating the standard fourth-order central moment S krt When y=f(x) is regarded as a marginal probability distribution curve, its standard fourth-order center distance is calculated. First, its mean is calculated. Recalculate the variance Finally, the standard fourth-order center distance is calculated,
[0131] Take {S Max,i The maximum value S Max,0 , the second largest value S Max,1 , calculate the first sample fitness and the second sample fitness
[0132] If the first sample matching degree and the second sample matching degree are both higher than the preset threshold, the light source switching operation is not performed.
[0133] If either the first sample fitness or the second sample fitness is lower than a preset threshold, and there is an alternative light source combination solution, the alternative light source solution is selected to be started, and all steps are executed again.
[0134] If either the first sample fitness or the second sample fitness is lower than a preset threshold and there is no alternative light source pair combination, the light source pair combination with the highest historical first sample fitness and second sample fitness is selected and the remaining steps in the fast focusing method are implemented.
[0135] In addition, Fig.16 , Fig.17 As shown, the method in this embodiment can be used to implement the rapid focusing process for both upright or inverted transmission or reflection microscope systems.
[0136] Embodiment 2
[0137] This embodiment is based on the method and technical solution disclosed in the first embodiment and relates to a fast parfocal device for a magnified imaging system.
[0138] The magnified imaging system includes a sample-carrying unit, a magnifying unit, an image acquisition unit, a motion unit and a central control unit on a common optical axis. The motion unit is suitable for driving the sample-carrying unit and / or the magnifying unit to reciprocate along its optical axis. The controlled ends of the image acquisition unit and the motion unit are connected to the control end of the central control unit.
[0139] The image acquisition unit includes an imaging element, an image acquisition and channel separation module, and the motion unit includes a motion mechanism and a motion control module.
[0140] The fast parfocal device comprises a point light source unit. The point light source unit comprises at least one pair of heterochromatic point light sources, any one of which emits monochromatic light, the luminous colors of the pair of heterochromatic point light sources are different and contrasting, and the irradiation points of the pair of heterochromatic point light sources are respectively located on both sides of the optical axis of the imaging element; the point light source unit also comprises a point light source control module, which is suitable for controlling the point light source to switch on and off.
[0141] The central control unit is adapted to control the image acquisition unit to obtain two monochrome channel images A and B corresponding to the sample under the illumination of a pair of heterochromatic point light sources. More specifically, the pair of heterochromatic point light sources emit red and green light respectively, and when the red and green lights illuminate the sample, the imaging element takes a picture. The total image after taking the picture is channel-separated to separate the grayscale images of the corresponding color channels, namely, images A and B.
[0142] The central control unit comprises a deviation calculation module. The deviation calculation module is adapted to calculate the offset p between the two images through the image A and the image B.
[0143] The central control unit calculates the defocus distance l of the current sample from the target focal plane according to the offset p, that is, the target movement value h. The specific calculation of this step is performed by the defocus distance calculation module in the central control unit. The calculation method of this step refers to the relevant part of Example 1 and will not be repeated here.
[0144] The central control unit is adapted to control the motion unit to place the sample at the parfocal plane of the magnification unit according to the target movement value h.
[0145] It can be preferred that: when calculating the offset p, the deviation calculation module exhaustively calculates the image likelihood values y of image A to image B or image B to image A after horizontally moving 1 to n pixels, and records the y values calculated each time, and takes the horizontal movement pixel value x corresponding to the highest y value as the offset.
[0146] Specifically based on mutual information calculation method or feature point matching method,
[0147] When based on the mutual information calculation method,
[0148] Consider grayscale images A and B. For each pixel value y1, the proportion of pixels in image A that have the value y1 is p. A (y1); for each pixel value y2, the proportion of pixels in image B that have the value y2 is p B (y2);
[0149] For each pair of pixel values (y1, y2), the ratio of two pixels with the same coordinates in images A and B to take y1 in image A and y2 in image B is p A,B (y1, y2), the mutual information of the two images is
[0150]
[0151] The mutual information between image A and the shifted image B can be calculated by the same formula for all pixel levels of image B. This is repeated to arrange the mutual information within the preset offset range, and the deviation likelihood curve is obtained.
[0152] The grayscale image input for mutual information calculation here can be either the original grayscale image of the monochrome channel or the image after gradient filtering or similar filtering operations. The typical gradient filtering method is to use the Laplacian operator, that is, the matrix Perform convolution operation with the original image;
[0153] Based on the feature point matching method,
[0154] SURF or SIFT feature point processing algorithms are used in images A and B respectively, and feature point description vectors are used to record the time-frequency domain characteristics of the pixels adjacent to the feature points.
[0155] After all the feature points of image B are aligned, the square of the difference between their description vectors and the feature points in image A in the adjacent position is calculated. If there is no adjacent position, the square of the difference is taken. Then the mean of the square of the difference is calculated and the inverse is taken to obtain the feature matching error of the two images. This process is repeated to arrange all the feature matching errors within the preset offset range to obtain the deviation likelihood curve.
[0156] It may be preferred that the point light source unit comprises a plurality of pairs of point light sources of different colors distributed at different intervals.
[0157] The central control unit also includes a light source spatial distribution evaluation module, which is suitable for evaluating the interval relationship between the calculated absolute value |p| of the offset p and a preset lower threshold μmin and a preset upper threshold μmax.
[0158] If |p| is between the preset lower threshold μmin and the preset upper threshold μmax, the activated point light source is suitable;
[0159] If |p| is less than the lower threshold μmin, it is known that the current defocus distance is short, and the central control unit selects to turn on a combination of heterochromatic point light sources with a larger spacing through the point light source control module, and re-performs the parfocal plane detection;
[0160] If |p| is greater than the upper threshold value μmax, it can be known that the current defocus distance is greater than the measurement range. The central control unit selects to turn on a pair of heterochromatic point light sources with a smaller spacing through the point light source control module and re-performs the parfocal plane detection.
[0161] It can be preferred that: the point light source unit includes a plurality of pairs of heterochromatic point light sources with different contrast color combinations,
[0162] The central control unit also includes a sample light source color matching evaluation module, which is suitable for evaluating whether the sample matches the current light source O and P.
[0163] For the n recorded y values, obtain several local maxima {S Max,i}, the median S is obtained by statistics Med and the standard fourth-order central moment (i.e. the ratio of the fourth-order central moment to the square of the variance) S krt ;
[0164] In calculating the local maximum {S Max,i}, for every 1<x<N-1, if f(x-1)<f(x) and f(x+1)<f(x), then this x is a local maximum;
[0165] In calculating the median S Med When y is arranged from small to large, if n is an odd number, the y arranged at the (n+1) / 2th position is taken as the median; if n is an even number, the average of the two y arranged at the n / 2th and n / 2+1th positions is taken as the median;
[0166] In calculating the standard fourth-order central moment S krt When y=f(x) is regarded as a marginal probability distribution curve, its standard fourth-order center distance is calculated. First, its mean is calculated. Recalculate the variance Finally, the standard fourth-order center distance is calculated,
[0167] Take {S Max,i The maximum value S Max,0 , the second largest value S Max,1 , calculate the first sample fitness and the second sample fitness
[0168] If the first sample fitness and the second sample fitness are both higher than the preset threshold, the light source switching operation is not performed;
[0169] If either the first sample fitness or the second sample fitness is lower than a preset threshold, and there is an alternative light source combination scheme, the central control unit selects to start the alternative light source scheme through the point light source control module and re-performs the parfocal plane detection;
[0170] If either the first sample fitness or the second sample fitness is lower than a preset threshold and there is no alternative light source pair combination, the light source pair combination with the highest historical first sample fitness and second sample fitness is selected and the parfocal plane detection is performed again.
[0171] The present invention is not limited to the above embodiments. The technical solutions of the above embodiments of the present invention can be cross-combined with each other to form new technical solutions. In addition, all technical solutions formed by equivalent replacement fall within the protection scope required by the present invention.
Claims
1. A fast parfocal method for a magnified imaging system, the system comprising a sample carrying unit, a magnifying unit and an image acquisition unit on a common optical axis, and also comprising a motion unit, the motion unit being adapted to drive the sample carrying unit and / or the magnifying unit to reciprocate along its optical axis, The method comprises The following characteristic steps: Acquire two monochromatic channel images A and B corresponding to the sample under the illumination of a pair of heterochromatic point light sources, wherein the illumination points of the pair of heterochromatic point light sources are respectively located on both sides of the optical axis of the imaging element; Calculate the offset p between the two images through the image A and the image B, and calculate the defocus distance l of the current sample from the target focal plane of the amplification unit according to the offset p, that is, the target movement value h; The motion unit places the sample into the target parfocal plane of the magnification unit according to the target movement value h, When calculating the offset p, exhaustively calculate the image likelihood values y of image A to image B or image B to image A after horizontally moving 1 to n pixels, and record the y values calculated each time, and take the horizontal movement pixel value x corresponding to the highest y value as the offset p. The system comprises a plurality of pairs of heterochromatic point light sources with different contrast color combinations, The method also includes evaluating whether the sample matches the color of the current light sources O and P, and performing subsequent optional steps according to the evaluation result. For the n recorded y values, obtain several local maxima {S Max,i }, the median S is obtained by statistics Med The standard fourth-order central moment is the ratio of the fourth-order central moment to the square of the variance S krt ; When calculating the local maximum value {S Max,i}, for each 1 < x < n - 1, if f(x - 1) < f(x) and f(x + 1) < f(x), then this x is a local maximum value; In calculating the median S Med When y is arranged from small to large, if n is an odd number, the y arranged at the (n+1) / 2th position is taken as the median; if n is an even number, the average of the two y arranged at the n / 2th and n / 2+1th positions is taken as the median; In calculating the standard fourth-order central moment S krt When y=f(x) is regarded as a marginal probability distribution curve, its standard fourth-order center distance is calculated. First, its mean is calculated. Recalculate the variance Finally, the standard fourth-order center distance is calculated, Take {S Max,i The maximum value S Max,0 , the second largest value S Max,1 , calculate the first sample fitness and the second sample fitness If both the first sample fitness and the second sample fitness are higher than the preset threshold, no light source switching operation is performed; If either the first sample fitness degree or the second sample fitness degree is lower than the preset threshold, and there is an alternative light source combination solution, select to start the alternative light source solution, and re-execute all steps again; If either the first sample fitness or the second sample fitness is lower than the preset threshold and there is no alternative light source pair combination, the light source pair combination with the highest historical first sample fitness and second sample fitness is selected and the remaining steps in the fast focusing method are implemented.
2. The fast parfocal method of the magnified imaging system according to claim 1, Features: When calculating the likelihood value y, based on the mutual information calculation method or the feature point matching method, When based on the mutual information calculation method, Consider grayscale images A and B, for each pixel value y 1 , the proportion of pixels in image A taking value y1 is p A (y 1 ); For each pixel value y 2 , the proportion of pixels in image B taking value y2 is p B (y 2 ); For each pair of pixel values (y1, y2), the ratio of two pixels with the same coordinates in images A and B to take y1 in image A and y2 in image B is p A,B (y 1 ,y 2 ), the mutual information of the two images is All pixels of image B are horizontally shifted, and the mutual information between image A and the shifted image B is calculated using the same formula. This process is repeated, and the mutual information within the preset offset range is arranged to obtain the deviation likelihood curve. The grayscale image input for mutual information calculation here is the original grayscale image of the monochrome channel or the image after gradient filtering. The typical gradient filtering method is to use the Laplacian operator, that is, the matrix Perform convolution operation with the original image; Based on the feature point matching method, SURF or SIFT feature point processing algorithms are used in images A and B respectively, and feature point description vectors are used to record the time-frequency domain characteristics of the pixels adjacent to the feature points. After horizontally shifting all feature points of image B, calculate the square difference between the description vector of each feature point in image A in the adjacent position. If there is no adjacent point, take the square of itself, then calculate the mean of the square difference and take the inverse to get the feature matching error of the two images. Repeat this process and arrange all feature matching errors within the preset offset range to get the deviation likelihood curve. The likelihood curve has the y value as the ordinate value and the x value as the abscissa value.
3. The fast parfocal method of the magnified imaging system according to claim 1, Features: When calculating the defocus distance l, it is done by looking up a table, and the table is preset. When setting up the table, first search and find the focal plane by a general method, which includes the maximum sharpness method, Then operate the focusing system to leave the focal plane a known distance, activate the point light source, image and calculate the offset, record the known defocus distance l and the calculated offset p in the table, and then repeat the above process to establish a corresponding table.
4. The rapid parfocal method of the magnified imaging system according to claim 1, Features: The system includes a combination of multiple pairs of heterochromatic point light sources with different spacing distributions. After calculating the offset p, the spatial distribution of the light sources is evaluated, and subsequent optional steps are performed according to the evaluation results. When evaluating, If the absolute value |p| of the offset p is between a preset lower threshold μmin and a preset upper threshold μmax, the activated point light source is suitable; If |p| is less than the lower threshold μmin, it means that the current defocus distance is short, and a combination of heterochromatic point light sources with a larger spacing is selected, and all steps are executed again; If |p| is greater than the upper threshold μmax, it is known that the current defocus distance is greater than the measurement range, and a pair of heterochromatic point light sources with a smaller spacing is selected and all steps are executed again.
5. A fast parfocal device of a magnifying imaging system, the magnifying imaging system comprising a sample carrying unit, a magnifying unit, an image acquisition unit, a motion unit and a central control unit on a common optical axis, the motion unit being adapted to drive the sample carrying unit and / or the magnifying unit to reciprocate along its optical axis, the controlled ends of the image acquisition unit and the motion unit being connected to the control end of the central control unit; Features: The fast parfocal device comprises a point light source unit, The point light source unit comprises at least one pair of heterochromatic point light sources, any of which emits monochromatic light, the luminous colors of the pair of heterochromatic point light sources are mutually different and contrasting, and the irradiation points of the pair of heterochromatic point light sources are respectively located on both sides of the optical axis of the imaging element; the point light source unit further comprises a point light source control module, which is suitable for controlling the point light sources to switch on and off; The central control unit includes a deviation calculation module; The central control unit is adapted to control the image acquisition unit to acquire two monochrome channel images A and B corresponding to the sample under the illumination of the pair of heterochromatic point light sources; The deviation calculation module is adapted to calculate the offset p between the two images through the image A and the image B, and calculate the defocus distance l of the current sample from the target focal plane according to the offset p, that is, the target movement value h; The central control unit is adapted to control the motion unit to place the sample at the parfocal plane of the magnification unit according to the target movement value h, When calculating the offset p, the deviation calculation module exhaustively calculates the image likelihood values y of image A to image B or image B to image A after horizontally moving 1 to n pixels, and records the y values calculated each time, and takes the horizontally moved pixel value x corresponding to the highest y value as the offset, specifically based on the mutual information calculation method or the feature point matching method. When based on the mutual information calculation method, Consider grayscale images A and B, for each pixel value y 1 , the proportion of pixels in image A taking value y1 is p A (y 1 ); For each pixel value y 2 , the proportion of pixels in image B taking value y2 is p B (y 2 ); For each pair of pixel values (y1, y2), the ratio of two pixels with the same coordinates in images A and B to take y1 in image A and y2 in image B is p A,B (y 1 ,y 2 ), the mutual information of the two images is The mutual information between image A and the shifted image B can be calculated by the same formula for all pixel levels of image B. This is repeated to arrange the mutual information within the preset offset range, and the deviation likelihood curve is obtained. The grayscale image input for mutual information calculation here is the original grayscale image of the monochrome channel or the image after gradient filtering. The typical gradient filtering method is to use the Laplacian operator, that is, the matrix Perform convolution operation with the original image; Based on the feature point matching method, SURF or SIFT feature point processing algorithms are used in images A and B respectively, and feature point description vectors are used to record the time-frequency domain characteristics of the pixels adjacent to the feature points. After all the feature points of image B are aligned, the square difference between the description vector of each feature point in image A and the feature point in the adjacent position is calculated. If there is no adjacent point, the square of the feature point itself is taken, and then the mean of the square difference is calculated and the inverse is taken to obtain the feature matching error of the two images. This is repeated to arrange all feature matching errors within the preset offset range, and the deviation likelihood curve is obtained. The point light source unit includes a plurality of pairs of point light sources with different color contrast combinations. The central control unit also includes a sample light source color matching evaluation module, which is suitable for evaluating whether the sample matches the current light source O and P. For the n recorded y values, obtain several local maxima {S Max,i }, the median S is obtained by statistics Med The standard fourth-order central moment is the ratio of the fourth-order central moment to the square of the variance S krt ; When calculating the local maximum value {S Max,i}, for each 1 < x < n - 1, if f(x - 1) < f(x) and f(x + 1) < f(x), then this x is a local maximum value; In calculating the median S Med When y is arranged from small to large, if n is an odd number, the y arranged at the (n+1) / 2th position is taken as the median; if n is an even number, the average of the two y arranged at the n / 2th and n / 2+1th positions is taken as the median; In calculating the standard fourth-order central moment S krt When y=f(x) is regarded as a marginal probability distribution curve, its standard fourth-order center distance is calculated. First, its mean is calculated. Recalculate the variance Finally, the standard fourth-order center distance is calculated, Take {S Max,i The maximum value S Max,0 , the second largest value S Max,1 , calculate the first sample fitness and the second sample fitness If both the first sample fitness and the second sample fitness are higher than the preset threshold, no light source switching operation is performed; If either the first sample fitness degree or the second sample fitness degree is lower than the preset threshold, and there is an alternative light source combination scheme, the central control unit selects to start the alternative light source scheme through the point light source control module, and re-performs the parfocal plane detection; If either the first sample fitness or the second sample fitness is lower than the preset threshold and there is no alternative light source pair combination, the light source pair combination with the highest historical first sample fitness and second sample fitness is selected and re-focus plane detection is performed.
6. The fast parfocal device of the magnifying imaging system according to claim 5, Features: The point light source unit comprises a plurality of pairs of heterochromatic point light sources distributed at different intervals. The central control unit further comprises a light source spatial distribution evaluation module, which is adapted to evaluate the interval relationship between the calculated absolute value |p| of the offset p and a preset lower threshold μmin and a preset upper threshold μmax. If |p| is between the preset lower threshold μmin and the preset upper threshold μmax, the activated point light source is suitable; If |p| is less than the lower threshold μmin, it is known that the current defocus distance is short, and the central control unit selects to turn on a combination of heterochromatic point light sources with a larger spacing through the point light source control module, and re-performs the parfocal plane detection; If |p| is greater than the upper threshold value μmax, it can be known that the current defocus distance is greater than the measurement range. The central control unit selects to turn on a pair of heterochromatic point light sources with a smaller spacing through the point light source control module and re-performs the parfocal plane detection.
Citation Information
Patent Citations
Laser focusing device
CN104833484A
Automatic focusing microscope based on eccentric beam method and focusing method thereof
CN104932092A
Multi-magnification microscope fast focusing method applied to TFT-LCD detection
CN105938243A
Correction method based on multi-distance auto focusing
CN106896622A
High speed micro scanning dynamic focusing device and focusing tracking method
CN106019550A
