A local adaptive denoising method for endoscopic spine

CN122887712APending Publication Date: 2026-10-09THE AFFILIATED HOSPITAL OF QINGDAO UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511129810.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-13
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

[0004]为了解决均值滤波会导致髓核区域的纤维网絮状结构被平滑处理,图像的辨识困难,去噪效果较差技术问题,本发明提供一种脊柱内镜局部自适应去噪方法,所采用的技术方案具体如下:

Benefits of technology

[0035]本发明通过暗通道图像确定图像中暗区域和亮区域,并根据超像素分割确定神经根区域和髓核区域为待处理区域,通过暗区域像素点的占比确定搜索窗口大小,并进一步确定标记窗口和参考窗口,能够自适应获取搜索窗口的大小,从而在保证图像处理效果的同时,能够有效降低图像处理的计算量,从而提升图像处理处理的效率,根据暗通道图像和脊柱内镜灰度图像不同区域暗区域和亮区域的灰度值均值,从而获取不同参考窗口的自适应权重系数,进而确定标记窗口与对应参考窗口的加权均方误差,能够结合髓核区域絮状纹理的模糊特点,通过分配对应的权重有效保留其模糊特点,提升加权均方误差的可靠性;通过参考窗口中暗区域的像素点的数量、参考窗口与标记窗口的加权均方误差,确定参考窗口的自适应窗口权值,并根据自适应窗口权值对脊柱内镜灰度图像进行非局部均值滤波去噪处理,得到目标图像,本发明通过对参考窗口的加权均方误差和自适应窗口权值进行处理,从而能够有效保留髓核区域的絮状特点,避免平滑滤波导致的纹理缺失,提升非局部均值滤波去噪算法的可靠性,使得目标图像能够在保留髓核区域和神经根区域的纹理特征的同时,提升对脊柱内镜的成像的去噪效果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122887712A_ABST
    Figure CN122887712A_ABST
Patent Text Reader

Abstract

The present application relates to computer vision and image processing technical field, specifically to a kind of local adaptive denoising method of endoscope of spine.The method comprises: obtaining endoscope of spine gray scale image and dark channel image, obtain the region to be processed;Dark area and bright area are determined;Search window, marker window and reference window are determined;The adaptive weight coefficient of different reference window is determined respectively, the target weight of each position of different reference window is determined;According to the target weight of marker window and any reference window in all positions and the gray scale value difference of pixel point under the same position, weighted mean square error is determined;Further, the adaptive window weight of reference window is determined;According to the adaptive window weight of reference window, non-local mean filtering denoising processing is carried out to endoscope of spine gray scale image, and target image is obtained.The present application can effectively improve the denoising effect of endoscope of spine.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer vision and image processing technology, specifically to a local adaptive denoising method for spinal endoscopy. Background Technology

[0002] Traditional open surgery has a long history in spinal surgery. However, with the advancement of imaging and computer technology research, minimally invasive spinal surgery techniques have made great progress. Spinal endoscopy is one of the most promising minimally invasive spinal surgery techniques today. Spinal endoscopic imaging includes the nucleus pulposus region and the nerve root region. The nucleus pulposus region appears as a dense fibrous network structure similar to cotton, while the nerve root region appears as a high-brightness strip structure. Due to the influence of the detection environment, spinal endoscopic imaging contains varying degrees of noise. The presence of noise makes the nucleus pulposus region and nerve root region less distinguishable, thus affecting the clarity of spinal endoscopic imaging.

[0003] In related technologies, mean filtering is used to denoise spinal endoscopy images. However, when noise appears in the image, errors may occur in the differentiation and denoising of the nucleus pulposus and nerve roots due to their similar colors. Direct mean filtering will smooth the texture of the fibrous network, further increasing the difficulty of image recognition and resulting in poor denoising effect. Summary of the Invention

[0004] To address the problem that mean filtering smooths out the fibrous network structure in the nucleus pulposus region, leading to difficulties in image recognition and poor denoising performance, this invention provides a local adaptive denoising method for spinal endoscopy. The specific technical solution adopted is as follows:

[0005] This invention proposes a local adaptive noise reduction method for spinal endoscopy, the method comprising:

[0006] Acquire grayscale and dark channel images of the spinal endoscope; perform superpixel segmentation on the grayscale image of the spinal endoscope to obtain the nerve root region and nucleus pulposus region as the regions to be processed; determine the dark region and bright region based on the grayscale values ​​of the pixels in the dark channel image.

