Medical image processing method, image processing method, medical image processing device, image processing device, computer device, and program

By generating differential images and performing binarization processing, the problem of color information loss of WSI images is solved, and the accuracy of extraction of pathological tissue areas and the effect of subsequent image analysis is improved.

JP7628536B2Active Publication Date: 2025-02-10TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
JP2022524010
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2020-02-10
Filing Date
2020-11-03
Publication Date
2025-02-10
Estimated Expiration
2040-11-03

AI Technical Summary

Technical Problem

When the prior art converts WSI images into grayscale images, color information is lost, resulting in inaccurate extraction of pathological tissue areas, affecting the accuracy of subsequent image analysis.

Method used

By using the color information of different color channels to generate a difference-value image and perform binarization processing, the pathological tissue area is extracted.

Benefits of technology

Effectively utilize color information to improve the extraction accuracy of pathological tissue areas and improve the effect of subsequent image analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007628536000002
    Figure 0007628536000002
  • Figure 0007628536000003
    Figure 0007628536000003
  • Figure 0007628536000004
    Figure 0007628536000004
Patent Text Reader

Abstract

This application discloses a medical image processing method, an image processing method, and an image processing apparatus applicable to the field of artificial intelligence. The method includes the steps of acquiring a medical image to be processed, generating a difference image based on first image data, second image data, and third image data included in the medical image to be processed, and performing a binarization process on the difference image to obtain a binarized image, where the foreground region of the binarized image corresponds to the pathological tissue region of the medical image to be processed. By generating the difference image using color information from different channels prior to performing the binarization process on the image, the color information in the image can be effectively utilized, and the pathological tissue region extracted based on the difference image can be more accurate and have a positive impact on subsequent image analysis.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] This application claims priority based on a Chinese patent application filed with the China Patent Office on February 10, 2020, bearing application number 202010084678.8 and titled "Medical image processing method, image processing method and apparatus," the entire contents of which are incorporated herein by reference.

[0002] This application relates to the field of artificial intelligence, and specifically to image processing techniques. [Background technology]

[0003] With the development of medical technology, identification and analysis based on Whole Slide Image (WSI) images play an important role in medical treatment. Because the side length of a WSI image is generally tens of thousands of pixels, such images need to be reduced or divided into smaller images for analysis, and in this process, most of the background area of ​​the WSI image needs to be removed to obtain the area with the pathological tissue slide for subsequent image analysis.

[0004] Currently, the main method for extracting pathological tissue regions from WSI images involves reducing the WSI image to a certain scale and then converting it to a grayscale image, and then performing further processing on the grayscale image, such as image binarization and cavity removal, and finally extracting the pathological tissue regions from the processed image.

[0005] However, if the color image is directly converted to a grayscale image after the scale conversion as in the above method, color information may be lost. Since color information is also an important image feature, the extracted pathological tissue area may not be accurate enough, which may cause variation in subsequent image analysis. Summary of the Invention [Problem to be solved by the invention]

[0006] The present application provides a medical image processing method, an image processing method and an image processing apparatus that effectively utilize the color information in an image by generating a difference image using color information of different channels prior to performing binarization processing on the image, so that the pathological tissue area extracted based on the difference image is more accurate and has a positive impact on subsequent image analysis. [Means for solving the problem]

[0007] In view of the above-mentioned problems, according to a first aspect of the present application, there is provided a medical image processing method executed by a server, comprising: A step of acquiring a medical image to be processed, the medical image to be processed being a color image, and the medical image to be processed includes first image data, second image data, and third image data, the first image data, the second image data, and the third image data being different. channel corresponding to the color information in each step; generating a difference image based on the first image data, the second image data, and the third image data; The present invention provides a medical image processing method including the step of performing a binarization process on the difference image to obtain a binary image, the foreground region of which corresponds to a pathological tissue region of the medical image to be processed.

[0008] According to a second aspect of the present application, there is provided an image processing method executed by a server, comprising: acquiring a first processing target image and a second processing target image, the first processing target image being a color image and including first image data, second image data and third image data, the first image data, the second image data and the third image data corresponding to color information in different channels, respectively; generating a difference image based on the first image data, the second image data, and the third image data; performing a binarization process on the difference image to obtain a binarized image, the foreground region of the binarized image corresponding to the pathological tissue region of the medical image to be processed; extracting a pathological tissue region from the first processing target image based on a foreground region of the binarized image; The present invention provides an image processing method including the step of generating a composite image based on a pathological tissue region and a second processing target image, wherein the pathological tissue region is located on a first layer, the second processing target image is located on a second layer, and the first layer is overlaid on the second layer.

[0009] According to a third aspect of the present application, An acquisition module for acquiring a medical image to be processed, the medical image to be processed being a color image, and the medical image to be processed includes first image data, second image data, and third image data, the first image data, the second image data, and the third image data respectively corresponding to color information in different channels; a generation module for generating a difference image based on the first image data, the second image data, and the third image data; The present invention provides a medical image processing apparatus including: a processing module for performing binarization processing on a difference image to obtain a binary image, wherein a foreground region of the binary image corresponds to a pathological tissue region of the medical image to be processed.

[0010] In one possible design, in one embodiment of the third aspect of the present invention, The generating module generates a maximum value image and a minimum value image based on the first image data, the second image data, and the third image data included in the medical image to be processed; A difference image is generated based on the maximum value image and the minimum value image.

[0011] In one possible design, in another embodiment of the third aspect of the present invention, Specifically, the generating module determines a maximum pixel value and a minimum pixel value based on a first pixel value at a first pixel position in the first image data, a second pixel value at a second pixel position in the second image data, and a third pixel value at a third pixel position in the third image data; This is for obtaining a maximum value image based on a maximum pixel value and a minimum value image based on a minimum pixel value, where the pixel value of the fourth pixel position in the maximum value image is the maximum pixel value, the pixel value of the fifth pixel position in the minimum value image is the minimum pixel value, and the first pixel position, the second pixel position, the third pixel position, the fourth pixel position, and the fifth pixel position all correspond to the positions of the same pixel point in the medical image to be processed.

[0012] The generating module specifically determines a pixel difference value according to a pixel value at a fourth pixel position in the maximum value image and a pixel value at a fifth pixel position in the minimum value image; The purpose is to obtain a difference image based on a pixel difference value, where the pixel value of a sixth pixel position in the difference image is the pixel difference value, and the fourth pixel position, the fifth pixel position and the sixth pixel position all correspond to the position of the same pixel point in the medical image to be processed.

[0013] In one possible design, in another embodiment of the third aspect of the present invention, The generation module specifically generates a processing target difference image based on the first image data, the second image data, and the third image data; This is for obtaining a difference image by performing Gaussian blurring on the difference image to be processed.

[0014] In one possible design, in another embodiment of the third aspect of the present application, the medical image processing device further includes a determination module: The determination module is for determining a binarization threshold based on the difference image; The determining module is for further performing a binarization process on the difference image based on the binarization threshold to obtain a binarized image.

[0015] In one possible design, in another embodiment of the third aspect of the present invention, The determining module specifically obtains N pixel values ​​corresponding to the N pixel points according to the difference image, where the pixel values ​​and the pixel points have a one-to-one corresponding relationship, and N is an integer greater than 1; determining a reference pixel value from the N pixel values, where the reference pixel value is a maximum value of the N pixel values; This is for determining a binarization threshold based on the reference pixel value and a preset ratio.

[0016] In one possible design, in another embodiment of the third aspect of the present invention, The generating module specifically uses a flood-fill algorithm to detect a background region in the binarized image, where the background region includes a plurality of background pixel points; Obtain background pixel points in a foreground region in the binarized image based on the binarized image and a background region in the binarized image, where the foreground region includes a plurality of foreground pixel points; The background pixel points in the foreground region of the binarized image are changed to foreground pixel points to obtain a cavity-filled image; A median filter process is performed on the cavity-filled image to obtain a resultant image, the foreground region of the resultant image corresponding to the pathological tissue region of the medical image to be processed.

[0017] In one possible design, in another embodiment of the third aspect of the present invention, The processing module specifically performs a median filtering process on the cavity-filled image to obtain a filtered image; Obtain a boundary line of a foreground region in the filtered image, where the boundary line includes M pixel points, where M is an integer greater than 1; For each of the M pixel points on the boundary line, K pixel points are extended outward to obtain a resultant image, where K is an integer equal to or greater than 1.

[0018] In one possible design, in another embodiment of the third aspect of the present invention, The acquisition module specifically acquires original medical images; Extracting sub-images from the original medical image using a sliding window; If a pathological tissue region is detected in the sub medical image, the sub medical image is determined to be a medical image to be processed; When it is detected that the secondary medical image does not include a pathological tissue region, the secondary medical image is determined to be a background image, and the background image is removed.

[0019] In one possible design, in another embodiment of the third aspect of the present application, the image processing device further includes a training module: The generation module further Medical images to be processed and medical images to be processed and generating a target positive sample image based on the foreground region of the target positive sample image, where the target positive sample image belongs to one positive sample image in the positive sample set, and each positive sample image includes a pathological tissue region; The acquisition module is further for acquiring a negative sample set, where the negative sample set includes at least one negative sample image, and each negative sample image does not include a pathological tissue region; The training module is for training an image processing model based on the positive sample set and the negative sample set.

[0020] According to a fourth aspect of the present application, an acquisition module for acquiring a first processing target image and a second processing target image, where the first processing target image is a color image and includes first image data, second image data and third image data, the first image data, the second image data and the third image data respectively corresponding to color information in different channels; a generation module for generating a difference image based on the first image data, the second image data, and the third image data; A processing module for performing binarization processing on the difference image to obtain a binarized image, the foreground region of the binarized image being: First processing target image a processing module corresponding to the target object; an extraction module for extracting a target object from the first processing target image based on a foreground region of the binarized image; The generation module provides an image processing device further for generating a composite image based on the target object and the second processed image, where the target object is located in a first layer, the second processed image is located in a second layer, and the first layer is overlaid on the second layer.

[0021] According to a fifth aspect of the present invention, there is provided a computer readable storage medium having stored thereon instructions which, when executed by a computer, cause the computer to carry out the method of any of the above aspects. Effect of the Invention

[0022] According to the above technical solutions, the embodiments of the present application have the following advantages:

[0023] According to the medical image processing method provided by the embodiment of the present application, first, a color medical image to be processed is obtained, and the medical image to be processed includes first image data, second image data, and third image data, and the first image data, the second image data, and the third image data are different. channeland a difference image is generated based on the first image data, the second image data and the third image data, and a binarization process is performed on the difference image to obtain a binarized image, and the foreground region of the binarized image corresponds to the pathological tissue region of the medical image to be processed. According to the above method, since the difference in color information of grayscale pixel points in different channels is small and the difference in color information of color pixel points in different channels is large, the difference image is generated using the color information of different channels before the binarization process is performed on the image, so that the color information in the image can be effectively utilized, and the pathological tissue region extracted based on the difference image can be more accurate and can have a positive effect on the subsequent image analysis. [Brief description of the drawings]

