Method and apparatus for identifying sample areas in a digital slide scanner

Through gamma enhancement and image processing technology, combined with contour extraction, the problem of inaccurate sample area identification in digital slide scanners is solved, and accurate identification and efficient scanning are achieved.

CN114862727BActive Publication Date: 2025-09-23WINMEDIC TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210537180.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-17
Publication Date
2025-09-23
Estimated Expiration
2042-05-17

AI Technical Summary

Technical Problem

Existing digital slide scanners have problems with inaccurate recognition of sample areas, which leads to increased scanning time or omission of key information in invalid areas. In addition, threshold recognition is affected by the light source and the color depth of the slice, making it difficult to accurately identify the sample area.

Method used

Pre-processing methods such as gamma enhancement, grayscale processing, filtering, equalization, expansion, corrosion and cutout are used, combined with contour extraction technology to identify sample areas and remove unnecessary scanning parts to ensure scanning quality and speed.

Benefits of technology

It achieves accurate recognition of sample areas in digital slide scanners, removes cover glass and small spots, improves recognition results, and ensures scanning accuracy and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114862727B_ABST
    Figure CN114862727B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for identifying sample areas in a digital slide scanner. The method comprises the following steps: collecting an original image (ImagePreview) of a physical slice and performing gamma enhancement processing to obtain an ImageGamma; performing grayscale, filtering, equalization, dilation, erosion, and cutout preprocessing on the ImageGamma to obtain a preprocessed image (ImageGrabCut); performing segmentation processing on the ImageGrabCut to obtain an ImageFinalGray; and extracting the contours of the sample in the ImageFinalGray. If the extracted sample contour is larger than the minimum sample area and the vertical and horizontal difference values ​​of the sample contour are no greater than 20, the extracted sample contour is used as the final sample area image. The present invention can accurately identify sample areas and improve the recognition effect of sample areas in digital slide scanners.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a method and a device for identifying a sample area in a digital slice scanner, belonging to the technical field of digital slice image processing. Background Art

[0002] A digital slide scanner is a device that digitizes physical slides. The digitization process involves first photographing the slide with a preview camera, creating a preview image of the corresponding sample area. Then, based on the correspondence between the preview image and the scanner area, the scanner captures high-resolution images and stitches the images together, ultimately creating full-field digital pathology slides (WSIs).

[0003] In digital slide scanners, taking photos and previewing physical slides is an important step in forming digital pathology slides. Excessive recognition will increase many invalid areas, increase scanning time, and even cause splicing marks between digital slide images; if too little recognition is performed, key information will be missed, making it difficult to apply the digital slides later. Therefore, accurate recognition of physical slides becomes very important. Existing recognition methods mostly use image enhancement, thresholding, boundary recognition, etc.; however, due to the different color modes of physical slides, the colors of physical slides vary; and they are affected by the light source during preview, making threshold recognition more difficult; at the same time, the recognition of slice samples also requires removing the cover glass area and small spots to more accurately identify the sample area.

[0004] In order to meet the requirements of digital slide scanners for identifying sample areas, a method is needed to accurately identify the sample area of ​​the preview image in the digital slide scanner. Summary of the Invention

[0005] In order to solve the above problems, the present invention proposes a method and device for identifying sample areas in a digital slide scanner, which can accurately identify the sample areas of the slice preview image in the digital slide scanner, so as to remove unnecessary scanning parts and ensure the quality and scanning speed of the scanned digital slides.

[0006] The technical solution adopted by the present invention to solve the technical problem is:

[0007] In a first aspect, an embodiment of the present invention provides a method for identifying a sample area in a digital slide scanner, comprising the following steps:

[0008] Collect the original image ImagePreview of the entity slice, and perform gamma enhancement processing to obtain the image ImageGamma;

[0009] Perform grayscale, filtering, equalization, expansion, corrosion and cutout preprocessing on the image ImageGamma to obtain the preprocessed image ImageGrabCut;

[0010] Perform segmentation processing on the image ImageGrabCut to obtain the image ImageFinalGray;

