Self-adaptive contrast enhancement method and system for medical image

Through adaptive weighted median filtering, linear normalization and quantum heuristic parameter search algorithms, adaptive contrast enhancement of medical images is achieved, solving the problem that the combination of contrast enhancement parameters in the prior art is difficult to automatically determine, and improving the clarity and diagnostic accuracy of the image.

CN119624845APending Publication Date: 2025-03-14CHANGZHOU NO 2 PEOPLES HOSPITAL
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411825444.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

Existing medical image contrast enhancement technology cannot automatically search and determine the optimal combination of contrast enhancement parameters, resulting in insufficient image clarity and detail expressiveness, affecting diagnostic accuracy.

Method used

Adaptive weighted median filtering and linear normalized preprocessing are adopted, combined with quantum heuristic parameter search algorithm, and the optimal combination of contrast enhancement parameters is automatically searched and determined to achieve adaptive contrast enhancement in medical images.

Benefits of technology

It improves the clarity and detailed expression of medical images, provides strong support for doctors' accurate diagnosis, and can refine the parameter value range according to the image type, improving the search efficiency and the possibility of optimal parameter combinations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119624845A_ABST
    Figure CN119624845A_ABST
Patent Text Reader

Abstract

The invention discloses a self-adaptive contrast enhancement method and system for a medical image, and relates to the technical field of medical image processing, and the system comprises the following components: S1, image input and preprocessing, S2, quantum heuristic parameter search initialization, S3, a search process based on quantum state superposition and entanglement characteristics, S4, optimal parameter combination determination, and S5, optimal contrast enhancement. And enhancing the image contrast. According to the method, noise in the medical image is effectively removed through self-adaptive weighted median filtering and linear normalization preprocessing operation, the gray value range of the image is normalized, a high-quality input image is provided for subsequent contrast enhancement operation, meanwhile, a quantum heuristic parameter search algorithm is utilized, and the image quality is improved. According to the system, the optimal contrast enhancement parameter combination can be automatically searched and determined, the self-adaptive enhancement of the contrast of the medical image is realized, the definition and detail expressive force of the image are improved, and a doctor can more accurately diagnose diseases.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of medical image processing, and in particular to a method and system for adaptive contrast enhancement of medical images. Background Art

[0002] In medical diagnosis, high-quality images are crucial for accurately judging the condition. However, due to the diverse sources of medical images and their different image characteristics, there are often problems such as insufficient contrast and noise interference, which affect the image clarity and detail expression.

[0003] There are deficiencies in the traditional medical image contrast enhancement technology, which cannot automatically search and determine the optimal contrast enhancement parameter combination. Therefore, it is particularly important to develop an adaptive contrast enhancement method and system for medical images. Summary of the invention

[0004] The purpose of the present invention is to make up for the deficiencies of the prior art and to provide a method and system for adaptive contrast enhancement of medical images. The system realizes adaptive enhancement of the contrast of medical images by introducing adaptive weighted median filtering, linear normalization preprocessing and optimized quantum heuristic parameter search algorithm, thereby improving the clarity and detail expression of the image and providing strong support for the doctor's accurate diagnosis.

[0005] In order to solve the above technical problems, the present invention provides the following technical solutions: a method for adaptive contrast enhancement of medical images, characterized in that the specific steps of the method are: S1, image input and preprocessing: receiving the medical image to be processed, obtaining the preprocessed medical image through the following preprocessing operations, using the adaptive weighted median filtering method to remove noise, for each pixel in the image , with it as the center and a size of The window, where is a preset positive integer, calculate the absolute difference between the grayscale value of each pixel in the window and the grayscale value of the central pixel, sort these differences from small to large, and take the first The pixel corresponding to the difference value is The grayscale values ​​of pixels are weighted averaged. The calculation method is: ,in It is The gray value of the selected pixel, is the center pixel The grayscale value of the image is calculated and the weighted average grayscale value is assigned to the central pixel to complete the noise removal of the entire image. The linear normalization method is used to change the grayscale value range of the image from the original range to Normalized to the interval [0, 1], the calculation formula is: ,in is the pixel in the image The original gray value, is the normalized grayscale value, and They are the minimum and maximum grayscale values ​​in the image, respectively. The normalization operation is completed by traversing all pixels of the image; S2, quantum-inspired parameter search initialization: define the parameter space related to contrast enhancement, which contains the brightness adjustment coefficients , contrast adjustment factor , Gamma correction coefficient , borrowing the concept of quantum state to initialize a set of quantum-inspired search states and their corresponding quantum probability amplitudes, assuming that the number of initialized search states is , for the search state, and its corresponding parameter combination is ,in , , They are the initial values ​​randomly generated within their respective value ranges, the quantum probability amplitude The initialization of is randomly generated using uniform distribution, the value range is [0, 1], and the normalization condition is satisfied: ; S3, search process based on quantum state superposition and entanglement characteristics: Use quantum state superposition and entanglement characteristics to search and evaluate the quantum-inspired search state, and calculate the activity value of each parameter combination as follows: According to the principle of quantum state superposition, each search state can be regarded as a superposition state of multiple possible parameter combinations. search state, and its state during the search process is represented as , Indicates the number of sub-states generated by further subdividing each search state during the search process. ,in is the coefficient of the substate, satisfying the normalization condition: , Represents the specific parameter combination sub-state after subdivision. For each sub-state, calculate its impact index value on the current preprocessed medical image , the calculation formula is as follows

