Digestive tract endoscope image adaptive enhancement method and system

By collecting multiple images of the digestive tract ultrasonic endoscopic image, performing grayscale processing and filtering the pixel points grouping in the window, calculating the pixel point weight and enhancing the image, the problem of blurred image details in the prior art is solved, and clearer images and more accurate diagnosis are achieved.

CN119991454AActive Publication Date: 2025-05-13西安国际医学中心有限公司
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510465212.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-15
Publication Date
2025-05-13
Estimated Expiration
2045-04-15

AI Technical Summary

Technical Problem

Existing weighted local mean filtering methods may blur the details of the digestive tract ultrasound endoscopic images during noise reduction, especially at the junction of the normal tissue echo level and the lesion area of ​​the digestive tract wall.

Method used

By collecting multiple ultrasonic endoscopic images of the same position and angle, performing grayscale processing and grouping of pixel points in the filter window, obtaining the packet threshold, probability parameters and fluctuation coefficient of each filter window, computing the weight of each pixel point, and enhancing the image based on these weights.

Benefits of technology

The detailed information of the digestive tract ultrasound endoscopic image is effectively retained, especially at the junction of the echo hierarchy, which improves the clarity and diagnostic value of the image and reduces the impact of noise on image quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119991454A_ABST
    Figure CN119991454A_ABST
Patent Text Reader

Abstract

The invention relates to the field of image processing, in particular to a digestive tract endoscope image adaptive enhancement method and system, and the method comprises the steps: collecting a plurality of ultrasonic endoscope images, carrying out the graying, and carrying out the traversal, thereby obtaining a preprocessed image; dividing pixel points into two groups according to pixel point gray scale distribution of a filtering window in the preprocessed image; obtaining a probability parameter of a filtering window according to the gray value distribution difference of the two groups of pixel points; acquiring a fluctuation coefficient of each pixel point according to the fluctuation of the pixel points in the filtering windows of the same sequence of the different preprocessed images; and obtaining the weight of each pixel point in each filtering window by combining the parameters, the coefficients and the grouping information, and enhancing the image according to the weight of the pixel point. According to the method, the edges of different echo levels in the digestive tract endoscope image are clearer, and the focus area is prevented from being excessively smoothed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image enhancement, and in particular to a method and system for adaptively enhancing digestive tract endoscope images. Background Art

[0002] Ultrasound endoscopy is a digestive tract inspection technology that combines endoscopy and ultrasound. When the ultrasound endoscope is inserted into the body cavity, it can not only observe the surface mucosa of the digestive tract like a normal endoscope, but also use endoscopic ultrasound for real-time scanning to obtain the histological characteristics of the hierarchical structure of the gastrointestinal tract, and some submucosal lesions can be observed. The noise reduction of the digestive tract ultrasound endoscopy images is mainly to improve the image quality and reduce interference factors, thereby assisting doctors in making more accurate diagnoses; through enhanced processing, the noise and blur in the image can be removed, making the digestive tract ultrasound endoscopy images clearer, which helps doctors observe and analyze lesions more accurately.

[0003] The weighted local mean filtering method can be used to enhance the gastrointestinal ultrasound endoscopic images. Its advantage is that it can retain more image details while smoothing noise, thereby improving image quality. It is widely used for image enhancement in various scenarios. The weighting method of the weighted local mean filtering method is generally based on the distance principle and the gray value difference principle. In the process of noise reduction, the detailed information of the gastrointestinal ultrasound endoscopic images may be blurred. Because the normal tissue of the gastrointestinal wall usually presents a specific echo layer in the ultrasound endoscopic image, it is very important to retain clearly visible layers and edge information. These layers are of great diagnostic value to doctors. The echo layers in the lesion area may be more disordered, or the dividing line may disappear. These situations may be over-smoothed, making the morphology and boundaries of the lesion area difficult to confirm. Summary of the invention

[0004] The present invention provides a method and system for adaptively enhancing digestive tract endoscope images to solve the existing problem that the weighted method of the weighted local mean filtering method may blur the detailed information of the digestive tract ultrasonic endoscope image during the noise reduction process.

[0005] The method and system for adaptively enhancing digestive tract endoscope images of the present invention adopt the following technical solutions: In a first aspect, the present invention provides a method for adaptively enhancing a digestive tract endoscope image, the method comprising the following steps: Collect multiple endoscopic ultrasound images at the same position and angle and grayscale the images, traverse the grayscale images in the order of collecting endoscopic ultrasound images, and obtain each pre-processed image; According to the gray value distribution trend of the pixels in each filter window in each preprocessed image, the grouping threshold of each filter window in each preprocessed image is obtained and the pixels in the filter window are divided into two groups; according to the gray value distribution difference of the two groups of grouped pixels in each filter window in each preprocessed image, the probability parameter of each filter window in each preprocessed image is obtained; according to the fluctuation amplitude of the pixels in the filter window of the same sequence of each preprocessed image, the fluctuation coefficient of each pixel in each filter window of each preprocessed image is obtained; according to the grouping of the pixels in each filter window in each preprocessed image, the probability parameter of each filter window in each preprocessed image, and the fluctuation coefficient of each pixel in each filter window of each preprocessed image, the weight of each pixel in each filter window in each preprocessed image is obtained; Each preprocessed image is enhanced according to the weight of each pixel in each filter window in each preprocessed image.

[0006] Furthermore, the method of acquiring multiple ultrasonic endoscopic images of the same position and angle and graying the images, traversing the grayscale images in the order of acquiring the ultrasonic endoscopic images, and obtaining each pre-processed image includes the following specific methods: While keeping the position and angle of the ultrasound probe consistent in the digestive tract, an ultrasound endoscopic image is collected every s seconds, and a total of n ultrasound endoscopic images are collected. The n collected ultrasound endoscopic images are gray-scaled to obtain n grayscale images. The n grayscale images are traversed in the order of corresponding ultrasound endoscopic image acquisition, and each grayscale image after traversal is recorded as a preprocessed image.

