Disclosure of Invention
The application aims to provide a method and a device for quickly calibrating and positioning a focusing surface of a microscopic imaging system, so as to solve the problem of low precision caused by large error of the existing focusing algorithm.
In a first aspect, according to an embodiment of the present application, a method for quickly calibrating a focal plane of a microscopic imaging system is provided, including:
selecting four end points and a center point of a screen to be detected as calibration points, wherein the calibration points divide the screen to be detected into four plane areas;
establishing plane equations of the four plane areas;
and solving the plane equation to obtain a plane equation coefficient.
With reference to the first aspect, in a first implementable manner of the first aspect, the step of solving the plane equation to obtain the plane equation coefficients includes:
acquiring two adjacent endpoint convergence coordinates and a center point convergence coordinate of the screen to be detected;
and substituting the convergence coordinates of the two adjacent end points and the convergence coordinate of the central point into the plane equation to obtain a plane equation coefficient.
With reference to the first implementable manner of the first aspect, in a second implementable manner of the first aspect, the step of obtaining two adjacent endpoint convergence coordinates and a center point convergence coordinate of the screen to be detected includes:
moving the microscopic imaging system to the end point or the central point, and acquiring images at pulse intervals;
calculating the definition of the image;
selecting a position corresponding to the image with the highest definition as a focusing surface;
judging whether the image with the highest definition is the first image or the last image;
and if the highest-definition image is not the first image or the last image, selecting the position coordinate corresponding to the highest-definition image as a convergence coordinate.
With reference to the second implementable manner of the first aspect, in a third implementable manner of the first aspect, the step of obtaining two adjacent endpoint convergence coordinates and a center point convergence coordinate of the screen to be detected further includes:
if the image with the highest definition is the first image or the last image, amplifying the pulse skipping range and re-collecting the image;
and repeating the step of calculating the definition of the image until the position coordinate corresponding to the image with the highest definition is selected as a convergence coordinate.
In a second aspect, according to an embodiment of the present application, there is provided a method for positioning a microscopic imaging system in focus, including:
acquiring a defect coordinate of a to-be-focused point;
judging the plane area where the focus to be focused is located according to the defect coordinates;
and determining the distance between the point to be focused and the screen to be detected according to the plane equation of the plane area where the point to be focused is located and the defect coordinate.
In a third aspect, according to an embodiment of the present application, there is provided a device for quickly calibrating a focusing surface of a microscopic imaging system, including:
the calibration point selection unit is used for selecting four end points and a center point of a screen to be detected as calibration points, and the calibration points divide the screen to be detected into four plane areas;
the plane equation establishing unit is used for establishing plane equations of the four plane areas;
and the plane equation solving unit is used for solving the plane equation to obtain a plane equation coefficient.
With reference to the third aspect, in a first implementable manner of the third aspect, the plane equation solving unit includes:
the convergence coordinate acquisition unit is used for acquiring two adjacent endpoint convergence coordinates and a center point convergence coordinate of the screen to be detected;
and the plane equation solving subunit is used for substituting the two adjacent endpoint convergence coordinates and the central point convergence coordinate into the plane equation to obtain a plane equation coefficient.
With reference to the first implementable manner of the third aspect, in a second implementable manner of the third aspect, the converged coordinate acquisition unit includes:
the acquisition unit is used for moving the microscopic imaging system to the end point or the central point and acquiring images at pulse intervals;
a calculating unit for calculating the definition of the image;
the focusing surface selecting unit is used for selecting a position corresponding to the image with the highest definition as a focusing surface;
the judging unit is used for judging whether the image with the highest definition is the first image or the last image;
and the convergence coordinate selecting unit is used for selecting the position coordinate corresponding to the highest-definition image as a convergence coordinate if the highest-definition image is not the first image or the last image.
With reference to the second implementable manner of the third aspect, in a third implementable manner of the third aspect, the convergent coordinate acquisition unit further includes:
the amplifying unit is used for amplifying the pulse skipping range and re-collecting the image if the image with the highest definition is the first image or the last image;
and the repeated execution unit is used for repeatedly executing the step of calculating the definition of the image until the position coordinate corresponding to the image with the highest definition is selected as the convergence coordinate.
In a fourth aspect, according to an embodiment of the present application, a focus positioning apparatus for a microscopy imaging system includes:
the defect coordinate acquisition unit is used for acquiring the defect coordinate of the focus to be focused;
the judging unit is used for judging the plane area where the focus to be focused is located according to the defect coordinates;
and the determining unit is used for determining the distance between the to-be-focused point and the screen to be detected according to the plane equation of the plane area where the to-be-focused point is located and the defect coordinate.
According to the technical scheme, the embodiment of the application provides a method and a device for quickly calibrating and positioning a focusing surface of a micro-imaging system. The calibration method comprises the steps that four end points and a center point of a screen to be detected are selected as calibration points, and the calibration points divide the screen to be detected into four plane areas; establishing plane equations of the four plane areas; and solving the plane equation to obtain a plane equation coefficient. The focusing positioning method comprises the steps of obtaining a defect coordinate of a to-be-focused point; judging the plane area where the focus to be focused is located according to the defect coordinates; and determining the distance between the point to be focused and the screen to be detected according to the plane equation of the plane area where the point to be focused is located and the defect coordinate. According to the method, the screen to be measured is divided into four triangular areas, the four triangular areas are subjected to plane equation fitting respectively, when different coordinates need to be focused, the triangular areas where the points are located can be judged, corresponding equations are substituted, and a z value is obtained. The plane is changed into four triangles, so that the accumulated error caused by the distance is reduced, and the error of each point is reduced to the maximum extent due to the triangular plane, so that the phenomenon that the angle which is not involved is very fuzzy due to the fact that the plane is made in the whole area of the mobile phone screen is avoided, and the curved surface equation fitting is simplified.
Detailed Description
Under the condition that the camera is focused clearly, the R, G, B and W pixels of the camera are shot clearly; when the image is not shot at the focusing position, the R, G, B and W pixels are not clear. However, when more ambiguous, no matter what autofocus algorithm, it can be declared invalid because there is no accurate information for the algorithm to decide on the path.
Referring to fig. 1, an embodiment of the present application provides a method for quickly calibrating a focusing surface of a microscopic imaging system, including:
s11, selecting four end points and a center point of a screen to be detected as calibration points, wherein the calibration points divide the screen to be detected into four plane areas;
fig. 2 is a schematic diagram for dividing the plane area of the screen to be detected, as shown in fig. 2, points (i), (ii), (iii), (iv) and (iv) are four end points of the screen to be detected, respectively, and point (v) is a central point of the screen to be detected. Connecting the points I, II and V pairwise to form a plane area A; connecting the points I, II and V pairwise to form a plane area B; the third point, the fourth point and the fifth point are connected in pairs to form a plane area C; two points III and five points are connected to form a plane area D.
Step S12, establishing plane equations of the four plane areas;
establishing a plane equation x + α y + β z + ζ of the four plane areas as 0, wherein α, β, ζ is a constant and α, β are not zero at the same time.
And step S13, solving the plane equation to obtain a plane equation coefficient.
The coordinates of three points in each of the four planar regions are known, and the plane equation coefficients are obtained by substituting the three points of the plane into the plane equation. For example, the coordinates of the points (i), (ii) and (iv) of the plane a are known, and the plane a equation is solved by taking the coordinates of the points (i), (ii) and (iv) as three fixed points of the plane a equation, so as to obtain the plane a equation coefficients (α _ r, β _ r, ζ _ r).
It should be noted that the screens to be detected include, but are not limited to, a mobile phone screen, a tablet computer screen, and a computer monitor screen. The application does not limit the type of the screen to be detected.
According to the technical scheme, the embodiment of the application provides a method for quickly calibrating the focusing surface of the microscopic imaging system. The calibration method comprises the steps that four end points and a center point of a screen to be detected are selected as calibration points, and the calibration points divide the screen to be detected into four plane areas; establishing plane equations of the four plane areas; and solving the plane equation to obtain a plane equation coefficient. The screen to be tested is divided into four triangular areas, and plane equation fitting is carried out on the four triangular areas respectively. The plane is changed into four triangles, so that the accumulated error caused by the distance is reduced, and the error of each point is reduced to the maximum extent due to the triangular plane, so that the phenomenon that the angle which is not involved is very fuzzy due to the fact that the plane is made in the whole area of the mobile phone screen is avoided, and the curved surface equation fitting is simplified.
In some embodiments, the step of solving the plane equations to obtain the plane equation coefficients comprises:
acquiring two adjacent endpoint convergence coordinates and a center point convergence coordinate of the screen to be detected;
in the embodiment of the present application, the convergence coordinates refer to coordinates of a point where the clearest image is acquired at the end point or the center point. If the convergence coordinate is represented by (x, y, z), the x value and the y value of the end point or the central point are determined, and the point at which the image is acquired is clearest, namely the z value is determined, so that the convergence coordinate of the two adjacent end points and the convergence coordinate of the central point of the screen to be detected are obtained
And substituting the convergence coordinates of the two adjacent end points and the convergence coordinate of the central point into the plane equation to obtain a plane equation coefficient.
The three points can determine a plane, the two end point convergence coordinates and the center point convergence coordinates are substituted into the plane equation, the plane equation is solved, and the plane equation coefficient can be obtained.
For example, the convergence coordinates of the two end points (point (r) and point (c)) are (x _ r, y _ r, z _ r) and (x _ c, y _ c, z _ c), respectively, the convergence coordinate of the center point (c) is (x _ c, y _ c, z _ c), and the three point coordinates of (x _ r, y _ r, z _ c), (x _ c, y _ c, z _ c) and (x _ c, y _ c, z _ c) are substituted into the a plane equation x + α y + β z + ζ 0 to obtain the solution of the a plane equation, i.e., the a plane equation coefficient, which is used as the final processing formula for calibration.
In some embodiments, the step of obtaining two adjacent end point convergence coordinates and a center point convergence coordinate of the screen to be detected includes:
moving the microscopic imaging system to the end point or the central point, and acquiring images at pulse intervals;
the microscopic imaging system is moved, so that the center of the field of view of the imaging system is aligned with an end point or a central point to acquire images. The pulse interval is fixed. The pulse interval refers to how many pulses are used by the microscopic imaging system to acquire one image, and the pulse range can judge how many images are acquired by the microscopic imaging system at most. For example, if the pulse interval is 5 and the number of pulses is 7, then the pulse jump range is (-15, 15).
Calculating the definition of the image;
in the embodiment of the application, the definition of the images acquired according to the pulse interval needs to be calculated, so that the subsequent definition comparison is convenient. The method for calculating the image definition is not limited in the present application.
Selecting a position corresponding to the image with the highest definition as a focusing surface;
and comparing the definition of the acquired image, and selecting the position corresponding to the image with the highest definition as a focusing surface.
And the position coordinate corresponding to the image with the highest definition is used as a convergence coordinate.
However, in some embodiments, the locations to which the highest resolution images correspond are not necessarily convergent due to the limited range of pulse skipping. Therefore, further judgment is required.
In this embodiment, the step of obtaining two adjacent endpoint convergence coordinates and a center point convergence coordinate of the screen to be detected further includes:
judging whether the image with the highest definition is the first image or the last image;
and if the highest-definition image is not the first image or the last image, selecting the position coordinate corresponding to the highest-definition image as a convergence coordinate.
If the image with the highest definition is the first image or the last image, amplifying the pulse skipping range and re-collecting the image;
when the highest-resolution image is the first image or the last image, it is stated that the highest-resolution image may not be within the current burst jump range, and therefore, the burst jump range needs to be further expanded. The current burst jump range is (-15, 15), and the amplified burst jump range may be (-20, 20). The amplification degree of the pulse skipping range can be preset or can be manually selected.
And repeating the step of calculating the definition of the image until the position coordinate corresponding to the image with the highest definition is selected as a convergence coordinate.
It should be noted that, repeatedly executing the step of calculating the sharpness of the image until the position coordinate corresponding to the image with the highest sharpness is selected as the convergence coordinate means that: performing a sharpness calculation of the image; selecting a position corresponding to the image with the highest definition as a focusing surface; until judging whether the highest-definition image is the first image or the last image, and selecting a position coordinate corresponding to the highest-definition image as a convergence coordinate.
In this embodiment, whether the position coordinate corresponding to the highest-resolution image is a convergence coordinate is determined by determining whether the highest-resolution image is the first image or the last image, so that the convergence coordinate of the end point or the central point can be determined more accurately, and the accuracy of obtaining the plane equation coefficient when solving the plane equation is improved.
For further explanation of the present application, the following detailed description will be given with reference to specific examples to describe the method for fast calibrating the focal plane of the microscopic imaging system provided in the present application, but they should not be construed as limiting the scope of the present application.
Example 1
The first step, referring to fig. 2, moving the microscopic imaging system, aligning the center of the field of view of the microscopic imaging system to the position of the end point of the screen to be measured, collecting a series of images according to a fixed pulse interval, calculating the sharpness of each image, using the position with the highest sharpness as a focusing plane, if the image with the highest sharpness is in the first image or the last image, enlarging the pulse jump range, collecting and calculating again until convergence (the image with the highest sharpness is not in the first image or the last image), and marking the converged coordinates (x _ r, y _ r, z _ r) as the first point of calibration.
And secondly, moving the microscopic imaging system, aligning the center of a view field of the microscopic imaging system to the end point of the screen to be measured to acquire images, acquiring a series of images according to a fixed pulse interval, calculating the definition of each image, taking the position with the highest image definition as a focusing surface, if the image with the highest definition is in the first image or the last image, amplifying the pulse jump range, acquiring and calculating again until convergence (the image with the highest definition is not in the first image or the last image), and marking the converged coordinates (x _ ②, y _ ② and z _ ②) as a calibrated second point.
And thirdly, moving the microscopic imaging system, aligning the center of the field of view of the microscopic imaging system to the position of the endpoint of the screen to be measured, acquiring a series of images according to a fixed pulse interval, calculating the definition of each image, taking the position with the highest image definition as a focusing plane, if the image with the highest definition is in the first image or the last image, amplifying the pulse skipping range, acquiring and calculating again until convergence (the image with the highest definition is not in the first image or the last image), and marking the converged coordinates (x _ fifth, y _ fifth and z _ fifth) as a calibrated third point.
And fourthly, solving the plane equation by taking the convergence coordinates of the points I, II and V as three fixed points of the plane equation to obtain coefficients (alpha _ I, beta _ I and zeta _ I).
And fifthly, obtaining other three plane equation coefficients (alpha _ phi, beta _ phi, zeta _ phi), (alpha _ phi, beta _ phi and zeta _ phi) by the same steps from the first step to the fourth step respectively, and completing calibration.
According to the technical scheme, the embodiment of the application provides a method for quickly calibrating the focusing surface of the microscopic imaging system. The calibration method comprises the steps that four end points and a center point of a screen to be detected are selected as calibration points, and the calibration points divide the screen to be detected into four planes; establishing plane equations of the four planes; and solving the plane equation to obtain a plane equation coefficient. The screen to be tested is divided into four triangular areas, and plane equation fitting is carried out on the four triangular areas respectively. The plane is changed into four triangles, so that the accumulated error caused by the distance is reduced, and the error of each point is reduced to the maximum extent due to the triangular plane, so that the phenomenon that the angle which is not involved is very fuzzy due to the fact that the plane is made in the whole area of the mobile phone screen is avoided, and the curved surface equation fitting is simplified.
Referring to fig. 3, an embodiment of the present application provides a focus positioning method for a microscopic imaging system, including:
step S21, acquiring a defect coordinate of a to-be-focused point;
the defect coordinate of the to-be-focused point refers to the coordinate of a point mapped by the center of the field of view of the microscopic imaging system at the imaging position of the mobile phone screen.
Step S22, judging the plane area where the focus to be focused is located according to the defect coordinates;
according to the defect coordinates, the plane area of the focus to be focused can be determined. But there are points at the intersection of two planar regions for which the following method decision is provided for this application.
The determination order of the planar regions is preset, for example, the determination order of the planar regions is a, B, C, D, and the determination order of the planar regions can be set according to specific situations.
Sequentially judging whether the focus to be focused is in the range of the plane area or not according to the judging sequence of the plane area;
if so, judging to end; if not, the next planar area is determined.
For example, a point located at the boundary between a and B is determined to be located in the a-plane area because it is determined with priority whether the point is located in the a-plane area. Similarly, a point located at the boundary between a and D is determined to be located in the a-plane area because it is determined preferentially whether the point is located in the a-plane area.
And step S23, determining the distance between the point to be focused and the screen to be detected according to the plane equation of the plane area where the point to be focused is located and the defect coordinate.
The method for focusing and positioning the microscopic imaging system is characterized in that the method for focusing and positioning the microscopic imaging system is used for roughly detecting the defects of the screen to be detected, and the microscopic imaging system is used for re-judging the rough detection result so as to improve the accuracy of detecting the defects of the screen.
For further explanation of the present application, the following detailed description will be provided with reference to specific examples to describe the focus positioning method of the microscopic imaging system, but they should not be construed as limiting the scope of the present application.
Example 2
Firstly, acquiring defect coordinates (x, y) of a focus to be focused;
secondly, judging which plane area (x, y) the focus to be focused (the point mapped by the center of the field of view of the microscopic imaging system at the imaging position of the mobile phone screen) belongs to, for example, the plane area A;
and thirdly, calculating to obtain a z value according to the plane equation of the plane where the focus to be focused is located and the defect coordinate, namely substituting the defect coordinate (x, y) into the plane equation of the plane area A, namely determining the distance between the focus to be focused and the screen to be detected.
According to the technical scheme, the focusing and positioning method of the microscopic imaging system comprises the steps of obtaining a defect coordinate of a to-be-focused point; judging the plane area where the focus to be focused is located according to the defect coordinates; and determining the distance between the point to be focused and the screen to be detected according to the plane equation of the plane area where the point to be focused is located and the defect coordinate. According to the method, the screen to be measured is divided into four triangular areas, the four triangular areas are subjected to plane equation fitting respectively, when different coordinates need to be focused, the triangular areas where the points are located can be judged, corresponding equations are substituted, and a z value is obtained. The plane is changed into four triangles, so that the accumulated error caused by the distance is reduced, and the error of each point is reduced to the maximum extent due to the triangular plane, so that the phenomenon that the angle which is not involved is very fuzzy due to the fact that the plane is made in the whole area of the mobile phone screen is avoided, and the curved surface equation fitting is simplified.
Referring to fig. 4, an embodiment of the present application provides a device for quickly calibrating a focusing surface of a microscopic imaging system, including:
the calibration point selecting unit 11 is configured to select four end points and a center point of a screen to be detected as calibration points, where the calibration points divide the screen to be detected into four plane areas;
a plane equation establishing unit 12, configured to establish plane equations of the four plane areas;
and the plane equation solving unit 13 is used for solving the plane equation to obtain a plane equation coefficient.
In some embodiments, the plane equation solving unit 13 includes:
the convergence coordinate acquisition unit is used for acquiring two adjacent endpoint convergence coordinates and a center point convergence coordinate of the screen to be detected;
and the plane equation solving subunit is used for substituting the two adjacent endpoint convergence coordinates and the central point convergence coordinate into the plane equation to obtain a plane equation coefficient.
In some embodiments, the convergent coordinate acquisition unit includes:
the acquisition unit is used for moving the microscopic imaging system to the end point or the central point and acquiring images at pulse intervals;
a calculating unit for calculating the definition of the image;
the focusing surface selecting unit is used for selecting a position corresponding to the image with the highest definition as a focusing surface;
the judging unit is used for judging whether the image with the highest definition is the first image or the last image;
and the convergence coordinate selecting unit is used for selecting the position coordinate corresponding to the highest-definition image as a convergence coordinate if the highest-definition image is not the first image or the last image.
In some embodiments, the convergent coordinate acquisition unit further comprises:
the amplifying unit is used for amplifying the pulse skipping range and re-collecting the image if the image with the highest definition is the first image or the last image;
and the repeated execution unit is used for repeatedly executing the step of calculating the definition of the image until the position coordinate corresponding to the image with the highest definition is selected as the convergence coordinate.
Referring to fig. 5, an embodiment of the present application provides a focus positioning apparatus for a microscopic imaging system, including:
a defect coordinate acquiring unit 21 configured to acquire a defect coordinate of a focus to be focused;
the judging unit 22 is used for judging the plane area where the focus to be focused is located according to the defect coordinates;
the determining unit 23 is configured to determine a distance between the to-be-focused point and the screen to be detected according to the plane equation of the plane area where the to-be-focused point is located and the defect coordinate.
According to the technical scheme, the embodiment of the application provides a method and a device for quickly calibrating and positioning a focusing surface of a micro-imaging system. The calibration method comprises the steps that four end points and a center point of a screen to be detected are selected as calibration points, and the calibration points divide the screen to be detected into four plane areas; establishing plane equations of the four plane areas; and solving the plane equation to obtain a plane equation coefficient. The focusing positioning method comprises the steps of obtaining a defect coordinate of a to-be-focused point; judging the plane area where the focus to be focused is located according to the defect coordinates; and determining the distance between the point to be focused and the screen to be detected according to the plane equation of the plane area where the point to be focused is located and the defect coordinate. According to the method, the screen to be measured is divided into four triangular areas, the four triangular areas are subjected to plane equation fitting respectively, when different coordinates need to be focused, the triangular areas where the points are located can be judged, corresponding equations are substituted, and a z value is obtained. The plane is changed into four triangles, so that the accumulated error caused by the distance is reduced, and the error of each point is reduced to the maximum extent due to the triangular plane, so that the phenomenon that the angle which is not involved is very fuzzy due to the fact that the plane is made in the whole area of the mobile phone screen is avoided, and the curved surface equation fitting is simplified.
It should be noted that, in this document, terms such as "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.