Medical Foreign Object Detection Method Based on Image Enhancement Processing

By adaptively adjusting the kernel parameters of the Lanczos interpolation algorithm, the problems of kernel parameter in chest CT images are solved, and better image enhancement and foreign object detection effects are achieved.

CN120147347BActive Publication Date: 2025-08-05BEIJING SHIKU TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510622285.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-15
Publication Date
2025-08-05
Estimated Expiration
2045-05-15

AI Technical Summary

Technical Problem

In chest CT images, the fixed kernel parameters in the Lanczos interpolation algorithm cannot adapt to different images or region features, resulting in image distortion or artifacts, and the CT images may cause motion blur due to device movement or call, affecting the detection effect.

Method used

By adaptively adjusting the kernel parameters, using sliding windows to perform gradient changes and motion blur direction analysis on the image, calculate the adjustment coefficient and correction coefficient of each pixel point, and optimize the kernel parameters for image enhancement and super-resolution reconstruction.

Benefits of technology

It improves image clarity and detail retention, reduces image distortion and artifacts, and enhances the accuracy and efficiency of foreign object detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120147347B_ABST
    Figure CN120147347B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of image processing, and in particular to a method for detecting medical foreign bodies based on image enhancement processing. The method comprises the following steps: acquiring a chest CT image, sliding a sliding window on each pixel point on the original image, and obtaining an adjustment coefficient for each pixel point according to a gradient change of the pixel point within the sliding window; sliding the sliding window in different directions of a target pixel point, and obtaining similarity between windows according to a difference in gradient direction between the target window and the sliding window; thereby obtaining a motion blur direction; obtaining a correction adjustment coefficient according to the difference in motion blur direction between the sliding window and the target window; and adjusting kernel parameters according to the correction adjustment coefficient. This method achieves better results when super-resolution reconstruction of the original image is performed using a Lanczos interpolation algorithm, improves the image enhancement effect, and facilitates subsequent detection of foreign bodies in the CT image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a medical foreign body detection method based on image enhancement processing. Background Art

[0002] When detecting foreign bodies in chest CT images, it is often necessary to perform image enhancement processing on the images so that doctors can make clearer judgments on the CT images and facilitate the subsequent detection of foreign bodies. Interpolation-based super-resolution reconstruction is used to improve the resolution of the image. This method requires interpolation of the pixels in the image. The Lanczos interpolation algorithm is an interpolation method based on the convolution kernel. The Lanczos function is used as the convolution kernel to calculate the value of the target pixel. However, this algorithm often uses a fixed-size kernel parameter. ,For different windows, the pixels in them behave differently, and a fixed kernel parameter size may cause the image to be distorted or have artifacts, resulting in no image enhancement effect.

[0003] When using the Lanczos interpolation algorithm for interpolation, fixed kernel parameters may not adapt to the characteristics of different images or regions. That is, windows with different grayscale representations may require different kernel parameter sizes. Furthermore, when capturing chest CT images, the captured images may exhibit motion blur due to device movement or breathing, leading to deviations in kernel parameter adjustment. Therefore, the present invention adaptively adjusts the kernel parameter size, resulting in better interpolation performance. Summary of the Invention

[0004] In order to solve the above problems, the present invention provides a medical foreign body detection method based on image enhancement processing.

[0005] The present invention provides a method for detecting foreign matter in medicine based on image enhancement processing, which adopts the following technical solutions:

[0006] An embodiment of the present invention provides a method for detecting foreign matter in medicine based on image enhancement processing, the method comprising the following steps:

[0007] Collect chest CT images, which are recorded as original images;

[0008] A preset sliding window is sliding on each pixel point on the original image, a target pixel point is obtained according to the gradient change of the pixel point within the sliding window, and a curve fitting is performed on the target pixel point to obtain a first fitting curve; an adjustment coefficient of each pixel point in the original image is obtained according to the positional relationship between the target pixel point and the first fitting curve;

[0009] The sliding window where each pixel 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. The similarity between the target window and the first sliding window is obtained based on 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 based on the similarity between the target window and the first sliding window, and the motion blur direction of the target pixel is obtained based on the retained sliding direction; the preferred window in the motion blur direction is obtained based on the gradient values of all first sliding windows in the motion blur direction, the edge pixel point contained in the preferred window is recorded as the first edge pixel point, and the authenticity of the first edge pixel point is obtained based on the distance between the first edge pixel point and the target window; the correction coefficient is obtained based on the authenticity of the first edge pixel point; and the kernel parameters are corrected based on the correction coefficient;

[0010] 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.

[0011] Furthermore, the method slides a preset sliding window on each pixel point on the original image, obtains a target pixel point according to a 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:

[0012] 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 ascending order 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. The pixel points in the sliding window with a gradient amplitude greater than or equal to the current gradient amplitude are recorded as target pixels, and the gradient amplitudes of the target pixels are subjected to curve fitting to obtain a fitting curve, which is recorded as the first fitting curve.

[0013] Furthermore, 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:

[0014] 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 mean of the gradient amplitudes 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.

[0015] Furthermore, the step of obtaining an adjustment coefficient for each pixel in the original image according to the mean of the gradient amplitudes 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 includes the following specific steps:

[0016]

[0017] Where, Indicates the first The adjustment coefficient 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 on the pixel point, Represents an exponential function with a natural constant as its base.

[0018] Furthermore, the step of obtaining a plurality of first sliding windows by sliding the target window in different sliding directions of the target pixel point and obtaining similarities between the target window and the first sliding windows based on differences in gradient directions between the target window and the first sliding windows includes the following specific steps:

[0019]

[0020] Where, Indicates the first The target window corresponding to the pixel point is the same as the The similarity between the first sliding windows, Indicates the first The pixel point in the target window corresponds to The gradient direction of each pixel, Indicates the first In the first sliding window The gradient direction of each pixel, Indicates the The number of target pixels in the sliding window centered on the pixel point, is a linear normalization function.

[0021] Furthermore, 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 according to the retained sliding direction, includes the following specific steps:

[0022] For the All similarities between the target window corresponding to the pixel point 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 When, 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 When, 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.

[0023] Furthermore, 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 contained 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 point and the target window includes the following specific steps:

[0024] 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 points, and is recorded as the first sliding window. The optimal window in the motion blur direction of the pixels is recorded as the first edge pixel. 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:

[0025]

[0026] Where, Indicates the first The authenticity of the first edge pixel in the motion blur direction of pixels, Indicates the first 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.

[0027] Furthermore, the step of obtaining the correction coefficient according to the authenticity of the first edge pixel point includes the following specific steps:

[0028]

[0029] Where, Indicates the first The correction coefficient of each pixel, Indicates the first The adjustment coefficient of each pixel, Indicates the first 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.

[0030] Furthermore, the kernel parameters are corrected according to the correction coefficients, including the following specific steps:

[0031]

[0032] Where, Indicates the first The kernel parameters after pixel correction, 3 is the initial kernel parameter size, is the ceiling function, is a linear normalization function.

[0033] Furthermore, the method of interpolating the original image according to the obtained kernel parameters to obtain an enhanced CT image, and performing threshold segmentation on the enhanced CT image to obtain the foreign body area includes the following specific steps:

[0034] 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.

[0035] The beneficial effect of the technical solution of the present invention is that when the original image is enhanced by the Lanczos interpolation algorithm, the kernel parameters in the algorithm have an important influence on the image enhancement effect. Therefore, the present invention adapts the kernel parameters of each pixel according to the grayscale change of the pixel in the image. Compared with the traditional method of fixing the kernel parameter size, it can effectively solve the problem of image details and clarity caused by too large kernel parameters and the problem of images being too sharp and unnatural caused by too small kernel parameters. At the same time, considering the motion blur that may be generated during the acquisition of CT images, the process of adaptively adjusting the kernel parameters is more effective and accurate.

[0036] When adapting kernel parameters, the present invention uses a preset sliding window to traverse every pixel in the original image, establishes a computational model based on the grayscale changes of the pixels within the sliding window, and obtains the adjustment coefficient for each center pixel of the sliding window. However, because image motion blur leads to blurred edges in the original image, the present invention slides the center pixel in different directions to obtain the authenticity of the blurred edge pixel of each pixel. Then, the adjustment coefficient is modified based on the authenticity of the edge to obtain the final kernel parameters. This improves the super-resolution reconstruction effect, enhances the image enhancement effect, and facilitates the subsequent detection of foreign objects in CT images. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0038] Figure 1 This is a flowchart of the steps of a medical foreign body detection method based on image enhancement processing of the present invention;

[0039] Figure 2 A diagram showing the fitting effect of the first fitting curve and the distance between each target pixel and the first fitting curve;

[0040] Figure 3 This is the result of super-resolution reconstruction of the original image using the Lanczos interpolation algorithm. DETAILED DESCRIPTION

[0041] To further illustrate the technical means and effectiveness of the present invention in achieving its intended objectives, the following, in conjunction with the accompanying drawings and preferred embodiments, describes in detail the specific implementation, structure, features, and effectiveness of a medical foreign body detection method based on image enhancement processing proposed by the present invention. In the following description, references to different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.