[0007] Furthermore, the method of obtaining the grouping threshold of each filter window in each preprocessed image and dividing the pixels in the filter window into two groups according to the gray value distribution trend of the pixels in each filter window in each preprocessed image includes the following specific methods: Set the dynamic threshold of the e-th filter window in the p-th preprocessed image. The dynamic threshold of the e-th filter window in the p-th preprocessed image is recorded as ,The range of dynamic threshold is 1~254, and the method of calculating the grouping coefficient of the filter window pixels is as follows: ; In the formula, represents the grouping coefficient of the e-th filter window in the p-th preprocessed image, Indicates that all gray values ​​in the e-th filter window in the p-th preprocessed image are less than or equal to the dynamic threshold The gray value variance of the pixel point is Indicates that all gray values ​​in the e-th filter window in the p-th preprocessed image are greater than the dynamic threshold The gray value variance of the pixel points; Calculate the grouping coefficient under different dynamic thresholds The size of the dynamic threshold corresponding to the maximum grouping coefficient As the grouping threshold of the pixels in the e-th filter window in the p-th preprocessed image, the grouping threshold is recorded as , all pixels whose grayscale values ​​in the e-th filtering window in the p-th preprocessed image are less than or equal to the grouping threshold are the first group of pixels, and all pixels whose grayscale values ​​in the e-th filtering window in the p-th preprocessed image are greater than the grouping threshold are the second group of pixels. According to the above method, the grouping threshold of each filtering window in each preprocessed image is obtained and the pixels in each filtering window are divided into two categories.

[0008] Furthermore, the probability parameter of each filtering window in each preprocessed image is obtained according to the gray value distribution difference of two groups of pixels grouped in each filtering window in each preprocessed image, including the specific method of: ; In the formula, represents the probability parameter of the e-th filter window in the p-th preprocessed image, Indicates that in the e-th filter window of the p-th preprocessed image, all gray values ​​are greater than the grouping threshold The mean gray value of the pixel points; Indicates that in the e-th filter window of the p-th preprocessed image, all gray values ​​are less than or equal to the grouping threshold The mean gray value of the pixel points; Indicates that in the e-th filter window of the p-th preprocessed image, all gray values ​​are greater than the grouping threshold The gray value of the pixel with the largest gray value among the pixels; Indicates the grouping threshold of all gray values ​​in the e-th filter window in the p-th preprocessed image that are less than or equal to the e-th filter window The grayscale value of the pixel with the smallest grayscale value among the pixels; the probability parameter of each filtering window is obtained according to the above method.

[0009] Furthermore, the method of obtaining the fluctuation coefficient of each pixel in each filter window of each preprocessed image according to the fluctuation amplitude of the pixel in the filter window of the same sequence of each preprocessed image includes the following specific methods: ; In the formula, represents the fluctuation coefficient of the rth pixel point in the eth filtering window in the pth preprocessed image, n represents the number of collected endoscopic ultrasound images, represents the gray value of the rth pixel in the eth filter window in the i-th preprocessed image, Represents the mean gray value of the rth pixel in the eth filtering window in each preprocessed image, and obtains the fluctuation coefficient of each pixel in each filtering window of each preprocessed image according to the above method.

[0010] Furthermore, the method of obtaining the weight of each pixel in each filtering window in each preprocessed image according to the grouping of pixels in each filtering window in each preprocessed image, the probability parameter of each filtering window in each preprocessed image, and the fluctuation coefficient of each pixel in each filtering window in each preprocessed image includes the following specific methods: First, determine whether the central pixel of the e-th filter window in the p-th preprocessed image belongs to the first group of pixels in the filter window or the second group of pixels; If the central pixel of the e-th filter window in the p-th preprocessed image belongs to the first group of pixels in the filter window, then: ; If the central pixel of the e-th filter window in the p-th preprocessed image belongs to the second group of pixels in the filter window, then: ; In the formula, represents the weight of the rth pixel in the eth filter window in the pth preprocessed image, represents the probability parameter of the e-th filter window in the p-th preprocessed image, represents the fluctuation coefficient of the rth pixel in the eth filter window in the pth preprocessed image, Represents the grayscale value of the central pixel of the e-th filter window in the p-th preprocessed image, Represents the grayscale value of the rth pixel in the eth filtering window in the pth preprocessed image; according to the above method, the weight of each pixel in each filtering window in each preprocessed image is obtained.

[0011] Furthermore, the method of enhancing each preprocessed image according to the weight of each pixel in each filter window in each preprocessed image includes the following specific methods: ; In the formula, represents the enhanced grayscale value of the rth pixel in the eth filtering window in the pth preprocessed image, represents the weight of the K-th pixel in the e-th filter window in the p-th preprocessed image, represents the gray value of the K-th pixel in the e-th filter window in the p-th preprocessed image, represents the weight of the jth pixel in the eth filter window in the pth preprocessed image, M represents the number of pixels in the filter window, and the enhanced grayscale value of each pixel in each filter window of each preprocessed image is obtained according to the above method to complete the enhancement of each preprocessed image.

[0012] A second aspect of the present invention provides a digestive tract endoscope image adaptive enhancement system, the system comprising an image acquisition module, a weight calculation module and an image enhancement module, wherein: An image acquisition module is used to acquire multiple ultrasonic endoscopic images of the same position and angle and grayscale the images, traverse the grayscale images in the order of acquiring the ultrasonic endoscopic images, and acquire each pre-processed image; A weight calculation module is used to obtain the grouping threshold of each filter window in each preprocessed image and divide the pixels in the filter window into two groups according to the gray value distribution trend of the pixels in each filter window in each preprocessed image; obtain the probability parameter of each filter window in each preprocessed image according to the gray value distribution difference between the two groups of pixel points in each filter window after grouping in each preprocessed image; obtain the fluctuation coefficient of each pixel point in each filter window of each preprocessed image according to the fluctuation amplitude of the pixel points in the filter window of the same sequence of each preprocessed image; obtain the weight of each pixel point in each filter window in each preprocessed image according to the grouping of the pixel points in each filter window in each preprocessed image, the probability parameter of each filter window in each preprocessed image, and the fluctuation coefficient of each pixel point in each filter window of each preprocessed image; The image enhancement module is used to enhance each preprocessed image according to the weight of each pixel in each filter window in each preprocessed image.