[0006] in, It uses parameter combination sub-state Perform temporary enhancement on the preprocessed medical image using the conventional contrast enhancement formula:

[0007] in is the pixel of the preprocessed medical image The gray value of and They are the minimum and maximum grayscale values ​​of the image after preprocessing, and the pixel points The gray value of is the target grayscale value, and is the weight coefficient, The value of is determined according to the image type and target contrast requirements. The value of is determined according to the original contrast of the image. For images with poor original contrast, the influence index value of each sub-state is The weighted average is The fitness value of the search state , the calculation formula is: Establish the entanglement relationship between different search states, and set the search state and search status The entanglement coefficient between , which is calculated as:

[0008] in, and Search state and search status The corresponding parameter combination performs temporary enhancement on the pixel points of the preprocessed medical image. Gray value, according to the entanglement coefficient, adjust the parameter combination of the search state. The specific adjustment rules are as follows: , its parameter combination adjustment amount , , They are:

[0009] The updated parameter combination is: , continue the search and evaluation process; S4, determine the optimal parameter combination: according to the fitness value, use the collapse mechanism of quantum probability amplitude to select the contrast enhancement parameter combination, and calculate the selection probability of each search state , the calculation formula is: ,in It is The quantum probability amplitude of the search state, It is The fitness value of the search state is then generated by a random number generator in the range [0, 1]. ,like , then select the parameter combination corresponding to the first search state as the optimal parameter combination. , then select the parameter combination corresponding to the second search state as the optimal parameter combination, and so on, until the optimal contrast enhancement parameter combination is determined ; S5, Image contrast enhancement: Determining the optimal parameter combination Finally, the optimal parameter combination is used to perform contrast enhancement on the preprocessed medical image to obtain the final enhanced medical image. The specific process is as follows: Define an intermediate variable It is used to calculate the enhancement effect step by step. The calculation formula is: in, is the pixel of the preprocessed medical image The gray value of and are the minimum and maximum grayscale values ​​of the image after preprocessing; Consider gamma correction to further adjust the image. Based on the gamma correction coefficient Correction is performed to obtain the final enhanced medical image pixel points Gray value , the calculation formula is:

[0010] In the whole contrast enhancement process, the brightness adjustment coefficient is first calculated step by step through the above-mentioned step-by-step calculation method. and contrast adjustment factor Perform preliminary contrast adjustment on the image to obtain the intermediate result , and then use the gamma correction coefficient Perform nonlinear transformations on intermediate results.

[0011] Furthermore, in the S1 noise removal method using the adaptive weighted median filtering method, the selection of pixels in the window can be further weighted according to the position of the pixels in the image. The specific weighting method is: assuming that the pixels in the window Relative to the center pixel The horizontal distance is , the vertical distance is , then the additional weight of the pixel for: , this additional weight is combined with the weight calculated according to the gray value difference Multiply them together to get the final weight used for weighted averaging, namely: ,In this way, not only the difference of the gray value of the pixel is ,considered, but also its position factor in the image, making the noise ,removal effect more refined and accurate.

[0012] Furthermore, the S1 normalization processing adopts a linear normalization method. For pixels in the image whose grayscale values ​​are significantly different from the grayscale values ​​of most pixels, they can be identified and processed first. The identification method is: calculate the average difference between the grayscale value of each pixel in the image and the grayscale value of adjacent pixels. If the difference is greater than a preset threshold, the pixel will be marked. For the marked pixel, the weighted average of the grayscale values ​​of its adjacent pixels can be used to replace its original grayscale value. The weight of the weighted average can be determined according to the distance relationship with the adjacent pixels. For example, the closer the distance, the greater the weight. This can avoid the influence of outliers on the normalization effect and make the normalized image more in line with the requirements of subsequent processing.

[0013] Furthermore, in the S2 quantum heuristic parameter search initialization step, for the brightness adjustment coefficient , contrast adjustment factor , Gamma correction coefficient The value range of can be set, and it can be further refined according to the specific type of medical image to be processed. For X-ray images, due to their relatively high brightness and low contrast, The value range of The value range of is adjusted to [0.8, 1.5], The value range of is adjusted to [0.6, 1.2]. For MRI images, due to their different image characteristics, The operating range is adjusted to [-0.4, 0.4], The value range of is adjusted to [0.6, 1.8], The value range of is adjusted to [0.5, 1.3]. By adjusting the value range according to the specific image type, the search can be performed more accurately in the parameter space suitable for the type of image, thereby improving the search efficiency and the possibility of finding the optimal parameter combination.

