Real-time enhancement processing method, system, equipment and medium for radiotherapy CT images

By performing grayscale mapping and edge analysis on CT images, the problem of edge segmentation difficulty in CT images in the prior art is solved, and the accuracy of edge analysis and image enhancement efficiency are improved.

CN119273603BActive Publication Date: 2025-04-15SHANGHAI MEISI PHARM TECH CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411378850.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-04-15
Estimated Expiration
2044-09-30

AI Technical Summary

Technical Problem

The lack of preprocessing and analysis of CT images in the prior art leads to small differences between the lesion edge and normal tissue, making it difficult for computers to segment the lesion edge, requiring manual participation, and inefficiency.

Method used

By obtaining the CT image picture, calculate the total number of pixels, grayscale ranges and pixels of each grayscale level, calculate the probability and probability accumulation of each grayscale level, perform grayscale mapping based on these data, adjust the image to the equalization state, and then calculate the pixel reference value and neighborhood difference value, mark edge points and perform color enhancement processing.

Benefits of technology

By performing balanced processing and edge analysis on CT images, the segmentation accuracy of lesions is improved, manual participation is reduced, and the efficiency and accuracy of image enhancement is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119273603B_ABST
    Figure CN119273603B_ABST
Patent Text Reader

Abstract

The present invention discloses a real-time enhanced processing method, system, device and medium for radiotherapy CT images, and relates to the technical field of digital image processing, including obtaining CT image pictures, calculating the number of grayscale pixels and the total number of pixels, and outputting the probability of occurrence; calculating the probability of occurrence, and outputting the probability cumulative value; adjusting the CT image pictures, and outputting the balanced CT pictures; calculating pixel reference values, and calculating neighborhood difference values; marking pixel points as edge points, and performing color enhancement processing on the balanced CT image based on the edge points, and outputting the enhanced image; the present invention is used to solve the problem in the prior art that due to the lack of pre-processing analysis of CT images, when the scanned CT image has little difference with normal tissue at the edge of the lesion, it is difficult to segment the edge of the lesion only by relying on a computer, and manual participation in the segmentation process is required, resulting in low segmentation efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of digital image processing, and in particular to a real-time enhancement processing method, system, equipment and medium for radiotherapy CT images. Background Art

[0002] Digital image processing, also known as computer image processing, refers to the process of converting image signals into digital signals and processing them using computers; it involves knowledge from multiple disciplines, such as computer science, mathematics, physics, informatics, etc.; the purpose of digital image processing is to improve the quality of images, extract useful information, or further process and apply images.

[0003] Existing improvements for CT image analysis usually directly analyze the CT images obtained through CT scanning. For example, in the Chinese patent with invention publication number CN114782307A, an enhanced CT image rectal cancer staging auxiliary diagnosis system based on deep learning is disclosed. This solution analyzes CT images by introducing a deep learning model to improve the accuracy of the analysis. However, the existing improvement method lacks analysis of preprocessing of CT images. When the scanned CT image has little difference from normal tissue at the edge of the lesion, it is difficult to segment the edge of the lesion only by relying on a computer. In view of this, it is necessary to improve the existing enhanced processing of radiotherapy images. Summary of the invention

[0004] The present invention aims to solve at least one of the technical problems in the prior art to a certain extent. By improving the enhanced processing of radiotherapy images, it is used to solve the problem in the prior art that due to the lack of pre-processing analysis of CT images, when the scanned CT image has a small difference between the edge of the lesion and the normal tissue, it is difficult to segment the edge of the lesion only by relying on a computer, and manual participation in the segmentation process is required, resulting in low segmentation efficiency.

[0005] To achieve the above objectives, in a first aspect, the present invention provides a real-time enhancement processing method for radiotherapy CT images, comprising:

[0006] Obtain a CT image, and use image processing technology to obtain the total number of pixels, the number of gray levels, and the number of gray pixels at each gray level in the CT image; calculate the number of gray pixels and the total number of pixels, and output the occurrence probability of each gray level;

[0007] Calculate the occurrence probability and output the probability accumulation value; perform mapping calculation on the probability accumulation value and the number of gray levels, and output the mapping level corresponding to each gray level;

[0008] Adjust the CT image based on the mapping relationship between the gray level and the mapping level, and output an adjusted balanced CT image;

[0009] Calculate the pixel reference value of each pixel in the balanced CT image, calculate the difference between the pixel reference values ​​of other pixel points adjacent to the pixel point based on the pixel reference value, and output multiple neighborhood difference values;