[0013] A third aspect of the present invention is a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the above-mentioned method for adaptively enhancing gastrointestinal endoscopic images.

[0014] A fourth aspect of the present invention is a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned method for adaptively enhancing gastrointestinal endoscopic images when executing the computer program.

[0015] The technical solution of the present invention has the following beneficial effects: multiple ultrasonic endoscopic images of the same position and angle are collected and grayscaled, and the grayscale images are traversed in the order of collecting ultrasonic endoscopic images to obtain each preprocessed image; although the noise in the ultrasonic endoscopic image is similar to the grayscale distribution characteristics of the pixels in the lesion area, the noise is random and accidental, so collecting multiple ultrasonic endoscopic images of the same position and angle can distinguish the noise pixels and the pixels in the lesion area to a certain extent, which is convenient for weighting the noise pixels and the pixels in the lesion area in the subsequent weighting process; According to the gray value distribution trend of the pixels in each filter window in each preprocessed image, the grouping threshold of each filter window in each preprocessed image is obtained and the pixels in the filter window are divided into two groups; in the ultrasonic endoscopic image, the normal tissue of the wall of the digestive tract will show clear echo levels, and the pixel gray values ​​between these levels are obviously different. The pixels in the filter window are divided into two categories with the greatest difference, so as to facilitate the subsequent determination of the relative probability that the filter window is located at the junction of adjacent echo levels by judging the difference and regularity of the pixel gray value distribution of the two categories of pixels, and then select different weighting modes for the pixels in the filter window according to different probabilities; According to the gray value distribution difference of the two groups of pixels in each filter window in each preprocessed image, the probability parameter of each filter window in each preprocessed image is obtained; according to the characteristics of the two types of pixels in different groups, the relative probability of the window being located at the junction of adjacent echo layers is judged. When the relative probability is high, the enhancement effect should focus on strengthening the information at the junction, and when the relative probability is low, the enhancement effect should focus on noise reduction; According to the fluctuation amplitude of the pixel points in the filter window of the same sequence of each preprocessed image, the fluctuation coefficient of each pixel point in each filter window of each preprocessed image is obtained; through the fluctuation of the pixel points at the same position of different images, the noise pixels can be screened out to a certain extent to avoid the gray value distribution characteristics of the pixel points in the lesion area being too close to the gray value distribution characteristics of the noise pixel points, resulting in excessive smoothing of the noise area; According to the grouping of pixels in each filter window in each preprocessed image, the probability parameter of each filter window in each preprocessed image, and the fluctuation coefficient of each pixel in each filter window in each preprocessed image, the weight of each pixel in each filter window in each preprocessed image is obtained; in combination with the above-obtained parameters and grouping, it is determined to which echo level the pixel to be enhanced belongs, and according to the pixel grouping to which the pixel to be enhanced belongs, the enhanced features of the pixel to be enhanced are made closer to the grayscale gradient features of the pixels in the pixel group to which it belongs, and in combination with the fluctuation amplitude of the pixel, the weight of the noise pixel is reduced, thereby reducing the influence of the noise pixel on the enhancement effect; Each preprocessed image is enhanced according to the weight of each pixel in each filter window in each preprocessed image; different weight ratios are respectively applied to high and low pixels in the filter window. Under this weight ratio, when the features of the junction of adjacent echo layers are more obvious, the junction is made clearer, and when the features of the junction of adjacent echo layers are not obvious, the influence of noise on image quality is reduced. The reduction of the influence of noise on image quality is judged based on multiple images at the same angle position, which can effectively avoid the disordered arrangement of pixels in the lesion area and prevent them from being misclassified as noise pixels, and avoid excessive smoothing of the lesion area. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0017] Figure 1 A flowchart of the steps of a method for adaptively enhancing a digestive tract endoscope image according to the present invention; Figure 2 The present invention is a structural block diagram of a digestive tract endoscope image adaptive enhancement system. DETAILED DESCRIPTION

[0018] 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 a method and system for adaptive enhancement of digestive tract endoscope images 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.

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

[0020] The specific scheme of the gastrointestinal endoscope image adaptive enhancement method and system provided by the present invention is described in detail below with reference to the accompanying drawings.

[0021] See also Figure 1 , which shows the first object of the present invention, a flowchart of a method for adaptively enhancing a digestive tract endoscope image, the method comprising the following steps: Step S001: Acquire multiple ultrasonic endoscopic images of the same position and angle and grayscale the images, traverse the grayscale images in the order of acquiring the ultrasonic endoscopic images, and obtain each pre-processed image.

[0022] It should be noted that although the noise in the ultrasonic endoscopic image is similar to the grayscale distribution characteristics of the pixels in the lesion area, the noise is random and accidental, so collecting multiple ultrasonic endoscopic images at the same position and angle can distinguish the noise pixels and the pixels in the lesion area to a certain extent; this step requires presetting the number of ultrasonic endoscopic images collected n and the ultrasonic endoscopic image collection time interval s. In this embodiment, the number of ultrasonic endoscopic images collected n=20, and the ultrasonic endoscopic image collection time interval s=0.02 seconds. This embodiment does not specifically limit the number of ultrasonic endoscopic images collected n and the ultrasonic endoscopic image collection time interval. In other embodiments, the number of ultrasonic endoscopic images collected and the ultrasonic endoscopic image collection time interval depend on the specific implementation situation.