[0011] The sample contour in the image ImageFinalGray is extracted. If the extracted sample contour is larger than the minimum sample area and the vertical and horizontal difference values ​​of the sample contour are not greater than 20, it is used as the final sample area image.

[0012] As a possible implementation of this embodiment, the collecting of the original image ImagePreview of the entity slice includes:

[0013] Set the gamma value of the preview camera to darken the preview image.

[0014] Place the entity slice into the digital slice scanner and use the preview camera to obtain the original image ImagePreview of the entity slice.

[0015] As a possible implementation of this embodiment, performing gamma enhancement processing to obtain an image ImageGamma includes:

[0016] Calculate the color mean ColorValue of the original image ImagePreview;

[0017] If ColorValue is greater than 240, set image Gamma to 5;

[0018] If ColorValue is greater than 230, set the image Gamma to 3; adjust the preview image according to Gamma to obtain the gamma-enhanced image ImageGamma.

[0019] As a possible implementation of this embodiment, performing grayscale, filtering, equalization, expansion, corrosion, and cutout preprocessing on the image ImageGamma to obtain the preprocessed image ImageGrabCut includes:

[0020] Convert the image ImageGamma to a grayscale image ImageGray;

[0021] Perform a Gaussian filter with a kernel size of KernelSize on the grayscale image ImageGray to obtain the filtered image ImageBlur;

[0022] Perform histogram equalization on the image ImageBlur to obtain the image ImageHistogram;

[0023] Perform dilation and erosion on the ImageHistogram to remove small spots and obtain the ImageEnhance image.

[0024] Overlay the ImageEnhance image with the original ImagePreview image:

[0025] ImageNewPreview=ImageEnhance+ImagePreview;

[0026] The overlay image ImageNewPreview is cut out using the cutout function grabCut to obtain a processed image ImageGrabCut.

[0027] As a possible implementation of this embodiment, the segmentation processing of the image ImageGrabCut to obtain the image ImageFinalGray includes:

[0028] Perform gamma enhancement on ImageGrabCut again to obtain the image ImageNewGamma;

[0029] Perform grayscale processing on the image ImageNewGamma to obtain the grayscale image ImageNewGray;

[0030] Perform binary segmentation processing on the grayscale image ImageNewGray to obtain the image ImageFinalGray.

[0031] As a possible implementation of this embodiment, performing binarization segmentation processing on the grayscale image ImageNewGray to obtain the image ImageFinalGray includes:

[0032] Use the OTSU method to calculate the binarization threshold Threshold of the grayscale image ImageNewGray; if the threshold Threshold is less than 80, then Threshold = Threshold + 20; if Threshold is less than 100, then Threshold = Threshold - 10; otherwise, Threshold = Threshold - 30;

[0033] Perform color segmentation on the grayscale image ImageNewGray according to the required Threshold, and perform corrosion processing on the grayscale image after segmentation to obtain the image ImageFinalGray.

[0034] As a possible implementation of this embodiment, the sample in the image ImageFinalGray is subjected to contour extraction. If the extracted sample contour is larger than the minimum sample area and the vertical and horizontal difference values ​​of the sample contour are not greater than 20, then the final sample area image is used as the final sample area image, including:

[0035] Extract the contours of the samples in the image ImageFinalGray and obtain the contour vector list vectorContours;

[0036] Set the minimum sample area to MinArea; traverse the contour vector list vectorContours and calculate the area of ​​each contour ContoursArea. If ContoursArea is smaller than MinArea, delete the current contour from vectorContours.

[0037] Continue to traverse the contour vector list vectorContours and calculate the minimum rectangle MinRect of each contour; set the vertical and horizontal difference values ​​of the cover glass to 20; if MinRect.Width / MinRect.Height>20 or MinRect.Height / MinRect.Width>20; then delete the current contour from vectorContours;

[0038] Display the contours in the contour vector list vectorContours on a blank image of the same size as the original image ImagePreview to obtain the final sample area image.

[0039] In a second aspect, an embodiment of the present invention provides a device for identifying a sample area in a digital slide scanner, comprising:

[0040] The image acquisition module is used to collect the original image ImagePreview of the entity slice and perform gamma enhancement processing to obtain the image ImageGamma;