[0014] Furthermore, in the S2 quantum heuristic parameter search initialization step, for the quantum probability amplitude The initialization method of image features can also be used. The specific operation is as follows: calculate the grayscale histogram of the preprocessed medical image, divide the histogram into several intervals, and count the proportion of the number of pixels in each interval to the total number of pixels, recorded as , Indicates intervals, and initialize the quantum probability amplitude according to these proportions, namely: ,in The corresponding parameter combination has a certain correlation with the image features of the interval during the search process, so that the initialized quantum probability amplitude can better reflect the initial features of the image, which can make the search direction more targeted and improve the search efficiency.

[0015] Furthermore, in the search process based on the quantum state superposition and entanglement characteristics in S3, the influence index value calculated in the step of quantum state superposition is The formula can also be dynamically adjusted according to the local features of the image. The specific operation is as follows: the preprocessed medical image is divided into several sub-regions of equal size. For each sub-region, the difference between the average gray value of the internal pixel and the target gray value is calculated, which is recorded as ,like , it means that the sub-region is bright, and then The value of is reduced to 0.4, The value of is increased to 0.6. , it means that the sub-region is dark, then the The value of is increased to 0.7, The value of is reduced to 0.3. By dynamically adjusting the weight coefficient according to the local features of the image, the impact of each sub-state on different local areas can be more accurately evaluated, thereby improving the accuracy of searching for the optimal parameter combination.

[0016] Furthermore, in the search process based on quantum state superposition and entanglement characteristics, the entanglement coefficient is calculated in the step of applying the quantum entanglement characteristics. The formula can also take into account the image texture features. The specific operation is as follows: Calculate the texture eigenvalue of the preprocessed medical image, and use the gray level co-occurrence matrix method to calculate the texture eigenvalue, which is recorded as , let the width of the image be , Gao Wei , then for the calculation of the gray level co-occurrence matrix, the distance and angle parameters are selected, and the gray level co-occurrence matrix is ​​constructed by counting the frequencies of different gray value combinations under these specific conditions. The statistics that can characterize the texture features are extracted from the gray level co-occurrence matrix. Here, contrast is selected as the main texture feature representation, which is recorded as , which is calculated according to the relevant formula of the gray-level co-occurrence matrix elements. The texture feature value is integrated into the calculation of the entanglement coefficient. The modified entanglement coefficient calculation formula is:

[0017] in, It is the average value of the texture feature contrast of the entire preprocessed medical image. By incorporating the texture feature value of the image into the calculation of the entanglement coefficient, the influence of the image texture characteristics on the parameter adjustment can be more fully considered when establishing the entanglement relationship between different search states. Because the texture features of the image are often closely related to the key information of the lesion area, the parameter adjustment can be guided in the direction that is more conducive to highlighting or retaining these important features during the search process, thereby improving the effectiveness of the optimal parameter combination finally found for improving the image diagnostic value.

[0018] Furthermore, in the step of determining the optimal parameter combination in S4, the selection probability of each search state is calculated. The formula can also introduce an adjustment factor To further optimize the selection process, the modified selection probability calculation formula is:

[0019] in, The value range of can be determined according to the complexity of the image and the requirements for selection accuracy. For relatively simple medical images, The value ranges from 1 to 1.5. For images of medium complexity, The value is between 1.5 and 2.5. For more complex images and when you want to select the optimal parameter combination more accurately, The value is between 2.5 and 3.5. , the search states with higher fitness values ​​will account for a larger proportion in the selection probability calculation, thus being more inclined to select those parameter combinations that show better performance in the evaluation process, further improving the quality of the optimal parameter combination finally determined, and more effectively achieving the adaptive contrast enhancement effect of medical images.

[0020] Furthermore, in the S5 image contrast enhancement step, the final enhancement formula adopted can be further adjusted and optimized according to the specific values ​​of each coefficient in the optimal parameter combination. When the absolute value of is less than the threshold, an auxiliary brightness adjustment item can be added to the final enhancement formula. The specific form is as follows: in, It is an auxiliary brightness adjustment coefficient, and its value can be set according to the overall brightness of the image and experience. It is the average grayscale value of the medical image after preprocessing. By adding auxiliary adjustment items according to the characteristics of the optimal parameter combination, the brightness and contrast of the image can be adjusted more finely in specific cases, further improving the quality of the final enhanced medical image.

