Method and system for finding sampling points in a specimen using a Raman spectrometer
By using photography devices and calculation circuits in the Raman spectrometer to segment images and judge the location of the sampling point, the efficiency and accuracy of the Raman spectrometer in the sampling point are solved, and fast and efficient detection of microbial organisms is achieved.
Patent Information
- Application Number
- CN202211241720.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2021-10-21
- Filing Date
- 2022-10-11
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2042-10-11
AI Technical Summary
In the prior art, how to effectively cooperate with Raman spectrometer to find sampling points in the specimen to improve detection efficiency and accuracy is an urgent problem.
The specimen image is acquired through the photography device and divided into multiple blocks, the image feature intensity distribution of each block is calculated, the sampling point position is determined based on the predetermined range and allowable conditions, and the laser beam irradiation area of the Raman spectrometer is used to cover these blocks, and the sampling point is judged based on the image feature intensity such as gray scale value, color scale, etc.
It improves the accuracy of microbial bacterial species judgment, greatly reduces detection time and improves detection efficiency.
Smart Images

Figure CN116008247B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method and system for finding sampling points, and in particular to a method and system for finding sampling points in a specimen in conjunction with a Raman spectrometer. Background Art
[0002] When examining a sample, a Raman spectrometer typically uses a laser to excite the sample, generating scattered light with a Raman spectrum. This scattered light's Raman spectrum is then analyzed. Furthermore, current Raman spectrometers utilize a sampling method, focusing the laser beam onto a sampling point within the sample. Therefore, finding the sampling point within the sample with a Raman spectrometer has become a technical challenge in this field. Summary of the Invention
[0003] In order to solve the above technical problems, the present invention discloses a method for finding sampling points in a specimen in conjunction with a Raman spectrometer, comprising the following steps. An image of an area of the specimen is obtained by a photographic device, and the image is divided into a plurality of blocks. The area corresponding to each block on the specimen can be covered by the area irradiated by the laser beam of the Raman spectrometer. For each of these blocks, the distribution pattern of pixels in the nth block whose image feature intensity is higher than, lower than, and / or between a predetermined range is calculated, and when the distribution pattern meets an acceptance condition, the position corresponding to the nth block in the specimen is determined to be capable of being used as a sampling point. n is a variable, and the predetermined range is determined based on the image features of a plurality of microorganisms corresponding to a plurality of analyzable Raman spectra, and each analyzable Raman spectrum contains a microorganism feature pattern. Image feature intensity refers to a color scale or flickering frequency, and the color scale is a grayscale value, hue / saturation, brightness, chroma, contrast, or depth value.
[0004] Preferably, the steps from calculating the distribution pattern of the nth block to determining that the position corresponding to the nth block in the specimen can be used as a sampling point include: calculating the proportion of pixels in the nth block whose grayscale values are between a predetermined range, and determining whether the proportion meets the acceptance conditions; and when the proportion meets the acceptance conditions, determining that the position corresponding to the nth block in the specimen can be used as a sampling point.
[0005] Preferably, after determining that the position corresponding to the nth block in the specimen can be used as a sampling point or judging that the proportion does not meet the acceptance conditions, the method also includes: judging whether every block of the image has been checked; if not, changing the value of n and returning to the step of calculating the proportion; and if so, judging whether there are other areas of the specimen where other sampling points can be found.
[0006] Preferably, the steps from calculating the distribution pattern of the nth block to determining that the position corresponding to the nth block in the specimen can be used as a sampling point include: respectively calculating a first proportion of pixels in the nth block whose red values are between a first predetermined range, a second proportion of pixels whose green values are between a second predetermined range, and a third proportion of pixels whose blue values are between a third predetermined range; calculating a first weight of the red value, a second weight of the green value, and a third weight of the blue value based on the first proportion, the second proportion, and the third proportion, and calculating the depth value of each pixel in the nth block based on the first weight, the second weight, and the third weight; calculating a fourth proportion of pixels in the nth block whose depth values are between a fourth predetermined range, and determining whether the fourth proportion meets the acceptance condition; and when the fourth proportion meets the acceptance condition, determining that the position corresponding to the nth block in the specimen can be used as a sampling point.
[0007] Preferably, after determining that the position corresponding to the nth block in the specimen can be used as a sampling point or judging that the fourth proportion does not meet the acceptance conditions, the method also includes: judging whether every block of the image has been checked; if not, changing the value of n and returning to the steps of calculating the first proportion, the second proportion and the third proportion respectively; and if so, judging whether there are other areas of the specimen where other sampling points can be found.
[0008] Preferably, before obtaining an image through a photographic device, the method also includes: switching the objective lens of the photographic device to a low-magnification state so that its field of view covers the entire colony of the specimen; finding the colony boundary through an algorithm and defining the colony range; calculating the sum of the red values, the green values, and the blue values of all pixels within the colony range; calculating the first weight of the red value, the second weight of the green value, and the third weight of the blue value based on the sum of the red values, the green values, and the blue values; and switching the objective lens of the photographic device to a high-magnification state.
[0009] Preferably, before dividing the image into multiple blocks, the method also includes: converting the image into a grayscale image; calculating a first proportion of pixels in the grayscale image whose grayscale values are between a first predetermined range, and determining whether the first proportion is less than a first threshold; if so, returning to the step of obtaining the image, and the image obtained each time the step is executed is an image of a different area of the specimen; and if not, executing the step of dividing the image into multiple blocks.
[0010] Preferably, the steps from calculating the distribution pattern of the nth block to determining that the position corresponding to the nth block in the specimen can be used as a sampling point include: calculating the depth value of each pixel in the nth block based on the first weight, the second weight and the third weight; calculating the second proportion of pixels in the nth block whose depth values are between a second predetermined range, and determining whether the second proportion meets the acceptance conditions; and when the second proportion meets the acceptance conditions, determining that the position corresponding to the nth block in the specimen can be used as a sampling point.
[0011] Preferably, after determining that the position corresponding to the nth block in the specimen can be used as a sampling point or judging that the second proportion does not meet the acceptance conditions, the method also includes: judging whether every block of the image has been checked; if not, changing the value of n and returning to the step of calculating the depth value of each pixel in the nth block; and if so, judging whether there are other areas of the specimen where other sampling points can be found.
[0012] Preferably, when there are other areas of the specimen where other sampling points can be found, the process returns to the step of obtaining an image, and the image obtained each time the step is performed is an image of a different area of the specimen.
[0013] To address the above-mentioned technical problems, the present invention further discloses a system for finding sampling points in a specimen in conjunction with a Raman spectrometer, comprising a photographic device and a computing circuit. The photographic device is used to photograph the specimen. The computing circuit is coupled to the photographic device and is used to perform the following steps. An image of a region of the specimen is captured by the photographic device and divided into a plurality of blocks. Each block corresponds to an area on the specimen that can be covered by the laser beam illumination area of the Raman spectrometer. For each of these blocks, the distribution pattern of pixels within the nth block whose image feature intensity is above, below, and / or between a predetermined range is calculated. When the distribution pattern meets an acceptance condition, the position corresponding to the nth block in the specimen is determined to be suitable for use as a sampling point. n is a variable, and the predetermined range is determined based on image features of multiple microorganisms corresponding to multiple analyzable Raman spectra, each of which contains a microorganism feature pattern. Image feature intensity refers to a color scale or flicker frequency, and the color scale can be grayscale value, hue / saturation, brightness, chroma, contrast, or lightness / shade value.
[0014] According to the method and system disclosed in the present invention, when using a Raman spectrometer to detect microorganisms in a specimen and determine the type of bacteria the microorganisms are, not only can the accuracy of determining the bacterial species be improved, but the time required for detection can also be significantly reduced.
[0015] To further understand the features and technical contents of the present invention, please refer to the following detailed description and drawings of the present invention. However, the drawings provided are only for reference and illustration and are not intended to limit the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 This is a flowchart of the steps of the method for finding a sampling point in a specimen in conjunction with a Raman spectrometer provided in the first embodiment of the present invention.
[0017] Figure 2 FIG. 4 is a schematic diagram showing an image being divided into multiple blocks according to an embodiment of the present invention.
[0018] Figure 3 This is a flowchart of the steps of a method for finding a sampling point in a specimen in conjunction with a Raman spectrometer provided in a second embodiment of the present invention.
[0019] Figure 4A and Figure 4B 1 is a flowchart of the steps of a method for finding a sampling point in a specimen in conjunction with a Raman spectrometer provided in a third embodiment of the present invention.
[0020] Figure 5 This is a flowchart of the steps for calculating the weights of red value, green value and blue value at one time provided by an embodiment of the present invention.
[0021] Figure 6A and Figure 6B 4 is a flowchart of a method for finding a sampling point in a specimen in conjunction with a Raman spectrometer, provided in accordance with a fourth embodiment of the present invention.
[0022] Figure 7 FIG. 4 is a block diagram of a system for finding sampling points in a specimen in conjunction with a Raman spectrometer according to an embodiment of the present invention. DETAILED DESCRIPTION
[0023] The following is an explanation of the embodiments of the present invention through specific embodiments. Those skilled in the art can understand the advantages and effects of the present invention from the content provided in this specification. The present invention can be implemented or applied through other different specific embodiments, and the details in this specification can also be modified and changed based on different viewpoints and applications without departing from the concept of the present invention. In addition, the drawings of the present invention are only simple schematic illustrations and are not depicted in actual size. It is stated in advance. The following embodiments will further explain the relevant technical content of the present invention in detail, but the content provided is not intended to limit the scope of protection of the present invention.
[0024] Please also see Figure 1 and Figure 7 , Figure 1 This is a flowchart of the steps of the method for finding a sampling point in a specimen in conjunction with a Raman spectrometer provided in the first embodiment of the present invention. Figure 7 The block diagram of the system for finding sampling points in a specimen in conjunction with a Raman spectrometer provided in an embodiment of the present invention is shown in FIG. Figure 7In the system 70, the system 70 includes at least a photographic device 700 and a computing circuit 702. The photographic device 700 is used to photograph the specimen, but the present invention does not limit the specific implementation of the photographic device 700 and its photographing of the specimen. The computing circuit 702 is coupled to the photographic device 700, and it can be implemented by hardware with software and / or firmware, but the present invention does not limit the specific implementation of the computing circuit 702. In addition, the photographic device 700 and / or the computing circuit 702 can be integrated into the Raman spectrometer 72, or independent of the Raman spectrometer 72. In short, the method and system 70 of the present invention can be used in conjunction with the Raman spectrometer 72, but the present invention does not limit the specific implementation of the Raman spectrometer 72.
[0025] The Raman spectrometer 72 divides the sample into multiple regions for detection. For example, the Raman spectrometer 72 usually uses a microscope to detect the sample, and the field of view of the microscope is much smaller than the size of the sample. Therefore, the Raman spectrometer 72 can divide the sample into multiple regions according to the field of view of the microscope, but the present invention is not limited to this. The method of finding the sampling point of the present invention is as follows: Figure 1 As shown, in step S110, the computing circuit 702 can obtain an image of an area of the specimen through the photographic device 700, and in step S120, the image is divided into a plurality of blocks, and each block may contain a plurality of microorganisms. However, the present invention does not limit the specific format of the image. In short, the image obtained by the photographic device 700 can be a dynamic image or a static image, such as a movie, a grayscale image, or a color image. In addition, since the image of an area of the specimen is segmented, each block can correspond to a position in the specimen, and the area corresponding to each block on the specimen can be covered by the laser beam irradiation area of the Raman spectrometer 72.
[0026] Please also refer to Figure 2 , Figure 2 FIG is a schematic diagram showing that an image according to an embodiment of the present invention is divided into multiple blocks. Figure 2 As shown, according to the size of the field of view of the microscope, the computing circuit 702 can obtain an image Im with a size of 320 microns × 240 microns, and according to the size of the laser beam irradiation area of the Raman spectrometer 72, the computing circuit 702 can divide the image Im into 12 blocks, and the area size of each block on the specimen is 80 microns × 80 microns, but the present invention is not limited to this. In other embodiments, there may be overlapping parts between the blocks. In short, the present invention does not limit the specific implementation method of the computing circuit 702 dividing the image Im into multiple blocks. Then, in step S130, for each of these blocks, the computing circuit 702 can give a number n, n is a variable, and if Figure 2Taking the 12 blocks as an example, the value of n can be an integer from 1 to 12, but the present invention is not limited to this. In addition, the calculation circuit 702 can calculate the distribution pattern of pixels in the nth block whose image feature intensity is higher than, lower than, and / or between a predetermined range. When the distribution pattern meets an acceptance condition, the calculation circuit 702 determines that the position corresponding to the nth block in the specimen can be used as a sampling point. The position corresponding to the nth block in the specimen can be, for example, the center point of the area corresponding to the nth block on the specimen, one of the four endpoints, the geometric center of the corresponding area, or any coordinate point within the corresponding area. The above-mentioned image feature intensity refers to the grayscale value of the pixel, for example, but the present invention is not limited to this. In other embodiments, the image feature intensity can refer to a static color scale or a dynamic flicker frequency, and the color scale includes grayscale value, hue / saturation, brightness, color, and contrast.
[0027] Because the Raman spectra of different types of bacteria have different characteristic peak positions, the Raman spectrometer 72 can distinguish the type of bacteria at the sampling point by identifying the spectral position of the peak in the spectrum. Raman spectra with such characteristic peak positions are referred to herein as "Raman spectra containing a characteristic pattern of a microorganism." However, not all generated Raman spectra can be analyzed. If the Raman spectrum generated by the laser beam projected onto the microorganisms within the block cannot be analyzed, such unanalyzable Raman spectra will be referred to as unanalyzable spectra in the present invention, and Raman spectra that can be analyzed will be referred to as analyzable Raman spectra in the present invention. As can be seen from the above, analyzable Raman spectra have characteristic patterns of microorganisms. In addition, the database of the Raman spectrometer 72 will store these analyzable Raman spectra, the microorganism data corresponding to these analyzable Raman spectra, and the image features of these microorganisms. For example, if the image features are represented by the grayscale values of pixels, big data analysis indicates that projecting a laser beam onto microorganisms in areas that are too dark or too white will not produce any analyzable Raman spectra. Therefore, the predetermined range can be set to grayscale values between 120 and 250. Alternatively, the predetermined range can be determined based on the image features of multiple microorganisms corresponding to multiple analyzable Raman spectra, with each analyzable Raman spectrum containing a characteristic pattern of a microorganism.
[0028] Next, please refer to Figure 3 , Figure 3 This is a flowchart of the steps of a method for finding a sampling point in a specimen in conjunction with a Raman spectrometer provided in a second embodiment of the present invention. Figure 3 Zhongyu Figure 1 The same steps are denoted by the same reference numerals, and therefore their details will not be described in detail here. Figure 3As shown, step S130 may include steps S331, S332, and S333. In step S331, the calculation circuit 702 may calculate the percentage of pixels in the nth block whose grayscale values are within a predetermined range (e.g., grayscale values 120 to 250). That is, the percentage is equal to the number of pixels in the nth block whose grayscale values are within the predetermined range divided by the total number of pixels in the nth block, and then multiplied by 100%. Next, in step S332, the calculation circuit 702 may determine whether the percentage meets an acceptance condition (e.g., greater than or equal to 50%). If the acceptance condition is met, the calculation circuit 702 may first execute step S333 to determine whether the position corresponding to the nth block in the specimen can be used as a sampling point, and then execute step S340. If the acceptance condition is not met, the calculation circuit 702 directly executes step S340.
[0029] In step S340, the calculation circuit 702 determines whether each block of the image Im has been inspected. If so, this indicates that the calculation circuit 702 has calculated the percentage of pixels within each block whose grayscale values fall within a predetermined range and has determined whether this percentage for each block meets the acceptance criteria. Therefore, the calculation circuit 702 executes step S360. If all blocks of the image Im have not been inspected, the calculation circuit 702 executes step S350 to change the value of n, and then returns to step S331 after the value of n has been changed. Furthermore, since the Raman spectrometer 72 can divide the specimen into multiple regions for inspection, and the currently acquired image Im represents only one region of the specimen, in step S360, the calculation circuit 702 determines whether there are other regions of the specimen where sampling points can be found. If not, it means that there is no other area in the current sample to find the sampling point, so the calculation circuit 702 can execute step S370 to end the method of finding the sampling point in the current sample. If sampling points need to be found in other samples, the system 70 will re-execute the method.
[0030] On the other hand, if it is determined that there are other areas of the specimen where sampling points can be found, the computing circuit 702 returns to step S110. However, to avoid repeatedly analyzing the same area, each time the computing circuit 702 executes step S110, it may compare the image of the area being sampled with the image of the previously detected area to confirm that the area being sampled is different from the area where sampling points were previously found. It should be noted that when the Raman spectrometer 72 is testing the specimen, it typically moves the stage on which the specimen is placed to allow testing of different areas of the specimen. Therefore, while the present invention does not limit the specific implementation of the imaging device 700 and its imaging of the specimen, if the imaging device 700 is integrated into the Raman spectrometer 72 and the computing circuit 702 only images a region of the specimen on the stage each time it executes step S110, then during the process of returning from step S360 to step S110, the computing circuit 702 may also perform an additional step to move the stage to enable the imaging device 700 to image another area of the specimen. Furthermore, the present invention does not limit the specific implementation of changing the value of n.
[0031] If Figure 2 Taking the image Im divided into 12 blocks as an example, the calculation circuit 702 may also initialize the value of n to 1 before executing step S130, and add 1 to the value of n in step S350. Conversely, the calculation circuit 702 may also initialize the value of n to 12 before executing step S130, and subtract 1 from the value of n in step S350. In short, the present invention does not limit the specific implementation method of changing the value of n. In addition, with respect to calculating the distribution pattern of pixels whose image feature intensity in the nth block is higher than, lower than, and / or between a predetermined range, Figure 3 The second embodiment is to calculate only the ratio of pixels in the nth block whose grayscale values are within a predetermined range. Therefore, if the image Im obtained by the photographic device 700 is a color image, the calculation circuit 702 can also execute Figure 3 Before step S130, the color image is converted into a grayscale image, or refer to Figure 4A and Figure 4B , Figure 4A and Figure 4B 1 is a flowchart of the steps of a method for finding a sampling point in a specimen in conjunction with a Raman spectrometer provided in a third embodiment of the present invention.
[0032] like Figure 4A and Figure 4BAs shown, step S130 may also include steps S431, S432, S433, S434, S435, and S436. In step S431, the calculation circuit 702 may calculate a first ratio of pixels having red (R) values within a first predetermined range, a second ratio of pixels having green (G) values within a second predetermined range, and a third ratio of pixels having blue (B) values within a third predetermined range in the nth block. For convenience of the following description, in this embodiment, the first ratio, the second ratio, and the third ratio may be represented by RR, GR, and BR, respectively. In step S432, based on RR, GR, and BR, the calculation circuit 702 may calculate a first weight for the R value, a second weight for the G value, and a third weight for the B value. The first weight of the R value, the second weight of the G value, and the third weight of the B value can be represented by Wr, Wg, and Wb, respectively, and Wr=RR / (RR+GR+BR), Wg=GR / (RR+GR+BR), and Wb=BR / (RR+GR+BR). Therefore, in step S433, based on Wr, Wg, and Wb, the calculation circuit 702 can calculate the depth value of each pixel in the nth block, that is, the depth value of each pixel is equal to the sum of the R value of the pixel multiplied by Wr, the G value multiplied by Wg, and the B value multiplied by Wb.
[0033] Then, in step S434, the calculation circuit 702 calculates a fourth percentage of pixels within the nth block whose shading values fall within a fourth predetermined range. In step S435, the calculation circuit 702 determines whether the fourth percentage meets an acceptance condition (e.g., less than 70%). If the acceptance condition is met, the calculation circuit 702 first executes step S436 to determine whether the location corresponding to the nth block in the specimen is suitable for use as a sampling point, and then executes step S440. If the acceptance condition is not met, the calculation circuit 702 directly executes step S440.
[0034] Similarly, in step S440, the calculation circuit 702 may determine whether each block of the image Im has been checked. If not, the calculation circuit 702 may execute step S450 to change the value of n, and return to step S431 after the value of n is changed; if so, it means that the calculation circuit 702 has calculated the fourth proportion of pixels whose depth values are within the fourth predetermined range in each block of the image Im, and has also determined whether the fourth proportion of each block meets the acceptance condition. Therefore, the calculation circuit 702 may execute step S460 to determine whether there are other areas in the specimen where sampling points can be found. If it is determined that there are no other areas in the specimen where sampling points can be found, the calculation circuit 702 executes step S470 to end the method of finding sampling points in the current specimen.
[0035] However, due to Figure 4A and Figure 4BThe third embodiment also assumes that the photographic device 700 is integrated into the Raman spectrometer 72, and that each time the computing circuit 702 executes step S110, it only captures a portion of the specimen on the stage. Therefore, upon determining that there are other areas of the specimen where sampling points can be found, the computing circuit 702 may execute step S480 to move the stage so that the photographic device 700 can capture another area of the specimen, and then return to step S110. However, the present invention is not limited to this. In short, if the photographic device 700 is not integrated into the Raman spectrometer 72, the computing circuit 702 may skip step S480 and return directly to step S110 upon determining that there are other areas of the specimen where sampling points can be found. However, each time the computing circuit 702 executes step S110, it captures an image of another area of the specimen. Since the relevant details are already described in the previous embodiment, they will not be further elaborated here.
[0036] Furthermore, the present invention does not limit the specific implementation method of the calculation circuit 702 moving the stage. Furthermore, the calculation circuit 702 can also add other determination conditions to terminate the method of finding sampling points in the current specimen. For example, the present invention can limit the number of sampling points found to 20 for each specimen. Therefore, after the calculation circuit 702 determines that the position corresponding to the nth block in the specimen can be used as a sampling point, the calculation circuit 702 can also first determine whether the number of positions currently determined to be suitable as sampling points has reached 20. If so, the calculation circuit 702 can directly terminate the method of finding sampling points in the current specimen. Furthermore, if the calculation circuit 702 is also integrated into the Raman spectrometer 72, and the Raman spectrometer 72 can also directly cooperate with the calculation circuit 702 to project the laser beam onto the position of the microorganism within the nth block, the calculation circuit 702 can simply record the number of the nth block.
[0037] In other words, for calculating the distribution of pixels in the nth block whose image feature intensities are higher, lower, and / or between the predetermined range, Figure 4A and Figure 4B The third embodiment is to calculate the fourth ratio of pixels in the nth block whose shading values are within the fourth predetermined range. Since the shading value of each pixel is equal to the sum of the R value multiplied by Wr, the G value multiplied by Wg, and the B value multiplied by Wb of the pixel, if Wr, Wg, and Wb can be fixed, the calculation circuit 702 can omit steps S431 and S432. Figure 5 , Figure 5 This is a flowchart of the steps for calculating the weights of red value, green value and blue value at one time provided by an embodiment of the present invention. Figure 5 As shown, step S500 includes steps S501 to S504.
[0038] In step S501, the calculation circuit 702 may switch the objective lens of the photographic device 700 to a low magnification (for example, ×4) state so that its field of view covers the entire colony of the specimen. Secondly, in step S502, the calculation circuit 702 may find the colony boundary through an algorithm and define the colony range. Then in step S503, the calculation circuit 702 may calculate the sum of the R values, the sum of the G values, and the sum of the B values of all pixels within the colony range. For the convenience of the following description, the sum of the R values, the sum of the G values, and the sum of the B values of all pixels within the colony range may be represented by RS, GS, and BS, respectively, and in step S504, based on RS, GS, and BS, the calculation circuit 702 may calculate Wr=RS / (RS+GS+BS), Wg=GS / (RS+GS+BS), and Wb=BS / (RS+GS+BS). In other words, the calculation circuit 702 may also calculate Figure 5 The calculation of Wr, Wg and Wb is performed in step S500, without calculating Wr, Wg and Wb based on RR, GR and BR. Figure 6A and Figure 6B , Figure 6A and Figure 6B 4 is a flowchart of a method for finding a sampling point in a specimen in conjunction with a Raman spectrometer, provided in accordance with a fourth embodiment of the present invention.
[0039] like Figure 6A and Figure 6B As shown, after the calculation circuit 702 executes step S500 to calculate Wr, Wg, and Wb, the calculation circuit 702 may execute step S610 to switch the objective lens of the photographic device 700 to a high magnification (e.g., ×20) state, and then execute step S110. Figure 3 The second embodiment, Figure 6A and Figure 6B The fourth embodiment may also include steps S611, S612, S613, and S680 before step S120. In step S611, the computing circuit 702 may convert the image Im from a color image into a grayscale image. In step S612, the computing circuit 702 may calculate a first percentage of pixels in the grayscale image whose grayscale values fall within a first predetermined range. Next, in step S613, the computing circuit 702 may determine whether the first percentage is less than a first threshold (e.g., 80%). If so, the computing circuit 702 may preliminarily determine that the region of the specimen corresponding to the image Im at this time does not yet produce an analyzable Raman spectrum. Therefore, the computing circuit 702 may execute step S680 to move the stage so that the imaging device 700 can capture another region of the specimen and then return to step S110. If not, the computing circuit 702 may execute step S120 to divide the image Im into multiple blocks.
[0040] Similarly, if the imaging device 700 is not integrated into the Raman spectrometer 72, the calculation circuit 702 may also directly return to step S110 when determining that the first ratio is less than the first threshold, but the calculation circuit 702 obtains an image of another area of the specimen each time it executes step S110. Figure 6A and Figure 6B Step S130 may include steps S631, S632, S633, and S634. In step S631, based on Wr, Wg, and Wb, the calculation circuit 702 may calculate the depth value of each pixel in the n-th block, and in step S632, the calculation circuit 702 may calculate a second proportion of pixels in the n-th block whose depth values are within a second predetermined range. Then, in step S633, the calculation circuit 702 may determine whether the second proportion meets the acceptance condition (for example, less than 70%). If so, the calculation circuit 702 may first execute step S634 to determine whether the position corresponding to the n-th block in the specimen can be used as a sampling point, and then execute step S640; if not, the calculation circuit 702 directly executes step S640.
[0041] In step S640, the calculation circuit 702 determines whether it has examined every block of the image Im. If not, the calculation circuit 702 executes step S650 to change the value of n and, after the value of n has been changed, returns to step S631. If so, this indicates that the calculation circuit 702 has calculated the second percentage of pixels having a shading value within the second predetermined range within each block of the image Im and has determined whether the second percentage for each block meets the acceptance criteria. Therefore, the calculation circuit 702 executes step S660 to determine whether there are other areas of the specimen where sampling points can be found. If it is determined that there are no other areas of the specimen where sampling points can be found, the calculation circuit 702 executes step S670 to terminate the method of searching for sampling points in the current specimen. Conversely, if it is determined that there are other areas of the specimen where sampling points can be found, the calculation circuit 702 executes step S680 to move the stage so that the imaging device 700 can capture another area of the specimen and returns to step S110. Since the relevant details are the same as those in the previous embodiment, they will not be repeated here.
[0042] In summary, the method and system proposed in the embodiments of the present invention utilizes a technique that divides an image into multiple blocks and determines whether the image features within each block meet specific criteria. This technique determines whether the specimen location corresponding to a specific block is suitable for sampling, thereby achieving rapid detection. When using a Raman spectrometer to detect microorganisms in a specimen and determine their bacterial species, this not only improves the accuracy of bacterial species identification but also significantly reduces detection time.
[0043] The contents disclosed above are only preferred feasible embodiments of the present invention and do not limit the claims of the present invention. Therefore, all equivalent technical changes made using the contents of the present invention description and drawings are included in the claims of the present invention.
Claims
1. A method for finding a sampling point in a specimen using a Raman spectrometer, characterized in that: The method comprises: Acquiring an image of a region of the specimen using a photographic device, and dividing the image into a plurality of blocks, wherein each block corresponds to an area on the specimen that can be covered by the laser beam irradiation area of the Raman spectrometer; and For each of the plurality of blocks, calculating a distribution pattern of pixels within the nth block whose image feature intensity is within a predetermined range, and determining a position in the specimen corresponding to the nth block as the sampling point when the distribution pattern meets an acceptance condition; wherein n is a variable, the predetermined range is determined based on the image features of a plurality of microorganisms corresponding to a plurality of analyzable Raman spectra, and each of the analyzable Raman spectra contains a characteristic pattern of a microorganism; The image feature intensity refers to a color scale or a flicker frequency, and the color scale is a grayscale value, hue / saturation, brightness, chroma, contrast or depth value.
2. The method according to claim 1, characterized in that The step from calculating the distribution pattern of the n-th block to determining that the position corresponding to the n-th block in the specimen can be used as the sampling point includes: Calculating a ratio of pixels in the nth block whose grayscale values are within the predetermined range, and determining whether the ratio meets the acceptance condition; and When the proportion meets the acceptance condition, it is determined that the position corresponding to the nth block in the specimen can be used as the sampling point.
3. The method according to claim 2, characterized in that After determining that the position corresponding to the nth block in the specimen can be used as the sampling point or determining that the proportion does not meet the acceptance condition, the method further includes: determining whether each of the blocks of the image has been checked; If not, change the value of n and return to the step of calculating the proportion; and If so, determine whether there are other areas of the specimen where other sampling points can be found.
4. The method according to claim 1, wherein The step from calculating the distribution pattern of the n-th block to determining that the position corresponding to the n-th block in the specimen can be used as the sampling point includes: Calculating a first proportion of pixels having red values within a first predetermined range, a second proportion of pixels having green values within a second predetermined range, and a third proportion of pixels having blue values within a third predetermined range in the nth block; Calculating a first weight of the red value, a second weight of the green value, and a third weight of the blue value based on the first ratio, the second ratio, and the third ratio, and calculating the depth value of each pixel in the nth block based on the first weight, the second weight, and the third weight; calculating a fourth ratio of pixels in the nth block whose depth values are within a fourth predetermined range, and determining whether the fourth ratio meets the acceptance condition; and When the fourth proportion meets the acceptance condition, it is determined that the position corresponding to the nth block in the specimen can be used as the sampling point.
5. The method according to claim 4, characterized in that After determining that the position corresponding to the nth block in the specimen can be used as the sampling point or determining that the fourth proportion does not meet the acceptance condition, the method further includes: determining whether each of the blocks of the image has been checked; If not, change the value of n and return to the steps of respectively calculating the first proportion, the second proportion, and the third proportion; and If so, determine whether there are other areas of the specimen where other sampling points can be found.
6. The method according to claim 1, wherein Before acquiring the image by the photographic device, the method further includes: Switching an objective lens of the photographic device to a low magnification state so that its field of view covers the entire bacterial colony of the specimen; Find a colony boundary through an algorithm and define a colony range; Calculating a sum of red values, a sum of green values, and a sum of blue values of all pixels within the colony; Calculating a first weight of the red value, a second weight of the green value, and a third weight of the blue value according to the sum of the red values, the sum of the green values, and the sum of the blue values; and The objective lens of the photographic device is switched to a high magnification state.
7. The method according to claim 6, characterized in that Before dividing the image into a plurality of blocks, the method further includes: Converting the image into a grayscale image; Calculating a first ratio of pixels in the grayscale image whose grayscale values are within a first predetermined range, and determining whether the first ratio is less than a first threshold; If so, return to the step of obtaining the image, and the image obtained each time the step is performed is an image of a different area of the specimen; and If not, the step of dividing the image into a plurality of the blocks is performed.
8. The method according to claim 7, characterized in that The step from calculating the distribution pattern of the n-th block to determining that the position corresponding to the n-th block in the specimen can be used as the sampling point includes: Calculating the depth value of each pixel in the nth block according to the first weight, the second weight, and the third weight; Calculating a second ratio of pixels in the nth block whose depth values are within a second predetermined range, and determining whether the second ratio meets the acceptance condition; and When the second proportion meets the acceptance condition, it is determined that the position corresponding to the nth block in the specimen can be used as the sampling point.
9. The method according to claim 8, characterized in that After determining that the position corresponding to the nth block in the specimen can be used as the sampling point or determining that the second proportion does not meet the acceptance condition, the method further includes: determining whether each of the blocks of the image has been checked; If not, change the value of n and return to the step of calculating the depth value of each pixel in the nth block; and If so, determine whether there are other areas of the specimen where other sampling points can be found.
10. The method according to claim 3, 5 or 9, characterized in that When there are other areas of the specimen where other sampling points can be found, the process returns to the step of obtaining the image, and the image obtained each time the step is performed is an image of a different area of the specimen.
11. A system for finding a sampling point in a specimen in conjunction with a Raman spectrometer, characterized in that: The system comprises: a photographing device for photographing the specimen; and A computing circuit, coupled to the photographic device, is configured to perform the following steps: Acquire an image of a region of the specimen using the photographic device, and divide the image into a plurality of blocks, wherein each block corresponds to an area on the specimen that can be covered by the laser beam irradiation area of the Raman spectrometer; and For each of the plurality of blocks, calculating a distribution pattern of pixels within the nth block whose image feature intensity is within a predetermined range, and determining a position corresponding to the nth block in the specimen as the sampling point when the distribution pattern meets an acceptance condition; wherein n is a variable, the predetermined range is determined based on the image features of a plurality of microorganisms corresponding to a plurality of analyzable Raman spectra, and each of the analyzable Raman spectra contains a characteristic pattern of a microorganism; The image feature intensity refers to a color scale or a flicker frequency, and the color scale is a grayscale value, hue / saturation, brightness, chroma, contrast or depth value.
Citation Information
Patent Citations
Charged-particle microscope with Raman spectroscopy capability
CN104280377A
Non-destructive testing method of packaged food quality based on blind source separation Raman scattering image
CN108827934A