Image processing method, device and system based on portable X-ray imaging
By determining the optimal pixel block of the non-local mean filter algorithm and adjusting the weight of edge pixels, the problem of insufficient denoising capabilities in edge and texture areas in portable X-ray imaging equipment is solved, and the image quality is improved.
Patent Information
- Application Number
- CN202411046548.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2044-08-01
AI Technical Summary
Existing non-local mean filtering algorithms have weak denoising capabilities in edge and texture areas in medical images of portable X-ray imaging equipment, resulting in unsatisfactory image quality.
By obtaining the pixel block, target area, edge connection line and grayscale change map slope, the optimal pixel block for the non-local mean filtering algorithm is determined, and the weight is adjusted to improve removal according to the degree of bone edge expression of the edge pixel points and the initial weight coefficient. Noise effect.
It effectively retains edge detail information in medical images and improves the denoising effect of non-local mean filtering algorithm on images of portable X-ray imaging equipment.
Smart Images

Figure CN118570205B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image data processing, and in particular to an image processing method, device and system based on portable X-ray imaging. Background Art
[0002] Portable X-ray imaging equipment is widely used in medical scenarios such as emergency rooms, operating rooms or remote areas, providing great convenience to medical staff. However, portable X-ray imaging equipment is low-dose imaging and has prominent noise, so denoising is a necessary processing method.
[0003] Among the existing denoising methods, the non-local mean filtering algorithm is usually used to remove noise from medical imaging of portable X-ray imaging equipment. However, the non-local mean filtering algorithm only has a good denoising effect in relatively smooth areas of the image, and has a weak denoising ability in the edge or texture areas of the image. As a result, the traditional non-local mean filtering algorithm cannot effectively enhance the detail information of the edges and textures in medical images, resulting in unsatisfactory image quality. Summary of the invention
[0004] The present invention provides an image processing method, device and system based on portable X-ray imaging to solve the existing problems.
[0005] The present invention provides an image processing method, device and system based on portable X-ray imaging, which adopts the following technical solutions:
[0006] An embodiment of the present invention provides an image processing method based on portable X-ray imaging, the method comprising the following steps:
[0007] Obtain medical images of patients;
[0008] Obtain pixel blocks, target areas, edge lines and slopes of grayscale change graphs of edge lines in the medical image, and obtain the best pixel blocks for medical image denoising using a non-local mean filtering algorithm according to the grayscale values of pixels in the pixel blocks, the target areas in the pixel blocks, the number of edge lines and the slopes of the grayscale change graphs of edge lines;
[0009] Obtain edge pixels and non-edge pixels in the medical image, obtain the bone edge expression degree of each edge pixel of the medical image according to the bone expression degree of the best pixel block where the edge pixel is located, the number and grayscale value of the pixels in the best pixel block where the edge pixel is located, and the number and gradient information of the pixels on the edge where the edge pixel is located, obtain the initial weight coefficient of each pixel when the medical image is denoised using a non-local mean filtering algorithm, and determine the final weight coefficient of each edge pixel in the medical image according to the bone edge expression degree of each edge pixel in the medical image, the number and bone edge expression degree of the pixels in the best pixel block where the edge pixel is located, and the initial weight coefficient of the edge pixel;
[0010] The medical image is denoised using the initial weight coefficients of the non-edge pixels and the final weight coefficients of the edge pixels to obtain a processed result image.
[0011] Furthermore, the method of obtaining the best pixel block for medical image denoising using the non-local mean filtering algorithm according to the grayscale value of the pixel point in the pixel block, the target area in the pixel block, the number of edge lines and the slope of the edge line grayscale change graph includes the following specific methods:
[0012] According to the non-local mean filtering algorithm, the similarity window size is When The gray value of the pixel in the pixel block, The target area in the pixel block, The number of edge connections in the pixel block, The slope of the grayscale change graph of the edge connection line of the pixel block is used to obtain the similarity window size: At that time, The degree of bone expression of each pixel block;
[0013] When the similarity window is obtained as any size, the bone expression degree corresponding to each pixel block is averaged under the similarity window of any size to obtain the bone expression degree under the similarity window of any size. The similarity window size when the bone expression degree is the largest is taken as the optimal size of the similarity window, and several pixel blocks corresponding to the similarity window of the optimal size are recorded as the optimal pixel blocks.
[0014] Furthermore, the similarity window size is At that time, The specific calculation method of the bone expression degree of a pixel block is:
[0015]
[0016] In the formula, Indicates that the similarity window size is At that time, The degree of bone expression of each pixel block; Indicates that the similarity window size is At that time, The maximum value of the grayscale value of all pixels in a pixel block; Indicates that the similarity window size is At that time, The minimum gray value of all pixels in a pixel block; Indicates that the similarity window size is At that time, The number of target areas in a pixel block; Indicates that the similarity window size is At that time, The number of edge lines in a pixel block; Indicates that the similarity window size is At that time, Pixel block In the target area The slope of the grayscale change graph of the edge connection line; Indicates absolute value.
[0017] Furthermore, the bone margin expression degree of each edge pixel in the medical image is obtained according to the bone expression degree of the best pixel block where the edge pixel is located, the number and grayscale value of the pixels in the best pixel block where the edge pixel is located, and the number and gradient information of the pixels on the edge where the edge pixel is located, including the specific method of:
[0018] According to the medical image The bone expression degree of the best pixel block corresponding to the edge pixel point as the center point of the best size similarity window, The number of pixels in the best pixel block where the edge pixel is located, The maximum and minimum values of the pixel gradient values in the best pixel block where the edge pixel is located, The gradient value of the pixel in the best pixel block where the edge pixel is located, The number of pixels on the edge where the edge pixel is located, The gradient direction of the pixel on the edge where the edge pixel is located, The mean value of the gradient direction of all pixels on the edge where the edge pixel is located is obtained in the medical image. The bone edge expression degree of each edge pixel.
[0019] Furthermore, the medical image The specific calculation method of the bone edge expression degree of each edge pixel is as follows:
[0020]
[0021] In the formula, Indicates the first The degree of bone edge expression of each edge pixel; Indicates the first The edge pixel point is taken as the center point of the best size similarity window, corresponding to the The degree of bone representation of the best pixel block; Indicates the first The number of pixels in the best pixel block where the edge pixels are located; Indicates the first The maximum value of the gradient value of the pixel points in the best pixel block where the edge pixel points are located; Indicates the first The minimum value of the gradient value of the pixel points in the best pixel block where the edge pixel points are located; Indicates the first The edge pixel point is located in the best pixel block The gradient value of each pixel; Indicates the first The number of pixels on the edge where the edge pixel is located; Indicates the first The edge pixel is located on the edge The gradient direction of each pixel; Indicates the first The mean value of the gradient direction of all pixels on the edge where the edge pixel is located; Indicates the absolute value. Represents an exponential function with a natural constant as base.
[0022] Furthermore, the method of determining the final weight coefficient of each edge pixel in the medical image according to the bone edge expression degree of each edge pixel in the medical image, the number of pixels in the best pixel block where the edge pixel is located and the bone edge expression degree, and the initial weight coefficient of the edge pixel includes the following specific methods:
[0023] According to the medical image The bone edge expression degree of the edge pixel point, the The bone edge expression degree of the edge pixel in the best pixel block where the edge pixel is located, the The initial weight coefficient of the edge pixel points determines the The final weight coefficient of the edge pixels.
[0024] Furthermore, the medical image The specific calculation method of the final weight coefficient of edge pixels is:
[0025]
[0026] In the formula, Indicates the first The final weight coefficient of edge pixels; Indicates the first The initial weight coefficient of edge pixels; Indicates the first The number of pixels in the best pixel block where the edge pixels are located; Indicates the first The degree of bone edge expression of each edge pixel; Indicates the first The edge pixel point is located in the best pixel block The degree of bone edge expression of each edge pixel; Indicates the absolute value. represents an exponential function with a natural constant as base; Represents the normalization function.
[0027] Furthermore, the specific method of obtaining the pixel blocks in the medical image, the target area in the pixel blocks, the edge lines and the slope of the edge line grayscale change map includes:
[0028] Several similarity windows of non-local mean filtering algorithms of different sizes are preset, and the medical images are traversed using similarity windows of different sizes respectively. During the traversal process, the areas corresponding to similarity windows of any size are recorded as pixel blocks, and the optimal segmentation threshold of similarity windows of different sizes is obtained using the Otsu method. Several areas formed by pixels with grayscale values greater than the corresponding optimal segmentation threshold in the similarity windows are obtained and recorded as target areas. The pixels on the edge of each target area are recorded as area edge points. The pixel points with the lowest grayscale value in any target area are connected to each area edge point of the target area to obtain several line segments, which are recorded as edge lines of the target area. The direction in which the grayscale value of the pixels on the edge line increases is taken as the first direction, and a line graph is drawn with the grayscale value of the pixels in the first direction as the vertical axis and the position order of the pixels as the horizontal axis, which is recorded as the edge line grayscale change graph. The slopes of the line segments corresponding to all adjacent pixels on the grayscale change graph line are calculated, and the average of all the slopes is taken as the slope of the grayscale change graph.
[0029] An image processing system based on portable X-ray imaging, using any one of the image processing methods based on portable X-ray imaging, the system comprises the following modules:
[0030] An image acquisition module, used for acquiring medical images of patients;
[0031] The best pixel block determination module is used to obtain the pixel blocks, target areas and edge lines in the medical image, and obtain the best pixel blocks when using the non-local mean filtering algorithm to denoise the medical image according to the grayscale values of the pixels in the pixel blocks and the number of target areas and edge lines in the pixel blocks;
[0032] A weight coefficient correction module is used to obtain edge pixels and non-edge pixels, and obtain the bone edge expression degree of each edge pixel in the medical image according to the bone expression degree of the best pixel block where the edge pixel is located, the number and grayscale value of the pixels in the best pixel block where the edge pixel is located, and the number and gradient information of the pixels on the edge where the edge pixel is located, and obtain the initial weight coefficient of each pixel when the medical image is denoised using a non-local mean filtering algorithm, and determine the final weight coefficient of each edge pixel in the medical image according to the bone edge expression degree of each edge pixel in the medical image, the number and bone edge expression degree of the pixels in the best pixel block where the edge pixel is located, and the initial weight coefficient of the edge pixel;
[0033] The image processing module is used to perform denoising on the medical image using the initial weight coefficients of the non-edge pixels and the final weight coefficients of the edge pixels.
[0034] An image processing device based on portable X-ray imaging comprises a portable X-ray imaging device and a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, any one of the steps of the image processing method based on portable X-ray imaging is implemented.
[0035] The beneficial effects of the technical solution of the present invention are: obtaining the best pixel block when using a non-local mean filtering algorithm to denoise a medical image, so that the bone information displayed in the similarity window is the largest, and obtaining the degree of bone edge expression of edge pixels is helpful to determine the bone edge information displayed by the pixel points. According to the degree of bone edge expression of each edge pixel point in the medical image, the number of pixels and the degree of bone edge expression in the best pixel block where the edge pixel point is located, and the initial weight coefficient of the edge pixel point, the final weight coefficient of each edge pixel point in the medical image is determined, which can better retain the edge detail information in the medical image and improve the effect of denoising the medical image using the non-local mean filtering algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] 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 description of the prior art will be briefly introduced below. 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 creative work.
[0037] Figure 1 A flowchart of the steps of an image processing method based on portable X-ray imaging of the present invention;
[0038] Figure 2 It is a structural block diagram of an image processing system based on portable X-ray imaging of the present invention;
[0039] Figure 3 It is a structural block diagram of an image processing device based on portable X-ray imaging of the present invention;
[0040] Figure 4 Schematic diagram of medical images of patients according to the present invention. DETAILED DESCRIPTION
[0041] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the image processing method, device and system based on portable X-ray imaging proposed by the present invention, its specific implementation, structure, features and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[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 is a detailed description of a specific scheme of an image processing method, device and system based on portable X-ray imaging provided by the present invention in conjunction with the accompanying drawings.
[0044] See also Figure 1 , which shows a flowchart of an image processing method based on portable X-ray imaging provided by an embodiment of the present invention, the method comprising the following steps:
[0045] Step S001, obtaining medical images of the patient.
[0046] In order to implement the image processing method based on portable X-ray imaging proposed in this embodiment, it is first necessary to obtain a patient medical image. The specific process is as follows:
[0047] The image of the patient's affected part is collected by a portable X-ray imaging device, and the collected image is grayed and contrast enhanced to focus on displaying the bone information in the X-ray image. The processed image is recorded as the patient's medical image, such as Figure 4 Shown is a schematic diagram of a medical image of a patient.
[0048] So far, the medical image of the patient is obtained through the above method.
[0049] Step S002, obtain the pixel blocks in the medical image, the target area in the pixel blocks, the edge lines and the slope of the grayscale change map of the edge lines, and obtain the optimal pixel blocks when using the non-local mean filtering algorithm to denoise the medical image based on the grayscale values of the pixels in the pixel blocks, the target area in the pixel blocks, the number of edge lines and the slope of the grayscale change map of the edge lines.
[0050] It should be noted that portable X-ray imaging equipment projects X-rays through human body parts onto film to form X-ray images. Since different tissues of the human body have different absorption capacities for X-rays, the degree of attenuation of X-rays when passing through the human body will also vary, resulting in different grayscale differences in different tissues in medical images. The bone part appears as a higher grayscale value in the medical image, and due to different bone densities, the grayscale values of different bone areas in the medical image are also different, which is specifically manifested in that the grayscale value of each bone decreases from the edge to the center, and the grayscale contrast is high. Therefore, based on the performance characteristics of the bones in the medical image, the performance degree of the bones in similar windows of different sizes when using the non-local mean filtering algorithm can be obtained, and the optimal pixel block corresponding to the optimal size of the similar window can be determined. The optimal pixel block contains the most bone information, thereby ensuring that the non-local mean filtering algorithm is used to denoise the medical image for a better effect.
[0051] Specifically, first, several similarity windows of non-local mean filtering algorithms of different sizes are preset, and the medical images are traversed using similarity windows of different sizes respectively. During the traversal process, the areas corresponding to similarity windows of any size are recorded as pixel blocks, and the optimal segmentation threshold of similarity windows of different sizes is obtained using the Otsu method. Several areas formed by pixels with grayscale values greater than the corresponding optimal segmentation threshold in the similarity windows are obtained and recorded as target areas. The pixels on the edge of each target area are recorded as area edge points, and the pixel points with the lowest grayscale value in any target area are connected to each area edge point of the target area to obtain several line segments, which are recorded as edge lines of the target area. Since the grayscale values of different bone areas are different in medical images, and the grayscale value of each bone decreases from the edge to the center, the direction in which the grayscale value of the pixels on the edge line increases is taken as the first direction, and a line graph is drawn with the grayscale value of the pixels in the first direction as the vertical axis and the position sequence of the pixels as the horizontal axis, which is recorded as the edge line grayscale change graph.
[0052] Then, according to the similarity window size When The maximum and minimum grayscale values of all pixels in the pixel block, The number of target areas in the pixel blocks, The number of edge lines in any target area in the pixel block, The slope of the grayscale change graph of any edge line in any target area of the pixel block is obtained to obtain the similarity window size: At that time, The degree of bone expression of each pixel block.
[0053] As an embodiment, the similarity window size is At that time, The specific calculation method of the bone expression degree of a pixel block is:
[0054]
[0055] In the formula, Indicates that the similarity window size is At that time, The degree of bone expression of each pixel block; Indicates that the similarity window size is At that time, The maximum value of the grayscale value of all pixels in a pixel block; Indicates that the similarity window size is At that time, The minimum gray value of all pixels in a pixel block; Indicates that the similarity window size is At that time, The number of target areas in a pixel block; Indicates that the similarity window size is At that time, The number of edge lines in a pixel block; Indicates that the similarity window size is At that time, Pixel block In the target area The slope of the grayscale change graph of the edge connection line; Indicates absolute value.
[0056] The specific method for obtaining the slope of the edge line grayscale change map is: calculating the slopes of all line segments corresponding to two or more adjacent pixel points on the grayscale change map polyline, and taking the average of all the slopes as the slope of the grayscale change map.
[0057] It should be noted that the degree of bone expression is used to describe the bone information shown in the similarity window. When the size of the similarity window is the optimal size, the bone information shown in the similarity window is the most, thereby ensuring the best effect of denoising the medical image using the non-local mean filtering algorithm. Indicates that the similarity window size is At that time, The grayscale contrast of a pixel block, The larger the value, the smaller the similarity window size. At that time, The lower the grayscale consistency of the pixels in a pixel block, the more consistent it is with the grayscale value change characteristics of the bone area in the medical image. The higher the degree of bone expression of the pixel block, Indicates that the similarity window size is At that time, The gradient of the grayscale values of all pixels on the edge lines of all target areas in the pixel block, i.e. The grayscale change of each pixel block, The larger the value, the smaller the similarity window size. At that time, The greater the gradient of the grayscale values of the pixels on all edge lines in all target areas in the pixel block, that is, the grayscale values of the pixels on all edge lines are increasing, the more consistent with the change characteristics of the grayscale value increasing from the center to the edge of the bone area in the medical image. The higher the pixel block, the higher the bone expression.
[0058] It should be noted that, in this embodiment, the size of the search box when using the non-local mean filtering algorithm to denoise medical images is preset based on experience. , similar to the size of the window The value of For odd numbers in the range, the size of the search box can be set according to actual conditions and is not specifically limited in this embodiment.
[0059] The above formula can be used to obtain the degree of bone expression of each pixel block when the similarity window is of any size. The average of the bone expression degrees of each pixel block under the similarity window of any size can be used to obtain the degree of bone expression under the similarity window of any size. The similarity window size when the bone expression degree is the largest is taken as the optimal size of the similarity window, and several pixel blocks corresponding to the similarity window of the optimal size are recorded as the optimal pixel blocks.
[0060] It should be noted that the Otsu method is a prior art and will not be described in detail here.
[0061] So far, the optimal pixel block for medical image denoising using the non-local mean filtering algorithm is obtained through the above method.
[0062] Step S003, obtain edge pixels and non-edge pixels in the medical image, obtain the bone edge expression degree of each edge pixel in the medical image according to the bone expression degree of the best pixel block where the edge pixel is located, the number and grayscale value of the pixels in the best pixel block where the edge pixel is located, and the number and gradient information of the pixels on the edge where the edge pixel is located, obtain the initial weight coefficient of each pixel when denoising the medical image using the non-local mean filtering algorithm, and determine the final weight coefficient of each edge pixel in the medical image according to the bone edge expression degree of each edge pixel in the medical image, the number and bone edge expression degree of the pixels in the best pixel block where the edge pixel is located, and the initial weight coefficient of the edge pixel.
[0063] It should be noted that doctors mainly judge the severity of the patient's condition or recovery status through the edge details of the bones in medical images. However, when using the non-mean filtering algorithm to denoise medical images, the weight coefficient determined by the Gaussian weighted distance has certain limitations, resulting in poor denoising effect on the edge area of the bone. Therefore, when using the non-mean filtering algorithm to denoise medical images, it is necessary to correct the weight coefficient of the edge pixels of the bone area and assign a higher weight to the edge pixels of the bone area.
[0064] Step (3.1), obtain edge pixels and non-edge pixels, and obtain the bone edge expression degree of each edge pixel in the medical image based on the bone expression degree of the best pixel block where the edge pixel is located, the number and grayscale value of the pixels in the best pixel block where the edge pixel is located, and the number and gradient information of the pixels on the edge where the edge pixel is located.
[0065] It should be noted that when doctors judge the severity of a patient's condition or recovery, the most important part is the bone fracture area of the injury. In order to improve the denoising effect of the bone fracture area, the weights of the edge pixels in the bone fracture area are corrected. It is necessary to obtain the bone edge expression degree of each edge pixel on the medical image, that is, the bone edge information expressed by the edge pixel. The pixel points in the bone fracture area must be located in the bone area. The greater the bone expression degree of the best pixel block where any pixel is located, the higher the possibility that the pixel point is located at the edge of the bone fracture area, and the greater the bone edge expression degree. At the same time, the pixel gradient contrast at the edge of the bone fracture area is higher, while the pixel gradient contrast at the edge of the human tissue area is lower. Therefore, when the gradient contrast of the pixel point in the pixel block is higher, the higher the bone edge expression degree. In addition, some edges of the bone fracture area are straight and smoother. Therefore, when the smoothness of the edge where the pixel point is located is higher, the greater the bone edge expression degree, that is, the greater the possibility that the pixel point belongs to the edge of the bone fracture area.
[0066] First, canny edge detection is performed on each optimal pixel block to obtain a number of edge pixels, and the pixels other than edge pixels in the medical image are recorded as non-edge pixels.
[0067] It should be noted that canny edge detection is an existing technology and will not be described in detail here.
[0068] Then, according to the medical image The bone expression degree of the best pixel block corresponding to the edge pixel point as the center point of the best size similarity window, The number of pixels in the best pixel block where the edge pixel is located, The maximum and minimum values of the pixel gradient values in the best pixel block where the edge pixel is located, The gradient value of the pixel in the best pixel block where the edge pixel is located, The number of pixels on the edge where the edge pixel is located, The gradient direction of the pixel on the edge where the edge pixel is located, The mean value of the gradient direction of all pixels on the edge where the edge pixel is located is obtained in the medical image. The bone edge expression degree of each edge pixel.
[0069] As an embodiment, the first The specific calculation method of the bone edge expression degree of each edge pixel is as follows:
[0070]
[0071] In the formula, Indicates the first The degree of bone edge expression of each edge pixel; Indicates the first The edge pixel point is taken as the center point of the best size similarity window, corresponding to the The degree of bone representation of the best pixel block; Indicates the first The number of pixels in the best pixel block where the edge pixels are located; Indicates the first The maximum value of the gradient value of the pixel points in the best pixel block where the edge pixel points are located; Indicates the first The minimum value of the gradient value of the pixel points in the best pixel block where the edge pixel points are located; Indicates the first The edge pixel point is located in the best pixel block The gradient value of each pixel; Indicates the first The number of pixels on the edge where the edge pixel is located; Indicates the first The edge pixel is located on the edge The gradient direction of each pixel; Indicates the first The mean value of the gradient direction of all pixels on the edge where the edge pixel is located; Indicates the absolute value. Represents an exponential function with a natural constant as base.
[0072] It should be noted that the bone edge expression degree is used to express the bone edge information expressed by the pixel points. Indicates the first The pixel is located at The best pixel block in the medical image has a good bone representation degree. The pixel points in the bone fracture area must be located in the bone area. The greater the degree of bone expression of the best pixel block where the edge pixel point is located, that is, The larger the value, the The more likely the edge pixel is a pixel on the bone, the The premise is that the edge pixel points are bone edge pixel points, and the bone edge pixel points refer to the pixel points located at the edge of the bone; Indicates the first The gradient contrast of the pixels in the best pixel block where the edge pixels are located, The larger the value, the The higher the gradient contrast of the pixels in the optimal pixel block where the edge pixel is located, the The higher the bone edge expression level of the edge pixels, Indicates the first The smoothness of the edge where the edge pixel is located, The smaller the value, the The higher the consistency of the gradient direction of the pixels on the edge where the edge pixels are located, the The greater the possibility that the edge where the edge pixel is located is a smooth straight line, the The more pixels on the edge, the higher the bone edge expression.
[0073] Step (3.2) is to obtain the initial weight coefficient of each pixel when the medical image is denoised using the non-local mean filtering algorithm, and determine the final weight coefficient of each edge pixel in the medical image based on the bone edge expression level of each edge pixel in the medical image, the number of pixels and the bone edge expression level in the best pixel block where the edge pixel is located, and the initial weight coefficient of the edge pixel.
[0074] It should be noted that when correcting the initial weight coefficient of each edge pixel, it is necessary to make corrections based on the degree of bone edge expression of the edge pixel, and assign higher weights to edge pixels with high similarity in bone edge expression, to ensure that when the non-local mean filtering algorithm is used to denoise the medical image, the detailed features of the bone fracture edge area in the medical image can be better maintained.
[0075] When using the non-local mean filtering algorithm to denoise medical images, the weight coefficient of each pixel is obtained, recorded as the initial weight coefficient, according to the first The bone edge expression degree of the edge pixel point, the The bone edge expression degree of the edge pixel in the best pixel block where the edge pixel is located, the The initial weight coefficient of the edge pixel points determines the The final weight coefficient of the edge pixels.
[0076] As an embodiment, the first The specific calculation method of the final weight coefficient of edge pixels is:
[0077]
[0078] In the formula, Indicates the first The final weight coefficient of edge pixels; Indicates the first The initial weight coefficient of edge pixels; Indicates the first The number of pixels in the best pixel block where the edge pixels are located; Indicates the first The degree of bone edge expression of each edge pixel; Indicates the first The edge pixel point is located in the best pixel block The degree of bone edge expression of each edge pixel; Indicates the absolute value. represents an exponential function with a natural constant as base; Represents the normalization function.
[0079] It should be noted that Indicates the first The edge pixel point and the optimal pixel block where it is located The difference in the degree of bone edge expression of each pixel, The larger the value, the more The edge pixel point and the optimal pixel block where it is located The smaller the difference in the bone edge expression of each pixel, the Therefore, in order to effectively adjust the initial weight coefficient of the edge pixel points in the medical image, this embodiment chooses to use a normalization function to The value is normalized to Within the range, the adjustment result of the initial weight coefficient of the edge pixels is improved.
[0080] At this point, the bone edge expression level of each edge pixel in the medical image is obtained through the above method.
[0081] Step S004, using the initial weight coefficients of non-edge pixels and the final weight coefficients of edge pixels to perform denoising on the medical image.
[0082] The initial weights of non-edge pixels in the medical image are kept unchanged, and the final weight coefficient of each edge pixel is used as the weight of the pixel when the medical image is denoised using the non-local mean filtering algorithm. The medical image is filtered in combination with the non-local mean filtering algorithm to obtain a processed result image.
[0083] Through the above steps, the denoising process of medical images is completed.
[0084] Second, see Figure 2 , which shows an image processing system based on portable X-ray imaging, the system includes the following modules:
[0085] An image acquisition module, used for acquiring medical images of patients;
[0086] The module for determining the best pixel block is used to obtain the pixel blocks, target areas, edge lines and the slope of the grayscale change map of the edge lines in the medical image, and to obtain the best pixel block for denoising the medical image using the non-local mean filtering algorithm according to the grayscale value of the pixel points in the pixel block, the target areas in the pixel block, the number of edge lines and the slope of the grayscale change map of the edge lines;
[0087] A weight coefficient correction module is used to obtain edge pixels and non-edge pixels, and obtain the bone edge expression degree of each edge pixel in the medical image according to the bone expression degree of the best pixel block where the edge pixel is located, the number and grayscale value of the pixels in the best pixel block where the edge pixel is located, and the number and gradient information of the pixels on the edge where the edge pixel is located, and obtain the initial weight coefficient of each pixel when the medical image is denoised using a non-local mean filtering algorithm, and determine the final weight coefficient of each edge pixel in the medical image according to the bone edge expression degree of each edge pixel in the medical image, the number and bone edge expression degree of the pixels in the best pixel block where the edge pixel is located, and the initial weight coefficient of the edge pixel;
[0088] The image processing module is used to perform denoising on the medical image using the initial weight coefficients of the non-edge pixels and the final weight coefficients of the edge pixels to obtain a processed result image.
[0089] Third, see Figure 3 The present invention also proposes an image processing device based on portable X-ray imaging, which includes a portable X-ray imaging device and a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the method described in steps S001 to S004 are implemented.
[0090] This embodiment obtains the best pixel block when using the non-local mean filtering algorithm to denoise the medical image, so that the bone information displayed in the similarity window is the largest, and the degree of bone edge expression of the edge pixel points is obtained, which is helpful to determine the bone edge information displayed by the pixel points. The final weight coefficient of each edge pixel point in the medical image is determined according to the degree of bone edge expression of each edge pixel point in the medical image, the number of pixels and the degree of bone edge expression in the best pixel block where the edge pixel point is located, and the initial weight coefficient of the edge pixel point. This can better retain the edge detail information in the medical image and improve the effect of denoising the medical image using the non-local mean filtering algorithm.
[0091] It should be noted that the The model is only used to represent negative correlation and constrain the output of the model to be in In the specific implementation, it can be replaced by other models with the same purpose. This embodiment is only based on The model is described as an example without any specific limitation. is the input to the model.
[0092] 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 protection scope of the present invention.
Claims
1. An image processing method based on portable X-ray imaging, characterized in that: The method comprises the following steps: Obtain medical images of patients; Obtain pixel blocks, target areas, edge lines and slopes of grayscale change graphs of edge lines in the medical image, and obtain the best pixel blocks for medical image denoising using a non-local mean filtering algorithm according to the grayscale values of pixels in the pixel blocks, the target areas in the pixel blocks, the number of edge lines and the slopes of the grayscale change graphs of edge lines; Obtain edge pixels and non-edge pixels in the medical image, obtain the bone edge expression degree of each edge pixel in the medical image according to the bone expression degree of the best pixel block where the edge pixel is located, the number and grayscale value of the pixels in the best pixel block where the edge pixel is located, and the number and gradient information of the pixels on the edge where the edge pixel is located, obtain the initial weight coefficient of each pixel when the medical image is denoised using a non-local mean filtering algorithm, and determine the final weight coefficient of each edge pixel in the medical image according to the bone edge expression degree of each edge pixel in the medical image, the number and bone edge expression degree of the pixels in the best pixel block where the edge pixel is located, and the initial weight coefficient of the edge pixel; The medical image is denoised using the initial weight coefficients of the non-edge pixels and the final weight coefficients of the edge pixels to obtain a processed result image.
2. The image processing method based on portable X-ray imaging according to claim 1, characterized in that: The method of obtaining the best pixel block for medical image denoising using the non-local mean filtering algorithm according to the grayscale value of the pixel point in the pixel block, the target area in the pixel block, the number of edge lines and the slope of the edge line grayscale change graph includes the following specific methods: According to the non-local mean filtering algorithm, the similarity window size is When The gray value of the pixel in the pixel block, The target area in the pixel block, The number of edge connections in the pixel block, The slope of the grayscale change graph of the edge connection line of the pixel block is used to obtain the similarity window size: At that time, The degree of bone expression of each pixel block; When the similarity window is obtained as any size, the bone expression degree corresponding to each pixel block is averaged under the similarity window of any size to obtain the bone expression degree under the similarity window of any size. The similarity window size when the bone expression degree is the largest is taken as the optimal size of the similarity window, and several pixel blocks corresponding to the similarity window of the optimal size are recorded as the optimal pixel blocks.
3. The image processing method based on portable X-ray imaging according to claim 2, characterized in that: The similarity window size is At that time, The specific calculation method of the bone expression degree of a pixel block is: In the formula, Indicates that the similarity window size is At that time, The degree of bone expression of each pixel block; Indicates that the similarity window size is At that time, The maximum value of the grayscale value of all pixels in a pixel block; Indicates that the similarity window size is At that time, The minimum gray value of all pixels in a pixel block; Indicates that the similarity window size is At that time, The number of target areas in a pixel block; Indicates that the similarity window size is At that time, The number of edge lines in a pixel block; Indicates that the similarity window size is At that time, Pixel block In the target area The slope of the grayscale change graph of the edge connection line; Indicates finding the absolute value.
4. The image processing method based on portable X-ray imaging according to claim 1, characterized in that: The bone margin expression degree of each edge pixel in the medical image is obtained according to the bone expression degree of the best pixel block where the edge pixel is located, the number and grayscale value of the pixels in the best pixel block where the edge pixel is located, and the number and gradient information of the pixels on the edge where the edge pixel is located, including the specific method of: According to the medical image The bone expression degree of the best pixel block corresponding to the edge pixel point as the center point of the best size similarity window, The number of pixels in the best pixel block where the edge pixel is located, The maximum and minimum values of the pixel gradient values in the best pixel block where the edge pixel is located, The gradient value of the pixel in the best pixel block where the edge pixel is located, The number of pixels on the edge where the edge pixel is located, The gradient direction of the pixel on the edge where the edge pixel is located, The mean value of the gradient direction of all pixels on the edge where the edge pixel is located is obtained in the medical image. The bone edge expression degree of each edge pixel.
5. The image processing method based on portable X-ray imaging according to claim 4, characterized in that: The medical image The specific calculation method of the bone edge expression degree of each edge pixel is as follows: In the formula, Indicates the first The degree of bone edge expression of each edge pixel; Indicates the first The edge pixel point is taken as the center point of the best size similarity window, corresponding to the The degree of bone representation of the best pixel block; Indicates the first The number of pixels in the best pixel block where the edge pixels are located; Indicates the first The maximum value of the gradient value of the pixel points in the best pixel block where the edge pixel points are located; Indicates the first The minimum value of the gradient value of the pixel points in the best pixel block where the edge pixel points are located; Indicates the first The edge pixel point is located in the best pixel block The gradient value of each pixel; Indicates the first The number of pixels on the edge where the edge pixel is located; Indicates the first The edge pixel is located on the edge The gradient direction of each pixel; Indicates the first The mean value of the gradient direction of all pixels on the edge where the edge pixel is located; Indicates the absolute value. Represents an exponential function with a natural constant as base.
6. The image processing method based on portable X-ray imaging according to claim 1, characterized in that: The method of determining the final weight coefficient of each edge pixel in the medical image according to the bone edge expression degree of each edge pixel in the medical image, the number of pixels in the best pixel block where the edge pixel is located and the bone edge expression degree, and the initial weight coefficient of the edge pixel includes: According to the medical image The bone edge expression degree of the edge pixel point, the The bone edge expression degree of the edge pixel in the best pixel block where the edge pixel is located, the The initial weight coefficient of the edge pixel points determines the The final weight coefficient of the edge pixels.
7. The image processing method based on portable X-ray imaging according to claim 6, characterized in that: The medical image The specific calculation method of the final weight coefficient of edge pixels is: In the formula, Indicates the first The final weight coefficient of edge pixels; Indicates the first The initial weight coefficient of edge pixels; Indicates the first The number of pixels in the best pixel block where the edge pixels are located; Indicates the first The degree of bone edge expression of each edge pixel; Indicates the first The edge pixel point is located in the best pixel block The degree of bone edge expression of each edge pixel; Indicates the absolute value. represents an exponential function with a natural constant as base; Represents the normalization function.
8. The image processing method based on portable X-ray imaging according to claim 1, characterized in that: The specific method of obtaining the pixel blocks in the medical image, the target area in the pixel blocks, the edge lines and the slope of the edge line grayscale change map includes: Several similarity windows of non-local mean filtering algorithms of different sizes are preset, and the medical images are traversed using similarity windows of different sizes respectively. During the traversal process, the areas corresponding to similarity windows of any size are recorded as pixel blocks, and the optimal segmentation threshold of similarity windows of different sizes is obtained using the Otsu method. Several areas formed by pixels with grayscale values greater than the corresponding optimal segmentation threshold in the similarity windows are obtained and recorded as target areas. The pixels on the edge of each target area are recorded as area edge points. The pixel points with the lowest grayscale value in any target area are connected to each area edge point of the target area to obtain several line segments, which are recorded as edge lines of the target area. The direction in which the grayscale value of the pixels on the edge line increases is taken as the first direction, and a line graph is drawn with the grayscale value of the pixels in the first direction as the vertical axis and the position order of the pixels as the horizontal axis, which is recorded as the edge line grayscale change graph. The slopes of the line segments corresponding to all two adjacent pixels on the grayscale change graph line are calculated, and the average of all the slopes is taken as the slope of the grayscale change graph.
9. An image processing system based on portable X-ray imaging, using an image processing method based on portable X-ray imaging as claimed in any one of claims 1 to 8, characterized in that: The system includes the following modules: An image acquisition module, used for acquiring medical images of patients; The best pixel block determination module is used to obtain the pixel blocks, target areas and edge lines in the medical image, and obtain the best pixel blocks when using the non-local mean filtering algorithm to denoise the medical image according to the grayscale values of the pixels in the pixel blocks and the number of target areas and edge lines in the pixel blocks; A weight coefficient correction module is used to obtain edge pixels and non-edge pixels, and obtain the bone edge expression degree of each edge pixel in the medical image according to the bone expression degree of the best pixel block where the edge pixel is located, the number and grayscale value of the pixels in the best pixel block where the edge pixel is located, and the number and gradient information of the pixels on the edge where the edge pixel is located, and obtain the initial weight coefficient of each pixel when the medical image is denoised using a non-local mean filtering algorithm, and determine the final weight coefficient of each edge pixel in the medical image according to the bone edge expression degree of each edge pixel in the medical image, the number and bone edge expression degree of the pixels in the best pixel block where the edge pixel is located, and the initial weight coefficient of the edge pixel; The image processing module is used to perform denoising on the medical image using the initial weight coefficients of the non-edge pixels and the final weight coefficients of the edge pixels.
10. An image processing device based on portable X-ray imaging, comprising a portable X-ray imaging device, a memory contained in the portable X-ray imaging device, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.
