CN-116029990-B - Method for calculating definition value of cell picture based on saturation value
Abstract
The invention relates to a method for calculating a cell picture definition value based on a saturation value, which comprises the following steps of (1) carrying out color conversion on a cell picture obtained through shooting, converting the cell picture from an RGB (red green blue) channel to HSV (color, saturation and brightness), (2) separating a saturation channel picture S, removing partial noise through Gaussian filtering (or mean filtering) to obtain a picture S1, (3) carrying out Laplace transformation on the picture S1 with a proper size, calculating an absolute value, finding a position with a severe change in the picture to obtain a picture S2, (4) setting a proper threshold value, carrying out thresholding on the picture S2, recording the saturation value, finding out a corresponding bright spot position, (5) counting the bright spot positions of a plurality of cell pictures, and recording the saturation value of the picture S2. The method is simple and effective, and combines Gaussian filtering (or mean filtering), laplace transformation, decision tree, morphological operation and the like, so that the result of judging the definition value of the cell picture is more accurate.
Inventors
- HUANG ZHEN
- XU SHUPING
- SUN MINGXIA
- XIAO JIE
- LI QIANG
- LU TAO
- LU JU
Assignees
- 杭州智微信息科技有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20221219
Claims (5)
- 1. A method for calculating a sharpness value of a cell picture based on a saturation value, comprising the steps of: (1) Performing color conversion on a cell picture obtained by shooting, and converting the cell picture from an RGB (red green blue) channel to HSV (color, saturation and brightness); (2) Separating out a saturation channel picture S, and removing partial noise points through Gaussian filtering or mean filtering to obtain a picture S1; (3) Selecting a check picture S1 with a proper size to perform Laplace transformation, calculating an absolute value, and finding out a position with severe change in the picture to obtain a picture S2; (4) Setting a proper threshold value, carrying out thresholding treatment on the picture S2, recording a saturation value, and finding out a corresponding bright spot position; (5) Counting the bright spot positions of a plurality of cell pictures, and recording the saturation value of the corresponding picture S2; (6) According to the recording result of the step (5), a decision tree algorithm is applied to find out a saturation value rule and formulate a selected condition, wherein the selected condition is a threshold value T1, namely, bright spots are formed when the saturation value is greater than the threshold value T1, and non-bright spots are formed when the saturation value is less than or equal to the threshold value T1; (7) Finding out the positions of all the bright spots in the cell picture according to the conditions formulated in the step (6), and then performing expansion operation on the positions to obtain a bright spot binary image B; (8) Performing expansion operation on the picture S to obtain an expanded picture S3; (9) Carrying out corrosion operation on the picture S to obtain a corroded picture S4; (10) And (3) taking the difference between the pictures S3 and S4, subtracting the pictures after morphological operation to find out a cell edge picture D, combining the position of the bright spots found in the step (7), taking the bright spot binary image B as a mask, calculating the mean square error of a non-bright spot area in the cell edge picture D, and calculating the definition value of the cell picture through the mean square error.
- 2. The method for calculating the sharpness value of a cell picture based on the saturation value according to claim 1, wherein the calculation formula of the gaussian filter or the mean filter in the step (2) is: Wherein (x, y) is the current pixel point, m is the template, src is the original image, a is the width of the template, b is the height of the template, and s (x, y) is the saturation value of the processed image at the point.
- 3. The method for calculating the sharpness value of a cellular picture based on the saturation value according to claim 1, wherein the calculation formula for performing the laplace transform on the picture S1 in the step (3) is: Wherein, (x, y) is the current pixel point, and src is the original image.
- 4. The method of claim 1, wherein the algorithm formula used for expanding the picture S in the step (8) is: Where src is the original image and dst is the processed image.
- 5. The method for calculating sharpness values of a cellular picture based on saturation values according to claim 1, wherein the algorithm formula used for the corrosion operation of the picture S in step (9) is: Where src is the original image and dst is the processed image.
Description
Method for calculating definition value of cell picture based on saturation value Technical Field The invention belongs to the field of medical image processing, and particularly relates to a method for calculating a cell picture definition value based on a saturation value. Background The algorithm for calculating the definition value of the cell picture is mainly used for finding out the position of the Z axis where the clearest cell picture is located according to the Z axis movement of the mechanical device, and taking the position as the focusing point to complete shooting. Because the thickness of the slice is uneven, the stacking degree of cells is different, the difference of different types of cells after being dyed is larger, the difference of cell colors can be caused by different colorants, and meanwhile, the slice is polluted by impurities such as dust and the like to different degrees. The accuracy requirements for the algorithm are high. At present, there is a contrast focusing method, which finds out the position with the maximum contrast through the inverse difference between the images shot by adjacent Z, and places the focus on the focus with the maximum inverse difference to complete focusing. However, if the images are shot under an oil lens, bright spots are easy to appear in the images, and errors are easy to occur when the algorithm calculates the inverse difference between the images shot by the adjacent Z, so that the shot images are not the clearest images. Disclosure of Invention The present invention aims to overcome the above-mentioned drawbacks of the prior art and provide a method for calculating a sharpness value of a cell picture based on a saturation value. The technical scheme adopted by the invention for solving the problems is that a method for calculating the definition value of the cell picture based on the saturation value is provided, and comprises the following steps: (1) Performing color conversion on a cell picture obtained by shooting, and converting the cell picture from an RGB (red green blue) channel to HSV (color, saturation and brightness); (2) Separating out a saturation channel picture S, and removing partial noise points through Gaussian filtering (or mean filtering) to obtain a picture S1; (3) Selecting a check picture S1 with a proper size to perform Laplace transformation, calculating an absolute value, and finding out a position with severe change in the picture to obtain a picture S2; (4) Setting a proper threshold value, carrying out thresholding treatment on the picture S2, recording a saturation value, and finding out a corresponding bright spot position; (5) Counting the bright spot positions of a plurality of cell pictures, and recording the saturation value of the corresponding picture S2; (6) According to the recorded result of the step (5), a decision tree algorithm is applied to find out the condition for formulating and selecting the saturation value rule; (7) Finding out the positions of all the bright spots in the cell picture according to the conditions formulated in the step (6), and then performing expansion operation on the positions to obtain a bright spot binary image B; (8) Performing expansion operation on the picture S to obtain an expanded picture S3; (9) Carrying out corrosion operation on the picture S to obtain a corroded picture S4; (10) And (3) subtracting the pictures S3 and S4, subtracting the pictures after morphological operation to find out a cell edge map D, and calculating the definition value of the cell picture by combining the position of the bright spots found in the step (7) and the mean square error. Preferably, the calculation formula of the gaussian filter (or the mean filter) in the step (2) is as follows: Wherein (x, y) is the current pixel point, m is the template, src is the original image, a is the width of the template, b is the height of the template, and s (x, y) is the saturation value of the processed image at the point. Preferably, the calculation formula for performing laplace transform on the picture S1 in the step (3) is as follows: Wherein, (x, y) is the current pixel point, and src is the original image. Preferably, the condition of the selection set in the step (6) is that the threshold T1 is bright spots when the saturation value is greater than the threshold T1, and the threshold T1 is not bright spots when the saturation value is less than or equal to the threshold T1. Preferably, the algorithm formula adopted for performing the expansion operation on the picture S in the step (8) is as follows: preferably, the algorithm formula adopted for the etching operation on the picture S in the step (9) is as follows: Compared with the prior art, the method has the advantages of simple and effective algorithm and wide application range. The method is characterized in that the Gaussian filtering (mean filtering), the Laplace transformation and the decision tree algorithm are combined to find out th