[0007] The window side length of the search window is determined based on the number of pixels in the dark region of the dark channel image and the total number of all pixels. A test pixel is randomly selected from the region to be processed. The search window is determined with the test pixel as the center and the window side length as the length. A marker window is determined with the test pixel as the center. The marker window is smaller than the search window. The search window is traversed, and a reference window of the same size as the marker window is determined from the search window.

[0008] Adaptive weighting coefficients for different reference windows are determined based on the mean gray values ​​of dark and bright regions in the dark channel image and the mean gray values ​​of dark and bright regions in the spinal endoscopy grayscale image, respectively. Target weights for each position of different reference windows are determined based on the adaptive weighting coefficients of the marker window and any reference window. The weighted mean square error between the marker window and the corresponding reference window is determined based on the target weights of the marker window and any reference window at all positions and the difference in gray values ​​of pixels at the same position.

[0009] Based on the number of pixels in the dark region of the reference window and the weighted mean square error between the reference window and the marker window, the adaptive window weight of the reference window is determined; the spinal endoscopy grayscale image is then subjected to nonlocal mean filtering denoising processing based on the adaptive window weight of the reference window to obtain the target image.

[0010] Further, determining the window side length of the search window based on the number of pixels in the dark region of the dark channel image and the total number of all pixels includes:

[0011] The ratio of the number of pixels in the dark region to the total number of pixels in the dark channel image is used as the dark pixel density.

[0012] The product of the dark spot density and the preset window side length is used as the window side length of the search window.

[0013] Further, determining the adaptive weighting coefficients for different reference windows based on the average gray values ​​of the dark and bright regions in the dark channel image and the average gray values ​​of the dark and bright regions in the spinal endoscopy grayscale image includes:

[0014] Use the area corresponding to any reference window as the area to be tested;

[0015] In the dark channel image, the ratio of the average gray value of the pixels in the dark area to the average gray value of the pixels in the bright area is taken as the first ratio.

[0016] In the grayscale image of the spinal endoscope, the ratio of the average grayscale value of the pixels in the dark area corresponding to the test area to the grayscale value of the pixels in the bright area is used as the second ratio.

[0017] The average of the first ratio and the second ratio is used as the adaptive weight coefficient of the region to be tested. The region to be tested is changed to obtain the adaptive weight coefficient corresponding to each reference window.

[0018] Further, determining the target weights at different positions of the reference window based on the adaptive weight coefficients includes:

[0019] Gaussian weighting is applied to each position in each of the reference windows, wherein the adaptive weight coefficient of the reference window is the ratio of the target weight at the center position to the target weight at the corner position, and the sum of the target weights at all positions in the reference window is 1.

[0020] Further, determining the weighted mean square error between the marker window and the corresponding reference window based on the target weights of the marker window and any reference window at all positions and the difference in grayscale values ​​of pixels at the same positions includes:

[0021] In the grayscale image of the spinal endoscope, the square of the difference between the grayscale values ​​of corresponding pixels at the same position of the marker window and any reference window is calculated as the grayscale value difference.

[0022] The product of the grayscale value difference and the target weight at the corresponding position is calculated as the weighted error at the corresponding position;

[0023] The average of the weighted errors at all locations is used as the weighted mean square error between the marked window and the corresponding reference window.

[0024] Further, determining the adaptive window weights of the reference window based on the number of pixels in the dark region of the reference window and the weighted mean square error between the reference window and the marker window includes:

[0025] The weighted mean square error is inversely normalized to obtain the error factor;

[0026] The ratio of the number of pixels in the dark area of ​​the reference window to the total number of pixels in the reference window is used as the number ratio.

[0027] The normalized value of the product of the error factor and the quantity ratio is used as the adaptive window weight of the reference window.

[0028] Further, the step of performing nonlocal mean filtering denoising on the spinal endoscopy grayscale image based on the adaptive window weights of the reference window to obtain the target image includes:

[0029] Based on the nonlocal mean filtering denoising algorithm, the denoised grayscale value of each pixel in the grayscale image of the spinal endoscope is calculated according to the adaptive window weight of the reference window to obtain the target image.

[0030] Further, determining the dark and bright regions based on the grayscale values ​​of pixels in the dark channel image includes:

