A method for detecting roi region for colony detection and related device

CN123015958APending Publication Date: 2026-10-30HUNAN SHENGWEI SUMIN BIOTECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611237142.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-14
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0004]本申请实施例提供了一种用于菌落检测的ROI区域检测方法及相关设备,可以解决ROI区域检测的精度差的问题

Benefits of technology

在本申请的实施例中,通过获取用于装载进行微生物药敏试验的菌悬液的孔板的孔板图像,然后根据孔板的物理结构确定目标检测算法,再利用目标检测算法对孔板图像进行目标检测,得到ROI区域检测结果,最后对ROI区域检测结果进行修正,得到孔板图像的最终ROI区域检测结果。其中,根据孔板的信息,自适应选择目标检测算法,而非直接套用通用目标检测算法,使ROI区域检测适配孔板的实际状况,降低不同孔板形状对目标检测造成的干扰,提高ROI区域检测的准确性,在初步的ROI区域检测结果上追加修正处理,降低边界偏移、边缘不贴合等误差情况,得到定位准确、符合实际孔位状况的ROI区域检测结果,进一步提高ROI区域检测的精度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123015958A_ABST
    Figure CN123015958A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of colony detection, and provides an ROI region detection method for colony detection and related equipment, which comprises the following steps: acquiring a well plate image of a well plate used for loading a bacterial suspension for a microbial drug sensitivity test; determining a target detection algorithm according to the physical structure of the well plate; performing target detection on the well plate image by using the target detection algorithm to obtain an ROI region detection result; and correcting the ROI region detection result to obtain a final ROI region detection result of the well plate image. The method can improve the precision of ROI region detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of colony detection technology, and in particular to a method and related equipment for detecting ROI areas for colony detection. Background Technology

[0002] In microbial antimicrobial susceptibility testing, microplates have become the standardized experimental medium. Imaging-based automated colony counting and phenotypic analysis technologies are gradually replacing manual interpretation and are the core means to improve experimental throughput and data consistency. Region of Interest (ROI) calibration is a crucial preliminary step in this type of detection system, and its positioning accuracy directly determines the accuracy of subsequent colony counting and phenotypic parameter extraction.

[0003] To meet the demands of high-throughput detection and simultaneously verify the drug susceptibility of multiple bacterial drug combinations, the instrument underwent a high-throughput microplate upgrade, increasing the well size from 96 to 192 wells. Due to this change in well size, issues such as defocusing often arise during cultivation, incubation, focusing, and imaging processes. Figure 1 As shown in the figure, the bounding box represents the ROI (Region of Interest) detection box. The instrument's recognition algorithm did not select the ROI, which affected the accuracy of subsequent interpretations and ultimately the results of the rapid drug susceptibility test. This resulted in misjudgment, affecting the diagnosis and causing poor accuracy in ROI detection, leading to misjudgments in the colony detection of microbial drug susceptibility tests. Summary of the Invention

[0004] This application provides a method and related equipment for detecting ROI regions for colony detection, which can solve the problem of poor accuracy in ROI region detection.

[0005] In a first aspect, embodiments of this application provide a method for detecting Region of Interest (ROI) areas for colony detection, the ROI area detection method comprising: Acquire images of well plates used to load bacterial suspensions for antimicrobial susceptibility testing; The target detection algorithm is determined based on the physical structure of the perforated plate; the physical structure refers to the shape of the holes in the perforated plate. The target detection algorithm is used to perform target detection on the perforated plate image to obtain the ROI region detection results; The ROI region detection results are corrected to obtain the final ROI region detection results for the perforated plate image.

[0006] Optionally, the target detection algorithm is determined based on the physical structure of the perforated plate, including: Based on the physical structure of the orifice plate, the target detection box type is determined from a variety of detection box types; The detection algorithm corresponding to the target detection box type is used as the target detection algorithm.

[0007] Optionally, the target detection algorithm is used to perform target detection on the perforated plate image to obtain ROI region detection results, including: Based on the perforated plate image, target detection is performed on the image region corresponding to each perforation to obtain the region detection parameters corresponding to each perforation. ROI region detection results are generated based on the region detection parameters corresponding to each well location.

[0008] Optionally, there are multiple detection box types, including circular detection boxes, rectangular detection boxes, and rounded rectangular detection boxes.

[0009] Optionally, when the target detection box type is a circular detection box, target detection is performed on the image region corresponding to each hole based on the perforated plate image to obtain the region detection parameters corresponding to each hole, including: High-intensity pixels are cropped from the perforated plate image to obtain the cropped perforated plate image; the pixel intensity values ​​in the cropped perforated plate image are all less than or equal to the preset intensity threshold. A grid region is generated for each hole location on the cropped perforated plate image. A search is performed in each grid region with a first search step size to obtain multiple initial parameters corresponding to each hole location. Candidate parameters for each hole location are determined from all the initial parameters corresponding to each hole location. The candidate parameters include the center position and radius of the circular detection box. For each hole location, based on the candidate parameters corresponding to the hole location, the image of the cropped perforated plate is traversed with a second search step size to obtain multiple intermediate parameters corresponding to the hole location, and the region detection parameters of the hole location are determined from all the intermediate parameters.