[0024] [Figure 1] FIG. 1 illustrates an architecture of a medical image processing system in an embodiment of the present application. [Diagram 2] FIG. 1 is a diagram showing one embodiment of a medical image processing method according to an embodiment of the present application. [Diagram 3] FIG. 2 is a diagram showing an example of a medical image to be processed in an embodiment of the present application. [Figure 4] FIG. 2 is a diagram showing an example of a difference image in an embodiment of the present application. [Diagram 5] FIG. 2 is a diagram showing an example of a binarized image in an embodiment of the present application. [Figure 6] FIG. 13 shows an example of a result image in an embodiment of the present application. [Figure 7] FIG. 13 illustrates another example of a result image in an embodiment of the present application. [Figure 8] FIG. 2 illustrates one embodiment of acquisition of a medical image to be processed in an embodiment of the present application. [Figure 9] FIG. 2 is a diagram showing a flow of a medical image processing method in an embodiment of the present application. [Figure 10] FIG. 13 shows an example of a result image in an embodiment of the present application. [Figure 11]FIG. 2 is a diagram showing one embodiment of an image processing method in an embodiment of the present application. [Figure 12] FIG. 1 is a diagram illustrating an embodiment of a medical image processing apparatus according to an embodiment of the present application. [Figure 13] FIG. 1 illustrates an embodiment of an image processing device according to an embodiment of the present application. [Figure 14] FIG. 2 is a diagram showing the structure of a type of server provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0025] The embodiments of the present application provide a medical image processing method, an image processing method and an image processing apparatus that effectively utilize the color information in an image by generating a difference image using color information of different channels prior to performing binarization processing on the image, so that the pathological tissue area extracted based on the difference image is more accurate and has a positive impact on subsequent image analysis.

[0026] The terms "first," "second," "third," "fourth," etc. (if present) in the specification and claims of this application and in the drawings are intended to distinguish between similar objects and do not necessarily describe a particular order or priority. It should be understood that the data used in this manner may be appropriately interchanged so that the embodiments of this application described herein can be practiced in other orders than those shown and described herein. Additionally, terms such as "comprises" and "corresponding" and any variations thereof are intended to cover non-exclusive inclusions, e.g., a process, method, system, product, or equipment that includes a series of steps or units need not explicitly list those steps or units, and may include other steps or units that are not explicitly listed or that are inherent to those processes, methods, products, or equipment.

[0027] In addition, the embodiment of the present application can be applied to the scene of processing images. As the visual basis for humans to perceive the world, images are an important means for humans to obtain information, express information, and transmit information. Image processing is a technology for analyzing images to obtain desired results, and image processing generally means processing digital images, and digital images refer to large two-dimensional arrays obtained by photographing industrial cameras, video cameras, and scanner devices, and the elements of this array are called pixels, and their values ​​are called grayscale values. Image processing technology can help people perceive the world more objectively and accurately, and the human visual system can help humans obtain a large amount of information from the outside world, and images and figures are carriers of all visual information, and the human eye has a high discrimination ability and can distinguish thousands of colors, but in many cases, images are unclear to the human eye and even invisible, so image processing technology can make unclear and even invisible images clear. Specifically, image processing technology includes, but is not limited to, image transformation, image coding and compression, image enhancement and restoration, image segmentation, image description, matting technology, and image classification.

[0028] Specifically, the image processing method provided by the present application can be applied to scenes in the medical field, where the medical images that can be processed include, but are not limited to, brain images, heart images, chest images, and cell images. In addition, medical images may be affected by noise, electric field offset effects, partial volume effects, and tissue motion. Because there is also discrimination between individuals of living organisms, and the shape of tissue structure is complicated, medical images usually have a high degree of blur and non-uniformity compared with general images. The medical image related to the present application is a color image, which may be a color ultrasound image or a whole slide imaging (WSI) image, and may include a color digital image obtained from a microscope. Taking a WSI image as an example, since the side length of a WSI image is usually 10,000 to 100,000 pixels, the WSI image usually needs to be reduced or divided into small-sized images for further processing, and in the process of processing the image, an area with a pathological tissue slide is obtained, and pathological analysis such as cell nucleus quantitative analysis, cell membrane quantitative analysis, cytoplasm quantitative analysis, and tissue microvascular analysis needs to be performed based on the area. Therefore, based on the characteristics of the medical image, the medical image processing method of the present application acquires a processing target medical image, generates a difference image based on the first image data, the second image data, and the third image data included in the processing target medical image, and performs binarization processing on the difference image to obtain a binary image, where the first image data, the second image data, and the third image data are different. channel The foreground region of the binarized image corresponds to the pathological tissue region of the medical image to be processed. Since the difference in color information of grayscale pixel points in different channels is small and the difference in color information of color pixel points in different channels is large, a difference image is generated using the color information of different channels before the image is binarized, so that the color information in the image can be effectively utilized, and the pathological tissue region extracted based on the difference image can be more accurate and can have a positive effect on the subsequent image analysis.

[0029] In another example, for example, image processing can also be applied to scenes in the field of remote sensing. With the rapid development of information technology and spatial technology, and the ever-improving resolution of satellite space, high-resolution remote sensing images can be applied to ocean monitoring, land cover monitoring, marine pollution and maritime rescue. And high-resolution remote sensing images have the characteristics of rich image detail information, prominent geometric structure of ground objects and complex target structure, for example, in high-resolution remote sensing images, the shading of coastline objects is complex, the vegetation coverage area is large, or the processing of light and dark man-made facilities is not clear enough. Compared with general images, high-resolution remote sensing images usually have more details and are more complex, so when it is necessary to determine the coverage area of ​​vegetation in high-resolution remote sensing images, the vegetation coverage can be cut out from the high-resolution remote sensing images to determine the corresponding area. Therefore, based on the characteristics of the high-resolution remote sensing image, the image processing method of the present application generates a difference image based on the first image data, the second image data, and the third image data included in the first processing target image, and then performs binarization processing on the generated difference image to obtain a binarized image, and further, based on the resultant image, a target object (e.g., a vegetation cover area) can be extracted from the first processing target image, where the first processing target image is a color image, the first image data, the second image data, and the third image data included in the first processing target image correspond to color information in different channels, respectively, and the foreground area of ​​the binarized image corresponds to the pathological tissue area of ​​the processing target medical image. By generating a difference image using color information of different channels before performing binarization processing on the image, the difference in color information of grayscale pixel points in different channels is small, and the difference in color information of color pixel points in different channels is large, so that the color information in the image can be effectively utilized, the target object extracted based on the difference image is more accurate, and the details in the high-resolution remote sensing image can be obtained more accurately, and the accuracy rate of high-resolution remote sensing image processing can be improved.

[0030] The embodiment of the present application takes the application scene in the medical field as an example, in order to improve the accuracy of the extracted pathological tissue region in the medical field scene and have a positive impact on the subsequent image analysis, the present application provides a medical image processing method, which is applied to the medical image processing system shown in Figure 1 (see Figure 1), which is a diagram showing the architecture of the medical image processing system in the embodiment of the present application, as shown in the figure, the image processing system includes a server and a terminal device. The medical image processing device may be disposed in the server, or may be disposed in the terminal device with high computing power.

[0031] For example, in the case where the medical image processing device is disposed in a server, the server acquires a medical image to be processed, then generates a difference image based on the first image data, the second image data, and the third image data included in the medical image to be processed, and further performs binarization processing on the difference image to acquire a binarized image, and the foreground region of the binarized image corresponds to the pathological tissue region of the medical image to be processed. The server can analyze the medical image based on the pathological tissue region.

[0032] For example, in the case where the medical image processing device is disposed in a terminal device, the terminal device acquires a medical image to be processed, then generates a difference image based on the first image data, the second image data, and the third image data included in the medical image to be processed, and further performs binarization processing on the difference image to acquire a binarized image, and a foreground region of the binarized image corresponds to a pathological tissue region of the medical image to be processed. The terminal device can analyze the medical image based on the pathological tissue region.

[0033] Here, the server in Fig. 1 may be one server, or a server cluster or cloud computing center consisting of multiple servers, and is not specifically limited here. The terminal device may be a tablet computer, notebook computer, mobile information terminal, mobile phone, personal computer (PC), and voice dialogue device shown in Fig. 1, or a monitoring device, face recognition device, and is not specifically limited here.

[0034] Although FIG. 1 shows only five terminal devices and one server, it should be understood that the example in FIG. 1 is merely for the purpose of understanding the present solution, and the specific number of terminal devices and servers should be flexibly determined according to actual circumstances.

[0035] Since the embodiments of the present application are applied to the field of artificial intelligence, some basic concepts in the field of artificial intelligence will be described before describing the model training method provided by the embodiments of the present application. Artificial intelligence (AI) is a theory, method, technology, and application system for simulating, extending, and expanding human intelligence using a digital computer or a machine controlled by a digital computer to sense the environment, acquire knowledge, and obtain optimal results using knowledge. In other words, artificial intelligence is a comprehensive technology in computer science that aims to understand the essence of intelligence and produce new intelligent machines that can react in a manner similar to human intelligence. In other words, artificial intelligence also gives machines the functions of sensing, inference, and decision-making by studying the design principles and realization methods of various intelligent machines. Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields and includes both hardware and software technologies. Fundamental technologies of artificial intelligence generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed memory, big data processing technology, operation / interactive systems, and electro-mechanical integration. Artificial intelligence software technology mainly includes several directions such as computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning. Machine learning (ML) is a field that intersects multiple fields and is related to many fields such as probability theory, statistics, approximation theory, convex analysis, and algorithmic complexity theory. It is a field that acquires new knowledge and skills and continuously improves its own performance by reorganizing existing knowledge structures through specialized research into how computers simulate and realize human learning behavior. Machine learning is the core of artificial intelligence and the fundamental route to making computers intelligent, and is applied across various fields of artificial intelligence. Machine learning and deep learning generally include technologies such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and teaching learning.

[0036] With the research and progress of artificial intelligence technology, artificial intelligence technology is being researched in various directions. Computer Vision (CV) technology is a science that studies how to make machines "see" among the various research directions of artificial intelligence technology. More specifically, it means machine vision that uses a video camera and a computer instead of human eyes to identify, track, measure, etc., and further processes the image by a computer so that it is more suitable for observation by human eyes or transmission to an instrument for detection by graphic processing. Computer vision, as a scientific discipline, studies related theories and technologies and attempts to establish an artificial intelligence system that can obtain information from images or multidimensional data. Computer vision technology generally includes technologies such as image processing, image identification, image semantic understanding, image search, optical character recognition (OCR), video processing, video semantic understanding, video content / action identification, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, synchronous positioning and map construction, and also includes ordinary face recognition, fingerprint recognition, and other biometric feature recognition technologies.

[0037] The technical solution provided by the embodiment of the present application relates to artificial intelligence image processing technology. In the following, in combination with the above description, the medical image processing method in the present application will be described (see FIG. 2), and FIG. 2 is a diagram showing an embodiment of the medical image processing method in the embodiment of the present application. As shown, the embodiment of the medical image processing method in the embodiment of the present application includes the following steps:

[0038] In step 101, a medical image to be processed is acquired, where the medical image to be processed is a color image and includes first image data, second image data and third image data, and the first image data, the second image data and the third image data respectively correspond to color information in different channels.

[0039] In this embodiment, the medical image processing device can obtain a processing target medical image which is a color image, and the processing target medical image can include first image data, second image data and third image data, and the first image data, second image data and third image data correspond to color information in different channels, respectively. Here, the processing target medical image may be a medical image received by the medical image processing device via a wired network, or may be a medical image stored in the medical image processing device itself.