[0031] Sort the gray values ​​of all pixels in the dark channel image from low to high, calculate the difference between adjacent gray values ​​according to the sorting order, and determine the maximum difference.

[0032] The smaller gray value of the pixel corresponding to the maximum difference is taken as the gray value threshold.

[0033] The dark channel image is divided into dark and bright regions based on the gray value threshold, wherein the gray value of the pixels in the dark region is less than or equal to the gray value threshold, and the gray value of the pixels in the bright region is greater than the gray value threshold.

[0034] The present invention has the following beneficial effects:

[0035] This invention identifies dark and bright regions in an image using dark channel imaging, and determines the nerve root and nucleus pulposus regions as the areas to be processed based on superpixel segmentation. The search window size is determined by the proportion of pixels in the dark region, and further, a marker window and a reference window are determined. The search window size can be adaptively obtained, thus effectively reducing the computational load while maintaining image processing quality, thereby improving processing efficiency. Based on the average grayscale values ​​of dark and bright regions in different areas of the dark channel image and the spinal endoscopy grayscale image, adaptive weight coefficients for different reference windows are obtained, thereby determining the weighted mean square error between the marker window and the corresponding reference window. This can be combined with the blurred characteristics of the flocculent texture in the nucleus pulposus region by allocating... The corresponding weights effectively preserve the fuzzy characteristics and improve the reliability of the weighted mean square error. By using the number of pixels in the dark area of ​​the reference window and the weighted mean square error between the reference window and the marker window, the adaptive window weight of the reference window is determined. Based on the adaptive window weight, the grayscale image of the spinal endoscope is subjected to nonlocal mean filtering for denoising to obtain the target image. This invention effectively preserves the flocculent characteristics of the nucleus pulposus region by processing the weighted mean square error of the reference window and the adaptive window weight, avoiding texture loss caused by smoothing filtering, and improving the reliability of the nonlocal mean filtering denoising algorithm. This allows the target image to improve the denoising effect of spinal endoscope imaging while preserving the texture features of the nucleus pulposus region and nerve root region. Attached Figure Description

[0036] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0037] Figure 1 This is a flowchart of a local adaptive noise reduction method for spinal endoscopy provided in one embodiment of the present invention. Detailed Implementation

[0038] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of a spinal endoscopy local adaptive noise reduction method proposed according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.

[0039] Unless otherwise defined, 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 pertains.

[0040] The following description, in conjunction with the accompanying drawings, details a specific scheme for a local adaptive noise reduction method for spinal endoscopy provided by this invention.

[0041] Please see Figure 1 The diagram illustrates a flowchart of a local adaptive noise reduction method for spinal endoscopy according to an embodiment of the present invention, the method comprising:

[0042] S101: Acquire the grayscale image and dark channel image of the spinal endoscope, perform superpixel segmentation on the grayscale image of the spinal endoscope to obtain the nerve root region and nucleus pulposus region as the regions to be processed; determine the dark region and bright region based on the grayscale value of the pixels in the dark channel image.

[0043] In this embodiment of the invention, a spinal endoscope can be used to capture and acquire the original image of the spinal endoscope. Then, the original image is processed by grayscale to obtain a grayscale image of the spinal endoscope. The grayscale processing can be, for example, mean grayscale processing, and there is no limitation thereto.

[0044] In this embodiment of the invention, after acquiring the original image of the spinal endoscope, the original image can be processed by dark channel processing to obtain a dark channel image. Dark channel processing refers to taking the minimum value among the red, green and blue color channels of each pixel in the original image as the gray value of that pixel, thereby obtaining the dark channel image.

[0045] In this embodiment of the invention, superpixel segmentation can be used to segment the grayscale image of the spinal endoscopy to extract the nerve root region and the nucleus pulposus region as the areas to be processed. It is understood that due to the influence of noise, the nerve root region and the nucleus pulposus region cannot be effectively distinguished. Using the same denoising method for both regions would result in smoothing of the nucleus pulposus region, leading to a loss of image details. Therefore, this invention performs adaptive nonlocal mean filtering denoising processing on the image based on features such as the image's grayscale distribution, as detailed in subsequent embodiments.