[0010] Optionally, when the target detection box type is a rounded rectangle detection box, target detection is performed on the image region corresponding to each hole based on the perforated plate image to obtain the region detection parameters corresponding to each hole, including: Edge detection is performed on the perforated plate image to obtain the edge image; Rectangular position detection is performed on the edge image to obtain the region detection parameters for each hole position; the region detection parameters include the center position, width, and height of the rounded rectangle detection box.

[0011] Optionally, rectangular position detection is performed on the edge image to obtain the region detection parameters for each hole location, including: For each hole, perform the following steps: Identify the estimated center location of the hole in the edge image and detect two pairs of parallel edges within the neighborhood of the estimated center location; the edge intensity of the two pairs of parallel edges is greater than the edge intensity of all other parallel edges; Use the distance between the two pairs of parallel sides as the width and height of the rectangle, respectively. The center of the rectangle is the position of the center of the two pairs of parallel sides.

[0012] Optionally, the results include: multiple ROI region detection boxes; the ROI region detection results are then corrected to obtain the final ROI region detection results for the perforated plate image, including: For each ROI region detection box, the calibration coordinates of the center point are calculated based on the reference coordinates of the center point of the ROI region detection box. The ROI region detection box is then offset and calibrated according to the calibration coordinates to obtain the calibrated ROI region detection box. Calculate the quality score of all calibrated ROI region detection boxes, and recalibrate all calibrated ROI region detection boxes based on the quality score to obtain the final ROI region detection box corresponding to each ROI region detection box; the quality score is the sum of the edge strengths of all calibrated ROI region detection boxes. All final ROI region detection boxes are used as the final ROI region detection results for the perforated plate image.

[0013] Optionally, the calibration coordinates of the center point are calculated based on the reference coordinates of the center point of the ROI region detection box, including: Through the formula:

[0014]

[0015] Calculate the calibration coordinates of the center point ; in, The x-coordinate of the calibration coordinates of the center point. The ordinate in the calibration coordinates of the center point. The x-coordinate in the reference coordinate system representing the center point. The ordinate in the reference coordinate system representing the center point. This represents the pixel displacement corresponding to each row offset along the horizontal axis. This represents the pixel displacement corresponding to each row offset along the vertical axis. This indicates the row offset of the ROI region detection frame relative to the reference hole position. This indicates the column offset of the ROI region detection frame relative to the reference hole position. This represents the pixel displacement corresponding to each column offset along the horizontal axis. This represents the pixel displacement corresponding to each column offset along the vertical axis.

[0016] Optionally, all calibrated ROI region detection boxes are recalibrated based on quality scores to obtain the final ROI region detection box corresponding to each ROI region detection box, including: When the quality score is less than the preset threshold, adjust the parameters in the target detection algorithm and return to the step of using the target detection algorithm to perform target detection on the perforated plate image and obtain the ROI region detection result.

[0017] Secondly, embodiments of this application provide a Region of Interest (ROI) detection device for colony detection, comprising: The acquisition module is used to acquire images of well plates used to load bacterial suspensions for microbial susceptibility testing. The determination module is used to determine the target detection algorithm based on the physical structure of the perforated plate; the physical structure is the shape of the perforations in the perforated plate. The detection module is used to perform target detection on the perforated plate image using a target detection algorithm to obtain the ROI region detection results; The correction module is used to correct the ROI region detection results to obtain the final ROI region detection results of the perforated plate image.

[0018] Thirdly, embodiments of this application provide a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the aforementioned ROI region detection method for colony detection.

[0019] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described ROI region detection method for colony detection.

[0020] The above-mentioned solution in this application has the following beneficial effects: In the embodiments of this application, an image of the well plate used to load the bacterial suspension for microbial susceptibility testing is acquired. Then, a target detection algorithm is determined based on the physical structure of the well plate. This algorithm is then used to perform target detection on the well plate image, obtaining the ROI region detection result. Finally, the ROI region detection result is corrected to obtain the final ROI region detection result of the well plate image. Specifically, the target detection algorithm is adaptively selected based on the well plate information, rather than directly applying a general target detection algorithm. This adapts the ROI region detection to the actual condition of the well plate, reducing interference caused by different well plate shapes and improving the accuracy of ROI region detection. Additional correction processing is applied to the initial ROI region detection result to reduce errors such as boundary offset and edge misalignment, resulting in an accurately positioned ROI region detection result that conforms to the actual well position, further improving the accuracy of ROI region detection.

[0021] Other beneficial effects of this application will be described in detail in the following detailed description section. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a schematic diagram of the ROI region detection box in the prior art; Figure 2 A flowchart of a ROI region detection method for colony detection provided in an embodiment of this application; Figure 3 A schematic diagram of a ROI region detection box provided in an embodiment of this application; Figure 4 This is a schematic diagram of a Region of Interest (ROI) detection device for colony detection provided in an embodiment of this application. Figure 5 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. Detailed Implementation

[0024] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0025] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0026] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0027] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."