[0040] Specifically, the medical image to be processed may be a region cut out from a WSI image, which may be obtained by scanning a slice with a microscope, and the slice is a glass slide prepared by hematoxylin or other staining methods, so that the WSI image obtained by scanning the slice with a microscope is a color image. Here, the image color mode of the color image includes, but is not limited to, RGB (red green blue) color mode, YUV (luminance bandwidth chrominance) color mode, and HSV (hue saturation value) color mode, and the color information may represent pixel values ​​in different channels, such as R channel pixel values, G channel pixel values, and B channel pixel values.

[0041] The format of the WSI image includes, but is not limited to, file formats such as SVS and NDPI, and the length and width of the WSI image are generally in the range of tens of thousands of pixels. The image size is large, and a large memory is required to directly process the WSI image, so the WSI image needs to be divided. Usually, the WSI image can be read using the openslide tool of python, which, in addition to converting the file format, can store one area cut out from the WSI image as an image with a resolution of 12*12, and in actual situations, can store it with resolutions such as 15*15 and 50*50, but is not limited to these resolutions, and there are multiple images in the same WSI image file, and in actual applications, the image with the highest resolution in the WSI image file is read as the image to be processed. Then, in this embodiment, the medical image to be processed is cut out from the reduced WSI image, and the WSI image can be reduced by any multiple, such as 20 times or 10 times, and the length and width of the WSI image after reduction are in the range of several thousand pixels. Note that the reduction multiple is artificially defined, so the specific reduction multiple should be flexibly determined according to the actual situation.

[0042] For ease of understanding, please refer to FIG. 3. FIG. 3 is a diagram showing one embodiment of a medical image to be processed in an embodiment of the present application. As shown, the medical image to be processed includes a pathological tissue region, and there is no other grayscale background or pure white background interfering with the medical image to be processed. To further understand this embodiment, an example is taken of an image color mode of the medical image to be processed being RGB, and the first image data, the second image data, and the third image data included in the medical image to be processed correspond to color information in different channels, respectively. Therefore, when the RGB corresponding to the color image is (200, 100, 60), the first image data may have a pixel value of 200 corresponding to the R channel, the second image data may have a pixel value of 100 corresponding to the G channel, and the third image data may have a pixel value of 60 corresponding to the B channel. When the RGB corresponding to the color image is (100, 80, 40), the first image data may have a pixel value of 100 corresponding to the R channel, and the second image data may have a pixel value of 80 corresponding to the G channel. 0 The third image data may be a pixel value of 40 corresponding to the B channel.

[0043] It should be noted that for an HSV or YUV image, subsequent processing can be performed after the HSV or YUV image is converted into an RGB image.

[0044] In addition, in practical applications, the specific color information corresponding to the first image data, the second image data, and the third image data should be flexibly determined according to the actual situation.The medical image processing device may be disposed in a server or in a terminal device having high computing power, and in this embodiment, the medical image processing device is disposed in a server as an example.

[0045] In step 102, a difference image is generated based on the first image data, the second image data, and the third image data included in the medical image to be processed.

[0046] In this embodiment, the medical image processing device can generate a difference image based on the first image data, the second image data, and the third image data. Specifically, the difference image is expressed as a grayscale image. For ease of understanding, please refer to FIG. 4. FIG. 4 is a diagram showing one example of a difference image in the embodiment of the present application. As shown, a difference image shown in FIG. 4(B) can be generated based on a processing target medical image including the first image data, the second image data, and the third image data shown in FIG. 4(A). The difference image may be an image including a pathological tissue region as shown in the figure, and pixel values ​​are distinguished using color information in corresponding different channels. Therefore, an example is described in which the image color mode of the processing target medical image is RGB. When the processing target medical image is gray, RGB is close to each other, and when the processing target medical image is colored, the difference between RGB is large, resulting in a large color difference in the area where the pathological tissue exists.

[0047] In step 103, a binarization process is performed on the difference image to obtain a binarized image.

[0048] In this embodiment, the medical image processing device performs binarization processing on the difference image generated in step 102 to obtain a binarized image. Here, the foreground region of the binarized image corresponds to the pathological tissue region of the medical image to be processed. For ease of understanding, please refer to FIG. 5. FIG. 5 is a diagram showing one example of a binarized image in the embodiment of the present application. As shown, in the case of the difference image shown in FIG. 5(A), since the difference image is a grayscale image, processing based on a grayscale image can be used. Specifically, in this embodiment, an adaptive binarization method is adopted to perform foreground processing, that is, binarization processing is performed on the difference image to obtain the binarized image shown in FIG. 5(B). In the binarized image, white is the foreground region including the pathological tissue region, and black is the background region not including the pathological tissue region.

[0049] For ease of understanding, please refer to Fig. 6. Fig. 6 is a diagram showing one example of a foreground region in an embodiment of the present application, and as shown in the figure, in the case of the binary image shown in Fig. 6(A), white is the foreground region including a pathological tissue region, and black is the background region not including a pathological tissue region, so that a region corresponding to the medical image to be processed shown in Fig. 6(B) can be generated based on the binary image.

[0050] In the embodiment of the present application, a medical image processing method is provided. According to the above method, since the difference in color information of grayscale pixel points in different channels is small and the difference in color information of color pixel points in different channels is large, before the image is subjected to binarization processing, a difference image is generated using the color information of different channels, so that the color information in the image can be effectively utilized, and the pathological tissue area extracted based on the difference image can be more accurate and have a positive impact on subsequent image analysis.

[0051] Preferably, in one preferred embodiment of the medical image processing method provided by the embodiment of the present application, in addition to the embodiment corresponding to FIG. 2, the step of generating a difference image based on the first image data, the second image data, and the third image data included in the medical image to be processed includes: generating a maximum value image and a minimum value image based on the first image data, the second image data and the third image data included in the medical image to be processed; generating a difference image based on the maximum image and the minimum image.

[0052] In this embodiment, after acquiring a medical image to be processed, the medical image processing device generates a maximum value image and a minimum value image based on the first image data, the second image data and the third image data contained in the medical image to be processed, and finally generates a difference image based on the maximum value image and the minimum value image.

[0053] Specifically, an example will be given in which the image color mode of the medical image to be processed is RGB, and the first image data, second image data, and third image data contained in the medical image to be processed correspond to color information in different channels, respectively, and the color information is represented by pixel values ​​corresponding to the R channel, G channel, and B channel. Therefore, the maximum values ​​in the R channel, G channel, and B channel are determined, and a maximum value image is determined by the maximum values. Similarly, the minimum values ​​in the R channel, G channel, and B channel are determined, and a minimum value image is determined by the minimum values. Then, each pixel point in the maximum value image is subtracted from each pixel point at a corresponding position in the minimum value image to obtain a difference image.

[0054] In an embodiment of the present application, a method for generating a difference image is provided, and a maximum value image and a minimum value image are generated based on first image data, second image data and third image data using the above method. Since the color information corresponding to different image data is different, the color information of the medical image to be processed contained in the maximum value image and the minimum value image determined based on the different image data is highly accurate, and the accuracy of the generation of the difference image can be improved.

[0055] Preferably, in another preferred embodiment of the medical image processing method provided by the embodiment of the present application, in addition to the embodiment corresponding to FIG. 2, the step of generating a maximum value image and a minimum value image based on the first image data, the second image data and the third image data included in the medical image to be processed further comprises: determining a maximum pixel value and a minimum pixel value based on a first pixel value at a first pixel location in the first image data, a second pixel value at a second pixel location in the second image data, and a third pixel value at a third pixel location in the third image data; obtaining a maximum value image based on the maximum pixel value, and obtaining a minimum value image based on the minimum pixel value.

[0056] Here, the pixel value at the fourth pixel position in the maximum value image is the maximum pixel value, the pixel value at the fifth pixel position in the minimum value image is the minimum pixel value, and the first pixel position, the second pixel position, the third pixel position, the fourth pixel position, and the fifth pixel position all correspond to the positions of the same pixel point in the medical image to be processed.

[0057] The step of generating a difference image based on the maximum image and the minimum image includes: determining a pixel difference value based on a pixel value at a fourth pixel location in the maximum image and a pixel value at a fifth pixel location in the minimum image; The method may include a step of obtaining a difference image based on the pixel difference value, wherein the pixel value of a sixth pixel position in the difference image is the pixel difference value, and the fourth pixel position, the fifth pixel position and the sixth pixel position all correspond to the position of the same pixel point in the medical image to be processed.

[0058] A pixel difference value is obtained by subtracting a maximum pixel value corresponding to the target pixel point in the maximum value image from a minimum pixel value corresponding to the target pixel point in the minimum value image, and the pixel difference value is set as a difference pixel value corresponding to the target pixel point in the difference image.

[0059] In this embodiment, the medical image processing device determines a maximum pixel value and a minimum pixel value corresponding to a target pixel point based on the first image data, the second image data, and the third image data included in the medical image to be processed, and generates a maximum value image and a minimum value image based on the determined maximum pixel value and minimum pixel value. Finally, the maximum pixel value corresponding to the target pixel point in the maximum value image is subtracted from the minimum pixel value corresponding to the target pixel point in the minimum value image to obtain a difference pixel value corresponding to the target pixel point in the difference image.

[0060] For ease of understanding, an example will be described in which the image color mode of the medical image to be processed is RGB, and for the medical image to be processed which includes first image data, second image data and third image data, each pixel point of the medical image to be processed has corresponding image data in the R channel, G channel and B channel, and for example, the image data of the pixel point in the R channel is a first pixel value, the image data in the G channel is a second pixel value, and the image data in the B channel is a third pixel value, and the maximum pixel value and the minimum pixel value in the R channel, G channel and B channel can be determined based on the first pixel value, the second pixel value and the third pixel value.

[0061] Furthermore, the maximum pixel value and the minimum pixel value of the pixel point position (x, y) can be calculated by the following formula. Imax(x,y)=Max[Ir(x,y),Ig(x,y),Ib(x,y)] Imin(x,y)=Min[Ir(x,y),Ig(x,y),Ib(x,y)] Here, Imax(x,y) is the maximum pixel value, Imin(x,y) is the minimum pixel value, Ir(x,y) is the first pixel value, Ig(x,y) is the second pixel value, and Ib(x,y) is the third pixel value.

[0062] In this embodiment, the pixel values ​​are distinguished using color information in different corresponding channels. Again, the image color mode of the medical image to be processed is RGB as an example. When the medical image to be processed is gray, the RGB is close to each other. When the medical image to be processed is colored, the difference between the RGB is large, and there is color in the area where the pathological tissue exists. The value with color is the pixel value required in this embodiment. Note that the above formula is described using only pixel points corresponding to a two-dimensional image as an example, but in actual applications, the above formula can also be applied to the calculation of the maximum pixel value and the minimum pixel value in a multidimensional image such as a three-dimensional (3 dimensions, 3D) image and a four-dimensional (4 dimensions, 4D) image.

[0063] To further understand this embodiment, an example will be described in which the position of the target pixel point is (x1, y1) and the image color mode of the medical image to be processed is RGB, and the first pixel value Ir(x1, y1) of the target pixel point position (x1, y1) is 100, the second pixel value Ig(x1, y1) of the target pixel point position (x1, y1) is 200, and the third pixel value Ib(x1, y1) of the target pixel point position (x1, y1) is 150. As can be seen from the above formula, the maximum pixel value Imax(x1, y1) of the target pixel point position (x1, y1) is 200, which is the pixel value corresponding to the second pixel value Ig(x1, y1), and the minimum pixel value Imin(x1, y1) of the target pixel point position (x1, y1) is 100, which is the pixel value corresponding to the first pixel value Ir(x1, y1).