[0010] The neighborhood differences are sorted and then calculated, and the difference threshold is output based on the calculation results; the neighborhood differences of all pixels are analyzed based on the difference threshold, and the pixels are marked as edge points or not processed based on the analysis results;

[0011] The color enhancement processing of the balanced CT image is performed based on the edge points to output the enhanced image.

[0012] Furthermore, a CT image is obtained, and the total number of pixels, the number of gray levels, and the number of gray pixels of each gray level in the CT image are obtained by using image processing technology; the number of gray pixels and the total number of pixels are calculated, and the occurrence probability of each gray level is output, including:

[0013] Obtain a CT image, calculate the number of pixels in the CT image, and mark it as the total number of pixels;

[0014] Calculate the number of gray levels in the CT image, marked as gray level number, and number each gray level from R1 to Rk, where k is a constant;

[0015] Calculate the number of pixels corresponding to each gray level, mark it as gray pixel number, and number each gray pixel number from N1 to Nk;

[0016] Calculate the number of grayscale pixels and the total number of pixels using the first probability calculation formula, and output the occurrence probability of each grayscale level;

[0017] The first probability calculation formula is configured as: Where Px(Rx) is the occurrence probability of the x-th gray level, x is any number from 1 to k, Nx is any number of gray pixels from N1 to Nk, and ZN is the total number of pixels.

[0018] Furthermore, the occurrence probability is calculated and the probability accumulation value is output; the probability accumulation value and the number of gray levels are mapped and calculated, and the mapping level corresponding to each gray level is output, including:

[0019] Calculate the occurrence probability using the second probability calculation formula and output the probability accumulation value;

[0020] The second probability calculation formula is configured as: Among them, Sx is the accumulated value of x occurrence probabilities, Pi(Ri) is the occurrence probability of the i-th gray level, the value range of i is 1 to x, and i is a positive integer;

[0021] The probability accumulation value and the number of gray levels are calculated using the mapping formula, and the mapping level corresponding to each gray level is output;

[0022] The mapping formula is configured as follows: Where SP(x) is the mapping level corresponding to the x-th gray level, The floor symbol.

[0023] Furthermore, the CT image is adjusted based on the mapping relationship between the gray level and the mapping level, and the output of the adjusted balanced CT image includes:

[0024] The gray level of each pixel in the CT image is updated to a mapping level that is in a mapping relationship with the gray level, the obtained CT image is marked as a balanced CT image, and the balanced CT image is output.

[0025] Furthermore, a pixel reference value of each pixel in the balanced CT image is calculated, and a difference between the pixel reference values ​​of other pixels adjacent to the pixel is calculated based on the pixel reference value, and multiple neighborhood difference values ​​are output, including:

[0026] The RGB model is used to mark the pixels of the balanced CT image. Each pixel is marked with RGB [R(a1), G(a2), B(a3)], where R(a1) represents the red component of the pixel, G(a2) represents the green component of the pixel, and B(a3) represents the blue component of the pixel. The value ranges of R(a1), G(a2) and B(a3) are all 0-255.

[0027] Calculate the sum of each pixel point a1, a2 and a3, marked as pixel reference value Pc;

[0028] Calculate the difference between the pixel reference value Pc1 of each pixel and the pixel reference values ​​Pc2, Pi3, Pi4 and Pi5 of its four neighboring pixels respectively, and mark the calculated difference as the neighborhood difference based on the position of the pixel and other pixels in the four neighborhoods;

[0029] If there is one or more blank areas in the four neighborhoods of any pixel, the pixel will be marked as a border point and no calculation will be performed.

[0030] Further, the neighborhood differences are sorted and then calculated, and a difference threshold is output based on the calculation result; the neighborhood differences of all pixels are analyzed based on the difference threshold, and the pixels are marked as edge points or not processed based on the analysis result, including:

[0031] Sort all neighborhood differences in ascending order to obtain a difference sequence;

[0032] Calculate the absolute value of the difference between two adjacent neighborhood differences in the difference sequence, and mark it as the sequence difference; obtain the two neighborhood differences corresponding to the largest sequence difference calculated, and mark the smallest neighborhood difference of the two neighborhood differences as the difference threshold;

[0033] The neighborhood differences of all pixels are compared with the difference threshold. When any neighborhood difference is greater than the difference threshold, the pixel is marked as an edge point; when all neighborhood differences are less than or equal to the difference threshold, no processing is performed.