[0041] The image preprocessing module is used to perform grayscale, filtering, equalization, expansion, corrosion and cutout preprocessing on the image ImageGamma to obtain the preprocessed image ImageGrabCut;

[0042] The image segmentation processing module is used to segment the image ImageGrabCut to obtain the image ImageFinalGray;

[0043] The contour extraction module is used to extract the contour of the sample in the image ImageFinalGray. If the extracted sample contour is larger than the minimum area of ​​the sample and the vertical and horizontal difference values ​​of the sample contour are not greater than 20, it will be used as the final sample area image.

[0044] In a third aspect, an embodiment of the present invention provides a computer device comprising a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the computer device is running, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform the steps of the method for identifying a sample area in a digital slide scanner as described above.

[0045] In a fourth aspect, an embodiment of the present invention provides a storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the method for identifying a sample area in a digital slide scanner are executed as described above.

[0046] The technical solution of the embodiment of the present invention can have the following beneficial effects:

[0047] The present invention proposes a method for identifying sample areas in a digital slide scanner. The method comprises the following steps: collecting an original image (ImagePreview) of a physical slice and performing gamma enhancement processing to obtain an image (ImageGamma); performing grayscale, filtering, equalization, dilation, erosion, and cutout preprocessing on the image (ImageGamma) to obtain a preprocessed image (ImageGrabCut); performing segmentation processing on the image (ImageGrabCut) to obtain an image (ImageFinalGray); and extracting the contours of the sample in the image (ImageFinalGray). If the extracted sample contour is larger than the minimum sample area and the vertical and horizontal differences of the sample contour are no greater than 20, the final sample area image is used. The present invention not only obtains a digital slide scanner preview image after accurate identification and removal of spots and coverslips, but also enables precise identification of sample areas by removing the coverslip area and small spots, thereby improving the recognition of sample areas in the digital slide scanner. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 is a flow chart showing a method for identifying a sample area in a digital slide scanner according to an exemplary embodiment;

[0049] Figure 2 is a structural diagram of a device for identifying a sample area in a digital slide scanner according to an exemplary embodiment;

[0050] Figure 3This is a light color slice preview image shown according to an exemplary embodiment;

[0051] Figure 4 This is a preview image of a dark color slice according to an exemplary embodiment;

[0052] Figure 5 is a schematic diagram of a gamma-enhanced image according to an exemplary embodiment;

[0053] Figure 6 is a grayscale filter image according to an exemplary embodiment;

[0054] Figure 7 A histogram is processed to remove speckles according to an exemplary embodiment;

[0055] Figure 8 is an image after cutout processing according to an exemplary embodiment;

[0056] Figure 9 A gamma-enhanced color segmentation image is shown according to an exemplary embodiment;

[0057] Figure 10 is an image showing a method of removing spots and removing a cover glass according to an exemplary embodiment;

[0058] Figure 11 is an image with different spot sizes removed according to an exemplary embodiment;

[0059] Figure 12 is a preview image of a shallower slice according to an exemplary embodiment;

[0060] Figure 13 FIG. 4 is an image after shallower slicing according to an exemplary embodiment. DETAILED DESCRIPTION

[0061] The present invention will be further described below with reference to the accompanying drawings and embodiments:

[0062] In order to clearly illustrate the technical features of this solution, the present invention is described in detail below through specific implementation methods and in conjunction with the accompanying drawings. The disclosure below provides many different embodiments or examples for realizing different structures of the present invention. In order to simplify the disclosure of the present invention, the components and settings of specific examples are described below. In addition, the present invention may repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplicity and clarity and does not itself indicate the relationship between the various embodiments and / or settings discussed. It should be noted that the components illustrated in the accompanying drawings are not necessarily drawn to scale. The present invention omits descriptions of well-known components and processing technologies and processes to avoid unnecessary limitations on the present invention.

[0063] Figure 1 FIG. 1 is a flow chart showing a method for identifying a sample area in a digital slide scanner according to an exemplary embodiment. Figure 1 As shown, an embodiment of the present invention provides a method for identifying a sample area in a digital slide scanner, comprising the following steps:

[0064] Collect the original image ImagePreview of the entity slice, and perform gamma enhancement processing to obtain the image ImageGamma;

[0065] Perform grayscale, filtering, equalization, expansion, corrosion and cutout preprocessing on the image ImageGamma to obtain the preprocessed image ImageGrabCut;

[0066] Perform segmentation processing on the image ImageGrabCut to obtain the image ImageFinalGray;

[0067] The sample contour in the image ImageFinalGray is extracted. If the extracted sample contour is larger than the minimum sample area and the vertical and horizontal difference values ​​of the sample contour are not greater than 20, it is used as the final sample area image.

[0068] As a possible implementation of this embodiment, the collecting of the original image ImagePreview of the entity slice includes:

[0069] Set the gamma value of the preview camera to darken the preview image.

[0070] Place the entity slice into the digital slice scanner and use the preview camera to obtain the original image ImagePreview of the entity slice.

[0071] As a possible implementation of this embodiment, performing gamma enhancement processing to obtain an image ImageGamma includes:

[0072] Calculate the color mean ColorValue of the original image ImagePreview;

[0073] If ColorValue is greater than 240, set image Gamma to 5;

[0074] If ColorValue is greater than 230, set the image Gamma to 3; adjust the preview image according to Gamma to obtain the gamma-enhanced image ImageGamma.

[0075] As a possible implementation of this embodiment, performing grayscale, filtering, equalization, expansion, corrosion, and cutout preprocessing on the image ImageGamma to obtain the preprocessed image ImageGrabCut includes:

[0076] Convert the image ImageGamma to a grayscale image ImageGray;

[0077] Perform a Gaussian filter with a kernel size of KernelSize on the grayscale image ImageGray to obtain the filtered image ImageBlur;

[0078] Perform histogram equalization on the image ImageBlur to obtain the image ImageHistogram;

[0079] Perform dilation and erosion on the ImageHistogram to remove small spots and obtain the ImageEnhance image.

[0080] Overlay the ImageEnhance image with the original ImagePreview image:

[0081] ImageNewPreview=ImageEnhance+ImagePreview;

[0082] The overlay image ImageNewPreview is cut out using the cutout function grabCut to obtain a processed image ImageGrabCut.

[0083] As a possible implementation of this embodiment, the segmentation processing of the image ImageGrabCut to obtain the image ImageFinalGray includes:

[0084] Perform gamma enhancement on ImageGrabCut again to obtain the image ImageNewGamma;

[0085] Perform grayscale processing on the image ImageNewGamma to obtain the grayscale image ImageNewGray;

[0086] Perform binary segmentation processing on the grayscale image ImageNewGray to obtain the image ImageFinalGray.

[0087] As a possible implementation of this embodiment, performing binarization segmentation processing on the grayscale image ImageNewGray to obtain the image ImageFinalGray includes:

[0088] Use the OTSU method to calculate the binarization threshold Threshold of the grayscale image ImageNewGray; if the threshold Threshold is less than 80, then Threshold = Threshold + 20; if Threshold is less than 100, then Threshold = Threshold - 10; otherwise, Threshold = Threshold - 30;

[0089] Perform color segmentation on the grayscale image ImageNewGray according to the required Threshold, and perform corrosion processing on the grayscale image after segmentation to obtain the image ImageFinalGray.

[0090] As a possible implementation of this embodiment, the sample in the image ImageFinalGray is subjected to contour extraction. If the extracted sample contour is larger than the minimum sample area and the vertical and horizontal difference values ​​of the sample contour are not greater than 20, then the final sample area image is used as the final sample area image, including:

[0091] Extract the contours of the samples in the image ImageFinalGray and obtain the contour vector list vectorContours;

[0092] Set the minimum sample area to MinArea; traverse the contour vector list vectorContours and calculate the area of ​​each contour ContoursArea. If ContoursArea is smaller than MinArea, delete the current contour from vectorContours.

[0093] Continue to traverse the contour vector list vectorContours and calculate the minimum rectangle MinRect of each contour; set the vertical and horizontal difference values ​​of the cover glass to 20; if MinRect.Width / MinRect.Height>20 or MinRect.Height / MinRect.Width>20; then delete the current contour from vectorContours;