[0064] Next, as another example, the target pixel point position is (x2, y2) and the image color mode of the medical image to be processed is RGB, the first pixel value Ir(x2, y2) of the target pixel point position (x2, y2) is 30, the second pixel value Ig(x2, y2) of the target pixel point position (x2, y2) is 80, and the third pixel value Ib(x2, y2) of the target pixel point position (x2, y2) is 120. As can be seen from the above formula, the maximum pixel value Imax(x2, y2) of the target pixel point position (x2, y2) is 120, which is the pixel value corresponding to the third pixel value Ib(x2, y2), and the minimum pixel value Imin(x2, y2) of the target pixel point position (x2, y2) is 30, which is the pixel value corresponding to the first pixel value Ir(x2, y2).

[0065] Further, as another example, the image color mode of the medical image to be processed is RGB, the medical image to be processed is a 3D image, and the target pixel point position is (x3, y3, z3). The first pixel value Ir(x3, y3, z3) of the target pixel point position (x3, y3, z3) is 200, the second pixel value Ig(x3, y3, z3) of the target pixel point position (x3, y3, z3) is 10, and the first pixel value Ir(x3, y3, z3) of the target pixel point position (x3, y3, z3) is 200. 3) is 60, and as can be seen from the above equation, the maximum pixel value Imax(x3, y3, z3) of the target pixel point position (x3, y3, z3) is 200, which is the pixel value corresponding to the first pixel value Ir(x3, y3, z3), and the minimum pixel value Imin(x3, y3, z3) of the target pixel point position (x3, y3, z3) is 10, which is the pixel value corresponding to the second pixel value Ig(x3, y3, z3).

[0066] Furthermore, when the maximum pixel value and the minimum pixel value corresponding to the target pixel point position are obtained, the difference pixel value corresponding to the target pixel point position in the difference image can be obtained by subtracting the maximum pixel value from the minimum pixel value. Specifically, the difference pixel value can be calculated based on the maximum pixel value Imax(x,y) and the minimum pixel value Imin(x,y) by the following formula, and it is assumed that the medical image to be processed contains 10,000 pixels. Idiff(x,y)=Imax(x,y)-Imin(x,y) Here, Imax(x, y) is the maximum pixel value, Imin(x, y) is the minimum pixel value, and Idiff(x, y) is the difference pixel value at position (x, y).

[0067] For ease of understanding, an example will be taken in which the target pixel point position is (x1, y1) and the image color mode of the medical image to be processed is RGB. The maximum pixel value Imax(x1, y1) of the target pixel point position (x1, y1) is 200, and the minimum pixel value Imin(x1, y1) of the target pixel point position (x1, y1) is 100. By subtracting the maximum pixel value Imax(x1, y1) from the minimum pixel value Imin(x1, y1), it can be seen that the differential pixel value corresponding to the target pixel point position (x1, y1) is 100. Next, as another example, the target pixel point position is (x2, y2) and the image color mode of the medical image to be processed is RGB. The maximum pixel value Imax(x2, y2) of the target pixel point position (x2, y2) is 120, and the minimum pixel value Imin(x2, y2) of the target pixel point position (x2, y2) is 30. By subtracting the maximum pixel value Imax(x2, y2) from the minimum pixel value Imin(x2, y2), it is found that the differential pixel value corresponding to the target pixel point position (x2, y2) is 90.

[0068] As another example, preferably, the image color mode of the medical image to be processed is RGB, the medical image to be processed is a 3D image, and the target pixel point position is (x3, y3, z3). From the above formula, the following formula can be derived. Imax(x,y,z)=Max[Ir(x,y,z),Ig(x,y,z),Ib(x,y,z)] Imin(x,y,z)=Min[Ir(x,y,z),Ig(x,y,z),Ib(x,y,z)] Idiff(x,y,z)=Imax(x,y,z)-Imin(x,y,z)

[0069] Assuming that the maximum pixel value Imax(x3, y3, z3) of the target pixel point position (x3, y3, z3) is 200 and the minimum pixel value Imin(x3, y3, z3) of the target pixel point position (x3, y3, z3) is 10, by subtracting the maximum pixel value Imax(x3, y3, z3) from the minimum pixel value Imin(x3, y3, z3), it is found that the differential pixel value corresponding to the target pixel point position (x3, y3, z3) is 190.

[0070] Specifically, when the differential pixel value of the medical image to be processed is small, the first pixel value, the second pixel value, and the third pixel value of the medical image to be processed are close to each other, and it can be indicated that the medical image to be processed is similar to a gray image; when the differential pixel value of the medical image to be processed is large, the difference between the first pixel value, the second pixel value, and the third pixel value of the medical image to be processed is large, and it can be indicated that the medical image to be processed is similar to a color image; since images containing pathological tissue areas are generally colored images, it is possible to make a rudimentary judgment on whether the medical image to be processed contains a pathological tissue area based on the differential pixel value.

[0071] In an embodiment of the present application, a method for generating a maximum value image and a minimum value image is provided, and the maximum pixel value and the minimum pixel value are determined according to the pixel values ​​of the target pixel points corresponding to the first image data, the second image data, and the third image data. The maximum pixel value and the minimum pixel value reflect the color information of the medical image to be processed to different degrees. By obtaining a differential pixel value by subtracting the maximum pixel value from the minimum pixel value, the differential pixel value can accurately reflect the color information of the medical image to be processed, and the accuracy of generating the differential image can be improved.

[0072] Preferably, in another preferred embodiment of the medical image processing method provided by the embodiment of the present application, in addition to the embodiment corresponding to FIG. 2, the step of generating a difference image based on the first image data, the second image data, and the third image data included in the medical image to be processed further comprises: generating a processing target difference image based on the first image data, the second image data, and the third image data included in the processing target medical image; and performing Gaussian blurring on the target difference image to obtain a difference image.

[0073] In this embodiment, the medical image processing device generates a target difference image based on the first image data, the second image data, and the third image data contained in the target medical image, and then performs Gaussian blur processing on the target difference image to obtain a difference image.

[0074] Specifically, blurring can be understood as taking the average value of the pixel points around each pixel point in the difference image to be processed, and when taking the average value of the pixel points around each pixel point, the numerical value of the pixel point tends to be smoothed, which is equivalent to the blurring effect being generated in the difference image to be processed, and the pixel point loses details.Since the pixel points are continuous in the difference image to be processed, the closer the pixel points are to each other, the closer the relationship is, and the farther the pixel points are from each other, the more distant the relationship is.Therefore, in this embodiment, the algorithm adopted for blurring is Gaussian blur, and Gaussian blur uses normal distribution (Gaussian distribution) to process the difference image to be processed, making the weighted average between pixel points more reasonable, and the closer the pixel points are, the larger the weight is, and the farther the pixel points are, the smaller the weight is.

[0075] Further, an example will be described in which the pixel point is (x, y). Since the pixel point (x, y) is a two-dimensional pixel point, a two-dimensional Gaussian function can be calculated for the pixel point by the following formula.

number

[0076] For ease of understanding, take the pixel point in question as an example (0,0). The eight pixel points surrounding the pixel point (0,0) can be (-1,1), (0,1), (1,1), (-1,0), (1,0), (-1,-1), (0,-1) and (1,-1). In order to further calculate the weighting matrix, it is necessary to set the value of σ. Assuming that σ=1.5, a weighting matrix with a blurring radius of 1 can be obtained. For example, in the weighting matrix, the weight corresponding to pixel point (0,0) is 0.0707, the weight corresponding to pixel point (-1,1) is 0.0453, the weight corresponding to pixel point (0,1) is 0.0566, the weight corresponding to pixel point (1,1) is 0.0453, the weight corresponding to pixel point (-1,0) is 0.0566, the weight corresponding to pixel point (1,0) is 0.0566, the weight corresponding to pixel point (-1,-1) is 0.0453, the weight corresponding to pixel point (0,-1) is 0.0566, the weight corresponding to pixel point (1,-1) is 0.0453, and the sum of the weights of the nine points including the eight pixel points surrounding pixel point (0,0) is approximately 0.479. If only the weighted average of these nine points is calculated, the sum of the weights should be equal to 1, i.e., the sum of the weights should be normalized; that is, the nine values ​​corresponding to the weight matrix should be divided by the sum of the weights, which is 0.479, to obtain the normalized weight matrix, i.e., the weight corresponding to the pixel point (0,0) after normalization is 0.147, the weight corresponding to the pixel point (-1,1) after normalization is 0.0947, the weight corresponding to the pixel point (0,1) after normalization is 0.0118, the weight corresponding to the pixel point (1,1) after normalization is 0.0947, the weight corresponding to the pixel point (-1,0) after normalization is 0.0118, the weight corresponding to the pixel point (-1,-1) after normalization is 0.0947, the weight corresponding to the pixel point (0,-1) after normalization is 0.0118, and the weight corresponding to the pixel point (1,-1) after normalization is 0.0947.Since a weighting matrix with a sum of weights greater than 1 results in a brighter difference image, and a weighting matrix with a sum of weights less than 1 results in a darker difference image, the normalized weighting matrix can more accurately identify the pathological tissue area in the difference image.

[0077] Furthermore, when the normalized weight matrix is ​​obtained, Gaussian blur calculation can be performed on the pixel point. For example, when the gradation value is 0 to 255, the gradation value corresponding to the pixel point (0,0) in the weight matrix is ​​25, the gradation value corresponding to the pixel point (-1,1) is 14, the gradation value corresponding to the pixel point (0,1) is 15, the gradation value corresponding to the pixel point (1,1) is 16, the gradation value corresponding to the pixel point (-1,0) is 24, the gradation value corresponding to the pixel point (1,0) is 26, the gradation value corresponding to the pixel point (-1,-1) is 34, the gradation value corresponding to the pixel point (0,-1) is 35, and the gradation value corresponding to the pixel point (1,-1) is 36. Multiplying the grayscale value corresponding to each pixel point by the weight corresponding to each pixel point, we can get nine values, namely, pixel point (0,0) can get 3.69, pixel point (-1,1) pair can get 1.32, pixel point (0,1) can get 1.77, pixel point (1,1) can get 1.51, pixel point (-1,0) can get 2.83, pixel point (1,0) can get 3.07, pixel point (-1,-1) can get 3.22, pixel point (0,-1) can get 4.14, pixel point (1,-1) can get 3.41. Then adding these nine values, we get the Gaussian blur value of pixel point (0,0).

[0078] Furthermore, by repeating the above-mentioned step of making all pixel points contained in the difference image to be processed similar to the pixel point (0,0), a difference image after Gaussian blurring can be obtained.

[0079] In an embodiment of the present application, another method for generating a difference image is provided, and a Gaussian blurring process is performed on the generated difference image to be processed by the above method. The Gaussian blurring process can improve the processing robustness, so that the obtained difference image has high processing robustness and can improve the stability of the difference image.

[0080] Preferably, in another preferred embodiment of the medical image processing method provided by the embodiment of the present application, in addition to the embodiment corresponding to FIG. 2, the step of performing binarization processing on the difference image to obtain a binarized image includes: determining a binarization threshold based on the difference image; The method may further include a step of performing a binarization process on the difference image based on the binarization threshold to obtain a binarized image.

[0081] In this embodiment, the medical image processing device can determine a binarization threshold based on the difference image, and if the pixel value corresponding to a pixel point in the difference image is greater than or equal to the binarization threshold, the pixel point is determined to be a foreground pixel point of the binarized image, and if the pixel value corresponding to the pixel point in the difference image is less than the binarization threshold, the pixel point is determined to be a background pixel point of the binarized image.