[0021] On the other hand, an adaptive contrast enhancement system for medical images is characterized in that the system includes an image input and preprocessing module, a quantum heuristic parameter search initialization module, a search process module based on quantum state superposition and entanglement characteristics and an optimal parameter combination determination module, and an image contrast enhancement module; Image input and preprocessing module: receives the medical image to be processed, obtains the preprocessed medical image through the following preprocessing operations, and uses the adaptive weighted median filtering method to remove noise. For each pixel in the image , with it as the center and a size of The window, where is a preset positive integer, calculate the absolute difference between the grayscale value of each pixel in the window and the grayscale value of the central pixel, sort these differences from small to large, and take the first The pixel corresponding to the difference value is The grayscale values ​​of pixels are weighted averaged. The calculation method is: ,in It is The gray value of the selected pixel, is the center pixel The grayscale value of the image is calculated and the weighted average grayscale value is assigned to the central pixel to complete the noise removal of the entire image. The linear normalization method is used to change the grayscale value range of the image from the original range to Normalized to the interval [0, 1], the calculation formula is: ,in is the pixel in the image The original gray value, is the normalized grayscale value, and They are the minimum and maximum grayscale values ​​in the image, respectively. The normalization operation is completed by traversing all pixels of the image; Quantum-inspired parameter search initialization module: defines the parameter space related to contrast enhancement, which contains the brightness adjustment coefficients , contrast adjustment factor , Gamma correction coefficient , borrowing the concept of quantum state to initialize a set of quantum-inspired search states and their corresponding quantum probability amplitudes, assuming that the number of initialized search states is , for the search state, and its corresponding parameter combination is ,in , , They are the initial values ​​randomly generated within their respective value ranges, the quantum probability amplitude The initialization of is randomly generated using uniform distribution, the value range is [0, 1], and the normalization condition is satisfied: ; Search process module based on quantum state superposition and entanglement characteristics: Use quantum state superposition and entanglement characteristics to search and evaluate quantum-inspired search states, and calculate the activity value of each parameter combination as follows: According to the principle of quantum state superposition, each search state can be regarded as a superposition state of multiple possible parameter combinations. search state, and its state during the search process is represented as , Indicates the number of sub-states generated by further subdividing each search state during the search process. ,in is the coefficient of the substate, satisfying the normalization condition: , Represents the specific parameter combination sub-state after subdivision. For each sub-state, calculate its impact index value on the current preprocessed medical image , the calculation formula is as follows

[0022] in, It uses parameter combination sub-state Perform temporary enhancement on the preprocessed medical image using the conventional contrast enhancement formula:

[0023] in is the pixel of the preprocessed medical image The gray value of and They are the minimum and maximum grayscale values ​​of the image after preprocessing, and the pixel points The gray value of is the target grayscale value, and is the weight coefficient, The value of is determined according to the image type and target contrast requirements. The value of is determined according to the original contrast of the image. For images with poor original contrast, the influence index value of each sub-state is The weighted average is The fitness value of the search state , the calculation formula is: Establish the entanglement relationship between different search states, and set the search state and search status The entanglement coefficient between , which is calculated as:

[0024] in, and Search state and search status The corresponding parameter combination performs temporary enhancement on the pixel points of the preprocessed medical image. Gray value, according to the entanglement coefficient, adjust the parameter combination of the search state. The specific adjustment rules are as follows: , its parameter combination adjustment amount , , They are:

[0025] The updated parameter combination is: , continue the search and evaluation process; Determine the optimal parameter combination module: According to the fitness value, use the collapse mechanism of quantum probability amplitude to select the contrast enhancement parameter combination and calculate the selection probability of each search state , the calculation formula is: ,in It is The quantum probability amplitude of the search state, It is The fitness value of the search state is then generated by a random number generator in the range [0, 1]. ,like , then select the parameter combination corresponding to the first search state as the optimal parameter combination. , then select the parameter combination corresponding to the second search state as the optimal parameter combination, and so on, until the optimal contrast enhancement parameter combination is determined ; Image contrast enhancement module: Determine the optimal parameter combination Finally, the optimal parameter combination is used to perform contrast enhancement on the preprocessed medical image to obtain the final enhanced medical image. The specific process is as follows: Define an intermediate variable It is used to calculate the enhancement effect step by step. The calculation formula is: in, is the pixel of the preprocessed medical image The gray value of and are the minimum and maximum grayscale values ​​of the image after preprocessing; Consider gamma correction to further adjust the image. Based on the gamma correction coefficient Correction is performed to obtain the final enhanced medical image pixel points Gray value , the calculation formula is:

[0026] In the whole contrast enhancement process, the brightness adjustment coefficient is first calculated step by step through the above-mentioned step-by-step calculation method. and contrast adjustment factor Perform preliminary contrast adjustment on the image to obtain the intermediate result , and then use the gamma correction coefficient Perform nonlinear transformations on intermediate results.

[0027] Compared with the prior art, a method and system for adaptive contrast enhancement of medical images have the following beneficial effects: 1. The system effectively removes noise from medical images through adaptive weighted median filtering and linear normalization preprocessing operations, and normalizes the grayscale value range of the image, providing high-quality input images for subsequent contrast enhancement operations. At the same time, using the quantum-inspired parameter search algorithm, the system can automatically search and determine the optimal contrast enhancement parameter combination, achieve adaptive enhancement of the contrast of medical images, improve image clarity and detail expression, and help doctors diagnose diseases more accurately.