[0023] Specifically, multiple ultrasonic endoscopic images of the same position and angle are collected and grayscaled, and the grayscale images are traversed in the order of collecting ultrasonic endoscopic images to obtain each preprocessed image. The specific method is as follows: While keeping the position and angle of the ultrasound probe consistent in the digestive tract, an ultrasound endoscopic image is collected every s seconds, and a total of n ultrasound endoscopic images are collected. The n collected ultrasound endoscopic images are gray-scaled to obtain n grayscale images. The n grayscale images are traversed in the order of corresponding ultrasound endoscopic image acquisition, and each grayscale image after traversal is recorded as a preprocessed image.

[0024] Step S002: according to the gray value distribution trend of the pixels in each filtering window in each preprocessed image, obtain the grouping threshold of each filtering window in each preprocessed image and divide the pixels in the filtering window into two groups; according to the gray value distribution difference between the two groups of grouped pixels in each filtering window in each preprocessed image, obtain the probability parameter of each filtering window in each preprocessed image; according to the fluctuation amplitude of the pixels in the filtering windows of the same sequence of each preprocessed image, obtain the fluctuation coefficient of each pixel in each filtering window of each preprocessed image; according to the grouping of the pixels in each filtering window in each preprocessed image, the probability parameter of each filtering window in each preprocessed image, and the fluctuation coefficient of each pixel in each filtering window of each preprocessed image, obtain the weight of each pixel in each filtering window in each preprocessed image.

[0025] It should be noted that in ultrasound endoscopic images, the normal tissue of the digestive tract wall will show clear echo levels, and the pixel grayscale values ​​between these levels are significantly different. When using the weighted local mean filter method to reduce noise in the image, if the filter window is located exactly at the junction of two adjacent echo levels, the grayscale values ​​of the pixels in the window will more significantly reflect the characteristics of the two echo levels, that is, due to the large difference in the pixel grayscale values ​​of different echo levels, the grayscale value distribution of the pixels in the filter window at the junction will tend to the grayscale value range corresponding to the two echo levels.

[0026] Specifically, according to the gray value distribution trend of the pixels in each filter window in each preprocessed image, the grouping threshold of each filter window in each preprocessed image is obtained and the pixels in the filter window are divided into two groups. The specific method is as follows: Set the dynamic threshold of the e-th filter window in the p-th preprocessed image. The dynamic threshold of the e-th filter window in the p-th preprocessed image is recorded as ,The range of dynamic threshold is 1~254, and the method of calculating the grouping coefficient of the filter window pixels is as follows: ; In the formula, represents the grouping coefficient of the e-th filter window in the p-th preprocessed image, Indicates that all gray values ​​in the e-th filter window in the p-th preprocessed image are less than or equal to the dynamic threshold The gray value variance of the pixel point is Indicates that all gray values ​​in the e-th filter window in the p-th preprocessed image are greater than the dynamic threshold The gray value variance of the pixel points; Calculate the grouping coefficient under different dynamic thresholds The size of the dynamic threshold corresponding to the maximum grouping coefficient As the grouping threshold of the pixels in the e-th filter window in the p-th preprocessed image, the grouping threshold is recorded as , all pixels whose grayscale values ​​in the e-th filtering window in the p-th preprocessed image are less than or equal to the grouping threshold are the first group of pixels, and all pixels whose grayscale values ​​in the e-th filtering window in the p-th preprocessed image are greater than the grouping threshold are the second group of pixels. According to the above method, the grouping threshold of each filtering window in each preprocessed image is obtained and the pixels in each filtering window are divided into two categories.

[0027] It should be noted that the above steps divide the pixels in the filter window into two categories according to the distribution trend of the pixels in each filter window. When the variance of the grayscale value within the group of two pixel points is the smallest and the variance of the grayscale value between the groups is the largest, it means that the pixels in the filter window have been divided into two categories of pixels with the largest differences. Because under the grouping conditions at this time, it can be ensured that the grayscale value distribution of the pixels in the group is close, and the grayscale value distribution difference of the pixels in different groups is obvious enough. The purpose of grouping is to assume that the filter window is located at the junction of two adjacent echo levels, so as to compare and analyze the grayscale value characteristics of the pixels in different windows and judge the probability of the window being located at the junction of two adjacent echo levels.

[0028] It should be further explained that the above steps divide the pixels in each filter window into two groups. Now it is necessary to judge the probability that the filter window is located at the junction of two adjacent echo levels according to the distribution difference of the grayscale values ​​of the grouped pixels in different filter windows. When the probability that the filter window is located at the junction of two adjacent echo levels is high, the weight of the filter window should be adjusted to focus on making the pixels at the junction clearer to facilitate the observation of clear echo levels; when the probability that the filter window is located at the junction of two adjacent echo levels is low, the weight of the filter window should be adjusted to focus on reducing the impact of noise, so as to better observe the fine details of the tissue structure or lesion area.

[0029] Specifically, according to the gray value distribution difference of two groups of pixels in each filter window in each preprocessed image, the probability parameter of each filter window in each preprocessed image is obtained. The specific method is as follows: ; In the formula, represents the probability parameter of the e-th filter window in the p-th preprocessed image, Indicates that in the e-th filter window of the p-th preprocessed image, all gray values ​​are greater than the grouping threshold The mean gray value of the pixel points; Indicates that in the e-th filter window of the p-th preprocessed image, all gray values ​​are less than or equal to the grouping threshold The mean gray value of the pixel points; Indicates that in the e-th filter window of the p-th preprocessed image, all gray values ​​are greater than the grouping threshold The gray value of the pixel with the largest gray value among the pixels; Indicates the grouping threshold of all gray values ​​in the e-th filter window in the p-th preprocessed image that are less than or equal to the e-th filter window The grayscale value of the pixel with the smallest grayscale value among the pixels; the probability parameter of each filtering window is obtained according to the above method.

