A method and system for detecting cryptococcal capsule thickness based on image processing
Through the method based on image processing, a Cryptococci parameter database was established, and the edge detection algorithm and circumci division method were used to segment and calculate the thickness of the Cryptococci images, which solved the problems of low accuracy and large error in the existing technology of Cryptococci capsule thickness detection, achieving higher detection accuracy and accuracy.
Patent Information
- Application Number
- CN202510310514.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-17
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2045-03-17
AI Technical Summary
In the prior art, the capsular thickness of Cryptococcal is judged by using microscope observation. The accuracy is low and the error is large, so it is impossible to accurately measure the severity of Cryptococcal infection in patients.
Using an image processing method, a cryptococci image is collected and analyzed, a cryptococci parameter database is established, and the edge detection algorithm and circumferential circle division method are used to segment the images of the cryptococci to be tested, and the capsular thickness is calculated, thereby improving the accuracy of detection.
It effectively improves the accuracy of Cryptococcal capsule thickness detection, reduces calculation complexity and error, and provides a more accurate diagnostic basis.
Smart Images

Figure CN119831999B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a method and system for detecting cryptococcal capsule thickness based on image processing. Background Art
[0002] Cryptococcal infection can lead to serious health-threatening diseases such as cryptococcal meningitis and pneumonia. Clinically, it is necessary to combine detection technology to accurately and quickly detect whether a patient is infected with cryptococcus, so as to provide patients with timely diagnostic advice. At present, clinical detection methods are limited to detecting whether a patient is infected with cryptococcus and roughly assessing the number of infected cryptococcosis to measure the severity of the patient's cryptococcal infection. This obviously ignores the key morphological indicators that affect the pathogenicity of cryptococcosis, namely the thickness of the cryptococcal capsule, resulting in the inability to provide an adapted diagnostic solution.
[0003] At present, the capsule thickness of cryptococci is generally observed with the naked eye under a microscope, and the results will produce large errors due to changes in microscope parameters and subjective judgments of observers. Therefore, how to accurately detect the capsule thickness of cryptococci infected by patients is the key to measuring the severity of the patient's illness and inferring the progression of the disease. Summary of the invention
[0004] In view of the shortcomings of the prior art, the purpose of the present invention is to provide a method and system for detecting the thickness of Cryptococcal capsule based on image processing, aiming to solve the problem of low accuracy and large error in judging the thickness of Cryptococcal capsule using microscope observation in the prior art.
[0005] The first aspect of the present invention is to provide a method for detecting cryptococcal capsule thickness based on image processing, the method comprising the following steps:
[0006] S1, collecting a number of cryptococcal images, measuring the parameter information of cryptococcus in each cryptococcal image by image measurement software, marking the corresponding cryptococcal image according to the parameter information, and establishing a cryptococcal parameter database;
[0007] S2, based on the cryptococcal parameter database, obtaining preset parameter information corresponding to the cryptococcal image to be tested, wherein the preset parameter information includes preset quantity information and preset thickness information;
[0008] S3, using an edge detection algorithm to detect an edge image of the cryptococcal image to be detected, and processing the edge image according to an edge gradient threshold to obtain an edge curve;
[0009] S4, cyclically extracting pixel points of the edge curve, determining a circumscribed circle of the pixel points according to the pixel points, calculating the Euclidean distances of all pixel points from the circumscribed circle, and dividing to form at least one circumscribed circle according to the error calculation of the Euclidean distance;
[0010] S5, performing image segmentation on all circumscribed circles in the cryptococcal image to be detected to form at least one cryptococcal sub-image to be detected, and marking initial quantity information of the cryptococcal sub-image to be detected;
[0011] S6, based on the minimum pixel distance algorithm, obtaining the thickness curve of the cryptococcal capsule in the cryptococcal sub-image to be tested, and obtaining the initial thickness information of the cryptococcal capsule;
[0012] S7, performing detection error calculation on the initial quantity information and the preset quantity information to obtain a quantity error, and updating the output target quantity information according to the quantity error, performing detection error calculation on the initial thickness information and the preset thickness information to obtain a thickness error, and updating the output target thickness information according to the thickness error.
[0013] Compared with the prior art, the present invention has the beneficial effect that: the cryptococcal capsule thickness detection method based on image processing provided by the present invention can effectively improve the accuracy of cryptococcal capsule thickness detection. Specifically, by collecting a large number of cryptococcal images and corresponding parameter information, a cryptococcal database of cryptococcal images-parameter information is established, so as to obtain preset parameter information corresponding to the cryptococcal image to be detected, and the accuracy of measuring the cryptococcal capsule thickness can be effectively improved. Considering the characteristic that the cryptococcal capsule morphology is annular, the image segmentation of the cryptococcal image to be detected is performed by combining the edge detection algorithm-circumscribed circle division method, which can effectively reduce the calculation complexity of directly detecting parameter information of the cryptococcal image to be detected, and can effectively improve the precision and accuracy of image segmentation, thereby improving the accuracy and precision of measuring the cryptococcal image to be detected. Then, by adjusting the range of the edge gradient threshold and the edge pixel threshold, the problem of decreased accuracy of the detection quantity information and thickness information caused by different clarity of the cryptococcal image is avoided, and the accuracy and precision of measuring the cryptococcal image to be detected is further improved, thereby solving the technical problem of low accuracy and large error in judging the capsule thickness of cryptococci using a microscope.
[0014] According to one aspect of the above technical solution, a number of cryptococcal images are collected, parameter information of cryptococcus in each cryptococcal image is measured by image measurement software, and the cryptococcal image corresponding to the parameter information is marked according to the parameter information to establish a cryptococcal parameter database, which specifically includes:
[0015] Collecting a number of cryptococcal images, and measuring the historical capsule thickness of each cryptococcal capsule in a number of angle directions in each cryptococcal image by using image measurement software;
[0016] Calculating historical thickness information according to the historical capsule thickness, wherein the historical thickness information includes a minimum historical capsule thickness, a maximum historical capsule thickness, and an average historical capsule thickness;
[0017] Count the number of cryptococci in each cryptococcal image to obtain historical number information;
[0018] The historical thickness information and the historical quantity information are used as parameter information, each cryptococcal image is used as an input image, and the parameter information is used as an output response to establish a cryptococcal parameter database.
[0019] According to one aspect of the above technical solution, the step of using an edge detection algorithm to detect the edge image of the cryptococcal image to be detected, and processing the edge image according to the edge gradient threshold to obtain the edge curve specifically includes:
[0020] grayscale conversion is performed on the cryptococcal image to be tested to obtain a grayscale image, and Gaussian filtering is used to smooth the grayscale image;
[0021] The first-order derivative of the horizontal gradient and the first-order derivative of the vertical gradient of the smoothed grayscale image are calculated respectively. According to the first-order derivative of the horizontal gradient and the first-order derivative of the vertical gradient, the edge gradient and angle of the grayscale image are calculated. The calculation formula is as follows:
[0022] ,
[0023] ,
[0024] in, is the first-order derivative of the horizontal gradient, is the first-order derivative of the vertical gradient, is the edge gradient, is the angle;
[0025] According to the edge gradient and the angle, retaining the edge image with the maximum gradient amplitude in the grayscale image by a non-maximum suppression algorithm;
[0026] Processing the edge image according to an edge gradient threshold to determine a strong edge region and a weak edge region;
[0027] The strong edge region and the weak edge region are connected to form an edge curve.
[0028] According to one aspect of the above technical solution, the step of cyclically extracting pixel points of the edge curve, determining a circumscribed circle of the pixel points according to the pixel points, calculating the Euclidean distance of all pixel points from the circumscribed circle, and dividing and forming at least one circumscribed circle according to the error calculation of the Euclidean distance specifically includes:
[0029] S40, randomly extracting four pixel points from the edge curve, namely , , and , take three pixel combinations, and calculate the center coordinates and radius of the circumscribed circle formed by each combination. The formula is as follows:
[0030] ,
[0031] ,
[0032] ,
[0033] in, To pass , and The circumscribed circle is determined in The coordinates of the center of the axis, To pass , and The circumscribed circle is determined in The coordinates of the center of the axis, To pass , and Determine the radius of the circumscribed circle, , and They are , and exist The component in the axial direction, , and They are , and exist Component in the axial direction;
[0034] S41, calculating the Euclidean distance of all pixel points from the center of the circumscribed circle, calculating the error value between the Euclidean distance and the radius of the circumscribed circle, and determining whether the error value is less than an edge pixel threshold;
[0035] If yes, it is determined that the current pixel belongs to the current circumscribed circle, and the current pixel is deleted from the edge curve, and the process returns to step S40 until the number of pixels cannot form a circumscribed circle;
[0036] If not, it is determined that the current pixel point does not belong to the current circumscribed circle, pixel points are continuously extracted, and the process returns to step S40.
[0037] According to one aspect of the above technical solution, based on the minimum pixel distance algorithm, the step of obtaining the thickness curve of the cryptococcal capsule in the cryptococcal sub-image to be tested and obtaining the initial thickness information of the cryptococcal capsule specifically includes:
[0038] Remove the pixel points on the circumscribed circle and calculate the Euclidean distance of each pixel point in the circumscribed circle of the cryptococcal sub-image to be tested;
[0039] According to the minimum pixel distance algorithm, the minimum value of the Euclidean distance is obtained as the capsule thickness at the corresponding pixel point of the circumscribed circle;
[0040] The maximum value, minimum value and average value of the capsule thickness at all pixel points within the circumscribed circle are calculated as the maximum initial capsule thickness, minimum initial capsule thickness and average initial capsule thickness of the initial thickness information, respectively.
[0041] According to one aspect of the above technical solution, the step of performing detection error calculation on the initial quantity information and the preset quantity information to obtain a quantity error, and updating the output target quantity information according to the quantity error specifically includes:
[0042] The detection error calculation is performed on the initial quantity information and the preset quantity information to obtain the quantity error. The calculation formula is as follows:
[0043] ,
[0044] in, is the quantity error, is the initial quantity information, The preset quantity information corresponding to the Cryptococcus parameter database;
[0045] Determining whether the quantity error is greater than a quantity threshold;
[0046] If yes, increase the edge gradient threshold in step S3 by a preset multiple, and return to step S3 until the output target quantity information is updated;
[0047] If not, it is determined that the initial quantity information is the target quantity information, and the target quantity information is updated and output.
[0048] According to one aspect of the above technical solution, the steps of calculating the detection error between the initial thickness information and the preset thickness information to obtain the thickness error, and updating the output target thickness information according to the thickness error specifically include:
[0049] The initial thickness information and the preset thickness information are subjected to detection error calculation to obtain a thickness error, and the calculation formula is as follows:
[0050] ,
[0051] in, is the thickness error, , and They are the maximum initial capsule thickness, minimum initial capsule thickness and average initial capsule thickness of the initial thickness information, , and They are respectively the maximum preset capsule thickness, the minimum preset capsule thickness and the average preset capsule thickness corresponding to the preset thickness information;
[0052] Determining whether the thickness error is greater than a thickness threshold;
[0053] If yes, increase the edge pixel threshold in step S4 by a preset multiple, and return to step S4 until the target thickness information is updated and output;
[0054] If not, it is determined that the initial thickness information is the target thickness information, and the target thickness information is updated and output.
[0055] The second aspect of the present invention is to provide a cryptococcal capsule thickness detection system based on image processing, which is used to execute any one of the cryptococcal capsule thickness detection methods based on image processing described above, and the system comprises:
[0056] A database establishment module is used to collect a number of cryptococcal images, measure the parameter information of cryptococcus in each cryptococcal image by image measurement software, mark the corresponding cryptococcal image according to the parameter information, and establish a cryptococcal parameter database;
[0057] An information acquisition module, used for acquiring preset parameter information corresponding to the cryptococcal image to be tested based on the cryptococcal parameter database, wherein the preset parameter information includes preset quantity information and preset thickness information;
[0058] An edge curve detection module is used to detect the edge image of the cryptococcal image to be detected by using an edge detection algorithm, and process the edge image according to an edge gradient threshold to obtain an edge curve;
[0059] A circumscribed circle division module, used for cyclically extracting pixel points of the edge curve, determining a circumscribed circle of the pixel points according to the pixel points, calculating the Euclidean distance of all pixel points from the circumscribed circle, and dividing to form at least one circumscribed circle according to the error calculation of the Euclidean distance;
[0060] A quantity information calculation module is used to perform image segmentation on all circumscribed circles in the cryptococcal image to be detected, form at least one cryptococcal sub-image to be detected, and mark the initial quantity information of the cryptococcal sub-image to be detected;
[0061] A thickness information calculation module is used to obtain the thickness curve of the cryptococcal capsule in the cryptococcal sub-image to be tested based on a minimum pixel distance algorithm to obtain the initial thickness information of the cryptococcal capsule;
[0062] The information output module is used to perform a detection error calculation between the initial quantity information and the preset quantity information to obtain a quantity error, and update the output target quantity information according to the quantity error; perform a detection error calculation between the initial thickness information and the preset thickness information to obtain a thickness error, and update the output target thickness information according to the thickness error.
[0063] The third aspect of the present invention is to provide a readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-mentioned method for detecting cryptococcal capsule thickness based on image processing.
[0064] The fourth aspect of the present invention is to provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the above-mentioned method for detecting cryptococcal capsule thickness based on image processing are implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 This is a flow chart of the method for detecting cryptococcal capsule thickness based on image processing in Example 1 of the present invention;
[0066] Figure 2 It is a structural block diagram of a cryptococcal capsule thickness detection system based on image processing in Embodiment 2 of the present invention;
[0067] Component symbol description:
[0068] Database establishment module 100, information acquisition module 200, edge curve detection module 300, circumscribed circle division module 400, quantity information calculation module 500, thickness information calculation module 600, information output module 700;
[0069] The following specific implementation manner will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION
[0070] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Several embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.
[0071] Embodiment 1
[0072] See also Figure 1 , shown is a method for detecting cryptococcal capsule thickness based on image processing in the first embodiment of the present invention, and the method includes the following steps.
[0073] S1, collecting a number of cryptococcal images, measuring the parameter information of cryptococcus in each cryptococcal image by image measurement software, marking the corresponding cryptococcal image according to the parameter information, and establishing a cryptococcal parameter database;
[0074] Specifically, S10, collecting a number of cryptococcal images, and measuring the historical capsule thickness of each cryptococcal capsule in a number of angle directions in each cryptococcal capsule in each cryptococcal image by using image measurement software;
[0075] By way of example and not limitation, for example, adjusting microscope parameters to acquire the best resolution image of Cryptococcus, that is, adjusting the microscope working height, magnification, and depth of field to obtain the best resolution image of Cryptococcus, and then using the ruler tool in Photoshop software to measure the historical capsule thickness of each Cryptococcal capsule in ten angular directions where the capsule is evenly distributed.
[0076] S11, calculating historical thickness information according to the historical capsule thickness, wherein the historical thickness information includes a minimum historical capsule thickness, a maximum historical capsule thickness, and an average historical capsule thickness;
[0077] S12, counting the number of cryptococci in each cryptococcal image to obtain historical number information;
[0078] S13, using the historical thickness information and the historical quantity information as parameter information, taking each cryptococcal image as an input image, and the parameter information as an output response, to establish a cryptococcal parameter database.
[0079] S2, based on the cryptococcal parameter database, obtaining preset parameter information corresponding to the cryptococcal image to be tested, wherein the preset parameter information includes preset quantity information and preset thickness information;
[0080] Among them, by collecting a large number of cryptococcal images and corresponding parameter information, a cryptococcal database of cryptococcal image-parameter information is established to facilitate the acquisition of preset parameter information corresponding to the cryptococcal image to be tested, which can effectively improve the accuracy of measuring the cryptococcal capsule thickness.
[0081] S3, using an edge detection algorithm to detect an edge image of the cryptococcal image to be detected, and processing the edge image according to an edge gradient threshold to obtain an edge curve;
[0082] Specifically, S30, gray-scale conversion is performed on the cryptococcal image to be detected to obtain a gray-scale image, and Gaussian filtering is used to smooth the gray-scale image;
[0083] Among them, Gaussian filtering is used to eliminate the noise effect in the grayscale image.
[0084] S31, respectively calculating the first-order derivative of the horizontal gradient and the first-order derivative of the vertical gradient of the smoothed grayscale image, and calculating the edge gradient and angle of the grayscale image according to the first-order derivative of the horizontal gradient and the first-order derivative of the vertical gradient, the calculation formula is as follows:
[0085] ,
[0086] ,
[0087] in, is the first-order derivative of the horizontal gradient, is the first-order derivative of the vertical gradient, Edge gradient, is the angle;
[0088] S32, retaining an edge image with a maximum gradient amplitude in the grayscale image by a non-maximum suppression algorithm according to the edge gradient and the angle;
[0089] S33, processing the edge image according to the edge gradient threshold to determine a strong edge area and a weak edge area;
[0090] The edge gradient threshold will be updated in a cyclic iteration with the detection method of this embodiment to improve the accuracy of the detection method.
[0091] S34, connecting the strong edge region and the weak edge region to form an edge curve.
[0092] S4, cyclically extracting pixel points of the edge curve, determining a circumscribed circle of the pixel points according to the pixel points, calculating the Euclidean distances of all pixel points from the circumscribed circle, and dividing to form at least one circumscribed circle according to the error calculation of the Euclidean distance;
[0093] Specifically, S40 randomly extracts four pixel points from the edge curve, namely , , and , take three pixel combinations, and calculate the center coordinates and radius of the circumscribed circle formed by each combination. The formula is as follows:
[0094] ,
[0095] ,
[0096] ,
[0097] in, To pass , and The circumscribed circle is determined in The coordinates of the center of the axis, To pass , and The circumscribed circle is determined in The coordinates of the center of the axis, To pass , and Determine the radius of the circumscribed circle, , and They are , and exist The component in the axial direction, , and They are , and exist Component in the axial direction;
[0098] S41, calculating the Euclidean distance of all pixel points from the center of the circumscribed circle, calculating the error value between the Euclidean distance and the radius of the circumscribed circle, and determining whether the error value is less than an edge pixel threshold;
[0099] If yes, it is determined that the current pixel belongs to the current circumscribed circle, and the current pixel is deleted from the edge curve, and the process returns to step S40 until the number of pixels cannot form a circumscribed circle;
[0100] If not, it is determined that the current pixel point does not belong to the current circumscribed circle, pixel points are continuously extracted, and the process returns to step S40.
[0101] It should be noted that the edge pixel threshold is updated with the cyclic iteration of the detection method to reduce the false detection rate of the noise edge. In addition, considering the circular shape of the cryptococcal capsule, the circumscribed circle is calculated by cyclically extracting pixel points to achieve circumscribed circle division, thereby achieving division to form a single cryptococcal capsule, improving the accuracy of the measurement, and avoiding the problem of inaccurate measurement caused by cryptococcal overlap.
[0102] S5, performing image segmentation on all circumscribed circles in the cryptococcal image to be detected to form at least one cryptococcal sub-image to be detected, and marking initial quantity information of the cryptococcal sub-image to be detected;
[0103] Among them, considering the characteristic that the cryptococcal capsule morphology is ring-shaped, the image segmentation of the cryptococcal image to be tested is performed by combining the edge detection algorithm-circumscribed circle division method, which can effectively reduce the computational complexity of direct detection parameter information of the cryptococcal image to be tested, and can effectively improve the accuracy and precision of image segmentation, thereby improving the accuracy and precision of the measurement of the cryptococcal image to be tested.
[0104] S6, based on the minimum pixel distance algorithm, obtaining the thickness curve of the cryptococcal capsule in the cryptococcal sub-image to be tested, and obtaining the initial thickness information of the cryptococcal capsule;
[0105] Specifically, S60, removing the pixel points on the circumscribed circle, and calculating the Euclidean distance of each pixel point in the circumscribed circle of the cryptococcal sub-image to be tested;
[0106] S61, according to the minimum pixel distance algorithm, obtaining the minimum value of the Euclidean distance as the capsule thickness at the corresponding pixel point of the circumscribed circle;
[0107] S62, calculating the maximum value, minimum value and average value of the capsule thickness at all pixel points within the circumscribed circle, and using them as the maximum initial capsule thickness, the minimum initial capsule thickness and the average initial capsule thickness of the initial thickness information, respectively.
[0108] Among them, three thickness calculations were used to evaluate the thickness index of Cryptococcus to improve the accuracy of thickness index testing.
[0109] S7, performing detection error calculation on the initial quantity information and the preset quantity information to obtain a quantity error, and updating the output target quantity information according to the quantity error, performing detection error calculation on the initial thickness information and the preset thickness information to obtain a thickness error, and updating the output target thickness information according to the thickness error.
[0110] Specifically, in S70, the detection error is calculated between the initial quantity information and the preset quantity information to obtain a quantity error, and the calculation formula is as follows:
[0111] ,
[0112] in, is the quantity error, is the initial quantity information, The preset quantity information corresponding to the Cryptococcus parameter database;
[0113] S71, determining whether the quantity error is greater than a quantity threshold;
[0114] If yes, increase the edge gradient threshold in step S3 by a preset multiple, and return to step S3 until the output target quantity information is updated;
[0115] If not, determining that the initial quantity information is the target quantity information, and updating and outputting the target quantity information;
[0116] S72, performing detection error calculation on the initial thickness information and the preset thickness information to obtain a thickness error, and the calculation formula is as follows:
[0117] ,
[0118] in, is the thickness error, , and They are the maximum initial capsule thickness, minimum initial capsule thickness and average initial capsule thickness of the initial thickness information, , and They are respectively the maximum preset capsule thickness, the minimum preset capsule thickness and the average preset capsule thickness corresponding to the preset thickness information;
[0119] S73, determining whether the thickness error is greater than a thickness threshold;
[0120] If yes, increase the edge pixel threshold in step S4 by a preset multiple, and return to step S4 until the target thickness information is updated and output;
[0121] If not, it is determined that the initial thickness information is the target thickness information, and the target thickness information is updated and output.
[0122] By way of example and not limitation, for example, the preset multiple may be 1.001, 1.003, 1.005, 1.008, 1.010, and so on.
[0123] It should be noted that, considering the differences in clarity and background information of different cryptococcal images, the edge gradient threshold and edge pixel threshold adapted to cryptococcal images with different clarity and background information will also be inconsistent. Therefore, it is necessary to continuously adjust the range of the edge gradient threshold and the edge pixel threshold to improve the edge detection accuracy for cryptococcal images with differences in clarity and background information, thereby avoiding the problem of decreased accuracy of detection quantity information and thickness information caused by different clarity of cryptococcal images.
[0124] To further illustrate this embodiment, the average value of the relative errors of 840 cryptococcal images was calculated as the average error value, and the average error value was used as the evaluation index, where the relative error was equal to the average value of the quantity relative error and the thickness relative error, the quantity relative error was equal to the quantity error divided by the preset quantity information corresponding to the cryptococcal parameter database, and the thickness relative error was equal to the thickness error divided by the preset capsule thickness corresponding to the cryptococcal parameter database; the experimental results are shown in Table 1.
[0125] Table 1:
[0126]
[0127] It can be seen from the results in Table 1 that the method of this embodiment has a lower error, which reflects the prediction accuracy of the detection model in this embodiment. The method of this embodiment has good performance in detecting the thickness and quantity of Cryptococcal capsules.
[0128] Based on the circular morphology and clinical diagnostic characteristics of the cryptococcal capsule, an adaptive cryptococcal image segmentation architecture and capsule detection model were designed, which improved the detection accuracy of the model and provided a systematic solution for the accurate identification of the cryptococcal capsule thickness.
[0129] In summary, the cryptococcal capsule thickness detection method based on image processing in the above embodiment of the present invention can effectively improve the accuracy of cryptococcal capsule thickness detection. Specifically, by collecting a large number of cryptococcal images and corresponding parameter information, a cryptococcal database of cryptococcal image-parameter information is established, which can effectively improve the accuracy of measuring cryptococcal capsule thickness. Considering the characteristic that the cryptococcal capsule morphology is ring-shaped, the image segmentation of the cryptococcal image to be tested is performed in combination with the edge detection algorithm-circumscribed circle division method, which can effectively reduce the calculation complexity of directly detecting parameter information of the cryptococcal image to be tested, and can effectively improve the precision and accuracy of image segmentation, thereby improving the accuracy and precision of the measurement of the cryptococcal image to be tested. By adjusting the range of the edge gradient threshold and the edge pixel threshold, the problem of decreased accuracy of the detection quantity information and thickness information caused by the different clarity of the cryptococcal image is avoided, and the accuracy and precision of the measurement of the cryptococcal image to be tested is further improved, thereby solving the technical problem of low accuracy and large error in judging the capsule thickness of cryptococci using a microscope.
[0130] Embodiment 2
[0131] See also Figure 2 , shown is a cryptococcal capsule thickness detection system based on image processing proposed in the second embodiment of the present invention, the system comprising:
[0132] The database establishment module 100 is used to collect a number of cryptococcal images, measure the parameter information of cryptococcus in each cryptococcal image by image measurement software, mark the corresponding cryptococcal image according to the parameter information, and establish a cryptococcal parameter database;
[0133] An information acquisition module 200 is used to acquire preset parameter information corresponding to the cryptococcal image to be detected based on the cryptococcal parameter database, wherein the preset parameter information includes preset quantity information and preset thickness information;
[0134] The edge curve detection module 300 is used to detect the edge image of the cryptococcal image to be detected by using an edge detection algorithm, and process the edge image according to an edge gradient threshold to obtain an edge curve;
[0135] A circumscribed circle division module 400 is used to cyclically extract pixel points of the edge curve, determine a circumscribed circle of the pixel points according to the pixel points, calculate the Euclidean distance of all pixel points from the circumscribed circle, and divide and form at least one circumscribed circle according to the error calculation of the Euclidean distance;
[0136] The quantity information calculation module 500 is used to perform image segmentation on all circumscribed circles in the cryptococcal image to be detected, form at least one cryptococcal sub-image to be detected, and mark the initial quantity information of the cryptococcal sub-image to be detected;
[0137] The thickness information calculation module 600 is used to obtain the thickness curve of the cryptococcal capsule in the cryptococcal sub-image to be tested based on the minimum pixel distance algorithm to obtain the initial thickness information of the cryptococcal capsule;
[0138] The information output module 700 is used to perform a detection error calculation between the initial quantity information and the preset quantity information to obtain a quantity error, and update the output target quantity information based on the quantity error; perform a detection error calculation between the initial thickness information and the preset thickness information to obtain a thickness error, and update the output target thickness information based on the thickness error.
[0139] In summary, the cryptococcal capsule thickness detection system based on image processing in the above embodiment of the present invention can effectively improve the accuracy of cryptococcal capsule thickness detection. Specifically, a cryptococcal database of cryptococcal image-parameter information is established through a database establishment module, which can effectively improve the accuracy of measuring cryptococcal capsule thickness. Considering the characteristic that the cryptococcal capsule morphology is ring-shaped, cryptococci are divided through an edge curve detection module and a circumscribed circle division module, and the image to be tested cryptococcal image is segmented through a quantity information calculation module, which can effectively reduce the calculation complexity of directly detecting parameter information of the cryptococcal image to be tested, and can effectively improve the precision and accuracy of image segmentation, thereby improving the accuracy and precision of measuring the cryptococcal image to be tested. The range of the edge gradient threshold and the edge pixel threshold is adjusted through the information output module to avoid the problem of decreased accuracy of the detection quantity information and thickness information caused by different clarity of the cryptococcal image, and further improve the accuracy and precision of measuring the cryptococcal image to be tested, thereby solving the technical problem of low accuracy and large error in judging the capsule thickness of cryptococci using a microscope.
[0140] Embodiment 3
[0141] The third embodiment of the present invention provides a storage medium on which computer instructions are stored. When the instructions are executed by a processor, the steps of the method described in the first embodiment are implemented.
[0142] Embodiment 4
[0143] A fourth embodiment of the present invention provides a device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method described in the first embodiment when executing the program.
[0144] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0145] Those skilled in the art will appreciate that the logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be specifically implemented in any computer-readable storage medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For purposes of this specification, a "computer-readable storage medium" may be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0146] More specific examples (a non-exhaustive list) of computer-readable storage media include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable storage medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
[0147] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or a combination thereof: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0148] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0149] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A method for detecting cryptococcal capsule thickness based on image processing, characterized in that: The method comprises the following steps: S1, collecting a number of cryptococcal images, measuring the parameter information of cryptococcus in each cryptococcal image by image measurement software, marking the corresponding cryptococcal image according to the parameter information, and establishing a cryptococcal parameter database; S2, based on the cryptococcal parameter database, obtaining preset parameter information corresponding to the cryptococcal image to be tested, wherein the preset parameter information includes preset quantity information and preset thickness information; S3, using an edge detection algorithm to detect an edge image of the cryptococcal image to be tested, and processing the edge image according to an edge gradient threshold to obtain an edge curve; S4, cyclically extracting pixel points of the edge curve, determining a circumscribed circle of the pixel points according to the pixel points, calculating the Euclidean distances of all pixel points from the circumscribed circle, and dividing to form at least one circumscribed circle according to the error calculation of the Euclidean distance; S5, performing image segmentation on all circumscribed circles in the cryptococcal image to be detected to form at least one cryptococcal sub-image to be detected, and marking initial quantity information of the cryptococcal sub-image to be detected; S6, based on the minimum pixel distance algorithm, obtaining the thickness curve of the cryptococcal capsule in the cryptococcal sub-image to be tested, and obtaining the initial thickness information of the cryptococcal capsule; S7, performing detection error calculation on the initial quantity information and the preset quantity information to obtain a quantity error, and updating the output target quantity information according to the quantity error, performing detection error calculation on the initial thickness information and the preset thickness information to obtain a thickness error, and updating the output target thickness information according to the thickness error.
2. The method for detecting cryptococcal capsule thickness based on image processing according to claim 1, characterized in that: The steps of collecting a number of cryptococcal images, measuring the parameter information of cryptococcus in each cryptococcal image by image measurement software, marking the corresponding cryptococcal image according to the parameter information, and establishing a cryptococcal parameter database specifically include: Collecting a number of cryptococcal images, and measuring the historical capsule thickness of each cryptococcal capsule in a number of angle directions in each cryptococcal image by using image measurement software; Calculating historical thickness information according to the historical capsule thickness, wherein the historical thickness information includes a minimum historical capsule thickness, a maximum historical capsule thickness, and an average historical capsule thickness; Count the number of cryptococci in each cryptococcal image to obtain historical number information; The historical thickness information and the historical quantity information are used as parameter information, each cryptococcal image is used as an input image, and the parameter information is used as an output response to establish a cryptococcal parameter database.
3. The method for detecting cryptococcal capsule thickness based on image processing according to claim 2, characterized in that: The step of using an edge detection algorithm to detect the edge image of the cryptococcal image to be detected, and processing the edge image according to an edge gradient threshold to obtain an edge curve specifically includes: grayscale conversion is performed on the cryptococcal image to be tested to obtain a grayscale image, and Gaussian filtering is used to smooth the grayscale image; The first-order derivative of the horizontal gradient and the first-order derivative of the vertical gradient of the smoothed grayscale image are calculated respectively. According to the first-order derivative of the horizontal gradient and the first-order derivative of the vertical gradient, the edge gradient and angle of the grayscale image are calculated. The calculation formula is as follows: , , in, is the first-order derivative of the horizontal gradient, is the first-order derivative of the vertical gradient, Edge gradient, is the angle; According to the edge gradient and the angle, retaining the edge image with the maximum gradient amplitude in the grayscale image by a non-maximum suppression algorithm; Processing the edge image according to an edge gradient threshold to determine a strong edge region and a weak edge region; The strong edge region and the weak edge region are connected to form an edge curve.
4. The method for detecting cryptococcal capsule thickness based on image processing according to claim 3, characterized in that: The step of cyclically extracting pixel points of the edge curve, determining a circumscribed circle of the pixel points according to the pixel points, calculating the Euclidean distances of all pixel points from the circumscribed circle, and dividing and forming at least one circumscribed circle according to the error calculation of the Euclidean distance specifically includes the following steps: S40, randomly extracting four pixel points from the edge curve, namely , , and , take three pixel combinations, and calculate the center coordinates and radius of the circumscribed circle formed by each combination. The formula is as follows: , , , in, To pass , and The circumscribed circle is determined in The coordinates of the center of the axis, To pass , and The circumscribed circle is determined in The coordinates of the center of the axis, To pass , and Determine the radius of the circumscribed circle, , and They are , and exist The component in the axial direction, , and They are , and exist Component in the axial direction; S41, calculating the Euclidean distance of all pixel points from the center of the circumscribed circle, calculating the error value between the Euclidean distance and the radius of the circumscribed circle, and determining whether the error value is less than an edge pixel threshold; If yes, it is determined that the current pixel belongs to the current circumscribed circle, and the current pixel is deleted from the edge curve, and the process returns to step S40 until the number of pixels cannot form a circumscribed circle; If not, it is determined that the current pixel point does not belong to the current circumscribed circle, pixel points are continuously extracted, and the process returns to step S40.
5. The method for detecting cryptococcal capsule thickness based on image processing according to claim 4, characterized in that: The step of obtaining the thickness curve of the cryptococcal capsule in the cryptococcal sub-image to be tested based on the minimum pixel distance algorithm to obtain the initial thickness information of the cryptococcal capsule specifically includes: Remove the pixel points on the circumscribed circle and calculate the Euclidean distance of each pixel point in the circumscribed circle of the cryptococcal sub-image to be tested; According to the minimum pixel distance algorithm, the minimum value of the Euclidean distance is obtained as the capsule thickness at the corresponding pixel point of the circumscribed circle; The maximum value, minimum value and average value of the capsule thickness at all pixel points within the circumscribed circle are calculated as the maximum initial capsule thickness, minimum initial capsule thickness and average initial capsule thickness of the initial thickness information, respectively.
6. The method for detecting cryptococcal capsule thickness based on image processing according to claim 5, characterized in that: The step of performing detection error calculation on the initial quantity information and the preset quantity information to obtain a quantity error, and updating the output target quantity information according to the quantity error specifically includes: The detection error calculation is performed on the initial quantity information and the preset quantity information to obtain the quantity error. The calculation formula is as follows: , in, is the quantity error, is the initial quantity information, The preset quantity information corresponding to the Cryptococcus parameter database; Determining whether the quantity error is greater than a quantity threshold; If yes, increase the edge gradient threshold in step S3 by a preset multiple, and return to step S3 until the output target quantity information is updated; If not, it is determined that the initial quantity information is the target quantity information, and the target quantity information is updated and output.
7. The method for detecting cryptococcal capsule thickness based on image processing according to claim 6, characterized in that: The step of calculating the detection error between the initial thickness information and the preset thickness information to obtain a thickness error, and updating and outputting the target thickness information according to the thickness error specifically includes: The initial thickness information and the preset thickness information are subjected to detection error calculation to obtain a thickness error, and the calculation formula is as follows: , in, is the thickness error, , and They are the maximum initial capsule thickness, minimum initial capsule thickness and average initial capsule thickness of the initial thickness information, , and They are respectively the maximum preset capsule thickness, the minimum preset capsule thickness and the average preset capsule thickness corresponding to the preset thickness information; Determining whether the thickness error is greater than a thickness threshold; If yes, increase the edge pixel threshold in step S4 by a preset multiple, and return to step S4 until the target thickness information is updated and output; If not, it is determined that the initial thickness information is the target thickness information, and the target thickness information is updated and output.
8. A cryptococcal capsule thickness detection system based on image processing, characterized in that: The system is used to perform the cryptococcal capsule thickness detection method based on image processing according to any one of claims 1 to 7, comprising: A database establishment module is used to collect a number of cryptococcal images, measure the parameter information of cryptococcus in each cryptococcal image by image measurement software, mark the corresponding cryptococcal image according to the parameter information, and establish a cryptococcal parameter database; An information acquisition module, used for acquiring preset parameter information corresponding to the cryptococcal image to be tested based on the cryptococcal parameter database, wherein the preset parameter information includes preset quantity information and preset thickness information; An edge curve detection module is used to detect the edge image of the cryptococcal image to be detected by using an edge detection algorithm, and process the edge image according to an edge gradient threshold to obtain an edge curve; A circumscribed circle division module, used for cyclically extracting pixel points of the edge curve, determining a circumscribed circle of the pixel points according to the pixel points, calculating the Euclidean distance of all pixel points from the circumscribed circle, and dividing to form at least one circumscribed circle according to the error calculation of the Euclidean distance; A quantity information calculation module is used to perform image segmentation on all circumscribed circles in the cryptococcal image to be detected, form at least one cryptococcal sub-image to be detected, and mark the initial quantity information of the cryptococcal sub-image to be detected; A thickness information calculation module is used to obtain the thickness curve of the cryptococcal capsule in the cryptococcal sub-image to be tested based on a minimum pixel distance algorithm to obtain the initial thickness information of the cryptococcal capsule; The information output module is used to perform a detection error calculation between the initial quantity information and the preset quantity information to obtain a quantity error, and update the output target quantity information according to the quantity error; perform a detection error calculation between the initial thickness information and the preset thickness information to obtain a thickness error, and update the output target thickness information according to the thickness error.
9. A readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method for detecting cryptococcal capsule thickness based on image processing according to any one of claims 1 to 7 are implemented.
10. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the method for detecting cryptococcal capsule thickness based on image processing as claimed in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Streptococcus pneumoniae freeze-drying protective agent
CN111849781A
Cryptococcus identification method and system based on data enhancement DETR
CN118521572A