[0028] Second, the system uses the texture features and local brightness differences of the image to introduce texture feature values ​​into the calculation of the entanglement coefficient and dynamically adjusts the weight coefficient according to the local features, so that the important information in the image can be better preserved and highlighted while enhancing the contrast. In addition, for different types of medical images, the system can further refine the parameter value range, improve the search efficiency and the possibility of finding the optimal parameter combination, thereby achieving more accurate contrast enhancement for different types of medical images. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0030] Figure 1An adaptive contrast enhancement method for medical images and a system operation flow chart. DETAILED DESCRIPTION

[0031] The technical solutions in the embodiments of the present invention are described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. 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.

[0032] Embodiment 1 This embodiment describes that a large number of X-ray images need to be processed every day in the radiology department of a large hospital. These images are used to diagnose patients' bone and lung conditions. However, the contrast of X-ray images is often low, especially when detecting subtle lesions. Doctors need to spend a long time observing and analyzing the images, which not only increases the workload but also increases the risk of misdiagnosis and missed diagnosis.

[0033] Adaptive weighted median filtering is used to remove image noise. According to the characteristics of X-ray images, the filtering method is further optimized. For each pixel in the image, a window of preset size is taken with it as the center, and the absolute difference between the grayscale value of each pixel in the window and the grayscale value of the central pixel is calculated, and these differences are sorted from small to large. Then, according to the sorting result, the pixels corresponding to the first N differences are selected, and the grayscale values ​​of these pixels are weighted averaged, and the grayscale value after weighted average is assigned to the central pixel, so as to complete the noise removal. According to the characteristics of X-ray images, the value ranges of brightness adjustment coefficient, contrast adjustment coefficient and gamma correction coefficient are adjusted to [0.8, 1.5], [0.6, 1.2], [0.6, 1.2] respectively to adapt to the high brightness and low contrast characteristics of X-ray images. The linear normalization method is adopted. ,in is the pixel in the image The original gray value, is the normalized grayscale value, and They are the minimum and maximum grayscale values ​​in the image, respectively. The normalization operation is completed by traversing all pixels of the image, and the grayscale value range of the image is normalized from the original range to the [0, 1] interval for subsequent processing.

[0034] A parameter space related to contrast enhancement is defined, which includes brightness adjustment coefficients, contrast adjustment coefficients and gamma correction coefficients. Drawing on the concept of quantum state, a set of quantum-inspired search states and their corresponding quantum probability amplitudes are initialized. These search states represent possible parameter combinations, while the quantum probability amplitudes reflect the probability of these states being selected.

[0035] The search state is searched and evaluated using the superposition and entanglement characteristics of quantum states. According to the principle of quantum state superposition, each search state can be regarded as a superposition state of multiple possible parameter combinations. During the search process, each search state is further subdivided to generate multiple sub-states, and the impact index value of each sub-state on the current preprocessed X-ray image is calculated. This impact index value reflects the degree of improvement of the sub-state on the image contrast. According to the local characteristics of the X-ray image, the weight coefficient is dynamically adjusted to more accurately evaluate the impact of each sub-state on different local areas. This dynamic adjustment helps to improve the accuracy and efficiency of the search process, establish an entanglement relationship between different search states, and set the search state and search status The entanglement coefficient between , which is calculated as:

[0036] in, and Search state and search status The corresponding parameter combination performs temporary enhancement on the pixel points of the preprocessed medical image. Gray value, according to the entanglement coefficient, adjust the parameter combination of the search state. The specific adjustment rules are as follows: , its parameter combination adjustment amount , , They are:

[0037] The updated parameter combination is: , continue the search and evaluation process, and adjust the parameter combination of the search state according to the entanglement coefficient. This adjustment mechanism enables the search process to converge to the optimal solution faster.

[0038] According to the fitness value, the optimal parameter combination is selected using the collapse mechanism of the quantum probability amplitude. The fitness value reflects the degree of improvement of the search state on the image contrast. A random number generator is used to generate a random number in the interval [0, 1], and the optimal parameter combination is selected based on the random number and the quantum probability amplitude of the search state.

[0039] After determining the optimal parameter combination, the combination is used to perform contrast enhancement on the preprocessed X-ray image. An intermediate variable is defined for calculating the enhancement effect in steps. First, the brightness adjustment coefficient and the contrast adjustment coefficient are combined to perform preliminary contrast adjustment on the image to obtain an intermediate result. Then, the gamma correction coefficient is used to perform a nonlinear transformation on the intermediate result to obtain the final enhanced medical image.

[0040] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and range of equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.

Claims

