A X-ray image processing method based on CLAHE
By using CLAHE technology and wavelet transformation in X-ray image processing, the unclear problem of X-ray images due to uneven light and low contrast is solved, and contrast improvement and image clarity are achieved.
Patent Information
- Application Number
- CN202211537511.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-01
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2042-12-01
AI Technical Summary
Due to uneven light exposure and low contrast in X-ray images, the image is unclear and the amount of information is low, and the prior art is difficult to effectively solve these problems.
Using the X-ray image processing method based on CLAHE, by converting the X-ray image to the HIS space, extracting brightness components and performing adaptive histogram equalization of limiting contrast, combining wavelet transformation and guided filtering for denoising, and finally through the fusion rules and The inverse wavelet transform results in the image enhancement result.
The contrast of the image is significantly improved, the dimension of the image data is reduced, the time of image processing is significantly reduced, and the clarity and information volume of the image is improved.
Smart Images

Figure CN116109527B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to an X-ray image processing method based on CLAHE. Background Art
[0002] X-ray image enhancement technology is a research issue that has received much attention in the field of image processing. By amplifying the display contrast of the structure of the region of interest in the X-ray image, the visual quality and comprehensibility of the image are significantly improved, which is of great significance to various artificial and autonomous sensing devices in applications such as flaw detection of industrial parts and medical clinical diagnosis. Therefore, the present invention proposes an X-ray image processing method based on CLAHE, which uses CLAHE to perform contrast-limited adaptive histogram equalization brightness processing, solves the problem of unclear images and low information content caused by uneven light illumination and low contrast, reduces the dimensionality of image data, significantly reduces the time of image processing, and effectively and efficiently improves the contrast of the image. Summary of the invention
[0003] The object of the present invention is to provide an X-ray image processing method based on CLAHE to solve the problems raised in the above background technology.
[0004] To achieve the above-mentioned purpose, the present invention provides the following technical solutions: a CLAHE-based X-ray image processing method, comprising: acquiring an X-ray image to be processed, and converting the X-ray image to be processed from an RGB space to an HIS space to obtain a first processed image; extracting a brightness component from the first processed image, and performing contrast-limited adaptive histogram equalization on the brightness component to obtain a brightness processing component; performing wavelet transform on the brightness component and the brightness processing component to obtain a high-frequency component and a low-frequency component; performing denoising on the high-frequency component using a guided filter to obtain a high-frequency processing component; fusing the high-frequency processing component and the low-frequency component according to a fusion rule to obtain a fused brightness component; transforming the fused brightness component by an inverse wavelet transform to obtain a new brightness component; and inversely transforming the new brightness component in combination with a hue component and a saturation component to obtain an enhanced image of the X-ray image to be processed.
[0005] Furthermore, when the contrast-limited adaptive histogram equalization is performed on the brightness component, the X-ray image to be processed is divided into a plurality of rectangular areas. In each rectangular area, a regional histogram is obtained for the rectangular area, and a transformation function is determined for the rectangular area. Then, an upper threshold of the regional histogram is set, and the portion of the regional histogram exceeding the upper threshold is evenly distributed over the entire image grayscale value interval. Different transformation functions are used to transform the pixels in the rectangular area according to the pixel position. A point transformation function is used to perform grayscale transformation for the endpoints of the rectangular area. For pixels at edge positions of the rectangular area other than the endpoints, the transformation functions of two adjacent pixels are used to transform the pixels and then linear interpolation is performed. For pixels in the middle part of the rectangular area, the transformation functions of four adjacent pixels are used to transform the pixels and then bilinear interpolation is performed.
[0006] Furthermore, when wavelet transform is performed on the brightness component and the brightness processing component, wavelet transform is performed on the brightness component and the brightness processing component respectively, and the high-frequency signal and the low-frequency signal in the brightness component and the brightness processing component are separated by wavelet transform to obtain the high-frequency component of the brightness component and the low-frequency component of the brightness component and the high-frequency component of the brightness processing component and the low-frequency component of the brightness processing component.
[0007] Furthermore, when the high-frequency component is denoised using the guided filtering, the edge information of the image is retained using the guided filtering formula, and in the process of retaining the edge information, a cost analysis is performed according to minimizing the difference between the components before and after the denoising process to determine the optimization result of the guided filtering formula, and the optimization result of the guided filtering formula is averaged to obtain the high-frequency processing component.
[0008] Furthermore, when the high-frequency processing component and the low-frequency component are fused respectively according to the fusion rule, the high-frequency component of the brightness component is fused with the high-frequency component of the brightness processing component by a method based on regional characteristics, and the low-frequency component of the brightness component is fused with the low-frequency component of the brightness processing component by a method based on image visibility weighted summation.
[0009] Furthermore, a method based on regional characteristics is used to fuse the high-frequency component of the brightness component with the high-frequency component of the brightness processing component, including: establishing a contribution matrix; defining the local energy of the brightness component and the local energy of the brightness processing component by combining the contribution matrix with the high-frequency coefficients of the high-frequency component of the brightness component and the high-frequency coefficients of the high-frequency component of the brightness processing component respectively; performing a matching degree analysis on the local energy of the brightness component and the local energy of the brightness processing component to obtain the matching degree between the high-frequency component of the brightness component and the high-frequency component of the brightness processing component; setting a threshold, and analyzing the size of the matching degree according to the set threshold, when the matching degree is less than or equal to the set threshold, using a weighted average method to fuse the high-frequency component of the brightness component with the high-frequency component of the brightness processing component to obtain a high-frequency fused component, otherwise using a weighted coefficient method to fuse the high-frequency component of the brightness component with the high-frequency component of the brightness processing component to obtain a high-frequency fused component.
[0010] Furthermore, a method based on image visibility weighted summation is used to fuse the low-frequency component of the brightness component with the low-frequency component of the brightness processing component, including:
[0011] Obtaining the regional image visibility of the image corresponding to the low-frequency component of the brightness component and the regional image visibility of the image corresponding to the low-frequency component of the brightness processing component;
[0012] Obtaining a first low-frequency weighting coefficient and a second low-frequency weighting coefficient according to the regional image visibility of the image corresponding to the low-frequency component of the brightness component and the regional image visibility of the image corresponding to the low-frequency component of the brightness processing component;
[0013] The low-frequency coefficient of the low-frequency component of the luminance component and the low-frequency coefficient of the low-frequency component of the luminance processing component are obtained, and the first low-frequency weighting coefficient and the second low-frequency weighting coefficient are respectively combined with the low-frequency coefficient of the low-frequency component of the luminance component and the low-frequency coefficient of the low-frequency component of the luminance processing component to obtain a low-frequency fusion component.
[0014] Furthermore, the process of transforming the fusion-processed brightness component by inverse wavelet transform is inverse to the process of performing wavelet transform on the brightness component and the brightness processing component to obtain high-frequency component and low-frequency component, and a new brightness component is obtained by inverse wavelet transform.
[0015] Furthermore, when the new brightness component is combined with the hue component and the saturation component for inverse conversion to obtain an enhanced image of the X-ray image to be processed, the new brightness component is combined with the hue component and the saturation component to be restored from the HIS space to the RGB space through inverse conversion to obtain an enhanced image of the X-ray image to be processed.
[0016] Furthermore, the RGB space is based on the three basic colors of red, green, and blue, and is divided into R component, G component, and B component. The HIS space is based on hue, saturation, and brightness, and is divided into hue component, saturation component, and brightness component. When converting from the RGB space to the HIS space, the conversion is performed through the following relationship:
[0017]
[0018]
[0019]
[0020] Among them: H represents the hue component, S represents the saturation component; I represents the brightness component.
[0021] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings.
[0022] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0024] Figure 1 A schematic diagram of the steps of an X-ray image processing method based on CLAHE according to the present invention;
[0025] Figure 2 This is a schematic diagram of step 2 in the X-ray image processing method based on CLAHE according to the present invention;
[0026] Figure 3 This is a partial flow chart of step 5 in the X-ray image processing method based on CLAHE described in the present invention. DETAILED DESCRIPTION
[0027] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0028] like Figure 1 As shown, an embodiment of the present invention provides a mining and analysis method based on massive data, including:
[0029] Step 1, obtaining an X-ray image to be processed, and converting the X-ray image to be processed from an RGB space to an HIS space to obtain a first processed image;
[0030] Step 2: extracting the brightness component of the first processed image, and performing contrast-limited adaptive histogram equalization on the brightness component to obtain a brightness processing component;
[0031] Step 3: Perform wavelet transform on the brightness component and the brightness processing component to obtain high-frequency component and low-frequency component;
[0032] Step 4: Use guided filtering to denoise the high-frequency component to obtain a high-frequency processing component;
[0033] Step 5: According to the fusion rule, the high-frequency processing component and the low-frequency component are fused to obtain the fused brightness component;
[0034] Step 6: transform the fused brightness component by inverse wavelet transform to obtain a new brightness component;
[0035] Step 7: Inversely transform the new brightness component together with the hue component and the saturation component to obtain an enhanced image of the X-ray image to be processed.
[0036] The above technical scheme provides an X-ray image processing method based on CLAHE. When processing an X-ray image to be processed, the X-ray image to be processed is first determined, and the X-ray image to be processed is converted from the RGB space to the HIS space, and the X-ray image to be processed, that is, the first processed image, is obtained in the HIS space. Then, the brightness component is extracted from the first processed image for analysis, and the brightness analysis is subjected to restricted contrast adaptive histogram equalization based on CLAHE to obtain a brightness processing component; then, the brightness component and the brightness processing component are separated by wavelet transform to obtain a high-frequency component and a low-frequency component; then, the high-frequency component is denoised by guided filtering to obtain a high-frequency processing component, and then the high-frequency processing component and the low-frequency component are fused according to the fusion rule, so as to obtain a fused brightness component, and then the fused brightness component is transformed by inverse wavelet transform to obtain a new brightness component, and finally, the new brightness component is combined with the hue component and the saturation component for inverse conversion, and restored from the HIS space to the RGB space, so as to realize the processing of the X-ray image to be processed.
[0037] The above technical solution realizes the processing of the brightness component by converting the X-ray image to be processed from the RGB space to the HIS space, thereby solving the problem of uneven light illumination of the X-ray image to be processed. In addition, only the brightness component is analyzed and processed in the HIS space, which reduces the dimension of the image data and improves the image processing efficiency. In addition, by performing contrast-limited adaptive histogram equalization based on CLAHE, the image is avoided from being unclear due to low contrast of the X-ray image to be processed, thereby improving the contrast of the image.
[0038] In one embodiment provided by the present invention, when performing contrast-limited adaptive histogram equalization on the brightness component, the X-ray image to be processed is divided into multiple rectangular areas. In each rectangular area, a regional histogram is obtained for the rectangular area, and a transformation function is determined for the rectangular area. Then, an upper threshold of the regional histogram is set, and the portion of the regional histogram that exceeds the upper threshold is evenly distributed over the entire image grayscale value interval. Different transformation functions are used to transform the pixels in the rectangular area according to the pixel position, a point transformation function is used to perform grayscale transformation for the endpoints of the rectangular area, and pixels at edge positions of the rectangular area other than the endpoints are transformed using the transformation functions of two adjacent pixels and then linear interpolation is performed. Pixels in the middle part of the rectangular area are transformed using the transformation functions of four adjacent pixels and then bilinear interpolation is performed.
[0039] like Figure 2 As shown, the above technical solution performs contrast-limited adaptive histogram equalization on the brightness component, including:
[0040] Step 201, dividing the X-ray image to be processed into a plurality of rectangular areas;
[0041] Step 202: in each rectangular area, obtain a region histogram for the rectangular area, and determine a transformation function for the rectangular area;
[0042] Step 203, setting an upper threshold of the regional histogram, and evenly distributing the portion of the regional histogram that exceeds the upper threshold over the entire image grayscale value interval;
[0043] Step 204, different transformation functions are used to transform the pixels in the rectangular area according to the pixel positions, point transformation functions are used to transform the grayscale of the endpoints of the rectangular area, pixels at the edge positions of the rectangular area other than the endpoints are transformed by the transformation functions of two adjacent pixels and then linear interpolation is performed, and pixels in the middle part of the rectangular area are transformed by the transformation functions of four adjacent pixels and then bilinear interpolation is performed.
[0044] The above technical solution can effectively handle the contrast between sub-blocks with different brightnesses by performing contrast-limited adaptive histogram equalization on the brightness component to achieve global balance, prevent image distortion caused by excessive amplification of details, and improve the contrast of the image.
[0045] In one embodiment provided by the present invention, when wavelet transform is performed on the brightness component and the brightness processing component, wavelet transform is performed on the brightness component and the brightness processing component respectively, and the high-frequency signal and the low-frequency signal in the brightness component and the brightness processing component are separated by wavelet transform to obtain the high-frequency component of the brightness component and the low-frequency component of the brightness component and the high-frequency component of the brightness processing component and the low-frequency component of the brightness processing component.
[0046] When the above technical scheme performs wavelet transform on the brightness component and the brightness processing component, the high-frequency signal and the low-frequency signal in the brightness component are separated by wavelet transform to obtain the high-frequency component of the brightness component and the low-frequency component of the brightness component, and the high-frequency signal and the low-frequency signal in the brightness processing component are separated by wavelet transform to obtain the high-frequency component of the brightness processing component and the low-frequency component of the brightness processing component.
[0047] The above technical solution can select a suitable filter through wavelet transform to greatly reduce or remove the correlation between the extracted different features, and the wavelet transform can use high frequency resolution and low time resolution in the low frequency band, and low frequency resolution and high time resolution in the high frequency band, so that the high frequency component and the low frequency component can be separated.
[0048] In one embodiment provided by the present invention, when high-frequency components are denoised using guided filtering, edge information of an image is retained using a guided filtering formula, and in the process of retaining edge information, a cost analysis is performed by minimizing the difference between components before and after denoising to determine an optimization result of the guided filtering formula, and the optimization result of the guided filtering formula is averaged to obtain a high-frequency processed component.
[0049] When the above technical solution uses guided filtering to denoise the high-frequency components, the guided filtering formula is used to retain the edge information of the image. The guided filtering calculation formula is:
[0050]
[0051] Among them, q i is the output high-frequency component of pixel i; I i is the guidance graph of pixel i; a k , b kis the coefficient of the linear function when the window center is k. In the process of edge information retention, the cost analysis is performed according to the minimization of the difference between the components before and after denoising to determine the optimization result of the guided filtering formula. Among them, the cost function E(a k ,b k )for:
[0052]
[0053] In the above formula: p i is the input high-frequency component of the pixel, ε is the regularization factor, a k Specifically expressed as:
[0054]
[0055] b k Specifically expressed as:
[0056]
[0057] In the above formula: u k , The guided graph is in window w k The mean and variance of The input image is in window w k The average value of the guided filtering formula is used to determine the optimization result under the optimal condition of the iterative function.
[0058] Then, the optimization result of the guided filtering formula is averaged to obtain the high-frequency processing component. The final expression of the output high-frequency component is:
[0059]
[0060] The above technical solution retains the edge information of the image by guiding the filtering formula while filtering the noise contained in the high-frequency component of the image to reduce the interference of the noise, and minimizes the difference between the input component and the output component through the cost function analysis, thereby reducing the error and better retaining the image detail information, and by performing averaging processing, it can be balanced when a pixel is included in multiple windows. In addition, a regularization factor is introduced in the cost function to avoid the coefficient a of the linear function when the window center is k. k The value is too large.
[0061] In an embodiment provided by the present invention, when the high-frequency processing component and the low-frequency component are fused separately according to the fusion rule, the high-frequency component of the brightness component is fused with the high-frequency component of the brightness processing component by a method based on regional characteristics, and the low-frequency component of the brightness component is fused with the low-frequency component of the brightness processing component by a method based on image visibility weighted summation.
[0062] The above technical scheme fuses the high-frequency processing component and the low-frequency component respectively according to the fusion rule, adopts a method based on regional characteristics to fuse the high-frequency component of the brightness component with the high-frequency component of the brightness processing component, and adopts a method based on image visibility weighted summation to fuse the low-frequency component of the brightness component with the low-frequency component of the brightness processing component.
[0063] The above technical solution fuses the high-frequency processing components and the low-frequency components respectively through different fusion rules, so as to combine the characteristics of different communications, make up for the defects, and improve the effect of the fused image.
[0064] like Figure 3 As shown, in one embodiment provided by the present invention, a method based on regional characteristics is used to fuse the high-frequency component of the brightness component with the high-frequency component of the brightness processing component, including: establishing a contribution matrix; defining the local energy of the brightness component and the local energy of the brightness processing component by combining the contribution matrix with the high-frequency coefficients of the high-frequency component of the brightness component and the high-frequency coefficients of the high-frequency component of the brightness processing component respectively; performing a matching degree analysis on the local energy of the brightness component and the local energy of the brightness processing component to obtain the matching degree between the high-frequency component of the brightness component and the high-frequency component of the brightness processing component; setting a threshold, and analyzing the size of the matching degree according to the set threshold, when the matching degree is less than or equal to the set threshold, using a weighted average method to fuse the high-frequency component of the brightness component with the high-frequency component of the brightness processing component to obtain a high-frequency fused component, otherwise using a weighted coefficient method to fuse the high-frequency component of the brightness component with the high-frequency component of the brightness processing component to obtain a high-frequency fused component.
[0065] In the above technical solution, when the high-frequency component of the brightness component is merged with the high-frequency component of the brightness processing component by using the method based on regional characteristics, a contribution matrix w(m,n) is first established, and then the contribution matrix is combined with the high-frequency coefficients of the high-frequency component of the brightness component and the high-frequency coefficients of the high-frequency component of the brightness processing component to define the local energy of the brightness component and the local energy of the brightness processing component;
[0066]
[0067] in, is the local energy of the high-frequency component of the image at point (x, y) in the horizontal (H), vertical (V), and diagonal (D) directions at scale j; Indicates the high-frequency coefficients after image decomposition; F = A or F = B, when F = A, it indicates the image corresponding to the brightness component, and when F = B, it indicates the image corresponding to the brightness processing component;
[0068] Then, a matching degree analysis is performed on the local energy of the brightness component and the local energy of the brightness processing component to obtain a matching degree T between the high-frequency component of the brightness component and the high-frequency component of the brightness processing component;
[0069]
[0070] Finally, if Figure 3 As shown, a threshold is set, and the matching degree is analyzed according to the set threshold. When the matching degree is less than or equal to the set threshold, the high-frequency component of the brightness component and the high-frequency component of the brightness processing component are fused together by the weighted average method to obtain a high-frequency fused component. Otherwise, the high-frequency component of the brightness component and the high-frequency component of the brightness processing component are fused together by the weighted coefficient method to obtain a high-frequency fused component, that is:
[0071]
[0072] in, represents the high frequency coefficients of the fused component at (x, y) in the horizontal (H), vertical (V), and diagonal (D) directions at scale j; C min With C max They represent the high-frequency coefficients corresponding to smaller and larger energy values respectively; a is the weight coefficient of smaller energy, which is specifically expressed as:
[0073] The above technical solution adopts a high-frequency fusion criterion based on regional characteristic measurement and selects different fusion criteria according to the local energy of the image. The local area energy can reflect the local information of the image. The larger the local area energy, the more image information there is in the area. The regional matching degree reflects the local similarity between images. The higher the matching degree, the higher the local similarity, and the higher the degree of fit when they are fused together.
[0074] In one embodiment of the present invention, a method based on image visibility weighted summation is used to fuse the low-frequency component of the brightness component with the low-frequency component of the brightness processing component, including:
[0075] Obtaining the regional image visibility of the image corresponding to the low-frequency component of the brightness component and the regional image visibility of the image corresponding to the low-frequency component of the brightness processing component;
[0076] Obtaining a first low-frequency weighting coefficient and a second low-frequency weighting coefficient according to the regional image visibility of the image corresponding to the low-frequency component of the brightness component and the regional image visibility of the image corresponding to the low-frequency component of the brightness processing component;
[0077] The low-frequency coefficient of the low-frequency component of the luminance component and the low-frequency coefficient of the low-frequency component of the luminance processing component are obtained, and the first low-frequency weighting coefficient and the second low-frequency weighting coefficient are respectively combined with the low-frequency coefficient of the low-frequency component of the luminance component and the low-frequency coefficient of the low-frequency component of the luminance processing component to obtain a low-frequency fusion component.
[0078] When the above technical solution adopts the method based on image visibility weighted summation to fuse the low-frequency component of the brightness component with the low-frequency component of the brightness processing component, the image visibility is first defined by the following formula to obtain the regional image visibility of the image corresponding to the low-frequency component of the brightness component and the regional image visibility of the image corresponding to the low-frequency component of the brightness processing component;
[0079]
[0080] Among them: IV F,j (x, y) represents the regional image visibility within the i×j window with (x, y) as the center point at scale j, F = A or F = B. When F = A, it represents the regional image visibility of the image corresponding to the low-frequency component of the brightness component, and when F = B, it represents the regional image visibility of the image corresponding to the low-frequency component of the brightness processing component; C l,j (x+p, y+q) represents the low-frequency coefficients at scale j after image decomposition; represents the average value of coefficients in a 3×3 neighborhood; γ is a visual constant, ranging from 0.6 to 0.7;
[0081] Then, according to the regional image visibility of the low-frequency component of the brightness component and the regional image visibility of the low-frequency component of the brightness processing component, the first low-frequency weighting coefficient P is obtained by the following formula: A and the second low-frequency weighting coefficient P B ;
[0082]
[0083]
[0084] Next, the low-frequency coefficient of the low-frequency component of the luminance component and the low-frequency coefficient of the low-frequency component of the luminance processing component are obtained, and the first low-frequency weighting coefficient and the second low-frequency weighting coefficient are respectively combined with the low-frequency coefficient of the low-frequency component of the luminance component and the low-frequency coefficient of the low-frequency component of the luminance processing component through the following fusion rule to obtain a low-frequency fusion component:
[0085] C L,I,j (x,y)=P A C A,I,j (x,y)+P B C B,I,j (x,y)
[0086] Among them, C L,I,j (x, y) represents the fusion component of the low-frequency coefficient at (x, y) at scale j; C A,I,j (x, y) represents the low-frequency coefficient of the low-frequency component of the brightness component, C B,I,j (x, y) represents the low-frequency coefficient of the low-frequency component of the luminance processing component.
[0087] The above technical solution realizes the background information processing of the image by fusing the low-frequency components, which can effectively suppress the influence of noise, avoid the loss of some useful information in the original image, and improve the image clarity.
[0088] In one embodiment provided by the present invention, the process of transforming the points of the fusion-processed brightness component through inverse wavelet transform is inverse to the process of performing wavelet transform on the brightness component and the brightness processing component to obtain the high-frequency component and the low-frequency component, and a new brightness component is obtained through inverse wavelet transform.
[0089] Step six and step three in the above technical solution are an inverse process, and a new brightness component is obtained by using inverse wavelet transform for the fused brightness component, ie, the fused high-frequency component and the fused low-frequency component.
[0090] The above technical solution uses inverse transformation to form a step opposite to the previous step of obtaining high-frequency components and low-frequency components using wavelet transformation, thereby restoring the fused high-frequency components and the fused low-frequency components into a new brightness component, thereby realizing the restoration of the brightness after processing.
[0091] In one embodiment provided by the present invention, when the new brightness component is combined with the hue component and the saturation component for inverse conversion to obtain an enhanced image of the X-ray image to be processed, the new brightness component is combined with the hue component and the saturation component and restored from the HIS space to the RGB space through inverse conversion to obtain an enhanced image of the X-ray image to be processed.
[0092] When the above technical scheme inversely transforms the new brightness component in combination with the hue component and the saturation component to obtain an enhanced image of the X-ray image to be processed, the new brightness component in combination with the hue component and the saturation component is restored from the HIS space to the RGB space through inverse transformation to obtain an enhanced image of the X-ray image to be processed.
[0093] The above technical solution restores the new brightness component combined with the hue component and the saturation component from the HIS space to the RGB space through inverse conversion, so that the X-ray image after brightness processing can be obtained in the RGB space corresponding to the original X-ray image to be processed, thereby realizing the spatial restoration of the processed image.
[0094] In one embodiment provided by the present invention, the RGB space is based on the three basic colors of red, green and blue, and is divided into R component, G component and B component. The HIS space is based on hue, saturation and brightness, and is divided into hue component, saturation component and brightness component. When converting from the RGB space to the HIS space, the conversion is performed through the following relationship:
[0095]
[0096]
[0097]
[0098] Among them: H represents the hue component, S represents the saturation component; I represents the brightness component.
[0099] Those skilled in the art should understand that the first and second in the present invention merely refer to different application stages.
[0100] Other embodiments of the present disclosure will be readily apparent to those skilled in the art after considering the specification and practicing the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0101] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A CLAHE-based X-ray image processing method, characterized in that: include: Acquire an X-ray image to be processed, and convert the X-ray image to be processed from an RGB space to an HIS space to obtain a first processed image; Extracting a brightness component from the first processed image, and performing contrast-limited adaptive histogram equalization on the brightness component to obtain a brightness processing component; Performing wavelet transform on the brightness component and the brightness processing component to obtain high-frequency component and low-frequency component; The high frequency component is denoised by using guided filtering to obtain the high frequency processing component; According to the fusion rule, the high-frequency processing component and the low-frequency component are fused respectively to obtain the brightness component after fusion processing; the brightness component after fusion processing is transformed by inverse wavelet transform to obtain a new brightness component; the new brightness component is combined with the hue component and the saturation component for inverse transformation to obtain an enhanced image of the X-ray image to be processed; When the high-frequency processing component and the low-frequency component are fused according to the fusion rule, the high-frequency component of the brightness component is fused with the high-frequency component of the brightness processing component by a method based on regional characteristics, and the low-frequency component of the brightness component is fused with the low-frequency component of the brightness processing component by a method based on image visibility weighted summation, wherein the high-frequency component of the brightness component is fused with the high-frequency component of the brightness processing component by a method based on regional characteristics, including: establishing a contribution matrix; defining the local energy of the brightness component and the local energy of the brightness processing component by combining the contribution matrix with the high-frequency coefficient of the high-frequency component of the brightness component and the high-frequency coefficient of the high-frequency component of the brightness processing component; performing matching degree analysis on the local energy of the brightness component and the local energy of the brightness processing component to obtain the matching degree between the high-frequency component of the brightness component and the high-frequency component of the brightness processing component; setting a threshold, and analyzing the size of the matching degree according to the set threshold, when the matching degree is less than or equal to the set threshold, using a weighted average method to fuse the high-frequency component of the brightness component with the high-frequency component of the brightness processing component to obtain a high-frequency fused component, otherwise using a weighted coefficient method to fuse the high-frequency component of the brightness component with the high-frequency component of the brightness processing component to obtain a high-frequency fused component.
2. The method according to claim 1, characterized in that When the brightness component is subjected to contrast-limited adaptive histogram equalization, the X-ray image to be processed is divided into a plurality of rectangular areas. In each rectangular area, a regional histogram is obtained for the rectangular area, and a transformation function is determined for the rectangular area. Then, an upper threshold of the regional histogram is set, and the portion of the regional histogram exceeding the upper threshold is evenly distributed over the entire image grayscale value interval. Different transformation functions are used to transform the pixels in the rectangular area according to the pixel position. A point transformation function is used to transform the grayscale of the endpoints of the rectangular area. The pixels at the edge positions of the rectangular area other than the endpoints are transformed by the transformation functions of two adjacent pixels and then linear interpolation is performed. The pixels in the middle part of the rectangular area are transformed by the transformation functions of four adjacent pixels and then bilinear interpolation is performed.
3. The method according to claim 1, characterized in that When wavelet transform is performed on the brightness component and the brightness processing component, wavelet transform is performed on the brightness component and the brightness processing component respectively, and the high-frequency signal and the low-frequency signal in the brightness component and the brightness processing component are separated by wavelet transform to obtain the high-frequency component of the brightness component and the low-frequency component of the brightness component and the high-frequency component of the brightness processing component and the low-frequency component of the brightness processing component.
4. The method according to claim 1, characterized in that: When the high-frequency component is denoised by guided filtering, the edge information of the image is retained by the guided filtering formula, and in the process of retaining the edge information, a cost analysis is performed according to minimizing the difference between the components before and after the denoising process to determine the optimization result of the guided filtering formula, and the optimization result of the guided filtering formula is averaged to obtain the high-frequency processing component.
5. The method according to claim 1, characterized in that The low-frequency component of the brightness component is fused with the low-frequency component of the brightness processing component by using a weighted summation method based on image visibility, including: Obtaining the regional image visibility of the image corresponding to the low-frequency component of the brightness component and the regional image visibility of the image corresponding to the low-frequency component of the brightness processing component; Obtaining a first low-frequency weighting coefficient and a second low-frequency weighting coefficient according to the regional image visibility of the image corresponding to the low-frequency component of the brightness component and the regional image visibility of the image corresponding to the low-frequency component of the brightness processing component; The low-frequency coefficient of the low-frequency component of the luminance component and the low-frequency coefficient of the low-frequency component of the luminance processing component are obtained, and the first low-frequency weighting coefficient and the second low-frequency weighting coefficient are respectively combined with the low-frequency coefficient of the low-frequency component of the luminance component and the low-frequency coefficient of the low-frequency component of the luminance processing component to obtain a low-frequency fusion component.
6. The method according to claim 1, characterized in that The process of transforming the points of the fused brightness component by inverse wavelet transform is inverse to the process of obtaining high-frequency and low-frequency components by wavelet transforming the brightness component and the brightness processing component. A new brightness component is obtained by inverse wavelet transform.
7. The method according to claim 1, characterized in that When the new brightness component is combined with the hue component and the saturation component for inverse conversion to obtain the enhanced image of the X-ray image to be processed, the new brightness component is combined with the hue component and the saturation component to be restored from the HIS space to the RGB space through inverse conversion to obtain the enhanced image of the X-ray image to be processed.
8. The method according to claim 1, characterized in that: The RGB space is based on the three basic colors of red, green, and blue, and is divided into R component, G component, and B component. The HIS space is based on hue, saturation, and brightness, and is divided into hue component, saturation component, and brightness component. When converting from RGB space to HIS space, the conversion is performed through the following relationship: Among them: H represents the hue component, S represents the saturation component; I represents the brightness component.
Citation Information
Patent Citations
Image processing method based on combination of wavelet transform and self-adaptive transform
CN106709891A