[0046] Further, in this embodiment of the invention, determining dark and bright regions based on the grayscale values ​​of pixels in the dark channel image includes: sorting the grayscale values ​​of all pixels in the dark channel image from low to high; calculating the difference between adjacent grayscale values ​​according to the sorting order to determine the maximum difference; using the smaller grayscale value of the pixel corresponding to the maximum difference as the grayscale value threshold; dividing the dark channel image into dark and bright regions according to the grayscale value threshold, wherein the grayscale value of pixels in the dark region is less than or equal to the grayscale value threshold, and the grayscale value of pixels in the bright region is greater than the grayscale value threshold.

[0047] In this embodiment of the invention, since the parts with lower gray values ​​in the dark channel image are usually the discrete low-brightness areas of the nucleus pulposus and the light and shadow areas of the nerve roots in the original image, the present invention avoids noise interference and locates the flocculent dark spots by using the dark channel image.

[0048] Specifically, the gray values ​​of all pixels in the dark channel image are sorted from low to high. Based on the sorting result, the absolute value of the difference between two adjacent gray values ​​is determined. When the absolute value of the difference is the largest, it is used as the boundary between the bright and dark parts. That is, the smaller gray value of the pixel corresponding to the largest difference is used as the gray value threshold. The dark channel image is divided into dark and bright regions based on the gray value threshold.

[0049] It is understandable that the original images from different spinal endoscopes correspond to different dark channel images, resulting in different imaging effects. It is not possible to directly set a fixed gray value threshold to divide the dark and bright areas. Therefore, this invention effectively determines the gray value threshold based on the gray value differences in the dark channel image, thereby effectively dividing the dark channel image into dark and bright areas based on the gray value threshold.

[0050] S102: Determine the window side length of the search window based on the number of pixels in the dark area of ​​the dark channel image and the total number of all pixels; select any pixel to be tested from the area to be processed, determine the search window with the pixel to be tested as the center and the window side length as the length, and determine the marker window with the pixel to be tested as the center, wherein the marker window is smaller than the search window; traverse the search window and determine a reference window with the same size as the marker window from the search window.

[0051] Furthermore, in some embodiments of the present invention, determining the window side length of the search window based on the number of pixels in the dark region of the dark channel image and the total number of all pixels includes: calculating the ratio of the number of pixels in the dark region to the total number of pixels in the dark channel image as the dark point density; and using the product of the dark point density and the preset window side length as the window side length of the search window.

[0052] The search window corresponds to the image window to be searched. Since analyzing the complete image directly would lead to an overly complex calculation process, setting a search window can effectively reduce the amount of computation in image processing while ensuring the image processing effect, thereby improving the efficiency of image processing.

[0053] The preset window side length is the preset side length of the search window. In this embodiment of the invention, the side length of the shortest side of the dark channel image can be used as the preset window side length, or the preset window side length can be obtained according to the actual processing situation. Optionally, the preset window side length can be, for example, 100, without limitation.

[0054] In this embodiment of the invention, the ratio of the number of pixels in the dark region to the total number of pixels in the dark channel image is used as the dark point density. A higher proportion of pixels in the dark region indicates a larger illuminated / shadowed area in the nucleus pulposus and nerve roots, meaning a larger search window can be used to capture more pixels in the dark region. Conversely, a lower proportion of pixels in the dark region indicates a smaller illuminated / shadowed area in the nucleus pulposus and nerve roots, requiring a smaller search window to reduce unnecessary computation and avoid the influence of background pixels on the calculation process. Therefore, in this embodiment of the invention, the product of the dark point density and the preset window side length is used as the window side length of the search window.

[0055] In this embodiment of the invention, a pixel to be tested is randomly selected from the area to be processed. A search window is determined with the pixel to be tested as the center and the window side length as the length. A marker window is determined with the pixel to be tested as the center. The marker window is smaller than the search window. The search window is traversed, and a reference window of the same size as the marker window is determined from the search window.

[0056] Understandably, when the pixel to be tested is close to the edge of the image, making it impossible to build a marker window and a reference window based on the obtained window side length, the image edge can be expanded, and a fixed gray value can be set to fill the expanded area, thereby achieving image processing.

[0057] In this embodiment of the invention, a marking window can be determined with the pixel to be tested as the center. The size of the marking window is a preset window size. Optionally, the size of the marking window can be, for example, 5×5, or it can be set according to the actual detection requirements, without limitation.

