Local adaptive flat field correction method and device based on pathological slide and readable storage medium thereof
Through local adaptive chunking processing and independent correction of HSL color space brightness channel, the brightness correction factor is dynamically calculated, which solves the problem of local brightness differences in pathological slide images, and achieves image uniformity improvement and detail retention.
Patent Information
- Application Number
- CN202510326470.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-19
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2045-03-19
AI Technical Summary
The prior art cannot effectively adapt to the complex local brightness differences in pathological slide images, resulting in insufficient uniformity of the image and loss of details after correction, affecting the accuracy of subsequent analysis.
Through local adaptive blocking processing, combined with mask generation and independent correction of HSL color space brightness channel, the brightness correction factors of each region are dynamically calculated to achieve accurate local brightness adjustment of pathological slide images.
Effectively remove uneven background interference, preserve image details, improve correction accuracy and image uniformity, and avoid over-correction or loss of details of global correction.
Smart Images

Figure CN119850500A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of medical image processing, and in particular to a local adaptive flat field correction method and device based on pathological slides and a readable storage medium thereof. Background Art
[0002] Existing flat-field correction methods are usually based on a global correction strategy, which requires taking a blank slide as a reference in advance and performing correction by calculating the global brightness difference. Figure 1 As shown in the figure, the glass background, stickers and uneven lighting often cause the brightness of the image edge or near the label to be significantly lower than the central area, and the sticker reflection may cause local overbrightness. Since global correction cannot dynamically adjust the local brightness differences in different areas, it is easy to lose details in the effective area or over-correction problems after correction (such as Figure 3 In addition, the photographed position of the blank slide is difficult to be completely consistent with the actual slide, which further reduces the correction effect. Summary of the invention
[0003] The embodiments of the present invention provide a local adaptive flat-field correction method and device based on pathology slides and a readable storage medium thereof, which address the problems that the current technology cannot adapt to the complex local brightness differences in pathology slide images (such as sticker interference and edge darkening), resulting in insufficient uniformity and loss of details in the corrected image, affecting the accuracy of subsequent analysis, etc.
[0004] The core technology of the present invention is mainly to realize the precise adjustment of the local brightness of the pathological slide image through local adaptive block processing, combined with mask generation and independent correction of the brightness channel of the HSL color space, and dynamically calculate the brightness correction factor of each area, so as to effectively remove the uneven background interference and retain the image details.
[0005] In a first aspect, the present invention provides a local adaptive flat field correction method based on a pathological slide, the method comprising the following steps: S1, obtaining a pathological slide image, the image including the slide, sticker, and background uneven illumination area; S2, generate a mask based on the threshold method to extract the salient areas in the image and remove the background interference areas including stickers; S3, converting the pathological slide image into HSL color space and separating the brightness channel; S4, performing overlapping block processing on the brightness channel, dividing the image into M×N overlapping small areas, and calculating the average brightness value of each small area; 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; S6, performing local flat field correction on the brightness channel based on the brightness correction factor matrix; S7, merging the corrected brightness channel with the original chroma and saturation channels, and converting back to the original color space; S8. Output the corrected pathological slide image.
[0006] Furthermore, in step S2, generating a mask based on a threshold method includes the following steps: The Otsu algorithm is used to calculate the threshold, and the area below the threshold is marked as background and removed.
[0007] Furthermore, in step S4, the size of the small area of the block is set by the user according to the image resolution and brightness uniformity, and the overlap ratio of the blocks is 5% to 15%.
[0008] Furthermore, in step S4, the specific parameters of the block processing are: The calculation formulas for the number of blocks M and N are as follows:
[0009]
[0010] Where x and y are the image pixel sizes, γ is the uniformity parameter, 1≤γ≤2; The overlap rate of adjacent patches is 10%.
[0011] Furthermore, in step S5, the generation of the brightness correction factor matrix includes: 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 the correction factor matrix of the full image size is generated by interpolation method.
[0012] Furthermore, in step S5, the interpolation method is bilinear interpolation.
[0013] Furthermore, the conversion of the HSL color space in step S3 is used to separate the brightness information from the color information, and only the brightness channel is processed.
[0014] In a second aspect, the present invention provides a local adaptive flat field correction device based on a pathological slide, comprising: The acquisition module obtains the pathological slide image, which includes the slide, sticker and background area with uneven lighting; The mask generation module generates masks based on the threshold method to extract the salient areas in the image and remove the background interference areas including stickers; HSL conversion module, which converts the pathological slide image into HSL color space and separates the brightness channel; The overlapping block module performs overlapping block processing on the brightness channel, divides the image into M×N overlapping small areas, and calculates the average brightness value of each small area; 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 through the interpolation method; and performs local flat field correction on the brightness channel based on the brightness correction factor matrix; The conversion module combines the corrected brightness channel with the original chroma and saturation channels and converts them back to the original color space; Output module, outputs the corrected pathology slide image.
[0015] In a third aspect, the present invention provides 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 the above-mentioned local adaptive flat-field correction method based on pathological slides.
[0016] In a fourth aspect, the present invention provides a readable storage medium, in which a computer program is stored. The computer program includes a 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 pathological slides.
[0017] The main contributions and innovations of the present invention are as follows: 1. Local adaptive correction: Through overlapping block processing and dynamically generated brightness correction factor matrix, precise adjustments are made to the local area differences of the image, overcoming the defects of global correction such as poor adaptability to complex backgrounds (such as stickers and edge reflections) and easy loss of details.
[0018] 2. Improve image uniformity: Combining interpolation expansion with smooth transition technology eliminates artifacts caused by block boundary jumps in traditional methods, ensuring that the brightness distribution of the corrected image is smooth and consistent.
[0019] 3. Flexibility and robustness: The block size, overlap ratio and uniformity parameters are adjustable to adapt to pathological slides with different resolutions and uneven brightness distribution, avoiding the limitations of relying on blank slide templates.
[0020] 4. Efficiency and practicality: Only separate brightness channels are processed, retaining the original chromaticity and saturation information, reducing computational complexity, and meeting the color fidelity requirements of medical image analysis.
[0021] 5. Application scalability: The method can be extended to various medical image processing scenarios with local uneven brightness, such as microscope images and tissue section images, and has wide applicability.
[0022] The details of one or more embodiments of the invention are set forth in the following drawings and description so that other features, objects, and advantages of the invention are more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings: Figure 1 is the collected image; Figure 2 is an image output after being processed by the local adaptive flat field correction method based on the pathological slide according to an embodiment of the present invention; Figure 3 It is the existing technology Figure 1 Schematic diagram of processing brightness differences; Figure 4 is a schematic diagram of using the Otsu algorithm to remove irrelevant areas according to an embodiment of the present invention; Figure 5 is a schematic diagram of converting BGR to HSL according to an embodiment of the present invention; Figure 6 is a schematic diagram of an L channel of HSL according to an embodiment of the present invention; Figure 7 is a schematic diagram of interpolation to the original image size according to an embodiment of the present invention; Figure 8 According to an embodiment of the present invention Figure 7 Schematic diagram after flat field correction; Fig. 9 is an HSL schematic diagram obtained after processing according to an embodiment of the present invention; Fig.10 is a flow chart of a local adaptive flat field correction method based on a pathological slide according to an embodiment of the present invention; Fig.11 4 is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0024] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in 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 this specification. Instead, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
[0025] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.
[0026] The existing global flat-field correction method cannot dynamically process local brightness differences, which leads to a decrease in image quality under complex background interference, affecting subsequent analysis and diagnosis.
[0027] Based on this, the present invention solves the problems existing in the prior art based on new image processing technology.
[0028] Embodiment 1 The present invention aims to propose a local adaptive flat-field correction method based on pathology slides. Through local adaptive block processing, the brightness correction factor of each area is dynamically calculated and adjusted. Combined with the overlapping block smooth transition technology, the background interference in the pathology slide image can be effectively eliminated while retaining the details, significantly improving the correction accuracy and image uniformity.
[0029] Specifically, the embodiment of the present invention provides a local adaptive flat field correction method based on a pathological slide, specifically, referring to Fig.10 , the method comprising: Step S1: Image acquisition and preprocessing Pathology slide images are collected by a pathology slide scanner or microscope (resolution ≥ 2000 × 2000 pixels, the specific resolution is adjusted according to the device model). The image includes the slide body, edge stickers, and non-uniform lighting background (such as Figure 1 ). Perform Gaussian filtering (σ=1.5) on the image to reduce noise interference in subsequent processing.
[0030] Step S2: Background interference area removal The Otsu algorithm is used to perform adaptive threshold segmentation on the image grayscale histogram and calculate the optimal threshold T; the area with grayscale value lower than T (such as stickers, background outside the slide) is marked as a mask, and its pixel value is set to zero, such as Figure 4 .
[0031] For example, use Python to binarize an image into foreground (salient area) and background (sticker, dark area): import cv2 gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) _, mask = cv2.threshold(gray, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU) The mask optimization operation can perform morphological closing operations (such as a 5×5 convolution kernel) on the binarization results to eliminate noise and close tiny holes.
[0032] Step S3: HSL color space conversion and brightness separation Convert the BGR image (because Python reads RGB images in the order of 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.
[0033] Python implementation: hsl = cv2.cvtColor(image, cv2.COLOR_BGR2HLS) l_channel = hsl[:, :, 1]# Extract brightness channel In this way, the brightness channel is processed independently to avoid the interference of color information on brightness correction, such as Figure 5 and Figure 6 .
[0034] Step S4: Overlapping block processing and brightness statistics The L channel is divided into M×N overlapping blocks, the block size is set to 64×64 pixels, the overlap ratio is 10% (i.e. adjacent blocks overlap by 6 pixels), and the uniformity parameter γ is 1.5.
[0035] According to the image size (for example, x=2048, y=2048), calculate the number of blocks:
[0036] For each block area B i,j Calculate the average brightness value µ i,j :
[0037] Among them, K is the number of valid pixels in the block (pixels after removing the mask area).
[0038] In this embodiment, overlapping block processing and brightness statistics can also be performed using the following calculation method:
[0039]
[0040] Among them, 10 represents the scaling ratio, for example, the block size is set to 10×10 pixels; x and y are the image pixel sizes, γ is the uniformity parameter, 1≤γ≤2; for example, for a 2048×2048 pixel image, when γ=1, M=N=204.8, rounded to 205×205 blocks. The overlap rate of adjacent blocks is 10% (if the block size is 10×10 pixels, the adjacent blocks overlap by 1 pixel) to ensure smooth transition of the boundaries. When there are many areas with sudden changes in image brightness (such as the edge of a sticker), the overlap rate can be increased to 15% to enhance the smoothness of the transition.
[0041] Traverse each small block and calculate the average brightness value:
[0042] Among them, w and h are block sizes, is the brightness value of the pixels in the block.
[0043] Preferably, the γ parameter is selected as: High image uniformity (such as a solid color background): γ=2, smaller blocks (such as 100×100 pixels), improving correction precision.
[0044] Complex images (such as multi-label interference): γ = 1, larger blocks (such as 200 × 200 pixels) to reduce the amount of computation.
[0045] Preferably, a gradient-based dynamic block division (such as Canny edge detection and subsequent division) can be used to further improve the correction accuracy. For example, the previous fixed block division method may cause boundary artifacts or over-smoothing when the image complexity is high. The present invention can be further optimized to a gradient-based dynamic block division, and the specific steps are as follows: 1. Canny edge detection: Use the Canny algorithm to extract image edges and identify significant structures (such as cell nucleus boundaries and tissue texture): edges = cv2.Canny(l_channel, threshold1=30, threshold2=100) 2. Dynamic block division: Adaptively adjust the block size according to edge density: Use smaller blocks (such as 50×50 pixels) in edge-dense areas (such as cell clusters), and use larger blocks (such as 200×200 pixels) in smooth areas (such as blank backgrounds). Align the block boundaries with the main edges to avoid dividing the same structure into different blocks.
[0046] Compared with the previous fixed-block method, it can reduce over-smoothing in texture areas, preserve image details, and can also be combined with the previous fixed-block method to achieve local adjustment.
[0047] Step S5: Brightness correction factor generation and interpolation expansion Calculate the global average brightness
[0048] Generate correction factors for each block , construct the initial correction factor matrix.
[0049] For dark areas (areas where the average brightness of small blocks is less than the global average brightness), the correction factor is greater than 1, which means brightening; for bright areas (areas where the average brightness of small blocks is greater than the global average brightness), the correction factor is less than 1, which means darkening. like Figure 7 ,by Figure 4 As a mask, Figure 6 After generating the brightness correction factor for the L channel, bilinear interpolation is used to convert the sparse C i,j The matrix is expanded to the original image size, or implemented in Python: import numpy as np correction_matrix = cv2.resize(factor_map, (x, y), interpolation=cv2.INTER_LINEAR) Step S6: Local flat field correction and image reconstruction like Figure 8 As shown, Figure 7 The brightness values exceeding 255 are saturated and truncated (i.e. L≤255) to obtain the brightness L corrected ; like Fig. 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 the details of the image, providing a more accurate basis for image analysis.
[0050] Implementation in Python: hsl[:, :, 1] = L_corrected result = cv2.cvtColor(hsl, cv2.COLOR_HLS2BGR) Preferably, a local contrast enhancement (CLAHE) algorithm can also be combined to optimize contrast while correcting brightness. For example: 1.CLAHE parameter settings: clahe = cv2.createCLAHE(clipLimit=2.0, tileGridSize=(8,8)) clahe_l = clahe.apply(l_channel) 2. Joint correction formula:
[0051] Among them, clahe_gain and clahe_offset are calculated by the gain matrix and offset matrix output by CLAHE, L final is the brightness value after joint correction. In this way, the brightness correction factor matrix solves the global inhomogeneity, and CLAHE enhances the local contrast (such as the distinction between the nucleus and the cytoplasm).
[0052] In this embodiment, technical terms are explained as follows: Flat-field Correction: An image preprocessing technique that makes the background brightness uniform by compensating for uneven illumination in the image.
[0053] HSL color space: A color model consisting of three components: hue, saturation, and lightness, which can separate brightness information for independent processing.
[0054] Otsu algorithm: An adaptive threshold segmentation method based on maximum inter-class variance, used to distinguish foreground and background areas.
[0055] Bilinear Interpolation: An interpolation algorithm that uses the weighted average of adjacent pixels to perform image scaling or smooth transitions.
[0056] Canny edge detection: It realizes edge extraction through Gaussian filtering, gradient calculation, non-maximum suppression and dual threshold detection. It is a commonly used edge detection algorithm in industrial detection.
[0057] CLAHE: By limiting the contrast gain (clip limit) of local histogram equalization, over-enhancement of noise is avoided, which is particularly suitable for contrast optimization of medical images.
[0058] Embodiment 2 Based on the same concept, the present invention also proposes a local adaptive flat field correction device based on a pathological slide, comprising: The acquisition module obtains the pathological slide image, which includes the slide, sticker and background area with uneven lighting; The mask generation module generates masks based on the threshold method to extract the salient areas in the image and remove the background interference areas including stickers; HSL conversion module, which converts the pathological slide image into HSL color space and separates the brightness channel; The overlapping block module performs overlapping block processing on the brightness channel, divides the image into M×N overlapping small areas, and calculates the average brightness value of each small area; 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 through the interpolation method; and performs local flat field correction on the brightness channel based on the brightness correction factor matrix; The conversion module combines the corrected brightness channel with the original chroma and saturation channels and converts them back to the original color space; Output module, outputs the corrected pathology slide image.
[0059] In this embodiment, the acquisition module integrates a microscope camera and an image acquisition card, and supports 16-bit RAW format image input.
[0060] Mask generation module: Parallel calculation of Otsu algorithm is implemented based on FPGA, with a processing speed of ≤10ms / frame.
[0061] Overlapping block module: GPU is used to accelerate block division and brightness statistics, and support dynamic adjustment of block parameters (such as γ=1~2).
[0062] Correction processing module: A bilinear interpolation hardware unit (such as ASIC) is used to implement real-time correction factor expansion.
[0063] Embodiment 3 This embodiment also provides an electronic device, referring to Fig.11 , comprises 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 execute the steps in any of the above method embodiments.
[0064] Specifically, the processor 402 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiment of the present invention.
[0065] Among them, the memory 404 may include a large capacity memory 404 for data or instructions. For example, but not limitation, the memory 404 may include a hard disk drive (HDD), a floppy disk drive, a solid state drive (SSD), a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 404 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 404 may be inside or outside the data processing device. In a specific embodiment, the memory 404 is a non-volatile memory. In a specific embodiment, the memory 404 includes a read-only memory (ROM) and a random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically alterable ROM (EAROM) or a flash memory (FLASH), or a combination of two or more of these. In appropriate circumstances, the RAM may be a static random access memory (SRAM) or a dynamic random access memory (DRAM), wherein the DRAM may be a fast page mode dynamic random access memory 404 (FPMDRAM), an extended data output dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.
[0066] The memory 404 may be used to store or cache various data files required for processing and / or communication, as well as possible computer program instructions executed by the processor 402 .
[0067] The processor 402 reads and executes the computer program instructions stored in the memory 404 to implement any one of the local adaptive flat-field correction methods based on pathological slides in the above embodiments.
[0068] 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 .
[0069] The transmission device 406 can be used to receive or send data via a network. Specific examples of the above-mentioned network may 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 (Network Interface Controller, referred to as 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 (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0070] Input / output devices 408 are used to input or output information.
[0071] Embodiment 4 This embodiment also provides a readable storage medium, in which a computer program is stored. The computer program includes a program code for controlling a process to execute the process. The process includes the local adaptive flat field correction method based on pathological slides according to the first embodiment.
[0072] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0073] In general, various embodiments may be implemented in hardware or dedicated circuits, software, logic, or any combination thereof. Some aspects of the invention may be implemented in hardware, while other aspects may be implemented in 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, flow charts, or using some other graphical representation, it should be understood that, as non-limiting examples, the boxes, devices, systems, techniques, or methods described herein may be implemented in hardware, software, firmware, dedicated circuits or logic, general-purpose hardware or controllers or other computing devices, or some combination thereof.
[0074] Embodiments of the present invention can be implemented by computer software, which is executable by a data processor of a mobile device, such as in a processor entity, or implemented by hardware, or implemented 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. Computer program products can include one or more computer executable components configured to perform embodiments when the program is running. One or more computer executable components can be at least one software code or a part thereof. In addition, at this point, it should be noted that any box of the logic flow in the figure 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 in physical media such as memory chips or storage blocks implemented in processors, magnetic media such as hard disks or floppy disks, and optical media such as, for example, DVDs and data variants thereof, CDs. Physical media are non-transient media.
[0075] Those skilled in the art should understand that the technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are 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.
[0076] The above embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present invention. It should be pointed out that, for those of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the attached claims.
Claims
1. A local adaptive flat field correction method based on pathological slides, characterized in that: The following steps are involved: S1, obtaining a pathological slide image, wherein the image includes the slide, the sticker, and the background uneven illumination area; S2, generate a mask based on the threshold method to extract the salient areas in the image and remove the background interference areas including stickers; S3, converting the pathological slide image into an HSL color space and separating a brightness channel; S4, performing overlapping block processing on the brightness channel, dividing the image into M×N overlapping small areas, and calculating the average brightness value of each small area; 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; S6, performing local flat field correction on the brightness channel based on the brightness correction factor matrix; S7, merging the corrected brightness channel with the original chroma and saturation channels, and converting back to the original color space; S8. Output the corrected pathological slide image.
2. A local adaptive flat field correction method based on pathological slides as claimed in claim 1, characterized in that: In step S2, generating a mask based on a threshold method includes the following steps: The Otsu algorithm is used to calculate the threshold, and the area below the threshold is marked as background and removed.
3. A local adaptive flat field correction method based on pathological slides as claimed in claim 1, characterized in that: In step S4, the size of the small area of the block is set by the user according to the image resolution and brightness uniformity, and the overlap ratio of the blocks is 5% to 15%.
4. A local adaptive flat field correction method based on pathological slides as claimed in claim 3, characterized in that: In step S4, the specific parameters of the block processing are: The calculation formulas for the number of blocks M and N are as follows: ; ; Where x and y are the image pixel sizes, γ is the uniformity parameter, 1≤γ≤2; The overlap rate of adjacent patches is 10%.
5. A local adaptive flat field correction method based on pathological slides as claimed in claim 1, characterized in that: In step S5, the generation of the brightness correction factor matrix includes: 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 the correction factor matrix of the full image size is generated by interpolation method.
6. A local adaptive flat field correction method based on pathological slides as claimed in claim 1, characterized in that: In step S5, the interpolation method is bilinear interpolation.
7. A local adaptive flat field correction method based on pathological slides as claimed in any one of claims 1 to 6, characterized in that: The conversion of the HSL color space in step S3 is used to separate the brightness information from the color information, and only the brightness channel is processed.
8. A local adaptive flat field correction device based on pathological slides, characterized in that: include: The acquisition module obtains the pathological slide image, which includes the slide, sticker and background area with uneven lighting; The mask generation module generates masks based on the threshold method to extract the salient areas in the image and remove the background interference areas including stickers; HSL conversion module, which converts the pathological slide image into HSL color space and separates the brightness channel; The overlapping block module performs overlapping block processing on the brightness channel, divides the image into M×N overlapping small areas, and calculates the average brightness value of each small area; 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 through the interpolation method; and performs local flat field correction on the brightness channel based on the brightness correction factor matrix; The conversion module combines the corrected brightness channel with the original chroma and saturation channels and converts them back to the original color space; Output module, outputs the corrected pathology slide image.
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 execute the local adaptive flat-field correction method based on pathological slides according to any one of claims 1 to 7.
10. A readable storage medium, characterized in that: The readable storage medium stores a computer program, wherein the computer program includes a program code for controlling a process to execute a process, wherein the process includes the local adaptive flat-field correction method based on a pathological slide according to any one of claims 1 to 7.
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