[0042] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0043] The following describes in detail a specific solution of a medical foreign body detection method based on image enhancement processing provided by the present invention with reference to the accompanying drawings.

[0044] See also Figure 1, which shows a flowchart of a method for detecting foreign matter in medicine based on image enhancement processing provided by one embodiment of the present invention, the method comprising the following steps:

[0045] S001. Acquire chest CT images;

[0046] The primary purpose of this embodiment is to enhance chest CT images. Therefore, a chest CT image must first be obtained. This chest CT image is acquired using a computed tomography (CT) machine. Because the acquired CT image contains a certain amount of noise, the acquired CT image is subjected to denoising. This embodiment uses a median filtering algorithm to denoise the acquired CT image. This algorithm is well known in the art and will not be described in detail here. A denoised CT image is then obtained and recorded as the original image.

[0047] S002. Slide a preset sliding window over each pixel on the chest CT image, and obtain an adjustment coefficient for each pixel based on the gradient change of the pixel within the sliding window;

[0048] It should be noted that in an image, the edge of the image is usually characterized by a higher gradient value. Therefore, a preset window is used to slide on the edge of the image. Since the edge of the image is a continuous smooth curve, the result of curve fitting of some pixels with larger gradient amplitudes in the window is a smooth curve. The smoothness of the curve and the gradient size can be used to jointly characterize the adjustment coefficient of the a value. Then, the larger the gradient amplitude of the pixel point in the window and the smoother the fitted curve, the more likely it is an edge position, and the smaller its a value is, the smaller the adjustment coefficient is. The specific implementation process is as follows:

[0049] It's important to note that the kernel parameter in the Lanczos interpolation algorithm controls the size of the interpolation kernel and has a significant impact on the final interpolation result. Choosing the appropriate kernel parameter ensures high-quality interpolation while maintaining computational efficiency. Small kernel parameters may result in oversharpened interpolation results, potentially introducing artifacts or over-enhancing details. Large kernel parameters, on the other hand, may result in overly smooth interpolation results, potentially blurring or losing detail.

[0050] Create a window centered on any pixel in the original image. In the Lanczos algorithm, the window size is usually , preset initial The value is 3, so in this embodiment the sliding size is , use the sliding window to slide on the original image; use The operator calculates the gradient magnitude of each pixel in the sliding window.

[0051] Arrange the gradient amplitudes of all pixels in the sliding window in ascending order to obtain a first gradient sequence. Then, traverse each gradient amplitude in the first gradient sequence from left to right, record the traversed gradient amplitude as the current gradient amplitude, and record the pixel in the sliding window with a gradient amplitude greater than or equal to the current gradient amplitude as the target pixel.

[0052] The least squares method is used to perform curve fitting on the gradient amplitude of the target pixel to obtain a fitting curve, which is recorded as the first fitting curve. Then, the shortest distance from each target pixel to the first fitting curve is calculated, and the average value of the shortest distances from all target pixels to the first fitting curve is calculated. The average value is used to represent the smoothness of the first fitting curve. Because if the target pixel is an edge pixel in the original image, the points with higher gradient amplitude must be distributed around the fitting curve. The smaller the average distance, the better the smoothness. Figure 2 As shown, it is a diagram showing the fitting effect of the first fitting curve and the distance from each target pixel to the first fitting curve.

[0053] The shortest distance from each target pixel in the sliding window to the first fitting curve is obtained. The adjustment coefficient of each pixel in the original image is obtained according to the mean of the gradient amplitudes 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. The calculation formula is as follows:

[0054]

[0055] Where, Indicates the first The adjustment coefficient 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 on the pixel point, Represents an exponential function with a natural constant as its base.

[0056] Indicates the The mean of the gradient amplitudes of all target pixels in the target window centered at a pixel point represents the gradient information of the pixel points in the iteration window. Represents the average of the shortest distances from all target pixels to the first fitting curve.

[0057] Further, get the first The adjustment coefficient of each pixel in each traversal process is selected, and the minimum value of all adjustment coefficients is selected as the The adjustment factor for each pixel.

[0058] At this point, the adjustment coefficient is obtained.

[0059] S003. Modify the adjustment coefficient based on the motion blur characteristics to obtain the kernel parameters for each pixel.

[0060] It should be noted that because there may be a certain amount of motion blur in CT images, this will cause false edges in the image. Therefore, it is necessary to use the characteristics of motion blur to correct the adjustment coefficient and weaken the influence of false edges on the adjustment coefficient. Motion blur has a certain directionality, so this directionality can be used to calculate edge authenticity. Since the gradient characteristics of edge texture are more obvious, using edge texture information to calculate edge authenticity during motion blur analysis can be more accurate and effective. The specific implementation process is as follows:

[0061] It should be noted that when the kernel parameter adjustment coefficient is adjusted, each pixel in the original image is calculated. However, because the degree of enhancement of different pixels is different when the image is enhanced, the kernel parameters of different pixels are different. Because the degree of blur of the image in the local range is similar in the motion blurred image, the edge authenticity of the target pixel is calculated, and then the adjustment coefficient of the pixel that is not the target pixel is corrected according to the edge authenticity.

[0062] Specifically, with any target pixel as the center, a window with the same size as the sliding window is used to Slide in the direction (0°, 45°, 90°, ..., 315°) to select , set the sliding step to a distance of 3 pixels, and slide the target window in different sliding directions of the target pixel to obtain several first sliding windows. Analyze the difference in pixel gradient direction between the target window and the first sliding window, and then obtain the similarity between the target window and the first sliding window. This similarity is manifested as the similarity of the gradient directions of the corresponding pixel points in the window. The higher the similarity of the gradient direction, 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 window is:

[0063]

[0064] Where, Indicates the first The target window corresponding to the pixel point is the same as the The similarity between the first sliding windows, Indicates the first The pixel point in the target window corresponds to The gradient direction of each pixel, Indicates the first In the first sliding window The gradient direction of each pixel, Indicates the The number of target pixels in the sliding window centered on the pixel point, is a linear normalization function.

[0065] Indicates the first The pixel point in the target window corresponds to pixel points and the The first position in the same window The difference in gradient direction between pixels, The value range is , so add 1 to make the value positive, and then take the average of the similarities of the pixels at the same position in the window to represent the similarity of the two windows.

[0066] Furthermore, after the first sliding in the iteration direction is completed, the target window and the first sliding direction in any sliding direction are obtained. The similarity between windows is less than the threshold. When, 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 When, The sliding direction of the first sliding window is the candidate motion blur direction. This threshold is an empirical threshold and can be set by the implementer according to different implementation environments. The similarity between the target window and the first sliding window is then calculated and the threshold judgment is performed until the similarity between the target window and the first sliding window in all directions is obtained.

[0067] Because motion blur occurs when moving in one direction, there will be multiple directions in which the sliding completes and meets the threshold. The PCA principal component analysis algorithm is used to obtain the main directions of multiple directions. The motion blur direction of each pixel is calculated, and the average similarity of the first sliding window in each direction is taken as the similarity of the motion blur direction.

[0068] The sliding window with the highest average gradient among all the first sliding windows in the motion blur direction is obtained and recorded as the preferred window in the motion blur direction. 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 pixels and the target window is calculated to represent the authenticity of the edge.

[0069] The calculation formula of edge authenticity is as follows:

[0070]

[0071] Where, Indicates the first The authenticity of the first edge pixel in the motion blur direction of pixels, Indicates the first 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.

[0072] The greater the authenticity of the first edge pixel, the better the The more credible the adjustment coefficient of the kernel parameter of each pixel point is, the smaller the adjustment coefficient is. Because the smaller the adjustment coefficient is, the smaller the kernel parameter can be obtained during the adjustment process of the kernel parameter. The smaller the kernel parameter is, the clearer the edge will be. Therefore, the calculation formula of the adjustment coefficient is obtained based on the authenticity of the edge:

[0073]

[0074] Where, Indicates the first The correction coefficient of each pixel, Indicates the first The adjustment coefficient of each pixel, Indicates the first 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.

[0075] Then, the kernel parameters corresponding to each pixel are adjusted according to the correction adjustment coefficient. The calculation formula is as follows:

[0076]

[0077] Where, Indicates the first The kernel parameters after pixel correction, 3 is the initial kernel parameter size, is the ceiling function, is a linear normalization function.

[0078] It should be noted that the above is to calculate the kernel parameters of any pixel point in the original image, and then use the same method to obtain the kernel parameters of each pixel point in the original image.

[0079] At this point, the adjusted kernel parameters are obtained.

[0080] S004. Perform super-resolution reconstruction of the original image using an interpolation algorithm based on the kernel parameters of each pixel to obtain an enhanced image and thereby determine the foreign body region.

[0081] According to the kernel parameters of each pixel, the Lanczos interpolation algorithm is used to reconstruct the original image in super-resolution, such as Figure 3 As shown, the three figures from left to right are the original image, the traditional Lanczos interpolation super-resolution reconstruction result based on fixed kernel parameters, and the super-resolution reconstruction result based on Lanczos interpolation based on adaptive kernel parameters.