[0058] After determining the size of the marker window, this invention can determine a reference window of the same size from the search window. It is understood that the reference window does not exceed the range corresponding to the search window. The search window can be traversed to determine multiple reference windows, so as to analyze the marker window based on the gray value distribution of all reference windows.

[0059] S103: Determine the adaptive weight coefficients of different reference windows based on the mean gray values ​​of the dark and bright regions in the dark channel image and the mean gray values ​​of the dark and bright regions in the spinal endoscopy grayscale image, respectively. Determine the target weights of each position of different reference windows based on the adaptive weight coefficients of the marker window and any reference window. Determine the weighted mean square error between the marker window and the corresponding reference window based on the target weights of the marker window and any reference window at all positions and the difference in gray values ​​of pixels at the same position.

[0060] Optionally, in some embodiments of the present invention, the adaptive weight coefficients of different reference windows are determined based on the average gray values ​​of the dark and bright regions in the dark channel image and the average gray values ​​of the dark and bright regions in the spinal endoscopy grayscale image, respectively. This includes: taking the region corresponding to any reference window as the region to be tested; in the dark channel image, taking the ratio of the average gray value of the pixels in the dark region corresponding to the region to be tested to the average gray value of the pixels in the bright region as a first ratio; in the spinal endoscopy grayscale image, taking the ratio of the average gray value of the pixels in the dark region corresponding to the region to be tested to the average gray value of the pixels in the bright region as a second ratio; and taking the average of the first and second ratios as the adaptive weight coefficient of the region to be tested, changing the region to be tested, and obtaining the adaptive weight coefficients corresponding to each reference window.

[0061] In this embodiment of the invention, any region corresponding to a reference window can be used as the region to be tested. The region to be tested includes dark and bright regions. It is understood that when the region to be tested contains only dark or only bright regions, it means that the corresponding region to be tested cannot be adaptively weighted. Therefore, in this embodiment of the invention, when the region to be tested contains only dark or only bright regions, the mean is used as the adaptive weight coefficient of the reference window.

[0062] Therefore, the ratio of the average gray value of pixels in the dark region corresponding to the test region in the dark channel image to the average gray value of pixels in the bright region is used as the first ratio; the ratio of the average gray value of pixels in the dark region corresponding to the test region in the spinal endoscopy grayscale image to the average gray value of pixels in the bright region is used as the second ratio. The average of the first ratio and the second ratio is used as the adaptive weight coefficient of the test region. The corresponding calculation formula can be specifically as follows:

[0063]

[0064] In the formula, Let g represent the adaptive weighting coefficients of the region to be measured, L represent the bright region, and A represent the dark region. L g represents the average grayscale value of pixels in the bright areas of a dark channel image. AI represents the average grayscale value of pixels in the dark area of ​​the dark channel image. L I represents the average grayscale value of pixels in the bright areas of a spinal endoscopy grayscale image. A This represents the average grayscale value of pixels in the dark area of ​​a spinal endoscopy grayscale image.

[0065] In the formula, Indicates the first ratio. The second ratio is calculated by taking the average grayscale value of corresponding pixels in the bright and dark regions of the dark channel image and the spinal endoscopy grayscale image, respectively. This can roughly obtain the grayscale distribution of pixels in the dark and bright regions of the dark channel image and the spinal endoscopy grayscale image. Regardless of whether it is the first ratio or the second ratio, its value is obtained by comparing a smaller number with a larger number, and to a certain extent, it represents the brightness ratio of the image. Therefore, this ratio can be used to weight pixels at different positions of the window to preserve their flocculent texture features.

[0066] It is understandable that in the general nonlocal mean filtering process, no weight is assigned to the label window of the pixel to be tested. Therefore, if the original algorithm is used to calculate the similarity between the label window and the reference window when noise is present, the calculation result will always be distorted. However, this invention avoids noise interference by using the dark channel image to locate the position of flocculent dark points. Then, by calculating the ratio of the gray values ​​of pixels in the bright and dark regions of the dark channel image and the spinal endoscopy grayscale image, the ratio is used as the weight allocation rule for the center point and neighboring points in the reference window, thereby increasing the similarity weight of the center point and effectively ensuring that the distribution structure of the alternating bright and dark areas of the flocculent region after denoising is not affected by noise.

