A colony counting method and colony counter
By using a camera to acquire images in the colony counting method and combining a pre-trained support vector machine for automatic judgment, the problem of insufficient artificial counting and insufficient analysis capabilities of automated equipment in the prior art is solved, and efficient and reliable automatic colony counting is achieved.
Patent Information
- Application Number
- CN202210344047.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-31
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2042-03-31
AI Technical Summary
The existing colony counting methods rely on manual counting, which consumes a lot of energy and has measurement uncertainty. The analysis ability of automation equipment is weak, and depends on the experience and lighting methods of the experimenter, and have poor repetition.
A colony counting method is adopted to collect the Petri dish images through the camera, pre-process and segment, and feature extraction and classification prediction are used to use the pre-trained soft boundary support vector machine to automatically determine the colony area, realizing automatic counting without human intervention.
It realizes automatic counting of colonies without manual intervention, reduces operating costs and errors, improves the reliability and repeatability of counting, and meets the traceability principle of GMP.
Smart Images

Figure CN115063340B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of colony counting, and in particular to a colony counting method and a colony counter. Background Art
[0002] Cultivating microorganisms at a certain temperature and humidity on an agar medium containing nutrients and counting the number of microbial colonies after cultivation is a quality control method widely used in microbial limit tests in the food and pharmaceutical industries. In addition, the dynamics of microbial growth has been increasingly used in strain analysis and personalized antibiotic therapy. In recent years, the development of rapid detection technology that does not require cultivation has enabled real-time, online microbial inspections to be applied in some fields, but the plate culture method for checking colony forming units (CFU) is still the most widely used and industry-accepted inspection method. In the foreseeable future, the CFU method will remain the mainstream method for microbial inspections.
[0003] At present, the commonly used culture and counting method in the industry is still to culture in an ordinary constant temperature incubator and then count manually. Counting may occur after the end of the culture or multiple times during the culture process. Regardless of the method used, manual counting of a large number of culture dishes consumes a lot of energy of microbiological experimenters. And there is no clear and systematic definition of visible "colonies", so different experimenters and different laboratories may get different results for the same culture dish. In some critical occasions, this measurement uncertainty will bring unacceptable quality risks. In addition, the manual counting process relies entirely on the judgment of the experimenter and lacks certain objective standards, leaving the possibility of tampering with the experimental results, which does not meet the traceability principle of GMP.
[0004] In response to these problems, people have tried many times to develop automatic colony counters based on computer image acquisition and analysis, and commercial products have been launched. These solutions all have automatic image processing functions and corresponding acquisition and storage systems, and some are also equipped with user rights management. Some products are equipped with dedicated lighting and image acquisition systems to enhance image consistency, while others allow analysis using photos taken with smartphones, for example.
[0005] For the obtained pictures, the image analysis software on the computer provides a series of specially developed image algorithms for users to choose the one that best suits the current culture dish and colony conditions, and make appropriate adjustments to the image processing parameters.
[0006] After the image analysis is completed, there are usually some post-processing steps, such as adding the number of areas determined to be colonies to the colony count of the current dish, classifying the colonies based on the aforementioned features, and / or generating some statistical information based on the colonies on the current dish. Finally, some products will generate a report.
[0007] Limited by the academic level of computer vision, computer processing efficiency, and the cost of optical and digital imaging systems, the analytical capabilities of existing equipment of this type are generally weak. In order to adapt to colonies with complex morphology and color and culture media for various purposes, some examples choose to provide a series of light sources and algorithm presets, and provide a large number of adjustable parameters. This approach is highly dependent on the experience of experimenters using automatic counters to select the most appropriate lighting and algorithms for the current culture dish. The learning cost is high, and the counting results are highly dependent on the choice of lighting methods and image processing parameters. The repeatability is poor and it has no advantage over manual counting.
[0008] For example, the "bacterial colony counter" disclosed in the Chinese patent literature, with publication number CN208903298U, includes a base, an optical axis, a top plate, a camera mounting plate, a camera, a rotating motor, a light source, legs, a culture dish placement table, a rotating support, and a lens. This solution requires constant adjustment of the camera angle and the height of the top plate during counting, and has a complex structure and is difficult to use. Too many factors that need to be controlled will affect the final counting effect. Summary of the invention
[0009] The present invention aims to overcome the problems of high cost and high dependence of counting effect on the selection of lighting mode and image processing parameters in the prior art, and provides a colony counting method and a colony counter, which can automatically process according to images without manual intervention and eliminate external influences.
[0010] In order to achieve the above object, the present invention adopts the following technical solutions:
[0011] A colony counting method comprising the following:
[0012] S1. Preprocessing the bacterial colony image captured by the acquisition module;
[0013] S2, segmenting the preprocessed image;
[0014] S3. After preprocessing and segmentation, the area corresponding to a single colony is obtained, and features are extracted for each area. The feature extracted vector is input into the pre-trained soft-margin support vector machine for classification prediction to determine whether the current area is a colony.
[0015] Preferably, the S1 includes the following contents:
[0016] S101, judging whether the current lighting mode is bright field or dark field based on the comparison of the average brightness of the bacterial colony image with the preset value, if the current lighting mode is detected as bright field, performing inversion processing, and then proceeding to S102, if the current lighting mode is detected as dark field, proceeding to S102;
[0017] S102, the preprocessing program performs binarization processing on the bacterial colony image, and after binarization, the edge of the culture dish presents dense concentric circles distributed radially, and the concentric circles have a broken part in the middle;
[0018] S103, correcting the broken parts of the concentric circles, performing morphological operations including dilation, erosion, opening, and closing on the image, so that the concentric circles at the edges merge into rings;
[0019] S104, performing a filling operation on the corrected binary image to hide the internal structural features, and obtaining a circle corresponding to the culture dish, the center of the circle is the center of the culture dish, and the radius is the radius of the culture dish;
[0020] S105. Make a square outside the circle described in S104 and crop the image along the edge of the square to obtain an image with only the culture dish left. Check whether the image obtained in this step has filter membrane features. If so, repeat steps S101-S104 to obtain an image with only the filter membrane left.
[0021] Preferably, the pretreatment further comprises the following:
[0022] A model pattern is created for the image background, and then image difference is performed.
[0023] Preferably, the steps of establishing a model pattern and performing image difference specifically include:
[0024] S106, transforming the circular culture dish image into a square image by performing polar coordinate to rectangular coordinate transformation, wherein the center pixels of the culture dish on one side are interpolated and expanded, and the edges of the culture dish are concentrated on the other side;
[0025] S107, analyzing the image as a whole, finding a pixel region located on one side of the rectangular coordinate image corresponding to the middle part of the culture dish that exceeds two standard deviations from the mean value, and filling each region content-awarely, replacing pixels that deviate greatly from the background with colors closer to the surroundings, and eliminating extreme outliers;
[0026] S108, after eliminating the extreme outliers, the image is analyzed column by column; the column direction after coordinate transformation is equivalent to the tangent direction in the original image; first, the value of two absolute deviations from the sliding median in each column is replaced with the median of the sliding window; then the sliding maximum smoothing process is performed along the column direction, and all the colonies in the processed image have been erased;
[0027] S109, transforming the image from a rectangular coordinate system to a polar coordinate system to obtain a smooth, debris-free background model;
[0028] S1010: Perform image difference between the image of the region of interest and the background model The difference image is obtained to improve the contrast, where I is the image of the region of interest, I0 is the background model, and δI is the difference image.
[0029] Preferably, a binary image is obtained by using a fixed threshold binarization algorithm after grayscale conversion, and a preliminary screening is performed on the region obtained from the binary image; after the preliminary screening, the region where fusion exists is segmented.
[0030] Preferably, the preliminary screening includes the following contents:
[0031] S201, directly eliminating regions whose area is smaller than a user-preset threshold, wherein the user-preset threshold is negatively correlated with the sensitivity selected by the user, and the higher the sensitivity, the smaller the threshold;
[0032] S202, for all the regions on the edge of the culture dish that are in the shape of a long strip, for each region, calculate the angle α between the major axis of the fitted ellipse and the line connecting the geometric center, if the angle is near 90 degrees so that the value of the Dirac function δ(α-90°) is greater than a preset threshold, the region is removed;
[0033] S203, removing areas whose shapes are obviously different from circles.
[0034] Preferably, the segmentation includes the following contents:
[0035] S204, for each pixel in the connected area, the shortest distance from the pixel to the pixel outside the area is calculated, and the closer the distance is, the closer it is to the edge; the local minimum value in the distance matrix is taken to form a point set;
[0036] S205, preprocessing the distance matrix to identify local minimum points;
[0037] S206, binarizing the image based on the watershed algorithm of brightness markers, taking out the brightest area in the image and performing unmarked watershed segmentation on it; then performing corrosion processing on the segmented image to make the edges of the area out of contact; then using the previously obtained binary image edge to obtain the grayscale image of the overlapping colony area, overlapping the area obtained by the unmarked watershed as the local minimum on the grayscale image, and performing another watershed segmentation based on the overlapped grayscale image to obtain the final segmented image;
[0038] S207, taking the relationship between the intersection of the segmentation line and the boundary and the convex hull boundary as a criterion for whether the segmentation is excessive, and if the segmentation is excessive, removing the excessively segmented potential to obtain a corrected excessively segmented graph.
[0039] Preferably, the S3 includes the following contents: after preprocessing and segmentation, the area corresponding to a single colony can be obtained, and for each area, it is cropped to a boundary box and reorganized into a square full-color image of a single size; feature extraction is performed on the above image to obtain a fixed-length vector; a variety of algorithms are available for this feature extraction; the vector is input into a pre-trained soft-margin support vector machine for classification prediction, thereby completing the determination of whether the current area is a colony.
[0040] A colony counter adopts a colony counting method, which is characterized by comprising a culture dish placement cabin, a camera and a lens for collecting images are fixed above the culture dish placement cabin, an ultraviolet lamp is arranged on the inner wall of the culture dish placement cabin, there is only a plane light source below the culture dish placement cabin, a transparent optical glass is arranged in the culture dish placement cabin, and the culture dish is placed above the optical glass.
[0041] Preferably, the colony counter also integrates two optional interference object elimination algorithms including dot matrix font removal and filter membrane grid line removal.
[0042] Therefore, the present invention has the following beneficial effects: by collecting images of the culture dish placement chamber by a camera and combining it with a preset colony counting method, automatic counting can be achieved as soon as the dish is placed, avoiding manual intervention in the computer processing process under normal circumstances, and manual intervention in the counting result can be made in addition to automatic counting, and the entire intervention operation is audited and tracked; multiple culture media, culture dishes, and filter membrane algorithms are built in; the applicable algorithm can be selected based on the image automatic analysis, and no manual intervention is required under normal circumstances; background modeling based on signal analysis can better restore the culture medium background to obtain a differential image, thereby improving the signal-to-noise ratio of visible light images; the interference of dot matrix font coding on the surface of the culture dish can be automatically eliminated; the technology based on linear Hough transform can automatically eliminate the interference of grid lines in the grid filter membrane; a support vector machine model pre-trained with a large amount of automatic calibration data is used to classify the suspected colonies that have been located. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 4 is a flowchart of the preprocessing of this embodiment.
[0044] Figure 2 4 is a flow chart of the segmentation algorithm of this embodiment.
[0045] Figure 3 This is an example diagram of ROI in the preprocessing of this embodiment.
[0046] Figure 4 This is an example diagram of background modeling in the preprocessing of this embodiment.
[0047] Figure 5 This is an example diagram of the preliminary screening and elimination algorithm of this embodiment.
[0048] Figure 6 This is an example diagram of the colonies in the segmentation step of this embodiment.
[0049] Figure 7 This is an example diagram of the grayscale marking assisted watershed segmentation algorithm of this embodiment.
[0050] Figure 8 This is an example diagram of the fusion operation and judgment criteria of over-segmentation in this embodiment.
[0051] Fig. 9 2 is a cross-sectional view of the colony counter of this embodiment.
[0052] In the figure: 1, camera 2, lens 3, ultraviolet lamp 4, left light source 5, plane light source 6, control component 7, foot 8, power supply component 9, small isolation column 10, culture dish 11, right light source 12, culture dish placement cabin 13, large isolation column 14, outer shell. DETAILED DESCRIPTION
[0053] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments.
[0054] Example:
[0055] This embodiment provides a colony counting method, including the following contents:
[0056] S1, pre-processing;
[0057] The purpose of preprocessing is to correct and crop the image as a whole, and eliminate the influence of irrelevant objects and optical defects on counting. In order to select the best preprocessing algorithm and parameters, some automatic analysis functions are also implemented to obtain the overall image information. The original image obtained first needs to be cropped to the area of interest, that is, the culture dish. In order to reduce the burden on the operator, the field of view of the acquisition system is larger than the size of the culture dish, so a certain error is allowed in the placement of the culture dish. After the culture dish is placed, the image acquisition system will automatically determine that the video stream is in a static state and acquire the image. If the culture dish is not detected in the image or part of the culture dish is outside the field of view of the acquisition system, the preprocessing algorithm will issue a warning to remind the user to straighten the culture dish. Once the culture dish is detected, segmentation begins.
[0058] S101, based on the comparison between the average brightness of the bacterial colony image and the preset value, determine whether the current lighting mode is bright field or dark field, and if the current lighting mode is detected to be bright field, perform color inversion processing to obtain the following Figure 3 A, then S102 is performed, and if it is detected that the current lighting mode is dark field, S102 is performed. The method in this embodiment is applicable to both bright field lighting and dark field lighting colony counters.
[0059] S102. The preprocessing program performs binarization processing on the colony image. Due to the refractive properties of the plastic at the edge of the culture dish, it is clearly distinguished from the culture medium and the background. After binarization, the edge of the culture dish presents dense concentric circles distributed radially. However, due to uneven illumination, the intervals between the concentric circles are uneven in the tangential direction, and the lines are intermittent, with broken parts in the middle of the concentric circles.
[0060] S103, correcting the broken parts of the concentric circles, performing morphological operations including dilation, erosion, opening, and closing on the image, so that the concentric circles at the edges are merged into rings.
[0061] S104, performing a filling operation on the corrected binary image to hide the internal structural features, and obtaining a circle corresponding to the culture dish, the center of the circle is the center of the culture dish, and the radius is the radius of the culture dish.
[0062] S105. Make a square outside the circle described in S104 and crop the image along the edge of the square to obtain an image with only the culture dish left. Check whether the image obtained in this step has filter membrane features. If so, repeat steps S101-S104 to obtain an image with only the filter membrane left.
[0063] from Figure 3 E shows that the culture medium in the image refracts light significantly, and it can be clearly seen that the culture medium itself has a background color, and the image contrast is low. In order to improve the accuracy of object recognition, it is necessary to increase the contrast. Next, a model pattern is established for the background of the image, that is, the culture medium, and then the difference between the two is obtained using image difference.
[0064] S106, transform polar coordinates to rectangular coordinates to transform the circular culture dish image into a square image to facilitate the use of linear algebra algorithms. The transformed image is as follows Figure 4 As shown in B, the center pixels of the culture dish on the left are interpolated and expanded, while the edge of the culture dish is concentrated on the right. Note: Since the center of the culture dish is not completely at the center of the image, the coordinate transformation causes the edge of the culture dish to appear as a curve.
[0065] S107. Analyze the image as a whole, find the pixel area on the left side of the rectangular coordinate image, which is equivalent to the middle part of the culture dish, and find the pixel area that exceeds the mean by two standard deviations. Fill each area content-awarely. Specifically, solve the discrete Laplace equations of the Dirichlet boundary condition in the area. This step has a high computational complexity, so two standard deviations are used to limit the size of the area. Figure 4 As can be seen from C, pixels that deviate greatly from the background are replaced with colors that are closer to the surroundings.
[0066] S108. After eliminating the extreme outliers, the image is analyzed column by column. The column direction after coordinate transformation, the vertical direction, is equivalent to the tangential direction in the original image. First, the values of the two absolute deviations from the sliding median in each column are replaced with the median of the sliding window. Then, the sliding maximum smoothing is performed along the column direction. The processed image is as follows: Figure 4 As shown in D, all colonies have been erased.
[0067] S109, transform the image from a rectangular coordinate system to a polar coordinate system; obtain a smooth, clutter-free background model, such as Figure 4 E; S1010, for ROI image Figure 4 A and background model Figure 4 E is used for image difference, Where I is the ROI image, I0 is the background model, δI is the difference image, and we get Figure 4 F. It can be seen that compared with Figure 4 A, the contrast is significantly improved.
[0068] S2, segmenting the preprocessed image;
[0069] like Figure 2 As shown in the figure, the segmentation includes the following. Since the background color has been eliminated by preprocessing, the background can be regarded as close to black, and the RGB pixel value is <0,0,0>. Therefore, a simple fixed threshold binarization algorithm is used after grayscale conversion to obtain a binary image. There are still a lot of dust and incompletely segmented culture dish edge pixels in this image. According to the user's preset detection sensitivity and the selected algorithm preset, some preliminary screening can be done on the binarized area, including the following steps:
[0070] S201. Directly eliminate regions whose area is smaller than a user-preset threshold. The user-preset threshold is negatively correlated with the sensitivity selected by the user. The higher the sensitivity, the smaller the threshold.
[0071] S202, for all the regions on the edge of the culture dish that are in the shape of a long strip, calculate the angle α between the major axis of the fitted ellipse and the line connecting the geometric center for each region. If the angle is near 90 degrees, the value of the Dirac function δ(α-90°) is greater than the threshold C α , then the area will be removed;
[0072] The edge of the culture dish is defined as the distance between the geometric center of the region and the center of the image is greater than 80% of the radius, and the long strip area is defined as the long strip area with a perimeter-to-radius ratio greater than a certain threshold.
[0073] S203: For regions whose shapes are obviously not approximately circular, the regions are eliminated if the difference between the convex hull of the region and the region itself is greater than a threshold.
[0074] After the initial screening is completed, it is necessary to segment the areas where fusion may exist, such as Figure 6 The commonly used one is the watershed algorithm, which includes the following:
[0075] S204. For each pixel in the connected area, the shortest distance from the pixel to the pixel outside the area is calculated. The closer the distance, the closer to the edge. If the pixel value is regarded as the height, the center of the area is higher and the edge is lower. Reverse the height so that the edge is higher and the center is lower, both are negative values. Take the local minimum values in the distance matrix to form a point set. Each local minimum value has a clearly defined convergence region, and the monotonic optimization in the region always converges to its local minimum value. The so-called watershed is the boundary line of adjacent monotonic convergence regions.
[0076] The watershed algorithm is highly dependent on the selection of local minimum points. In order to avoid the generation of a large number of local minima with small convergence areas due to slight changes in the direction of the edge of the image, it is necessary to preprocess the distance matrix of the watershed algorithm to remove these local minima. Here, h-minima transform is used.
[0077] The only information used by the watershed algorithm is the binary image, mainly the region boundaries of the binary image. The human eye also uses the changes in light and dark in the color image when judging whether and where to segment the colony. The accuracy of the watershed algorithm can be greatly improved by manually placing markers. However, due to the complexity of analyzing the image brightness information to obtain the marker points, this algorithm component is turned off by default.
[0078] S205, such as Figure 6 As shown in the figure, the watershed algorithm based on brightness marking first performs a simple binarization on the image, takes out the brightest area in the image and performs unmarked watershed segmentation on it, as shown in the figure. Figure 7 AD. Then the image after segmentation is eroded to make the edges of the regions out of contact, such as Figure 8 E, and then use the edge of the previously obtained regional binary image, such as Figure 6 A, obtain the grayscale image of the overlapping colony area, and use the area obtained by the unmarked watershed as the local minimum mark point to overlap the grayscale image, such as Figure 8 F, and perform another watershed segmentation based on the brightness value of the overlapped grayscale image to obtain the final segmented image, such as Figure 8 G. Example of colony area distribution across the entire dish after correction for oversegmentation. Figure 7 H.
[0079] S206. All of the above algorithms may over-segment the region. Figure 7Among the three overlapping colonies (C0, C1, C2) in the upper right corner of G, C1 is over-segmented into two colonies. It can be seen that the intersection of the segmentation line of C1 and the edge of the colony is located on the boundary of the convex hull of the three colonies in the overall area, while the intersections of the segmentation lines and boundaries of other correctly segmented regions are all located inside the convex hull. Therefore, the relationship between the intersection of the segmentation line and the boundary and the convex hull boundary can be used as a criterion for whether the segmentation is over-segmented.
[0080] S207, the implementation of the above criteria is as follows Figure 8 As shown. Figure 7 Take (C0, C1, C2) in G as an example. After segmentation, there are four regions in total. There are 6 ways to select two of the four regions, and calculate the boundary of the convex hull for these 6 pairs of regions. Specifically, Figure 7 A shows the dividing line between the regions. Draw the intersection of the dividing line and the edge of the undivided region as Figure 8 B, we get 4 points. Take any two regions and merge them. Figure 8 B and 8C are two examples. Find their convex hull as Figure 8 E, 8F. Then calculate the difference between the convex hull and the merged area Figure 8 H, 8I. If the intersection point is in the difference set, then the point is the correct segmentation point. Figure 8 H, 8I. If the intersection point is outside the difference set, the point is an over-segmented point and should be removed. Finally, the corrected over-segmented Figure 8 G.
[0081] S3, after preprocessing and segmenting components, the area roughly corresponding to a single colony is obtained. For each area, the algorithm will crop it to the bounding box and reshape it into a square full-color image of a single size. The algorithm will extract features from the above image and obtain a fixed-length vector. The essence of feature extraction is a high-dimensional nonlinear transformation. There are already quite a few mature feature extraction algorithms to choose from. Here, scale-conservative feature transformation is preferred, but it is not limited to this algorithm. Many feature extraction algorithms are available. The vector is input into the pre-trained soft-margin support vector machine for classification prediction, which can determine whether the current area is a colony.
[0082] This embodiment also provides a colony counter. Fig. 9 As shown, it includes an acquisition module, a culture dish placement cabin and an electrical module, and also includes a control algorithm, a user interface and an image analysis algorithm of an external computer.
[0083] The acquisition module of the colony counter includes a camera 1 and a lens 2, and has a data and control interface connected to an external computer. The lens is vertically pointed at the culture dish in the culture dish placement cabin, and the field of view covers the optical glass in the culture dish placement cabin. A left light source 4 is provided on the left side of the culture dish storage compartment 12, and a right light source 11 is provided on the right side. A plane light source 5 is provided at the bottom of the culture dish placement cabin. The culture dish placement cabin has a horizontal transparent optical glass, and the culture dish is placed on it during operation, either upright or inverted, that is, the upper surface of the culture medium faces / backwards the lens. Light sources are integrated in the cabin for lighting, including left and right side light sources and a bottom surface light source. There is a closable light-shielding cabin door at the connection between the cabin and the outside of the equipment. A foot 7 is provided under the outer shell 14, a symmetrical small isolation column 9 is provided under the planar light source 5, and a symmetrical large isolation column 13 is provided on the outside of the culture dish placement cabin 12. The electrical module includes a control component 6 and a power supply component 8, and the control component 6 and the power supply component 8 are arranged under the culture dish placement cabin in the outer shell 14. The ultraviolet lamp 3 is placed on the rear side wall of the culture dish placement cabin 12. The electrical module includes a programmable logic controller that receives control instructions issued by a computer and directly controls the light source, the switch and brightness of the ultraviolet lamp, and a power adapter suitable for ordinary AC power.
[0084] The operation steps of the colony counter are as follows:
[0085] 1. Connect the power supply and signal lines of the equipment correctly;
[0086] 2. Turn on the power of the computer and counter and run the interface software. Other software components will automatically suspend;
[0087] 3. After the user manually places the culture dish into the culture dish placement chamber, the software will receive the information of the culture dish being placed, immediately count the culture dishes, and display the counting results on the software interface. This process does not require clicking any buttons or interfaces by default, realizing the "0 click" mode;
[0088] 4. After the counting is completed, the user clicks the save button on the software interface to save the counting results to the software;
[0089] 5. Replace the culture dish, count and save;
[0090] 6. After all culture dishes are counted, turn off the software and the power of the device.
[0091] The specific description of the present invention in the above embodiments is only used to further illustrate the present invention and cannot be understood as limiting the scope of protection of the present invention. Technical engineers in this field may make some non-essential improvements and adjustments to the present invention based on the contents of the above invention, which fall within the scope of protection of the present invention.
Claims
1. A colony counting method, characterized in that: Includes the following: S1. Preprocessing the bacterial colony image captured by the acquisition module; S2, segmenting the preprocessed image using a watershed algorithm; Make the intersection of the segmentation line and the edge of the unsegmented area, randomly merge two areas, find their convex hull, calculate the difference between the convex hull and the merged area, and if the intersection is outside the difference, remove it to get the corrected over-segmented image; S3. After preprocessing and segmentation, the area corresponding to a single colony is obtained, and features are extracted for each area. The feature extracted vector is input into the pre-trained soft-margin support vector machine for classification prediction to determine whether the current area is a colony.
2. A colony counting method according to claim 1, characterized in that: The S1 includes the following contents: S101, judging whether the current lighting mode is bright field or dark field based on the comparison of the average brightness of the bacterial colony image with the preset value, if the current lighting mode is detected as bright field, performing inversion processing, and then proceeding to S102, if the current lighting mode is detected as dark field, proceeding to S102; S102, the preprocessing program performs binarization processing on the bacterial colony image, and after binarization, the edge of the culture dish presents dense concentric circles distributed radially, and the concentric circles have a broken part in the middle; S103, correcting the broken parts of the concentric circles, performing morphological operations including dilation, erosion, opening, and closing on the image, so that the concentric circles at the edges merge into rings; S104, performing a filling operation on the corrected binary image to hide the internal structural features, and obtaining a circle corresponding to the culture dish, the center of the circle is the center of the culture dish, and the radius is the radius of the culture dish; S105. Make a square outside the circle described in S104 and crop the image along the edge of the square to obtain an image with only the culture dish left. Check whether the image obtained in this step has filter membrane features. If so, repeat steps S101-S104 to obtain an image with only the filter membrane left.
3. A colony counting method according to claim 1, characterized in that: The pre-processing also includes the following contents: A model pattern is created for the image background, and then image difference is performed.
4. A colony counting method according to claim 3, characterized in that: The said model building pattern and the said image difference performing specifically include: S106, transforming the circular culture dish image into a square image by performing polar coordinate to rectangular coordinate transformation, wherein the center pixels of the culture dish on one side are interpolated and expanded, and the edges of the culture dish are concentrated on the other side; S107, analyzing the image as a whole, finding a pixel region located on one side of the rectangular coordinate image corresponding to the middle part of the culture dish that exceeds two standard deviations from the mean value, and filling each region content-awarely, replacing pixels that deviate greatly from the background with colors closer to the surroundings, and eliminating extreme outliers; S108, after eliminating the extreme outliers, the image is analyzed column by column; the column direction after coordinate transformation is equivalent to the tangent direction in the original image; first, the value of two absolute deviations from the sliding median in each column is replaced with the median of the sliding window; then the sliding maximum smoothing process is performed along the column direction, and all the colonies in the processed image have been erased; S109, transforming the image from a rectangular coordinate system to a polar coordinate system to obtain a smooth, debris-free background model; S1010: Perform image difference between the image of the region of interest and the background model The difference image is obtained to improve the contrast. Where I is the image of the region of interest, I0 is the background model, and δI is the difference image.
5. A colony counting method according to claim 1, characterized in that: The S2 includes the following contents: A binary image is obtained by using a fixed threshold binarization algorithm after grayscale conversion, and a preliminary screening is performed on the areas obtained from the binary image; after the preliminary screening, the fused areas are segmented.
6. A colony counting method according to claim 5, characterized in that: The initial screening includes the following: S201, directly eliminating regions whose area is smaller than a user-preset threshold, wherein the user-preset threshold is negatively correlated with the sensitivity selected by the user, and the higher the sensitivity, the smaller the threshold; S202, for all the regions on the edge of the culture dish that are in the shape of a long strip, for each region, calculate the angle α between the major axis of the fitted ellipse and the line connecting the geometric center, and if the angle is 90 degrees, remove the region; S203, removing areas whose shapes are obviously different from circles.
7. A colony counting method according to claim 5, characterized in that: The segmentation includes the following: S204, for each pixel in the connected area, the shortest distance from the pixel to the pixel outside the area is calculated, and the closer the distance is, the closer it is to the edge; the local minimum value in the distance matrix is taken to form a point set; S205, preprocessing the distance matrix to remove local minimum points; S206, binarizing the image based on the watershed algorithm of brightness markers, taking out the brightest area in the image and performing unmarked watershed segmentation on it; then performing corrosion processing on the segmented image to make the edges of the area out of contact; then using the previously obtained binary image edge to obtain the grayscale image of the overlapping colony area, overlapping the area obtained by the unmarked watershed as the local minimum on the grayscale image, and performing another watershed segmentation based on the overlapped grayscale image to obtain the final segmented image; S207, taking the relationship between the intersection of the segmentation line and the boundary and the convex hull boundary as a criterion for whether the segmentation is excessive, and if the segmentation is excessive, removing the excessively segmented points to obtain a corrected excessively segmented graph.
8. A colony counting method according to claim 1, characterized in that: The S3 includes the following contents: after preprocessing and segmentation, the area corresponding to a single colony is obtained, and for each area, it is cropped to a boundary box and reshaped into a square full-color image of a single size; feature extraction is performed on the above image to obtain a fixed-length vector; the vector is input into a pre-trained soft-margin support vector machine for classification prediction, so as to complete the determination of whether the current area is a colony.
9. A colony counter, using a colony counting method according to any one of claims 1 to 8, characterized in that: It includes a culture dish placement chamber, a camera and a lens for collecting images are fixed above the culture dish placement chamber, an ultraviolet lamp is arranged on the inner wall of the culture dish placement chamber, there is only a plane light source below the culture dish placement chamber, a transparent optical glass is arranged in the culture dish placement chamber, and the culture dish is placed above the optical glass.
10. A colony counter according to claim 9, characterized in that: The colony counter also integrates two optional interference object elimination algorithms, including dot matrix font removal and filter membrane grid line removal.
Citation Information
Patent Citations
Bacterial colony counter
CN208903298U
Auxiliary device for photographing microbial colonies
CN210222453U