Pathological slide-based local adaptive flat field correction method and device and readable storage medium thereof
By employing local adaptive block processing and HSL color space luminance channel correction, the problem of uneven brightness in pathological slide images is solved, achieving high-precision correction and detail preservation of pathological slide images, which is suitable for various medical image processing scenarios.
Patent Information
- Application Number
- CN202510326470.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-19
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2045-03-19
AI Technical Summary
Existing flat-field correction methods cannot adapt to the complex local brightness differences in pathological slide images, resulting in insufficient uniformity and loss of detail in the corrected image, which affects the accuracy of subsequent analysis.
A local adaptive block processing method is adopted, which combines mask generation and independent correction of the luminance channel in the HSL color space. The luminance correction factor of each region is dynamically calculated, and local luminance is accurately adjusted through overlapping block processing and interpolation methods.
It effectively removes background interference in pathological slide images, preserves image details, improves correction accuracy and image uniformity, and adapts to pathological slides with different resolutions and brightness distributions.
Smart Images

Figure CN119850500B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of medical image processing, and particularly relates to a local adaptive flat field correction method based on pathological slides, a device and a readable storage medium thereof. BACKGROUND
[0002] The existing flat field correction method is usually based on a global correction strategy, and a blank slide needs to be photographed in advance as a reference to correct the global brightness difference. However, in the pathological slide image collection, as shown in FIG. 1, the slide background, the sticker and the unevenness of the light often cause the brightness of the edge or the label to be significantly lower than that of the central region, and the sticker reflection may cause local over-brightness. Since the global correction cannot dynamically adjust the local brightness difference of different regions, the effective region details are easily lost or over-corrected after correction (as shown in FIG. 2). Figure 1 Figure 3 In addition, the shooting position of the blank slide is difficult to completely consistent with the actual slide, which further reduces the correction effect. SUMMARY
[0003] The present application provides a local adaptive flat field correction method based on pathological slides, a device and a readable storage medium thereof, which can adapt to the complex local brightness difference (such as sticker interference and edge darkening) in the pathological slide image, and can effectively remove the uneven background interference and retain the image details.
[0004] The core technology of the present application is mainly to realize the local brightness accurate adjustment of the pathological slide image by the local adaptive block processing, the mask generation and the independent correction of the HSL color space brightness channel, and dynamically calculate the brightness correction factor of each region, so as to effectively remove the uneven background interference and retain the image details.
[0005] In the first aspect, the present application provides a local adaptive flat field correction method based on pathological slides, and the method comprises the following steps:
[0006] S1, acquiring a pathological slide image, the image containing a slide, a sticker and a background light uneven region;
[0007] S2, generating a mask based on a threshold method, extracting a significant region in the image and removing a background interference region including the sticker;
[0008] S3, converting the pathological slide image into an HSL color space to separate out a brightness channel;
[0009] S4, performing overlapping block processing on the brightness channel, dividing the image into MxN overlapping small regions, and calculating an average brightness value of each small region;
[0010] S5, generating a brightness correction factor matrix according to the ratio of the average brightness value of each small area to the global average brightness, and expanding the brightness correction factor matrix to the original image size by an interpolation method;
[0011] S6, performing local flat field correction on the brightness channel based on the brightness correction factor matrix;
[0012] S7, merging the corrected brightness channel with the original chrominance and saturation channels, and converting back to the original color space;
[0013] S8, outputting the corrected pathological slide image.
[0014] Further, in step S2, generating a mask based on a threshold method includes the following steps:
[0015] An Otsu algorithm is used to calculate the threshold, and areas below the threshold are marked as background and excluded.
[0016] Further, in step S4, the size of the small area divided is set by the user according to the image resolution and brightness uniformity, and the overlap ratio of the division is 5% to 15%.
[0017] Further, in step S4, the specific parameters of the block processing are:
[0018] The calculation formula of the block number M and N is as follows:
[0019]
[0020]
[0021] Where x and y are the image pixel size, and γ is the uniformity parameter, 1≤γ≤2;
[0022] The overlap rate of adjacent small blocks is 10%.
[0023] Further, in step S5, the generation of the brightness correction factor matrix includes:
[0024] For each block area, the ratio of its average brightness to the global average brightness is calculated as the correction factor of the block area, and a correction factor matrix of the full image size is generated by an interpolation method.
[0025] Further, in step S5, the interpolation method is bilinear interpolation.
[0026] Further, in step S3, the conversion of the HSL color space is used to separate the brightness information and the color information, and only the brightness channel is processed.
[0027] In a second aspect, the present application provides a local adaptive flat field correction device based on a pathological slide, comprising:
[0028] The acquisition module acquires a pathological slide image, and the image includes a slide, a sticker, and a background light uneven area;
[0029] The mask generation module generates a mask based on a threshold method, extracts a significant area in the image, and eliminates a background interference area including the sticker;
[0030] The HSL conversion module converts the pathological slide image into an HSL color space and separates a brightness channel;
[0031] The overlapping block module performs overlapping block processing on the brightness channel, divides the image into MxN overlapping small areas, and calculates an average brightness value of each small area;
[0032] The correction processing module generates a brightness correction factor matrix according to a ratio of the average brightness value of each small area to a global average brightness, extends the brightness correction factor matrix to the original image size through an interpolation method, and performs local flat field correction on the brightness channel based on the brightness correction factor matrix;
[0033] The conversion module combines the corrected brightness channel with original chroma and saturation channels and converts back to the original color space;
[0034] The output module outputs the corrected pathological slide image.
[0035] In a third aspect, the present application provides an electronic device including a memory and a processor, the memory stores a computer program, and the processor is configured to run the computer program to execute the above-mentioned local adaptive flat field correction method based on a pathological slide.
[0036] In a fourth aspect, the present application provides a readable storage medium, the readable storage medium stores a computer program, the computer program includes program code for controlling a process to execute the process, and the process includes the above-mentioned local adaptive flat field correction method based on a pathological slide.
[0037] The main contributions and innovations of the present application are as follows:
[0038] 1. Local adaptive correction: through overlapping block processing and a dynamically generated brightness correction factor matrix, the local area differences of the image are accurately adjusted, and the defects of poor adaptability of global correction to complex backgrounds (such as stickers and edge reflections) and easy loss of details are overcome.
[0039] 2. Improve image uniformity: combined with interpolation expansion and smooth transition technology, the artifacts caused by block boundary jumps in traditional methods are eliminated, and the brightness distribution of the corrected image is smooth and consistent.
[0040] 3. Flexibility and robustness: The block size, overlap ratio, and uniformity parameters can be adjusted to adapt to different resolutions and uneven brightness distribution of pathological slides, avoiding the limitations of relying on blank slide templates.
[0041] 4. Efficiency and practicality: Only the separated brightness channel is processed, preserving the original chroma and saturation information, reducing computational complexity, while meeting the color fidelity requirements of medical image analysis.
[0042] 5. Application expansion: The method can be extended to microscope images, tissue section images, and other medical image processing scenarios with local brightness unevenness, with wide applicability.
[0043] The details of one or more embodiments of the present application are presented in the following drawings and description, so that other features, objects, and advantages of the present application are more apparent. BRIEF DESCRIPTION OF DRAWINGS
[0044] The drawings described herein are intended to provide a further understanding of the present application, and form a part of the present application. The illustrative embodiments of the present application and their description serve to explain the present application. They do not constitute an inappropriate limitation on the present application. In the drawings:
[0045] Figure 1 is the collected image;
[0046] Figure 2 is the image output after processing based on the local adaptive flat field correction method of the pathological slide according to the embodiment of the present application;
[0047] Figure 3 is a schematic diagram of the existing technology for processing Figure 1 with brightness difference;
[0048] Figure 4 is a schematic diagram of removing irrelevant areas using the otsu algorithm according to the embodiment of the present application;
[0049] Figure 5 is a schematic diagram of BGR to HSL according to the embodiment of the present application;
[0050] Figure 6 is a schematic diagram of the L channel of HSL according to the embodiment of the present application;
[0051] Figure 7 is a schematic diagram of interpolation to the original image size according to the embodiment of the present application;
[0052] Figure 8 is a schematic diagram of flat field correction of Figure 7 according to the embodiment of the present application;
[0053] Figure 9is a HSL diagram obtained after processing according to an embodiment of the present application;
[0054] Figure 10 is a flowchart of a local adaptive flat-field correction method based on pathological slides according to an embodiment of the present application;
[0055] Figure 11 is a hardware structure schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0056] The exemplary embodiments will be described in detail hereinbelow with reference to the drawings. When the following description refers to the drawings, identical numbers on different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of the description. Instead, they are merely examples of apparatuses and methods consistent with some aspects of one or more embodiments of the description as detailed in the appended claims.
[0057] It should be noted that the steps of the corresponding methods are not necessarily performed in the order shown and described in the present description in other embodiments. In some other embodiments, the steps included in the methods can be more or less than those described in the present description. Furthermore, a single step described in the present description can be broken down into multiple steps for description in other embodiments, and multiple steps described in the present description can be combined into a single step for description in other embodiments.
[0058] The existing global flat-field correction method cannot dynamically process local brightness differences, resulting in a decline in image quality under complex background interference, affecting subsequent analysis and diagnosis.
[0059] Based on this, the present application solves the problems existing in the prior art based on new image processing technology.
[0060] Embodiment one
[0061] The present application aims to propose a local adaptive flat-field correction method based on pathological slides, which dynamically calculates and adjusts the brightness correction factor of each region through local adaptive block processing, and effectively eliminates the background interference in the pathological slide image while retaining the details by combining the overlapping block smoothing transition technology, significantly improving the correction accuracy and image uniformity.
[0062] Specifically, the embodiment of the present application provides a local adaptive flat-field correction method based on pathological slides, specifically, referring to Figure 10 , the method comprises:
[0063] Step S1: image acquisition and preprocessing
[0064] Pathological slide images are collected by pathological slide scanner or microscope (resolution ≥ 2000x2000 pixels, the specific resolution is adjusted according to the equipment model), and the image contains the main body of the slide, the edge sticker and the non-uniformly illuminated background (such as Figure 1 Gaussian filtering (σ = 1.5) is performed on the image to reduce noise interference in subsequent processing.
[0065] Step S2: Background interference area rejection
[0066] Otsu algorithm is used for adaptive threshold segmentation of image gray histogram, and the best threshold T is calculated; the area with a gray value lower than T (such as stickers, slide background) is marked as a mask (Mask), and its pixel value is set to zero, such as Figure 4 .
[0067] For example, the image is binarized into foreground (significant area) and background (sticker, dark area) using python:
[0068] import cv2
[0069] gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
[0070] _, mask = cv2.threshold(gray, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)
[0071] Mask optimization operation can perform morphological closing operation (such as 5x5 convolution kernel) on the binarization result to eliminate noise and close small cavities.
[0072] Step S3: HSL color space conversion and brightness separation
[0073] Convert the BGR image (because the order of reading RGB image in python is BGR) to HSL (hue-saturation-lightness) color space, extract the brightness channel L(x,y), and keep the hue (H) and saturation (S) channels unchanged.
[0074] Python implementation:
[0075] hsl = cv2.cvtColor(image, cv2.COLOR_BGR2HLS)
[0076] l_channel = hsl[:, :, 1]# Extract the brightness channel
[0077] In this way, the brightness channel is processed independently, avoiding the interference of color information on brightness correction, such asFigure 5 and Figure 6 .
[0078] Step S4: Overlapping block processing and brightness statistics
[0079] Divide the L channel into MxN overlapping blocks, set the block size to 64x64 pixels, the overlapping ratio to 10% (i.e. 6 pixels overlap between adjacent blocks), and the uniformity parameter γ = 1.5.
[0080] According to the image size (e.g. x = 2048, y = 2048), calculate the number of blocks:
[0081]
[0082] For each block region B i,j Calculate the average brightness value µ i,j :
[0083]
[0084] where K is the number of valid pixels within the block (pixels after removing the mask region).
[0085] In this embodiment, the overlapping block processing and brightness statistics can also be calculated as follows:
[0086]
[0087]
[0088] where 10 represents the scaling ratio, such as setting the block size to 10x10 pixels; x and y are the image pixel size, and γ is the uniformity parameter, 1 ≤ γ ≤ 2; for example, for a 2048x2048 pixel image, when γ = 1, M = N = 204.8, rounded to 205x205 blocks. The overlapping rate of adjacent blocks is 10% (e.g. if the block size is 10x10 pixels, then adjacent blocks overlap by 1 pixel), which ensures smooth transition at the boundary. When there are many image brightness abrupt change regions (e.g. the edges of a sticker), the overlapping rate can be increased to 15% to enhance the transition smoothness.
[0089] Traverse each block and calculate the average brightness value:
[0090]
[0091] where w, h are the block size, and I(w, h) is the brightness value of the pixels within the block.
[0092] Preferably, the γ parameter is selected as:
[0093] High image uniformity (e.g. solid color background): gamma = 2, smaller block size (e.g. 100x100 pixels), improve correction accuracy.
[0094] High image complexity (e.g. multi-label interference): gamma = 1, larger block size (e.g. 200x200 pixels), reduce computation load.
[0095] Preferably, gradient-based dynamic block (e.g. division after Canny edge detection) can be used to further improve correction accuracy. For example, the previous fixed block method may cause boundary artifacts or over-smoothing when the image complexity is high. The present invention can be further optimized to gradient-based dynamic block, the specific steps are as follows:
[0096] 1. Canny edge detection: use Canny algorithm to extract image edges and identify significant structures (e.g. cell nucleus boundary, tissue texture):
[0097] edges = cv2.Canny(l_channel, threshold1=30, threshold2=100)
[0098] 2. Dynamic block division: adaptively adjust the block size according to the edge density: use smaller block size (e.g. 50x50 pixels) in edge-dense areas (e.g. cell clusters), and use larger block size (e.g. 200x200 pixels) in smooth areas (e.g. blank background). The block boundary is aligned with the main edge to avoid splitting the same structure into different blocks.
[0099] Compared with the previous fixed block method, it can reduce the over-smoothing of texture area and preserve image details. It can also be combined with the previous fixed block method to achieve local adjustment.
[0100] Step S5: Brightness correction factor generation and interpolation expansion
[0101] Calculate the global average brightness
[0102] Generate correction factors for each block , construct the initial correction factor matrix.
[0103] The correction factor of dark area (the average brightness value of small block is less than the global average brightness) is greater than 1, and the correction factor of bright area (the average brightness value of small block is greater than the global average brightness) is less than 1.
[0104] For example Figure 7 , as mask (mask), generate brightness correction factor for L channel of Figure 4 , and then use bilinear interpolation to expand the sparse C Figure 6 i,j Expand the matrix to the original image size, or implement it using Python:
[0105] import numpy as np
[0106] correction_matrix = cv2.resize(factor_map, (x, y), interpolation=cv2.INTER_LINEAR)
[0107] Step S6: Local planar correction and image reconstruction
[0108] like Figure 8 As shown, for Figure 7 Brightness values exceeding 255 are saturated and truncated (i.e., L≤255) to obtain the brightness L. corrected ;
[0109] like Figure 9 The corrected brightness L corrected Merge with the original H and S channels, convert back to BGR color space, and output the final image, such as... Figure 2 As shown, the output image is not only more uniform in brightness, but also retains image details, providing a more accurate basis for image analysis.
[0110] Implemented in Python:
[0111] hsl[:, :, 1] = L_corrected
[0112] result = cv2.cvtColor(hsl, cv2.COLOR_HLS2BGR)
[0113] Preferably, a Local Contrast Enhancement (CLAHE) algorithm can also be used to optimize contrast while correcting brightness. For example:
[0114] 1. CLAHE parameter settings:
[0115] clahe = cv2.createCLAHE(clipLimit=2.0, tileGridSize=(8,8))
[0116] clahe_l = clahe.apply(l_channel)
[0117] 2. Joint correction formula:
[0118]
[0119] Wherein, clahe_gain and clahe_offset are calculated by the gain matrix and offset matrix of CLAHE output, L final is the corrected brightness value. In this way, the brightness correction factor matrix solves the global non-uniformity, and CLAHE enhances the local contrast (such as the distinction between the nucleus and the cytoplasm).
[0120] In this embodiment, the technical terms are explained:
[0121] Flat-field correction: An image preprocessing technique that makes the background brightness uniform by compensating for uneven illumination in the image.
[0122] HSL color space: A color model composed of hue (H), saturation (S), and lightness (L), which can separate brightness information for independent processing.
[0123] Otsu algorithm: An adaptive threshold segmentation method based on maximum inter-class variance, used to distinguish foreground and background regions.
[0124] Bilinear interpolation: An interpolation algorithm that uses weighted average of adjacent pixels for image scaling or smooth transition.
[0125] Canny edge detection: An edge extraction algorithm commonly used in industrial detection, achieved by Gaussian filtering, gradient calculation, non-maximum suppression, and double-threshold detection.
[0126] CLAHE: A contrast gain limiting method for local histogram equalization (clip limit), which avoids over-enhancing noise and is particularly suitable for contrast optimization of medical images.
[0127] Example Two
[0128] Based on the same idea, the application also provides a local adaptive flat-field correction device based on pathological slides, comprising:
[0129] The acquisition module acquires the pathological slide image, which contains the slide, the sticker, and the background uneven illumination area.
[0130] The mask generation module generates a mask based on a threshold method, extracts the salient region in the image, and eliminates the background interference area including the sticker.
[0131] The HSL conversion module converts the pathological slide image to HSL color space and separates the brightness channel.
[0132] The overlapping block module performs overlapping block processing on the luminance channel, divides the image into MxN overlapping small regions, and calculates the average luminance value of each small region.
[0133] The correction processing module generates a luminance correction factor matrix according to the ratio of the average luminance value of each small region to the global average luminance, and expands the luminance correction factor matrix to the original image size by an interpolation method; and performs local flat field correction on the luminance channel based on the luminance correction factor matrix.
[0134] The conversion module combines the corrected luminance channel with the original chrominance and saturation channels, and converts back to the original color space.
[0135] The output module outputs the corrected pathological slide image.
[0136] In this embodiment, the acquisition module integrates a microscope camera and an image acquisition card, and supports 16-bit RAW format image input.
[0137] The mask generation module implements parallel computing of the Otsu algorithm based on FPGA, and the processing speed is ≤10ms / frame.
[0138] The overlapping block module supports dynamic adjustment of block parameters (such as γ=1~2) through GPU accelerated block division and luminance statistics.
[0139] The correction processing module uses a bilinear interpolation hardware unit (such as ASIC) to realize real-time correction factor expansion.
[0140] Embodiment three
[0141] The embodiment also provides an electronic device, referring to Figure 11 , comprising a memory 404 and a processor 402, the memory 404 stores a computer program, and the processor 402 is configured to run the computer program to execute the steps in any of the above method embodiments.
[0142] Specifically, the above processor 402 can include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
[0143] The memory 404 can include a mass storage that stores data or instructions. For example, and without limitation, the memory 404 can include a Hard Disk Drive (HDD), a floppy disk drive, a Solid State Drive (SSD), a flash drive, a Compact Disc Read Only Memory (CD-ROM), a magneto-optical disk, a magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. The memory 404 can be removable and / or non-removable (or fixed) as appropriate. The memory 404 can be internal or external as appropriate. In particular embodiments, the memory 404 is a Non-Volatile memory. In particular embodiments, the memory 404 includes a Read-Only Memory (ROM) and a Random Access Memory (RAM). The ROM can be a mask-programmed ROM, a Programmable Read-Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), an Electrically Alterable Read-Only Memory (EAROM), or a FLASH memory, or a combination of two or more of these, as appropriate. The RAM can be a Static Random-Access Memory (SRAM) or a Dynamic Random-Access Memory (DRAM), which can be a Fast Page Mode Dynamic Random-Access Memory (FPMDRAM), an Extended Data Output Dynamic Random-Access Memory (EDODRAM), a Synchronous Dynamic Random-Access Memory (SDRAM), or the like, as appropriate.
[0144] The memory 404 can be used to store or buffer various data files needed for processing and / or communication, and possible computer program instructions executed by the processor 402.
[0145] The processor 402 implements the pathological slide-based local adaptive flat field correction method in any of the above embodiments by reading and executing the computer program instructions stored in the memory 404.
[0146] Optionally, the electronic device described above can further include a transmission device 406 connected to the processor 402 and an input / output device 408 connected to the processor 402.
[0147] The transmission device 406 can be used to receive or send data via a network. Specific examples of the network can include a wired or wireless network provided by a communication provider of the electronic device. In one example, the transmission device includes a network adapter (NIC) which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 406 can be a radio frequency (RF) module for communicating with the Internet in a wireless manner.
[0148] The input / output device 408 is used for inputting or outputting information.
[0149] Embodiment Four
[0150] The embodiment also provides a readable storage medium, and the readable storage medium stores a computer program. The computer program includes program codes for controlling a process to execute the process. The process includes the pathological slide-based local adaptive flat field correction method according to Embodiment One.
[0151] It should be noted that specific examples in the embodiment can refer to examples described in the above embodiments and optional implementation manners, and the embodiment will not be described here.
[0152] Generally, various embodiments can be implemented in hardware or special-purpose circuitry, software, logic or any combination thereof. Some aspects of the application can be implemented in hardware, while other aspects can be implemented by firmware or software executed by a controller, microprocessor or other computing device, but the application is not limited thereto. Although various aspects of the application can be illustrated and described as block diagrams, flow charts, or using some other pictorial representation, it is well understood that these blocks, apparatus, systems, techniques or methods described herein can be implemented in hardware, software, firmware, special purpose circuits or logic, general purpose hardware or controller or other computing devices, or some combination thereof.
[0153] Embodiments of the application can be implemented by computer software executable by a data processor of the mobile device such as in the processor entity, or by hardware, or by a combination of software and hardware. Computer software or program, also called program product, including software routines, applets and / or macros, can be stored in any apparatus-readable data storage medium and they include program instructions to implement certain tasks. The program product can include one or more computer-executable components tangibly embodied in a computer- readable medium, when executed, for implementing one or more embodiments of the present application. The one or more computer-executable components can be one or more of a procedure, a function, a subprogram, a plugin, an applet, an servlet, a source file, an object, a library, a data file, a variable, a macro, a task, a process, or the like. The computer-executable components can be executable via one or more computer processors, such as a central processing unit (CPU), multiprocessor, microcontroller, digital signal processor (DSP), application specific integrated circuit (ASIC), field programmable gate array (FPGA), or other computer processors. The computer-readable medium can be a computer- readable storage medium or a computer-readable storage device. The computer-readable storage medium can be a tangible or physical computer-readable medium.
[0154] It should be apparent to those skilled in the art that the above-described embodiments of the present application can be combined in any manner, and for brevity, not all possible combinations are described above, however, any combination of the above-described features should be considered to be within the scope of the present application.
[0155] The above embodiments only express several implementation manners of the present application, and the description is relatively specific and detailed, but it should not be understood as a limitation on the scope of the present application. It should be noted that, for those skilled in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A method for local adaptive flat field correction based on pathological slides, characterized in that, The method comprises the following steps: S1, acquiring a pathological slide image, the image containing a slide, a sticker and a background unevenly illuminated area; S2, generating a mask based on a threshold method, extracting a significant area in the image and removing a background interference area including the sticker; wherein an Otsu algorithm is used to calculate a threshold value, and an area lower than the threshold value is marked as background and removed; S3, converting the pathological slide image into an HSL color space to separate out a luminance channel; wherein the conversion of the HSL color space is used to separate luminance information and color information, and only the luminance channel is processed; S4, performing overlapping block processing on the luminance channel to divide the image into MxN overlapping small areas, and calculating an average luminance value of each small area; wherein the size of the small areas after block processing is set by a user according to the resolution of the image and the luminance uniformity, and the overlapping ratio of the block processing is 5%-15%; The specific parameters of the block processing are as follows: The calculation formulae of the block numbers M and N are as follows: Wherein x and y are image pixel sizes, and γ is a uniformity parameter, 1≤γ≤2; S5, generating a luminance correction factor matrix according to the ratio of the average luminance value of each small area to the global average luminance, and expanding the luminance correction factor matrix to the original image size by a bilinear interpolation method; wherein the generation of the luminance correction factor matrix comprises: For each block area, the ratio of the average luminance to the global average luminance is calculated as the correction factor of the block area, and an interpolation method is used to generate a correction factor matrix of the whole image size; S6, performing local flat-field correction on the luminance channel based on the luminance correction factor matrix; S7, combining the corrected luminance channel with the original chroma and saturation channels to convert back to the original color space; S8, outputting the corrected pathological slide image.
2. A method for local adaptive flat field correction of pathological slides as claimed in claim 1 wherein, In the S4 step, the overlapping ratio of adjacent small blocks is 10%.
3. A local adaptive flat field correction device based on pathological slides, characterized in that, It comprises: A collection module acquires a pathological slide image, the image containing a slide, a sticker and a background unevenly illuminated area; A mask generation module generates a mask based on a threshold method, extracts a significant area in the image and removes a background interference area including the sticker; an Otsu algorithm is used to calculate a threshold value, and an area lower than the threshold value is marked as background and removed; An HSL conversion module converts the pathological slide image into an HSL color space to separate out a luminance channel; wherein the conversion of the HSL color space is used to separate luminance information and color information, and only the luminance channel is processed; An overlapping block module performs overlapping block processing on the luminance channel to divide the image into MxN overlapping small areas, and calculates an average luminance value of each small area; wherein the size of the small areas after block processing is set by a user according to the resolution of the image and the luminance uniformity, and the overlapping ratio of the block processing is 5%-15%; the specific parameters of the block processing are as follows: The calculation formulae of the block numbers M and N are as follows: Wherein x and y are image pixel sizes, and γ is a uniformity parameter, 1≤γ≤2; The correction processing module generates a brightness correction factor matrix according to the ratio of the average brightness value of each small area to the global average brightness, and expands the brightness correction factor matrix to the original image size by a bilinear interpolation method; performs local flat field correction on the brightness channel based on the brightness correction factor matrix; wherein the generation of the brightness correction factor matrix comprises: For each sub-block area, the ratio of its average brightness to the global average brightness is calculated as the correction factor of the sub-block area, and a correction factor matrix of the full image size is generated by an interpolation method; The conversion module combines the corrected brightness channel with the original chrominance and saturation channels and converts back to the original color space; The output module outputs the corrected pathological slide image. 4.An electronic device comprising a memory and a processor, the electronic device characterized by, The memory stores a computer program, and the processor is configured to run the computer program to execute the local adaptive flat field correction method based on the pathological slide according to any one of claims 1 to 2.
5. A readable storage medium characterized by, The readable storage medium stores a computer program, and the computer program includes program code for controlling a process to execute the process, and the process includes the local adaptive flat field correction method based on the pathological slide according to any one of claims 1 to 2.
Citation Information
Patent Citations
Road surface object identification method and device
CN110070009A
Image processing method and device, computer equipment and storage medium
CN116958289A
Sequence image dodging method and device and readable medium
CN117197328A
Method and system for correcting backlight brightness uniformity of mini LED display
CN117690387A