[0067] Optionally, in some embodiments of the present invention, determining the target weights at each position of different reference windows based on the adaptive weight coefficient includes: performing Gaussian weighting on each position in each reference window, wherein the adaptive weight coefficient of the reference window is the ratio of the target weight at the center position to the target weight at the corner position of the corresponding reference window, and the sum of the target weights at all positions within the reference window is 1.

[0068] In other words, the reference window is weighted according to the Gaussian distribution rule, so that the ratio of the target weight at the center position to the target weight at the corner position is the adaptive weight coefficient of the corresponding test area. This can be combined with a more effective and reliable weighting rule to improve the accuracy of weighting processing, thereby improving the accuracy and reliability of the target weight at each position.

[0069] Therefore, it is possible to adaptively obtain the target weights corresponding to different positions of different reference windows. These target weights effectively combine the brightness and darkness distribution of the window itself, reduce the weights of non-center pixels, and effectively improve the processing effect of center pixels when calculating the mean square error in the subsequent process.

[0070] Optionally, in some embodiments of the present invention, determining the weighted mean square error between the marker window and the corresponding reference window based on the target weights of the marker window and any reference window at all positions and the difference in grayscale values ​​of pixels at the same position includes: in the grayscale image of a spinal endoscopy, calculating the square of the difference in grayscale values ​​of corresponding pixels at the same position between the marker window and any reference window as the grayscale value difference; calculating the product of the grayscale value difference and the target weight at the corresponding position as the weighted error at the corresponding position; and taking the mean of the weighted errors at all positions as the weighted mean square error between the marker window and the corresponding reference window. The specific calculation formula may be, for example:

[0071]

[0072] In the formula, M[α,β] represents the weighted mean square error of the marker window α and the reference window β, w represents the side length of the reference window, i represents the x-coordinate of the corresponding position in the marker window and the reference window, j represents the y-coordinate of the corresponding position in the marker window and the reference window, α(i,j) represents the gray value at the (i,j)th position in the marker window α, β(β,j) represents the gray value at the (i,j)th position in the reference window β, and ρ ij This represents the target weight at the (i, j)th position corresponding to the reference window β.

[0073] The traditional method for calculating the mean square error is to assign the same weight to each position in the reference window, i.e., ρ. ij Both are 1, while ρ ij (α(i,j)-β(i,j)) 2 The weighted error is represented by the product of the grayscale difference and the target weight at the corresponding position. The weights in the window are distributed in a Gaussian pattern from the center point to the edge, so that positions closer to the center point of the window have higher weights, thereby increasing the influence of other pixels around the center point. Combining the characteristics of the dense fibrous network structure of the nucleus pulposus region and the high-brightness strip structure of the nerve root region, the weighted mean square error can more completely and effectively preserve the grayscale features of the center point itself. In the embodiments of the present invention, the center pixel is used as the main factor in calculating the weighted mean square error by allocating weights, and the weights of non-center pixels are reduced. When calculating the weighted mean square error, the center pixel is enhanced to distinguish between bright and dark points, thereby effectively solving the problem of low distinguishability of the flocculent bright and dark parts of the nucleus pulposus region caused by noise interference, resulting in poor readability and distortion of image information after noise reduction.

[0074] S104: Determine the adaptive window weight of the reference window based on the number of pixels in the dark area of ​​the reference window and the weighted mean square error between the reference window and the marker window; perform non-local mean filtering denoising on the grayscale image of the spinal endoscopy based on the adaptive window weight of the reference window to obtain the target image.

[0075] Furthermore, in some embodiments of the present invention, determining the adaptive window weight of the reference window based on the number of pixels in the dark region of the reference window and the weighted mean square error between the reference window and the marker window includes: performing inverse proportional normalization on the weighted mean square error to obtain an error factor; calculating the ratio of the number of pixels in the dark region of the reference window to the total number of pixels in the reference window as a quantity ratio; and calculating the normalized value of the product of the error factor and the quantity ratio as the adaptive window weight of the reference window. The corresponding calculation formula can be specifically, for example, as follows:

[0076]

[0077] In the formula, Z(α,β) represents the adaptive window weight of the reference window β with respect to the marker window α, n represents the number of pixels in the dark region of the reference window β, and w represents the side length of the reference window. 2 M[α,β] represents the total number of pixels in the reference window, M[α,β] represents the weighted mean square error between the marker window α and the reference window β, e represents the natural constant, and G[] represents the normalization process. In one embodiment of the present invention, the normalization process can be, for example, the maximum and minimum value normalization process. Furthermore, the normalization in subsequent steps can all adopt the maximum and minimum value normalization process. In other embodiments of the present invention, other normalization methods can be selected according to the specific range of values, which will not be elaborated further.