[0082] Specifically, by setting a binarization threshold and performing binarization processing on the difference image, the grayscale image can be changed into a binary image whose value is 0 or 1. That is, by setting a binarization threshold, the difference image can be converted into a binary image that indicates the image foreground and the image background with only two values ​​(0 or 1), respectively, where the value of the foreground is 1 and the value of the background is 0, and in practical applications, the RGB values ​​corresponding to 0 are all 0 and the RGB values ​​corresponding to 1 are all 255. After the difference image is binarized to obtain a binary image, when the binary image is further processed, the geometric properties of the binary image are related only to the positions of 0 and 1 and not to the grayscale values ​​of the pixels, so that the processing of the binary image is simplified and the image processing efficiency can be improved. The method of determining the binarization threshold can be divided into a global threshold and a local threshold. Here, the global threshold is to divide the entire difference image with one threshold. However, since different difference images have different numbers of gradations in the difference images, and the same difference image may have different light and dark distributions in different parts, this embodiment adopts a dynamic threshold binarization method to determine the binarization threshold.

[0083] After determining the binarization threshold based on the difference image, the pixel value corresponding to the pixel point in the difference image and the binarization threshold are judged, and if the pixel value corresponding to the pixel point in the difference image is equal to or greater than the binarization threshold, the pixel point is determined as a foreground pixel point of the binarized image. If the pixel value corresponding to the pixel point in the difference image is smaller than the binarization threshold, the pixel point is determined as a background pixel point of the binarized image. For example, if the pixel value corresponding to pixel point A is greater than the binarization threshold, the pixel point A is determined as a foreground pixel point of the binarized image, i.e., the pixel value is 1. That is, the pixel point A is in the foreground region and is displayed as white when the image is in RGB mode. If the pixel value corresponding to pixel point B is smaller than the binarization threshold, the pixel point B is determined as a background pixel point of the binarized image, i.e., the pixel value is 0. That is, the pixel point B is in the background region and is displayed as black when the image is in RGB mode.

[0084] In the embodiment of the present application, a method for obtaining a binary image is provided. By generating a binary image through binarization processing in the above manner, the geometric properties of the binary image are not related to the gradation values ​​of the pixels, so that the subsequent processing of the binary image can be simplified and the efficiency of generating a resultant image can be improved.

[0085] Preferably, in another preferred embodiment of the medical image processing method provided by the embodiment of the present application, in addition to the embodiment corresponding to FIG. 2, the step of determining a binarization threshold based on the difference image includes: obtaining N pixel values ​​corresponding to the N pixel points based on the difference image, where the pixel values ​​and the pixel points have a one-to-one corresponding relationship, and N is an integer greater than 1; determining a reference pixel value from the N pixel values, where the reference pixel value is the maximum of the N pixel values; The method may further include a step of calculating a binarization threshold based on the reference pixel value and the preset ratio.

[0086] In this embodiment, the medical image processing device obtains N pixel values ​​corresponding to N pixel points based on the difference image, then determines a reference pixel value from the N pixel values, and finally calculates a binarization threshold based on the reference pixel value and a preset ratio, where the pixel value and the pixel point have a one-to-one corresponding relationship, the reference pixel value is the maximum value among the N pixel values, and N is an integer greater than 1.

[0087] Specifically, in this embodiment, the binarization threshold is determined based on a difference image, and the difference image can be generated by subtracting a maximum value image and a minimum value image in the medical image to be processed, and since the pixel values ​​in the difference image and the pixel points have a one-to-one correspondence, the pixel values ​​corresponding to a plurality of pixel points in the difference image are obtained, and then the maximum value among the plurality of pixel values ​​is determined as a reference pixel value, and then the binarization threshold can be calculated based on the reference pixel value and a preset ratio. For ease of understanding, in this embodiment, the preset ratio is 10%. For example, assuming that the length and width of the image after reducing the WSI image are within a range of several thousand pixels, and the reduced image includes 100*100 pixel points, it is necessary to find the maximum value from the pixel values ​​corresponding to 10,000 pixel points. For example, if the maximum value is 150, the maximum value 150 is determined as the reference pixel value, and then the reference pixel value 150 is multiplied by the preset ratio of 10% to obtain the binarization threshold value of 15. In addition, in actual applications, the preset ratio may be a value corresponding to another percentage, and the specific preset ratio can be flexibly determined according to actual circumstances.

[0088] In the embodiment of the present application, another method for obtaining a binarization threshold is provided, in which the binarization threshold can be obtained according to a reference pixel value determined based on the maximum pixel value and a preset ratio. Since there may be differences in the number of gradations in the differential image and different regions may have different light and dark distributions, the binarization threshold can be flexibly determined by adjusting the preset ratio, thereby improving the accuracy and flexibility of the threshold and improving the accuracy of generating a binary image.

[0089] Preferably, in another preferred embodiment of the medical image processing method provided by the embodiment of the present application, in addition to the embodiment corresponding to FIG. 2, detecting a background region in the binarized image using a flood-fill algorithm, where the background region includes a plurality of background pixel points; obtaining background pixel points in a foreground region in the binary image based on the binary image and a background region in the binary image, where the foreground region includes a plurality of foreground pixel points; changing background pixel points in a foreground region in the binarized image to foreground pixel points to obtain a void-filled image; The method may further include performing a median filtering process on the cavity filled image to obtain a resultant image, the foreground region of the resultant image corresponding to the pathological tissue region of the medical image to be processed.

[0090] In this embodiment, the medical image processing device detects a background region in a binary image using a flood-fill algorithm, then obtains background pixel points in a foreground region in the binary image based on the binary image and the background region in the binary image, and further changes the background pixel points in the foreground region in the binary image to foreground pixel points to obtain a cavity-filled image, and finally performs a median filter process on the cavity-filled image to obtain a resultant image, where the background region may include a plurality of background pixel points, and the foreground region may include a plurality of foreground pixel points, and the foreground region of the resultant image corresponds to the pathological tissue region of the medical image to be processed.

[0091] Specifically, in a binary image obtained by performing a binarization process on a difference image, the foreground region in the binary image may be a black cavity, so it is necessary to detect the black cavity as the foreground region. For easier understanding, please refer to FIG. 7. FIG. 7 is a diagram showing another embodiment of a resultant image in an embodiment of the present application. As shown in the figure, the binary image shown in FIG. 7(A) includes a plurality of background pixel points in a foreground region exhibiting white color, among which, the black points surrounded by the regions A1 to A5 are all composed of background pixel points, and by changing the black points surrounded by the regions A1 to A5 from background pixel points to foreground pixel points, and the white points surrounded by the regions A6 and A7 are composed of foreground pixel points, and by changing the white points surrounded by the regions A6 and A7 from foreground pixel points to background pixel points, a cavity-filled image shown in FIG. 7(B) can be obtained.

[0092] Furthermore, the cavity-filled image shown in FIG. 7(B) can then be subjected to median filtering to obtain the resultant image shown in FIG. 7(C). Morphological processing may also be performed. Here, the filtering is intended to suppress noise in the medical image to be processed under the condition that the detailed features of the cavity-filled image are preserved as much as possible, and the filtering can improve the effectiveness and reliability of subsequent processing and analysis of the resultant image. Removing noise components in the cavity-filled image is a filtering operation. Most of the energy of the cavity-filled image is concentrated in the low and medium frequency bands of the amplitude spectrum, and in the high frequency band, the information of the cavity-filled image is always affected by noise. Therefore, in order to meet the requirements of image processing, the cavity-filled image can be subjected to a filtering operation to remove noise that was mixed in when the image was digitized. Median filtering is a typical nonlinear filtering, which is a nonlinear signal processing technique that can effectively suppress noise based on the theory of order statistics. Median filtering is a typical nonlinear filtering, which is a nonlinear signal processing technique that can effectively suppress noise based on the theory of order statistics. Median filtering replaces the grayscale value of a pixel point with the median value of the grayscale values ​​in the vicinity of the pixel point, and makes the surrounding pixel values ​​closer to the true value, thereby removing isolated noise points.

[0093] In the embodiment of the present application, a method for generating a resultant image is provided. The background pixel points in the foreground area are changed to foreground pixel points in the above manner to obtain a cavity-filled image with high reliability. Then, by using median filtering, the resultant image corresponding to the medical image to be processed can be made clear and have a good visual effect without damaging the characteristic information such as the contour and edge of the image.

[0094] Preferably, in another preferred embodiment of the medical image processing method provided by the embodiment of the present application, in addition to the embodiment corresponding to FIG. 2, the step of performing median filtering on the cavity-filled image includes: performing a median filter process on the cavity-filled image to obtain a filtered image and a resultant image, the foreground region of the resultant image corresponding to a pathological tissue region of the target medical image; obtaining a boundary of a foreground region in the filtered image, where the boundary includes M pixel points, where M is an integer greater than 1; and expanding K pixel points outward for each of the M pixel points on the boundary line to obtain a resultant image, where K is an integer greater than or equal to 1.

[0095] In this embodiment, the medical image processing device performs median filtering on the cavity-filled image to obtain the boundary of the foreground region in the filtered image, and further expands K pixel points outward for each of M pixel points on the boundary to obtain a resultant image, where the filtered image may include the foreground region to be processed, and the boundary includes M pixel points, where M is an integer greater than 1, and K is an integer greater than or equal to 1. Specifically, the median filtering replaces the gradation value of a pixel point with the median value of the gradation values ​​in the vicinity of the pixel point, and makes the surrounding pixel values ​​closer to the true value, thereby removing isolated noise points, and the median filtering can extract pulse noise and salt-and-pepper noise while obtaining a filtered image that retains the edge details of the image.

[0096] Furthermore, flood fill algorithms are used to fill areas with different colors that are connected to each other and have similar colors. The basic principle of flood fill algorithms is to extend the coloring from one pixel point to the surrounding pixel points until the edge of the pattern is reached. Flood fill algorithms need to adopt three parameters: start node, target color, and replacement color. Flood fill algorithms connect all nodes of the start node through a bus of the target color and change them to the replacement color. In practical applications, flood fill algorithms can be constructed in various ways, and all of the various ways use queue or stack data structures explicitly or implicitly. For example, there are 4-neighborhood flood fill algorithms, 8-neighborhood flood fill algorithms, scanline fill algorithms, and large-scale behavior. The idea of ​​the traditional 4-neighborhood flood fill algorithm is to color a pixel point (x,y) and then color the four surrounding points above, below, left, and right. The recursive method consumes a lot of memory, and if the area that needs to be colored is very large, it will cause overflow, so the non-recursive 4-neighborhood flood fill algorithm can be adopted. In addition, the 8-neighborhood flood fill algorithm is to color all of the top, bottom, left, right, top left, bottom left, top right and bottom right of a pixel point. The scan line algorithm can use the fill line to accelerate the algorithm, and first color the pixel points in a line, and then expand in order from top to bottom until the coloring is completed. Large-scale behavior can be data-centered or flow-centered.

[0097] Since the boundary of the cavity filling image is irregular, the embodiment adopts a scan line algorithm, and takes the boundary of the foreground region to be processed containing 1000 pixels as an example, and uses a morphological processing method to extend K pixels outward from each of the 1000 pixels, assuming that K is 2, in addition to the original 1000 pixels, 2000 pixels are added as the foreground region to obtain the resultant image. In practical application, the specific M pixels and K pixels should be flexibly determined according to the actual situation.

