A microscopic imaging method, device, equipment and medium based on grating illumination
Through grating illumination technology, grating devices are used to form stripe-shaped illumination light and automatically trigger imaging, which solves the problem of high computational complexity of traditional structured light imaging technology and achieves efficient and high-resolution imaging.
Patent Information
- Application Number
- CN202411445703.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2044-10-16
AI Technical Summary
Traditional structured light imaging technology has complex computational processing, long imaging time, and high computing resource consumption, making it difficult to meet the needs of high-efficiency and high-resolution imaging.
A grating device with alternating translucent and opaque areas is used to form striped illumination light. The movement of the grating device automatically triggers the imaging camera to capture images, creating and gradually updating background and highlight images, reducing computational complexity.
It greatly shortens the imaging time, improves the imaging efficiency, reduces the computational complexity, and enhances the system stability and the accuracy of the image information.
Smart Images

Figure CN119414585B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of microscope imaging, and in particular to a microscope imaging method, device, equipment and medium based on grating illumination. Background Art
[0002] With the development of microscopic imaging technology, structured light imaging, as a high-resolution imaging method, has been widely used in fields such as biomedicine and materials science. By utilizing structured illumination patterns, structured light imaging can improve image quality without sacrificing resolution, meeting the high-precision requirements of scientific research.
[0003] Traditional structured light imaging technology uses multiple captures of fringe patterns at different phases to supplement the image's frequency domain information, thereby converting high-frequency frequency-domain images into high-resolution time-domain images. This process typically requires multiple captures and complex computational processing, and further improvements are needed. Summary of the Invention
[0004] To address the complex computational processing issues associated with existing structured light imaging technology, this application provides a microscopic imaging method, apparatus, device, and medium based on grating illumination, employing the following technical solutions:
[0005] In a first aspect, the present application provides a microscopic imaging method based on grating illumination, comprising the following steps:
[0006] Controlling the light emitted by the light source module to pass through a grating device having alternately arranged light-transmitting areas and light-impermeable areas to form stripe-shaped illumination light;
[0007] Using a filter to filter the stripe-shaped illumination light, focusing the filtered stripe-shaped illumination light on the sample through an objective lens, and controlling the movement of the grating device to change the position of the stripe-shaped illumination light on the sample;
[0008] After each movement of the grating device, the imaging camera is automatically triggered to capture an image of the sample to obtain a captured image set; based on the captured image set, a background image and a highlight image of the same size as the captured image are created, wherein the initial grayscale values of the background image and the highlight image are zero;
[0009] Calculating the grayscale value difference between corresponding pixels of any two captured images, and when the grayscale value difference is less than or equal to a preset threshold, updating the corresponding pixel values in the background image and the highlight image;
[0010] continuing the process until all of the captured images have been compared;
[0011] The difference between the highlighted image and the background image is calculated to obtain an optimized image.
[0012] By adopting the above-mentioned technical solution, traditional structured light imaging technology usually acquires multiple images by changing the phase of the illumination light, and processes the image information in the frequency domain through mathematical transformations (such as Fourier transform), thereby achieving high-resolution imaging. The imaging time is long and the computational complexity is high, especially when processing a large amount of image data, which easily leads to excessive consumption of computing resources. The present application forms striped illumination light through a grating device having alternatingly arranged light-transmitting areas and opaque areas, and automatically triggers the imaging camera to capture the sample image after each movement of the grating device, and creates a background image and a highlight image and gradually updates them, which greatly shortens the imaging time, improves imaging efficiency, reduces complex computational processing, and reduces computational complexity.
[0013] Optionally, when the grayscale value difference is less than or equal to a preset threshold, updating the corresponding pixel value in the background image specifically includes the following steps:
[0014] When the grayscale value difference is less than or equal to a preset threshold, determining whether the pixel value at the corresponding position in the background image is zero; if the pixel value at the corresponding position in the background image is zero, setting the pixel value at the corresponding position to the average of the grayscale values at the corresponding positions in the two captured images;
[0015] If the pixel value at the corresponding position in the background image is not zero, comparing the pixel value at the corresponding position in the background image with the average grayscale value of the corresponding positions in the two captured images;
[0016] If the pixel value in the background image is greater than the mean, the pixel value at the corresponding position in the background image is updated to the mean; if the pixel value in the background image is not less than the mean, the pixel value at the corresponding position in the highlight image remains unchanged.
[0017] By adopting the above technical solution, when the value of a pixel in the background image is zero, it means that the position has not been filled with valid information. At this time, the pixel value is set to the average of the grayscale values of the corresponding positions in the two captured images as a preliminary estimate. When the value of a pixel in the background image is not zero, it means that there is certain information. At this time, by comparing the existing pixel value with the average of the newly captured image, it is decided whether to update the pixel value to ensure the accuracy and consistency of the information. If the existing pixel value is greater than the average of the newly captured image, it means that the background information may be too prominent and needs to be adjusted to the average to be closer to the real background. In this way, through gradual updating, the background information is ensured to be more accurate, and the instability of a single image is avoided. Through simple mean comparison and update operations, complex calculation processing is reduced, and the overall calculation complexity is reduced. At the same time, the gradual update strategy reduces the sensitivity to the external environment (such as vibration) and enhances the stability of the system.
[0018] Optionally, when the grayscale value difference is less than or equal to a preset threshold, updating the corresponding pixel value in the highlighted image specifically includes the following steps:
[0019] When the grayscale value difference is less than or equal to a preset threshold, determining whether the pixel value of the corresponding position in the highlighted image is zero; if the pixel value of the corresponding position in the highlighted image is zero, setting the pixel value of the corresponding position to the average of the grayscale values of the corresponding positions in the two captured images;
[0020] If the pixel value of the corresponding position in the highlighted image is not zero, comparing the pixel value of the corresponding position in the highlighted image with the average grayscale value of the corresponding position in the two captured images;
[0021] If the pixel value in the highlighted image is less than the mean, the pixel value at the corresponding position in the highlighted image is updated to the mean; if the pixel value in the highlighted image is not less than the mean, the pixel value at the corresponding position in the highlighted image is kept unchanged.
[0022] By adopting the above technical solution, similarly, in the present application, when the value of a pixel in the highlight image is zero, it means that the position has not been filled with valid information. At this time, the pixel value is set to the average of the grayscale values of the corresponding positions in the two captured images as a preliminary estimate. When the value of a pixel in the highlight image is not zero, it means that there is certain information. At this time, by comparing the existing pixel value with the average of the newly captured image, it is decided whether to update the pixel value to ensure the accuracy and consistency of the information. If the existing pixel value is less than the average of the newly captured image, it means that the highlight information may not be prominent enough and needs to be adjusted to the average to more accurately reflect the highlight features. In this way, through gradual updates, the highlight information is ensured to be more accurate, and the instability of a single image is avoided. Through simple mean comparison and update operations, complex calculation processing is reduced, and the overall calculation complexity is reduced. At the same time, the gradual update strategy reduces the sensitivity to the external environment (such as vibration) and enhances the stability of the system.
[0023] Optionally, the preset threshold is set to 0 to 20.
[0024] By adopting the above technical solution, the preset threshold of this application is set to 0 to 20, which can balance the relationship between the response speed to image changes and the noise resistance, and optimize according to specific application scenarios. For example, in an environment with more noise, a higher Nerror value is selected to reduce misjudgment. In an environment that requires rapid response to changes, a lower Nerror value is selected to increase sensitivity.
[0025] Optionally, after each movement of the grating device, the imaging camera is automatically triggered to capture an image of the sample, and after obtaining a captured image set, the method further comprises the following steps:
[0026] Acquiring image quality selection information, and acquiring target fringe contrast according to the image quality selection information;
[0027] Calculating the fringe contrast between any two images in the captured image set;
[0028] Comparing the fringe contrast with the target fringe contrast to obtain a contrast difference value;
[0029] The contrast difference value is compared with a preset change threshold value, and if the contrast difference value is outside the preset change threshold value range, a grating distance adjustment instruction is triggered.
[0030] By adopting the above technical solution, the present application first obtains image quality selection information, obtains the target stripe contrast based on the image quality selection information, and then calculates the stripe contrast of any two images in the captured image set, compares the stripe contrast with the target stripe contrast, and obtains a contrast difference value; compares the contrast difference value with a preset change threshold value in a range, and if the contrast difference value is outside the preset change threshold range, triggers a grating distance adjustment instruction; by dynamically adjusting the grating distance, the stripe contrast is further optimized, thereby balancing the overall image quality and overall efficiency.
[0031] Optionally, after each movement of the grating device, the imaging camera is automatically triggered to capture an image of the sample, and after obtaining a captured image set, the method further comprises the following steps:
[0032] obtaining image quality selection information, and obtaining a target signal-to-noise ratio according to the image quality selection information;
[0033] Calculating the signal-to-noise ratio of any two images in the captured image set;
[0034] Comparing the signal-to-noise ratio with the target signal-to-noise ratio to obtain a signal-to-noise ratio difference value;
[0035] The signal-to-noise ratio difference value is compared with a preset change threshold value. If the signal-to-noise ratio difference value is outside the preset change threshold value range, the light source module is triggered to output a light intensity adjustment instruction.
[0036] By adopting the above technical solution, the present application selects information based on image quality, obtains the target signal-to-noise ratio, and calculates the signal-to-noise ratio of any two images in the captured image set; then compares the signal-to-noise ratio with the target signal-to-noise ratio to obtain a signal-to-noise ratio difference value; compares the signal-to-noise ratio difference value with a preset change threshold value for a range; if the signal-to-noise ratio difference value is outside the preset change threshold range, the light source module is triggered to output a light intensity adjustment instruction; by dynamically adjusting the light intensity output by the light source module, the signal-to-noise ratio is further optimized, thereby improving the overall image quality.
[0037] In a second aspect, the present application provides a microscopic imaging device based on grating illumination, comprising:
[0038] A light source module, for emitting light;
[0039] A grating device having light-transmitting areas and light-impermeable areas arranged alternately, for forming stripe-shaped illumination light;
[0040] a filter for filtering the stripe-shaped illumination light;
[0041] an objective lens, used to focus the filtered streak-like illumination light onto the sample;
[0042] a control module, configured to control the movement of the grating device to change the position of the stripe-shaped illumination light on the sample;
[0043] an imaging camera, configured to automatically trigger and capture an image of the sample each time the grating device moves, thereby obtaining a captured image set;
[0044] The processing module is used to perform the following steps:
[0045] Creating a background image and a highlight image of the same size as the captured image based on the captured image set, wherein the initial grayscale values of the background image and the highlight image are zero;
[0046] Calculating the grayscale value difference between corresponding pixels of any two captured images;
[0047] When the grayscale value difference is less than or equal to a preset threshold, updating the corresponding pixel values in the background image and the highlight image; continuing the process until all the captured images are compared;
[0048] Calculating the difference between the highlighted image and the background image to obtain an optimized image;
[0049] A memory, used to store the preset threshold, background image, highlight image and optimized image;
[0050] An output module is used to output the optimized image.
[0051] In a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned grating illumination-based microscopic imaging method when executing the computer program.
[0052] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-mentioned grating illumination-based microscopic imaging method.
[0053] In summary, this application includes at least one of the following beneficial technical effects:
[0054] 1. Traditional structured light imaging technology typically acquires multiple images by changing the phase of the illumination light and processes the image information in the frequency domain through mathematical transformations (such as Fourier transforms) to achieve high-resolution imaging. However, this technology takes a long time to image and has high computational complexity, which can lead to excessive consumption of computing resources, especially when processing large amounts of image data. The present application uses a grating device with alternating light-transmitting and light-opaque areas to form striped illumination light. Each time the grating device moves, the imaging camera is automatically triggered to capture the sample image, and a background image and a highlight image are created and gradually updated. This significantly shortens the imaging time, improves imaging efficiency, and reduces complex computational processing and computational complexity.
[0055] 2. In this application, when the value of a certain pixel in the background image is zero, it means that the position has not been filled with valid information. At this time, the pixel value is set to the mean of the grayscale values of the corresponding positions in the two captured images as a preliminary estimate. When the value of a certain pixel in the background image is not zero, it means that certain information has been obtained. At this time, by comparing the existing pixel value with the mean of the newly captured image, it is decided whether to update the pixel value to ensure the accuracy and consistency of the information. If the existing pixel value is greater than the mean of the newly captured image, it means that the background information may be too prominent and needs to be adjusted to the mean to be closer to the real background. In this way, by gradually updating, the background information is ensured to be more accurate, and the instability of a single image is avoided. By simple mean comparison and update operations, complex calculation processing is reduced, and the overall calculation complexity is reduced. At the same time, the gradual update strategy reduces the sensitivity to the external environment (such as vibration) and enhances the stability of the system.
[0056] 3. This application first obtains image quality selection information, obtains the target stripe contrast based on the image quality selection information, then calculates the stripe contrast of any two images in the captured image set, compares the stripe contrast with the target stripe contrast, and obtains a contrast difference value; compares the contrast difference value with a preset change threshold value for a range, and if the contrast difference value is outside the preset change threshold range, triggers a grating distance adjustment instruction; by dynamically adjusting the grating distance, the stripe contrast is further optimized, thereby balancing the overall image quality and overall efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 This is a schematic flow chart of a microscopic imaging method based on grating illumination according to an embodiment of the present application;
[0058] Figure 2 1 is a schematic structural diagram of a microscopic imaging device in a microscopic imaging method based on grating illumination according to an embodiment of the present application;
[0059] Figure 3 is a schematic diagram of a grid in a microscopic imaging method based on grating illumination according to an embodiment of the present application;
[0060] Figure 4 This is an example diagram of an image captured in a microscopic imaging method based on grating illumination according to an embodiment of the present application;
[0061] Figure 5 This is an example diagram of grayscale values in a microscopic imaging method based on grating illumination according to an embodiment of the present application;
[0062] Figure 6 This is a comparison diagram of an example before and after processing in a microscopic imaging method based on grating illumination according to an embodiment of the present application;
[0063] Figure 7 This is a schematic diagram of a process for updating a background image in a microscopic imaging method based on grating illumination according to an embodiment of the present application;
[0064] Figure 8 This is a schematic diagram of a process for updating a highlight image in a microscopic imaging method based on grating illumination according to an embodiment of the present application;
[0065] Figure 9 This is a flow chart of triggering a grating distance adjustment instruction in a microscopic imaging method based on grating illumination according to an embodiment of the present application;
[0066] Figure 10 This is a flow chart of triggering a light source module to output a light intensity adjustment instruction in a microscopic imaging method based on grating illumination according to an embodiment of the present application;
[0067] Figure 11This is a schematic diagram of a module of a microscopic imaging device based on grating illumination according to an embodiment of the present application;
[0068] Figure 12 This is a diagram of the internal structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0069] The terms used in the following examples of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the specification and appended claims of this application, the singular expressions "a," "an," "said," "above," "the," and "this" are intended to include plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in this application refers to any or all possible combinations comprising one or more of the listed items.
[0070] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to imply or suggest relative importance or implicitly indicate the number of the technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of this application, unless otherwise specified, "plurality" means two or more.
[0071] The embodiments of the present application are described in further detail below with reference to the accompanying drawings.
[0072] In the first aspect, the present application provides a microscopic imaging method based on grating illumination, referring to Figure 1 , comprising the following steps: S110, controlling the light emitted by the light source module to pass through a grating device having alternately arranged light-transmitting areas and light-impermeable areas to form stripe-shaped illumination light.
[0073] In this embodiment, refer to Figure 2 The microscope imaging device includes a light source module, a grating device, a filter, an objective lens and an imaging camera. The light emitted by the light source module passes through the grating device, then enters the objective lens through the filter, and finally irradiates the sample. The light on the sample will pass through the objective lens and filter again, and finally form an image on the imaging camera.
[0074] Among them, reference Figure 3 The grating device is a series of striped grids, in which the white part is the light-transmitting part and the black part is the light-impermeable part. The striped grid will eventually present striped illumination on the sample, that is, there will be striped illumination light on the sample and striped dark stripes next to it.
[0075] S120, using a filter to filter the stripe-shaped illumination light, and focusing the filtered stripe-shaped illumination light on the sample through an objective lens, and controlling the movement of the grating device to change the position of the stripe-shaped illumination light on the sample.
[0076] The light emitted by the light source module is converted into stripe illumination light through the grating device, and the filtered stripe illumination light is focused on the sample through the objective lens.
[0077] In this embodiment, light emitted by the light source module passes through a grating device to form striped illumination light. This light is then filtered through a filter to remove unnecessary wavelength components while retaining light that is useful for imaging. The filtered striped illumination light is focused onto the sample through an objective lens, resulting in a clear striped illumination effect on the sample surface. Furthermore, by controlling the movement of the grating device, the position of the striped illumination light on the sample can be changed to obtain image information at different locations.
[0078] Specifically, the filter selection is customized based on the sample characteristics and the desired imaging wavelength, ensuring that only light of a specific wavelength passes through, thereby reducing background noise and improving image quality. The movement of the grating device can be driven by a precision motor, enabling precise control and ensuring that each movement produces the desired effect. For example, the motor can precisely control the distance the grating device moves, ensuring that new fringe position information is obtained with each movement.
[0079] S130 , after each movement of the grating device, automatically triggering the imaging camera to capture an image of the sample to obtain a captured image set.
[0080] The movement of the grating device creates a series of sample images. Each time the grating device moves, it automatically triggers the imaging camera to capture a single image, resulting in a set of images containing multiple stripe illuminations at different positions.
[0081] Specifically, the imaging camera can be configured as a high-speed camera to ensure rapid image capture after each grating device movement. The system pre-sets the imaging camera's trigger mechanism so that it immediately triggers capture after each grating device movement, ensuring consistent and synchronized image acquisition. For example, an external trigger signal can be used to synchronize the grating device movement and the camera's capture action.
[0082] S140 . Based on the captured image set, create a background image and a highlight image of the same size as the captured image, wherein the initial grayscale value of the background image and the highlight image is zero.
[0083] In this example, a background image and highlight image of the same size as the captured image are created based on the captured image set. Initially, the grayscale values of these images are zero. The background image and highlight image are used to record the background information and highlight features of the sample, respectively. The grayscale values of these images are gradually updated through subsequent processing.
[0084] Specifically, the background image is used to record the information of the sample background area, while the highlight image is used to highlight the highlight features in the sample. In the initial stage, the pixel value of each of these images is set to zero, and these pixel values are gradually updated as the subsequent steps proceed.
[0085] S150 , calculating the grayscale value difference between corresponding pixels of any two captured images, and when the grayscale value difference is less than or equal to a preset threshold, updating the corresponding pixel values in the background image and the highlight image.
[0086] In this embodiment, the grayscale value difference between corresponding pixels in any two captured images is calculated and compared with a preset threshold. If the grayscale value difference is less than or equal to the preset threshold, the corresponding pixel values in the background image and the highlight image are updated. In this way, information about the background image and the highlight image is gradually accumulated and optimized.
[0087] Specifically, the preset threshold can be adjusted based on actual application scenarios to ensure the applicability of the update rule. The preset threshold can be set between 0 and 20. For example, if the preset threshold is set to 20, then when the grayscale value difference between any two images is less than or equal to 20, the two images are considered to have similar information at that location, and the corresponding pixel values in the background image and the highlight image are updated. In this way, the information of the background image and the highlight image can be gradually accumulated and optimized.
[0088] S160 , continue the process until all captured images have been compared.
[0089] In this embodiment, all images in the captured image set are processed continuously until all captured images have been compared. By repeatedly comparing and updating, the information in the background image and the highlight image is gradually improved to ensure the accuracy and reliability of the final result.
[0090] Specifically, each time a new captured image is processed, it is compared with the previous image. A loop is set up to ensure that each new captured image is added to the processing flow until all images are processed. This ensures that the final background image and highlight image contain information from all captured images.
[0091] S170: Calculate the difference between the highlight image and the background image to obtain an optimized image.
[0092] In this embodiment, the difference between the highlight image and the background image is calculated to obtain the final optimized image.
[0093] Specifically, the generation of the optimized image can be achieved by simple difference calculation. For example, for each pixel in the highlight image and the background image, the difference between their grayscale values is calculated, and the result obtained is the corresponding pixel value in the optimized image. In this embodiment, Figures 4 to 6 As shown, Figure 4 The following are 5 sample images of captured images. Different captured images have different light and dark information. Figure 5 In the figure, the curve is the grayscale image of the straight line position in the image. Figure 6 Comparison between the original image before and after processing and the final optimized image. The processed image has improved contrast and resolution.
[0094] In one embodiment, referring to Figure 7 In step S150, when the grayscale value difference is less than or equal to the preset threshold, the corresponding pixel value in the background image is updated, which specifically includes the following steps:
[0095] S710: When the grayscale value difference is less than or equal to a preset threshold, determine whether the pixel value at the corresponding position in the background image is zero.
[0096] Specifically, calculate the grayscale value difference of the corresponding pixels of any two captured images. For example, take two comparison images A and B, and for the pixel position (i, j) in the image, first obtain the grayscale value a of the pixel at that position. ij and b ij Then get the gray value c of the same position (i, j) of the background image C ij , to determine whether it is zero. Since the background image and the captured image have the same size, the same positions can correspond one to one.
[0097] S720: If the pixel value at the corresponding position in the background image is zero, the pixel value at the corresponding position is set to the average grayscale value of the corresponding positions in the two captured images.
[0098] Specifically, if c ij = 0, then the gray value of the pixel is set to the average of the gray values of the same position of A and B, that is, c ij =(a ij +b ij ) / 2.
[0099] S730: If the pixel value at the corresponding position in the background image is not zero, compare the pixel value at the corresponding position in the background image with the average grayscale value of the corresponding positions in the two captured images.
[0100] S740: If the pixel value in the background image is greater than the mean value, update the pixel value at the corresponding position in the background image to the mean value.
[0101] Specifically, if c ij ≠0, compared with c ij The relationship between the value of and the mean gray value of the corresponding position of A and B, if c ij When c is greater than the mean, ij Set to the mean, that is, c ij =(a ij +b ij ) / 2. If the existing pixel value is greater than the mean of the newly captured image, it means that the background information may be too prominent, so it is adjusted to the mean to be closer to the real background.
[0102] S750: If the pixel value in the background image is not less than the mean value, the pixel value at the corresponding position in the highlight image is kept unchanged.
[0103] Similarly, refer to Figure 8 In step S150, when the grayscale value difference is less than or equal to the preset threshold, the corresponding pixel value in the highlighted image is updated, which specifically includes the following steps:
[0104] S810: When the grayscale value difference is less than or equal to the preset threshold, determine whether the pixel value at the corresponding position in the highlighted image is zero.
[0105] S820: If the pixel value at the corresponding position in the highlighted image is zero, the pixel value at the corresponding position is set to the average grayscale value of the corresponding position in the two captured images.
[0106] S830: If the pixel value of the corresponding position in the highlighted image is not zero, compare the pixel value of the corresponding position in the highlighted image with the average grayscale value of the corresponding position in the two captured images.
[0107] S840: If the pixel value in the highlighted image is less than the mean value, update the pixel value at the corresponding position in the highlighted image to the mean value.
[0108] Specifically, get the highlighted image D, if d ij ≠0, compared with this time d ij The relationship between the value of and the mean gray value of the corresponding position of A and B, if d ij When d is less than the mean, ij Set to the mean, that is, at this time d ij =(a ij +b ij ) / 2. If the existing pixel value is less than the mean value of the newly captured image, it means that the highlight information may not be prominent enough, so it is adjusted to the mean value to more accurately reflect the highlight features.
[0109] S850: If the pixel value in the highlighted image is not less than the mean value, the pixel value at the corresponding position in the highlighted image is kept unchanged.
[0110] In one embodiment, referring to Figure 9 After each movement of the grating device, the imaging camera is automatically triggered to capture an image of the sample. After obtaining a set of captured images, the method further includes the following steps:
[0111] S910 , obtaining image quality selection information, and obtaining target stripe contrast according to the image quality selection information.
[0112] In this embodiment, after each movement of the grating device, the imaging camera is automatically triggered to capture an image of the sample. After obtaining a set of captured images, image quality selection information is further obtained. Based on the image quality selection information, the target fringe contrast is obtained for subsequent image quality assessment.
[0113] Specifically, the image quality selection information can be a user-entered target contrast value or a pre-set standard contrast value. For example, the user can set the target contrast to a specific value on the software interface, and the system will adjust the movement distance of the grating device based on this value.
[0114] S920: Calculate the stripe contrast between any two images in the captured image set.
[0115] In this embodiment, after obtaining the target fringe contrast, the fringe contrast of any two images in the captured image set is calculated. By comparing the fringe contrast between different images, the image quality can be evaluated and whether the movement distance of the grating device needs to be adjusted.
[0116] Specifically, the difference between the average grayscale values of bright and dark stripes in an image is calculated. For example, a stripe region in an image is selected and the average grayscale values of the bright and dark stripes are calculated. The difference between the two is the stripe contrast. This method can quantitatively assess the clarity of stripes in an image.
[0117] S930: Compare the stripe contrast with the target stripe contrast to obtain a contrast difference value.
[0118] In this embodiment, after calculating the fringe contrast of any two images in the captured image set, these fringe contrasts are compared with the target fringe contrast to obtain a contrast difference value. The contrast difference value reflects the difference between the actual fringe contrast and the target fringe contrast. If the difference value is large, it means that the fringe contrast of the current image is not ideal and the distance of the grating needs to be adjusted. For example, when observing the microstructure of metal materials, the metal surface has strong reflective characteristics, and a wider fringe spacing is required to reduce reflection interference; when observing biological tissues, the tissue transparency is high, and a narrower fringe spacing may be required to improve the contrast. If the target fringe contrast is 50 and the actual calculated fringe contrast is 30, the contrast difference value is 20. Through this method, the quality difference between the current image and the target image can be clearly determined.
[0119] Specifically, the distance between the grating device and the light source module can be changed to adjust the distance of the grating, thereby changing the distance between each stripe in the formed stripe-shaped illumination light.
[0120] S940 , comparing the contrast difference value with a preset change threshold value. If the contrast difference value is outside the preset change threshold value range, triggering a grating distance adjustment instruction.
[0121] In one embodiment, referring to Figure 10 After each movement of the grating device, the imaging camera is automatically triggered to capture an image of the sample. After obtaining a set of captured images, the method further includes the following steps:
[0122] S1010: Obtain image quality selection information, and obtain a target signal-to-noise ratio based on the image quality selection information.
[0123] In this embodiment, after each movement of the grating device, the imaging camera is automatically triggered to capture an image of the sample, and after obtaining a captured image set, image quality selection information is further obtained.
[0124] Specifically, the image quality selection information can be a user-entered target signal-to-noise ratio value or a pre-set standard signal-to-noise ratio value. For example, the user can set the target signal-to-noise ratio to a specific value on the software interface, and the system will adjust the output light intensity of the light source module based on this value.
[0125] S1020: Calculate the signal-to-noise ratio of any two images in the captured image set.
[0126] S1030: Compare the signal-to-noise ratio with the target signal-to-noise ratio to obtain a signal-to-noise ratio difference value.
[0127] In this embodiment, after calculating the signal-to-noise ratios of any two images in the captured image set, these signal-to-noise ratios are compared with the target signal-to-noise ratio to obtain a signal-to-noise ratio difference value.
[0128] Specifically, the SNR difference value reflects the difference between the actual SNR and the target SNR. If the difference value is large, it means that the SNR of the current image is not ideal and the output light intensity of the light source module needs to be adjusted. For example, if the target SNR is 20 and the actual calculated SNR is 15, the SNR difference value is 5.
[0129] S1040: Compare the signal-to-noise ratio difference value with a preset change threshold value. If the signal-to-noise ratio difference value is outside the preset change threshold range, trigger the light source module to output a light intensity adjustment instruction.
[0130] In this embodiment, the signal-to-noise ratio difference value is compared with a preset change threshold value. If the signal-to-noise ratio difference value exceeds the preset change threshold value, the light source module is triggered to output a light intensity adjustment instruction to improve image quality.
[0131] Specifically, the preset change threshold can be set based on specific application requirements. For example, a change threshold of ±3 can be set, meaning that if the signal-to-noise ratio difference exceeds ±3, the output intensity of the light source module needs to be adjusted. The adjustment instruction can be to increase or decrease the output intensity of the light source module to achieve a better signal-to-noise ratio. This method allows the output intensity of the light source module to be dynamically adjusted, ensuring that the final image has an ideal signal-to-noise ratio.
[0132] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0133] In a second aspect, the present application provides a microscopic imaging device based on grating illumination. The microscopic imaging device based on grating illumination of the present application is described below in combination with the above-mentioned microscopic imaging method based on grating illumination.
[0134] Reference Figure 11 , a microscopic imaging device based on grating illumination, characterized by comprising:
[0135] A light source module, for emitting light;
[0136] A grating device having light-transmitting areas and light-impermeable areas arranged alternately, for forming stripe-shaped illumination light;
[0137] A filter for filtering stripe-shaped illumination light;
[0138] an objective lens, used to focus the filtered streak-like illumination light onto the sample;
[0139] a control module, configured to control the movement of the grating device to change the position of the stripe-shaped illumination light on the sample;
[0140] an imaging camera, configured to automatically trigger and capture an image of the sample after each movement of the grating device, thereby obtaining a captured image set;
[0141] The processing module is used to perform the following steps:
[0142] Create a background image and a highlight image of the same size as the captured image based on the captured image set. The initial grayscale value of the background image and the highlight image is zero.
[0143] Calculate the grayscale value difference between corresponding pixels of any two captured images;
[0144] When the grayscale value difference is less than or equal to the preset threshold, the corresponding pixel values in the background image and the highlight image are updated;
[0145] The process continues until all captured images have been contrast processed;
[0146] Calculate the difference between the highlight image and the background image to obtain the optimized image;
[0147] A memory for storing preset thresholds, background images, highlight images, and optimized images;
[0148] Output module, used to output optimized images.
[0149] In one embodiment, when the grayscale value difference is less than or equal to a preset threshold, the processing module performs the following steps when updating the corresponding pixel value in the background image:
[0150] When the grayscale value difference is less than or equal to the preset threshold, it is determined whether the pixel value at the corresponding position in the background image is zero.
[0151] The preset threshold is set to 0 to 20.
[0152] If the pixel value at the corresponding position in the background image is zero, the pixel value at the corresponding position is set to the average grayscale value of the corresponding position in the two captured images;
[0153] If the pixel value at the corresponding position in the background image is not zero, then compare the pixel value at the corresponding position in the background image with the average grayscale value of the corresponding position in the two captured images;
[0154] If the pixel value in the background image is greater than the mean, the pixel value at the corresponding position in the background image is updated to the mean;
[0155] If the pixel value in the background image is not less than the mean, the pixel value at the corresponding position in the highlight image remains unchanged.
[0156] In one embodiment, when the grayscale value difference is less than or equal to a preset threshold, the processing module performs the following steps when updating the corresponding pixel value in the highlighted image:
[0157] When the grayscale value difference is less than or equal to the preset threshold, determine whether the pixel value at the corresponding position in the highlighted image is zero;
[0158] If the pixel value of the corresponding position in the highlighted image is zero, the pixel value of the corresponding position is set to the average grayscale value of the corresponding position in the two captured images;
[0159] If the pixel value of the corresponding position in the highlighted image is not zero, then compare the pixel value of the corresponding position in the highlighted image with the average grayscale value of the corresponding position in the two captured images;
[0160] If the pixel value in the highlighted image is less than the mean, the pixel value at the corresponding position in the highlighted image is updated to the mean;
[0161] If the pixel value in the highlighted image is not less than the mean, the pixel value at the corresponding position in the highlighted image remains unchanged.
[0162] In one embodiment, after each movement of the grating device, the imaging camera is automatically triggered to capture an image of the sample. After obtaining a set of captured images, the processing module performs the following steps:
[0163] obtaining image quality selection information, and obtaining target fringe contrast according to the image quality selection information;
[0164] Calculate the fringe contrast between any two images in the captured image set;
[0165] Compare the stripe contrast with the target stripe contrast to obtain the contrast difference value;
[0166] The contrast difference value is compared with a preset change threshold value. If the contrast difference value is outside the preset change threshold range, a grating distance adjustment instruction is triggered.
[0167] In one embodiment, after each movement of the grating device, the imaging camera is automatically triggered to capture an image of the sample. After obtaining a set of captured images, the processing module performs the following steps:
[0168] obtaining image quality selection information, and obtaining a target signal-to-noise ratio according to the image quality selection information;
[0169] Calculate the signal-to-noise ratio of any two images in the captured image set;
[0170] Compare the signal-to-noise ratio with the target signal-to-noise ratio to obtain the signal-to-noise ratio difference value;
[0171] The signal-to-noise ratio difference value is compared with a preset change threshold value. If the signal-to-noise ratio difference value is outside the preset change threshold range, the light source module is triggered to output a light intensity adjustment instruction.
[0172] In one embodiment, the present application provides an electronic device, which may be a server, and its internal structure diagram may be as follows: Figure 12 As shown. The electronic device includes a processor, a memory and a network interface connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the electronic device is used to store data. The network interface of the electronic device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a microscopic imaging method based on grating illumination is implemented.
[0173] Those skilled in the art will understand that Figure 12 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the electronic device to which the solution of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0174] In one embodiment, an electronic device is further provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.
[0175] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the above-mentioned computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0176] The above are all preferred embodiments of the present application, and are not intended to limit the scope of protection of the present application. Therefore, any equivalent changes made based on the structure, shape, and principle of the present application should be included in the scope of protection of the present application.
Claims
1. A microscopic imaging method based on grating illumination, characterized in that: The steps include: Controlling the light emitted by the light source module to pass through a grating device having alternately arranged light-transmitting areas and light-impermeable areas to form stripe-shaped illumination light; Using a filter to filter the stripe-shaped illumination light, focusing the filtered stripe-shaped illumination light on the sample through an objective lens, and controlling the movement of the grating device to change the position of the stripe-shaped illumination light on the sample; After each movement of the grating device, automatically triggering an imaging camera to capture an image of the sample to obtain a captured image set; Based on the captured image set, creating a background image and a highlight image of the same size as the captured image, wherein the initial grayscale value of the background image and the highlight image is zero; Calculating the grayscale value difference between corresponding pixels of any two captured images, and when the grayscale value difference is less than or equal to a preset threshold, updating the corresponding pixel values in the background image and the highlight image; continuing the process until all of the captured images have been compared; The difference between the highlighted image and the background image is calculated to obtain an optimized image.
2. The microscopic imaging method based on grating illumination according to claim 1, characterized in that: When the grayscale value difference is less than or equal to a preset threshold, updating the corresponding pixel value in the background image specifically includes the following steps: When the grayscale value difference is less than or equal to a preset threshold, determining whether the pixel value at the corresponding position in the background image is zero; If the pixel value at the corresponding position in the background image is zero, the pixel value at the corresponding position is set to the average of the grayscale values at the corresponding positions in the two captured images; If the pixel value at the corresponding position in the background image is not zero, comparing the pixel value at the corresponding position in the background image with the average grayscale value of the corresponding positions in the two captured images; If the pixel value in the background image is greater than the mean, the pixel value at the corresponding position in the background image is updated to the mean; If the pixel value in the background image is not less than the mean value, the pixel value at the corresponding position in the highlight image is kept unchanged.
3. The microscopic imaging method based on grating illumination according to claim 2, characterized in that: When the grayscale value difference is less than or equal to a preset threshold, updating the corresponding pixel value in the highlighted image specifically includes the following steps: When the grayscale value difference is less than or equal to a preset threshold, determining whether the pixel value at the corresponding position in the highlighted image is zero; If the pixel value at the corresponding position in the highlighted image is zero, the pixel value at the corresponding position is set to the average of the grayscale values at the corresponding positions in the two captured images; If the pixel value of the corresponding position in the highlighted image is not zero, comparing the pixel value of the corresponding position in the highlighted image with the average grayscale value of the corresponding positions in the two captured images; If the pixel value in the highlighted image is less than the mean, the pixel value at the corresponding position in the highlighted image is updated to the mean; If the pixel value in the highlighted image is not less than the mean value, the pixel value at the corresponding position in the highlighted image is kept unchanged.
4. The microscopic imaging method based on grating illumination according to claim 1, characterized in that: The preset threshold is set to 0 to 20.
5. The microscopic imaging method based on grating illumination according to claim 1, characterized in that: After each movement of the grating device, the imaging camera is automatically triggered to capture an image of the sample, and after obtaining a captured image set, the method further comprises the following steps: Acquiring image quality selection information, and acquiring target fringe contrast according to the image quality selection information; Calculating the fringe contrast between any two images in the captured image set; Comparing the fringe contrast with the target fringe contrast to obtain a contrast difference value; The contrast difference value is compared with a preset change threshold value, and if the contrast difference value is outside the preset change threshold value range, a grating distance adjustment instruction is triggered.
6. The microscopic imaging method based on grating illumination according to claim 1, characterized in that: After each movement of the grating device, the imaging camera is automatically triggered to capture an image of the sample, and after obtaining a captured image set, the method further comprises the following steps: obtaining image quality selection information, and obtaining a target signal-to-noise ratio according to the image quality selection information; Calculating the signal-to-noise ratio of any two images in the captured image set; Comparing the signal-to-noise ratio with the target signal-to-noise ratio to obtain a signal-to-noise ratio difference value; The signal-to-noise ratio difference value is compared with a preset change threshold value. If the signal-to-noise ratio difference value is outside the preset change threshold value range, the light source module is triggered to output a light intensity adjustment instruction.
7. A microscopic imaging device based on grating illumination, characterized in that: include: A light source module, for emitting light; A grating device having light-transmitting areas and light-impermeable areas arranged alternately, for forming stripe-shaped illumination light; a filter for filtering the stripe-shaped illumination light; an objective lens, used to focus the filtered streak-like illumination light onto the sample; a control module, configured to control the movement of the grating device to change the position of the stripe-shaped illumination light on the sample; an imaging camera, configured to automatically trigger and capture an image of the sample each time the grating device moves, thereby obtaining a captured image set; The processing module is used to perform the following steps: Creating a background image and a highlight image of the same size as the captured image based on the captured image set, wherein the initial grayscale values of the background image and the highlight image are zero; Calculating the grayscale value difference between corresponding pixels of any two captured images; When the grayscale value difference is less than or equal to a preset threshold, updating the corresponding pixel values in the background image and the highlight image; continuing the process until all of the captured images have been compared; Calculating the difference between the highlighted image and the background image to obtain an optimized image; A memory, used to store the preset threshold, background image, highlight image and optimized image; An output module is used to output the optimized image.
8. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the microscopic imaging method based on grating illumination according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the microscopic imaging method based on grating illumination according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
High-speed structure illumination optical microscope system and method based on digital micromirror device
CN102540446A
Phase microimaging device and method based on structured light illumination
CN110058393A