[0028] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0029] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0030] To address the issue of poor accuracy in existing high-throughput colony detection methods, this application provides a Region of Interest (ROI) detection method for colony detection. This method acquires images of well plates containing bacterial suspensions for antimicrobial susceptibility testing. Then, it determines a target detection algorithm based on the physical structure of the well plate, applies this algorithm to the well plate image to obtain the ROI detection result, and finally corrects the ROI detection result to obtain the final ROI detection result for the well plate image. Specifically, the method adaptively selects the target detection algorithm based on the well plate information, rather than directly applying a general target detection algorithm. This adapts the ROI detection to the actual well plate conditions, reducing interference from different well plate shapes and improving the accuracy of ROI detection. Furthermore, it adds correction processing to the initial ROI detection result, reducing errors such as boundary offset and edge misalignment, resulting in accurately located ROI detection results that conform to the actual well positions, further improving the accuracy of ROI detection.

[0031] The ROI region detection method for colony detection provided in this application will be described exemplarily below.

[0032] like Figure 2As shown, the ROI region detection method for colony detection provided in this application includes the following steps: Step 21: Obtain images of the well plates used to load the bacterial suspension for microbial susceptibility testing.

[0033] The aforementioned perforated plates can be 192-well deep perforated plates, 384-well microperforated plates, etc.

[0034] In some embodiments of this application, perforated plate images can be acquired using devices such as cameras.

[0035] Step 22: Determine the target detection algorithm based on the physical structure of the perforated plate.

[0036] The physical structure described above refers to the shape of the holes in the perforated plate, such as circles, rectangles, rounded rectangles, etc.

[0037] In some embodiments of this application, the steps of determining the target detection algorithm based on the physical structure of the orifice plate include: The first step is to determine the target detection box type from a variety of detection box types based on the physical structure of the orifice plate.

[0038] Multiple detection box types are available, including circular detection boxes, rectangular detection boxes, and rounded rectangular detection boxes.

[0039] For example, considering the shape of the hole in the perforated plate, if the hole shape is circular, the target detection box type is circular detection box; if the hole shape is rectangular, the target detection box type is rectangular detection box; and if the hole shape is rounded rectangle, the target detection box type is rounded rectangle detection box.

[0040] In addition, the target detection box type can be determined based on the bacterial species, such as Escherichia coli, yeast, and Streptomyces.

[0041] If the shape of the well is unclear or not circular, rectangular, or rounded rectangular, then the type of bacterial species can be considered. For example, the target detection box type for species such as Escherichia coli and yeast is a circular detection box, the target detection box type for species such as Streptomyces is a rectangular detection box, and the target detection box type for species such as Staphylococcus aureus is a rounded rectangle. The correspondence between bacterial species type and detection box type can be preset based on information such as the growth status and colony morphology of the bacterial species.

[0042] Circular detection frame: suitable for circular perforated plates (such as 96 / 192 / 384 perforated plates); Rectangular detection box: suitable for square holes or full image analysis; Rounded rectangular detection frame: suitable for detection areas with rounded corners, such as microfluidic chip cartridges.

[0043] The second step is to use the detection algorithm corresponding to the target detection box type as the target detection algorithm.

[0044] For example, the detection algorithm corresponding to the target detection box type is a pre-defined algorithm.

[0045] Step 23: Use the target detection algorithm to perform target detection on the perforated plate image to obtain the ROI region detection results.

[0046] The above ROI region detection results include multiple ROI region detection boxes, which are used to indicate the image regions corresponding to the holes in the perforated plate image. Each of the multiple ROI region detection boxes corresponds to a single hole.

[0047] Specifically, based on the perforated plate image, target detection is performed on the image region corresponding to each perforation to obtain the region detection parameters corresponding to each perforation; and ROI region detection results are generated based on the region detection parameters corresponding to each perforation.

[0048] When the target detection box type is a circular detection box, the above steps of performing target detection on the image region corresponding to each hole position based on the perforated plate image to obtain the region detection parameters corresponding to each hole position include: The first step is to crop the high-intensity pixels of the perforated plate image to obtain the cropped perforated plate image.

[0049] The pixel light intensity values ​​in the cropped perforated plate image are all less than or equal to the preset light intensity threshold.

[0050] For example, pixels with light intensity values ​​greater than a preset light intensity threshold in the perforated plate image are cropped and removed, while pixels with light intensity values ​​less than or equal to the preset light intensity threshold are retained, resulting in a cropped perforated plate image.

[0051] The second step is to generate a grid region for each hole location on the cropped perforated plate image, and to search in each grid region with a first search step size to obtain multiple initial parameters corresponding to each hole location, and to determine the candidate parameters of the hole location from all the initial parameters corresponding to each hole location.

[0052] The candidate parameters include the center position and radius of the circular detection box, where the center position is the coordinate in a coordinate system with the plane where the perforated plate image is located as the two-dimensional plane.