[0098] In the embodiment of the present application, another method for generating a result image is provided, in which the above method can make the filtered image clear and improve the visual effect by median filtering without damaging the feature information such as the contour and edge of the image, and then the morphological processing is performed on the filtered image by flood-fill algorithm, which can improve the accuracy and integrity of the result image.

[0099] Preferably, in another preferred embodiment of the medical image processing method provided by the embodiment of the present application, in addition to the embodiment corresponding to FIG. 2, the step of acquiring the medical image to be processed includes: Obtaining an original medical image; Extracting sub-images from an original medical image using a sliding window; When it is detected that the sub medical image includes a pathological tissue region, the sub medical image is determined to be a medical image to be processed; If it is detected that the sub-medical image does not include a pathological tissue region, the method may include determining the sub-medical image as a background image and removing the background image.

[0100] In this embodiment, the medical image processing device obtains an original medical image, and then extracts a sub-medical image from the original medical image using a sliding window. If it is detected that the sub-medical image contains a pathological tissue region, it determines the sub-medical image as a medical image to be processed. If it is detected that the sub-medical image does not contain a pathological tissue region, it determines the sub-medical image as a background image and removes the background image. Specifically, the original medical image may be an image received by the medical image processing device via a wired network, or may be an image stored in the medical image processing device itself.

[0101] For ease of understanding, please refer to FIG. 8. FIG. 8 is a diagram showing one embodiment of acquisition of a medical image to be processed in an embodiment of the present application. As shown in the figure, FIG. 8(A) shows an original medical image, and a sub-medical image is extracted from the original medical image using a sliding window, among which, the area surrounded by B1 to B3 is a sub-medical image extracted from the original medical image, so that a sub-medical image as shown in FIG. 8(B) can be obtained correspondingly from B1, a sub-medical image as shown in FIG. 8(C) can be obtained correspondingly from B2, and a sub-medical image as shown in FIG. 8(D) can be obtained correspondingly from B3. As can be seen from this, since the sub-medical images shown in FIG. 8(B) and (C) include a pathological tissue region, the sub-medical images shown in FIG. 8(B) and (C) can be determined as a medical image to be processed, but since the sub-medical image shown in FIG. 8(D) does not include a pathological tissue region, the sub-medical image shown in FIG. 8(D) can be determined as a background image, and the background image can be removed.

[0102] In the embodiment of the present application, a method for obtaining a kind of target medical image is provided, and the target medical image is determined by detecting whether the sub-medical image contains a pathological tissue region according to the above method, and the target medical image containing the pathological tissue region can obtain a result image corresponding to the target medical image according to the above steps, and the result image contains the pathological tissue region, so that the pathological tissue region in the result image can be easily processed and analyzed.Then, the sub-medical image not containing the pathological tissue region is determined as a background image, and the background image is removed, thereby reducing the resource occupancy rate.

[0103] Preferably, in another preferred embodiment of the medical image processing method provided by the embodiment of the present application, in addition to the embodiment corresponding to FIG. 2, after generating a result image based on the binarized image, generating a target positive sample image based on the result image, where the target positive sample image belongs to one positive sample image in the positive sample set, and each positive sample image includes a pathological tissue region; Obtaining a negative sample set, where the negative sample set includes at least one negative sample image, and each negative sample image does not include a pathological tissue region; The method may further include training an image processing model based on the positive sample set and the negative sample set.

[0104] In this embodiment, the medical image processing device generates a result image based on the binarized image, and then generates a target positive sample image based on the result image, the target positive sample image belongs to one positive sample image in the positive sample set, and each positive sample image contains a pathological tissue area, and then obtains a negative sample set, the negative sample set includes at least one negative sample image, and each negative sample image does not contain a pathological tissue area, and finally, an image processing model can be trained based on the obtained positive sample set and negative sample set. The image processing model can be processed based on a color medical image to obtain the corresponding pathological tissue area.

[0105] In an embodiment of the present application, a method for training an image processing model is provided, and the image processing model is trained in the above manner based on a set of positive sample images containing pathological tissue areas and a set of negative samples not containing pathological tissue areas, thereby improving the accuracy and reliability of the image processing model and improving the efficiency and accuracy of image processing.

[0106] Specifically, the embodiment of the present application can improve the accuracy of the extracted pathological tissue region and have a positive effect on subsequent image analysis. For easy understanding of the embodiment of the present application, please refer to Figure 9. Figure 9 is a diagram showing the flow of the medical image processing method in the embodiment of the present application, and is specifically as follows. In step S1, an original medical image is acquired. In step S2, a medical image to be processed is acquired based on the original medical image. In step S3, a difference image is generated based on the medical image to be processed. In step S4, a binarization process is performed on the differential image to obtain a binarized image. In step S5, a void-filled image is obtained based on the binarized image. In step S6, a median filter process is performed on the cavity filled image to obtain a result image.

[0107] Here, in step S1, an original medical image shown in FIG. 9(A) can be obtained, and then in step S2, a sub-medical image is extracted from the original medical image shown in FIG. 9(A) using a sliding window. If it is detected that the sub-medical image contains a pathological tissue region, it is determined to be the medical image to be processed, thereby obtaining the medical image to be processed shown in FIG. 9(B). Furthermore, in step S3, a maximum pixel value and a minimum pixel value corresponding to the target pixel point are determined from the first pixel value, the second pixel value and the third pixel value based on the first image data, the second image data and the third image data contained in the medical image to be processed, thereby generating a maximum value image and a minimum value image, and then a difference image shown in FIG. 9(C) can be obtained based on the maximum value image and the minimum value image. Furthermore, in step S4, N pixel values ​​corresponding to N pixel points are obtained based on the difference image shown in Fig. 9(C), the pixel values ​​and the pixel points have a one-to-one correspondence relationship, the maximum value of the N pixel values ​​is determined as a reference pixel value, a binarization threshold is calculated based on the reference pixel value and a preset ratio, and if the pixel value corresponding to the pixel point in the difference image is equal to or greater than the binarization threshold, the pixel point is determined as a foreground pixel point of the binarized image, and if the pixel value corresponding to the pixel point in the difference image is less than the binarization threshold, the pixel point is determined as a background pixel point of the binarized image, thereby obtaining the binarized image shown in Fig. 9(D). In step S5, a background region including a plurality of background pixel points in the binarized image is detected using a flood fill algorithm, and then, based on the binarized image and the background region in the binarized image, background pixel points in the foreground region in the binarized image are obtained, and the background pixel points in the foreground region in the binarized image are changed to foreground pixel points, thereby obtaining the cavity-filled image shown in Fig. 9(E). In step S6, a median filter process is performed on the cavity-filled image to obtain a filter image including the foreground region to be processed, and a boundary line including M pixel points in the foreground region to be processed is obtained. For each of the M pixel points on the boundary line, K pixel points are extended outward to obtain the result image shown in FIG. 9(F), where: M is an integer greater than 1.

[0108] Furthermore, a result image can be generated for different target medical images. With reference to FIG. 10, FIG. 10 is a diagram showing one example of a result image in an embodiment of the present application. As shown, FIG. 10(A) shows a target medical image in which pure white and gray exist, and the result image shown in FIG. 10(B) can be obtained by the medical image processing method provided by the embodiment of the present application. FIG. 10(C) shows a target medical image in which regular vertical stripes exist, and the regular vertical stripes are generated by the scanner scanning the glass slide, and the occurrence of the regular vertical stripes depends on the scanning device, and the result image shown in FIG. 10(D) can be obtained by the medical image processing method provided by the embodiment of the present application. Next, FIG. 10(E) shows a target medical image in which black and white stripes exist, and the black and white stripes may be generated by format conversion or may be an unclear area generated by the scanner scanning the glass slide, and black and white stripes occur in the part of the area, and the result image shown in FIG. 10(F) can be obtained by the medical image processing method provided by the embodiment of the present application. Therefore, prior to performing binarization processing on the image, a difference image is generated using the color information of different channels. Since the difference in color information of grayscale pixel points in different channels is small and the difference in color information of color pixel points in different channels is large, the color information in the various medical images to be processed shown in FIG. 10 can be effectively utilized. The pathological tissue area extracted based on the difference image is more accurate and can have a positive impact on subsequent image analysis.

[0109] In the following, combining the above description, the image processing method of the present application will be described with reference to FIG. 11. FIG. 11 is a diagram showing one embodiment of the image processing method of the present application. As shown in the figure, one embodiment of the image processing method of the present application includes the following steps:

[0110] In step 201, a first processing target image and a second processing target image are obtained, where the first processing target image is a color image and includes first image data, second image data and third image data, and the first image data, the second image data and the third image data respectively correspond to color information in different channels.

[0111] In this embodiment, the image processing device can obtain a first processing target image and a second processing target image, and the first processing target image can include first image data, second image data, and third image data, and the first image data, second image data, and third image data correspond to color information in different channels, respectively. Here, the first processing target image and the second processing target image may be images received by the image processing device via a wired network, or may be images stored in the image processing device itself. Specifically, the first processing target image is similar to the processing target medical image described in step 101, and therefore will not be described here.

[0112] In addition, in practical applications, the specific color information corresponding to the first image data, the second image data, and the third image data should be flexibly determined according to the actual situation. The image processing device may be disposed in a server or in a terminal device having high computing power, and this embodiment takes the image processing device disposed in the server as an example.

[0113] Specifically, the first processing target image is assumed to be a photograph taken on a cloudy day, with a cloudy background and a red passenger car in the background, and the second processing target image is a photograph of a blue sky and sea.

[0114] In step 202, a difference image is generated based on the first image data, the second image data, and the third image data.

[0115] In this embodiment, the image processing device can generate a difference image based on the first image data, the second image data, and the third image data included in the first processing target image acquired in step 201. Specifically, the difference image is a grayscale image. The method of generating the difference image in this embodiment is similar to the embodiment corresponding to FIG. 2, so the description will be omitted here.

[0116] Specifically, the contour of the car can be seen from the difference image generated in this case.

[0117] In step 203, a binarization process is performed on the difference image to obtain a binarized image, the foreground region of which corresponds to the pathological tissue region of the medical image to be processed.

[0118] In this embodiment, the image processing device can obtain a binary image by performing binarization processing on the difference image generated in step 202. Specifically, in this embodiment, foreground processing is performed by an adaptive binarization method, that is, a binary image is obtained by performing binarization processing on the difference image. The method of generating a binary image in this embodiment is similar to the embodiment corresponding to Fig. 2, so a description thereof will be omitted here.

[0119] Specifically, the binarized image generated in this case can accurately present the contour of the passenger vehicle.

[0120] In step 204, the target object is extracted from the first target image based on the foreground region of the binarized image.

[0121] In this embodiment, the image processing device can extract a target object from the first processing target image based on the foreground region generated in step 203. If the first processing target image is a medical image, the target object can be a pathological tissue region. If the first processing target image is a high-resolution remote sensing image, the target object can be a vegetation cover region. If the first processing target image is a real-time road condition monitoring image, the target object can be a bicycle or a car.

[0122] Specifically, in this case, an image of the car can be cut out from the first processing target image, that is, the image of the car becomes the target object.

[0123] In step 205, a composite image is generated based on the target object and the second target image, where the target object is located in a first layer, the second target image is located in a second layer, and the first layer is overlaid on the second layer.