[0034] Furthermore, the color enhancement processing is performed on the balanced CT image based on the edge points, and the output enhanced image includes:

[0035] Performing color enhancement processing on the balanced CT image, the color enhancement processing comprising:

[0036] Adjust the RGB value [R(a1), G(a2), B(a3)] of each edge point in the balanced CT image to [R(a1)+b, G(a2)+b, B(a3)+b], where b is a constant. When R(a1)+b, G(a2)+b or B(a3)+b is greater than 255, the value is 255.

[0037] The balanced CT image after color enhancement processing is marked as an enhanced image, and the enhanced image is output.

[0038] In a second aspect, the present invention also provides a real-time enhancement processing system for radiotherapy CT images, including an image equalization module, an edge analysis module, and an image enhancement module; the image equalization module is used to obtain a CT image picture, and use image processing technology to obtain the total number of pixels, the number of gray levels, and the number of gray pixels of each gray level in the CT image picture; the number of gray pixels and the total number of pixels are calculated, and the occurrence probability of each gray level is output;

[0039] The image equalization module is also used to calculate the occurrence probability and output the probability accumulation value; perform mapping calculation on the probability accumulation value and the number of gray levels and output the mapping level corresponding to each gray level; adjust the CT image picture based on the mapping relationship between the gray level and the mapping level and output the adjusted balanced CT image;

[0040] The edge analysis module is used to calculate the pixel reference value of each pixel in the balanced CT image, calculate the difference between the pixel reference values ​​of other pixel points adjacent to the pixel point based on the pixel reference value, and output multiple neighborhood difference values; sort the neighborhood difference values ​​and then calculate them, and output the difference threshold value based on the calculation result; analyze the neighborhood difference values ​​of all pixel points based on the difference threshold value, and mark the pixel points as edge points or do not process them based on the analysis results;

[0041] The image enhancement module is used to perform color enhancement processing on the balanced CT image based on edge points and output an enhanced image.

[0042] In a third aspect, the present application provides an electronic device, including a processor and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps in the method described above are executed.

[0043] In a fourth aspect, the present application provides a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in the method described above are executed.

[0044] Beneficial effects of the present invention: The present invention obtains a CT image and the total number of pixels, the number of gray levels and the number of gray pixels of each gray level in the image, calculates the occurrence probability of each gray level, calculates the cumulative probability according to the occurrence probability, calculates the mapping level corresponding to each gray level by the cumulative probability and the gray level, and adjusts the gray level to the mapping level to complete the balanced adjustment of the CT image. The advantage of this is that by balancing the CT image, the darker or brighter part in the CT image can be adjusted to be clear, which is convenient for subsequent analysis of the edge of each tissue in the CT image, and improves the accuracy of the edge analysis;

[0045] The present invention also marks the pixels of the balanced CT image, calculates the pixel reference value of each pixel, and then calculates the difference between each pixel and the pixel reference values ​​of other pixels in the four neighborhoods. By analyzing the difference, a difference threshold can be obtained, and then the pixels are analyzed according to the difference threshold to mark the edge points. Finally, the RGB values ​​of the edge points are adjusted to obtain the final enhanced image. The advantage of this is that after the initial CT image is balanced, the edge points obtained by analysis are more accurate. On the other hand, by adopting a nonlinear adjustment method for the RGB values ​​of the edge points, the calculation rate can be increased, and the efficiency of image enhancement is improved. By adjusting the RGB values ​​of the edge points, the edge points can be highlighted, which makes it easier for medical personnel to extract relevant information from the image. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 is a functional block diagram of the system of the present invention;

[0047] Figure 2 is a flow chart of the steps of the method of the present invention;

[0048] Figure 3 Schematic diagram of pixel distribution of an image of the present invention;

[0049] Figure 4 The present invention is Figure 3 The pixel statistics histogram obtained by statistics. DETAILED DESCRIPTION

[0050] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0051] Example 1, please refer to Figure 1 As shown, the present invention provides a real-time enhancement processing system for radiotherapy images, including an image equalization module, an edge analysis module and an image enhancement module; the image equalization module is used to obtain a CT image picture, and use image processing technology to obtain the total number of pixels, the number of gray levels and the number of gray pixels of each gray level in the CT image picture; the number of gray pixels and the total number of pixels are calculated, and the occurrence probability of each gray level is output; the occurrence probability is calculated, and the probability cumulative value is output; the probability cumulative value and the number of gray levels are mapped and calculated, and the mapping level corresponding to each gray level is output; the CT image picture is adjusted based on the mapping relationship between the gray level and the mapping level, and the adjusted balanced CT picture is output;