[0078] In this embodiment of the invention, The value represents the ratio of the number of pixels. The larger the ratio, the greater the density of pixels in the dark area of ​​the corresponding reference window. Therefore, it is necessary to increase its weight to preserve the dark feature. Thus, while ensuring that the texture features of the flocculent area are not lost during the smoothing process, the weight allocation rule can be improved, and the accuracy and objectivity of the adaptive window weight can be enhanced.

[0079] Furthermore, in some embodiments of the present invention, the spinal endoscope grayscale image is subjected to nonlocal mean filtering denoising processing according to the adaptive window weight of the reference window to obtain the target image, including: based on the nonlocal mean filtering denoising algorithm, the denoised grayscale value of each pixel in the spinal endoscope grayscale image is calculated according to the adaptive window weight of the reference window to obtain the target image.

[0080] After obtaining the adaptive window weights for different reference windows, this invention can calculate the denoised grayscale values ​​of each pixel in the spinal endoscope grayscale image based on a nonlocal mean filtering denoising algorithm to obtain the target image. The nonlocal mean filtering denoising algorithm is a conventional denoising algorithm in the field. This invention improves the reliability of the nonlocal mean filtering denoising algorithm by refining the weighted mean square error and the adaptive window weights, enabling the target image to effectively denoise the spinal endoscope image while preserving the texture features of the nucleus pulposus and nerve root regions.

[0081] This invention identifies dark and bright regions in an image using dark channel imaging, and determines the nerve root and nucleus pulposus regions as the areas to be processed based on superpixel segmentation. The search window size is determined by the proportion of pixels in the dark region, and further, a marker window and a reference window are determined. The search window size can be adaptively obtained, thus effectively reducing the computational load while maintaining image processing quality, thereby improving processing efficiency. Based on the average grayscale values ​​of dark and bright regions in different areas of the dark channel image and the spinal endoscopy grayscale image, adaptive weight coefficients for different reference windows are obtained, thereby determining the weighted mean square error between the marker window and the corresponding reference window. This can be combined with the blurred characteristics of the flocculent texture in the nucleus pulposus region by allocating... The corresponding weights effectively preserve the fuzzy characteristics and improve the reliability of the weighted mean square error. By using the number of pixels in the dark area of ​​the reference window and the weighted mean square error between the reference window and the marker window, the adaptive window weight of the reference window is determined. Based on the adaptive window weight, the grayscale image of the spinal endoscope is subjected to nonlocal mean filtering for denoising to obtain the target image. This invention effectively preserves the flocculent characteristics of the nucleus pulposus region by processing the weighted mean square error of the reference window and the adaptive window weight, avoiding texture loss caused by smoothing filtering, and improving the reliability of the nonlocal mean filtering denoising algorithm. This allows the target image to improve the denoising effect of spinal endoscope imaging while preserving the texture features of the nucleus pulposus region and nerve root region.

[0082] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0083] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.

Claims

1. A locally adaptive noise reduction method for spinal endoscopy, characterized in that, The method includes: Acquire grayscale and dark channel images of the spinal endoscope; perform superpixel segmentation on the grayscale image of the spinal endoscope to obtain the nerve root region and nucleus pulposus region as the regions to be processed; determine the dark region and bright region based on the grayscale values ​​of the pixels in the dark channel image. The window side length of the search window is determined based on the number of pixels in the dark region of the dark channel image and the total number of all pixels. A test pixel is randomly selected from the region to be processed. The search window is determined with the test pixel as the center and the window side length as the length. A marker window is determined with the test pixel as the center. The marker window is smaller than the search window. The search window is traversed, and a reference window of the same size as the marker window is determined from the search window. Adaptive weighting coefficients for different reference windows are determined based on the mean gray values ​​of dark and bright regions in the dark channel image and the mean gray values ​​of dark and bright regions in the spinal endoscopy grayscale image, respectively. Target weights for each position of different reference windows are determined based on the adaptive weighting coefficients of the marker window and any reference window. The weighted mean square error between the marker window and the corresponding reference window is determined based on the target weights of the marker window and any reference window at all positions and the difference in gray values ​​of pixels at the same position. Based on the number of pixels in the dark region of the reference window and the weighted mean square error between the reference window and the marker window, the adaptive window weight of the reference window is determined; the spinal endoscopy grayscale image is then subjected to nonlocal mean filtering denoising processing based on the adaptive window weight of the reference window to obtain the target image.