[0124] In this embodiment, the image processing device can generate a composite image by setting a target object in a first layer, setting a second processing target image in a second layer, and overlaying the first layer on top of the second layer.

[0125] Specifically, a composite image is formed by overlaying an image of a car with a photograph of blue sky and white clouds, such that the car appears to be behind a blue sky and white clouds rather than overcast skies.

[0126] In the embodiment of the present application, an image processing method is provided. According to the above method, since the difference in color information of grayscale pixel points in different channels is small and the difference in color information of color pixel points in different channels is large, before performing binarization processing on the image, a difference image is generated using the color information of different channels, so that the color information in the image can be effectively utilized, and the target object extracted based on the difference image is more accurate. Therefore, the target object in the composite image generated by covering the layer in which the target object is located on the layer in which the second image to be processed is located is accurate, which improves the accuracy of the composite image and has a positive impact on subsequent image analysis.

[0127] Hereinafter, the medical image processing device of the present application will be described in detail with reference to FIG. 12. FIG. 12 is a diagram showing one embodiment of the medical image processing device of the present application. The medical image processing device 300 includes: An acquisition module 301 for acquiring a medical image to be processed, where the medical image to be processed is a color image, and the medical image to be processed includes first image data, second image data and third image data, and the first image data, the second image data and the third image data respectively correspond to color information in different channels; a generation module 302 for generating a difference image based on the first image data, the second image data, and the third image data; The processing module includes a processing module 303 for performing binarization processing on the difference image to obtain a binary image, wherein the foreground region of the binary image corresponds to a first processing target image included in the pathological tissue region of the processing target medical image.

[0128] In the embodiment of the present application, a medical image processing method is provided. According to the above method, the difference in color information of grayscale pixel points in different channels is small, but the difference in color information of color pixel points in different channels is large. Therefore, before performing binarization processing on the image, a difference image is generated using the color information of different channels, so that the color information in the image can be effectively utilized, and the pathological tissue area extracted based on the difference image can be more accurate and have a positive impact on subsequent image analysis.

[0129] Preferably, in another embodiment of the medical image processing device 300 provided by the embodiment of the present application, in addition to the embodiment corresponding to FIG. 12, The generating module 302 generates a maximum value image and a minimum value image based on the first image data, the second image data, and the third image data included in the medical image to be processed; A difference image is generated based on the maximum value image and the minimum value image.

[0130] In the embodiments of the present application, a method for generating a difference image is provided, and a maximum value image and a minimum value image are generated based on the first image data, the second image data and the third image data using the above method. Since the color information corresponding to the different image data is different, the color information of the medical image to be processed contained in the maximum value image and the minimum value image determined based on the different image data is highly accurate, and the accuracy of the generation of the difference image can be improved.

[0131] Preferably, in another embodiment of the medical image processing device 300 provided by the embodiment of the present application, in addition to the embodiment corresponding to FIG. 12, Specifically, the generating module 302 determines a maximum pixel value and a minimum pixel value based on a first pixel value at a first pixel position in the first image data, a second pixel value at a second pixel position in the second image data, and a third pixel value at a third pixel position in the third image data; This is for obtaining a maximum value image based on a maximum pixel value and a minimum value image based on a minimum pixel value, where the pixel value at the fourth pixel position in the maximum value image is the maximum pixel value and the pixel value at the fifth pixel position in the minimum value image is the minimum pixel value, and the first pixel position, the second pixel position, the third pixel position, the fourth pixel position and the fifth pixel position all correspond to the positions of the same pixel point in the medical image to be processed.

[0132] Specifically, the generating module 302 determines a pixel difference value based on a pixel value at a fourth pixel position in the maximum value image and a pixel value at a fifth pixel position in the minimum value image; This is for obtaining a difference image based on a pixel difference value, and the pixel value of the sixth pixel position in the difference image is the pixel difference value, and the fourth pixel position, the fifth pixel position and the sixth pixel position all correspond to the position of the same pixel point in the medical image to be processed.

[0133] In an embodiment of the present application, a method for generating a maximum value image is provided, in which a maximum pixel value and a minimum pixel value are determined according to pixel values ​​of target pixel points corresponding to the first image data, the second image data and the third image data, and the maximum pixel value and the minimum pixel value reflect the color information of the medical image to be processed to different degrees. The maximum pixel value and the minimum pixel value are subtracted from each other to obtain a differential pixel value, so that the differential pixel value can accurately reflect the color information of the medical image to be processed, and the accuracy of generating the differential image can be improved.

[0134] Preferably, in another embodiment of the medical image processing device 300 provided by the embodiment of the present application, in addition to the embodiment corresponding to FIG. 12, The generation module 302 specifically generates a processing target difference image based on the first image data, the second image data, and the third image data; This is for obtaining a difference image by performing Gaussian blurring on the difference image to be processed.

[0135] In the embodiment of the present application, another method for generating a difference image is provided, and a Gaussian blurring process is performed on the generated difference image to be processed according to the above method. The Gaussian blurring process can improve the robustness, so that the obtained difference image has good robustness and the stability of the difference image can be improved.

[0136] Preferably, the medical image processing apparatus 300 according to another embodiment of the present application further includes a determination module 304 in addition to the embodiment corresponding to FIG.

[0137] The determining module 304 is for determining a binarization threshold based on the difference image.

[0138] The determining module 304 is for further performing a binarization process on the difference image based on the binarization threshold to obtain a binarized image.

[0139] In the embodiment of the present application, a method for obtaining a binary image is provided. By generating a binary image based on a binarization process in the above manner, the geometric properties of the binary image are independent of the pixel gradation values, which simplifies the subsequent processing of the binary image and improves the efficiency of generating the foreground region.

[0140] Preferably, in another embodiment of the medical image processing device 300 provided by the embodiment of the present application, in addition to the embodiment corresponding to FIG. 12, The determining module 304 specifically obtains N pixel values ​​corresponding to the N pixel points according to the difference image, where the pixel values ​​and the pixel points have a one-to-one corresponding relationship, and N is an integer greater than 1; determining a reference pixel value from the N pixel values, where the reference pixel value is a maximum value of the N pixel values; This is for determining a binarization threshold based on the reference pixel value and a preset ratio.

[0141] In the embodiment of the present application, another method for obtaining a binarization threshold is provided, in which the binarization threshold can be obtained according to a reference pixel value determined based on the maximum pixel value and a preset ratio. Since there may be differences in the number of gradations in the differential image and different regions may have different light and dark distributions, the binarization threshold can be flexibly determined by adjusting the preset ratio, thereby improving the accuracy and flexibility of the threshold and improving the accuracy of generating a binary image.

[0142] Preferably, in another embodiment of the medical image processing device 300 provided by the embodiment of the present application, in addition to the embodiment corresponding to FIG. 12, The generating module 302 specifically uses a flood-fill algorithm to detect a background region in the binarized image, where the background region includes a plurality of background pixel points; Obtain background pixel points in a foreground region in the binarized image based on the binarized image and a background region in the binarized image, where the foreground region includes a plurality of foreground pixel points; The background pixel points in the foreground region of the binarized image are changed to foreground pixel points to obtain a cavity-filled image; A median filter process is performed on the cavity-filled image to obtain a resultant image, the foreground region of the resultant image corresponding to the pathological tissue region of the medical image to be processed.

[0143] In the embodiment of the present application, a method for generating a resultant image is provided, in which the background pixel points in the foreground area are changed to foreground pixel points in the above manner to obtain a cavity-filled image with high reliability. Furthermore, the median filter processing can make the resultant image corresponding to the medical image to be processed clear and improve the visual effect without damaging the characteristic information such as the contour and edge of the image.

[0144] Preferably, in another embodiment of the medical image processing device 300 provided by the embodiment of the present application, in addition to the embodiment corresponding to FIG. 12, The processing module 303 specifically performs a median filter process on the cavity-filled image to obtain a filtered image; Obtain a boundary line of a foreground region in the filtered image, where the boundary line includes M pixel points, where M is an integer greater than 1; For each of the M pixel points on the boundary line, K pixel points are extended outward to obtain a resultant image, where K is an integer equal to or greater than 1.

[0145] In the embodiment of the present application, another method for generating a result image is provided, in which the above method can make the filtered image clear and improve the visual effect by median filtering without damaging the feature information such as the contour and edge of the image, and then the morphological processing is performed on the filtered image by flood-fill algorithm, which can improve the accuracy and integrity of the result image.

[0146] Preferably, in another embodiment of the medical image processing device 300 provided by the embodiment of the present application, in addition to the embodiment corresponding to FIG. 12, The acquisition module 301 specifically acquires an original medical image; Extracting sub-images from the original medical image using a sliding window; If a pathological tissue region is detected in the sub medical image, the sub medical image is determined to be a medical image to be processed; When it is detected that the secondary medical image does not include a pathological tissue region, the secondary medical image is determined to be a background image, and the background image is removed.

[0147] In the embodiment of the present application, a method for obtaining a kind of target medical image is provided, and the target medical image is determined by detecting whether the sub-medical image contains a pathological tissue region according to the above method, and the target medical image containing the pathological tissue region can obtain a result image corresponding to the target medical image according to the above step, and the result image contains the pathological tissue region, so that the subsequent processing and analysis of the pathological tissue region in the result image is easy. Then, the sub-medical image not containing the pathological tissue region is determined as a background image, and the background image is removed, thereby reducing the resource occupancy rate.

[0148] Preferably, in another embodiment of the medical image processing device 300 provided by the embodiment of the present application, in addition to the embodiment corresponding to FIG. 12, further includes a training module 305: The generating module 302 is further for generating a target positive sample image according to the target image and the foreground region of the target image, where the target positive sample image belongs to one positive sample image in the positive sample set, and each positive sample image includes a pathological tissue region; The acquiring module 301 is further for acquiring a negative sample set, where the negative sample set includes at least one negative sample image, and each negative sample image does not include a pathological tissue region; The training module 305 is for training an image processing model based on the positive sample set and the negative sample set.

[0149] In an embodiment of the present application, a method for training an image processing model is provided, and the image processing model is trained in the above manner based on a set of positive sample images containing pathological tissue areas and a set of negative samples not containing pathological tissue areas, thereby improving the accuracy and reliability of the image processing model and improving the efficiency and accuracy of image processing.

[0150] Hereinafter, the image processing device of the present application will be described in detail with reference to FIG. 13. FIG. 13 is a diagram showing one embodiment of the image processing device of the present application. The image processing device 400 includes: an acquisition module 401 for acquiring a first processing target image and a second processing target image, where the first processing target image is a color image, and the first processing target image includes first image data, second image data and third image data, and the first image data, the second image data and the third image data respectively correspond to color information in different channels; a generation module 402 for generating a difference image based on the first image data, the second image data, and the third image data; a processing module for performing a binarization process on the difference image to obtain a binarized image, wherein the foreground region of the binarized image is 1. Processing vs. elephant painting a processing module 403 corresponding to the histopathological region of the image; an extraction module 404 for extracting a target object from the first processing target image based on a foreground region of the binarized image; The generation module 402 is further for generating a composite image based on the target object and the second processed image, where the target object is located in a first layer, the second processed image is located in a second layer, and the first layer is overlaid on the second layer.

[0151] In the embodiment of the present application, an image processing method is provided. According to the above method, since the difference in color information of grayscale pixel points in different channels is small and the difference in color information of color pixel points in different channels is large, before performing binarization processing on the image, a difference image is generated using the color information of different channels, so that the color information in the image can be effectively utilized, and the target object extracted based on the difference image is more accurate. As a result, the target object in the composite image generated by covering the layer in which the target object is located on the layer in which the second processed image is located is accurate, which improves the accuracy of the composite image and has a positive impact on subsequent image analysis.