[0030] It should be noted that for the e-th filter window in the p-th preprocessed image, and They represent the general grayscale values ​​of the two groups of pixels in the filter window after the pixels are grouped. The larger the value of , the greater the average difference in the grayscale values ​​of the two groups of pixels, indicating that the probability that the filter window is located at the junction of adjacent echo levels is greater, because the grayscale difference of the pixels on both sides of the junction of adjacent echo levels is more obvious; To a certain extent, it reflects the numerical range of the grayscale value of the pixel in the filter window. The smaller it is, the less the general size of the pixel grayscale value judged by the mean is affected by noise, the higher the authenticity of the general size of the pixel grayscale value obtained, the more concentrated the pixel grayscale value distribution is, and the more it conforms to the distribution law of the pixel grayscale value at the junction of the echo levels. The greater the probability that the filter window is located at the junction of adjacent echo levels, so the larger the probability parameter of the e-th filter window in the p-th preprocessed image, the greater the probability that the e-th filter window in the p-th preprocessed image is located at the junction of adjacent echo levels.

[0031] It should be further explained that the above steps obtain the probability parameters of each filter window in each preprocessed image, which are used to determine the probability of each window being located at the junction of adjacent echo levels. Next, it is necessary to analyze the pixels in the filter window to determine the probability of each pixel in the filter window belonging to noise, and further eliminate the influence of noise. Because the image quality of a single ultrasonic endoscopic image is unstable, and noise is random and volatile, the fluctuation amplitude of the grayscale value of the pixel of human tissue is relatively stable. Through multiple ultrasonic endoscopic images at the same position, it is possible to more accurately determine whether the pixel belongs to noise. If the probability that a certain pixel belongs to noise is greater, then in the process of noise reduction using weighted local mean filtering, a lower weight is assigned to the pixel to achieve a better noise reduction effect; if the probability that a certain pixel belongs to noise is smaller, a higher weight should be assigned to retain the image details of normal tissue and lesion area.

[0032] Specifically, according to the fluctuation amplitude of the pixel points in the filter window of the same sequence of each preprocessed image, the fluctuation coefficient of each pixel point in each filter window of each preprocessed image is obtained. The specific method is as follows: ; In the formula, represents the fluctuation coefficient of the rth pixel point in the eth filtering window in the pth preprocessed image, n represents the number of collected endoscopic ultrasound images, represents the gray value of the rth pixel in the eth filter window in the i-th preprocessed image, Represents the mean gray value of the rth pixel in the eth filtering window in each preprocessed image, and obtains the fluctuation coefficient of each pixel in each filtering window of each preprocessed image according to the above method.

[0033] It should be noted that the sliding path of the weighted local mean filter window in this embodiment is a serpentine scanning path. In this embodiment, the sliding path of the weighted local mean filter window is not specifically limited, but it is necessary to ensure that the sliding path of the weighted local mean filter window remains consistent during the processing of each pre-processed image; the above steps determine the fluctuation of the grayscale value of the pixel at the same position in different pre-processed images to determine whether the characteristics of the pixel are more inclined to noise pixels or more inclined to normal pixels. If The larger the value is, the more obvious and unstable the gray value fluctuation of the rth pixel in the eth filter window of each preprocessed image is, and the higher the degree of noise influence on the pixel is, the lower the weight should be given to ensure a better noise reduction effect. The smaller it is, the smoother and more stable the grayscale value fluctuation of the rth pixel in the eth filtering window of each preprocessed image is, and the less the pixel is affected by noise, so a higher weight should be given to it; that is, the larger the fluctuation coefficient is, the higher the weight should be given to the pixel, and the smaller the fluctuation coefficient is, the lower the weight should be given.

[0034] It should be further explained that the above method groups the pixels in each filter window in each preprocessed image, and obtains the probability parameters of each filter window and the fluctuation coefficient of each pixel in the filter window. Now it is necessary to combine the pixel grouping and the probability parameters of the filter window, as well as the fluctuation coefficient of each pixel in the filter window to obtain the weight of each pixel in the filter window.

[0035] Specifically, according to the grouping of pixels in each filter window in each preprocessed image, the probability parameter of each filter window in each preprocessed image, and the fluctuation coefficient of each pixel in each filter window in each preprocessed image, the weight of each pixel in each filter window in each preprocessed image is obtained. The specific method is as follows: First, determine whether the central pixel of the e-th filter window in the p-th preprocessed image belongs to the first group of pixels in the filter window or the second group of pixels; If the central pixel of the e-th filter window in the p-th preprocessed image belongs to the first group of pixels in the filter window, then: ; If the central pixel of the e-th filter window in the p-th preprocessed image belongs to the second group of pixels in the filter window, then: ; In the formula, represents the weight of the rth pixel in the eth filter window in the pth preprocessed image, represents the probability parameter of the e-th filter window in the p-th preprocessed image, represents the fluctuation coefficient of the rth pixel in the eth filter window in the pth preprocessed image, Represents the grayscale value of the central pixel of the e-th filter window in the p-th preprocessed image, Represents the grayscale value of the rth pixel in the eth filtering window in the pth preprocessed image; according to the above method, the weight of each pixel in each filtering window in each preprocessed image is obtained.

