Microscope and objective table leveling method
Through automated image processing technology, the grayscale characteristic value of the red blood cell sample is used to determine the inclination degree of the microscope barrel and the stage, and automatically level it, solving the problem of poor subjectivity and stability of manual judgment in the prior art. Improved leveling accuracy and efficiency.
Patent Information
- Application Number
- CN202411609718.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-02-18
AI Technical Summary
In the prior art, the parallelism leveling between the microscope barrel and the stage depends on manual judgment, and there are problems of poor subjectivity and stability, which affects the leveling effect and efficiency.
The original image of the red blood cell sample on the stage was obtained by a microscope, divided into partitions, extracted the red blood cell image and calculated its grayscale characteristic value, judged the degree of inclination based on the partition characteristic value, and automatically leveled until the preset conditions were met.
It achieves a more stable and effective leveling of the microscope and the stage, which improves the accuracy and efficiency of leveling.
Smart Images

Figure CN119477873A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of microscopes, and in particular to a method for leveling a microscope and a stage. Background Art
[0002] In the microscopic examination method of laboratory medicine, there are high requirements for the parallelism between the microscope barrel and the stage. If the barrel and the stage are not level, there will be an unclear area in the picture taken, which will affect the test results.
[0003] The existing method of ensuring the parallelism between the lens barrel and the stage is usually to manually determine the degree of tilt through pictures for leveling. However, manually determining the degree of tilt through pictures is subjective, requires high experience from the operator, and is prone to misjudgment or analysis errors, and has poor stability, which greatly affects the leveling effect and efficiency of the lens barrel and the stage.
[0004] Therefore, how to get rid of the subjective influence of manually judging the tilt degree through pictures and to stably and effectively level the microscope and the stage is a technical problem that needs to be solved urgently by technical personnel in this field. Summary of the invention
[0005] In order to solve the above technical problems, the present application provides a method for leveling a microscope and a stage, which can get rid of the subjective influence of manually judging the degree of tilt through pictures, and can level the microscope and the stage more stably and effectively.
[0006] The technical solutions provided by this application are as follows: A method for leveling a microscope and a stage, comprising: A raw image of a red blood cell sample located on a stage is acquired through a microscope; Divide the original image into at least 2 partitions; Extracting multiple red blood cell images in each partition on the original image, and calculating the grayscale feature value of each red blood cell image; Taking the average value of the grayscale characteristic values of all red blood cell images in each partition as the partition characteristic value corresponding to the partition; According to each partition characteristic value, it is judged in turn whether the inclination degree of each partition meets the preset qualification condition, If not, leveling the partition with the largest partition characteristic value, and then returning to re-execute the step of acquiring the original image of the red blood cell sample located on the stage through the microscope; If so, it is considered that the microscope and the stage are leveled.
[0007] Preferably, in the method for leveling the microscope and the stage, dividing the original image into at least two partitions comprises: In the same direction, the original image is divided into at least 2 partitions; or, In two directions perpendicular to each other, the original image is divided into at least two partitions respectively.
[0008] Preferably, in the method for leveling the microscope and the stage, the step of calculating the grayscale characteristic value of each red blood cell image comprises: The contrast value of each red blood cell image is calculated as the grayscale feature value of each red blood cell image.
[0009] Preferably, in the method for leveling the microscope and the stage, the step of calculating the grayscale characteristic value of each red blood cell image comprises: The ratio of the difference between the maximum grayscale value and the minimum grayscale value of each red blood cell image to the sum of the maximum grayscale value and the minimum grayscale value is calculated as the grayscale feature value of each red blood cell image.
[0010] Preferably, in the method for leveling the microscope and the stage, the step of calculating the grayscale characteristic value of each red blood cell image comprises: Each red blood cell image is divided into an outer circle area and an inner circle area; The difference between the average grayscale value of the inner circle area of each red blood cell image and the average grayscale value of the outer circle area is calculated as the grayscale feature value of each red blood cell image.
[0011] Preferably, in the method for leveling the microscope and the stage, judging in turn whether the tilt degree of each partition satisfies a preset qualification condition according to each partition characteristic value includes: Calculating a partition characteristic deviation value of each partition according to each of the partition characteristic values and the standard characteristic value; It is determined in turn whether the partition feature deviation value of each partition is less than the set threshold value. If so, it is considered that the inclination degree of the partition meets the preset qualification condition. If not, it is considered that the inclination degree of the partition does not meet the preset qualification condition.
[0012] Preferably, in the method for leveling the microscope and the stage, the step of calculating the partition characteristic deviation value of each partition according to each partition characteristic value and the standard characteristic value comprises: The difference between each partition characteristic value and the standard characteristic value is calculated as the partition characteristic deviation value of each partition.
[0013] Preferably, in the method for leveling the microscope and the stage, the step of calculating the partition characteristic deviation value of each partition according to each partition characteristic value and the standard characteristic value comprises: The difference between each partition characteristic value and the minimum value among all partition characteristic values is calculated, and the ratio of the difference to the standard characteristic value is calculated as the partition characteristic deviation value of each partition.
[0014] Preferably, the method for leveling the microscope and the stage further comprises a step of determining the standard characteristic value, wherein the step of determining the standard characteristic value comprises: Through the microscope that has been leveled, experimental images of multiple red blood cell samples on the stage are obtained respectively; Divide the experimental image corresponding to each red blood cell sample into at least 2 partitions; Extracting a plurality of red blood cell images in each partition of the experimental image corresponding to each red blood cell sample, and calculating an experimental grayscale feature value of each red blood cell image; Taking the average value of the experimental grayscale characteristic values of all red blood cell images in each partition on the experimental image as the experimental partition characteristic value corresponding to the partition; Taking the average value of the experimental partition characteristic values of all partitions as the standard characteristic value; or, Eliminate the maximum value among the experimental partition characteristic values of all partitions, and take the average value of the remaining experimental partition characteristic values as the standard characteristic value; or, Eliminate the maximum and minimum values of the experimental partition characteristic values of all partitions, and take the average value of the remaining experimental partition characteristic values as the standard characteristic value; or, The average value of the maximum value and the minimum value of the experimental partition characteristic values of all partitions is taken as the standard characteristic value.
[0015] Preferably, the method for leveling the microscope and the stage further comprises a step of determining the set threshold, wherein the step of determining the set threshold comprises: Calculating the experimental partition feature deviation value of each partition on the experimental image according to each of the experimental partition feature values and the standard feature value; Taking the average value of the experimental partition characteristic deviation values of all partitions as the set threshold; or, Eliminate the maximum value of the experimental partition characteristic deviation values of all partitions, and take the average value of the remaining experimental partition characteristic deviation values as the set threshold; or, Eliminate the maximum and minimum values of the experimental partition characteristic deviation values of all partitions, and take the average value of the remaining experimental partition characteristic deviation values as the set threshold value; or, The average value of the maximum value and the minimum value of the experimental partition characteristic deviation values of all partitions is taken as the set threshold value.
[0016] The above technical solution obtains the original image of the red blood cell sample located on the stage through a microscope; divides the original image into at least 2 partitions; extracts multiple red blood cell images in each partition on the original image, and calculates the grayscale characteristic value of each red blood cell image; takes the average of the grayscale characteristic values of all red blood cell images in each partition as the partition characteristic value corresponding to the partition; according to each partition characteristic value, judges in turn whether the degree of inclination of each partition meets the preset qualified conditions, thereby realizing the judgment of the degree of image inclination based on the information carried by the image itself, and getting rid of the subjective influence of manual judgment; further, if it is judged that the degree of inclination of a certain partition does not meet the preset qualified conditions, the partition with the largest partition characteristic value is leveled, and then the original image of the red blood cell sample is re-obtained to judge the image inclination again, until the degree of inclination of each partition meets the preset qualified conditions, it is considered that the microscope and the stage are leveled. In summary, compared with the prior art, the above technical solution can get rid of the subjective influence of manual judgment of the degree of inclination through pictures, and can more stably and effectively level the microscope and the stage. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 A schematic diagram of a process for leveling a microscope and a stage in an embodiment of the present application; Figure 2 is a schematic diagram of an original image in an embodiment of the present application; Figure 3 A schematic diagram of partitioning of an original image in an embodiment of the present application; Figure 4 Schematic diagram of the image segmentation and extraction results in the embodiment of the present application, wherein Figure (a) is the red blood cell image of the partition numbered 1, Figure (b) is the red blood cell image of the partition numbered 2, Figure (c) is the red blood cell image of the partition numbered 4, and Figure (d) is the red blood cell image of the partition numbered 3. DETAILED DESCRIPTION
[0019] In order to enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0020] A person skilled in the art can understand that all or part of the steps of the following method embodiments can be completed by program instructions and related hardware. The aforementioned program instructions can be stored in a computer-readable storage medium. When the program instructions are executed, the steps of the following method embodiments are executed; and the aforementioned storage medium includes: a mobile storage device, a read-only memory (ROM), a magnetic disk or an optical disk, and other media that can store program codes.
[0021] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, "multiple" and "several" mean two or more, unless otherwise clearly and specifically defined.
[0022] If a flow chart is used in the present application, the flow chart is used to illustrate the operations performed by the system according to the embodiment of the present application. It should be understood that the preceding or following operations are not necessarily performed accurately in order. On the contrary, each step can be processed in reverse order or simultaneously. At the same time, other operations can also be added to these processes, or a certain step or several steps of operations can be removed from these processes.
[0023] It should also be noted that, in this article, terms such as "comprises", "includes" or any other variations thereof are intended to cover non-exclusive inclusion, so that an article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such articles or devices. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the article or device including the above elements.
[0024] The embodiments of the present application are written in a progressive manner.
[0025] like Figure 1 As shown, the embodiment of the present application provides a method for leveling a microscope and a stage, comprising: S101. Acquire an original image of a red blood cell sample on a stage through a microscope; In S101, specifically, the red blood cell sample can be prepared by diluting whole blood and physiological saline according to a set ratio. For example, whole blood is prepared and diluted with physiological saline at a certain ratio (1:200 is used in this embodiment) to obtain red blood cell fluid, and the red blood cell fluid is dropped into a slide or a counting plate to obtain a red blood cell sample; before the image is taken, the red blood cell sample is first placed on the stage of the microscope, and with the help of the autofocus function of the microscope, the autofocus is completed, and then the red blood cell sample is photographed with the help of the camera function of the microscope to obtain the original image, but the present application is not limited to this.
[0026] S102. Divide the original image into at least 2 partitions; In S102, specifically, the image partition can be partitioned in only one direction or in two directions at the same time. The more partitions there are, the higher the accuracy is, but the more complicated the calculation is; the fewer partitions there are, the lower the accuracy is, but the calculation is the simplest, for example, dividing into only 2 partitions.
[0027] In some embodiments, one implementation of this step specifically includes: in the same direction, the original image is divided into at least 2 partitions; or, in two directions perpendicular to each other, the original image is divided into at least 2 partitions. For example, in the same direction, the X direction or the Y direction, the original image is divided into at least 2 partitions, or into 3, 4 or more partitions; or, in two directions perpendicular to each other, the X direction and the Y direction, the original image is divided into at least 2 partitions in each direction, or into 3, 4 or more partitions.
[0028] Preferably, in order to balance the computational complexity and accuracy, the original image can be divided into two partitions in two mutually perpendicular directions, for example, two partitions in the X direction and two partitions in the Y direction, for a total of four partitions. Figure 2 Taking the original image of the red blood cell sample shown in the figure as an example, the original image is divided into 4 partitions according to the X and Y directions. Figure 3 As shown, for easy distinction, the four partitions can be numbered 1, 2, 3, and 4 in a clockwise direction.
[0029] S103. extracting multiple red blood cell images in each partition on the original image, and calculating the grayscale feature value of each red blood cell image; In S103, specifically, after the original image is divided into at least two partitions, it is necessary to extract the features of each partition, that is, to extract the red blood cell image in each partition. For example, a deep learning-based image segmentation algorithm known in the art can be used to perform image segmentation on each partition of the original image to extract the red blood cell image in each partition; or Hough circle detection can be performed on each partition of the original image, and the detected Hough circle can be extracted as a single cell segmentation to obtain the red blood cell image in each partition, wherein the Hough circle detection can accurately detect a single cell from the original image, and has lower computing power requirements than the image segmentation algorithm. In a specific embodiment, Figure 3 Taking the four partitions shown in the figure as an example, the red blood cell images extracted from each partition are placed in the corresponding folder according to the partition number. The image segmentation extraction results are shown in Figure 4 As shown, the red blood cell image of each partition is obtained.
[0030] Furthermore, after obtaining the red blood cell image in each partition, each red blood cell image may be gray-processed, and then the gray-scale feature value of each red blood cell image may be calculated based on each red blood cell image after the gray-scale processing; wherein, there are multiple ways to calculate the gray-scale feature value.
[0031] In some embodiments, one implementation of the step of calculating the grayscale characteristic value of each red blood cell image specifically includes: calculating the contrast value of each red blood cell image as the grayscale characteristic value of each red blood cell image.
[0032] Specifically, the contrast value can be calculated using an existing calculation method. For example: convert each red blood cell image to grayscale to obtain a grayscale image of each red blood cell image; based on the grayscale image, count the mode of the grayscale distribution of the image; use the mode of the grayscale distribution as the background value to calculate the contrast of each pixel, and based on the contrast of each pixel, calculate the average value of the contrast of the entire grayscale image as the contrast value of each red blood cell image, that is, the grayscale characteristic value of each red blood cell image, and the present application is not limited thereto.
[0033] In other embodiments, one implementation of the step of calculating the grayscale characteristic value of each red blood cell image specifically includes: calculating the ratio of the difference between the maximum grayscale value and the minimum grayscale value of each red blood cell image to the sum of the maximum grayscale value and the minimum grayscale value as the grayscale characteristic value of each red blood cell image.
[0034] Specifically, after converting each red blood cell image to grayscale, the grayscale value of each red blood cell image can be obtained. The difference between the maximum grayscale value and the minimum grayscale value of each red blood cell image is divided by the sum of the maximum grayscale value and the minimum grayscale value to obtain the grayscale characteristic value of each red blood cell image, that is, the grayscale characteristic value of each red blood cell image = (the maximum grayscale value of the red blood cell image - the minimum grayscale value of the red blood cell image) / (the maximum grayscale value of the red blood cell image + the minimum grayscale value of the red blood cell image).
[0035] In other embodiments, one implementation method of the step of calculating the grayscale characteristic value of each red blood cell image specifically includes: dividing each red blood cell image into an outer circle area and an inner circle area; calculating the difference between the average grayscale value of the inner circle area of each red blood cell image and the average grayscale value of the outer circle area as the grayscale characteristic value of each red blood cell image.
[0036] Specifically, the structural characteristics of the red blood cell itself are similar to an outer circle, and there is a depression inside it to form an inner circle coaxial with the outer circle. For each red blood cell image, the red blood cell image is divided into two areas, an outer circle and an inner circle. The average grayscale value of the outer circle area and the average grayscale value of the inner circle area of the red blood cell image are calculated respectively, and the difference obtained by subtracting the average grayscale value of the outer circle area from the average grayscale value of the inner circle area is used as the grayscale feature value of the red blood cell image. Among them, in digital image processing, when extracting the red blood cell image, the outer circle size and the inner circle size of the red blood cell image can be obtained, that is, the relative position of the outer circle and the inner circle is clarified, and the inner circle area of the red blood cell image can be conveniently marked. In digital image processing, there is no circular image file, which is generally a rectangle. The red blood cell image in this application can be regarded as a square, that is, in digital image processing, the outer circle area will be regarded as a large square, and the inner circle area will be regarded as a small square, so that digital processing (grayscale calculation) can be performed. It should be noted here that, for the outer circle area, the average grayscale value of the inscribed square area can be calculated, and for the inner circle area, the average grayscale value of the circumscribed square area can be calculated, but the present application is not limited to this.
[0037] S104. taking the average value of the grayscale feature values of all red blood cell images in each partition as the partition feature value corresponding to the partition; In S104, specifically, mean calculations may be performed according to the grayscale feature values of the red blood cell image of each partition to obtain a partition feature value corresponding to each partition, wherein the partition feature value is used for subsequent judgment of the tilt degree of the partition.
[0038] In some embodiments, in order to eliminate the interference of excessively high contrast of the red blood cell image in the "lying on the side" posture, one implementation method of this step specifically includes: removing the first preset number of grayscale feature values with larger values in the grayscale feature values of the red blood cell image of each partition, and then performing mean calculations according to the remaining grayscale feature values of the red blood cell image of each partition to obtain the partition feature value corresponding to each partition; wherein the preset number may preferably be 2, that is, removing the first two maximum values of the grayscale feature values of the red blood cell image of each partition, and summing the remaining grayscale feature values of each partition, dividing by the number of remaining grayscale feature values of each partition (that is, the number of original grayscale feature values minus 2), to obtain the partition feature value corresponding to each partition, thereby improving the accuracy of the partition feature value calculation.
[0039] In some other embodiments, one implementation of this step specifically includes: removing the maximum and minimum values of the grayscale feature values of the red blood cell image of each partition, and then performing mean calculations on the grayscale feature values of the remaining red blood cell images of each partition to obtain the partition feature values corresponding to each partition. Removing the extreme values of the grayscale feature values of the red blood cell image of each partition and then calculating the mean value can make the calculation results of the partition feature values more representative.
[0040] S105. According to each partition characteristic value, determine in turn whether the inclination degree of each partition meets the preset qualification condition. If not, execute S106; if so, execute S107; In S105, specifically, after obtaining the partition characteristic value of each partition, it is possible to determine in turn whether the inclination degree of each partition meets the preset qualified conditions according to the deviation between the partition characteristic value and the standard characteristic value.
[0041] In some embodiments, one implementation of this step specifically includes: S1051. Calculate the partition characteristic deviation value of each partition according to each partition characteristic value and the standard characteristic value; In S1051, specifically, one implementation of this step includes: calculating the difference between each partition feature value and the standard feature value as the partition feature deviation value of each partition. That is, the partition feature deviation value = the partition feature value of the current partition - the standard feature value; another implementation of this step includes: calculating the difference between each partition feature value and the minimum value of all partition feature values, and the ratio of the difference to the standard feature value as the partition feature deviation value of each partition. That is, the partition feature deviation value = 100% × (partition feature value of the current partition - the minimum value of all partition feature values) / standard feature value.
[0042] Among them, the standard feature value can be pre-set based on manual experience and experiments; for example, use a leveled microscope to take images of multiple different red blood cell samples, calculate the partition feature value of each partition according to the above implementation steps, and then eliminate the partition feature values that are obviously abnormal and too high (which can be judged manually), and use the average value of all the remaining partition feature values as the standard feature value.
[0043] In a specific embodiment, taking the calculation method of partition feature deviation value = 100% × (partition feature value of the current partition - minimum value of all partition feature values) / standard feature value as an example, the standard feature value adopts the average value of the partition feature value calculated from the non-tilted red blood cell image; preferably, the standard feature value adopts 0.5, Figure 3 Taking the four partitions shown as an example, in the order of numbers 1 to 4, assuming that the partition characteristic values of the four partitions are 0.5292, 0.4747, 0.5732, and 0.6017, respectively, correspondingly, the partition characteristic deviation values (expressed in %) of the four partitions calculated according to the above formula are 10.90%, 0.00%, 19.70%, and 25.40%, respectively.
[0044] S1052. Determine in turn whether the partition feature deviation value of each partition is less than the set threshold value. If so, it is considered that the inclination degree of the partition meets the preset qualification conditions. If not, it is considered that the inclination degree of the partition does not meet the preset qualification conditions. When it is determined that the inclination degrees of each partition meet the preset qualification conditions, execute S107. When it is determined that the inclination degree of a partition does not meet the preset qualification conditions, execute S106.
[0045] In S1052, specifically, the threshold value can be pre-set based on manual experience and experiments; for example, a leveled microscope is used to capture images of a plurality of different red blood cell samples, and the partition characteristic value of each partition is calculated according to the above implementation steps. The partition characteristic deviation value corresponding to each partition is calculated according to one of the two partition characteristic deviation value calculation methods mentioned above, and then the partition characteristic deviation values that are obviously abnormal and too high are eliminated (which can be determined manually), and the maximum value of the remaining partition characteristic deviation values is used as the set threshold value.
[0046] In some embodiments, after calculating the partition characteristic deviation value of each partition, the maximum value of all partition characteristic deviation values can be determined first, and then it can be determined whether the maximum value is less than a set threshold value. If so, it is considered that the inclination degree of each partition meets the preset qualified condition, and then S107 is executed. If not, it is considered that the inclination degree of a certain partition does not meet the preset qualified condition, and then S106 is executed. In a specific embodiment, taking the calculation method of partition characteristic deviation value = 100% × (partition characteristic value of the current partition - the minimum value of all partition characteristic values) / standard characteristic value as an example, the set threshold value can be 12%, and the threshold value can be 12%. Figure 3 Taking the four partitions shown as an example, the maximum value of the partition feature deviation value of the four partitions is 25.40%, which is greater than 12%. At this time, it can be considered that the tilt degree of a certain partition does not meet the preset qualified condition, and then S106 is executed. Through the above implementation steps, the image tilt degree judgment is realized based on the information carried by the image itself, which is free from the subjective influence of manual judgment and effectively avoids the occurrence of manual judgment errors or analysis errors.
[0047] S106. Level the partition with the largest partition characteristic value, and then return to re-execute S101; In S106, specifically, when it is determined that the tilt degree of a certain partition does not meet the preset qualified conditions, it is necessary to level the microscope and the stage, select the partition with the largest partition characteristic value, and use and combine the structure of the existing microscope leveling mechanism to raise the height of the partition. For example, control the stepper motor of the microscope leveling mechanism to run 100 steps or 200 steps in the lifting direction. The smaller the number of steps, the lower the leveling efficiency but the more accurate it is. It can be selected according to actual conditions, and this application does not impose specific restrictions on this. After the leveling is completed, the original image of the red blood cell sample is re-acquired to perform image tilt determination again until the tilt degree of each partition meets the preset qualified conditions. It should be noted that after the leveling is completed, before re-shooting the original image of the red blood cell sample, the microscope also completes autofocus to ensure the effectiveness of image acquisition.
[0048] S107. It is considered that the leveling of the microscope and the stage is completed.
[0049] In S107, specifically, when it is determined that the tilt degrees of each partition meet the preset qualified conditions, it can be considered that the microscope and the stage are leveled, and then the red blood cell sample can be taken out to carry out subsequent microscope observation work.
[0050] The existing method of ensuring the parallelism between the lens barrel and the stage is usually to manually determine the degree of tilt through pictures for leveling. However, manually determining the degree of tilt through pictures is subjective, requires high experience from the operator, and is prone to misjudgment or analysis errors, and has poor stability, which greatly affects the leveling effect and efficiency of the lens barrel and the stage.
[0051] In the above embodiment, the original image of the red blood cell sample located on the stage is obtained through a microscope; the original image is evenly divided into at least 2 partitions; multiple red blood cell images in each partition on the original image are extracted, and the grayscale characteristic value of each red blood cell image is calculated; the average value of the grayscale characteristic values of all red blood cell images in each partition is taken as the partition characteristic value corresponding to the partition; according to each partition characteristic value, it is judged in turn whether the degree of inclination of each partition meets the preset qualified conditions, thereby realizing the judgment of the degree of image inclination based on the information carried by the image itself, and getting rid of the subjective influence of manual judgment; further, if it is judged that the degree of inclination of a certain partition does not meet the preset qualified conditions, the partition with the largest partition characteristic value is leveled, and then the original image of the red blood cell sample is re-acquired to judge the image inclination again, until the degree of inclination of each partition meets the preset qualified conditions, it is considered that the microscope and the stage are leveled. In summary, compared with the prior art, the above embodiment can get rid of the subjective influence of manual judgment of the degree of inclination through pictures, and can more stably and effectively level the microscope and the stage.
[0052] In other embodiments of the present application, in order to get rid of manual experience judgment, the standard characteristic value can also be calculated through a large number of experiments. The above-mentioned microscope and stage leveling method also includes a step of determining the standard characteristic value; this step specifically includes: S201. Acquire experimental images of a plurality of red blood cell samples on the stage through the microscope that has been leveled; In S201, specifically, a red blood cell sample is placed on the stage of a microscope that has been leveled, and then the red blood cell sample is photographed using the microscope that has been leveled to obtain an experimental image corresponding to the red blood cell sample; by selecting a plurality of different red blood cell samples for multiple photographs, an experimental image corresponding to each red blood cell sample is obtained for subsequent calculations.
[0053] S202. Divide the experimental image corresponding to each red blood cell sample into at least 2 partitions; In S202, the specific implementation details may refer to the above S102.
[0054] S203. extracting multiple red blood cell images in each partition on the experimental image corresponding to each red blood cell sample, and calculating the experimental grayscale feature value of each red blood cell image; In S203, the specific implementation details may refer to the above S103.
[0055] S204. taking the average of the experimental grayscale feature values of all red blood cell images in each partition on the experimental image as the experimental partition feature value corresponding to the partition; In S204, the specific implementation details may refer to the above S104.
[0056] S205. Take the average of the experimental partition characteristic values of all partitions as the standard characteristic value; or, S206. Eliminate the maximum value among the experimental partition characteristic values of all partitions, and take the average value of the remaining experimental partition characteristic values as the standard characteristic value; or, S207. Eliminate the maximum and minimum values of the experimental partition characteristic values of all partitions, and take the average value of the remaining experimental partition characteristic values as the standard characteristic value; or, S208. Take the average of the maximum and minimum values of the experimental partition characteristic values of all partitions as the standard characteristic value.
[0057] Among them, the maximum value among the experimental partition characteristic values of all partitions is eliminated, and the average value of the remaining experimental partition characteristic values is taken as the standard characteristic value, which can be used as a preferred solution.
[0058] On the basis of the above embodiment, in order to get rid of manual experience judgment, the set threshold value can also be calculated through a large number of experiments. The above method for leveling the microscope and the stage also includes a step of determining the set threshold value; this step specifically includes: S301. Calculate the experimental partition feature deviation value of each partition on the experimental image according to each experimental partition feature value and the standard feature value; In S301, specifically, after calculating the experimental partition characteristic value and the standard characteristic value of each partition on the experimental image according to the above S201-S208, the experimental partition characteristic deviation value of each partition on the experimental image can be calculated by referring to the specific implementation details in S105.
[0059] S302. Take the average value of the experimental partition feature deviation values of all partitions as the set threshold; or, S303. Eliminate the maximum value of the experimental partition characteristic deviation values of all partitions, and take the average value of the remaining experimental partition characteristic deviation values as the set threshold; or, S304. Eliminate the maximum and minimum values of the experimental partition characteristic deviation values of all partitions, and take the average value of the remaining experimental partition characteristic deviation values as the set threshold; or, S305. Take the average of the maximum and minimum values of the experimental partition feature deviation values of all partitions as the set threshold.
[0060] Among them, eliminating the maximum value of the experimental partition characteristic deviation values of all partitions and taking the average value of the remaining experimental partition characteristic deviation values as the set threshold value can be used as a preferred solution.
[0061] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for leveling a microscope and a stage, characterized in that: include: A raw image of a red blood cell sample located on a stage is acquired through a microscope; Divide the original image into at least 2 partitions; Extracting multiple red blood cell images in each partition on the original image, and calculating the grayscale feature value of each red blood cell image; Taking the average value of the grayscale characteristic values of all red blood cell images in each partition as the partition characteristic value corresponding to the partition; According to each partition characteristic value, it is judged in turn whether the inclination degree of each partition meets the preset qualification condition, If not, leveling the partition with the largest partition characteristic value, and then returning to re-execute the step of acquiring the original image of the red blood cell sample located on the stage through the microscope; If so, it is considered that the microscope and the stage are leveled.
2. The method according to claim 1, characterized in that The step of dividing the original image into at least two partitions comprises: In the same direction, the original image is divided into at least 2 partitions; or, In two directions perpendicular to each other, the original image is divided into at least two partitions respectively.
3. The method according to claim 1, characterized in that The step of calculating the grayscale characteristic value of each red blood cell image includes: The contrast value of each red blood cell image is calculated as the grayscale feature value of each red blood cell image.
4. The method according to claim 1, characterized in that The step of calculating the grayscale characteristic value of each red blood cell image includes: The ratio of the difference between the maximum grayscale value and the minimum grayscale value of each red blood cell image to the sum of the maximum grayscale value and the minimum grayscale value is calculated as the grayscale feature value of each red blood cell image.
5. The method according to claim 1, characterized in that The step of calculating the grayscale characteristic value of each red blood cell image includes: Each red blood cell image is divided into an outer circle area and an inner circle area; The difference between the average grayscale value of the inner circle area of each red blood cell image and the average grayscale value of the outer circle area is calculated as the grayscale feature value of each red blood cell image.
6. The method according to claim 1, characterized in that The step of determining, in turn, whether the inclination of each partition satisfies a preset qualification condition according to each partition characteristic value includes: Calculating a partition characteristic deviation value of each partition according to each of the partition characteristic values and the standard characteristic value; It is determined in turn whether the partition feature deviation value of each partition is less than the set threshold value. If so, it is considered that the inclination degree of the partition meets the preset qualification condition. If not, it is considered that the inclination degree of the partition does not meet the preset qualification condition.
7. The method as claimed in claim 6, characterized in that The step of calculating the partition feature deviation value of each partition according to each partition feature value and the standard feature value includes: The difference between each partition characteristic value and the standard characteristic value is calculated as the partition characteristic deviation value of each partition.
8. The method as claimed in claim 6, characterized in that The step of calculating the partition feature deviation value of each partition according to each partition feature value and the standard feature value includes: The difference between each partition characteristic value and the minimum value among all partition characteristic values is calculated, and the ratio of the difference to the standard characteristic value is calculated as the partition characteristic deviation value of each partition.
9. The method as claimed in claim 6, characterized in that The method further comprises the step of determining the standard characteristic value, wherein the step of determining the standard characteristic value comprises: Through the microscope that has been leveled, experimental images of multiple red blood cell samples on the stage are obtained respectively; Divide the experimental image corresponding to each red blood cell sample into at least 2 partitions; Extracting a plurality of red blood cell images in each partition of the experimental image corresponding to each red blood cell sample, and calculating an experimental grayscale feature value of each red blood cell image; Taking the average value of the experimental grayscale characteristic values of all red blood cell images in each partition on the experimental image as the experimental partition characteristic value corresponding to the partition; Taking the average value of the experimental partition characteristic values of all partitions as the standard characteristic value; or, Eliminate the maximum value among the experimental partition characteristic values of all partitions, and take the average value of the remaining experimental partition characteristic values as the standard characteristic value; or, Eliminate the maximum and minimum values of the experimental partition characteristic values of all partitions, and take the average value of the remaining experimental partition characteristic values as the standard characteristic value; or, The average value of the maximum value and the minimum value of the experimental partition characteristic values of all partitions is taken as the standard characteristic value.
10. The method as claimed in claim 9, characterized in that The method further includes a step of determining the set threshold, wherein the step of determining the set threshold includes: Calculating the experimental partition feature deviation value of each partition on the experimental image according to each of the experimental partition feature values and the standard feature value; Taking the average value of the experimental partition characteristic deviation values of all partitions as the set threshold; or, Eliminate the maximum value of the experimental partition characteristic deviation values of all partitions, and take the average value of the remaining experimental partition characteristic deviation values as the set threshold; or, Eliminate the maximum and minimum values of the experimental partition characteristic deviation values of all partitions, and take the average value of the remaining experimental partition characteristic deviation values as the set threshold value; or, The average value of the maximum value and the minimum value of the experimental partition characteristic deviation values of all partitions is taken as the set threshold value.