[0053] Specifically, a grid region is generated for each hole position on the cropped perforated plate image. The grid region is traversed with a first search step size to perform pixel search, and multiple initial pixels are determined. Initial parameters are generated based on the position of each initial pixel. The initial parameters include the center position and radius of the circle at the initial pixel. For each hole position, the edge correlation score of all initial parameters corresponding to the hole position is calculated, and the initial parameter with the highest edge correlation score is used as the candidate parameter of the hole position.

[0054] For example, multiple scan lines are generated on the perforated plate image. These scan lines consist of two sets, one vertical and one horizontal, forming multiple grid regions. Each grid region contains one perforation, meaning the edges of the perforation are entirely within the grid region. The scan lines cover the central 50% of the image width. The spacing between adjacent scan lines is determined according to a preset ratio based on the image width to ensure coverage of critical edge regions while reducing computational load. A 1D Rank filter (filter size = 20, Rank = 18) is applied to each sampling line, and an edge correlator is used to detect the transition from bright to dark edges. The edge correlator uses a difference kernel: [-1,...,-1, +1,...,+1] (each half is 40 pixels long).

[0055] Within a preset radius range, preset vertical position range, and preset horizontal position range, a gridded traversal is performed with a first search step size (e.g., 5 pixels) and a scan line as the fixed sampling path. Multiple initial pixels with uniform spacing of the first search step size are determined within the grid area. The position of the initial pixel is used as the center position, and the radius of that position is determined (e.g., the minimum distance between the initial pixel and the edge of the grid area is used as the radius, or a value within a preset radius range is used as the radius, etc.). The initial parameters of the initial pixel are obtained, and the correlation score between the initial parameters at each initial pixel and the image edge is calculated (which can be calculated using the correlateCircle function). The initial parameter with the highest correlation score in each grid area is recorded as the candidate parameter.

[0056] For example: Within half the width of the cropped image, sample the horizontal coordinates sequentially with a step size of 1 / 20 of the image width. For each horizontal coordinate, call the vertical edge detection function to obtain the vertical edge result of the corresponding column. Encapsulate the horizontal coordinate and edge result into a line information object and add it to the vertical line set. Set a search step size of 5 pixels, and use a triple loop to traverse all candidate parameter combinations in the radius interval, the circle center vertical coordinate interval, and the circle center horizontal coordinate interval according to the step size. For each group of candidate circle center coordinates and radius, call the circle correlation calculation function to obtain the correlation value. Multiply it by the sign coefficient and compare it with the current best correlation. If the value is larger, update the best correlation and the corresponding parameters.

[0057] The third step involves traversing the cropped perforated plate image with a second search step size for each hole location based on the candidate parameters corresponding to the hole location, obtaining multiple intermediate parameters corresponding to the hole location, and determining the region detection parameters of the hole location from all the intermediate parameters.

[0058] Specifically, the following steps are performed: In the cropped perforated plate image, with the center position of the circle in the candidate parameters as the center, the search is performed within the preset neighborhood of the center with a second search step size to determine multiple target pixels, and intermediate parameters corresponding to each target pixel are generated based on the position of each target pixel; the intermediate parameters include the center position and radius of the circle at the target pixel; the edge correlation score of each intermediate parameter is calculated, and the intermediate parameter with the highest edge correlation score is used as the region detection parameter of the corresponding perforation position.

[0059] For example, in the cropped perforated plate image, using the center position of the circle in the candidate parameters as the center, a fine traversal is performed within a preset neighborhood of this center with a second search step size. The second search step size is smaller than the first search step size, identifying multiple uniform target pixels spaced at intervals equal to the second search step size. The position of each target pixel is used as the center position of a circle, and the radius of this position is determined (e.g., using the minimum distance between the target pixel and the edge of the grid region as the radius, or using a value within a preset radius range as the radius, etc.). The target parameters of this target pixel are obtained. The correlation score of the target parameters is calculated using the correlateCircle function. Finally, the target parameter with the highest correlation score is used as the region detection parameter for the corresponding hole position. The correlation score calculated by the correlateCircle function reflects information such as the edge strength of the circle corresponding to the parameter. The highest correlation score indicates that the grayscale change intensity at this circle is the highest, and it is most likely the outline of the hole position. That is, the region detection parameter reflects the center position and outline of the hole position, realizing the ROI region detection of the hole position.

[0060] The steps described above for generating ROI region detection results based on the region detection parameters corresponding to each well location are as follows: Based on each target parameter, a corresponding circular ROI region detection box is generated, and all ROI region detection boxes are used as the ROI region detection results.

[0061] For example, a circular ROI detection box is obtained by drawing a circle with the radius of the circle center coordinates in the target parameter combination.

[0062] In some embodiments of this application, a circular detection box can also be obtained through arc detection: an arc filter is created, a matching filter for the expected arc shape is generated based on the detected arc radius detectionArcRadius and the detected arc angle detectionArcAngle, then filter correlation operations are performed, the arc filter is slid across the entire image to find the positions (peaks) with the highest correlation, and then quality assessment is performed. If the percentage of matching between the detected arc and the expected arc is lower than the arc quality threshold arcQualityThreshold (default 50%), then the calibration is determined to have failed.