1. An adaptive contrast enhancement method for medical images, characterized in that: The specific steps of this method are: S1, image input and preprocessing: receiving the medical image to be processed, obtaining the preprocessed medical image through the following preprocessing operations, using the adaptive weighted median filtering method to remove noise, for each pixel in the image , with it as the center, take a The window, where is a preset positive integer, calculate the absolute difference between the grayscale value of each pixel in the window and the grayscale value of the central pixel, sort these differences from small to large, and take the first The pixel corresponding to the difference value is The grayscale values ​​of pixels are weighted averaged. The calculation method is: ,in It is The gray value of the selected pixel, is the center pixel The grayscale value of the image is calculated and the weighted average grayscale value is assigned to the central pixel to complete the noise removal of the entire image. The linear normalization method is used to change the grayscale value range of the image from the original range to Normalized to the interval [0, 1], the calculation formula is: ,in is the pixel in the image The original gray value, is the normalized grayscale value, and They are the minimum and maximum grayscale values ​​in the image, respectively. The normalization operation is completed by traversing all pixels of the image; S2, quantum-inspired parameter search initialization: define the parameter space related to contrast enhancement, which contains the brightness adjustment coefficients , contrast adjustment factor , Gamma correction coefficient , borrowing the concept of quantum state to initialize a set of quantum-inspired search states and their corresponding quantum probability amplitudes, assuming that the number of initialized search states is , for the search state, and its corresponding parameter combination is ,in , , They are the initial values ​​randomly generated within their respective value ranges, the quantum probability amplitude The initialization of is randomly generated using uniform distribution, the value range is [0, 1], and the normalization condition is satisfied: ; S3, search process based on quantum state superposition and entanglement characteristics: Use quantum state superposition and entanglement characteristics to search and evaluate the quantum-inspired search state, and calculate the activity value of each parameter combination as follows: According to the principle of quantum state superposition, each search state can be regarded as a superposition state of multiple possible parameter combinations. search state, and its state during the search process is represented as , Indicates the number of sub-states generated by further subdividing each search state during the search process. ,in is the coefficient of the substate, satisfying the normalization condition: , Represents the specific parameter combination sub-state after subdivision. For each sub-state, calculate its impact index value on the current preprocessed medical image , the calculation formula is as follows in, It uses parameter combination sub-state Perform temporary enhancement on the preprocessed medical image using the conventional contrast enhancement formula: in is the pixel of the preprocessed medical image The gray value of and They are the minimum and maximum grayscale values ​​of the image after preprocessing, and the pixel points The gray value of is the target grayscale value, and is the weight coefficient, The value of is determined according to the image type and target contrast requirement. The value of is determined according to the original contrast of the image. For images with poor original contrast, the influence index value of each sub-state is The weighted average is The fitness value of the search state , the calculation formula is: Establish the entanglement relationship between different search states, and set the search state and search status The entanglement coefficient between , which is calculated as: in, and Search state and search status The corresponding parameter combination performs temporary enhancement on the pixel points of the preprocessed medical image. Gray value, according to the entanglement coefficient, adjust the parameter combination of the search state. The specific adjustment rules are as follows: , its parameter combination adjustment amount , , They are: The updated parameter combination is: , continue the search and evaluation process; S4, determine the optimal parameter combination: according to the fitness value, use the collapse mechanism of quantum probability amplitude to select the contrast enhancement parameter combination, and calculate the selection probability of each search state , the calculation formula is: ,in It is The quantum probability amplitude of the search state, It is The fitness value of the search state is then generated by a random number generator in the range [0, 1]. ,like , then select the parameter combination corresponding to the first search state as the optimal parameter combination. , then select the parameter combination corresponding to the second search state as the optimal parameter combination, and so on, until the optimal contrast enhancement parameter combination is determined ; S5, Image contrast enhancement: Determining the optimal parameter combination Finally, the optimal parameter combination is used to perform contrast enhancement on the preprocessed medical image to obtain the final enhanced medical image. The specific process is as follows: Define an intermediate variable It is used to calculate the enhancement effect step by step. The calculation formula is: in, is the pixel of the preprocessed medical image The gray value of and are the minimum and maximum grayscale values ​​of the image after preprocessing; Consider gamma correction to further adjust the image. Based on the gamma correction coefficient Correction is performed to obtain the final enhanced medical image pixel points Gray value , the calculation formula is: In the whole contrast enhancement process, the brightness adjustment coefficient is first calculated step by step through the above-mentioned step-by-step calculation method. and contrast adjustment factor Perform preliminary contrast adjustment on the image to obtain the intermediate result , and then use the gamma correction coefficient Perform nonlinear transformations on intermediate results.

2. The method for adaptive contrast enhancement of medical images according to claim 1, characterized in that: In the S1 noise removal method using adaptive weighted median filtering, the selection of pixels in the window can be further weighted according to the position of the pixel in the image. The specific weighting method is: Relative to the center pixel The horizontal distance is , the vertical distance is , then the additional weight of the pixel for: , this additional weight is combined with the weight calculated according to the gray value difference Multiply them together to get the final weight used for weighted averaging, namely: ,In this way, not only the difference of the gray value of the pixel is ,considered, but also its position factor in the image.

3. The method for adaptive contrast enhancement of medical images according to claim 1, characterized in that: The S1 normalization processing adopts a linear normalization method. For pixels in the image whose grayscale values ​​are greatly different from the grayscale values ​​of most pixels, they can be identified and processed first. The identification method is: calculate the average difference between the grayscale value of each pixel in the image and the grayscale values ​​of adjacent pixels. If the difference is greater than a preset threshold, the pixel will be marked. For the marked pixel, the weighted average of the grayscale values ​​of its adjacent pixels can be used to replace its original grayscale value. The weight of the weighted average can be determined according to the distance relationship with the adjacent pixels.