[0052] See also Figure 3 As shown, Figure 3 Take a picture with a pixel distribution of 7×7 as an example. Each square block in the picture represents a pixel. The number inside the pixel represents the gray level of the pixel. There are 8 gray levels in the picture, from 0 to 7. Figure 3 Draw as Figure 4 The pixel statistics histogram shown;

[0053] The image equalization module is configured with an information extraction strategy, which includes:

[0054] Obtain a CT image, calculate the number of pixels in the CT image, and mark it as the total number of pixels;

[0055] Calculate the number of gray levels in the CT image, marked as gray level number, and number each gray level from R1 to Rk, where k is a constant;

[0056] The number of pixels corresponding to each gray level is calculated, marked as the gray pixel number, and each gray pixel number is numbered from N1 to Nk.

[0057] The image equalization module is also configured with a probability calculation strategy, which includes:

[0058] Calculate the number of grayscale pixels and the total number of pixels using the first probability calculation formula, and output the occurrence probability of each grayscale level;

[0059] The first probability calculation formula is configured as: Where Px(Rx) is the occurrence probability of the x-th gray level, x is any number from 1 to k, Nx is any number of gray pixels from N1 to Nk, and ZN is the total number of pixels.

[0060] Calculate the occurrence probability using the second probability calculation formula and output the probability accumulation value;

[0061] The second probability calculation formula is configured as: Among them, Sx is the accumulated value of x occurrence probabilities, Pi(Ri) is the occurrence probability of the i-th gray level, the value range of i is 1 to x, and i is a positive integer.

[0062] Depend on Figure 3 as well as Figure 4 Calculate the occurrence probability of each gray level and obtain the results shown in Table 1-1:

[0063] Table 1-1 Occurrence probability table

[0064] Grayscale Probability 0 0.183 1 0.183 2 0.122 3 0.102 4 0.122 5 0.061 6 0.061 7 0.163

[0065] It should be noted that since the total number of pixels is 7×7=49, an irrational number may occur when calculating the probability of occurrence of gray levels. For example, the probability of occurrence of gray levels 0 and 1 is actually 0.18367... At this time, other decimals after the third decimal place are discarded, and three decimal places are shown in Table 1-1.

[0066] Then calculate the probability accumulation value from Table 1-1, and get the probability accumulation table shown in Table 1-2

[0067] Table 1-2 Probability accumulation table

[0068]

[0069]

[0070] It should be noted that the final result of the probability accumulation value must be 1, that is, the probability of occurrence of a certain event. In order to facilitate subsequent calculations, when calculating the probability accumulation value, the third decimal place is not displayed when the third decimal place is less than 5, and it is directly carried when the third decimal place is greater than 5. The accumulated probability value of gray level 1 is 0.183+0.183≈0.37. Similarly, the accumulated probability value of gray level 4 is 0.72; and when the gray level is 7, since 0.842+0.163=1.05, which is greater than 1 at this time, the third decimal place is discarded, so that the final probability accumulation value is equal to 1.

[0071] The image equalization module is also configured with a mapping calculation strategy, which includes:

[0072] The probability accumulation value and the number of gray levels are calculated using the mapping formula, and the mapping level corresponding to each gray level is output;

[0073] The mapping formula is configured as: Where SP(x) is the mapping level corresponding to the x-th gray level, is the floor rounding symbol;

[0074] It should be noted that Figure 3 For example, at this time, Rk=7, R1=0, and then based on Table 1-2, the grayscale mapping table in Table 1-3 is calculated using the mapping formula;

[0075] Table 1-3 Grayscale mapping table

[0076]

[0077]

[0078] After mapping processing, the original image is converted from 8 gray levels to 6 gray levels, thereby improving the contrast of the image. The areas of the CT image that are too dark and difficult to divide can become clear after mapping, making it easier for the computer to recognize and divide them.

[0079] The edge analysis module is used to calculate the pixel reference value of each pixel in the balanced CT image, calculate the difference between the pixel reference values ​​of other pixel points adjacent to the pixel point based on the pixel reference value, and output multiple neighborhood differences; sort the neighborhood differences and then calculate them, and output the difference threshold based on the calculation results; analyze the neighborhood differences of all pixel points based on the difference threshold, and mark the pixel points as edge points or do not process them based on the analysis results;