[0063] The detection process can incorporate the `fallingEdge` parameter, supporting two scenarios: "bright inside the hole / dark outside" and "dark inside the hole / bright outside." The `edgeThreshold` parameter filters low-contrast edges. `fallingEdge` is a 0-1 variable indicating which edge is brighter, "inside the hole" or "outside the hole," thus selecting the correct edge detection direction. Based on this parameter, the detection direction of the filter is adjusted. A `fallingEdge` of 0 indicates a bright inside the hole and a dark outside, with a filter response of negative outside and positive inside, detecting "dark → bright" edges. A value of 1 indicates the opposite. `edgeThreshold` is the edge threshold, filtering out "pseudo-edges" with too low a correlation value, retaining only sufficiently strong edges as candidate arcs. Too low a value will detect noisy edges, while too high a value will miss weak edges. Points exceeding this value are recorded as valid points.

[0064] When the target detection box type is a rectangular detection box, the above steps of performing target detection on the image region corresponding to each hole based on the perforated plate image, obtaining the region detection parameters corresponding to each hole, and generating the ROI region detection result based on the region detection parameters corresponding to each hole include: Specifically, the hole position (i.e., area detection parameters) of each hole can be calculated first. Then, based on the preset rectangle side length, a rectangular ROI area detection box is generated with the hole position as the center. All rectangular ROI area detection boxes are used as the ROI area detection results.

[0065] For example, the hole position can be calculated by stepping the rectangular offset of the hole position reference position, and then a rectangle can be constructed with the hole position as the center and a preset side length to obtain the rectangular ROI region detection box.

[0066] The formula for calculating the hole position is: x=a0x+(alphaStep×xOffsetPerAlphaStep)+(numericStep×xOffsetPerNumericStep); y=a0y+(alphaStep×yOffsetPerAlphaStep)+(numericStep×yOffsetPerNumericStep); Where x is the x-coordinate of the hole position, y is the y-coordinate of the hole position, a0x is the x-coordinate of the hole reference position, a0y is the y-coordinate of the hole reference position, alphaStep is the row index value, xOffsetPerAlphaStep represents the X increment (row increment) for each row step, numericStep is the column index value, xOffsetPerNumericStep represents the X increment (row increment) for each column step, yOffsetPerAlphaStep represents the Y increment (column increment) for each row step, and yOffsetPerNumericStep represents the Y increment (column increment) for each column step.

[0067] When the target detection box type is a rounded rectangle detection box, the above steps of performing target detection on the image region corresponding to each hole position based on the perforated plate image to obtain the region detection parameters corresponding to each hole position include: The first step is to perform edge detection on the perforated plate image to obtain the edge image.

[0068] For example, using an adaptive threshold as a benchmark, pixels with edge strength greater than the adaptive threshold are retained to obtain an edge image. Edge strength refers to the degree of drastic change in gray level at a pixel, which can be obtained by calculating the gray level gradient of the image using algorithms such as the Sobel operator. The adaptive threshold calculation process is as follows: All edge intensity values ​​obtained from edge detection are statistically sorted, and the intensity value located at a preset percentage position at the high end of the distribution is selected as the initial edge clipping threshold. The preset percentage is configured within a preset percentile range. For example, according to the Sobel operator algorithm, multiple preset values ​​are first set: the first percentile, the second percentile, the third percentile, the lower threshold, and the upper threshold. The first percentile is less than the second percentile, and the second percentile is less than the third percentile. Using the second percentile as the initial threshold, the difference between the third percentile and the first percentile in the edge pixel array is calculated to obtain the spread. If the spread is less than 100, the initial threshold is multiplied by 90 and then divided by 100. The maximum value of the calculation result and the lower threshold is taken as the new threshold. If the spread is greater than 500, the initial threshold is multiplied by 110 and then divided by 100. The minimum value of the calculation result and the upper threshold is taken as the new threshold. Finally, the threshold is limited to the range between the lower threshold and the upper threshold, and the threshold result is returned.

[0069] The adaptive threshold is adjusted a second time based on the dispersion of the edge intensity distribution: When the dispersion of edge intensity distribution is lower than the first dispersion threshold, it is determined to be a low contrast scene. The edge clipping threshold is reduced proportionally, and an absolute lower limit is set to prevent the threshold from being too low and introducing noise.

[0070] When the dispersion of edge intensity distribution is higher than the second dispersion threshold, it is judged as a high-contrast scene. The edge clipping threshold is increased proportionally, and an absolute upper limit value is set to prevent the threshold from being too high and missing effective edges.

[0071] The first discrete threshold is configured within a preset first range (e.g., [50, 150]), the second discrete threshold is configured within a preset second range (e.g., [300, 700]), and the proportional adjustment coefficient is configured within a preset third range (e.g., [0.8, 1.2]).

[0072] The second step is to perform rectangular position detection on the edge image to obtain multiple region detection parameters.

[0073] Multiple holes correspond one-to-one with multiple region detection parameters. The region detection parameters include the center position of the rectangle, the width of the rectangle, and the height of the rectangle. That is, they reflect the center position of the hole in the image, as well as the width and height of the rectangle at the hole outline, thus realizing the ROI region detection of the hole.