[0036] It should be noted that, when the probability parameter of the e-th filter window in the p-th preprocessed image is high, it means that the probability of the window being located at the junction of adjacent echo levels is high; if the central pixel belongs to the first group of pixels, it means that the pixel may belong to an echo level with a lower grayscale value, and the final grayscale of the central pixel after filtering should be close to the grayscale value distribution interval of the pixel with a lower grayscale value, so the pixel with a lower grayscale value group should be given a larger weight to obtain a clear edge; When the probability parameter of the e-th filter window in the p-th preprocessed image is low, it means that the probability of the window being located at the junction of adjacent echo levels is low, that is, the probability of the window being located in normal human tissue or noise area is high. At this time, the purpose of filtering is to reduce noise. Because the grayscale values ​​of pixels in normal human tissue or noise area are irregularly distributed, in this case, the probability parameter of the fluctuating filter window will not affect the grayscale gradient of the grayscale values ​​of pixels in the filter window too much, because in this case, the grayscale values ​​of high grayscale pixels and low grayscale pixels are not much different. The weight of the noise pixels is reduced by combining the fluctuation coefficient of the pixels, and the weighted local mean filtering algorithm is based on mean calculation, which can also achieve a good noise reduction effect. When the probability parameter of the e-th filter window in the p-th preprocessed image is high, it means that the probability of the window being located at the junction of adjacent echo levels is high; if the central pixel belongs to the second group of pixels, it means that the pixel may belong to an echo level with a higher grayscale value, and the final grayscale of the central pixel after filtering should be close to the grayscale value distribution interval of the pixel with a higher grayscale value, so the pixel in the group with a higher grayscale value should be given a larger weight to obtain a clear edge; When the probability parameter of the e-th filter window in the p-th preprocessed image is low, it means that the probability that the window is located at the junction of adjacent echo levels is low, that is, the probability that the window is located in normal human tissue or noise area is high. At this time, the purpose of filtering is to reduce noise. Because the grayscale values ​​of pixels in normal human tissue or noise area are irregularly distributed, in this case, the probability parameter of the fluctuating filter window will not affect the grayscale gradient of the grayscale values ​​of pixels in the filter window too much, because in this case the grayscale values ​​of high grayscale pixels and low grayscale pixels are not much different. Combined with the fluctuation coefficient of the pixel, the weight of the noise pixel is reduced, and the weighted local mean filtering algorithm is based on mean calculation, which can also achieve a good noise reduction effect.

[0037] Step S003: enhancing each pre-processed image according to the weight of each pixel in each filtering window in each pre-processed image.

[0038] The above method obtains the weight of each pixel in each filter window in each preprocessed image. Now it is necessary to use the weight of each pixel in each filter window and use the weighted local mean filtering method to enhance each preprocessed image.

[0039] Specifically, each preprocessed image is enhanced according to the weight of each pixel in each filter window in each preprocessed image. The specific method is as follows: ; In the formula, represents the enhanced grayscale value of the rth pixel in the eth filtering window in the pth preprocessed image, represents the weight of the K-th pixel in the e-th filter window in the p-th preprocessed image, represents the gray value of the K-th pixel in the e-th filter window in the p-th preprocessed image, represents the weight of the jth pixel in the eth filter window in the pth preprocessed image, M represents the number of pixels in the filter window, and the enhanced grayscale value of each pixel in each filter window of each preprocessed image is obtained according to the above method to complete the enhancement of each preprocessed image.

[0040] It should be noted that, in the present embodiment, the side length of the filter window is 7. The present embodiment does not specifically limit the side length of the filter window, but it is necessary to ensure that the side length of each filter window is consistent during the implementation process. The present method combines the relative probability of the filter window being located at adjacent echo levels and the degree to which each pixel point is affected by noise, and performs different weight ratios on the high and low pixels in the filter window. Under this weight ratio, when the features at the junction of adjacent echo levels are more obvious, the junction is made clearer, and when the features at the junction of adjacent echo levels are not obvious, the impact of noise on image quality is reduced. The reduction of the impact of noise on image quality is judged based on multiple images at the same angle position, which can effectively avoid the disordered arrangement of pixels in the lesion area and prevent them from being misclassified as noise pixels, and avoid excessive smoothing of the lesion area.

[0041] See also Figure 2 , which shows the second object of the present invention, a structural block diagram of a digestive tract endoscope image adaptive enhancement system, the system includes the following modules: An image acquisition module is used to acquire multiple ultrasonic endoscopic images of the same position and angle and grayscale the images, traverse the grayscale images in the order of acquiring the ultrasonic endoscopic images, and acquire each pre-processed image; A weight calculation module is used to obtain the grouping threshold of each filter window in each preprocessed image and divide the pixels in the filter window into two groups according to the gray value distribution trend of the pixels in each filter window in each preprocessed image; obtain the probability parameter of each filter window in each preprocessed image according to the gray value distribution difference between the two groups of pixel points in each filter window after grouping in each preprocessed image; obtain the fluctuation coefficient of each pixel point in each filter window of each preprocessed image according to the fluctuation amplitude of the pixel points in the filter window of the same sequence of each preprocessed image; obtain the weight of each pixel point in each filter window in each preprocessed image according to the grouping of the pixel points in each filter window in each preprocessed image, the probability parameter of each filter window in each preprocessed image, and the fluctuation coefficient of each pixel point in each filter window of each preprocessed image; The image enhancement module is used to enhance each preprocessed image according to the weight of each pixel in each filter window in each preprocessed image.

[0042] The third purpose of an embodiment of the present invention is to provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned method for adaptive enhancement of gastrointestinal endoscopic images when executing the computer program.

[0043] The fourth objective of an embodiment of the present invention is to provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned method for adaptive enhancement of gastrointestinal endoscopic images are implemented.