4. The method for adaptive contrast enhancement of medical images according to claim 1, characterized in that: In the S2 quantum heuristic parameter search initialization step, for the brightness adjustment coefficient , contrast adjustment factor , Gamma correction coefficient The value range of can be set, and it can be further refined according to the specific type of medical image to be processed. For X-ray images, due to their relatively high brightness and low contrast, The value range of The value range of is adjusted to [0.8, 1.5], The value range of is adjusted to [0.6, 1.2]. For MRI images, due to their different image characteristics, The operating range is adjusted to [-0.4, 0.4], The value range of is adjusted to [0.6, 1.8], The value range of is adjusted to [0.5, 1.3]. By adjusting the value range according to the specific image type, the search can be performed more accurately in the parameter space suitable for the type of image.

5. The method for adaptive contrast enhancement of medical images according to claim 1, characterized in that: In the S2 quantum heuristic parameter search initialization step, for the quantum probability amplitude The initialization method of image features can also be used. The specific operation is as follows: calculate the grayscale histogram of the preprocessed medical image, divide the histogram into several intervals, and count the proportion of the number of pixels in each interval to the total number of pixels, recorded as , Indicates intervals, and initialize the quantum probability amplitude according to these proportions, namely: ,in The corresponding parameter combination has a certain correlation with the image features of the interval during the search process.

6. The method for adaptive contrast enhancement of medical images according to claim 1, characterized in that: In the search process based on the quantum state superposition and entanglement characteristics, the influence index value calculated in the step of quantum state superposition is used. The formula can also be dynamically adjusted according to the local features of the image. The specific operation is as follows: the preprocessed medical image is divided into several sub-regions of equal size. For each sub-region, the difference between the average gray value of the internal pixel and the target gray value is calculated, which is recorded as ,like , it means that the sub-region is bright, and then The value of is reduced to 0.4, The value of is increased to 0.

6. , it means that the sub-region is dark, then the The value of is increased to 0.7, The value of is reduced to 0.

3. By dynamically adjusting the weight coefficient according to the local features of the image, the impact of each sub-state on different local areas can be more accurately evaluated.

7. The method for adaptive contrast enhancement of medical images according to claim 1, characterized in that: In the search process based on quantum state superposition and entanglement characteristics, the entanglement coefficient is calculated in the step of applying the quantum entanglement characteristics. The formula can also take into account the image texture features. The specific operation is as follows: Calculate the texture eigenvalue of the preprocessed medical image, and use the gray level co-occurrence matrix method to calculate the texture eigenvalue, which is recorded as , let the width of the image be , Gao Wei , then for the calculation of the gray level co-occurrence matrix, the distance and angle parameters are selected, and the gray level co-occurrence matrix is ​​constructed by counting the frequencies of different gray value combinations under these specific conditions. The statistics that can characterize the texture features are extracted from the gray level co-occurrence matrix. Here, contrast is selected as the main texture feature representation, which is recorded as , which is calculated according to the relevant formula of the gray-level co-occurrence matrix elements. The texture feature value is integrated into the calculation of the entanglement coefficient. The modified entanglement coefficient calculation formula is: in, It is the average value of the texture feature contrast of the entire preprocessed medical image. By incorporating the texture feature value of the image into the calculation of the entanglement coefficient, the influence of the image texture characteristics on the parameter adjustment can be more fully considered when establishing the entanglement relationship between different search states. Because the texture features of the image are often closely related to the key information of the lesion area, the parameter adjustment can be guided in the direction that is more conducive to highlighting or retaining these important features during the search process.

8. The method for adaptive contrast enhancement of medical images according to claim 1, characterized in that: In the step of determining the optimal parameter combination in S4, the selection probability of each search state is calculated. The formula can also introduce an adjustment factor To further optimize the selection process, the modified selection probability calculation formula is: in, The value range of can be determined according to the complexity of the image and the requirements for selection accuracy. For simpler medical images, The value ranges from 1 to 1.

5. For images of medium complexity, The value is between 1.5 and 2.

5. For more complex images and when you want to select the optimal parameter combination more accurately, The value is between 2.5 and 3.

5. When , the search states with higher fitness values ​​will account for a larger proportion in the selection probability calculation, thus tending to select those parameter combinations that show better performance in the evaluation process.

9. The method for adaptive contrast enhancement of medical images according to claim 1, characterized in that: In the S5 image contrast enhancement step, the final enhancement formula used can be further adjusted and optimized according to the specific values ​​of each coefficient in the optimal parameter combination. When the absolute value of is less than the threshold, an auxiliary brightness adjustment item can be added to the final enhancement formula. The specific form is as follows: in, It is an auxiliary brightness adjustment coefficient, and its value can be set according to the overall brightness of the image and experience. is the average gray value of the medical image after preprocessing.