[0152] FIG. 14 is a diagram showing the structure of a server provided by an embodiment of the present application. The server 500 may have a large difference due to the difference in configuration and performance, and may include one or more central processing units (CPUs) 522 (e.g., one or more processors), a memory 532, and one or more storage media 530 (e.g., one or more mass storage devices) for storing an application program 542 or data 544. Here, the memory 532 and the storage medium 530 may be temporary or permanent. The program stored in the storage medium 530 may include one or more modules (not shown), and each module may include a series of command operations for the server. Furthermore, the CPU 522 may be configured to communicate with the storage medium 530 and execute the series of command operations in the storage medium 530 in the server 500.

[0153] The server 500 may include one or more power sources 525, one or more wired or wireless network interfaces 550, one or more input / output interfaces 558, and / or a variety of other hardware components, such as a Windows Server 2003 (S2003 R2) or a Windows 8 operating system. TM , MacOSX TM , Unix TM , Linux TM , FreeBSDTM The processor 541 may further include one or more operating systems 541, such as

[0154] The steps performed by the server in the above embodiment may be performed based on the server structure shown in FIG.

[0155] In this embodiment, the CPU 522 is for executing the steps performed by the medical image processing device in the embodiment corresponding to FIG. 2, and the CPU 522 is further for executing the steps performed by the image processing device in the embodiment corresponding to FIG. 1.

[0156] As can be clearly understood by those skilled in the art, for convenience and brevity of description, the specific operating processes of the above-described systems, devices and units may refer to the corresponding processes in the above method embodiments, and therefore the description thereof will be omitted here.

[0157] It should be noted that the systems, devices, and methods disclosed in some embodiments provided in the present application may be realized in other ways. For example, the device embodiments described above are merely illustrative, and the division of the units is merely based on logical functions, and may be divided in other ways in actual implementation. For example, multiple units or assemblies may be combined or incorporated into other systems, or some features may be omitted or not implemented. In addition, the mutual couplings, direct couplings, or communicative connections shown or discussed may be realized by interfaces, and the indirect couplings or communicative connections of devices or units may be realized in electrical or other forms.

[0158] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, and may be located in one place or distributed among multiple network units, and some or all of the units may be selected according to actual needs to achieve the objective of the technical solution of the embodiment.

[0159] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The integrated units may be realized by hardware or software functional units.

[0160] When the integrated unit is realized by a software function unit and sold or used as an independent product, it may be stored in one computer-readable storage medium. Based on this, the technical means of the present invention can be embodied as a software product, either in its essential form or in its contribution to the prior art, or in its entirety or in part, and the computer software product is stored in a storage medium and includes some instructions for making a computer (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present invention. The storage medium includes various media capable of storing program codes, such as U disks, removable hard disks, ROMs (read-only memory), RAMs (random access memory), magnetic disks, or optical disks.

[0161] As mentioned above, the above examples are merely for explaining the technical means of the present application, and are not intended to limit it. Although the present application has been described in detail with reference to the above examples, a person skilled in the art may still modify the technical means described in each of the above examples, or replace some of the technical features therein with equivalents, and these modifications or replacements do not cause the essence of the corresponding technical means to deviate from the spirit and scope of the technical means of each of the embodiments of the present application. [Explanation of symbols]

[0162] 300 Medical image processing device 301 Acquisition Module 302 Generation Module 303 Processing Module 304 Decision Module 305 Training Modules 400 Image processing device 401 Acquisition Module 402 Generation Module 403 Processing Module 404 Extraction Module 500 servers 522 CPU 526 Power supply 530 Storage medium 532 Memory 541 Operating Systems 542 Application Program 544 Data 550 Wired or wireless network interface 558 Input / Output Interface

Claims

1. A medical image processing method executed by a server, comprising: acquiring a medical image to be processed, the medical image to be processed being a color image, and including first image data, second image data, and third image data, the first image data, the second image data, and the third image data each corresponding to color information in a different channel; generating a difference image based on the first image data, the second image data, and the third image data; performing a binarization process on the difference image to obtain a binarized image, the foreground region of the binarized image corresponding to a pathological tissue region of the processing target medical image; Including, A medical image processing method comprising:

2. a step of converting the first image data, the second image data, and the third image data from a first color mode to a second color mode after the step of acquiring the medical image to be processed and before the step of generating the difference image; The first color mode is an HSV image or a YUV image, and the second color mode is an RGB image. The method of claim 1.

3. The step of generating a difference image based on the first image data, the second image data, and the third image data includes: generating a maximum value image and a minimum value image based on the first image data, the second image data, and the third image data included in the medical image to be processed; generating the difference image based on the maximum image and the minimum image.

3. The method according to claim 1 or 2.

4. The step of generating a maximum image and a minimum image based on the first image data, the second image data, and the third image data includes: determining a maximum pixel value and a minimum pixel value based on a first pixel value at a first pixel location in the first image data, a second pixel value at a second pixel location in the second image data, and a third pixel value at a third pixel location in the third image data; acquiring a maximum value image based on the maximum pixel value and acquiring a minimum value image based on the minimum pixel value, wherein a pixel value at a fourth pixel position in the maximum value image is the maximum pixel value, a pixel value at a fifth pixel position in the minimum value image is the minimum pixel value, and the first pixel position, the second pixel position, the third pixel position, the fourth pixel position, and the fifth pixel position all correspond to positions of an identical pixel point in the medical image to be processed, The step of generating the difference image based on the maximum value image and the minimum value image includes: determining a pixel difference value based on a pixel value at the fourth pixel location in the maximum value image and a pixel value at the fifth pixel location in the minimum value image; acquiring a difference image based on the pixel difference value, wherein a pixel value of a sixth pixel position in the difference image is the pixel difference value, and the fourth pixel position, the fifth pixel position, and the sixth pixel position all correspond to positions of a same pixel point in the medical image to be processed; 4. The method according to claim 3 .

5. The step of generating a difference image based on the first image data, the second image data, and the third image data includes: generating a processing target difference image based on the first image data, the second image data, and the third image data; and performing a Gaussian blur process on the target difference image to obtain a difference image.

3. The method according to claim 1 or 2.

6. The step of performing a binarization process on the difference image to obtain a binarized image includes: determining a binarization threshold based on the difference image; and performing a binarization process on the difference image based on the binarization threshold to obtain a binarized image.

3. The method according to claim 1 or 2.

7. The step of determining a binarization threshold based on the difference image includes: obtaining N pixel values ​​corresponding to N pixel points based on the difference image, the pixel values ​​and the pixel points having a one-to-one correspondence, and N being an integer greater than 1; determining a reference pixel value from the N pixel values, the reference pixel value being the maximum value of the N pixel values; determining a binarization threshold based on the reference pixel value and a preset ratio; 7. The method of claim 6.

8. detecting a background region in the binarized image using a flood-fill algorithm, the background region including a plurality of background pixel points; obtaining background pixel points in the foreground region in the binarized image based on the binarized image and a background region in the binarized image, the foreground region including a plurality of foreground pixel points; changing background pixel points in a foreground region in the binarized image to foreground pixel points to obtain a void-filled image; performing a median filter process on the cavity-filled image to obtain a resultant image, the foreground region of the resultant image corresponding to a pathological tissue region of the target medical image; 3. The method according to claim 1 or 2.

9. The step of performing a median filtering process on the cavity filled image to obtain a resultant image includes: performing a median filtering process on the cavity filled image to obtain a filtered image; obtaining a boundary of a foreground region in the filtered image, the boundary including M pixel points, where M is an integer greater than 1; and expanding K pixel points outward for each of the M pixel points on the boundary line to obtain a resultant image, where K is an integer greater than or equal to 1.

9. The method of claim 8.

10. The step of acquiring a medical image to be processed includes: Obtaining an original medical image; Extracting a sub-image from the original medical image using a sliding window; When it is detected that the sub medical image includes a pathological tissue region, the sub medical image is determined to be the medical image to be processed; and if it is detected that the sub medical image does not include a pathological tissue region, determining the sub medical image as a background image and removing the background image.

3. The method according to claim 1 or 2.

11. generating a target positive sample image based on the target medical image and the foreground region of the target medical image, the target positive sample image belonging to one positive sample image in a positive sample set, and each positive sample image including a pathological tissue region; A step of obtaining a negative sample set, the negative sample set including at least one negative sample image, and each negative sample image including no pathological tissue region; training an image processing model based on the positive sample set and the negative sample set.

11. The method according to any one of claims 1 to 10.

12. An image processing method executed by a server, comprising: acquiring a first processing target image and a second processing target image, the first processing target image being a color image, and including first image data, second image data and third image data, the first image data, the second image data and the third image data respectively corresponding to color information in different channels; generating a difference image based on the first image data, the second image data, and the third image data; performing a binarization process on the difference image to obtain a binarized image, the foreground region of the binarized image corresponding to the pathological tissue region of the first processing target image; extracting a target object from the first processing target image based on a foreground region of the binarized image; generating a composite image based on the target object and the second target image, the target object being located on a first layer, the second target image being located on a second layer, and the first layer being overlaid on the second layer; 13. An image processing method comprising:

13. After the step of obtaining the first processing target image and the second processing target image, and before the step of generating the difference image, the method includes a step of converting the first image data, the second image data and the third image data from a first color mode to a second color mode, The first color mode is an HSV image or a YUV image, and the second color mode is an RGB image. The method of claim 12.

14. an acquisition module for acquiring a medical image to be processed, the medical image to be processed being a color image, and the medical image to be processed includes first image data, second image data, and third image data, the first image data, the second image data, and the third image data each corresponding to color information in a different channel; a generation module for generating a difference image based on the first image data, the second image data, and the third image data; a processing module for performing a binarization process on the difference image to obtain a binarized image, the foreground region of the binarized image corresponding to a pathological tissue region of the processing target medical image; 2. A medical image processing apparatus comprising:

15. an acquisition module for acquiring a first processing target image and a second processing target image, the first processing target image being a color image, and the first processing target image including first image data, second image data and third image data, the first image data, the second image data and the third image data respectively corresponding to color information in different channels; a generation module for generating a difference image based on the first image data, the second image data, and the third image data; a processing module for performing a binarization process on the difference image to obtain a binarized image, the foreground region of the binarized image corresponding to a target object of the first processing target image; an extraction module for extracting the target object from the first target image based on a foreground region of the binarized image; the generating module is further for generating a composite image based on the target object and the second target image, the target object being located on a first layer, the second target image being located on a second layer, and the first layer being overlaid on the second layer.

13. An image processing device comprising:

16. A memory, a transceiver, a processor, and a bus system, The memory is for storing a program, The processor is adapted to execute a program stored in the memory to implement the method according to any one of claims 1 to 11 or the method according to claim 12, the bus system is for communicatively connecting the memory and the processor; 23. A computer apparatus comprising:

17. A program causing a processor included in a computer device to carry out the method according to any one of claims 1 to 11 or the method according to claim 12.

Citation Information

Patent Citations

  • Verification code sample collection method and system

    CN106469267A

  • Pattern inspection device

    JP1996279046A

  • Digital image processing method

    JP2001101426A

  • Method and program for extracting mask image, and method and program for constructing voxel data

    JP2011048627A

  • Cancer cell region extraction device, method and program

    JP2013238459A