[0044] This embodiment collects multiple ultrasonic endoscopic images at the same position and angle and grayscales the images, traverses the grayscale images in the order of collecting ultrasonic endoscopic images, and obtains each preprocessed image; although the noise in the ultrasonic endoscopic image is similar to the grayscale distribution characteristics of the pixels in the lesion area, the noise is random and accidental, so collecting multiple ultrasonic endoscopic images at the same position and angle can distinguish the noise pixels and the lesion area pixels to a certain extent, which is convenient for the subsequent weighting process to weight the noise pixels and the lesion area pixels; According to the gray value distribution trend of the pixels in each filter window in each preprocessed image, the grouping threshold of each filter window in each preprocessed image is obtained and the pixels in the filter window are divided into two groups; in the ultrasonic endoscopic image, the normal tissue of the wall of the digestive tract will show clear echo levels, and the pixel gray values ​​between these levels are obviously different. The pixels in the filter window are divided into two categories with the greatest difference, so as to facilitate the subsequent determination of the relative probability that the filter window is located at the junction of adjacent echo levels by judging the difference and regularity of the pixel gray value distribution of the two categories of pixels, and then select different weighting modes for the pixels in the filter window according to different probabilities; According to the gray value distribution difference of the two groups of pixels in each filter window in each preprocessed image, the probability parameter of each filter window in each preprocessed image is obtained; according to the characteristics of the two types of pixels in different groups, the relative probability of the window being located at the junction of adjacent echo layers is judged. When the relative probability is high, the enhancement effect should focus on strengthening the information at the junction, and when the relative probability is low, the enhancement effect should focus on noise reduction; According to the fluctuation amplitude of the pixel points in the filter window of the same sequence of each preprocessed image, the fluctuation coefficient of each pixel point in each filter window of each preprocessed image is obtained; through the fluctuation of the pixel points at the same position of different images, the noise pixels can be screened out to a certain extent to avoid the gray value distribution characteristics of the pixel points in the lesion area being too close to the gray value distribution characteristics of the noise pixel points, resulting in excessive smoothing of the noise area; According to the grouping of pixels in each filter window in each preprocessed image, the probability parameter of each filter window in each preprocessed image, and the fluctuation coefficient of each pixel in each filter window in each preprocessed image, the weight of each pixel in each filter window in each preprocessed image is obtained; in combination with the above-obtained parameters and grouping, it is determined to which echo level the pixel to be enhanced belongs, and according to the pixel grouping to which the pixel to be enhanced belongs, the enhanced features of the pixel to be enhanced are made closer to the grayscale gradient features of the pixels in the pixel group to which it belongs, and in combination with the fluctuation amplitude of the pixel, the weight of the noise pixel is reduced, thereby reducing the influence of the noise pixel on the enhancement effect; Each preprocessed image is enhanced according to the weight of each pixel in each filter window in each preprocessed image; different weight ratios are respectively applied to high and low pixels in the filter window. Under this weight ratio, when the features of the junction of adjacent echo layers are more obvious, the junction is made clearer, and when the features of the junction of adjacent echo layers are not obvious, the influence of noise on image quality is reduced. The reduction of the influence of noise on image quality is judged based on multiple images at the same angle position, which can effectively avoid the disordered arrangement of pixels in the lesion area and prevent them from being misclassified as noise pixels, and avoid excessive smoothing of the lesion area.

[0045] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0046] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0047] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0048] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0049] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A method for adaptively enhancing a digestive tract endoscope image, characterized in that: The method comprises the following steps: Collect multiple endoscopic ultrasound images at the same position and angle and grayscale the images, traverse the grayscale images in the order of collecting endoscopic ultrasound images, and obtain each pre-processed image; According to the gray value distribution trend of the pixels in each filter window in each preprocessed image, the grouping threshold of each filter window in each preprocessed image is obtained and the pixels in the filter window are divided into two groups; according to the gray value distribution difference of the two groups of grouped pixels in each filter window in each preprocessed image, the probability parameter of each filter window in each preprocessed image is obtained; according to the fluctuation amplitude of the pixels in the filter window of the same sequence of each preprocessed image, the fluctuation coefficient of each pixel in each filter window of each preprocessed image is obtained; according to the grouping of the pixels in each filter window in each preprocessed image, the probability parameter of each filter window in each preprocessed image, and the fluctuation coefficient of each pixel in each filter window of each preprocessed image, the weight of each pixel in each filter window in each preprocessed image is obtained; Each preprocessed image is enhanced according to the weight of each pixel in each filter window in each preprocessed image.

2. According to claim 1, a method for adaptive enhancement of digestive tract endoscope images, characterized in that: The method of acquiring multiple ultrasonic endoscopic images at the same position and angle and graying the images, traversing the grayscale images in the order of acquiring the ultrasonic endoscopic images, and obtaining each pre-processed image includes the following specific methods: While keeping the position and angle of the ultrasound probe consistent in the digestive tract, an ultrasound endoscopic image is collected every s seconds, and a total of n ultrasound endoscopic images are collected. The n collected ultrasound endoscopic images are gray-scaled to obtain n grayscale images. The n grayscale images are traversed in the order of corresponding ultrasound endoscopic image acquisition, and each grayscale image after traversal is recorded as a preprocessed image.

3. The method for adaptively enhancing digestive tract endoscope images according to claim 1, characterized in that: The method of obtaining the grouping threshold of each filter window in each preprocessed image and dividing the pixels in the filter window into two groups according to the gray value distribution trend of the pixels in each filter window in each preprocessed image includes: Set the dynamic threshold of the e-th filter window in the p-th preprocessed image. The dynamic threshold of the e-th filter window in the p-th preprocessed image is recorded as ,The range of dynamic threshold is 1~254, and the method of calculating the grouping coefficient of the filter window pixels is as follows: ; In the formula, represents the grouping coefficient of the e-th filter window in the p-th preprocessed image, Indicates that all gray values ​​in the e-th filter window in the p-th preprocessed image are less than or equal to the dynamic threshold The gray value variance of the pixel point is Indicates that all gray values ​​in the e-th filter window in the p-th preprocessed image are greater than the dynamic threshold The gray value variance of the pixel points; Calculate the grouping coefficient under different dynamic thresholds The size of the dynamic threshold corresponding to the maximum grouping coefficient As the grouping threshold of the pixels in the e-th filter window in the p-th preprocessed image, the grouping threshold is recorded as , all pixels whose grayscale values ​​in the e-th filtering window in the p-th preprocessed image are less than or equal to the grouping threshold are the first group of pixels, and all pixels whose grayscale values ​​in the e-th filtering window in the p-th preprocessed image are greater than the grouping threshold are the second group of pixels. According to the above method, the grouping threshold of each filtering window in each preprocessed image is obtained and the pixels in each filtering window are divided into two categories.