[0094] Display the contours in the contour vector list vectorContours on a blank image of the same size as the original image ImagePreview to obtain the final sample area image.

[0095] like Figure 2 As shown, an embodiment of the present invention provides a device for identifying a sample area in a digital slide scanner, comprising:

[0096] The image acquisition module is used to collect the original image ImagePreview of the entity slice and perform gamma enhancement processing to obtain the image ImageGamma;

[0097] The image preprocessing module is used to perform grayscale, filtering, equalization, expansion, corrosion and cutout preprocessing on the image ImageGamma to obtain the preprocessed image ImageGrabCut;

[0098] The image segmentation processing module is used to segment the image ImageGrabCut to obtain the image ImageFinalGray;

[0099] The contour extraction module is used to extract the contour of the sample in the image ImageFinalGray. If the extracted sample contour is larger than the minimum area of ​​the sample and the vertical and horizontal difference values ​​of the sample contour are not greater than 20, it will be used as the final sample area image.

[0100] In a third aspect, an embodiment of the present invention provides a computer device comprising a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the computer device is running, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform the steps of the method for identifying a sample area in a digital slide scanner as described above.

[0101] In a fourth aspect, an embodiment of the present invention provides a storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the method for identifying a sample area in a digital slide scanner are executed as described above.

[0102] like Figure 3-13 As shown, the specific process of the present invention for performing accurate sample area recognition in a digital slide scanner is as follows.

[0103] 1. Set the gamma value of the preview camera to make the preview image darker; light colors such as Figure 3 As shown, dark staining sections are Figure 4 shown.

[0104] 2. Place the entity slice into the digital slice scanner and use the preview camera to obtain the preview image ImagePreview of the entity slice, such as Figure 4 shown.

[0105] 3. Calculate the color mean of the preview image ImagePreview ColorValue = 241.66; if ColorValue is greater than 240, set the image Gamma = 5; adjust the preview image according to Gamma to obtain the gamma-enhanced image ImageGamma, such as Figure 5 shown.

[0106] 4. Convert the enhanced image ImageGamma into a grayscale image ImageGray; perform Gaussian filtering on the grayscale image ImageGray with a kernel size of KernelSize = 5 to obtain the filtered image ImageBlur; Figure 6 shown.

[0107] 5. Perform histogram equalization on ImageBlur to obtain the image ImageHistogram; perform corresponding dilation and corrosion on the image ImageHistogram to remove small spots and obtain the image ImageEnhance; Figure 7 shown.

[0108] 6. Superimpose the ImageEnhance image with the original image ImageNewPreview = ImageEnhance + ImagePreview; use the opencv cutout function grabCut to cut out the ImageEnhance image to obtain the processed image ImageGrabCut, as shown in Figure 8 shown.

[0109] 7. Gamma enhancement is performed again on ImageGrabCut with a gamma enhancement coefficient of Gamma = 15 to obtain the image ImageNewGamma; grayscale processing is performed on ImageNewGamma to obtain the grayscale image ImageNewGray, and the binarization threshold of the preview image after processing is calculated using the OTSU method Threshold = 172; Threshold = Threshold-30 = 142; the grayscale image ImageNewGray is color segmented using inRange and then expanded with a kernel size KernelSize = 9 to obtain the image ImageFinalGray, as shown Figure 9 shown.

[0110] 8. Perform contour extraction on the samples in ImageFinalGray to obtain the contour vector list vectorContours; obtain the number of vectorContours to be 39; set the minimum sample area to MinArea = 200; traverse the contour vector list vectorContours and calculate the area ContoursArea of ​​each contour CurrentContours. If ContoursArea is smaller than MinArea, delete the current contour CurrentContours from vectorContours. After deletion, the number of vectorContours is 9.

[0111] 9. Traverse the remaining contour vector list vectorContours and calculate the minimum rectangle MinRect of each contour CurrentContours; set the vertical and horizontal difference values ​​of the coverslip to 10; if MinRect.Width / MinRect.Height>10 or MinRect.Height / MinRect.Width>10; then delete the current contour CurrentContours from vectorContours. After deletion, the number of vectorContours is 5.

