Microscopic imaging method, device and equipment based on grating illumination and medium
By using alternately arranged grating devices to form stripe-like illumination light and automatically capture images, creating and updating background images and highlighting images, the complex computational processing problems of existing structured light imaging technology is solved, and an efficient imaging process is achieved.
Patent Information
- Application Number
- CN202411445703.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-10-16
AI Technical Summary
The existing structured light imaging technology has complex calculation processing, long imaging time and high computational complexity, especially when processing large amounts of image data, it is easy to cause excessive consumption of computing resources.
The grating device with alternately arranged light-transmitting and opaque areas is used to form stripe-like illumination light, and the image forming camera is automatically triggered to capture images through the movement of the grating device, create and update background images and highlight images, and reduce calculation processing.
It greatly shortens the imaging time, improves the imaging efficiency, reduces complex computing processing, reduces the computational complexity, and enhances the stability of the system.
Smart Images

Figure CN119414585A_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 biomedicine, materials science and other fields. By utilizing structured illumination patterns, structured light imaging can improve imaging quality without sacrificing resolution, meeting the high-precision requirements of scientific research.
[0003] Traditional structured light imaging technology uses multiple shots of stripe patterns at different phases to supplement the information in the frequency domain, thereby converting high-frequency frequency domain images into high-resolution time domain images. This process usually requires multiple shots and complex calculations, which needs to be further improved. Summary of the invention
[0004] In order to solve the problem that the existing structured light imaging technology has relatively complex computational processing, the present application provides a microscopic imaging method, device, equipment and medium based on grating illumination, which adopts the following technical solutions: In a first aspect, the present application provides a microscopic imaging method based on grating illumination, comprising the following steps: Control the light emitted by the light source module to pass through a grating device having light-transmitting areas and light-impermeable areas arranged alternately, so as 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, the imaging camera is automatically triggered to capture the 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, and the initial grayscale values of the background image and the highlight image are zero; Calculate 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, update 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 highlight image and the background image is calculated to obtain an optimized image.
[0005] By adopting the above-mentioned technical scheme, 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 transformation (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 the imaging efficiency, reduces complex computational processing, and reduces computational complexity.
[0006] Optionally, when the gray 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 gray 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 gray value of the corresponding position 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 position 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, the pixel value at the corresponding position in the highlight image is kept unchanged.
[0007] By adopting the above technical solution, in the present application, when a pixel value 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 a pixel value 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.
[0008] Optionally, when the gray 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 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 grayscale value of the corresponding position 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 position 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, the pixel value at the corresponding position in the highlighted image is kept unchanged.
[0009] By adopting the above technical solution, similarly, in the present application, when a pixel value 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 a pixel value in the highlight image is not zero, it means that certain information has been obtained. 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, by gradually updating, the highlight information is ensured to be more accurate, the instability of a single image is avoided, and the complex calculation processing is reduced through simple mean comparison and update operations, thereby reducing the overall calculation complexity. 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.
[0010] Optionally, the preset threshold is set to 0 to 20.
[0011] By adopting the above technical solution, the preset threshold of the present 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.
[0012] 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: Acquire image quality selection information, and acquire 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.
[0013] By adopting the above technical solution, the present application first obtains image quality selection information, obtains the target stripe contrast according to 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, and if the contrast difference value is outside the preset change threshold range, triggers a grating distance adjustment instruction; and by dynamically adjusting the grating distance, further optimizes the stripe contrast, thereby balancing the overall image quality and overall efficiency.
[0014] 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: Acquire image quality selection information, and acquire 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, and 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.
[0015] By adopting the above technical solution, the present application selects information according to 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 the signal-to-noise ratio is compared 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 in 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.
[0016] In a second aspect, the present application provides a microscopic imaging device based on grating illumination, comprising: 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, used for filtering the stripe-shaped illumination light; An objective lens, used to focus the filtered streak-shaped illumination light onto the sample; A control module, used for controlling the movement of the grating device to change the position of the stripe-shaped illumination light on the sample; An imaging camera, used for automatically triggering and capturing an image of the sample each time the grating device moves, to obtain a captured image set; A 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 gray 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; Calculate the difference between the highlight 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.
[0017] 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.
[0018] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the above-mentioned microscopic imaging method based on grating illumination are implemented.
[0019] In summary, the present application includes at least one of the following beneficial technical effects: 1. 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 transformation (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 by using a grating device with alternating 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 and gradually updates the background image and the highlight image, which greatly shortens the imaging time, improves the imaging efficiency, reduces complex computational processing, and reduces computational complexity. 2. In this application, when a pixel value 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 a pixel value in the background image is not zero, it means that there is already certain information. 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. 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. 3. 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; performs a range comparison between the contrast difference value and a preset change threshold, and if the contrast difference value is outside the preset change threshold range, triggers a grating distance adjustment instruction; and further optimizes the stripe contrast by dynamically adjusting the grating distance, thereby balancing the overall image quality and overall efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 It is a schematic diagram of a process of a microscopic imaging method based on grating illumination according to an embodiment of the present application; Figure 2 is a structural schematic diagram of a microscopic imaging device in a microscopic imaging method based on grating illumination according to an embodiment of the present application; 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; 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; 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; Figure 6 This is a comparison example diagram before and after processing in a microscopic imaging method based on grating illumination in an embodiment of the present application; Figure 7 It is a schematic diagram of a process of updating a background image in a microscopic imaging method based on grating illumination according to an embodiment of the present application; Figure 8It is a schematic diagram of a process of updating a highlight image in a microscopic imaging method based on grating illumination according to an embodiment of the present application; Fig. 9 It is a schematic diagram of 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; Fig.10 It 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; Fig.11 It is a module schematic diagram of a microscopic imaging device based on grating illumination according to an embodiment of the present application; Fig.12 It is a diagram of the internal structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0021] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification and appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to any or all possible combinations comprising one or more listed items.
[0022] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0023] The embodiments of the present application are further described in detail below in conjunction with the drawings in the specification.
[0024] In a 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 light-transmitting areas and light-impermeable areas arranged alternately to form stripe-shaped illumination light.
[0025] 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 the filter again, and finally be imaged on the imaging camera.
[0026] Among them, refer to 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.
[0027] 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.
[0028] 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.
[0029] In this embodiment, the light emitted by the light source module passes through the grating device to form a stripe-shaped illumination light, which is then filtered through a filter to remove unnecessary wavelength components and retain light useful for imaging. The filtered stripe-shaped illumination light is focused on the sample through the objective lens, so that the surface of the sample presents a clear stripe illumination effect. At the same time, by controlling the movement of the grating device, the position of the stripe-shaped illumination light on the sample can be changed to obtain image information at different positions.
[0030] Specifically, the selection of filters is customized according to the sample characteristics and the required imaging wavelength to ensure that only light of a specific wavelength can pass through, thereby reducing background noise and improving imaging quality. The movement of the grating device can be driven by a precision motor to achieve precise control, ensuring that each movement produces the desired effect. For example, the motor can accurately control the distance the grating device moves, ensuring that new fringe position information can be obtained with each movement.
[0031] 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.
[0032] Among them, by moving the grating device, a series of sample images of the grating device movement can be obtained on the sample. Each time the grating device moves, it will automatically trigger the imaging camera to capture once, thereby obtaining a set of images containing multiple stripe illuminations at different positions.
[0033] Specifically, the imaging camera can be configured as a high-speed camera to ensure that the image can be captured quickly after each movement of the grating device. The system pre-sets the trigger mechanism of the imaging camera so that it triggers the shooting immediately after each movement of the grating device is completed, ensuring the consistency and synchronization of image acquisition. For example, the movement of the grating device and the shooting action of the camera can be synchronously controlled by an external trigger signal.
[0034] 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.
[0035] In this embodiment, a background image and a highlight image of the same size as the captured image are created based on the captured image set, and the grayscale values of these images are all zero in the initial state. The background image and the highlight image are used to record the background information and highlight features of the sample, respectively, and the grayscale values of these images are gradually updated through subsequent processing.
[0036] Specifically, the background image is used to record the information of the background area of the sample, while the highlight image is used to highlight the highlight features in the sample. In the initial stage, each pixel value of these images is set to zero, and these pixel values are gradually updated as the subsequent steps proceed.
[0037] S150, calculating the gray value difference between corresponding pixel points of any two captured images, and when the gray value difference is less than or equal to a preset threshold, updating the corresponding pixel values in the background image and the highlight image.
[0038] In this embodiment, the gray value difference of corresponding pixels in any two captured images is calculated and compared with a preset threshold. If the gray 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, the information of the background image and the highlight image is gradually accumulated and optimized.
[0039] Specifically, the preset threshold can be adjusted according to the actual application situation to ensure the applicability of the update rule. The preset threshold can be set to 0 to 20. For example, if the preset threshold is set to 20, then when the gray value difference between any two images is less than or equal to 20, the two images are considered to have similar information at that position, 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.
[0040] S160 , continue the process until all captured images are compared.
[0041] In this embodiment, all images in the captured image set are processed continuously until all captured images are compared and processed. Through repeated comparison 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.
[0042] Specifically, each time a new captured image is processed and compared with the previous image, a loop mechanism is set up to ensure that each new captured image is added to the processing flow until all images are processed. Ensure that the final generated background image and highlight image contain the information of all captured images.
[0043] S170, calculating the difference between the highlight image and the background image to obtain an optimized image.
[0044] In this embodiment, the difference between the highlight image and the background image is calculated to obtain the final optimized image.
[0045] 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. Figures 4 to 6 As shown, Figure 4 The following are five sample images of captured images. Different captured images have different brightness and darkness 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.
[0046] In one embodiment, referring to Figure 7 In step S150, when the gray 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: S710: When the gray 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.
[0047] Specifically, the grayscale value difference of the corresponding pixel points of any two captured images is calculated. For example, two comparison images A and B are obtained. For the pixel position (i, j) in the image, the grayscale value a of the pixel at the position is first obtained. ij and b ij Then get the gray value c of the same position (i, j) of the background image C ij , 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.
[0048] 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 position in the two captured images.
[0049] Specifically, if c ij = 0, 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.
[0050] 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 at the corresponding position in the two captured images.
[0051] S740: If the pixel value in the background image is greater than the mean value, the pixel value at the corresponding position in the background image is updated to the mean value.
[0052] Specifically, if c ij ≠0, compared with c ij The relationship between the value of and the mean grayscale value of the corresponding position of A and B, if c ij When c is greater than the mean, ij Set to the mean value, that is, at this time c ij =(a ij +b ij ) / 2. Since 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, it is adjusted to the mean to be closer to the real background.
[0053] 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.
[0054] Similarly, refer to Figure 8 In step S150, when the gray 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: S810: When the gray value difference is less than or equal to a preset threshold, determine whether the pixel value at the corresponding position in the highlighted image is zero.
[0055] 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.
[0056] S830: If the pixel value at the corresponding position in the highlight image is not zero, compare the pixel value at the corresponding position in the highlight image with the average grayscale value of the corresponding position in the two captured images.
[0057] S840: If the pixel value in the highlighted image is less than the mean value, the pixel value at the corresponding position in the highlighted image is updated to the mean value.
[0058] 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 grayscale 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.
[0059] S850: If the pixel value in the highlight image is not less than the mean value, the pixel value at the corresponding position in the highlight image is kept unchanged.
[0060] In one embodiment, referring to Fig. 9 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 includes the following steps: S910, obtaining image quality selection information, and obtaining target stripe contrast according to the image quality selection information.
[0061] In this embodiment, after each movement of the grating device, the imaging camera is automatically triggered to capture the image of the sample, and after obtaining the captured image set, image quality selection information is further obtained. According to the image quality selection information, the target fringe contrast is obtained for subsequent image quality evaluation.
[0062] Specifically, the image quality selection information may be a target contrast value input by the user, or a pre-set standard contrast value. For example, the user may set the target contrast to a specific value on the software interface, and the system will adjust the moving distance of the grating device according to the value.
[0063] S920, calculating the stripe contrast between any two images in the captured image set.
[0064] 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 it can be determined whether the moving distance of the grating device needs to be adjusted.
[0065] Specifically, by calculating the difference in the average grayscale value of the bright stripes and the dark stripes in the image. For example, a stripe area in the image is selected, and the average grayscale value of the bright stripes and the average grayscale value of the dark stripes are calculated. The difference between the two is the stripe contrast. In this way, the stripe clarity in the image can be quantitatively evaluated.
[0066] S930: Compare the stripe contrast with the target stripe contrast to obtain a contrast difference value.
[0067] In this embodiment, after calculating the stripe contrast of any two images in the captured image set, these stripe contrasts are compared with the target stripe contrast to obtain a contrast difference value. The contrast difference value reflects the difference between the actual stripe contrast and the target stripe contrast. If the difference value is large, it means that the stripe 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 stripe spacing is required to reduce reflection interference; when observing biological tissues, the tissue transparency is high, and a narrower stripe spacing may be required to increase the contrast. If the target stripe contrast is 50, and the actual calculated stripe contrast is 30, the contrast difference value is 20. In this way, the quality gap between the current image and the target image can be clearly defined.
[0068] 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.
[0069] S940, performing a range comparison between the contrast difference value and a preset change threshold value, and if the contrast difference value is outside the preset change threshold range, triggering a grating distance adjustment instruction.
[0070] In one embodiment, referring to Fig.10 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 includes the following steps: S1010: Obtain image quality selection information, and obtain a target signal-to-noise ratio according to the image quality selection information.
[0071] 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.
[0072] Specifically, the image quality selection information may be a target signal-to-noise ratio value input by the user, or a pre-set standard signal-to-noise ratio value. For example, the user may 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 according to this value.
[0073] S1020: Calculate the signal-to-noise ratio of any two images in the captured image set.
[0074] S1030: Compare the signal-to-noise ratio with the target signal-to-noise ratio to obtain a signal-to-noise ratio difference value.
[0075] 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.
[0076] 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.
[0077] S1040, comparing the signal-to-noise ratio difference value with a preset change threshold value, and if the signal-to-noise ratio difference value is outside the preset change threshold range, triggering the light source module to output a light intensity adjustment instruction.
[0078] 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 range, the light source module is triggered to output a light intensity adjustment instruction to improve image quality.
[0079] Specifically, the preset change threshold can be set according to specific application requirements. For example, the change threshold can be set to ±3, which means that if the signal-to-noise ratio difference value exceeds ±3, the output light intensity of the light source module needs to be adjusted. The adjustment instruction can be to increase or decrease the output light intensity of the light source module to achieve a better signal-to-noise ratio. In this way, the output light intensity of the light source module can be dynamically adjusted to ensure that the final generated image has an ideal signal-to-noise ratio.
[0080] 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 the present application.
[0081] 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.
[0082] Reference Fig.11 , a microscopic imaging device based on grating illumination, characterized in that it comprises: 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-shaped illumination light onto the sample; A control module, used for controlling the movement of the grating device to change the position of the stripe-shaped illumination light on the sample; An imaging camera, used for automatically triggering and capturing an image of the sample after each movement of the grating device, to obtain a captured image set; A processing module is used to perform the following steps: Based on the captured image set, create a background image and a highlight image with the same size as the captured image, and the initial grayscale value of the background image and the highlight image is zero; Calculate the gray value difference between corresponding pixels of any two captured images; 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; The process continues until all captured images have been contrast processed; Calculate the difference between the highlight image and the background image to get the optimized image; A memory, used to store preset thresholds, background images, highlight images, and optimized images; Output module, used to output optimized images.
[0083] In one embodiment, when the gray value difference is less than or equal to a preset threshold, when updating the corresponding pixel value in the background image, the processing module performs the following steps: 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.
[0084] Among them, the preset threshold is set to 0 to 20.
[0085] 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; 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; 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.
[0086] In one embodiment, when the gray value difference is less than or equal to a preset threshold, when updating the corresponding pixel value in the highlighted image, the processing module performs the following steps: 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; 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; 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; 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 remains unchanged.
[0087] In one 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 set of captured images, the processing module performs the following steps: Acquire image quality selection information, and acquire target fringe contrast according to the image quality selection information; Calculate the fringe contrast between any two images in the captured image set; The stripe contrast is compared with the target stripe contrast to obtain a contrast difference value; 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.
[0088] In one 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 set of captured images, the processing module performs the following steps: Acquire image quality selection information, and acquire a target signal-to-noise ratio according to the image quality selection information; Calculate the signal-to-noise ratio of any two images in the captured image set; Compare 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 range, the light source module is triggered to output a light intensity adjustment instruction.
[0089] In one embodiment, the present application provides an electronic device, which may be a server, and its internal structure diagram may be as follows: Fig.12 As shown. The electronic device includes a processor, a memory and a network interface connected through a system bus. Among them, 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 through a network connection. When the computer program is executed by the processor, a microscopic imaging method based on grating illumination is implemented.
[0090] Those skilled in the art will understand that Fig.12The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme 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 arrangement of components.
[0091] In one embodiment, an electronic device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0092] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed 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 can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can 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).
[0093] The above are all preferred embodiments of the present application, and the protection scope of the present application is not limited thereto. Therefore, any equivalent changes made according to the structure, shape, and principle of the present application should be included in the protection scope of the present application.
Claims
1. A microscopic imaging method based on grating illumination, characterized in that: The steps include: Control the light emitted by the light source module to pass through a grating device having light-transmitting areas and light-impermeable areas arranged alternately, so as 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, 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, 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; Calculate 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, update 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 highlight 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 gray 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 gray 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 grayscale value of the corresponding position 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 position in the two captured images; If the pixel value in the background image is greater than the mean value, the pixel value at the corresponding position in the background image is updated to the mean value; 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 gray 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 gray 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 grayscale value of the corresponding position 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 position in the two captured images; If the pixel value in the highlighted image is less than the mean value, the pixel value at the corresponding position in the highlighted image is updated to the mean value; 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 be 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 the image of the sample, and after obtaining a captured image set, the method further comprises the following steps: Acquire image quality selection information, and acquire 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 the image of the sample, and after obtaining a captured image set, the method further comprises the following steps: Acquire image quality selection information, and acquire 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, and 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.
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, used for filtering the stripe-shaped illumination light; An objective lens, used to focus the filtered streak-shaped illumination light onto the sample; A control module, used for controlling the movement of the grating device to change the position of the stripe-shaped illumination light on the sample; An imaging camera, used for automatically triggering and capturing an image of the sample each time the grating device moves, to obtain a captured image set; A 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 gray value difference is less than or equal to a preset threshold, updating corresponding pixel values in the background image and the highlight image; continuing the process until all of the captured images have been compared; Calculate the difference between the highlight 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 method 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 described in 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 described in 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
Method and system for rapidly three-dimensionally microimaging large sample
CN102928970A
Super-resolution microscopy imaging method and system for continuously adjustable structured light illumination
CN105814402A
Phase microimaging device and method based on structured light illumination
CN110058393A
Dual-modality microscopic imaging system and method
WO2021143707A1