[0080] The edge analysis module is configured with a pixel calculation strategy, which includes:

[0081] The RGB model is used to mark the pixels of the balanced CT image. Each pixel is marked with RGB [R(a1), G(a2), B(a3)], where R(a1) represents the red component of the pixel, G(a2) represents the green component of the pixel, and B(a3) represents the blue component of the pixel. The value ranges of R(a1), G(a2) and B(a3) are all 0-255.

[0082] Calculate the sum of each pixel point a1, a2 and a3, marked as pixel reference value Pc;

[0083] Calculate the difference between the pixel reference value Pc1 of each pixel and the pixel reference values ​​Pc2, Pc3, Pc4 and Pc5 of its four neighboring pixels respectively. Based on the position of the pixel and other pixels in the four neighborhoods, mark the calculated difference as the neighborhood difference. The calculation process of the neighborhood difference through the four neighboring pixels is Pc1-Pc2, Pc1-Pc3, Pc1-Pc4, Pc1-Pc5;

[0084] In particular, if there is one or more blank areas in the four neighborhoods of any pixel, the pixel will be marked as a border point and no calculation processing will be performed.

[0085] The edge analysis module is also configured with an edge partitioning strategy, which includes:

[0086] Sort all neighborhood differences in ascending order to obtain a difference sequence;

[0087] Calculate the absolute value of the difference between two adjacent neighborhood differences in the difference sequence, and mark it as the sequence difference; obtain the two neighborhood differences corresponding to the largest sequence difference calculated, and mark the smallest neighborhood difference of the two neighborhood differences as the difference threshold;

[0088] The neighborhood differences of all pixels are compared with the difference threshold. When any neighborhood difference is greater than the difference threshold, the pixel is marked as an edge point; when all neighborhood differences are less than or equal to the difference threshold, no processing is performed.

[0089] The image enhancement module is used to perform color enhancement processing on the balanced CT image based on edge points and output an enhanced image;

[0090] The image enhancement module is configured with image enhancement strategies, which include:

[0091] Perform color enhancement processing on the balanced CT image, and the color enhancement processing includes:

[0092] Adjust the RGB value [R(a1), G(a2), B(a3)] of each edge point in the balanced CT image to [R(a1)+b, G(a2)+b, B(a3)+b], where b is a constant. When R(a1)+b, G(a2)+b or B(a3)+b is greater than 255, the value is 255.

[0093] Marking the balanced CT image after color enhancement processing as an enhanced image, and outputting the enhanced image;

[0094] In the specific implementation, b is set to 10, which means that the values ​​of the three components of the pixel point R, G, and B are increased by 10 at the same time;

[0095] It should be noted that by increasing the R, G, and B components of the edge points by the same value b at the same time, the purpose of adjusting the brightness of the edge points can be achieved. This method belongs to nonlinear brightness adjustment. The code used is simple and the processing speed is fast, which improves the timeliness of implementing enhancement processing. At the same time, by increasing the brightness of all edge points, it can make it easier for medical personnel to obtain information from images.

[0096] Example 2, please refer to Figure 2 As shown, the present invention also provides a real-time enhancement processing method for radiotherapy CT images, comprising:

[0097] Step S1, obtaining a CT image, using image processing technology to obtain the total number of pixels, the number of gray levels, and the number of gray pixels at each gray level in the CT image; calculating the number of gray pixels and the total number of pixels, and outputting the probability of occurrence of each gray level; Step S1 also includes the following sub-steps:

[0098] Step S101, obtaining a CT image, calculating the number of pixels in the CT image, and marking it as the total number of pixels;

[0099] Step S102, calculating the number of gray levels in the CT image, marked as gray level number, and numbering each gray level from R1 to Rk, where k is a constant;

[0100] Step S103, calculating the number of pixels corresponding to each gray level, marking them as gray pixel numbers, and numbering each gray pixel number from N1 to Nk;

[0101] Step S104, calculating the number of grayscale pixels and the total number of pixels using a first probability calculation formula, and outputting the occurrence probability of each grayscale level;

[0102] Step S105: the first probability calculation formula is configured as: Where Px(Rx) is the occurrence probability of the x-th gray level, x is any number from 1 to k, Nx is any number of gray pixels from N1 to Nk, and ZN is the total number of pixels.

[0103] Step S2, calculate the occurrence probability and output the probability accumulation value; perform mapping calculation on the probability accumulation value and the number of gray levels, and output the mapping level corresponding to each gray level; Step S2 also includes the following sub-steps:

[0104] Step S201, using the second probability calculation formula to calculate the occurrence probability, and outputting the probability accumulation value;

[0105] The second probability calculation formula is configured as: Among them, Sx is the accumulated value of x occurrence probabilities, Pi(Ri) is the occurrence probability of the i-th gray level, the value range of i is 1 to x, and i is a positive integer;

[0106] Step S202, using a mapping formula to calculate the probability accumulation value and the number of gray levels, and outputting a mapping level corresponding to each gray level;

[0107] The mapping formula is configured as: Where SP(x) is the mapping level corresponding to the x-th gray level, The floor symbol.

[0108] Step S3, adjusting the CT image based on the mapping relationship between the gray level and the mapping level, and outputting the adjusted balanced CT image; Step S3 also includes the following sub-steps:

[0109] Step S301: update the gray level of each pixel in the CT image to a mapping level that is in a mapping relationship with the gray level, mark the obtained CT image as a balanced CT image, and output the balanced CT image.

[0110] Step S4, calculating the pixel reference value of each pixel in the balanced CT image, calculating the difference between the pixel reference values ​​of other pixel points adjacent to the pixel point based on the pixel reference value, and outputting a plurality of neighborhood difference values; Step S4 also includes the following sub-steps:

[0111] Step S401, using the RGB model to mark the pixels of the balanced CT image, each pixel is marked with RGB [R(a1), G(a2), B(a3)], where R(a1) represents the red component of the pixel, G(a2) represents the green component of the pixel, and B(a3) represents the blue component of the pixel, and the value ranges of R(a1), G(a2) and B(a3) are all 0-255;

[0112] Step S402, calculating the sum of each pixel point a1, a2 and a3, and marking it as the pixel reference value Pc;

[0113] Step S403, respectively calculate the difference between the pixel reference value Pc1 of each pixel point and the pixel reference values ​​Pc2, Pi3, Pi4 and Pi5 of its four neighborhood pixels, and mark the calculated difference as the neighborhood difference based on the position of the pixel point and other pixels in the four neighborhoods; in particular, if there are one or more blank areas in the four neighborhoods of any pixel point, the pixel point will be marked as a border point and no calculation processing will be performed.

[0114] Step S5, sorting the neighborhood differences and then calculating, outputting a difference threshold based on the calculation result; analyzing the neighborhood differences of all pixels based on the difference threshold, and marking the pixels as edge points or not processing them based on the analysis results; Step S5 also includes the following sub-steps:

[0115] Step S501, sorting all neighborhood differences in ascending order to obtain a difference sequence;

[0116] Step S502, calculating the absolute value of the difference between two adjacent neighborhood difference values ​​in the difference sequence, marking it as a sequence difference; obtaining two neighborhood difference values ​​corresponding to the calculated maximum sequence difference value, and marking the smallest neighborhood difference value of the two neighborhood difference values ​​as a difference threshold;

[0117] Step S503, compare the neighborhood differences of all pixels with the difference threshold. When any neighborhood difference is greater than the difference threshold, mark the pixel as an edge point; when all neighborhood differences are less than or equal to the difference threshold, no processing is performed.

[0118] Step S6, performing color enhancement processing on the balanced CT image based on the edge points, and outputting an enhanced image; Step S6 also includes the following sub-steps:

[0119] Step S601, performing color enhancement processing on the balanced CT image, the color enhancement processing includes:

[0120] Adjust the RGB value [R(a1), G(a2), B(a3)] of each edge point in the balanced CT image to [R(a1)+b, G(a2)+b, B(a3)+b], where b is a constant. When R(a1)+b, G(a2)+b or B(a3)+b is greater than 255, the value is 255.

[0121] Step S602: Mark the balanced CT image after the color enhancement processing as an enhanced image, and output the enhanced image.

[0122] Embodiment 3, the present application provides an electronic device, including a processor and a memory, the memory storing computer-readable instructions, when the computer-readable instructions are executed by the processor, the steps in the above method are executed. Through the above technical solution, the processor and the memory are interconnected and communicate with each other through a communication bus and / or other forms of connection mechanisms, the memory stores a computer program executable by the processor, when the electronic device is running, the processor executes the computer program, and executes the method in any optional implementation of the above embodiment when executing, so as to achieve the following functions: obtain the total number of pixels, grayscale levels and grayscale pixels in the CT image; calculate the probability of occurrence of each grayscale level; calculate the probability cumulative value, map the probability cumulative value and the grayscale level, and output the mapping level; adjust the CT image and output a balanced CT image; calculate the pixel reference value, the neighborhood difference and the difference threshold, analyze the neighborhood difference based on the difference threshold, and mark the pixel point as an edge point; perform color enhancement processing on the balanced CT image.

