Medical foreign matter detection method based on image enhancement processing
By adaptively adjusting the kernel parameters in the Lanczos interpolation algorithm, combining sliding window and curve fitting technology, the image distortion and artifact problems caused by fixed kernel parameters are solved, and the image enhancement effect and clarity are improved, especially in the case of motion blur, and the accuracy of foreign object detection is enhanced.
Patent Information
- Application Number
- CN202510622285.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-15
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2045-05-15
AI Technical Summary
In chest CT images, the fixed kernel parameter size in Lanczos interpolation algorithm may cause image distortion or artifacts and cannot adapt to the characteristics of different images or regions, especially in motion blur, resulting in poor image enhancement effect.
By adaptively adjusting the size of the kernel parameters, using preset sliding windows and curve fitting technology, the kernel parameters are corrected according to the grayscale changes of pixel points and the direction of motion blur to adapt to the characteristics of different image areas.
It effectively solves the image distortion and artifact problems caused by fixed kernel parameters, improves the effect and clarity of image enhancement, especially in the case of motion blur, and enhances the accuracy of foreign object detection.
Smart Images

Figure CN120147347A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and particularly to a medical foreign object detection method based on image enhancement processing. Background Art
[0002] When detecting foreign objects in chest CT images, it is often necessary to perform image enhancement processing on the images so that doctors can make more accurate judgments on the CT images and facilitate subsequent detection of foreign objects. Based on interpolation super-resolution reconstruction to improve the resolution of the image, in this method, pixel points in the image need to be interpolated. The Lanczos interpolation algorithm is an interpolation method based on a convolution kernel, and the value of the target pixel is calculated by using the Lanczos function as the convolution kernel. However, in this algorithm, fixed-size kernel parameters are often used , and for different windows, the pixel points in them behave differently. The fixed size of the kernel parameters may cause the image to be distorted or artifacts to appear, resulting in poor image enhancement effects.
[0003] During the interpolation process using the Lanczos interpolation algorithm, the fixed kernel parameters may not be able to adapt to the characteristics of different images or different regions, that is, different windows with different gray-scale performances may require different sizes of kernel parameters; at the same time, during the process of taking chest CT images, due to equipment movement or breathing, the collected images may be blurred by motion. Deviations may occur during the process of adjusting the kernel parameters. Therefore, the present invention adaptively adjusts the size of the kernel parameters, so that the interpolation effect of the algorithm is better. Summary of the Invention
[0004] In order to solve the above problems, the present invention provides a medical foreign object detection method based on image enhancement processing.
[0005] The medical foreign object detection method based on image enhancement processing of the present invention adopts the following technical solutions: An embodiment of the present invention provides a medical foreign object detection method based on image enhancement processing, and the method includes the following steps: Collect a chest CT image, denoted as the original image; Slide a preset sliding window over each pixel point of the original image, obtain target pixel points according to the gradient change of the pixel points within the sliding window, perform curve fitting on the target pixel points to obtain a first fitting curve; obtain the adjustment coefficient of each pixel point in the original image according to the positional relationship between the target pixel points and the first fitting curve; Denote the sliding window where each pixel in the original image is located as the target window. Slide the target window in different sliding directions of the target pixel to obtain a number of first sliding windows. Obtain the similarity between the target window and the first sliding windows based on the difference in the gradient directions between the target window and the first sliding windows; judge the sliding directions to be retained according to the similarity between the target window and the first sliding windows through a preset threshold, and obtain the motion blur direction of the target pixel according to the retained sliding directions; obtain the preferred window in the motion blur direction based on the gradient values of all the first sliding windows in the motion blur direction, denote the edge pixels included in the preferred window as the first edge pixels, obtain the authenticity of the first edge pixels according to the distance between the first edge pixels and the target window; obtain the correction coefficient according to the authenticity of the first edge pixels; correct the kernel parameters according to the correction coefficient; Interpolate the original image according to the obtained kernel parameters to obtain the enhanced CT image, and perform threshold segmentation on the enhanced CT image to obtain the foreign object area.
[0006] Further, sliding on each pixel of the original image through a preset sliding window, obtaining the target pixel according to the gradient change of the pixels in the sliding window, and performing curve fitting on the target pixel to obtain the first fitting curve, including the following specific steps: Preset the sliding window, with each pixel in the original image as the center of the sliding window, and slide the sliding window on the original image; arrange the gradient magnitudes of all the pixels in the sliding window in ascending order of gradient magnitude to obtain the first gradient sequence, traverse each gradient magnitude in the first gradient sequence from left to right in turn, denote the traversed gradient magnitude as the current gradient magnitude, denote the pixels in the sliding window that are greater than or equal to the current gradient magnitude as the target pixels, and perform curve fitting on the gradient magnitudes of the target pixels to obtain the fitting curve, denoted as the first fitting curve.
[0007] Further, obtaining the adjustment coefficient of each pixel in the original image according to the positional relationship between the target pixel and the first fitting curve, including the following specific steps: Obtain the shortest distance from each target pixel in the sliding window to the first fitting curve, and obtain the adjustment coefficient of each pixel in the original image according to the mean value of the gradient magnitudes of all the pixels in the sliding window, the shortest distance from each target pixel to the first fitting curve, and the number of target pixels in the sliding window; then obtain the adjustment coefficient of each pixel in the original image in each traversal process, and select the minimum value of all the adjustment coefficients as the adjustment coefficient of this pixel.
[0008] Further, obtaining the adjustment coefficient of each pixel point in the original image according to the mean value of the gradient amplitudes of all pixel points within the sliding window, the shortest distance from each target pixel point to the first fitting curve, and the number of target pixel points within the sliding window includes the following specific steps: In the formula, represents the adjustment coefficient of the th pixel point in the original image, represents the gradient amplitude of the th target pixel point in the target window centered on the th pixel point, represents the shortest distance between the th target pixel point in the target window centered on the th pixel point and the first fitting curve, represents the number of target pixel points in the sliding window centered on the th pixel point, represents the exponential function with the natural constant as the base.
[0009] Further, sliding the target window in different sliding directions of the target pixel points to obtain a number of first sliding windows, and obtaining the similarity between the target window and the first sliding windows according to the difference in the gradient directions between the target window and the first sliding windows includes the following specific steps: In the formula, represents the similarity between the target window corresponding to the th pixel point in the original image and the th first sliding window in any sliding direction, represents the gradient direction of the th pixel point in the target window corresponding to the th pixel point in the original image, represents the gradient direction of the th pixel point in the th first sliding window in any sliding direction, represents the number of target pixel points in the sliding window centered on the th pixel point, is a linear normalization function.
[0010] Further, judging the sliding directions to be retained according to the similarity between the target window and the first sliding windows through a preset threshold, and obtaining the motion blur direction of the target pixel points according to the retained sliding directions includes the following specific steps: For the For all similarities between the target window corresponding to a pixel and all first sliding windows in any direction, obtain the maximum value of all similarities. When the maximum value is less than the preset threshold the sliding direction where the th first sliding window is located is not a candidate motion blur direction; when it is greater than or equal to the preset threshold the sliding direction where the th first sliding window is located is a candidate motion blur direction; use the PCA algorithm to obtain the main direction of all candidate motion blur directions, and take the main direction as the motion blur direction of the th pixel.
[0011] Further, obtaining the preferred window in the motion blur direction based on the gradient values of all first sliding windows in the motion blur direction, recording the edge pixels included in the preferred window as the first edge pixels, and obtaining the authenticity of the first edge pixels according to the distance between the first edge pixels and the target window, including the following specific steps: Obtain the first sliding window with the maximum average gradient among all first sliding windows in the motion blur direction of the th pixel in the original image, and record it as the preferred window in the motion blur direction of the th pixel. Record the edge pixels included in the preferred window as the first edge pixels, and calculate the mean value of the Euclidean distances between the first edge pixels and the target window to represent the authenticity of the edge. The calculation formula is as follows: In the formula, represents the authenticity of the first edge pixels in the motion blur direction of the th pixel in the original image, represents the variance of the similarities between the target window corresponding to the th pixel in the original image and all first sliding windows in the motion blur direction, represents the exponential function with the natural constant as the base.
[0012] Further, obtaining the correction coefficient according to the authenticity of the first edge pixels, including the following specific steps: In the formula, represents the correction coefficient of the th pixel in the original image, represents the adjustment coefficient of the th pixel in the original image, represents the authenticity of the first edge pixels in the motion blur direction of the th pixel in the original image, represents the exponential function with the base of the natural constant.
[0013] Further, the correction of the kernel parameters according to the correction coefficient includes the following specific steps: In the formula, represents the corrected kernel parameter of the th pixel point in the original image. 3 is the size of the initial kernel parameter, is the ceiling function, is the linear normalization function.
[0014] Further, the interpolation of the original image according to the obtained kernel parameters to obtain an enhanced CT image, and the threshold segmentation of the enhanced CT image to obtain the foreign object region includes the following specific steps: According to the obtained kernel parameters corresponding to each pixel point in the original image, then perform super-resolution reconstruction on the original image to obtain an enhanced CT image, and perform threshold segmentation on the enhanced CT image to obtain the foreign object region.
[0015] The beneficial effects of the technical solution of the present invention are as follows: When enhancing the original image by the Lanczos interpolation algorithm, since the kernel parameters in the algorithm have an important impact on the enhancement effect of the image, the present invention adapts the kernel parameters of each pixel point according to the gray-scale change of the pixel points in the image. Compared with the traditional method of fixing the kernel parameter size, it can effectively solve the problems of excessive kernel parameters leading to loss of image details and clarity and too small kernel parameters leading to overly sharp and unnatural images. At the same time, considering the possible motion blur during the acquisition of CT images, the process of adaptively adjusting the kernel parameters becomes more effective and accurate. When adapting the kernel parameters, the present invention traverses each pixel point in the original image by presetting a sliding window, establishes an operation model according to the gray-scale change of the pixel points within the sliding window, and obtains the adjustment coefficient of the central pixel point of each sliding window. However, due to the blurring of the edges in the original image caused by image motion blur, the present invention slides in different directions of the central pixel point to obtain the authenticity of the blurred edge pixel points of each pixel point, and then corrects the adjustment coefficient according to the authenticity of the edge to obtain the final kernel parameter. Thus, the super-resolution reconstruction effect is better, the image enhancement effect is improved, and it is convenient for subsequent detection of foreign objects in CT images. Description of the Drawings
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0017] Figure 1 It is a flowchart of the steps of a medical foreign object detection method based on image enhancement processing of the present invention; Figure 2 It is a diagram showing the fitting effect of the first fitting curve and the distance from each target pixel point to the first fitting curve; Figure 3 It is an effect diagram of super-resolution reconstruction of the original image by the Lanczos interpolation algorithm. Detailed implementation manners
[0018] To further elaborate on the technical means and effects adopted by the present invention to achieve the intended invention purpose, the following, in combination with the accompanying drawings and preferred embodiments, details the specific implementation manners, structures, features, and effects of a medical foreign object detection method based on image enhancement processing proposed according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which the present invention belongs.
[0020] The following specifically describes the specific solution of a medical foreign object detection method based on image enhancement processing provided by the present invention with reference to the accompanying drawings.
[0021] Please refer to Figure 1 , which shows a flowchart of the steps of a medical foreign object detection method based on image enhancement processing provided by an embodiment of the present invention. The method includes the following steps: S001. Collect chest CT images; The main purpose of this embodiment is to enhance the chest CT images. Therefore, the chest CT images need to be obtained first. When collecting chest CT images, a computerized tomography (CT) scanner is used to collect chest CT images. Since there is a certain amount of noise in the collected CT images, the obtained CT images are denoised. In this embodiment, the median filtering algorithm is used to denoise the obtained CT images. The median filtering algorithm is a well-known prior art and will not be elaborated here. Then, the denoised CT images are obtained and denoted as the original images.
[0022] S002. Slide through each pixel point on the chest CT image with a preset sliding window, and obtain the adjustment coefficient of each pixel point according to the gradient change of the pixel points within the sliding window; It should be noted that in an image, the edges of the image usually exhibit relatively high gradient values. Therefore, when sliding through the edges of the image with a preset window, since the edge of the image is a continuous and smooth curve, the result of curve fitting for some pixel points with a large gradient amplitude within the window is a smooth curve. Then, the smoothness of the curve and the gradient magnitude can be used together to characterize the adjustment coefficient of the a value. The larger the gradient amplitude of the pixel points within the window, and the smoother the fitted curve, the more likely it is an edge position, and the smaller its a value, the smaller the adjustment coefficient. The specific implementation process is as follows: It should be noted that the kernel parameter in the Lanczos interpolation algorithm is a parameter used to control the size of the interpolation kernel, and it has a certain impact on the final interpolation result. Selecting an appropriate kernel parameter can obtain high-quality interpolation results while ensuring computational efficiency. A smaller kernel parameter may cause the interpolation result to be too sharp, possibly introducing artifacts or over-enhancing details. While a larger kernel parameter may cause the interpolation result to be too smooth, possibly resulting in blurring or loss of details.
[0023] Create a window centered on any pixel point in the original image. In the Lanczos algorithm, the window size is usually , and the preset initial value is 3. Therefore, in this embodiment, the sliding size is , and use the sliding window to slide on the original image; use operator to calculate the gradient amplitude of each pixel point within the sliding window.
[0024] Arrange the gradient amplitudes of all pixel points within the sliding window in ascending order of gradient amplitude to obtain the first gradient sequence. Traverse each gradient amplitude in the first gradient sequence from left to right, and record the traversed gradient amplitude as the current gradient amplitude. In the sliding window, the pixel points greater than or equal to the current gradient amplitude are recorded as target pixel points.
[0025] Use the least squares method to perform curve fitting on the gradient amplitudes of the target pixel points to obtain a fitted curve, denoted as the first fitted curve. Then calculate the shortest distance from each target pixel point to the first fitted curve, and then calculate the average value of the shortest distances from all target pixel points to the first fitted curve. Use the average value to represent the smoothness of the first fitted curve. Because if the target pixel point is an edge pixel point in the original image, then the points with higher gradient amplitudes must be distributed around the fitted curve. The smaller the average distance, the better the smoothness. As Figure 2As shown, it is a representation diagram of the fitting effect of the first fitting curve and the distance from each target pixel point to the first fitting curve.
[0026] Obtain the shortest distance from each target pixel point within the sliding window to the first fitting curve, and obtain the adjustment coefficient of each pixel point in the original image based on the mean value of the gradient magnitudes of all pixel points within the sliding window, the shortest distance from each target pixel point to the first fitting curve, and the number of target pixel points within the sliding window. The calculation formula is as follows: In the formula, represents the adjustment coefficient of the th pixel point in the original image, represents the gradient magnitude of the th target pixel point in the target window centered on the th pixel point, represents the shortest distance from the th target pixel point in the target window centered on the th pixel point to the first fitting curve, represents the number of target pixel points in the sliding window centered on the th pixel point, represents the exponential function with the natural constant as the base.
[0027] represents the mean value of the gradient magnitudes of all target pixel points in the target window centered on the th pixel point, representing the gradient information of the pixel points within the iterative window, represents the average value of the shortest distances from all target pixel points to the first fitting curve.
[0028] Furthermore, obtain the adjustment coefficient of the th pixel point in the original image during each traversal process, and select the minimum value of all adjustment coefficients as the adjustment coefficient of the th pixel point.
[0029] Thus, the adjustment coefficient is obtained.
[0030] S003. Make a correction to the adjustment coefficient based on the characteristics of motion blur to obtain the kernel parameter of each pixel point; It should be noted that since there may be a certain amount of motion blur in CT images, which will cause false edges to appear in the images. Therefore, it is necessary to utilize the characteristics of motion blur to correct the adjustment coefficient and weaken the influence of false edges on the adjustment coefficient. Since motion blur has a certain directionality, this directionality can be used to calculate the authenticity of edges. Because the gradient characteristics of edge textures are relatively obvious, in the process of analyzing motion blur, using the information of edge textures to calculate the authenticity of edges can be more accurate and effective. The specific implementation process is as follows: It should be noted that when adjusting the kernel parameter adjustment coefficient as described above, each pixel point in the original image is calculated. However, because when enhancing the image, the enhancement degree of different pixel points is different, the kernel parameters of different pixel points are not the same. In an image with motion blur, the degree of blur within a local range is similar. Therefore, calculate the authenticity of the edges of the target pixel point, and then correct the adjustment coefficient of the pixel points that are not the target pixel points according to the edge authenticity.
[0031] Specifically, taking any target pixel point as the center, use a window of the same size as the sliding window to slide in the (0°, 45°, 90°, …, 315°) directions of the target pixel point, and take , set the sliding step to a distance of 3 pixel points. Slide the target window in different sliding directions of the target pixel point to obtain a number of first sliding windows, analyze the difference in the gradient directions of the pixel points between the target window and the first sliding windows, and then obtain the similarity between the target window and the first sliding windows. This similarity is manifested as the similarity of the gradient directions of the corresponding position pixel points within the window. The higher the similarity of the gradient directions, the higher the possibility that the current direction is the motion blur direction. The calculation formula for the similarity between the target window and the first sliding windows is: In the formula, represents the similarity between the target window corresponding to the th pixel point in the original image and the th first sliding window in any sliding direction, represents the gradient direction of the th pixel point in the target window corresponding to the th pixel point in the original image, represents the gradient direction of the th pixel point in the th first sliding window in any sliding direction, represents the number of target pixel points in the sliding window centered on the th pixel point, is a linear normalization function.
[0032] Indicates the th pixel point in the original image corresponding to the th pixel point in the target window and the th pixel point at the same position in any sliding direction and the th pixel point at the same position in the The difference in gradient direction between them. The value range of is , so add 1 to make the value positive, and then take the average of the similarities of the pixel points at the same position within the window, which represents the similarity between the two windows.
[0033] Furthermore, after the first sliding in the iteration direction is completed, the similarity between the target window and the th window in any sliding direction is obtained. When the similarity is less than the threshold , the sliding direction where the rd first sliding window is located is not the candidate motion blur direction; when it is greater than or equal to the preset threshold , the sliding direction where the th first sliding window is located is the candidate motion blur direction. Take , this threshold is an empirical threshold, and the implementer can set it according to different implementation environments. Then calculate the similarity between the target window and the first sliding window, and perform threshold judgment until the similarities between the target window and the first sliding window in all directions are obtained.
[0034] Because motion blur occurs by moving in one direction, there will be multiple directions that satisfy the threshold after sliding is completed. Use the PCA principal component analysis algorithm to obtain the principal direction of multiple directions, and take the motion blur direction of the th pixel point. Take the average similarity of the first sliding window in each direction as the similarity of the motion blur direction.
[0035] Obtain the sliding window with the highest average gradient among all the first sliding windows in the motion blur direction, and record it as the preferred window in the motion blur direction. Denote the edge pixel points included in the preferred window as the first edge pixel points, and calculate the mean of the Euclidean distances between the first edge pixel points and the target window to characterize the authenticity of the edge.
[0036] The calculation formula for the edge authenticity is as follows: In the formula, Indicates the authenticity of the first edge pixel point in the motion blur direction of the th pixel point in the original image, Indicates the The variance of the similarity between the target window corresponding to a pixel and all the first sliding windows in the motion blur direction Denotes the exponential function with the natural constant as the base.
[0037] Furthermore, the greater the authenticity of the first edge pixel, the more credible the adjustment coefficient of the kernel parameter for the th pixel in the original image. Therefore, the adjustment coefficient is smaller because the smaller the adjustment coefficient, the smaller the kernel parameter can be obtained during the adjustment of the kernel parameter. The smaller kernel parameter will make the edge clearer. Therefore, the calculation formula for the adjustment coefficient is obtained based on the authenticity of the edge: In the formula, Denotes the correction coefficient of the th pixel in the original image, Denotes the adjustment coefficient of the th pixel in the original image, Denotes the authenticity of the first edge pixel in the motion blur direction of the th pixel in the original image, Denotes the exponential function with the natural constant as the base.
[0038] Furthermore, the kernel parameter corresponding to each pixel is adjusted according to the corrected adjustment coefficient, and its calculation formula is as follows: In the formula, Denotes the corrected kernel parameter of the th pixel in the original image. 3 is the initial kernel parameter size, Is the ceiling function, Is the linear normalization function.
[0039] It should be noted that the above calculates the kernel parameter for any pixel in the original image, and then uses the same method to obtain the kernel parameters of each pixel in the original image.
[0040] Thus, the adjusted kernel parameters are obtained.
[0041] S004. Perform super-resolution reconstruction on the original image through an interpolation algorithm according to the kernel parameter of each pixel to obtain an enhanced image, and then obtain the foreign object area; According to the obtained kernel parameter of each pixel, then use the Lanczos interpolation algorithm to perform super-resolution reconstruction on the original image, as Figure 3As shown in the figure, the three images from left to right are the original image, the super-resolution reconstruction result image of the traditional Lanczos interpolation based on fixed kernel parameters, and the super-resolution reconstruction result image of the Lanczos interpolation based on adaptive kernel parameters respectively.
[0042] It can be seen that the clarity of the image after super-resolution reconstruction has been significantly improved; Figure 3 The local images below the second and third images in the figure are the enlarged images at the same position in the second and third images respectively. It can be seen that although the results of the Lanczos interpolation algorithm with fixed kernel parameters and the Lanczos interpolation algorithm with adaptive kernel parameters are not much different visually, their gray-scale distributions are quite different. Obviously, the super-resolution reconstruction result based on the Lanczos interpolation with adaptive kernel parameters is more similar to the gray-scale distribution of the original image, that is, while improving the clarity, more details in the original image are retained, which is convenient for the subsequent detection of foreign objects in the CT image, and further improves the efficiency of the medical foreign object detection method based on image enhancement processing. The Lanczos interpolation algorithm is a well-known existing technology and will not be elaborated here.
[0043] According to the obtained enhanced CT image, threshold segmentation is performed on the enhanced CT image to obtain the foreign object area. In this implementation, the OTSU threshold segmentation algorithm is used to segment the enhanced CT image. This algorithm is a well-known existing technology and will not be elaborated here.
[0044] Through the above steps, a medical foreign object detection method based on image enhancement processing is completed.
[0045] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for detecting foreign matter in medicine based on image enhancement processing, characterized in that: The method comprises the following steps: Collect chest CT images and record them as original images; Slide on each pixel point on the original image through a preset sliding window, obtain the target pixel point according to the gradient change of the pixel point in the sliding window, perform curve fitting on the target pixel point to obtain a first fitting curve; obtain the adjustment coefficient of each pixel point in the original image according to the positional relationship between the target pixel point and the first fitting curve; The sliding window where each pixel point in the original image is located is recorded as a target window, and several first sliding windows are obtained by sliding the target window in different sliding directions of the target pixel point. The similarity between the target window and the first sliding window is obtained according to the difference in gradient direction between the target window and the first sliding window; the sliding direction to be retained is determined by a preset threshold according to the similarity between the target window and the first sliding window, and the motion blur direction of the target pixel point is obtained according to the retained sliding direction; the preferred window in the motion blur direction is obtained according to the gradient values of all the first sliding windows in the motion blur direction, and the edge pixel points contained in the preferred window are recorded as first edge pixel points, and the authenticity of the first edge pixel point is obtained according to the distance between the first edge pixel point and the target window; the correction coefficient is obtained according to the authenticity of the first edge pixel point; and the kernel parameters are corrected according to the correction coefficient; The original image is interpolated according to the obtained kernel parameters to obtain an enhanced CT image, and the enhanced CT image is segmented by threshold to obtain the foreign body area.
2. The medical foreign body detection method based on image enhancement processing according to claim 1 is characterized in that: The method slides on each pixel point on the original image through a preset sliding window, obtains a target pixel point according to the gradient change of the pixel point in the sliding window, and performs curve fitting on the target pixel point to obtain a first fitting curve, including the following specific steps: A sliding window is preset, with each pixel in the original image as the center of the sliding window, and the sliding window is used to slide on the original image; the gradient amplitudes of all pixels in the sliding window are arranged in order from small to large to obtain a first gradient sequence, and each gradient amplitude in the first gradient sequence is traversed from left to right, and the traversed gradient amplitude is recorded as the current gradient amplitude, and the pixel points in the sliding window that are greater than or equal to the current gradient amplitude are recorded as target pixels, and the gradient amplitude of the target pixel points is subjected to curve fitting to obtain a fitting curve, which is recorded as the first fitting curve.
3. The medical foreign body detection method based on image enhancement processing according to claim 2 is characterized in that: The step of obtaining the adjustment coefficient of each pixel in the original image according to the positional relationship between the target pixel and the first fitting curve includes the following specific steps: The shortest distance from each target pixel point in the sliding window to the first fitting curve is obtained, and the adjustment coefficient of each pixel point in the original image is obtained according to the average value of the gradient amplitude of all pixels in the sliding window, the shortest distance from each target pixel point to the first fitting curve, and the number of target pixels in the sliding window; then the adjustment coefficient of each pixel point in the original image in each traversal process is obtained, and the minimum value of all adjustment coefficients is selected as the adjustment coefficient of the pixel point.
4. The medical foreign body detection method based on image enhancement processing according to claim 3 is characterized in that: The specific steps of obtaining the adjustment coefficient of each pixel in the original image according to the mean value of the gradient amplitude of all pixels in the sliding window, the shortest distance from each target pixel to the first fitting curve, and the number of target pixels in the sliding window are as follows: In the formula, Indicates the original image The adjustment factor of each pixel, Indicates the The first pixel in the target window centered at The gradient amplitude of the target pixel, Indicates the The first pixel in the target window centered at The shortest distance between the target pixel and the first fitting curve, Indicates the The number of target pixels in the sliding window centered at the pixel point. Represents an exponential function with a natural constant as its base.
5. The medical foreign body detection method based on image enhancement processing according to claim 1 is characterized in that: The method comprises the following specific steps: obtaining a plurality of first sliding windows by sliding the target window in different sliding directions of the target pixel point, and obtaining the similarity between the target window and the first sliding window according to the difference in gradient direction between the target window and the first sliding window: In the formula, Indicates the original image The target window corresponding to the pixel point is the same as the The similarity between the first sliding windows, Indicates the original image The pixel point in the target window corresponds to The gradient direction of each pixel is Indicates the first In the first sliding window The gradient direction of each pixel is Indicates the The number of target pixels in the sliding window centered at the pixel point. is a linear normalization function.
6. The medical foreign body detection method based on image enhancement processing according to claim 5 is characterized in that: The method of determining the sliding direction to be retained by using a preset threshold according to the similarity between the target window and the first sliding window, and obtaining the motion blur direction of the target pixel point according to the retained sliding direction, includes the following specific steps: For All similarities between the target window corresponding to the pixel points and all the first sliding windows in any direction are obtained, and the maximum value of all similarities is obtained. When the maximum value is less than the preset threshold At that time, The sliding direction of the first sliding window is not a candidate motion blur direction; it is greater than or equal to a preset threshold At that time, The sliding direction of the first sliding window is the candidate motion blur direction; the PCA algorithm is used to obtain the main direction of all candidate motion blur directions, and the main direction is used as the first The direction of motion blur for each pixel.
7. The medical foreign body detection method based on image enhancement processing according to claim 1 is characterized in that: The method of obtaining a preferred window in the motion blur direction according to the gradient values of all first sliding windows in the motion blur direction, recording the edge pixel points included in the preferred window as first edge pixel points, and obtaining the authenticity of the first edge pixel points according to the distance between the first edge pixel points and the target window includes the following specific steps: In the original image The first sliding window with the largest average gradient among all the first sliding windows is obtained in the motion blur direction of the pixel point, and is recorded as the first The preferred window in the motion blur direction of pixels is used, and the edge pixels contained in the preferred window are recorded as the first edge pixels. The mean of the Euclidean distance between the first edge pixel and the target window is calculated to represent the authenticity of the edge. The calculation formula is as follows: In the formula, Indicates the original image The authenticity of the first edge pixel in the motion blur direction of pixels, Indicates the original image The variance of the similarity between the target window corresponding to the pixel point and all the first sliding windows in the motion blur direction, Represents an exponential function with a natural constant as its base.
8. The medical foreign body detection method based on image enhancement processing according to claim 1 is characterized in that: The specific steps of obtaining the correction coefficient according to the authenticity of the first edge pixel point are as follows: In the formula, Indicates the original image The correction factor for each pixel is Indicates the original image The adjustment factor of each pixel, Indicates the original image The authenticity of the first edge pixel in the motion blur direction of pixels, Represents an exponential function with a natural constant as its base.
9. The medical foreign body detection method based on image enhancement processing according to claim 1, characterized in that: The specific steps of correcting the kernel parameters according to the correction coefficient are as follows: In the formula, Indicates the original image The kernel parameters after pixel correction, 3 is the initial kernel parameter size, is the ceiling function, is a linear normalization function.
10. The medical foreign body detection method based on image enhancement processing according to claim 1, characterized in that: The method of interpolating the original image according to the obtained kernel parameters to obtain an enhanced CT image, performing threshold segmentation on the enhanced CT image to obtain the foreign body area includes the following specific steps: According to the kernel parameters corresponding to each pixel in the original image, the original image is super-resolution reconstructed to obtain an enhanced CT image, and the enhanced CT image is threshold segmented to obtain the foreign body area.
Citation Information
Patent Citations
CT reconstruction method and device based on self-adaptive NLM correction
CN110599563A
Image reconstruction method and device, storage medium and electronic equipment
CN117274056A
Tumor image enhancement method
CN117853386A
Lung X-ray image processing method for lung fiber inhalation pathopoiesis
CN118196123A
Waste treatment and detection method for animal husbandry and veterinary medicine based on image processing
CN118762247A