2. The spinal endoscopy local adaptive noise reduction method as described in claim 1, characterized in that, The step of determining the window side length of the search window based on the number of pixels in the dark region of the dark channel image and the total number of all pixels includes: The ratio of the number of pixels in the dark region to the total number of pixels in the dark channel image is used as the dark pixel density. The product of the dark spot density and the preset window side length is used as the window side length of the search window.

3. The spinal endoscopy local adaptive noise reduction method as described in claim 1, characterized in that, The step of determining adaptive weighting coefficients for different reference windows based on the average gray values ​​of the dark and bright regions in the dark channel image and the average gray values ​​of the dark and bright regions in the spinal endoscopy grayscale image, respectively, includes: Use the area corresponding to any reference window as the area to be tested; In the dark channel image, the ratio of the average gray value of the pixels in the dark area to the average gray value of the pixels in the bright area is taken as the first ratio. In the grayscale image of the spinal endoscope, the ratio of the average grayscale value of the pixels in the dark area corresponding to the test area to the grayscale value of the pixels in the bright area is used as the second ratio. The average of the first ratio and the second ratio is used as the adaptive weight coefficient of the region to be tested. The region to be tested is changed to obtain the adaptive weight coefficient corresponding to each reference window.

4. The spinal endoscopy local adaptive noise reduction method as described in claim 1, characterized in that, The step of determining the target weights at different positions of the reference window based on the adaptive weight coefficients includes: Gaussian weighting is applied to each position in each of the reference windows, wherein the adaptive weight coefficient of the reference window is the ratio of the target weight at the center position to the target weight at the corner position, and the sum of the target weights at all positions in the reference window is 1.

5. The spinal endoscopy local adaptive noise reduction method as described in claim 1, characterized in that, The step of determining the weighted mean square error between the marker window and the corresponding reference window based on the target weights at all positions and the difference in grayscale values ​​of pixels at the same positions between the marker window and any reference window includes: In the grayscale image of the spinal endoscope, the square of the difference between the grayscale values ​​of corresponding pixels at the same position of the marker window and any reference window is calculated as the grayscale value difference. The product of the grayscale value difference and the target weight at the corresponding position is calculated as the weighted error at the corresponding position; The average of the weighted errors at all locations is used as the weighted mean square error between the marked window and the corresponding reference window.

6. The spinal endoscopy local adaptive noise reduction method as described in claim 1, characterized in that, The step of determining the adaptive window weight of the reference window based on the number of pixels in the dark region of the reference window and the weighted mean square error between the reference window and the marker window includes: The weighted mean square error is inversely normalized to obtain the error factor; The ratio of the number of pixels in the dark area of ​​the reference window to the total number of pixels in the reference window is used as the number ratio. The normalized value of the product of the error factor and the quantity ratio is used as the adaptive window weight of the reference window.

7. The spinal endoscopy local adaptive noise reduction method as described in claim 1, characterized in that, The step of performing nonlocal mean filtering denoising on the spinal endoscopy grayscale image based on the adaptive window weights of the reference window to obtain the target image includes: Based on the nonlocal mean filtering denoising algorithm, the denoised grayscale value of each pixel in the grayscale image of the spinal endoscope is calculated according to the adaptive window weight of the reference window to obtain the target image.

8. The spinal endoscopy local adaptive noise reduction method as described in claim 1, characterized in that, The step of determining the dark and bright regions based on the grayscale values ​​of pixels in the dark channel image includes: Sort the gray values ​​of all pixels in the dark channel image from low to high, calculate the difference between adjacent gray values ​​according to the sorting order, and determine the maximum difference. The smaller gray value of the pixel corresponding to the maximum difference is taken as the gray value threshold. The dark channel image is divided into dark and bright regions based on the gray value threshold, wherein the gray value of the pixels in the dark region is less than or equal to the gray value threshold, and the gray value of the pixels in the bright region is greater than the gray value threshold.