[0123] Embodiment 4, the present application provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps in the above method are executed. Through the above technical solution, when the computer program is executed by the processor, the method in any optional implementation of the above embodiment is executed to achieve the following functions: obtain the total number of pixels, grayscale levels and grayscale pixels in the CT image; calculate the probability of occurrence of each grayscale; calculate the probability cumulative value, map the probability cumulative value and the grayscale level, and output the mapping level; adjust the CT image and output a balanced CT image; calculate the pixel reference value, neighborhood difference and difference threshold, analyze the neighborhood difference based on the difference threshold, and mark the pixel point as an edge point; perform color enhancement processing on the balanced CT image.

[0124] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0125] It should be understood by those skilled in the art that the embodiments of the present invention can be provided as methods, systems or computer program products. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program codes. Among them, the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read Only Memory, referred to as EPROM), programmable read-only memory (Programmable Read-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic memory, flash memory, disk or optical disk. These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0126] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

Claims

1. A real-time enhancement processing method for radiotherapy CT images, characterized in that: include: Acquire a CT image, and use image processing technology to obtain the total number of pixels, the number of gray levels, and the number of gray pixels at each gray level in the CT image; Calculate the number of grayscale pixels and the total number of pixels, and output the probability of occurrence of each gray level; Calculate the probability of occurrence and output the cumulative value of probability; Perform mapping calculation on the probability accumulation value and the number of gray levels, and output the mapping level corresponding to each gray level; Adjust the CT image based on the mapping relationship between the gray level and the mapping level, and output an adjusted balanced CT image; Calculate the pixel reference value of each pixel in the balanced CT image, calculate the difference between the pixel reference values ​​of other pixel points adjacent to the pixel point based on the pixel reference value, and output multiple neighborhood difference values; The neighborhood differences are sorted and then calculated, and the difference threshold is output based on the calculation results; Analyze the neighborhood differences of all pixels based on the difference threshold, and mark the pixels as edge points or do not process them based on the analysis results; Perform color enhancement processing on the balanced CT image based on edge points and output enhanced images; The neighborhood differences are sorted and then calculated, and the difference threshold is output based on the calculation results; Analyze the neighborhood differences of all pixels based on the difference threshold, and mark the pixels as edge points or do not process them based on the analysis results, including: Sort all neighborhood differences in ascending order to obtain a difference sequence; Calculate the absolute value of the difference between two adjacent neighborhood differences in the difference sequence, and mark it as the sequence difference; obtain the two neighborhood differences corresponding to the largest sequence difference calculated, and mark the smallest neighborhood difference of the two neighborhood differences as the difference threshold; Compare the neighborhood differences of all pixels with the difference threshold. If any neighborhood difference is greater than the difference threshold, the pixel is marked as an edge point. If all neighborhood differences are less than or equal to the difference threshold, no processing is performed. Based on the edge points, the color enhancement processing of the balanced CT image is performed, and the output enhanced image includes: Performing color enhancement processing on the balanced CT image, the color enhancement processing comprising: Adjust the RGB value [R(a1), G(a2), B(a3)] of each edge point in the balanced CT image to [R(a1)+b, G(a2)+b, B(a3)+b], where b is a constant. When R(a1)+b, G(a2)+b or B(a3)+b is greater than 255, the value is 255. The balanced CT image after color enhancement processing is marked as an enhanced image, and the enhanced image is output.

2. The real-time enhancement processing method for radiotherapy CT images according to claim 1, characterized in that: Acquire a CT image, and use image processing technology to obtain the total number of pixels, the number of gray levels, and the number of gray pixels at each gray level in the CT image; The number of grayscale pixels and the total number of pixels are calculated, and the output probability of each gray level includes: Obtain a CT image, calculate the number of pixels in the CT image, and mark it as the total number of pixels; Calculate the number of gray levels in the CT image, marked as gray level number, and number each gray level from R1 to Rk, where k is a constant; Calculate the number of pixels corresponding to each gray level, mark it as gray pixel number, and number each gray pixel number from N1 to Nk; Calculate the number of grayscale pixels and the total number of pixels using the first probability calculation formula, and output the occurrence probability of each grayscale level; The first probability calculation formula is configured as: ; Where Px(Rx) is the probability of occurrence of the x-th gray level, x is any number from 1 to k, Rx is any gray level from R1 to Rk, Nx is any number of gray pixels from N1 to Nk, and ZN is the total number of pixels.

