Medical image detail enhancement method
By improving the area growth algorithm, combining grayscale values and texture similarity to determine the preferred degree of pixel points, the problem of blurred details and insufficient contrast in medical images is solved, and more accurate image segmentation and contrast enhancement are achieved, and diagnostic accuracy is improved.
Patent Information
- Application Number
- CN202510643852.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-19
- Publication Date
- 2025-08-15
AI Technical Summary
There are problems of blurred details and insufficient contrast in medical images, resulting in inaccurate regional segmentation, affecting the detection rate of lesions and diagnostic accuracy.
By improving the region growth algorithm, the grayscale value and texture similarity of each newly added pixel point are calculated, the degree of preference is judged based on the gradient value, accurate region growth and segmentation are performed, and contrast enhancement is performed.
It improves image segmentation accuracy, reduces noise interference, enhances the visualization of lesions and important structures, and improves diagnostic accuracy.
Smart Images

Figure CN120495154A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing, and in particular to a method for enhancing medical image details. Background Art
[0002] With the rapid development of medical imaging technology, devices such as CT, MRI, X-rays, and ultrasound have become core tools for disease diagnosis. However, due to limitations in imaging principles, device resolution, and noise interference, medical images often suffer from blurred details and insufficient contrast, directly impacting the detection rate of early lesions. Medical image enhancement can be used to enhance detail and suppress noise.
[0003] In the process of segmenting medical images through region growing and enhancing the image contrast of each region, due to the poor quality of medical imaging phenomena and the chaotic changes in the grayscale values of regional pixels, it is difficult to obtain accurate segmentation if the region is directly segmented using the region growing algorithm, resulting in the subsequent contrast enhancement algorithm being unable to obtain good results and the important areas not being able to obtain more obvious detail enhancement. Summary of the Invention
[0004] In order to solve the above technical problems, the present application provides a method for enhancing medical image details.
[0005] In a first aspect, the present application provides a method for enhancing medical image details, which adopts the following technical solutions: A method for enhancing medical image details comprises the following steps: obtaining a grayscale image of the medical image; performing region growing based on the grayscale image to obtain an image segmentation result based on the region growing; and performing contrast enhancement on each segmented region based on the image segmentation result; Among them, the method for performing region growing based on a grayscale image is as follows: obtaining an initial seed point in the grayscale image, performing region growing of the grayscale value based on the initial seed point to obtain an initial region, performing region growing based on the initial region, and in response to the region range being greater than a preset threshold, taking the pixel points adjacent to the region as the pixel points to be added; calculating the initial preference of the pixel points to be added; performing maximum value judgment based on the gradient of the pixel points to be added and calculating the maximum value adjustment factor; multiplying the maximum value adjustment factor by the initial preference degree to obtain the preference degree of each pixel point to be added; in response to the preference degree being less than the preference degree threshold, dividing the pixel points to be added into the growth region to complete the region growing.
[0006] Optionally, the expression of the initial preference is: Where, Indicates the The first The initial optimization degree of the pixels to be added, Indicates the The first Grayscale value of the pixel to be added, Indicates the The grayscale mean of the region, Indicates the The standard deviation of the gray value of the region, Indicates The exponential function with base , Indicates the The first growth area The number of adjacent angles of the pixel points to be added, Indicates the The first The pixel to be added is in Texture matching factor in each direction.
[0007] Optionally, the texture matching factor can be expressed as: Where, Indicates the The first The pixel to be added is in Texture matching factor in each direction, Indicates the The first growth area The pixel to be added Texture pixel value pairs in each direction, Indicates the The first growth area The direction of Texture pixel pairs of the texture, represents the Euclidean distance, Indicates the The first growth area The direction of The frequency of texel pairs for a texture.
[0008] Optionally, the maximum adjustment factor is calculated as: Where, Indicates the The first growth area The maximum adjustment factor of the pixel to be added, Indicates the number of local pixels to be added. Indicates the pixel to be added The gradient value of a local pixel, Indicates the gradient value of the pixel to be added, represents the minimum function.
[0009] Optionally, the method for obtaining the initial seed points in the grayscale image is: performing corner point detection on the grayscale image and using all corner points as initial seed points.
[0010] Optionally, perform tile segmentation on the grayscale image.
[0011] Optionally, the initial region is obtained by performing regional growth of grayscale values based on the initial seed point, including: setting an initial range, performing regional growth of grayscale values based on the initial seed point, stopping regional growth when the area of the region where the seed point is located is larger than the initial range, marking the seed points whose area cannot grow to a size larger than the initial range as noise points and eliminating them, to obtain all the initial regions.
[0012] Optionally, adjacent pixels in the initial area are used as pixels to be added, and the adjacency is eight-adjacency or four-adjacency.
[0013] Optionally, the medical image is an X-ray image, a CT image, or an MRI image.
[0014] In a second aspect, the present application provides a medical image detail enhancement system, which adopts the following technical solutions: A medical image detail enhancement system comprises: a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the medical image detail enhancement method described above is implemented.
[0015] This application has the following technical effects: The growth strategy of the region growing algorithm is improved based on the grayscale complexity of the pixels in the medical image. During the region growing process, the grayscale value and texture similarity of each newly added pixel with the growing region are calculated to obtain a preliminary addition preference. The preliminary preference is then adjusted based on the maximum value of the gradient value of the pixel to obtain the preferred degree. This can obtain more accurate region growing results, accurately determine whether the pixel to be added belongs to the target region, and thus obtain more precise image segmentation results. It effectively reduces noise interference and missegmentation, improves the segmentation accuracy of detailed areas in medical images, provides a high-quality foundation for subsequent contrast enhancement, and thus improves the visualization of lesions or important structures in medical images, helping to improve diagnostic accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 This is a method flow chart of a medical image detail enhancement method according to an embodiment of the present application.
[0017] Figure 2 This is a method flow chart of step S2 in a method for enhancing medical image details in an embodiment of the present application.
[0018] Figure 3 It is a schematic diagram used to illustrate the pixel adjacency direction in the texture matching factor calculation process. DETAILED DESCRIPTION
[0019] The present application discloses a method for enhancing medical image details. Figure 1 , including steps S1 to S3: S1: Obtain a grayscale image of a medical image.
[0020] Medical images can be X-ray images, CT images or MRI images, etc. The original X-ray images or CT / MRI images are usually grayscale images. For medical images whose original images are not grayscale images, grayscale images can be obtained after grayscale processing. The existing technology will not be repeated here.
[0021] S2: Perform region growing based on the grayscale image to obtain the image segmentation result based on region growing.
[0022] Reference Figure 2 The method for performing region growing based on a grayscale image includes steps S20 to S22, which are specifically as follows: S20: Obtain an initial seed point in the grayscale image, perform region growth of the grayscale value based on the initial seed point to obtain an initial region, perform region growth based on the initial region, and in response to the region range being greater than a preset threshold, use pixel points adjacent to the region as pixel points to be added.
[0023] Specifically, the grayscale image is detected for corners, all corners are obtained as initial seed points, and the image is tiled, with the preset segmentation size being By dividing the image into several small blocks (tiles), we ensure that at least one seed point is selected in each tile. This can prevent the seed points from being too concentrated in certain areas and ignoring other areas. Preset an initial range , the experience value is Pixel points, the implementer can set the initial range size according to the actual implementation situation. The purpose of presetting the initial region range is to limit the result range of regional growth to avoid excessive expansion of the region or overlap with other regions. Specifically, regional growth of grayscale values is performed based on the initial seed point. If the area of the region where the seed point is located is larger than the initial range, regional growth is stopped. Seed points whose area cannot grow larger than the initial range are recorded as noise points and removed to obtain all initial regions. The number of initial regions is obtained and recorded as , will The number of pixels contained in the region is recorded as .
[0024] Specifically, in the process of judging whether a pixel point in an image should be added to a region, growing it according to the grayscale value of the point to be added will be affected by the smooth transition of some areas, and the actual medical image area cannot be segmented. Therefore, texture similarity and grayscale value are introduced to jointly judge whether it is a pixel point that can be added.
[0025] The non-region pixels that are eight-adjacent (8 directly adjacent pixels in the top, bottom, left, right, and diagonal directions) to each region are recorded as pixels to be added. Four-adjacent can also be used, but eight-adjacent is preferred in this application.
[0026] The first The first The gray value of the pixel to be added is recorded as , get the The number of directions of the pixels adjacent to the pixel to be added in the region (recorded as adjacent pixels) is recorded as (If there are two opposite texture directions, they are counted as one direction), Take the pixel point to be added as the center, obtain the adjacent direction of the pixel points in each adjacent area, and obtain the texture pixel value pair of each texture direction For example, see Figure 3 , each grid represents a pixel point, where there are four pixel points in the nine-square grid with point P as the center, then point P has four adjacent pixel points, and the adjacent directions of these four pixel points are (in When calculating the gray-level co-occurrence matrix, it is equivalent to ). Obtain the gray level co-occurrence matrix of all pixels in the growth area along the four directions. The gray level co-occurrence matrix is a prior art and will not be described in detail.
[0027] S21: Calculate the initial preference of the pixel to be added.
[0028] In one embodiment, the expression of the initial preference is: Where, Indicates the The first The initial optimization degree of the pixels to be added, Indicates the The first Grayscale value of the pixel to be added, Indicates the The grayscale mean of the region, Indicates the The standard deviation of the gray value of the region, Indicates The exponential function with base , Indicates the The first growth area The number of adjacent angles of the pixel points to be added, Indicates the The region's The pixels to be added are Texture matching factor in direction.
[0029] In the formula Factor used to measure the In the region The similarity between the gray value of the pixel to be added and the gray mean of the region, Indicates the absolute difference between the grayscale value of the current pixel and the grayscale mean of the region. The smaller the difference, the closer the grayscale value of the current pixel is to the overall characteristics of the region; the larger the difference, the more likely the current pixel does not belong to the region. Used to normalize grayscale difference ,when When it is larger, it means that the grayscale value distribution in the area is more dispersed, so a larger grayscale difference is allowed to exist. On the contrary, it means that the grayscale value distribution in the area is more concentrated, and the calculation result is more sensitive to the change of grayscale difference.
[0030] The expression of texture matching factor is: Where, Indicates the The first growth area The pixel to be added Texture pixel value pairs in each direction, Indicates the The first growth area The direction of Texture pixel pairs of the texture, Represents the Euclidean distance. The larger the Euclidean distance, the greater the difference between the texture characteristics of the current pixel and the reference texture characteristics; conversely, the smaller the difference. Indicates the The first growth area The direction of The frequency of texture pixel pairs in a texture. It reflects how often a specific texture pattern (i.e., pixel pair) appears in that direction. The higher the frequency, the more important or representative the texture pattern is.
[0031] The factor represents the degree of texture matching between the texture of the pixel to be added and the texture of the growth area. The higher the texture matching degree, the more matching there is between the pixel to be added and the growth area. Conversely, the less matching there is between the pixel to be added and the growth area.
[0032] S22: Perform maximum value judgment based on the gradient of the pixel to be added and calculate the maximum value adjustment factor; multiply the maximum value adjustment factor by the initial optimization degree to obtain the optimization degree of each pixel to be added.
[0033] In the process of image segmentation by region growing, the ideal result is to divide the pixels in the same area into the same region. Therefore, it is necessary to judge whether the edge of the region is touched during the growing process and to make a maximum judgment based on the pixel to be added. If the gradient of the pixel to be added is a local gradient maximum, it can be considered that the pixel may be an edge pixel, and the preference degree of the pixel needs to be reduced to stop further growing.
[0034] Specifically, the pixels in the eight-neighborhood of each pixel to be added and other pixels outside the area are obtained, and the number of pixels in the area is recorded as and the number of pixels outside the area , get the closest Euclidean distance to the pixel to be added in the growth area pixels and outside the area The pixel points are recorded as local pixel points, and the The gradient value of a pixel is recorded as , the gradient maximum adjustment factor is obtained according to the gradient of the pixel to be added and the gradient of the local data point.
[0035] In one embodiment, the maximum value adjustment factor is calculated as follows: Where, Indicates the The first growth area The maximum adjustment factor of the pixel to be added, Indicates the number of local pixels to be added. Indicates the pixel to be added The gradient value of a local pixel, Indicates the gradient value of the pixel to be added, represents the minimum function.
[0036] It represents the gradient ratio of local data to the pixel to be added. The larger the ratio is, the greater the gradient of local data is than the gradient of the pixel to be added, and the less likely the pixel to be added is an edge point. The smaller the adjustment range of the initial preference should be, so it is limited by the minimum function. If the gradient of the pixel to be added is greater than the gradient of most local pixels, it is more likely to be an edge point, and it is necessary to prevent the edge point from being divided into the growth area by reducing its initial preference, so as to achieve the purpose of stopping growth at the edge.
[0037] Multiply the maximum adjustment factor by the initial preference to obtain the preference of each pixel to be added ,in, Indicates the The region's The preference of the pixels to be added.
[0038] S23: In response to the preference level being less than the preference level threshold, the pixel points to be added are divided into a growth region to complete region growing.
[0039] Preset preference threshold The implementation personnel can set the preference threshold based on the actual implementation situation. Specifically, for each growth region, all pixels adjacent to the eight neighborhoods of the growth region are obtained as the pixels to be added. The preference is calculated. The pixels to be added whose preference exceeds the preference threshold are incorporated into the growth region, completing a region growing cycle. The image segmentation results are obtained iteratively.
[0040] S3: Perform contrast enhancement on each segmented area according to the image segmentation result.
[0041] Contrast enhancement is performed based on the grayscale value of each segmented area and the importance of the area therein, and a higher degree of contrast enhancement is performed on the segmented area containing the region of interest, so that the detail area in the medical image is enhanced to a higher degree.
[0042] An embodiment of the present application also discloses a medical image detail enhancement system, including a processor and a memory, wherein the memory stores computer program instructions. When the computer program instructions are executed by the processor, a medical image detail enhancement method according to the present application is implemented.
[0043] The above system also includes other components well known to those skilled in the art, such as a communication bus and a communication interface. The configuration and functions of these components are known in the art and will not be described in detail here.
[0044] In this application, the aforementioned memory may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, a computer-readable storage medium may be any suitable magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory, a dynamic random access memory, a static random access memory, or the like, or any other medium that can be used to store the required information and can be accessed by an application, a module, or both. Any such computer storage medium may be part of, accessible to, or connectable to a device.
[0045] The above are all preferred embodiments of the present application, and are not intended to limit the scope of protection of the present application. Therefore, any equivalent changes made based on the structure, shape, and principle of the present application should be included in the scope of protection of the present application.
Claims
1. A method for enhancing medical image details, characterized in that: The method comprises the following steps: obtaining a grayscale image of a medical image; performing region growing based on the grayscale image to obtain an image segmentation result based on the region growing; and performing contrast enhancement on each segmented region based on the image segmentation result; Among them, the method of region growing based on grayscale image is: Obtain an initial seed point in the grayscale image, perform region growing of the grayscale value based on the initial seed point to obtain an initial region, perform region growing based on the initial region, and in response to the region range being greater than a preset threshold, use pixels adjacent to the region as pixels to be added; Calculate the initial preference of the pixel to be added; perform maximum value judgment based on the gradient of the pixel to be added and calculate the maximum value adjustment factor; multiply the maximum value adjustment factor by the initial preference to obtain the preference degree of each pixel to be added; In response to the preference level being less than the preference level threshold, the pixel point to be added is divided into a growth region, thereby completing region growing.
2. The medical image detail enhancement method according to claim 1, characterized in that: The expression of initial optimization degree is: Where, Indicates the The first The initial optimization degree of the pixels to be added, Indicates the The first Grayscale value of the pixel to be added, Indicates the The grayscale mean of the region, Indicates the The standard deviation of the gray value of the region, Indicates The exponential function with base , Indicates the The first growth area The number of adjacent angles of the pixel points to be added, Indicates the The first The pixel to be added is in Texture matching factor in each direction.
3. The medical image detail enhancement method according to claim 2, characterized in that: The expression of texture matching factor is: Where, Indicates the The region's The pixel to be added is in Texture matching factor in each direction, Indicates the The first growth area The pixel to be added Texture pixel value pairs in each direction, Indicates the The first growth area The direction of Texture pixel pairs of the texture, represents the Euclidean distance, Indicates the The first growth area The direction of The frequency of texel pairs for a texture.
4. The method for enhancing medical image details according to claim 1, wherein: The calculation formula of the maximum value adjustment factor is: Where, Indicates the The first growth area The maximum adjustment factor of the pixel to be added, Indicates the number of local pixels to be added. Indicates the pixel to be added The gradient value of a local pixel, Indicates the gradient value of the pixel to be added, represents the minimum function.
5. The method for enhancing medical image details according to claim 1, wherein: The method for obtaining the initial seed points in the grayscale image is: performing corner detection on the grayscale image and taking all corner points as the initial seed points.
6. The medical image detail enhancement method according to claim 5, characterized in that: The method also includes the step of performing tile segmentation on the grayscale image.
7. The medical image detail enhancement method according to claim 1, characterized in that: The initial region is obtained by performing region growth of grayscale values according to the initial seed point, including: setting an initial range, performing region growth of grayscale values according to the initial seed point, stopping region growth when the area of the region where the seed point is located is larger than the initial range, marking the seed point where the region cannot grow to a size larger than the initial range as a noise point and eliminating it, thus obtaining all the initial regions.
8. The method for enhancing medical image details according to claim 1, wherein: The adjacent pixels in the initial area are taken as the pixels to be added, and the adjacency is eight-adjacency or four-adjacency.
9. The method for enhancing medical image details according to claim 1, wherein: The medical images include X-ray images, CT images, or MRI images.
10. A medical image detail enhancement system, characterized in that: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the medical image detail enhancement method according to any one of claims 1 to 9 is implemented.