[0112] 10. Draw the remaining contour vector list vectorContours onto a blank image of the same size as the original preview image ImagePreview to obtain the final preview binary image ImageFinalPreview. At this point, the digital slide scanner preview image after accurate recognition, spot removal and cover glass removal is obtained, as shown in the figure below. Figure 10 As shown in the figure, there are impurities in the final digital slide scanner preview image. This is because of the problem of the size of the removed spots. In practice, the size of the removed spots can be set as needed to obtain a better preview image. Figure 11 shown.

[0113] 11. The present invention tested the slices with lighter colors and also achieved the following results: Figure 12 and 13 The better effect shown.

[0114] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered by the scope of protection of the claims of the present invention.

Claims

1. A method for identifying a sample area in a digital slide scanner, characterized in that: The following steps are involved: Collect the original image ImagePreview of the entity slice, and perform gamma enhancement processing to obtain the image ImageGamma; Perform grayscale, filtering, equalization, expansion, corrosion and cutout preprocessing on the image ImageGamma to obtain the preprocessed image ImageGrabCut; Perform segmentation processing on the image ImageGrabCut to obtain the image ImageFinalGray; Extract the contours of the samples in the ImageFinalGray image. If the extracted sample contour is larger than the minimum sample area and the vertical and horizontal difference values ​​of the sample contour are not greater than 20, it will be used as the final sample area image. The performing of gamma enhancement processing to obtain an image ImageGamma includes: Calculate the color mean ColorValue of the original image ImagePreview; If ColorValue is greater than 240, set image Gamma=5; If ColorValue is greater than 230 and less than or equal to 240, set the image Gamma to 3; adjust the preview image according to Gamma to obtain the gamma-enhanced image ImageGamma; The sample in the image ImageFinalGray is subjected to contour extraction. If the extracted sample contour is larger than the minimum sample area and the vertical and horizontal difference values ​​of the sample contour are not greater than 20, then the final sample area image is used, including: Extract the contours of the samples in the image ImageFinalGray and obtain the contour vector list vectorContours; Set the minimum sample area to MinArea; traverse the contour vector list vectorContours and calculate the area of ​​each contour ContoursArea. If ContoursArea is smaller than MinArea, delete the current contour from vectorContours. Continue traversing the contour vector list vectorContours and calculating the minimum rectangle MinRect for each contour. Set the vertical and horizontal difference values ​​of the coverslip to 20. If MinRect.Width / MinRect.Height > 20 or MinRect. Height / MinRect.Width > 20, delete the current contour from vectorContours. Display the contours in the contour vector list vectorContours on a blank image of the same size as the original image ImagePreview to obtain the final sample area image; The image ImageGamma is preprocessed by grayscale, filtering, equalization, expansion, corrosion and cutout to obtain the preprocessed image ImageGrabCut, including: Convert the image ImageGamma to a grayscale image ImageGray; Perform a Gaussian filter with a kernel size of KernelSize on the grayscale image ImageGray to obtain the filtered image ImageBlur; Perform histogram equalization on the image ImageBlur to obtain the image ImageHistogram; Perform dilation and erosion on the ImageHistogram to remove small spots and obtain the ImageEnhance image. Overlay the ImageEnhance image with the original ImagePreview image: ImageNewPreview=ImageEnhance+ImagePreview; The overlay image ImageNewPreview is cut out using the cutout function grabCut to obtain a processed image ImageGrabCut.

2. The method for identifying a sample area in a digital slide scanner according to claim 1, wherein: The original image ImagePreview of the acquired entity slice includes: Set the gamma value of the preview camera to darken the preview image. Place the entity slice into the digital slice scanner and use the preview camera to obtain the original image ImagePreview of the entity slice.

3. The method for identifying a sample area in a digital slide scanner according to claim 1, wherein: The segmentation process of the image ImageGrabCut to obtain the image ImageFinalGray includes: Perform gamma enhancement on ImageGrabCut again to obtain the image ImageNewGamma; Perform grayscale processing on the image ImageNewGamma to obtain the grayscale image ImageNewGray; Perform binary segmentation processing on the grayscale image ImageNewGray to obtain the image ImageFinalGray.