[0074] Specifically, for each hole, the following steps are performed: Identify the estimated center position of the hole in the edge image and detect two pairs of parallel edges in the neighborhood of the estimated center position; the edge intensity of the two pairs of parallel edges is greater than the edge intensity of all other parallel edges; use the distance between the two pairs of parallel edges as the width and height of the rectangle, respectively; use the center position of the two pairs of parallel edges as the center position of the rectangle.

[0075] For example, the estimated center position of the hole can be obtained by pre-setting the reference position of the hole and using analysis algorithms such as Blob target detection to identify the edge image. The aforementioned neighborhood range is a preset range centered on the estimated center position. A dual-line correlator can be used to perform bilateral line detection on the edge image to obtain multiple region detection parameters. For example: First, find the first search center line: to the left (or above) of the estimated center. Then, find the second search center line in mirror image: to the right (or below) of the estimated center, mirroring the first one.

[0076] The DualLineCorrelator is invoked to find two parallel edges that are close to the expected distance (approximately 1000 pixels) with a suitable distance error (~±10%). This forms the skeleton of the rounded ROI, i.e., two parallel edges. The distance between these edges is used as the width of the rectangle. Simultaneously, the aforementioned double-sided line detection process is performed in a direction perpendicular to these two edges to obtain two more parallel edges. The distance between these two edges is used as the height of the rectangle, and the center position of the four edges is used as the center position of the rectangle. After receiving parameters such as the image processor, the approximate shape center point, and the search range, two mirror-symmetric search center lines are first generated based on the approximate shape center point, serving as the search references for the left / top and right / bottom sides, respectively. Then, the DualLineCorrelator is instantiated using these two search center lines as core parameters. Finally, the quality-checked line-finding method of the DualLineCorrelator is called to process the input image, returning an array of line segments composed of the two detected edges.

[0077] During the execution of the DualLineCorrelator, multiple pairs of candidate parallel edges are first generated on both sides of the center position, and the edge strength of each pair of candidate parallel edges is calculated (which can be obtained by adding the edge strengths of all corresponding pixels). The candidate parallel edge with the largest edge strength is taken as a pair of parallel edges, and the above operation is performed in the direction perpendicular to the parallel edge to obtain another pair of parallel edges.

[0078] The steps described above for generating ROI region detection results based on the region detection parameters corresponding to each well location include: Specifically, for each region's detection parameters, a detection box is generated based on the region's detection parameters, and the top corners of the generated rectangular detection boxes are rounded to obtain rounded rectangular ROI region detection boxes.

[0079] For example, rotation operations can be performed using functions such as `tiltRadians`. Parameters such as edge angles can be added to the region detection parameters to adapt to actual scenarios such as orifice plate tilt. Then, the center position in the geometric parameters is used as the center of the rectangle. A rectangle is constructed based on the width and height, and the edges of the rectangle are tilted according to the edge angles. Finally, the top corners of the generated rectangular detection box are rounded according to the preset indentation margin, so that the top corners of the rectangular detection box are transformed into rounded corners, resulting in a rounded rectangle ROI region detection box.

[0080] Step 24: Correct the ROI region detection results to obtain the final ROI region detection results of the perforated plate image.

[0081] The above results include: multiple ROI region detection boxes.

[0082] In some embodiments of this application, the steps of correcting the ROI region detection results to obtain the final ROI region detection results of the perforated plate image include: The first step is to calculate the calibration coordinates of the center point of each ROI detection box based on the reference coordinates of the center point of the ROI detection box, and then perform offset calibration on the ROI detection box according to the calibration coordinates to obtain the calibrated ROI detection box.

[0083] Specifically, through the formula:

[0084]

[0085] Calculate the calibration coordinates of the center point .

[0086] in, The x-coordinate of the calibration coordinates of the center point. The ordinate in the calibration coordinates of the center point. The x-coordinate in the reference coordinate system representing the center point. The ordinate in the reference coordinate system representing the center point. This represents the pixel displacement corresponding to each row offset along the horizontal axis. This represents the pixel displacement corresponding to each row offset along the vertical axis. This indicates the row offset of the ROI region detection frame relative to the reference hole position. This indicates the column offset of the ROI region detection frame relative to the reference hole position. This represents the pixel displacement corresponding to each column offset along the horizontal axis. This represents the pixel displacement corresponding to each column offset along the vertical axis.

[0087] Then, using the calibration coordinates as the center position of the detection box, the ROI region detection box is moved to obtain the calibrated ROI region detection box.

[0088] The second step is to calculate the quality score of all calibrated ROI region detection boxes, and recalibrate all calibrated ROI region detection boxes based on the quality score to obtain the final ROI region detection box corresponding to each ROI region detection box.

[0089] The quality score above is the sum of the edge strengths of all calibrated ROI region detection frames.

[0090] Specifically, when the quality score is less than a preset threshold, the parameters in the target detection algorithm are adjusted, and the process returns to the step of using the target detection algorithm to perform target detection on the perforated plate image and obtain the ROI region detection result.