4. The method for adaptively enhancing digestive tract endoscope images according to claim 1, characterized in that: The specific method of obtaining the probability parameter of each filtering window in each preprocessed image according to the gray value distribution difference of two groups of pixels in each filtering window in each preprocessed image includes: ; In the formula, represents the probability parameter of the e-th filter window in the p-th preprocessed image, Indicates that in the e-th filter window of the p-th preprocessed image, all gray values ​​are greater than the grouping threshold The mean gray value of the pixel points; Indicates that in the e-th filter window of the p-th preprocessed image, all gray values ​​are less than or equal to the grouping threshold The mean gray value of the pixel points; Indicates that in the e-th filter window of the p-th preprocessed image, all gray values ​​are greater than the grouping threshold The gray value of the pixel with the largest gray value among the pixels; Indicates the grouping threshold of all gray values ​​in the e-th filter window in the p-th preprocessed image that are less than or equal to the e-th filter window The grayscale value of the pixel with the smallest grayscale value among the pixels; the probability parameter of each filtering window is obtained according to the above method.

5. The method for adaptively enhancing digestive tract endoscope images according to claim 1, characterized in that: The specific method of obtaining the fluctuation coefficient of each pixel point in each filtering window of each preprocessed image according to the fluctuation amplitude of the pixel points in the filtering window of the same sequence of each preprocessed image includes: ; In the formula, represents the fluctuation coefficient of the rth pixel point in the eth filtering window in the pth preprocessed image, n represents the number of collected endoscopic ultrasound images, represents the gray value of the rth pixel in the eth filter window in the i-th preprocessed image, Represents the mean gray value of the rth pixel in the eth filtering window in each preprocessed image, and obtains the fluctuation coefficient of each pixel in each filtering window of each preprocessed image according to the above method.

6. The method for adaptively enhancing digestive tract endoscope images according to claim 1, characterized in that: The method of obtaining the weight of each pixel in each filtering window in each preprocessed image according to the grouping of the pixel in each filtering window in each preprocessed image, the probability parameter of each filtering window in each preprocessed image, and the fluctuation coefficient of each pixel in each filtering window in each preprocessed image includes the following specific methods: First, determine whether the central pixel of the e-th filter window in the p-th preprocessed image belongs to the first group of pixels in the filter window or the second group of pixels; If the central pixel of the e-th filter window in the p-th preprocessed image belongs to the first group of pixels in the filter window, then: ; If the central pixel of the e-th filter window in the p-th preprocessed image belongs to the second group of pixels in the filter window, then: ; In the formula, represents the weight of the rth pixel in the eth filter window in the pth preprocessed image, represents the probability parameter of the e-th filter window in the p-th preprocessed image, represents the fluctuation coefficient of the rth pixel in the eth filter window in the pth preprocessed image, Represents the grayscale value of the central pixel of the e-th filter window in the p-th preprocessed image, Represents the grayscale value of the rth pixel in the eth filtering window in the pth preprocessed image; according to the above method, the weight of each pixel in each filtering window in each preprocessed image is obtained.

7. The method for adaptively enhancing digestive tract endoscope images according to claim 1, characterized in that: The specific method of enhancing each pre-processed image according to the weight of each pixel in each filter window in each pre-processed image is as follows: ; In the formula, represents the enhanced grayscale value of the rth pixel in the eth filtering window in the pth preprocessed image, represents the weight of the K-th pixel in the e-th filter window in the p-th preprocessed image, represents the gray value of the K-th pixel in the e-th filter window in the p-th preprocessed image, represents the weight of the jth pixel in the eth filter window in the pth preprocessed image, M represents the number of pixels in the filter window, and the enhanced grayscale value of each pixel in each filter window of each preprocessed image is obtained according to the above method to complete the enhancement of each preprocessed image.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of a method for adaptively enhancing a digestive tract endoscope image as described in any one of claims 1 to 7 are implemented.

9. A computer device comprising a memory, 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 for adaptively enhancing gastrointestinal endoscopic images as described in any one of claims 1 to 7 are implemented.

10. A digestive tract endoscope image adaptive enhancement system, characterized in that: The system includes the following modules: An image acquisition module is used to acquire multiple ultrasonic endoscopic images of the same position and angle and grayscale the images, traverse the grayscale images in the order of acquiring the ultrasonic endoscopic images, and acquire each pre-processed image; A weight calculation module is used to obtain the grouping threshold of each filter window in each preprocessed image and divide the pixels in the filter window into two groups according to the gray value distribution trend of the pixels in each filter window in each preprocessed image; According to the gray value distribution difference of two groups of pixel points in each filter window after grouping in each preprocessed image, the probability parameter of each filter window in each preprocessed image is obtained; according to the fluctuation amplitude of the pixel points in the filter window of the same sequence of each preprocessed image, the fluctuation coefficient of each pixel point in each filter window of each preprocessed image is obtained; according to the grouping of the pixel points in each filter window in each preprocessed image, the probability parameter of each filter window in each preprocessed image, and the fluctuation coefficient of each pixel point in each filter window of each preprocessed image, the weight of each pixel point in each filter window in each preprocessed image is obtained; The image enhancement module is used to enhance each preprocessed image according to the weight of each pixel in each filter window in each preprocessed image.

Citation Information

Patent Citations

  • Tumor image enhancement method

    CN117853386A

  • Anesthesia puncture positioning method and system based on visual assistance

    CN118680646A

  • Ultrasound diagnostic system, ultrasound image generation apparatus, and ultrasound image generation method

    US20120078103A1