X-ray image enhancement method based on CycleGAN
Through the CycleGAN model and adaptive window width and window level algorithm, the problem of low X-ray image quality and artifacts is solved, high-quality image enhancement is achieved, and the accuracy of diagnosis and detection is improved.
Patent Information
- Application Number
- CN202411079184.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-08-07
AI Technical Summary
The X-ray images obtained by direct shooting are of low quality and contain background artifacts, which affects the accuracy of diagnosis.
The X-ray image enhancement method based on CycleGAN is used, including image preprocessing, image enhancement training and determination of adaptive window width and window level. The CycleGAN model is used for data set training, and micro-data enhancement method and adaptive window width and window level algorithm are used to remove Noise and artifacts, improving image quality.
It achieves high-definition X-ray images without artifacts and noise in the background, highlights the foreground content, improves the accuracy of diagnosis and the clarity of the image, and is suitable for medical and industrial testing.
Smart Images

Figure CN118628378B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the general field of image data processing technology, and in particular to an X-ray image enhancement processing method, and specifically to an X-ray image enhancement method based on CycleGAN. Background Art
[0002] X-ray images are images obtained by imaging with X-ray devices. The most common ones are images obtained after examination with medical DR, CT and other equipment. The quality of X-ray images directly affects the doctor's judgment, and there are many factors that affect the quality of X-ray images, such as: ensuring that the patient remains still during the shooting process to reduce motion artifacts. Use appropriate exposure parameters and adjust the settings according to the patient's body shape and shooting site. Use a suitable shooting distance and angle to reduce image distortion. Avoid over- or under-exposure, and obtain clearer images by optimizing exposure time and dose. Of course, with the upgrade of equipment, in terms of shooting, the hardware has been updated to be more complete, and there are fewer and fewer things that rely on manual experience control. Therefore, the existing way to improve the quality of X-ray images is usually in the post-processing of the image.
[0003] Image post-processing generally uses image processing software to adjust the contrast of the image so that tissues of different densities appear more clearly in the image. The principle is to enhance the difference between the bright and dark parts of the image by stretching or compressing the grayscale range of the image, making the edges and details clearer. Or convert the original black and white image into a color image, so that different tissue parts can be better distinguished by color, and compress the dynamic range of the image so that the dynamic range of the image can be compressed when displayed on the monitor so that all details can be clearly seen.
[0004] Chinese invention patent application publication number CN114972067A discloses a method for enhancing X-ray small dental film images, which uses adaptive gamma transformation to correct the grayscale of X-ray small dental film images, adaptively determines its parameters through the grayscale information of the image, uses Sobel edge detection algorithm and Gaussian high-pass filter to obtain detail feature images for the corrected images, and fuses them with the weights of the original X-ray small dental film images, and finally adaptively determines the threshold according to the characteristics of the grayscale histogram, and uses the CLAHE algorithm to enhance the image. The invention can effectively improve the contrast of small dental film images and realize the enhancement of X-ray small dental film images. Summary of the invention
[0005] In order to solve the problem of low quality and background artifacts of X-ray images obtained by direct shooting, the present application provides an X-ray image enhancement method based on CycleGAN, which is used to enhance the X-ray image so that the image is a high-definition image with no background artifacts and noise. By determining the optimal window width and window position, it is possible to filter these useless noise distributions in the X-ray image, achieve an X-ray reading display that meets the requirements, and highlight the foreground content that is beneficial to clinical diagnosis.
[0006] In order to achieve the above purpose, the technical solution adopted in this application is:
[0007] The X-ray image enhancement method based on CycleGAN includes the following steps:
[0008] Step STP1, image preprocessing, using binary segmentation algorithm to maintain the original format type to achieve ROI extraction, and then using Gaussian filtering to process the original image Img 1 Smoothing and denoising are performed, and the original image Img is denoised using the Otsu method. 1 Perform binary threshold processing and use morphological closing operation to the original image Img 1 The edge details are improved, the bounding box corresponding to the ROI is calculated using the binary mask and the ROI area is extracted, and the original image Img 1 Perform pixel and anti-pixel iterative processing to obtain n pre-processed images Img 2 Composition of pictures collection M 0 ;
[0009] Step STP2, image enhancement training, the image set M in step STP1 0 Input the data set into the CycleGAN model for training, and obtain a 16-bit single-channel grayscale image Img 3 The enhanced picture collection M 1 The training process uses a micro-data enhancement method, which is to replace each D(x) with D(T(x)), where x is the original image Img 1 Or preprocess image Img 2 , D is the discriminator, T is the micro-data enhancement operation process; the micro-data enhancement operation process T includes the following at least one dimension adjustment:
[0010] a. Random brightness adjustment: add random brightness x to the input tensor;
[0011] b. Random saturation adjustment: x adjusts the saturation of the input tensor by randomly scaling the color channels of the input tensor;
[0012] c. Random contrast adjustment: x adjusts the contrast of the input tensor by randomly scaling pixel values;
[0013] d. Random translation adjustment: x applies a random translation to the input tensor at a specified ratio of 0.125;
[0014] e. Random cropping adjustment: random shearing is applied by zeroing a rectangular area within the input tensor. The size and position of the cuts are random;
[0015] Step STP3, the determination of the adaptive window width and window level adopts any one of an adaptive window width and window level algorithm based on histogram area, an adaptive window width and window level algorithm based on image segmentation, and an adaptive window width and window level algorithm based on histogram extreme value points; wherein the adaptive window width and window level algorithm based on histogram area specifically comprises the following steps:
[0016] Step STP3.1: The input image is a 16-bit single-channel grayscale image Img after image enhancement. 3 , the background defaults to 65535;
[0017] Step STP3.2, calculate the input image Img 3 Histogram of pixel intensities, with intensity values ranging from 0 to 65535;
[0018] Step STP3.3, since there are multiple dense extreme points in the histogram distribution, a moving average is applied to smooth the histogram with a window size of 30;
[0019] Step STP3.4, calculating the total area of the histogram, and taking the minimum index and the maximum index of the histogram corresponding to the total cumulative sum of 0.05% and 8% as the window boundary;
[0020] Step STP3.5, calculate the window position as the average of the minimum index and the maximum index, and calculate the window width as the difference between the maximum index and the minimum index;
[0021] Step STP3.6, convert the calculated window width and window position into pixel values in a 256-bin histogram.
[0022] Preferably, the adaptive window width and window level algorithm based on image segmentation in step STP3 specifically comprises the following steps:
[0023] Step STP3-1. The input image is a 16-bit single-channel grayscale image Img after image enhancement 3 , the background defaults to 65535;
[0024] Step STP3-2. By inputting the image Img 3Applying Gaussian mixture model (GMM), a Gaussian mixture model with two components is fitted to the histogram of the pixel values of the original image, and the Gaussian mixture model (GMM) is used to distinguish the image Img 3 Different intensity areas in the image to determine the histogram threshold for the best foreground we need;
[0025] Step STP3-3. The average of the two Gaussian component means in GMM is the optimal threshold for segmenting the image;
[0026] Step STP3-4. Select a specific pixel value from the range of the calculated threshold value to the maximum intensity value of 65535, the selected value being the value with the most repetitions in the image;
[0027] Step STP3-5. The pixel values calculated in step STP3-4 are used to determine the image Img 3 Adjusted window width and window level, the window level is image Img 3 The window width is the value with the most repetitions in the image - twice the optimal threshold.
[0028] Preferably, the adaptive window width and window level algorithm based on histogram extreme value points in step STP3 specifically comprises the following steps:
[0029] Step STP3-a. The input image is a 16-bit single-channel grayscale image Img after image enhancement. 3 , the background defaults to 65535;
[0030] Step STP3-b. Calculate the input image Img 3 Histogram of pixel intensities, with intensity values ranging from 0 to 65535;
[0031] Step STP3-c. Since there are multiple dense extreme points in the histogram distribution, a moving average is applied to smooth the histogram with a window size of 30;
[0032] Step STP3-d. Calculate the local minimum and maximum values in the histogram;
[0033] Step STP3-e. Adjusting the detected minimum points and values by considering neighboring points to include the leftmost and rightmost points, and performing kurtosis adjustment;
[0034] Step STP3-f. Iterate the adjusted minimum points to find the maximum area under the histogram between adjacent minimum values. The window with the largest area is regarded as the region of interest. The window level is determined as the maximum point of the adjacent maximum values in the selected window. The window width is calculated based on the distance between the selected window level and the adjacent minimum value.
[0035] Step STP3-g. Convert the calculated window width and window position into pixel values in a 256-bin histogram.
[0036] Beneficial effects:
[0037] 1. X-ray image enhancement is of great significance in medical diagnosis, industrial detection and scientific research. By enhancing the X-ray image, the quality and clarity of the image can be improved, so as to better identify and analyze the target information.
[0038] 2. Clear X-rays can effectively improve diagnostic accuracy, enhance the contrast and details of X-ray images, and enable doctors to see the structure and boundaries of tissues, organs and lesions more clearly, thereby improving diagnostic accuracy. In the medical field, image enhancement can help doctors more accurately identify fractures, tumors, inflammation and other lesions, and improve the effectiveness of early diagnosis and treatment.
[0039] 3. Through image enhancement, noise and artifacts are reduced, making the image clearer and easier to interpret. In a clinical setting, clear images can reduce doctors' reading fatigue and improve diagnostic efficiency. At the same time, enhanced images are also helpful for medical teaching and research, providing clearer learning and research materials.
[0040] 4. In industrial inspection, X-ray image enhancement can help inspectors more accurately find defects in materials and products, such as cracks, pores, foreign matter, etc. It can be effectively and widely used in welding quality inspection, electronic component inspection, aerospace material inspection and other fields to ensure product quality and safety.
[0041] 5. In scientific research, X-ray image enhancement can provide clearer experimental data and results, helping researchers to better analyze and understand the research object. For example, in the fields of materials science, archaeology, biology, etc., enhanced X-ray images can reveal the internal structure of materials, the internal characteristics of ancient artifacts, and the microstructure of biological samples.
[0042] 6. During the treatment process, clear X-ray images can help doctors accurately locate the lesion and develop a more accurate treatment plan. For example, in interventional therapy, radiotherapy and surgery, image enhancement can help doctors accurately guide surgical instruments or treatment equipment to improve the safety and effectiveness of treatment.
[0043] 7. High-quality enhanced X-ray images can be transmitted digitally for remote diagnosis, supporting the development of telemedicine. In remote areas or medical institutions with limited resources, through enhanced X-ray images, experts can remotely provide diagnosis and treatment suggestions, improving the accessibility and quality of medical services.
[0044] 8. Enhanced X-ray images can help doctors explain the condition and treatment plan to patients more clearly, and enhance doctor-patient communication. Through intuitive image display, patients can more easily understand their health status and treatment plan, which helps to improve treatment compliance and satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative labor.
[0046] Figure 1 It is a schematic diagram of the process of whether the discriminator can effectively identify the original image to the enhanced image.
[0047] Figure 2 It is a schematic diagram of the process of whether the discriminator can effectively identify the target image to enhance the target image.
[0048] Figure 3 It is a schematic diagram of the role of cycle consistency loss in converting from the original image domain to the target image domain.
[0049] Figure 4 It is a schematic diagram of the role of cycle consistency loss in converting from the target image domain to the original image domain.
[0050] Figure 5 is the original X-ray image Img of the pet cat in Example 1 1 .
[0051] Figure 6 It is a single-channel grayscale image Img after adjusting the window width and window position in the manner of this embodiment. 3 .
[0052] Figure 7 is the original image Img of this embodiment 1 and grayscale image Img 3 Histogram comparison of .
[0053] Figure 8 is a single-channel grayscale image Img with different micro-data enhancement and adjustment dimensions 3 .
[0054] Fig. 9 yes Figure 8 The original image Img 1 and grayscale image Img 3 Histogram comparison of . DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0056] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0057] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0058] Embodiment 1:
[0059] This embodiment provides an X-ray image enhancement method based on CycleGAN, comprising the following steps:
[0060] Step STP1, image preprocessing, using binary segmentation algorithm to maintain the original format type to achieve ROI extraction, and then using Gaussian filtering to process the original image Img 1 Smoothing and denoising are performed, and the original image Img is denoised using the Otsu method. 1 Perform binary threshold processing and use morphological closing operation to the original image Img 1 The edge details are improved, the bounding box corresponding to the ROI is calculated using the binary mask and the ROI area is extracted, and the original image Img 1 Perform pixel and anti-pixel iterative processing to obtain n pre-processed images Img 2 Composition of pictures collection M 0; Among them, ROI extraction refers to the process of identifying and extracting regions of interest from images or data sets. In the field of computer vision and image processing, ROI refers to the area in the image that contains specific information or targets, which may be very important for subsequent analysis, recognition or processing. The purpose of ROI extraction is to reduce the amount of data and improve processing efficiency by defining and identifying these key areas, and is often used in tasks such as object detection, target recognition, and image segmentation. ROI extraction technology can be based on pixel-level features, edge detection, color distribution, etc. Otsu's method is an automatic image thresholding technology used in the field of image processing and computer vision. This method was proposed by Japanese scholar Nobuyuki Otsu, and aims to find an optimal threshold to segment the image into two categories (usually target and background), so that the target is above the threshold and the background is below the threshold.
[0061] The main idea of Otsu's method is to determine the optimal threshold by maximizing the inter-class variance. In the grayscale histogram of the image, the threshold divides the image into two parts so that the inter-class variance between the two parts is maximized, that is, the difference between the target and the background is maximized. This method is suitable for images with a bimodal histogram, where the target and the background have obvious grayscale differences. With Otsu's method, the threshold suitable for image segmentation can be automatically determined, which is very useful in many image processing tasks, such as edge detection, object recognition, etc.
[0062] Step STP2, image enhancement training, the image set M in step STP1 0 Input the data set into the CycleGAN model for training, and obtain a 16-bit single-channel grayscale image Img 3 The enhanced picture collection M 1 ; It is worth noting that the internal structure of CycleGAN mainly consists of two pairs of generators and discriminators, as well as an additional cycle consistency loss. Figure 1-Figure 4 As shown, the following is the basic internal structure setting of CycleGAN:
[0063] Generator: CycleGAN contains two generators: the first generator "G_img_imgt" and the second generator "G_imgt_img". Each generator is responsible for mapping images from one domain to another domain. These two generators usually use a convolutional neural network (CNN) architecture to convert input images into images of the target domain through learning.
[0064] Discriminator: CycleGAN also contains two inverse discriminators: the first discriminator "D_img" and the second discriminator "D_imgt" are used to evaluate the authenticity of the images generated by the generator. The first discriminator "D_img" encourages "G_img" to convert images from the original image domain to images that are very close to the target image domain; the second discriminator "D_imgt" does the same thing when converting images from the target image domain to the original image domain. These discriminators are usually the discriminators of CNN, which are used to distinguish whether the generated images are images of the real domain or images of the generated domain.
[0065] Cycle Consistency Loss: To ensure that the conversion is bidirectional, CycleGAN introduces a cycle consistency loss, which is achieved by converting the converted image back to the original domain and calculating the difference between the original image and the cycle-converted image. This helps to maintain the consistency of the image content. Overall, the internal structure of CycleGAN is designed to achieve unsupervised image domain conversion, where the generator is responsible for learning the mapping from one domain to another, the discriminator is used to evaluate the quality of the generated image, and the cycle consistency loss helps to ensure the consistency and accuracy of the conversion.
[0066] The training process adopts a micro-data enhancement method, which is to replace each D(x) with D(T(x)), where x is the original image Img 1 Or preprocess image Img 2 , D is the discriminator, T is the micro-data enhancement operation process; the micro-data enhancement operation process T includes the following at least one dimension adjustment:
[0067] a. Random brightness adjustment: add random brightness x to the input tensor;
[0068] b. Random saturation adjustment: x adjusts the saturation of the input tensor by randomly scaling the color channels of the input tensor;
[0069] c. Random contrast adjustment: x adjusts the contrast of the input tensor by randomly scaling pixel values;
[0070] d. Random translation adjustment: x applies a random translation to the input tensor at a specified ratio of 0.125;
[0071] e. Random cropping adjustment: random shearing is applied by zeroing a rectangular area within the input tensor. The size and position of the cuts are random;
[0072] It is worth noting that the more adjustment dimensions in the above AE, the better the effect; but for images with uniform background or noise taken in a specific environment, only targeted adjustments can be made.
[0073] Step STP3, the determination of the adaptive window width and window level adopts any one of an adaptive window width and window level algorithm based on histogram area, an adaptive window width and window level algorithm based on image segmentation, and an adaptive window width and window level algorithm based on histogram extreme value points; wherein the adaptive window width and window level algorithm based on histogram area specifically comprises the following steps:
[0074] Step STP3.1: The input image is a 16-bit single-channel grayscale image Img after image enhancement. 3 , the background defaults to 65535;
[0075] Step STP3.2, calculate the input image Img 3 Histogram of pixel intensities, with intensity values ranging from 0 to 65535;
[0076] Step STP3.3, since there are multiple dense extreme points in the histogram distribution, a moving average is applied to smooth the histogram with a window size of 30;
[0077] Step STP3.4, calculating the total area of the histogram, and taking the minimum index and the maximum index of the histogram corresponding to the total cumulative sum of 0.05% and 8% as the window boundary;
[0078] Step STP3.5, calculate the window position as the average of the minimum index and the maximum index, and calculate the window width as the difference between the maximum index and the minimum index;
[0079] Step STP3.6, converting the calculated window width and window position into pixel values in a 256-bin histogram, thereby achieving the purpose of optimizing and enhancing the image.
[0080] This embodiment is described by taking a pet cat as an example. Figure 5 As shown, this is the original X-ray image Img of a pet cat 1 , Figure 6 It is a single-channel grayscale image Img after adjusting the window width and window position in the manner of this embodiment. 3 , Figure 7 is the original image Img of this embodiment 1 and grayscale image Img 3 Histogram comparison of ; Figure 8 is a single-channel grayscale image Img with different micro-data enhancement and adjustment dimensions 3 , Fig. 9 yes Figure 8 The original image Img 1 and grayscale image Img3 Histogram comparison of .
[0081] Embodiment 2:
[0082] The other contents of this embodiment are the same as those of the first embodiment, except that the adaptive window width and window level algorithm based on image segmentation described in step STP3 is refined, and specifically includes the following steps:
[0083] Step STP3-1. The input image is a 16-bit single-channel grayscale image Img after image enhancement 3 , the background defaults to 65535;
[0084] Step STP3-2. By inputting the image Img 3 Applying Gaussian mixture model (GMM), a Gaussian mixture model with two components is fitted to the histogram of the pixel values of the original image, and the Gaussian mixture model (GMM) is used to distinguish the image Img 3 Different intensity areas in the image to determine the histogram threshold for the best foreground we need;
[0085] Step STP3-3. The average of the two Gaussian component means in GMM is the optimal threshold for segmenting the image;
[0086] Step STP3-4. Select a specific pixel value from the range of the calculated threshold value to the maximum intensity value of 65535, the selected value being the value with the most repetitions in the image;
[0087] Step STP3-5. The pixel values calculated in step STP3-4 are used to determine the image Img 3 Adjusted window width and window level, the window level is image Img 3 The window width is the value with the most repetitions in the image - twice the optimal threshold, so as to achieve the purpose of optimizing the enhanced image.
[0088] Embodiment 3:
[0089] The other contents of this embodiment are the same as those of the first embodiment, except that the adaptive window width and window level algorithm based on the extreme value points of the histogram described in step STP3 is refined, and specifically includes the following steps:
[0090] Step STP3-a. The input image is a 16-bit single-channel grayscale image Img after image enhancement. 3 , the background defaults to 65535;
[0091] Step STP3-b. Calculate the input image Img 3 Histogram of pixel intensities, with intensity values ranging from 0 to 65535;
[0092] Step STP3-c. Since there are multiple dense extreme points in the histogram distribution, a moving average is applied to smooth the histogram with a window size of 30;
[0093] Step STP3-d. Calculate the local minimum and maximum values in the histogram;
[0094] Step STP3-e. Adjusting the detected minimum points and values by considering neighboring points to include the leftmost and rightmost points, and performing kurtosis adjustment;
[0095] Step STP3-f. Iterate the adjusted minimum points to find the maximum area under the histogram between adjacent minimum values. The window with the largest area is regarded as the region of interest. The window level is determined as the maximum point of the adjacent maximum values in the selected window. The window width is calculated based on the distance between the selected window level and the adjacent minimum value.
[0096] Step STP3-g. Convert the calculated window width and window position into pixel values in a 256-bin histogram, thereby achieving the purpose of image enhancement.
[0097] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. X-ray image enhancement method based on CycleGAN, It is characterized in that The following steps are involved: Step STP1, image preprocessing, using binary segmentation algorithm to maintain the original format type to achieve ROI extraction, and then using Gaussian filtering to process the original image Img 1 Smoothing and denoising are performed, and the original image Img is denoised using the Otsu method. 1 Perform binary threshold processing and use morphological closing operation to the original image Img 1 The edge details are improved, the bounding box corresponding to the ROI is calculated using the binary mask and the ROI area is extracted, and the original image Img 1 Perform pixel and anti-pixel iterative processing to obtain n pre-processed images Img 2 Composition of pictures collection M 0 ; Step STP2, image enhancement training, the image set M in step STP1 0 Input the data set into the CycleGAN model for training, and obtain a 16-bit single-channel grayscale image Img 3 The enhanced picture collection M 1 ; The training process uses a micro-data enhancement method, which is to replace each D(x) with D(T(x)), where x is the original image Img 1 Or preprocess the image Img 2 , D is the discriminator, T is the micro-data enhancement operation process; the micro-data enhancement operation process T includes the adjustment of at least one dimension of a and be as follows: a. Random brightness adjustment: add random brightness x to the input tensor; b. Random saturation adjustment: x adjusts the saturation of the input tensor by randomly scaling the color channels of the input tensor; c. Random contrast adjustment: x adjusts the contrast of the input tensor by randomly scaling pixel values; d. Random translation adjustment: x applies a random translation to the input tensor at a specified ratio of 0.125; e. Random cropping adjustment: random cropping is applied by zeroing a rectangular area within the input tensor. The size and position of the cuts are random; Step STP3, the determination of the adaptive window width and window level adopts any one of an adaptive window width and window level algorithm based on histogram area, an adaptive window width and window level algorithm based on image segmentation, and an adaptive window width and window level algorithm based on histogram extreme value points; wherein the adaptive window width and window level algorithm based on histogram area specifically comprises the following steps: Step STP3.1: The input image is a 16-bit single-channel grayscale image Img after image enhancement. 3 , the background defaults to 65535; Step STP3.2, calculate the input image Img 3 Histogram of pixel intensities, with intensity values ranging from 0 to 65535; Step STP3.3, since there are multiple dense extreme points in the histogram distribution, a moving average is applied to smooth the histogram with a window size of 30; Step STP3.4, calculating the total area of the histogram, and taking the minimum index and the maximum index of the histogram corresponding to the total cumulative sum of 0.05% and 8% as the window boundary; Step STP3.5, calculate the window position as the average of the minimum index and the maximum index, and calculate the window width as the difference between the maximum index and the minimum index; Step STP3.6, convert the calculated window width and window position into pixel values in a 256-bin histogram.
2. The X-ray image enhancement method based on CycleGAN according to claim 1, It is characterized in that The adaptive window width and window level algorithm based on image segmentation described in step STP3 specifically comprises the following steps: Step STP3-1. The input image is a 16-bit single-channel grayscale image Img after image enhancement 3 , the background defaults to 65535; Step STP3-2. By inputting the image Img 3 Apply the Gaussian mixture model GMM, fit the Gaussian mixture model with two components to the histogram of the pixel values of the original image, and use the Gaussian mixture model GMM to distinguish the image Img 3 Different intensity areas in the image to determine the histogram threshold for the best foreground we need; Step STP3-3. The average of the means of the two Gaussian components in GMM is the optimal threshold for segmenting the image; Step STP3-4. Select a specific pixel value from the range of the calculated threshold value to the maximum intensity value of 65535, the selected value being the value with the most repetitions in the image; Step STP3-5. The pixel values calculated in step STP3-4 are used to determine the image Img 3 Adjusted window width and window level, the window level is image Img 3 The window width is the value with the most repetitions in the image - twice the optimal threshold.
3. The X-ray image enhancement method based on CycleGAN according to claim 1, It is characterized in that The adaptive window width and window level algorithm based on histogram extreme value points described in step STP3 specifically comprises the following steps: Step STP3-a. The input image is a 16-bit single-channel grayscale image Img after image enhancement. 3 , the background defaults to 65535; Step STP3-b. Calculate the input image Img 3 Histogram of pixel intensities, with intensity values ranging from 0 to 65535; Step STP3-c. Since there are multiple dense extreme points in the histogram distribution, a moving average is applied to smooth the histogram with a window size of 30; Step STP3-d. Calculate the local minimum and maximum values in the histogram; Step STP3-e. Adjusting the detected minimum points and values by considering neighboring points to include the leftmost and rightmost points, and performing kurtosis adjustment; Step STP3-f. Iterate the adjusted minimum points to find the maximum area under the histogram between adjacent minimum values. The window with the largest area is regarded as the region of interest. The window level is determined as the maximum point of the adjacent maximum values in the selected window. The window width is calculated based on the distance between the selected window level and the adjacent minimum value. Step STP3-g. Convert the calculated window width and window position into pixel values in a 256-bin histogram.
Citation Information
Patent Citations
X-ray small dental film image enhancement method
CN114972067A
Multi-resolution fusion radial image enhancement method
CN103093449A
Infrared image and visible light image fusion method based on non-global pre-enhancement
CN114387195A