3. The real-time enhancement processing method for radiotherapy CT images according to claim 2, characterized in that: Calculate the probability of occurrence and output the cumulative value of probability; The probability accumulation value and the number of gray levels are mapped and calculated, and the mapping level corresponding to each gray level is output, including: Calculate the occurrence probability using the second probability calculation formula and output the probability accumulation value; The second probability calculation formula is configured as: ; Where Sx is the accumulated value of x occurrence probabilities, Pi(Ri) is the occurrence probability of the i-th gray level, the value range of i is 1 to x, and i is a positive integer; The probability accumulation value and the number of gray levels are calculated using the mapping formula, and the mapping level corresponding to each gray level is output; The mapping formula is configured as: SP(x)=⌊(Rx-R1)×Sx+0.5⌋; where SP(x) is the mapping level corresponding to the x-th gray level, The floor symbol.

4. The real-time enhancement processing method for radiotherapy CT images according to claim 3, characterized in that: The CT image is adjusted based on the mapping relationship between the gray level and the mapping level, and the output adjusted balanced CT image includes: The gray level of each pixel in the CT image is updated to a mapping level that is in a mapping relationship with the gray level, the obtained CT image is marked as a balanced CT image, and the balanced CT image is output.

5. The real-time enhancement processing method for radiotherapy CT images according to claim 4, characterized in that: Calculate the pixel reference value of each pixel in the balanced CT image, calculate the difference between the pixel reference values ​​of other pixels adjacent to the pixel based on the pixel reference value, and output multiple neighborhood differences including: The RGB model is used to mark the pixels of the balanced CT image. Each pixel is marked with RGB [R(a1), G(a2), B(a3)], where R(a1) represents the red component of the pixel, G(a2) represents the green component of the pixel, and B(a3) represents the blue component of the pixel. The value ranges of R(a1), G(a2) and B(a3) are all 0-255. Calculate the sum of R(a1), G(a2) and B(a3) for each pixel, and mark it as the pixel reference value Pc; Calculate the difference between the pixel reference value Pc1 of each pixel and the pixel reference values ​​Pc2, Pc3, Pc4 and Pc5 of its four neighboring pixels respectively, and mark the calculated difference as the neighborhood difference based on the position of the pixel and other pixels in the four neighborhoods; If there is one or more blank areas in the four neighborhoods of any pixel, the pixel will be marked as a border point and no calculation will be performed.

6. A real-time enhancement processing system for radiotherapy CT images, used to implement the real-time enhancement processing method for radiotherapy CT images according to any one of claims 1 to 5, characterized in that: It includes an image equalization module, an edge analysis module and an image enhancement module; the image equalization module is used to obtain a CT image picture, and use image processing technology to obtain the total number of pixels, the number of gray levels and the number of gray pixels of each gray level in the CT image picture; the number of gray pixels and the total number of pixels are calculated, and the occurrence probability of each gray level is output; The image equalization module is also used to calculate the occurrence probability and output the probability accumulation value; Mapping calculation is performed on the probability accumulation value and the number of gray levels, and the mapping level corresponding to each gray level is output; the CT image is adjusted based on the mapping relationship between the gray level and the mapping level, and the adjusted balanced CT image is output; The edge analysis module is used to calculate the pixel reference value of each pixel in the balanced CT image, calculate the difference between the pixel reference values ​​of other pixel points adjacent to the pixel point based on the pixel reference value, and output multiple neighborhood difference values; The neighborhood differences are sorted and then calculated, and the difference threshold is output based on the calculation results; Analyze the neighborhood differences of all pixels based on the difference threshold, and mark the pixels as edge points or do not process them based on the analysis results; The image enhancement module is used to perform color enhancement processing on the balanced CT image based on edge points and output an enhanced image.

7. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the steps in the method according to any one of claims 1 to 5 are executed.

8. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are executed.

Citation Information

Patent Citations

  • Enhanced CT image rectal cancer staging auxiliary diagnosis system based on deep learning

    CN114782307A

  • Edge pixel point extraction method and device based on neighborhood relation

    CN111179291A

  • Self-adaptive image enhancement method and device and electronic equipment

    CN117745552A