4. The method for identifying a sample area in a digital slide scanner according to claim 3, wherein: The binary segmentation process is performed on the grayscale image ImageNewGray to obtain the image ImageFinalGray, including: Use the OTSU method to calculate the binarization threshold Threshold of the grayscale image ImageNewGray; if the threshold Threshold is less than 80, then Threshold = Threshold + 20; if Threshold is greater than or equal to 80 and less than 100, then Threshold = Threshold - 10; if Threshold is greater than or equal to 100, then Threshold = Threshold - 30; Perform color segmentation on the grayscale image ImageNewGray according to the required Threshold, and perform corrosion processing on the segmented grayscale image to obtain the image ImageFinalGray.

5. A device for identifying a sample area in a digital slide scanner, characterized in that: include: The image acquisition module is used to collect the original image ImagePreview of the entity slice and perform gamma enhancement processing to obtain the image ImageGamma; The image preprocessing module is used to perform grayscale, filtering, equalization, expansion, corrosion and cutout preprocessing on the image ImageGamma to obtain the preprocessed image ImageGrabCut; The image segmentation processing module is used to segment the image ImageGrabCut to obtain the image ImageFinalGray; The contour extraction module is used to extract the contour of the sample in the image ImageFinalGray. If the extracted sample contour is larger than the minimum sample area and the vertical and horizontal difference values ​​of the sample contour are not greater than 20, it will be used as the final sample area image; The performing of gamma enhancement processing to obtain an image ImageGamma includes: Calculate the color mean ColorValue of the original image ImagePreview; If ColorValue is greater than 240, set image Gamma=5; If ColorValue is greater than 230 and less than or equal to 240, set the image Gamma to 3; adjust the preview image according to Gamma to obtain the gamma-enhanced image ImageGamma; The sample in the image ImageFinalGray is subjected to contour extraction. If the extracted sample contour is larger than the minimum sample area and the vertical and horizontal difference values ​​of the sample contour are not greater than 20, then the final sample area image is used, including: Extract the contours of the samples in the image ImageFinalGray and obtain the contour vector list vectorContours; Set the minimum sample area to MinArea; traverse the contour vector list vectorContours and calculate the area of ​​each contour ContoursArea. If ContoursArea is smaller than MinArea, delete the current contour from vectorContours. Continue traversing the contour vector list vectorContours and calculating the minimum rectangle MinRect for each contour. Set the vertical and horizontal difference values ​​of the coverslip to 20. If MinRect.Width / MinRect.Height > 20 or MinRect. Height / MinRect.Width > 20, delete the current contour from vectorContours. Display the contours in the contour vector list vectorContours on a blank image of the same size as the original image ImagePreview to obtain the final sample area image; The image ImageGamma is preprocessed by grayscale, filtering, equalization, expansion, corrosion and cutout to obtain the preprocessed image ImageGrabCut, including: Convert the image ImageGamma to a grayscale image ImageGray; Perform a Gaussian filter with a kernel size of KernelSize on the grayscale image ImageGray to obtain the filtered image ImageBlur; Perform histogram equalization on the image ImageBlur to obtain the image ImageHistogram; Perform dilation and erosion on the ImageHistogram to remove small spots and obtain the ImageEnhance image. Overlay the ImageEnhance image with the original ImagePreview image: ImageNewPreview=ImageEnhance+ImagePreview; The overlay image ImageNewPreview is cut out using the cutout function grabCut to obtain a processed image ImageGrabCut.

6. A computer device, characterized in that: The computer device comprises a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the computer device is running, the processor and the memory communicate with each other via the bus, and the processor executes the machine-readable instructions to perform the steps of the method for identifying a sample area in a digital slide scanner as described in any one of claims 1 to 4.

7. A storage medium, characterized in that: The storage medium stores a computer program, which, when executed by a processor, executes the steps of the method for identifying a sample area in a digital slide scanner according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Mould image recognizing method and device thereof

    CN107480662A