[0091] For example, a quality score can be calculated by accumulating the edge strength of the ROI region detection box. When the quality score is less than a preset threshold, the detection quality is considered low. The parameters in the target detection algorithm (such as the radius range of the circle, the threshold for edge clipping, etc.) are adjusted until the quality score is greater than or equal to the preset threshold. The calibrated ROI region detection box at this time is taken as the corresponding final ROI region detection box.

[0092] In addition, manual recalibration of the rectangle can be introduced. For example, if the quality score is less than a preset threshold, feedback can be given to the user first. After the user confirms the recalibration and the algorithm parameters are manually adjusted, the process of re-detecting the target can be resumed.

[0093] After obtaining the final ROI region detection bounding box, subsequent tasks can be performed based on it, such as counting colonies in the image region corresponding to the final ROI region detection bounding box. For example, when the optimal ROI object is empty, or the ROI quality score is lower than the preset quality threshold, the error ROI generation method is called to generate an error-identifying ROI using the width and height of the current image as parameters, and then assigns it to the optimal ROI variable.

[0094] In some embodiments of this application, the reference hole position, pixel displacement, etc. during the calibration process are preset values. By accurately measuring the reference position of the positioning hole, the ROI position of any hole position is calibrated by the offset in the row and column directions, without the need to calibrate each hole position individually, thereby improving efficiency.

[0095] After calibration, the ROI parameters of each well are persistently stored as fixed configuration data. Subsequent analysis of samples from the same batch directly loads the fixed configuration data, skipping repeated calibration calculations. In the scenario of full-plate testing of an N-well plate, only the first well needs to undergo a complete calibration process, and the cached results are directly called for the remaining N-1 wells, significantly reducing the overall processing time.

[0096] For example, the ROI region detection box obtained using the method of this application is as follows: Figure 3 As shown in the figure, the rounded rectangle represents the detection box. It can be seen that, compared to conventional methods, the detection box obtained by the method in this application can more accurately indicate the colony location. The automatic alignment function of the ROI has an accuracy of >99.7%, essentially achieving automatic alignment of colony areas without manual adjustment, thus providing reliable raw data support for colony counting, positive result determination, signal interpretation, MIC determination, and SIR diagnosis.

[0097] The third step is to use all the final ROI region detection boxes as the final ROI region detection results of the perforated plate image.

[0098] It is worth mentioning that, based on the information of the perforated plate, the target detection algorithm is adaptively selected instead of directly applying a general target detection algorithm. This allows the ROI region detection to adapt to the actual condition of the perforated plate, reducing the interference caused by different perforated plate shapes on target detection, improving the accuracy of ROI region detection, and adding correction processing to the initial ROI region detection results to reduce errors such as boundary offset and edge misalignment. This results in ROI region detection results that are accurately positioned and conform to the actual hole position, further improving the accuracy of ROI region detection.

[0099] The ROI area detection device for colony detection provided in this application is described below as an example.

[0100] like Figure 4 As shown, this application embodiment provides a Region of Interest (ROI) detection device for colony detection. The ROI detection device 400 for colony detection includes: The acquisition module 401 is used to acquire images of well plates used to load bacterial suspensions for microbial susceptibility testing. The determination module 402 is used to determine the target detection algorithm based on the physical structure of the perforated plate; the physical structure is the shape of the holes in the perforated plate. Detection module 403 is used to perform target detection on the perforated plate image using a target detection algorithm to obtain the ROI region detection result; The correction module 404 is used to correct the ROI region detection results to obtain the final ROI region detection results of the perforated plate image.

[0101] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.

[0102] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0103] like Figure 5 As shown, an embodiment of this application provides a terminal device, wherein the terminal device D10 of this embodiment includes: at least one processor D100 ( Figure 5 The diagram shows only one processor, a memory D101, and a computer program D102 stored in the memory D101 and executable on the at least one processor D100, wherein the processor D100 executes the computer program D102 to implement the steps in any of the above method embodiments.

[0104] Specifically, when the processor D100 executes the computer program D102, it acquires an image of the well plate used to load the bacterial suspension for microbial drug sensitivity testing. Then, it determines a target detection algorithm based on the physical structure of the well plate, and uses this algorithm to perform target detection on the well plate image, obtaining the ROI region detection result. Finally, it corrects the ROI region detection result to obtain the final ROI region detection result of the well plate image. In this process, the target detection algorithm is adaptively selected based on the well plate information, rather than directly applying a general target detection algorithm. This adapts the ROI region detection to the actual condition of the well plate, reducing interference caused by different well plate shapes and improving the accuracy of ROI region detection. The initial ROI region detection result is further corrected to reduce errors such as boundary offset and edge misalignment, resulting in an accurately positioned ROI region detection result that conforms to the actual well position, further improving the accuracy of ROI region detection.

[0105] The processor D100 can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.

[0106] In some embodiments, the memory D101 may be an internal storage unit of the terminal device D10, such as a hard disk or memory of the terminal device D10. In other embodiments, the memory D101 may be an external storage device of the terminal device D10, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc., equipped on the terminal device D10. Furthermore, the memory D101 may include both internal and external storage units of the terminal device D10. The memory D101 is used to store the operating system, applications, bootloader, data, and other programs, such as the program code of the computer program. The memory D101 can also be used to temporarily store data that has been output or will be output.

[0107] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0108] This application provides a computer program product that, when run on a terminal device, enables the terminal device to implement the steps described in the various method embodiments above.