10. The adaptive contrast enhancement system for medical images according to any one of claims 1 to 8, characterized in that: The system includes an image input and preprocessing module, a quantum-inspired parameter search initialization module, a search process module based on quantum state superposition and entanglement characteristics, an optimal parameter combination determination module, and an image contrast enhancement module; Image input and preprocessing module: receives the medical image to be processed, obtains the preprocessed medical image through the following preprocessing operations, and uses the adaptive weighted median filtering method to remove noise. For each pixel in the image , with it as the center, take a The window, where is a preset positive integer, calculate the absolute difference between the grayscale value of each pixel in the window and the grayscale value of the central pixel, sort these differences from small to large, and take the first The pixel corresponding to the difference value is The grayscale values ​​of pixels are weighted averaged. The calculation method is: ,in It is The gray value of the selected pixel, is the center pixel The grayscale value of the image is calculated and the weighted average grayscale value is assigned to the central pixel to complete the noise removal of the entire image. The linear normalization method is used to change the grayscale value range of the image from the original range to Normalized to the interval [0, 1], the calculation formula is: ,in is the pixel in the image The original gray value, is the normalized grayscale value, and They are the minimum and maximum grayscale values ​​in the image, respectively. The normalization operation is completed by traversing all pixels of the image; Quantum-inspired parameter search initialization module: defines the parameter space related to contrast enhancement, which contains the brightness adjustment coefficients , contrast adjustment factor , Gamma correction coefficient , borrowing the concept of quantum state to initialize a set of quantum-inspired search states and their corresponding quantum probability amplitudes, assuming that the number of initialized search states is , for the search state, and its corresponding parameter combination is ,in , , They are the initial values ​​randomly generated within their respective value ranges, the quantum probability amplitude The initialization of is randomly generated using uniform distribution, the value range is [0, 1], and the normalization condition is satisfied: ; Search process module based on quantum state superposition and entanglement characteristics: Use quantum state superposition and entanglement characteristics to search and evaluate quantum-inspired search states, and calculate the activity value of each parameter combination as follows: According to the principle of quantum state superposition, each search state can be regarded as a superposition state of multiple possible parameter combinations. search state, and its state during the search process is represented as , Indicates the number of sub-states generated by further subdividing each search state during the search process. ,in is the coefficient of the substate, satisfying the normalization condition: , Represents the specific parameter combination sub-state after subdivision. For each sub-state, calculate its impact index value on the current preprocessed medical image , the calculation formula is as follows in, It uses parameter combination sub-state Perform temporary enhancement on the preprocessed medical image using the conventional contrast enhancement formula: in is the pixel of the preprocessed medical image The gray value of and They are the minimum and maximum grayscale values ​​of the image after preprocessing, and the pixel points The gray value of is the target grayscale value, and is the weight coefficient, The value of is determined according to the image type and target contrast requirement. The value of is determined according to the original contrast of the image. For images with poor original contrast, the influence index value of each sub-state is The weighted average is The fitness value of the search state , the calculation formula is: Establish the entanglement relationship between different search states, and set the search state and search status The entanglement coefficient between , which is calculated as: in, and Search state and search status The corresponding parameter combination performs temporary enhancement on the pixel points of the preprocessed medical image. Gray value, according to the entanglement coefficient, adjust the parameter combination of the search state. The specific adjustment rules are as follows: , its parameter combination adjustment amount , , They are: The updated parameter combination is: , continue the search and evaluation process; Determine the optimal parameter combination module: According to the fitness value, use the collapse mechanism of quantum probability amplitude to select the contrast enhancement parameter combination and calculate the selection probability of each search state , the calculation formula is: ,in It is The quantum probability amplitude of the search state, It is The fitness value of the search state is then generated by a random number generator in the range [0, 1]. ,like , then select the parameter combination corresponding to the first search state as the optimal parameter combination. , then select the parameter combination corresponding to the second search state as the optimal parameter combination, and so on, until the optimal contrast enhancement parameter combination is determined ; Image contrast enhancement module: Determine the optimal parameter combination Finally, the optimal parameter combination is used to perform contrast enhancement on the preprocessed medical image to obtain the final enhanced medical image. The specific process is as follows: Define an intermediate variable It is used to calculate the enhancement effect step by step. The calculation formula is: in, is the pixel of the preprocessed medical image The gray value of and are the minimum and maximum grayscale values ​​of the image after preprocessing; Consider gamma correction to further adjust the image. Based on the gamma correction coefficient Correction is performed to obtain the final enhanced medical image pixel points Gray value , the calculation formula is: In the whole contrast enhancement process, the brightness adjustment coefficient is first calculated step by step through the above-mentioned step-by-step calculation method. and contrast adjustment factor Perform preliminary contrast adjustment on the image to obtain the intermediate result , and then use the gamma correction coefficient Perform nonlinear transformations on intermediate results.

Citation Information

Cited By

  • HSV color space-based low-illumination image enhancement method

    CN121169780A

  • Liquid crystal filtering multispectral image generation method based on quantum inspiration

    CN121174035A