All-focus digital slice synthesis method and device based on physical optical model
By constructing a PSF template and using the Tenengrad operator to calculate a precise defocus vector, the problems of scanning efficiency, accuracy, and data cost in digital pathology imaging are solved, generating high-quality full-focus digital slices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN SHENGQIANG TECH
- Filing Date
- 2026-03-19
- Publication Date
- 2026-05-22
AI Technical Summary
Existing technologies cannot simultaneously balance scanning efficiency, imaging accuracy, data cost, and image fidelity, making it difficult to meet the digital pathology industry's requirements for high-quality, high-throughput, and low-cost imaging of full-depth digital slides.
By constructing a PSF template that characterizes the defocusing and out-of-focusing patterns, the Tenengrad operator is used to calculate the accurate defocus vector, and imaging compensation is performed based on the PSF template to generate a fully focused digital slice.
It enables the generation of fully focused digital slices without relying on high-frequency mechanical focusing or acquiring massive amounts of multi-layer data, adapting to the microscopic morphological variations of pathological tissues, improving imaging quality, and reducing data storage costs.
Smart Images

Figure CN121883278B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of digital pathological imaging, and in particular to a method and apparatus for synthesizing fully focused digital slides based on a physical optics model. Background Technology
[0002] With the rapid transformation of pathological diagnostic technology from traditional optical microscopy to digitalization and intelligence, whole-field digital slide scanning (WSI) has become a core foundational technology of modern digital pathology systems. This technology transforms pathological tissue slides into high-resolution digital images through an optical scanning system, providing core data support for remote pathology consultations, AI-assisted diagnosis, and the archiving and analysis of pathological big data. Consequently, increasingly stringent requirements have been placed on the full-field imaging clarity, scanning efficiency, and data storage costs of digital slides. In actual clinical scanning scenarios, factors such as uneven slide substrates, uneven thickness of pathological tissue samples, tilted coverslips, and the natural undulations of the tissue's microstructure can easily cause localized tissue areas to deviate from the objective lens's depth of focus, leading to defocusing and blurring. This results in the loss of crucial pathological diagnostic details such as cell nuclei and chromatin texture, directly affecting the accuracy of diagnostic results and significantly reducing the recognition accuracy of subsequent AI-assisted analysis models. This has become a common bottleneck restricting the improvement of digital slide imaging quality across the industry.
[0003] To address the aforementioned defocusing issue, the mainstream solution in the industry currently relies on hardware dynamic focusing technology. This approach uses the high-frequency reciprocating mechanical motion of a Z-axis motor to adjust the objective lens's focal plane in real time during scanning, tracking and adapting to changes in the focal plane of the tissue section. However, this technology has inherent and unavoidable drawbacks: the high-frequency mechanical focusing action significantly increases the overall scanning time for a single section, failing to meet the clinical needs of high-throughput section scanning in pathology departments; simultaneously, the long-term high-frequency motion of the motor generates severe mechanical wear, increasing equipment maintenance costs and causing insufficient focusing accuracy in local areas due to mechanical response delays and motion errors. This makes it difficult to adapt to the micron-level microscopic morphological variations of tissue sections, failing to fundamentally solve the problem of uniform and clear imaging across the entire field of view.
[0004] To compensate for the limitations of hardware focusing accuracy, physical Z-Stack multi-focal plane stacking technology has become a widely used alternative in the industry. This technology continuously acquires dozens or even hundreds of full-field images of different focal planes along the Z-axis, then uses image fusion algorithms to select sharp pixels from each region, ultimately synthesizing a single full-depth-of-focus image. However, this approach also has significant technical drawbacks: full-layer focal plane acquisition generates massive amounts of redundant image data, with the raw data volume of a single slice increasing by tens of times compared to a single-layer scan, placing extremely high cost pressure on local storage, cloud archiving, and data transmission in hospital pathology departments; at the same time, continuous acquisition of multi-layer images significantly reduces scanning efficiency, contradicting the needs of high-throughput clinical scanning, and multi-layer image fusion is highly susceptible to inter-layer registration errors, leading to structural artifacts and obscuring the true morphological characteristics of pathological tissues.
[0005] In addition, blind image enhancement and blind deconvolution techniques based on pure image processing have also been attempted for defocus image restoration. These solutions do not require hardware focusing adjustments; they enhance details in a single-layer blurred image solely through software algorithms. However, these solutions lack rigorous physical optics theory support and are blind restoration processes without physical prior knowledge. They cannot accurately match the actual defocus degradation patterns of the optical system, and are prone to generating false textures and structural artifacts when restoring the high-frequency microscopic details required for pathological diagnosis. At the same time, during the process of enhancing details in blurred areas, the algorithm simultaneously amplifies the background noise and sensor noise, resulting in a significant decrease in the image signal-to-noise ratio, which completely fails to meet the rigid medical-grade requirements for image authenticity and accuracy in pathological diagnosis.
[0006] In summary, existing technologies cannot simultaneously address the core requirements of scanning efficiency, imaging accuracy, data cost, and image fidelity, making them ill-suited to the high-quality, high-throughput, and low-cost imaging demands of full-depth-of-focus digital slides during the rapid development of the digital pathology industry. Therefore, developing a full-depth-of-focus digital slide synthesis technology that does not rely on high-frequency mechanical focusing, requires no massive multi-layer data acquisition, and is based on a rigorous physical optical model has become a critical technical problem urgently needing to be solved in this field. Summary of the Invention
[0007] This application provides a method and apparatus for synthesizing fully focused digital slices based on a physical optics model. By constructing a PSF template that characterizes the defocusing and out-of-focusing rules, and using the Tenengrad operator to calculate the precise defocus vector of each pixel matrix block, imaging compensation is performed based on matching the corresponding PSF template with the precise defocus vector to generate fully focused digital slices.
[0008] In a first aspect, embodiments of this application provide a method for synthesizing fully focused digital slices based on a physical optics model, the method comprising:
[0009] Acquire objective lens parameters and preset step distance, and obtain multiple defocus levels based on the preset step distance;
[0010] The wavefront error of each defocus setting is calculated based on the defocus vector and objective lens parameters of each defocus setting, and the PSF template of the corresponding defocus setting is calculated based on the wavefront error of each defocus setting. The wavefront error is a physical operator used to evaluate the degree of defocus at the corresponding defocus setting, and the PSF template represents the defocus rule of the corresponding defocus setting.
[0011] At least three consecutive focal plane images are acquired along the optical axis in each field of view of the pathological section. Each field of view is divided into multiple pixel matrix blocks. The accurate defocus vector of each pixel matrix block is calculated based on the high-frequency component energy value of each pixel matrix block under different focal plane images. The Tenengrad operator is used to calculate the high-frequency component energy value of each pixel matrix block under different focal planes.
[0012] Based on the objective lens parameters, if the absolute value of the precise defocus vector of the pixel matrix block is less than the sharpness threshold, the original image of the corresponding pixel matrix block is used as the imaging result; if the absolute value of the precise defocus vector of the pixel block is not less than the sharpness threshold, the PSF template corresponding to the precise defocus vector is obtained to perform imaging compensation on the original image of the pixel matrix block, and the compensated result is used as the imaging result of the corresponding pixel matrix block.
[0013] The imaging results of each pixel matrix block in all fields of view within the pathological section are fused to obtain a fully focused digital section.
[0014] Secondly, embodiments of this application provide a total focusing digital slice synthesis device based on a physical optics model, comprising:
[0015] The acquisition module is used to acquire objective lens parameters and preset step distance, and to acquire multiple defocus levels based on the preset step distance;
[0016] The PSF calculation module calculates the wavefront error of each defocus position based on the defocus vector and objective lens parameters of each defocus position, and calculates the PSF template of the corresponding defocus position based on the wavefront error of each defocus position. The wavefront error is a physical operator used to evaluate the degree of defocus at the corresponding defocus position, and the PSF template represents the defocus rule of the corresponding defocus position.
[0017] The defocus vector calculation module is used to acquire focal plane images of at least three consecutive focal planes along the optical axis in each field of view of the pathological slide, divide each field of view into multiple pixel matrix blocks, and calculate the accurate defocus vector of each pixel matrix block based on the high-frequency component energy value of each pixel matrix block under different focal plane images. The Tenengrad operator is used to calculate the high-frequency component energy value of each pixel matrix block under different focal planes.
[0018] The compensation module, based on the objective lens parameters, presets a sharpness threshold. If the absolute value of the precise defocus vector of the pixel matrix block is less than the sharpness threshold, the original image of the corresponding pixel matrix block is used as the imaging result. If the absolute value of the precise defocus vector of the pixel block is not less than the sharpness threshold, the PSF template corresponding to the precise defocus vector is obtained to perform imaging compensation on the original image of the pixel matrix block, and the compensated result is used as the imaging result of the corresponding pixel matrix block.
[0019] The fusion module is used to fuse the imaging results of every pixel matrix block in all fields of view within a pathological slice to obtain a fully focused digital slice.
[0020] Thirdly, embodiments of this application provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute a total focusing digital slice synthesis method based on a physical optics model.
[0021] Fourthly, embodiments of this application provide a readable storage medium storing a computer program, which, when executed by a processor, implements a method for synthesizing fully focused digital slices based on a physical optics model.
[0022] The main contributions and innovations of this invention are as follows:
[0023] This application's embodiments pre-calculate the PSF template corresponding to the defocus level using wavefront error, constructing a PSF template characterizing the defocusing and blurring rules. This transforms the subjective perception of defocus blur into a quantifiable physical operator, establishing a physical model that fits the real defocusing degradation rules of the optical imaging system. This provides a rigorous physical-optical prior for subsequent defocus image compensation, fundamentally avoiding the defects of blind deconvolution techniques without physical prior, which easily generate false textures and structural artifacts. This scheme uses the Tenengrad operator to calculate the high-frequency component energy values of each pixel matrix block under different focal plane images, and uses this to fit and solve the accurate defocus vector of each pixel matrix block. This achieves accurate estimation of the local defocus amount at the micrometer level within the field of view, perfectly adapting to local defocusing problems caused by microscopic morphological fluctuations in pathological tissues, uneven slides, and uneven sample thickness, and uses the corresponding PSF template to perform imaging compensation.
[0024] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description
[0025] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0026] Figure 1 This is a flowchart of a fully focused digital slice synthesis method based on a physical optics model according to an embodiment of this application;
[0027] Figure 2 This is a schematic diagram illustrating the influence of wavefront error on a PSF template according to an embodiment of this application;
[0028] Figure 3 This is a schematic diagram of obtaining a fully focused digital slice according to an embodiment of this application;
[0029] Figure 4 This is a structural block diagram of a fully focused digital slice synthesis device based on a physical optics model according to an embodiment of this application;
[0030] Figure 5 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0031] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with one or more embodiments of this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
[0032] It should be noted that the steps of the corresponding methods are not necessarily performed in the order shown and described in this specification in other embodiments. In some other embodiments, the methods may include more or fewer steps than described in this specification. Furthermore, a single step described in this specification may be broken down into multiple steps in other embodiments; and multiple steps described in this specification may be combined into a single step in other embodiments.
[0033] Example 1
[0034] This application provides a method for synthesizing fully focused digital slices based on a physical optics model. It constructs a PSF template representing the defocusing behavior and uses the Tenengrad operator to calculate the precise defocus vector for each pixel matrix block. Imaging compensation is then performed based on matching the corresponding PSF template to the precise defocus vector to generate fully focused digital slices. Specifically, refer to... Figure 1 The method includes:
[0035] Acquire objective lens parameters and preset step distance, and obtain multiple defocus levels based on the preset step distance;
[0036] The wavefront error of each defocus setting is calculated based on the defocus vector and objective lens parameters of each defocus setting, and the PSF template of the corresponding defocus setting is calculated based on the wavefront error of each defocus setting. The wavefront error is a physical operator used to evaluate the degree of defocus at the corresponding defocus setting, and the PSF template represents the defocus rule of the corresponding defocus setting.
[0037] At least three consecutive focal plane images are acquired along the optical axis in each field of view of the pathological section. Each field of view is divided into multiple pixel matrix blocks. The accurate defocus vector of each pixel matrix block is calculated based on the high-frequency component energy value of each pixel matrix block under different focal plane images. The Tenengrad operator is used to calculate the high-frequency component energy value of each pixel matrix block under different focal planes.
[0038] Based on the objective lens parameters, if the absolute value of the precise defocus vector of the pixel matrix block is less than the sharpness threshold, the original image of the corresponding pixel matrix block is used as the imaging result; if the absolute value of the precise defocus vector of the pixel block is not less than the sharpness threshold, the PSF template corresponding to the precise defocus vector is obtained to perform imaging compensation on the original image of the pixel matrix block, and the compensated result is used as the imaging result of the corresponding pixel matrix block.
[0039] The imaging results of each pixel matrix block in all fields of view within the pathological section are fused to obtain a fully focused digital section.
[0040] In the current embodiment, the objective lens parameters include NA value, aperture coordinates, and illumination wavelength. The NA value is mapped onto a circular region formed by the objective lens transmittance and normalized to obtain the aperture coordinates. The center point of the circular region formed by the objective lens transmittance is the objective lens pupil.
[0041] In the current embodiment, a preset defocus range is defined, and the defocus range is divided into multiple defocus levels based on a preset step distance. The defocus vector of each defocus level represents the distance between the current focal plane and the ideal focal plane. When the defocus vector is positive, the corresponding defocus level is above the ideal focal plane; when the defocus vector is negative, the corresponding defocus level is below the ideal focal plane; and when the defocus vector is 0, it indicates that the focus is on the ideal focal plane.
[0042] Specifically, the defocus range in this scheme is [-5μm, 5μm], and the preset step distance is 0.1μm. In other words, this scheme divides the defocus range into 100 defocus levels based on the preset step distance.
[0043] In the current embodiment, the formula for calculating the wavefront error is:
[0044]
[0045] in, Here, NA is the defocus vector, and NA is the NA value of the objective lens. , ) represents the aperture coordinates, which are Defocus vector The wavefront error.
[0046] Specifically, the wavefront error is used to transform the "blur" caused by defocusing from a subjective visual perception into an objective and quantifiable physical operator.
[0047] In the current embodiment, the wavefront error of each defocus position is combined with the aperture coordinates to obtain the generalized pupil function. The generalized pupil function is then subjected to a two-dimensional fast Fourier transform and the modulus is squared to obtain the corresponding PSF template. The generalized pupil function represents the phase distribution of the light field under the current defocus position and aperture coordinates.
[0048] Specifically, the formula for obtaining the generalized pupil function is expressed as follows:
[0049]
[0050] in, For aperture coordinates, For the corresponding defocus setting, For the generalized pupil function, For aperture coordinates, The imaginary unit, For illumination wavelength, This represents wavefront error.
[0051] Specifically, the PSF template is a two-dimensional weight matrix, and the influence of wavefront error on the PSF template is as follows: Figure 2 As shown.
[0052] In the current embodiment, a ternary quadratic polynomial is constructed based on the high-frequency component energy values of each pixel matrix block under different focal plane images. The ternary quadratic polynomial is fitted and solved to obtain the accurate defocus vector of the corresponding pixel matrix block.
[0053] Specifically, since the sharpness of the high-frequency component energy values at different focal planes varies with the focal plane position in a "single-peak parabola" pattern, meaning that the smaller the defocusing amount, the higher the sharpness, and the sharpness reaches its peak at the optimal focal plane, the specific spatial coordinates of the high-frequency component energy values on the single-peak parabola under different focal plane images can be determined by solving the ternary quadratic polynomial. Thus, the precise defocus vector of the pixel matrix block can be obtained based on the difference between the specific spatial coordinates of each high-frequency component energy value and the spatial coordinates corresponding to the vertex of the parabola.
[0054] In the current embodiment, the ratio of the illumination wavelength to the square of the NA value is used as the physical depth of focus, and the product of the physical depth of focus and the threshold coefficient is used as the sharpness determination threshold.
[0055] Specifically, the formula for physical depth of focus is expressed as:
[0056]
[0057] in, For physical depth of focus, NA is the illumination wavelength, and NA is the NA value.
[0058] Specifically, if the threshold coefficient is preset to 0.5, then the clear determination threshold T = 0.5 × DOF.
[0059] In other words, with As the precise defocus vector of the current pixel matrix block, when When the pixel matrix block falls within the physical depth of focus, the image quality meets the requirements; when If the pixel matrix block is out of focus, it means that the pixel matrix block is not within the physical depth of focus, and the pixel matrix block has gone out of focus due to the undulation of the slice.
[0060] In the current embodiment, imaging compensation is performed on the original image of the pixel matrix block to obtain frequency domain imaging, and inverse Fourier transform is performed on the frequency domain imaging to complete imaging compensation. The formula for obtaining frequency domain imaging is expressed as:
[0061]
[0062] in, For frequency domain imaging, This represents the total number of focal planes. For focal plane index, For aperture coordinates, As a weighting factor, This is the result of performing a Fast Fourier Transform on the original image. The result of performing a Fast Fourier Transform on the corresponding PSF template. for conjugate, This is a regularization term.
[0063] In other words, after obtaining the specific and accurate defocus vector, this scheme retrieves the PSF template corresponding to the accurate defocus vector from the database, and then performs Wiener gain calculation in the frequency domain space by calculating the PSF template and the original image to complete the imaging compensation.
[0064] In the current embodiment, the gradient vector of each pixel in the fully focused digital slice is calculated, and an iterative digital slice is obtained by smoothing iteratively along the orthogonal direction of the pixel gradient vector based on anisotropic diffusion filtering. When the noise of the iterative digital slice is less than a preset threshold, the smoothing iteration is stopped, and the iterative digital slice obtained in the last round of iteration is used as a new fully focused digital slice.
[0065] Specifically, a schematic diagram of obtaining a fully focused digital slice using this method is shown below. Figure 3 As shown, compared to traditional single-layer scanning, this scheme relies on a physical PSF model library to complete local depth-of-focus estimation and generate a depth map. Then, it completes virtual full-focus synthesis through regularized deconvolution and weighted fusion of multi-focal plane information. Finally, after denoising optimization, it outputs a fully focused digital slice. This effectively solves the problem of local defocusing and blurring caused by uneven slides and uneven sample thickness in traditional single-layer scanning. It does not rely on continuous mechanical focusing in hardware and achieves clear digital slice generation across the entire field without generating massive amounts of redundant data.
[0066] Specifically, anisotropic diffusion filtering is an image processing technique based on partial differential equations. Its core principle is to achieve noise suppression and edge protection by dynamically adjusting the diffusion coefficient. Its core logic is: "Strongly denoise in flat areas and stop denoising in edge areas." The following are its specific implementation steps:
[0067] 1. Establish the partial differential diffusion equation (PDE)
[0068] This algorithm will use total focusing digital slices Considered as a type of "heat" distribution, over time Iterative evolution, mathematically expressed as:
[0069]
[0070] in, For full-focus digital slice gradient, For divergence operators, is the diffusion coefficient.
[0071] 2. Construct an "edge-sensitive" diffusion coefficient
[0072] Through diffusion coefficient The system automatically determines whether smoothing is needed based on the gradient of each pixel in the fully focused digital slice. The formula is as follows:
[0073]
[0074] Among them, when The gradient represents the condition when the region is flat. This indicates strong diffusion at this location, suggesting the absence of significant biological structural information, thus requiring smoothing along the orthogonal direction of the pixel's gradient vector; when The gradient indicates that this location is at the cell edge. Diffusion is stopped here because important information such as cell edges exists here. No smoothing is performed here, and high-frequency details such as cell nuclear membrane and chromatin texture obtained by imaging compensation are preserved. Here, K is the gradient threshold used to adjust the denoising intensity.
[0075] In other words, during the iteration, the gradient threshold K is continuously adjusted to determine which pixels to smooth in order to eliminate more image noise.
[0076] Specifically, this scheme determines noise within iterative digital slices by calculating image entropy.
[0077] Example 2
[0078] Based on the same concept, referencing Figure 4 This application also proposes a total focusing digital slice synthesis device based on a physical optics model, comprising:
[0079] The acquisition module is used to acquire objective lens parameters and preset step distance, and to acquire multiple defocus levels based on the preset step distance;
[0080] The PSF calculation module calculates the wavefront error of each defocus position based on the defocus vector and objective lens parameters of each defocus position, and calculates the PSF template of the corresponding defocus position based on the wavefront error of each defocus position. The wavefront error is a physical operator used to evaluate the degree of defocus at the corresponding defocus position, and the PSF template represents the defocus rule of the corresponding defocus position.
[0081] The defocus vector calculation module is used to acquire focal plane images of at least three consecutive focal planes along the optical axis in each field of view of the pathological slide, divide each field of view into multiple pixel matrix blocks, and calculate the accurate defocus vector of each pixel matrix block based on the high-frequency component energy value of each pixel matrix block under different focal plane images. The Tenengrad operator is used to calculate the high-frequency component energy value of each pixel matrix block under different focal planes.
[0082] The compensation module, based on the objective lens parameters, presets a sharpness threshold. If the absolute value of the precise defocus vector of the pixel matrix block is less than the sharpness threshold, the original image of the corresponding pixel matrix block is used as the imaging result. If the absolute value of the precise defocus vector of the pixel block is not less than the sharpness threshold, the PSF template corresponding to the precise defocus vector is obtained to perform imaging compensation on the original image of the pixel matrix block, and the compensated result is used as the imaging result of the corresponding pixel matrix block.
[0083] The fusion module is used to fuse the imaging results of every pixel matrix block in all fields of view within a pathological slice to obtain a fully focused digital slice.
[0084] Example 3
[0085] This embodiment also provides an electronic device, see reference. Figure 5 It includes a memory 404 and a processor 402, wherein the memory 404 stores a computer program and the processor 402 is configured to run the computer program to perform the steps in any of the above method embodiments.
[0086] Specifically, the processor 402 may include a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0087] Memory 404 may include a mass storage device for data or instructions. For example, and not limitingly, memory 404 may include a hard disk drive (HDD), a floppy disk drive, a solid-state drive (SSD), flash memory, an optical disk drive, a magneto-optical disk drive, magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 404 may include removable or non-removable (or fixed) media. Where appropriate, memory 404 may be internal or external to a data processing device. In a particular embodiment, memory 404 is non-volatile memory. In a particular embodiment, memory 404 includes read-only memory (ROM) and random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable read-only memory (PROM), an erasable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), an electrically alterable read-only memory (EAROM), or flash memory, or a combination of two or more of these. Where appropriate, the RAM can be Static Random-Access Memory (SRAM) or Dynamic Random-Access Memory (DRAM). DRAM can be Fast Page Mode Dynamic Random-Access Memory (FPMDRAM), Extended Data Out Dynamic Random-Access Memory (EDODRAM), Synchronous Dynamic Random-Access Memory (SDRAM), etc.
[0088] The memory 404 can be used to store or cache various data files that need to be processed and / or communicated, as well as possible computer program instructions executed by the processor 402.
[0089] The processor 402 reads and executes computer program instructions stored in the memory 404 to implement any of the total focusing digital slice synthesis methods based on physical optics models in the above embodiments.
[0090] Optionally, the electronic device may further include a transmission device 406 and an input / output device 408, wherein the transmission device 406 is connected to the processor 402, and the input / output device 408 is connected to the processor 402.
[0091] The transmission device 406 can be used to receive or send data via a network. Specific examples of the network described above may include wired or wireless networks provided by the communication provider of the electronic device. In one example, the transmission device includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 406 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0092] The input / output device 408 is used to input or output information. In this embodiment, the input information may be objective lens parameters, step distance, etc., and the output information may be total focusing digital slices, etc.
[0093] Optionally, in this embodiment, the processor 402 can be configured to perform the following steps via a computer program:
[0094] Acquire objective lens parameters and preset step distance, and obtain multiple defocus levels based on the preset step distance;
[0095] The wavefront error of each defocus setting is calculated based on the defocus vector and objective lens parameters of each defocus setting, and the PSF template of the corresponding defocus setting is calculated based on the wavefront error of each defocus setting. The wavefront error is a physical operator used to evaluate the degree of defocus at the corresponding defocus setting, and the PSF template represents the defocus rule of the corresponding defocus setting.
[0096] At least three consecutive focal plane images are acquired along the optical axis in each field of view of the pathological section. Each field of view is divided into multiple pixel matrix blocks. The accurate defocus vector of each pixel matrix block is calculated based on the high-frequency component energy value of each pixel matrix block under different focal plane images. The Tenengrad operator is used to calculate the high-frequency component energy value of each pixel matrix block under different focal planes.
[0097] Based on the objective lens parameters, if the absolute value of the precise defocus vector of the pixel matrix block is less than the sharpness threshold, the original image of the corresponding pixel matrix block is used as the imaging result; if the absolute value of the precise defocus vector of the pixel block is not less than the sharpness threshold, the PSF template corresponding to the precise defocus vector is obtained to perform imaging compensation on the original image of the pixel matrix block, and the compensated result is used as the imaging result of the corresponding pixel matrix block.
[0098] The imaging results of each pixel matrix block in all fields of view within the pathological section are fused to obtain a fully focused digital section.
[0099] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.
[0100] Generally, various embodiments can be implemented in hardware or dedicated circuitry, software, logic, or any combination thereof. Some aspects of the invention can be implemented in hardware, while others can be implemented by firmware or software executed by a controller, microprocessor, or other computing device, but the invention is not limited thereto. Although various aspects of the invention may be shown and described as block diagrams, flowcharts, or using some other graphical representation, it should be understood that, by way of non-limiting example, these blocks, apparatuses, systems, techniques, or methods described herein can be implemented in hardware, software, firmware, dedicated circuitry or logic, general-purpose hardware or controllers or other computing devices, or some combination thereof.
[0101] Embodiments of the present invention can be implemented by computer software, which may be executable by a data processor of a mobile device, such as a processor entity, or by hardware, or by a combination of software and hardware. Computer software or programs (also referred to as program products) including software routines, applets, and / or macros can be stored in any device-readable data storage medium, and they include program instructions for performing specific tasks. The computer program product may include one or more computer-executable components configured to perform the embodiments when the program is run. The one or more computer-executable components may be at least one piece of software code or a portion thereof. Additionally, it should be noted in this respect that, as Figure 5 Any box in the logical flow can represent a program step, or interconnected logic circuits, boxes and functions, or a combination of program steps and logic circuits, boxes and functions. Software can be stored on physical media such as memory chips or blocks of storage implemented within a processor, magnetic media such as hard disks or floppy disks, and optical media such as DVDs and their data variants, CDs, etc. The physical medium is a non-transient medium.
[0102] Those skilled in the art should understand that the technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments have been described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0103] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for synthesizing fully focused digital slices based on a physical optics model, characterized in that, Includes the following steps: Acquire objective lens parameters and preset step distance, and obtain multiple defocus levels based on the preset step distance; The wavefront error of each defocus setting is calculated based on the defocus vector and objective lens parameters of each defocus setting, and the PSF template of the corresponding defocus setting is calculated based on the wavefront error of each defocus setting. The wavefront error is a physical operator used to evaluate the degree of defocus at the corresponding defocus setting, and the PSF template represents the defocus rule of the corresponding defocus setting. At least three consecutive focal plane images are acquired along the optical axis in each field of view of the pathological section. Each field of view is divided into multiple pixel matrix blocks. The accurate defocus vector of each pixel matrix block is calculated based on the high-frequency component energy value of each pixel matrix block under different focal plane images. The Tenengrad operator is used to calculate the high-frequency component energy value of each pixel matrix block under different focal planes. Based on the objective lens parameters, if the absolute value of the precise defocus vector of the pixel matrix block is less than the sharpness threshold, the original image of the corresponding pixel matrix block is used as the imaging result; if the absolute value of the precise defocus vector of the pixel block is not less than the sharpness threshold, the PSF template corresponding to the precise defocus vector is obtained to perform imaging compensation on the original image of the pixel matrix block, and the compensated result is used as the imaging result of the corresponding pixel matrix block. The imaging results of each pixel matrix block in all fields of view within the pathological section are fused to obtain a fully focused digital section.
2. The method for synthesizing fully focused digital slices based on a physical optics model according to claim 1, characterized in that, The objective lens parameters include the NA value, aperture coordinates, and illumination wavelength. The NA value is mapped onto a circular region formed by the objective lens transmittance and normalized to obtain the aperture coordinates. The center point of the circular region formed by the objective lens transmittance is the objective lens pupil.
3. The method for synthesizing fully focused digital slices based on a physical optics model according to claim 1, characterized in that, A preset defocus range is defined, which is then divided into multiple defocus levels based on a preset step distance. The defocus vector of each defocus level represents the distance between the current focal plane and the ideal focal plane. When the defocus vector is positive, the corresponding defocus level is above the ideal focal plane; when the defocus vector is negative, the corresponding defocus level is below the ideal focal plane; and when the defocus vector is 0, it indicates that the focus is on the ideal focal plane.
4. The method for synthesizing fully focused digital slices based on a physical optics model according to claim 1, characterized in that, The formula for calculating the wavefront error is as follows: in, Here, NA is the defocus vector, and NA is the NA value of the objective lens. , ) represents the aperture coordinates, which are Defocus vector The wavefront error.
5. The method for synthesizing fully focused digital slices based on a physical optics model according to claim 1, characterized in that, A ternary quadratic polynomial is constructed based on the high-frequency component energy values of each pixel matrix block under different focal plane images. The ternary quadratic polynomial is then fitted and solved to obtain the accurate defocus vector of the corresponding pixel matrix block.
6. The method for synthesizing fully focused digital slices based on a physical optics model according to claim 1, characterized in that, Imaging compensation is performed on the original image of the pixel matrix blocks to obtain the frequency domain image. Inverse Fourier transform is then performed on the frequency domain image to complete the imaging compensation. The formula for obtaining the frequency domain image is expressed as: in, For frequency domain imaging, This represents the total number of focal planes. For focal plane index, For aperture coordinates, As a weighting factor, This is the result of performing a Fast Fourier Transform on the original image. The result of performing a Fast Fourier Transform on the corresponding PSF template. for conjugate, This is a regularization term.
7. The method for synthesizing fully focused digital slices based on a physical optics model according to claim 1, characterized in that, Calculate the gradient vector of each pixel in the fully focused digital slice. Smooth the pixels in the direction orthogonal to the gradient direction of the gradient vector in the fully focused digital slice to obtain an iterative digital slice. Stop the iteration when the noise of the iterative digital slice is less than a preset threshold, and use the iterative digital slice obtained in the last round of iteration as a new fully focused digital slice.
8. A total focusing digital slice synthesis device based on a physical optics model, characterized in that, include: The acquisition module is used to acquire objective lens parameters and preset step distance, and to acquire multiple defocus levels based on the preset step distance; The PSF calculation module calculates the wavefront error of each defocus position based on the defocus vector and objective lens parameters of each defocus position, and calculates the PSF template of the corresponding defocus position based on the wavefront error of each defocus position. The wavefront error is a physical operator used to evaluate the degree of defocus at the corresponding defocus position, and the PSF template represents the defocus rule of the corresponding defocus position. The defocus vector calculation module is used to acquire focal plane images of at least three consecutive focal planes along the optical axis in each field of view of the pathological slide, divide each field of view into multiple pixel matrix blocks, and calculate the accurate defocus vector of each pixel matrix block based on the high-frequency component energy value of each pixel matrix block under different focal plane images. The Tenengrad operator is used to calculate the high-frequency component energy value of each pixel matrix block under different focal planes. The compensation module, based on the objective lens parameters, presets a sharpness threshold. If the absolute value of the precise defocus vector of the pixel matrix block is less than the sharpness threshold, the original image of the corresponding pixel matrix block is used as the imaging result. If the absolute value of the precise defocus vector of the pixel matrix block is not less than the sharpness threshold, the PSF template corresponding to the precise defocus vector is obtained to perform imaging compensation on the original image of the pixel matrix block, and the compensated result is used as the imaging result of the corresponding pixel matrix block. The fusion module is used to fuse the imaging results of every pixel matrix block in all fields of view within a pathological slice to obtain a fully focused digital slice.
9. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform a total focusing digital slice synthesis method based on a physical optics model as described in any one of claims 1-7.
10. A readable storage medium, characterized in that, The readable storage medium stores a computer program, which, when executed by a processor, implements a total focusing digital slice synthesis method based on a physical optics model as described in any one of claims 1-7.