[0109] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying the computer program code to an ROI area detection method apparatus / terminal device for colony detection, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.

[0110] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0111] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0112] The above description is the preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this invention, and these improvements and modifications should also be considered within the scope of protection of this invention.

Claims

1. A method for detecting ROI regions for colony detection, characterized in that, include: Acquire images of well plates used to load bacterial suspensions for antimicrobial susceptibility testing; The target detection algorithm is determined based on the physical structure of the orifice plate; the physical structure refers to the shape of the holes in the orifice plate. The target detection algorithm is used to perform target detection on the perforated plate image to obtain the ROI region detection results; The ROI region detection results are corrected to obtain the final ROI region detection results of the perforated plate image.

2. The ROI region detection method according to claim 1, characterized in that, The algorithm for determining the target detection based on the physical structure of the perforated plate includes: Based on the physical structure of the orifice plate, the target detection box type is determined from a variety of detection box types; The detection algorithm corresponding to the target detection box type is used as the target detection algorithm.

3. The ROI region detection method according to claim 1, characterized in that, The step of using the target detection algorithm to perform target detection on the perforated plate image to obtain the ROI region detection result includes: Based on the perforated plate image, target detection is performed on the image region corresponding to each perforation to obtain the region detection parameters corresponding to each perforation. ROI region detection results are generated based on the region detection parameters corresponding to each well location.

4. The ROI region detection method according to claim 3, characterized in that, The various detection frame types include circular detection frames, rectangular detection frames, and rounded rectangular detection frames.

5. The ROI region detection method according to claim 4, characterized in that, When the target detection box type is a circular detection box, the step of performing target detection on the image region corresponding to each hole position based on the perforated plate image to obtain the region detection parameters corresponding to each hole position includes: The high-intensity pixels of the perforated plate image are cropped to obtain a cropped perforated plate image; the pixel intensity values ​​in the cropped perforated plate image are all less than or equal to a preset intensity threshold. A grid region is generated for each hole location on the cropped perforated plate image. A search is performed in each grid region with a first search step size to obtain multiple initial parameters corresponding to each hole location. Candidate parameters for each hole location are determined from all the initial parameters corresponding to each hole location. The candidate parameters include the center position and radius of the circular detection frame. For each of the holes, based on the candidate parameters corresponding to the hole, the image of the cropped perforated plate is traversed with a second search step size to obtain multiple intermediate parameters corresponding to the hole, and the region detection parameters of the hole are determined from all the intermediate parameters.

6. The ROI region detection method according to claim 4, characterized in that, When the target detection box type is a rounded rectangle detection box, the step of performing target detection on the image region corresponding to each hole position based on the perforated plate image to obtain the region detection parameters corresponding to each hole position includes: Edge detection is performed on the perforated plate image to obtain an edge image; The edge image is subjected to rectangular position detection to obtain the region detection parameters for each hole; the region detection parameters include the center position, width, and height of the rounded rectangle detection box.

7. The ROI region detection method according to claim 6, characterized in that, The process of performing rectangular position detection on the edge image to obtain region detection parameters for each hole location includes: For each hole, perform the following steps: The estimated center position of the hole is identified in the edge image, and two pairs of parallel edges are detected in the neighborhood of the estimated center position; the edge intensity of the two pairs of parallel edges is greater than the edge intensity of all other parallel edges. Use the distance between the two pairs of parallel sides as the width and height of the rectangle, respectively. The center of the rectangle is the position of the center of the two pairs of parallel sides.

8. The ROI region detection method according to claim 1, characterized in that, The results include: Multiple ROI region detection boxes; The step of correcting the ROI region detection results to obtain the final ROI region detection results of the perforated plate image includes: For each ROI region detection box, the calibration coordinates of the center point are calculated based on the reference coordinates of the center point of the ROI region detection box. The ROI region detection box is then offset and calibrated according to the calibration coordinates to obtain the calibrated ROI region detection box. Calculate the quality score of all calibrated ROI region detection boxes, and recalibrate all calibrated ROI region detection boxes based on the quality score to obtain the final ROI region detection box corresponding to each ROI region detection box; the quality score is the sum of the edge strengths of all calibrated ROI region detection boxes. All final ROI region detection boxes are taken as the final ROI region detection results of the perforated plate image.

9. The ROI region detection method according to claim 8, characterized in that, The step of recalibrating all ROI region detection boxes based on the quality score to obtain the final ROI region detection box corresponding to each ROI region detection box includes: When the quality score is less than a preset threshold, the parameters in the target detection algorithm are adjusted, and the process returns to the step of using the target detection algorithm to perform target detection on the perforated plate image and obtain the ROI region detection result.

10. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the ROI region detection method for colony detection as described in any one of claims 1 to 9.