A method and device for automatically determining the focus position of a fluorescent dark-field camera
By performing grayscale processing and wavelet transformation calculation on immunofluorescence images of different focus positions of the slide, the MSE value is calculated to determine the focus position, and the problems of slow speed of obtaining clear immunofluorescence images and inaccurate focus positions in the prior art are solved. Automatic focus and efficient focus are achieved.
Patent Information
- Application Number
- CN202210773283.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-01
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2042-07-01
AI Technical Summary
In the prior art, the acquisition of clear immunofluorescent images is slow and inefficient, and the focus position of the fluorescent dark field camera is inaccurate.
By obtaining immunofluorescence images of different focus positions of the slide, performing grayscale processing and wavelet transformation calculations, forming a first and second information sets, and calculating the MSE values to determine the focus position.
Automatic focus adjustment is achieved, with fast focus speed and high efficiency, ensuring the accuracy of the focus position of the fluorescent dark field camera.
Smart Images

Figure CN115308129B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of fluorescent dark field detection, and in particular to a method and a device for automatically determining a focus position of a fluorescent dark field camera. Background Art
[0002] Immunofluorescence staining images are generally formed by a fluorescent dark-field camera collecting fluorescence in a specific band, so as to find the location and number of lesion cells or lesion bacteria.
[0003] The process of obtaining immunofluorescence staining images by the traditional fluorescent dark field detection device is as follows: manually adjust the distance between the microscope objective lens and the glass slide (i.e., the focus position of the fluorescent dark field camera), and when clear lesion cells or lesion bacteria are observed, stop adjusting the distance between the microscope objective lens and the glass slide, and the fluorescent dark field camera takes pictures of the clear lesion cells or lesion bacteria observed by the microscope to obtain an immunofluorescence image. In the above-mentioned traditional process of obtaining immunofluorescence images, it is necessary to manually adjust the distance between the microscope objective lens and the glass slide (i.e., manually adjust the focus position of the fluorescent dark field camera), which has a slow adjustment speed, low efficiency, and does not utilize automated operations. Summary of the invention
[0004] Therefore, the technical problem to be solved by the present invention is to overcome the problem of slow speed and low efficiency in obtaining clear immunofluorescence images in the prior art, thereby providing a method and device for automatically determining the focusing position of a fluorescent dark-field camera.
[0005] One aspect of the present invention provides a method for automatically determining the focus position of a fluorescent dark field camera, comprising the following steps:
[0006] Obtain immunofluorescence images at different focus positions on the slide;
[0007] Grayscale processing is performed on the immunofluorescence image, and then horizontal information, vertical information and diagonal information of the fluorescence image are calculated using a two-dimensional first-order wavelet transform to form a first information set of the immunofluorescence image;
[0008] The immunofluorescence image is subjected to blur processing and grayscale processing, and the horizontal information, vertical information and diagonal information of the fluorescence image are calculated using the Haar wavelet to form a second information set of the immunofluorescence image;
[0009] The MSE value of the immunofluorescence image is calculated based on the first information set and the second information set, and the MSE value is used as the clarity value of the fluorescence image. The focus plane position or the focus position is determined according to the clarity value of the immunofluorescence image.
[0010] Preferably, the two-dimensional first-order wavelet change is one of Daubechies wavelet and Haar wavelet.
[0011] Preferably, the blurring process uses Gaussian blurring process or Laplace blurring process.
[0012] Furthermore, the MSE value is calculated using the following formula:
[0013]
[0014] Among them, y i Represents the values in v1, h1, c1, represents the value in v2, h2, c2, w i is equal to 1, SSE is the total difference; n is the number of pixels in the immunofluorescence image.
[0015] Another technical problem to be solved by the present invention is to overcome the defect of inaccurate focus position of the fluorescent dark field camera in the prior art, thereby providing a device for automatically determining the focus position of the fluorescent dark field camera, comprising:
[0016] An acquisition module is used to obtain immunofluorescence images at different focus positions on the slide;
[0017] The first information set acquisition module performs grayscale processing on the immunofluorescence image, and then calculates the first horizontal information, the first vertical information and the first diagonal information of the fluorescence image by using a two-dimensional first-order wavelet transform to form a first information set of the immunofluorescence image;
[0018] A second information set acquisition module performs fuzzy processing and grayscale processing on the immunofluorescence image, and then uses Haar wavelet to calculate the second horizontal information, second vertical information and second diagonal information of the immunofluorescence image to form a second information set of the immunofluorescence image;
[0019] The immunofluorescence image clarity value calculation module is configured to calculate the MSE value of the immunofluorescence image based on the first information set and the second information set, the MSE value is used as the clarity value of the immunofluorescence image, and the focus position is determined according to the clarity value.
[0020] Another aspect of the present invention 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 above-mentioned method for automatically determining the focusing position of an immunofluorescence dark-field camera when executing the computer program.
[0021] According to another aspect of the present invention, a non-transitory computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for automatically determining the focus position of a fluorescent dark-field camera is implemented.
[0022] The technical solution of the present invention has the following advantages:
[0023] 1. The method for automatically determining the focus position of an immunofluorescence dark-field camera provided by the present invention calculates a first information set after grayscale processing of an immunofluorescence image, calculates a second information set after blurring and grayscale processing of the immunofluorescence image, calculates the MSE value of the immunofluorescence image through the first information set and the second information set, and determines whether the focus position of the fluorescent dark-field camera is in the optimal position based on the size of the MSE value. The method has fast focusing speed, high efficiency, and is easy to operate automatically.
[0024] 2. The method for automatically determining the focus position of an immunofluorescence dark-field camera provided by the present invention can be implemented by using a variety of two-dimensional first-order wavelet transforms, preferably Daubechies wavelet or Haar wavelet. The above two algorithms are simple and can effectively reduce the hardware burden.
[0025] 3. The method for automatically determining the focus position of an immunofluorescence dark-field camera provided by the present invention can be implemented by using a variety of blur processing, preferably Gaussian blur processing or Laplace blur processing. The above two processing methods can effectively reduce the hardware burden.
[0026] 4. The method for automatically determining the focus position of an immunofluorescence dark-field camera provided by the present invention has a simple MSE value algorithm, which can effectively reduce the hardware burden and improve efficiency.
[0027] 5. The device for automatically determining the focusing position of an immunofluorescence dark-field camera provided by the present invention obtains an immunofluorescence image through an acquisition module, calculates a first information set after grayscale processing of the immunofluorescence image through a first information set acquisition module, calculates a second information set after blurring and grayscale processing of the immunofluorescence image through a second information set acquisition module, calculates an MSE value of the immunofluorescence image through the first information set and the second information set, and judges the focusing position of the fluorescent dark-field camera by the size of the MSE value. The focusing speed is fast, the efficiency is high, and the automatic operation is convenient. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0029] Figure 1 This is a flow chart of the method for automatically determining the focus position of a fluorescent dark-field camera in Embodiment 1 of the present invention;
[0030] Figure 2 A schematic diagram of a focusing path for obtaining an immunofluorescence staining image in Example 1 of the present invention;
[0031] Figure 3 This is the first immunofluorescence staining picture obtained in Example 1;
[0032] Figure 4 Schematic diagram of the immunofluorescence staining image processed by Haar wavelet in Example 1;
[0033] Figure 5 These are the 9 pictures processed in Example 1;
[0034] Figure 6 The device for automatically determining the focus position of the fluorescent dark field camera in Example 3;
[0035] Figure 7 This is a principle block diagram of an electronic device in Embodiment 5 of the present invention.
[0036] Reference numerals:
[0037] 1-cover glass; 2-bubble; 3-saline; 4-target sample; 5-slide. DETAILED DESCRIPTION
[0038] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0039] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0040] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, it can also be the internal connection of two components, it can be a wireless connection, or it can be a wired connection. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0041] In addition, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0042] Example 1
[0043] This embodiment provides a method for automatically determining the focus position of a fluorescent dark field camera. Figure 1 As shown, the following steps are included:
[0044] Step 101, obtaining immunofluorescence images at different focus positions on the slide, such as Figure 2 As shown, a fluorescent dark field camera (e.g., a CCD camera) collects immunofluorescence images at different focus positions of the slide from top to bottom, and the focus path adopts a step-by-step method. For ease of understanding, this embodiment assumes that a total of 9 images are collected from top to bottom. Since the focus path is a step-by-step method, each image has a corresponding z-axis distance.
[0045] The clarity of the 9 images is evaluated. The clarity evaluation starts with the 9 images in the order of acquisition from top to bottom. The clarity evaluation process for each image is as follows:
[0046] Step 102: firstly analyze the first immunofluorescence image (such as Figure 3 The grayscale is processed, and then the horizontal information h1, vertical information v1 and diagonal information c1 of the fluorescence image are calculated by using a two-dimensional first-order wavelet change (the present embodiment uses the Haar wavelet) to form a first information set of the immunofluorescence image;
[0047] Step 103, blur the first immunofluorescence image (Gaussian blur is used in this embodiment) to obtain a blurred image, wherein the size of the Gaussian kernel function is determined according to the input image resolution. If the input resolution is large, the size of the blur kernel can be increased accordingly. In this case, the input image resolution is 912*618, and the size of the blur kernel is 7; grayscale processing is then performed on the first image after the Gaussian module, and then the image is blurred using the following method: Figure 4 The Haar wavelet shown calculates the horizontal information h2, the vertical information v2 and the diagonal information c2 of the first immunofluorescence image to form a second information set of the first immunofluorescence image;
[0048] Step 104, based on the first information set and the second information set, the MSE value of the first immunofluorescence image is calculated, and the MSE value is used as the clarity value of the first fluorescence image. The calculation method of the MSE value is not limited. In this embodiment, the MSE value is calculated using the following calculation formula:
[0049]
[0050] Among them, y iRepresents the values in v1, h1, c1, represents the value in v2, h2, c2. i is equal to 1.
[0051] Repeat the above clarity evaluation process to obtain the clarity evaluation values of 9 immunofluorescence images, such as Figure 5 shown. Figure 4 The pictures in the file are named using the method of Img+serial number+resolution value, i.e. the first number after Img is the serial number, and the second number is the resolution value. Figure 4 The clarity evaluation value corresponding to the first picture shown is: 0.000348; among them, the clarity evaluation value of the image Img_5_0.0473679.jpg with serial number 5 is the largest, and the z-axis position corresponding to the image with serial number 5 is the ideal focusing position.
[0052] The principle of using the image clarity value to evaluate whether the focus position is accurate is as follows: the clearer the image, the greater the information entropy (indicating that the image contains more information); after Gaussian blur processing, the greater the information entropy loss, and the difference in information entropy loss before and after blurring (MSE value) is used as the clarity value of the immunofluorescence image. The more blurred the image, the less information entropy loss before and after Gaussian blur processing; the clearer the image, the greater the information entropy loss before and after Gaussian blur processing.
[0053] The method for automatically determining the focus position of an immunofluorescence dark-field camera provided in this embodiment calculates a first information set after grayscale processing of the immunofluorescence image, and then calculates a second information set after blur processing and grayscale processing of the immunofluorescence image. The MSE value of the immunofluorescence image is calculated by the first information set and the second information set, and the focus position of the fluorescent dark-field camera is judged by the size of the MSE value. The focusing speed is fast, the efficiency is high, and the automated operation is convenient.
[0054] Example 2
[0055] The difference between this embodiment and the embodiment 1 is that: in step 102, the two-dimensional first-order wavelet transformation adopts Daubechies wavelet; in step 103, the blurring process of the immunofluorescence image adopts Laplace blurring process.
[0056] The Daubechies wavelet and Laplace blur algorithm are used to process images. On the one hand, a more diverse processing method is provided for image processing, which effectively improves the versatility of the technical solution of the present invention. On the other hand, the above two algorithms have a simple structure, which can effectively improve the computing efficiency and reduce the hardware burden.
[0057] Example 3
[0058] This embodiment provides a device for automatically determining the focus position of a fluorescent dark field camera. Figure 6 As shown, including:
[0059] An acquisition module 201 is used to acquire fluorescence images at different focus positions of the slide;
[0060] The first information set acquisition module 202 performs grayscale processing on the immunofluorescence image, and then calculates the first low-latitude information, first horizontal information, first vertical information and diagonal information of the immunofluorescence image using a two-dimensional first-order wavelet transform to form a first information set of the immunofluorescence image;
[0061] The second information set acquisition module 203 performs fuzzy processing and grayscale processing on the immunofluorescence image, and then uses Haar wavelet to calculate the second low-latitude information, second horizontal information, second vertical information and second diagonal information of the immunofluorescence image to form a second information set of the immunofluorescence image;
[0062] The immunofluorescence picture clarity value calculation module 204 is configured to calculate the MSE value of the immunofluorescence picture based on the first information set and the second information set, and the MSE value is used as a clarity value for evaluating the immunofluorescence picture.
[0063] The device for automatically determining the focus position of an immunofluorescence dark-field camera provided by the present invention acquires an immunofluorescence image through an acquisition module, calculates a first information set after grayscale processing is performed on the immunofluorescence image through a first information set acquisition module, calculates a second information set after blurring and grayscale processing is performed on the immunofluorescence image through a second information set acquisition module, calculates an MSE value of the immunofluorescence image through the first information set and the second information set, and judges the accuracy of the focus position of the fluorescent dark-field camera by the size of the MSE value. The focusing speed is fast, the efficiency is high, and the automatic operation is convenient.
[0064] Example 4
[0065] Based on the same inventive concept, this embodiment provides an electronic device, see Figure 7 , including a memory 302, a processor 301, a communication interface 303, a communication bus 304, and a computer program stored in the memory and executable on the processor, wherein the processor 301, the communication interface 303, and the memory 302 communicate with each other via the communication bus 304; the communication interface 303 is used to realize information transmission between various modeling software and intelligent equipment module libraries and other related devices; the processor 301 is used to call the computer program in the memory 302, and the processor implements the methods provided by the above-mentioned various method embodiments when executing the computer program. For example, when the processor executes the computer program, it performs the following operations:
[0066] Obtain immunofluorescence images at different focus positions on the slide;
[0067] Grayscale processing is performed on the immunofluorescence image, and then horizontal information, vertical information and diagonal information of the immunofluorescence image are calculated using a two-dimensional first-order wavelet transform to form a first information set of the immunofluorescence image;
[0068] The immunofluorescence image is subjected to blur processing and grayscale processing, and the horizontal information, vertical information and diagonal information of the immunofluorescence image are calculated using the Haar wavelet to form a second information set of the immunofluorescence image;
[0069] The MSE value of the immunofluorescence image is calculated based on the first information set and the second information set, the MSE value is used as the clarity value of the immunofluorescence image, and the focus position of the immunofluorescence camera is determined according to the clarity value of the immunofluorescence image.
[0070] Example 5
[0071] This embodiment provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following operations are performed:
[0072] Obtain immunofluorescence images at different focus positions on the slide;
[0073] Grayscale processing is performed on the immunofluorescence image, and then horizontal information, vertical information and diagonal information of the immunofluorescence image are calculated using a two-dimensional first-order wavelet transform to form a first information set of the immunofluorescence image;
[0074] The immunofluorescence image is subjected to blur processing and grayscale processing, and the horizontal information, vertical information and diagonal information of the immunofluorescence image are calculated using the Haar wavelet to form a second information set of the immunofluorescence image;
[0075] The MSE value of the immunofluorescence image is calculated based on the first information set and the second information set, and the MSE value is used as the clarity value of the immunofluorescence image. The focus plane position or the focus position is determined according to the clarity value of the immunofluorescence image.
[0076] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0077] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0078] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0079] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0080] Obviously, the above embodiments are merely examples for the purpose of clear explanation, and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived therefrom are still within the scope of protection of the invention.
Claims
1. A method for automatically determining the focus position of a fluorescent dark field camera, characterized in that: The steps include: Acquire immunofluorescence images of different focal positions of the slide from top to bottom; grayscale processing is performed on the first immunofluorescence image, and then horizontal information, vertical information and diagonal information of the immunofluorescence image are calculated using a two-dimensional first-order wavelet transform to form a first information set of the immunofluorescence image; The first immunofluorescence image is subjected to blur processing and grayscale processing, and the horizontal information, vertical information and diagonal information of the immunofluorescence image are calculated using Haar wavelet to form a second information set of the immunofluorescence image; Calculating the MSE value of the first immunofluorescence image based on the first information set and the second information set, and using the MSE value as the clarity value of the first immunofluorescence image; Repeat the above steps to calculate the clarity value of the first immunofluorescence image to obtain the clarity values of multiple immunofluorescence images, and use the MSE value to determine the focus position of the fluorescent dark field camera.
2. The method according to claim 1, characterized in that The two-dimensional first-order wavelet is changed into Daubechies wavelet or Haar wavelet.
3. The method according to claim 1, characterized in that The blurring process uses Gaussian blurring or Laplace blurring.
4. The method according to claim 1, characterized in that The MSE value is calculated using the following formula: ,in, Represents the values in v1, h1, c1, Represents the values in v2, h2, and c2. is equal to 1, SSE is the total difference; n is the number of pixels in the immunofluorescence image.
5. A device for automatically determining the focus position of a fluorescent dark field camera, characterized in that: The method for automatically determining the focus position of a fluorescent dark-field camera as claimed in any one of claims 1 to 4 is implemented when the device is running, comprising: An acquisition module is used to obtain immunofluorescence images at different focus positions on the slide; The first information set acquisition module performs grayscale processing on the immunofluorescence image, and then calculates the first horizontal information, the first vertical information and the diagonal information of the immunofluorescence image by using a two-dimensional first-order wavelet transform to form a first information set of the immunofluorescence image; The second information set acquisition module performs fuzzy processing and grayscale processing on the immunofluorescence image, and then uses Haar wavelet to calculate the second horizontal information, second vertical information and second diagonal information of the immunofluorescence image to form a second information set of the immunofluorescence image; The immunofluorescence image clarity value calculation module is configured to calculate the MSE value of the fluorescence image based on the first information set and the second information set, and the MSE value is used as the clarity value of the immunofluorescence image.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method for automatically determining the focus position of a fluorescent dark-field camera as claimed in any one of claims 1 to 4 is implemented.
7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for automatically determining the focus position of a fluorescent dark-field camera as claimed in any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
BIBAVR algorithm based automatic focusing helmet camera
CN105227810A
Micro-spectrometry measurement method and system
CN110214290A