[0082] It can be seen that the clarity of the super-resolution reconstructed image has been significantly improved; Figure 3 The local images below the second and third images are magnified images of the same locations in the second and third images, respectively. It can be seen that while the visual effects of the Lanczos interpolation algorithm with fixed kernel parameters and the Lanczos interpolation algorithm with adaptive kernel parameters are similar, their grayscale distributions are quite different. Clearly, the super-resolution reconstruction result based on the Lanczos interpolation with adaptive kernel parameters is more similar to the grayscale distribution of the original image, improving clarity while retaining more details in the original image. This facilitates the detection of foreign bodies in subsequent CT images and further improves the efficiency of medical foreign body detection methods based on image enhancement processing. The Lanczos interpolation algorithm is a well-known technique and will not be further described here.

[0083] According to the obtained enhanced CT image, the enhanced CT image is threshold segmented to obtain the foreign body area. This embodiment uses the OTSU threshold segmentation algorithm to segment the enhanced CT image. The algorithm is an existing well-known technology and will not be described in detail here.

[0084] Through the above steps, a medical foreign body detection method based on image enhancement processing is completed.

[0085] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the scope of protection 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, which are recorded as original images; A preset sliding window is sliding on each pixel point on the original image, a target pixel point is obtained according to the gradient change of the pixel point within the sliding window, and a curve fitting is performed on the target pixel point to obtain a first fitting curve; an adjustment coefficient of each pixel point in the original image is obtained according to the positional relationship between the target pixel point and the first fitting curve; The sliding window where each pixel 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. The similarity between the target window and the first sliding window is obtained based on 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 based on the similarity between the target window and the first sliding window, and the motion blur direction of the target pixel is obtained based on the retained sliding direction; the preferred window in the motion blur direction is obtained based on the gradient values of all first sliding windows in the motion blur direction, the edge pixel point contained in the preferred window is recorded as the first edge pixel point, and the authenticity of the first edge pixel point is obtained based on the distance between the first edge pixel point and the target window; the correction coefficient is obtained based on the authenticity of the first edge pixel point; and the kernel parameters are corrected based on the correction coefficient; Interpolate the original image according to the obtained kernel parameters to obtain an enhanced CT image, perform threshold segmentation on the enhanced CT image to obtain the foreign body area; The specific steps of correcting the kernel parameters according to the correction coefficient are as follows: Where, Indicates the first The kernel parameters after pixel correction, 3 is the initial kernel parameter size, is the ceiling function, is the linear normalization function, Indicates the first Correction coefficient for each pixel; 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 Lanczos interpolation algorithm is used to perform super-resolution reconstruction on the original image to obtain an enhanced CT image, which is then subjected to threshold segmentation to obtain the foreign body area.

2. The medical foreign body detection method based on image enhancement processing according to claim 1, characterized in that: The method slides a preset sliding window on each pixel point on the original image, 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 ascending order 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. The pixel points in the sliding window with a gradient amplitude greater than or equal to the current gradient amplitude are recorded as target pixels, and the gradient amplitudes of the target pixels are 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, 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 mean of the gradient amplitudes 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, characterized in that: The step of obtaining the adjustment coefficient of each pixel in the original image according to the mean of the gradient amplitudes 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 includes the following specific steps: Where, Indicates the first The adjustment coefficient 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 on the pixel point, Represents an exponential function with a natural constant as its base.

5. The method for detecting medical foreign matter based on image enhancement processing according to claim 1, characterized in that: The method includes 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 windows based on the difference in gradient direction between the target window and the first sliding windows. Where, Indicates the first The target window corresponding to the pixel point is the same as the The similarity between the first sliding windows, Indicates the first The pixel point in the target window corresponds to The gradient direction of each pixel, Indicates the first In the first sliding window The gradient direction of each pixel, Indicates the The number of target pixels in the sliding window centered on the pixel point, is a linear normalization function.

6. The method for detecting medical foreign matter based on image enhancement processing according to claim 5, 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 the All similarities between the target window corresponding to the pixel point 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 When, 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 When, 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 method for detecting medical foreign matter based on image enhancement processing according to claim 1, 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 contained 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 point 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 points, and is recorded as the first sliding window. The optimal window in the motion blur direction of the pixels is recorded as the first edge pixel. 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: Where, Indicates the first The authenticity of the first edge pixel in the motion blur direction of pixels, Indicates the first 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 method for detecting medical foreign matter based on image enhancement processing according to claim 1, characterized in that: The specific steps of obtaining the correction coefficient according to the authenticity of the first edge pixel point are as follows: Where, Indicates the first The correction coefficient of each pixel, Indicates the first The adjustment coefficient of each pixel, Indicates the first 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.

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