Interference stripe elimination method and interference stripe elimination device for endoscope image

An FPGA-based method for eliminating interference stripes in endoscopic images utilizes parallel detection and ring buffer technology, combined with the Sobel operator and gradient calculation, to eliminate horizontal and vertical stripe interference in medical endoscopes in real time. This solves the problem of existing technologies being unable to adjust and distinguish interference stripes in real time, thus improving the accuracy of surgical observation.

CN122048729APending Publication Date: 2026-05-15SCIVITA MEDICAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SCIVITA MEDICAL TECHNOLOGY CO LTD
Filing Date
2026-01-29
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

When using holmium lasers, medical endoscopes produce obvious horizontal and vertical stripe interference in the images, affecting surgical observation and judgment. Existing methods cannot adjust or distinguish between the real structure and the interference stripes in real time.

Method used

An FPGA-based method for eliminating interference stripes in endoscopic images is adopted. By detecting horizontal and vertical interference stripes in parallel and using a ring buffer for read and write control, interference stripes are eliminated in real time. The Sobel operator and gradient calculation are combined to achieve the identification and elimination of interference stripes.

Benefits of technology

It achieves low-latency and efficient elimination of interference stripes, meeting the real-time imaging requirements of medical endoscopic surgery and improving the observation accuracy of the surgical area.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122048729A_ABST
    Figure CN122048729A_ABST
Patent Text Reader

Abstract

The invention provides an interference stripe elimination method and an interference stripe elimination device for an endoscope image. The interference fringe elimination method for the endoscope image is realized based on an FPGA (Field Programmable Gate Array), and comprises the following steps: acquiring a current image frame output by an endoscope; performing transverse interference stripe detection and vertical interference stripe detection on the current image frame in parallel to determine whether interference stripes exist or not; performing read-write control on an annular buffer of the FPGA in response to the existence of transverse interference stripes or vertical interference stripes in the current image frame, writing image data of the current image frame into a storage area corresponding to a storage address pointed by a write-in pointer of the annular buffer, and controlling the pointing of the write-in pointer to remain unchanged, and writing the image data of the next image frame of the current image frame into the storage area of the image data of the current image frame to cover the image data of the current image frame, and controlling the reading pointer of the annular buffer to point to the previous storage address of the storage address pointed by the writing pointer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the technical fields of image processing, and in particular to a method and apparatus for eliminating interference stripes in endoscopic images. Background Technology

[0002] In medical endoscopic surgery, holmium lasers are commonly used for procedures such as tissue cutting, hemostasis, and lithotripsy. However, when holmium lasers are used simultaneously with endoscopes, factors such as direct reflection and scattering of the laser beam, as well as electromagnetic interference, cause significant horizontal and vertical stripe interference in the endoscopic images, severely affecting the surgeon's observation and judgment of the surgical area.

[0003] In traditional interference cancellation methods, optical filtering reduces image brightness and detail and cannot be adjusted in real time; software post-processing has a large delay and is not suitable for real-time surgery; simple threshold filtering has a high false detection rate and cannot distinguish between real structures and interference stripes; improved laser medium structure can reduce parasitic oscillations, but cannot solve the image interference that has already been generated. Summary of the Invention

[0004] This disclosure provides a method and apparatus for eliminating interference stripes in endoscopic images.

[0005] According to one aspect of this disclosure, a method for eliminating interference stripes in endoscopic images is provided, implemented based on an FPGA, comprising: Obtain the current image frame output by the endoscope; Perform horizontal and vertical interference stripe detection in parallel on the current image frame to determine whether interference stripes exist; In response to the presence of horizontal or vertical interference stripes in the current image frame, read / write control is performed on the FPGA's circular buffer. The image data of the current image frame is written to the storage area corresponding to the storage address pointed to by the write pointer of the circular buffer, and the writing pointer is kept unchanged. This allows the image data of the next image frame to be written to the storage area of ​​the current image frame's image data to overwrite the image data of the current image frame. The read pointer of the circular buffer is then controlled to point to the storage address preceding the storage address pointed to by the write pointer.

[0006] A method for eliminating interfering stripes in endoscopic images according to at least one embodiment of the present disclosure, the method further comprising: In response to the absence of interference stripes in the current image frame, read and write control is performed on the FPGA's ring buffer. The image data of the current image frame is written to the storage area corresponding to the storage address pointed to by the write pointer, and the read pointer of the ring buffer is controlled to point to the storage address pointed to by the write pointer. Then, the storage address pointed to by the write pointer is changed to the next storage address of the ring buffer.

[0007] According to at least one embodiment of the endoscopic image interference stripe elimination method of the present disclosure, when the number of image frames in which interference stripes are continuously detected has reached a preset upper limit, the current image frame is assumed to be free of interference stripes.

[0008] According to at least one embodiment of the present disclosure, a method for eliminating interference stripes in endoscopic images, wherein the detection of transverse interference stripes includes: Convert the RGB image of the current image frame to a grayscale image; The grayscale image is convolved using the Sobel vertical operator to obtain a vertical pixel gradient map. The vertical pixel gradient map is column-accumulated to obtain the column accumulation result; Calculate the gradient of the column accumulation result to obtain the pixel gradient change map; Calculate the region feature quantity based on the pixel gradient change map; The region feature quantity is compared with a preset threshold. When the region feature quantity is greater than or equal to the threshold, it is determined that there are horizontal interference stripes. The vertical interference stripe detection includes: Convert the RGB image of the current image frame to a grayscale image; The grayscale image is convolved using the Sobel horizontal operator to obtain a horizontal pixel gradient map. The horizontal pixel gradient map is accumulated row by row to obtain the row accumulation result; Calculate the gradient of the row accumulation result to obtain the pixel gradient change map; Calculate the region feature quantity based on the pixel gradient change map; The region feature quantity is compared with a preset threshold. When the region feature quantity is greater than or equal to the threshold, it is determined that there are vertical interference stripes.

[0009] According to at least one embodiment of the present disclosure, a method for eliminating interference stripes in endoscopic images, wherein converting the RGB image of the current image frame into a grayscale image includes: Image conversion of RGB images is performed based on the formula Gray=0.a×R+0.b×G+0.c×B; Where 0.a, 0.b, and 0.c are conversion coefficients; In this process, the conversion coefficients are expanded to integers in the FPGA, and after multiplication and addition operations, they are shifted and restored to achieve approximate decimal operations.

[0010] According to at least one embodiment of the endoscopic image interference stripe elimination method of the present disclosure, the conversion coefficient preferably satisfies 0.a+0.b+0.c=1.

[0011] According to at least one embodiment of the endoscopic image interference stripe elimination method of the present disclosure, the step of performing a convolution operation on the grayscale image using the Sobel vertical operator to obtain a vertical pixel gradient map includes: Using a first FIFO and a second FIFO as row buffers, the three rows of data of the grayscale image are extracted and convolved with a 3×3 Sobel vertical operator. The depth of each FIFO is equal to the row width of the grayscale image and is used to store a whole row of data. The first FIFO and the second FIFO respectively buffer the first two rows of data of the currently extracted row of data of the grayscale image, and the third row of data of the three rows is the currently extracted row of data. The Sobel vertical operator is as follows: .

[0012] According to at least one embodiment of the present disclosure, a method for eliminating interference stripes in endoscopic images, wherein the step of performing a convolution operation on the grayscale image using the Sobel horizontal operator to obtain a horizontal pixel gradient map includes: The third and fourth FIFOs are used as row buffers. The three rows of data of the grayscale image are extracted and convolved with a 3×3 Sobel horizontal operator. The depth of each FIFO is equal to the row width of the grayscale image and is used to store a whole row of data. The third and fourth FIFOs respectively buffer the first two rows of data of the currently extracted row of data of the grayscale image. The third row of data of the three rows is the currently extracted row of data. The Sobel level operator is: .

[0013] According to at least one embodiment of the present disclosure, the method for eliminating interference stripes in an endoscope image, wherein the vertical pixel gradient map is a feature map of the same size as the grayscale image, and each pixel value of the vertical pixel gradient map is a gradient value obtained by multiplying the corresponding pixel in the grayscale image and its 3×3 neighboring pixel values ​​with the weights of the Sobel vertical operator and summing them. The horizontal pixel gradient map is a feature map with the same size as the grayscale image, wherein each pixel value of the horizontal pixel gradient map is a gradient value obtained by multiplying the corresponding pixel in the grayscale image and its 3×3 neighboring pixel values ​​with the weights of the Sobel horizontal operator and summing them.

[0014] According to at least one embodiment of the endoscopic image interference stripe elimination method of the present disclosure, in the detection of horizontal interference stripes, the step of column accumulation of the vertical pixel gradient map to obtain the column accumulation result includes: For each row of the vertical pixel gradient map, the gradient values ​​of all pixels in that row are summed to obtain the cumulative value of that row; the column accumulation result is a one-dimensional array composed of the cumulative values ​​of all rows of the vertical pixel gradient map. In the FPGA, a dedicated FIFO (FIFO3 in the figure) for horizontal interference stripe detection is used to cache the accumulated result of each row in sequence, and a copy is synchronously cached in the second random access memory. In the vertical interference stripe detection, the step of performing row accumulation on the horizontal pixel gradient map to obtain the row accumulation result includes: For each column of the horizontal pixel gradient map, the gradient values ​​of all pixels in that column are summed to obtain the cumulative value of that column. The row accumulation result is a one-dimensional array composed of the cumulative values ​​of all columns of the horizontal pixel gradient map. In the FPGA, a first random access memory is used for row accumulation. Each time, the accumulation result in the first random access memory is read and accumulated with a new row, and then stored in the first random access memory. After the accumulation calculation of the last row of the current image frame, a copy is synchronously cached in the second random access memory.

[0015] According to at least one embodiment of the endoscopic image interference stripe elimination method of the present disclosure, in the horizontal interference stripe detection, the step of calculating the gradient of the column accumulation result to obtain a pixel gradient change map includes: In the FPGA, a first register is used to store the accumulated value of the current row in the column accumulation result. The first register captures input data in each clock cycle and outputs the input data captured in the previous clock cycle in the next clock cycle, thereby realizing a one-clock-cycle delay and obtaining a one-beat delay data. The accumulated value of the current row is subtracted from the one-beat delay data to obtain the gradient value of the current row. The gradient values ​​of all rows are combined into a one-dimensional array to form the pixel gradient change map. The pixel gradient change map is synchronously cached in the third random access memory. In the vertical interference stripe detection, calculating the gradient of the row accumulation result to obtain a pixel gradient change map includes: In the FPGA, a second register is used to store the accumulated value of the current column in the row accumulation result. This second register captures input data in each clock cycle and outputs the input data captured in the previous clock cycle in the next clock cycle, thereby realizing a one-clock-cycle delay and obtaining a one-beat delay data. The accumulated value of the current column is subtracted from the one-beat delay data to obtain the gradient value of the current column. The gradient values ​​of all columns are combined into a one-dimensional array to form the pixel gradient change map. The pixel gradient change map is synchronously cached in a third random access memory.

[0016] According to at least one embodiment of the endoscopic image interference stripe elimination method of the present disclosure, in the detection of transverse interference stripes, the calculation of region feature quantities based on the pixel gradient change map includes: Using the location of the maximum absolute value of the gradient in the pixel gradient change map as the center, the regions on the left and right sides of the center are selected as the read addresses of the second random access memory and the third random access memory according to a preset configuration range. The maximum value of the column summation result read from the second random access memory is taken as the first region feature quantity; The difference between the maximum and minimum gradient values ​​read from the third random access memory is used as the second region feature quantity.

[0017] According to at least one embodiment of the endoscopic image interference stripe elimination method of the present disclosure, in the vertical interference stripe detection, the calculation of region feature quantities based on the pixel gradient change map includes: Using the location of the maximum absolute value of the gradient in the pixel gradient change map as the center, the regions above and below the center are selected as the read addresses of the second random access memory and the third random access memory according to a preset configuration range. The maximum value of the row accumulation result read from the second random access memory is taken as the first region feature quantity; The difference between the maximum and minimum gradient values ​​read from the third random access memory is used as the second region feature quantity.

[0018] According to at least one embodiment of the present disclosure, a method for eliminating interference stripes in endoscopic images, wherein comparing the region feature quantity with a preset threshold, and determining the presence of transverse interference stripes when the region feature quantity is greater than or equal to the threshold, includes: The first region feature value is compared with a preset first threshold, and the second region feature value is compared with a preset second threshold. When the first region feature value or the second region feature value is greater than or equal to the first threshold or the second threshold, it is determined that there are horizontal interference stripes in the current image frame.

[0019] According to at least one embodiment of the present disclosure, a method for eliminating interference stripes in endoscopic images, wherein comparing the region feature quantity with a preset threshold, and determining the presence of vertical interference stripes when the region feature quantity is greater than or equal to the threshold, includes: The first region feature value is compared with a preset first threshold, and the second region feature value is compared with a preset second threshold. When the first region feature value or the second region feature value is greater than or equal to the first threshold or the second threshold, it is determined that there are vertical interference stripes in the current image frame.

[0020] According to another aspect of this disclosure, an interference stripe elimination device for endoscopic images is provided, the device being implemented based on an FPGA, comprising: Horizontal interference stripe detection module; Vertical interference stripe detection module; The horizontal interference stripe detection module and the vertical interference stripe detection module perform horizontal and vertical interference stripe detection in parallel on the current image frame output by the endoscope to determine whether interference stripes exist. A circular buffer, in response to the presence of horizontal or vertical interference stripes in the current image frame, performs read and write control on the circular buffer, writes the image data of the current image frame into the storage area corresponding to the storage address pointed to by the write pointer of the circular buffer, and controls the writing pointer to remain unchanged, so that the image data of the next image frame is written into the storage area of ​​the image data of the current image frame to overwrite the image data of the current image frame, and controls the read pointer of the circular buffer to point to the storage address above the storage address pointed to by the write pointer.

[0021] An interference stripe elimination apparatus according to at least one embodiment of the present disclosure further includes: an image conversion module that converts the RGB image of the current image frame into a grayscale image.

[0022] According to at least one embodiment of the interference stripe elimination apparatus of this disclosure, the transverse interference stripe detection module includes: The first convolution operation module uses the Sobel vertical operator to perform convolution operation on the grayscale image to obtain a vertical pixel gradient map. A column accumulation module performs column accumulation on the vertical pixel gradient map to obtain a column accumulation result. A gradient calculation module calculates the gradient of the column accumulation result to obtain a pixel gradient change map; A region feature calculation module calculates region features based on the pixel gradient change map; A horizontal interference stripe detection module compares the region feature quantity with a preset threshold, and determines the presence of horizontal interference stripes when the region feature quantity is greater than or equal to the threshold. The vertical interference stripe detection includes: The second convolution operation module uses the Sobel horizontal operator to perform convolution operation on the grayscale image to obtain a horizontal pixel gradient map. A row accumulation module performs row accumulation on the horizontal pixel gradient map to obtain a row accumulation result. The gradient calculation module calculates the gradient of the row accumulation result to obtain a pixel gradient change map. A region feature calculation module calculates region features based on the pixel gradient change map; The vertical interference stripe detection module compares the region feature quantity with a preset threshold, and determines the presence of vertical interference stripes when the region feature quantity is greater than or equal to the threshold. Attached Figure Description

[0023] The accompanying drawings illustrate exemplary embodiments of the present disclosure and, together with the description thereof, serve to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification.

[0024] Figure 1 This is a schematic flowchart of a method for eliminating interference stripes in endoscopic images according to one embodiment of the present disclosure.

[0025] Figure 2 This is a flowchart illustrating another embodiment of the interference stripe elimination method of this disclosure.

[0026] Figure 3 This is a schematic diagram of the transverse interference stripe detection process in the interference stripe detection method disclosed herein.

[0027] Figure 4 This is a schematic diagram of the vertical interference stripe detection process in the interference stripe detection method disclosed herein.

[0028] Figure 5 This is a schematic block diagram of the structure of an interference stripe elimination device according to one embodiment of the present disclosure.

[0029] Figure 6 This is a schematic block diagram of an FPGA structure for implementing transverse interference stripe detection according to one embodiment of the present disclosure.

[0030] Figure 7 This is a schematic block diagram of an FPGA structure for detecting vertical interference stripes according to one embodiment of the present disclosure. Detailed Implementation

[0031] The present disclosure will now be described in further detail with reference to the accompanying drawings and examples. It should be understood that the specific examples described herein are for illustrative purposes only and are not intended to limit the scope of the disclosure. Furthermore, it should be noted that, for ease of description, only the parts relevant to the present disclosure are shown in the accompanying drawings.

[0032] It should be noted that, where there is no conflict, the embodiments and features described in this disclosure can be combined with each other. The technical solutions of this disclosure will now be described in detail with reference to the accompanying drawings and embodiments.

[0033] Figure 1 This is a schematic flowchart of a method for eliminating interference stripes in endoscopic images according to one embodiment of the present disclosure.

[0034] refer to Figure 1 In some embodiments of this disclosure, the interference stripe elimination method M100 for endoscopic images is implemented based on an FPGA, including: S102. Obtain the current image frame output by the endoscope; S104. Perform horizontal interference stripe detection and vertical interference stripe detection in parallel on the current image frame to determine whether interference stripes exist; S106. In response to the presence of horizontal or vertical interference stripes in the current image frame, read / write control is performed on the FPGA's ring buffer. The image data of the current image frame is written to the storage area corresponding to the storage address pointed to by the write pointer of the ring buffer, and the writing pointer is kept unchanged. The image data of the next image frame is written to the storage area of ​​the current image frame's image data to cover the image data of the current image frame. The read pointer of the ring buffer is controlled to point to the storage address above the storage address pointed to by the write pointer.

[0035] The interference stripe elimination method for endoscopic images disclosed herein is implemented based on FPGA. By acquiring the current image frame output by the endoscope, horizontal and vertical interference stripe detection are performed in parallel on the image frame to determine whether interference stripes exist. If interference exists, interference elimination is achieved by reading and writing to the FPGA's ring buffer.

[0036] Specifically, a circular buffer is a circular storage structure used to continuously store image frame data. The write pointer points to the storage address of the current write position, corresponding to a storage area (memory block, used to store one frame of image data). When interference is detected, the write pointer remains unchanged, allowing the next frame of data to overwrite the current interfering frame data, while the read pointer points to the previous storage address (i.e., the area of ​​the previous normal frame), thereby outputting (to the host computer) the previous frame image and avoiding the display of images with interference stripes.

[0037] The interference stripe elimination method disclosed herein achieves low-latency interference stripe detection and elimination through parallel processing and pipeline mechanism of FPGA, which can meet the real-time imaging requirements in medical endoscopic surgery and improve the accuracy of surgical area observation.

[0038] Figure 2 This is a flowchart illustrating another embodiment of the interference stripe elimination method of this disclosure.

[0039] refer to Figure 2 In some embodiments of this disclosure, the interference stripe elimination method M100 further includes: S106. In response to the absence of interference stripes in the current image frame, read and write control is performed on the FPGA's ring buffer. The image data of the current image frame is written to the storage area corresponding to the storage address pointed to by the write pointer, and the read pointer of the ring buffer is controlled to point to the storage address pointed to by the write pointer. Then, the storage address pointed to by the write pointer is changed to the next storage address of the ring buffer.

[0040] In the absence of interference stripes in the current image frame, the interference stripe elimination method disclosed herein ensures the normal storage and retrieval of image frame data by controlling the read and write operations of the FPGA's ring buffer.

[0041] Specifically, when there are no interference stripes, the current image frame data is written to the storage area (memory block, used to store one frame of data) corresponding to the storage address pointed to by the write pointer, and the read pointer is pointed to that address to achieve synchronous reading and output to the host computer for display; then, the write pointer is pushed to the next storage address to prepare space for subsequent frames.

[0042] In the above-disclosed method for eliminating interference stripes, preferably, when the number of image frames in which interference stripes are continuously detected has reached a preset upper limit, the current image frame is assumed to be free of interference stripes.

[0043] Figure 3 This is a schematic diagram of the transverse interference stripe detection process in the interference stripe detection method disclosed herein.

[0044] refer to Figure 3In some embodiments of this disclosure, the transverse interference stripe detection described above includes: S302. Convert the RGB image of the current image frame into a grayscale image; S304. Perform convolution operation on the grayscale image using the Sobel vertical operator to obtain a vertical pixel gradient map; S306. Perform column accumulation on the vertical pixel gradient map to obtain the column accumulation result; S308. Calculate the gradient of the column accumulation result to obtain the pixel gradient change map; S310. Calculate the region feature quantity based on the pixel gradient change map; S312. Compare the region feature quantity with a preset threshold. When the region feature quantity is greater than or equal to the threshold, it is determined that there are horizontal interference stripes.

[0045] Figure 4 This is a schematic diagram of the vertical interference stripe detection process in the interference stripe detection method disclosed herein.

[0046] refer to Figure 4 In some embodiments of this disclosure, the vertical interference stripe detection described above includes: S402. Convert the RGB image of the current image frame into a grayscale image; S404. Perform a convolution operation on the grayscale image using the Sobel horizontal operator to obtain a horizontal pixel gradient map; S406. Perform row accumulation on the horizontal pixel gradient map to obtain the row accumulation result; S408. Calculate the gradient of the row accumulation result to obtain the pixel gradient change map; S410. Calculate the region feature quantity based on the pixel gradient change map; S412. Compare the region feature quantity with a preset threshold. When the region feature quantity is greater than or equal to the threshold, it is determined that there are vertical interference stripes.

[0047] The horizontal interference stripe detection method disclosed herein first converts the RGB image of the current image frame into a grayscale image. The grayscale image is obtained by converting color pixels into single-channel brightness values ​​through weighted averaging, reducing computational complexity and facilitating subsequent edge detection. Next, a Sobel vertical operator is used to convolve the grayscale image. The Sobel vertical operator can be a 3×3 matrix kernel that highlights vertical gradient changes. The convolution process generates a vertical pixel gradient map by multiplying the kernel with the image pixels, highlighting the edge features of the horizontal stripes. Then, the vertical pixel gradient map is column-accumulated, i.e., the gradient values ​​of each row of pixels are summed to obtain a one-dimensional column accumulation result, compressing the data and amplifying inter-row differences. The gradient of the above row accumulation result, i.e., the difference between the accumulated values ​​of adjacent rows, is calculated to form a pixel gradient change map, capturing the abrupt changes in the stripes. Regional feature quantities are calculated based on the pixel gradient change map. Finally, the regional feature quantities are compared with a preset threshold; if the threshold is exceeded, horizontal interference stripes are determined to exist.

[0048] The detection process for vertical interference stripes is similar to that for horizontal stripes, using the Sobel horizontal operator to extract the horizontal pixel gradient map, which will not be described in detail here.

[0049] The detection processes for horizontal and vertical interference stripes described above are implemented using a parallel pipeline on an FPGA to ensure low-latency processing. The "convolution operation" utilizes a FIFO as a row buffer in the FPGA to retrieve, for example, three rows of data for calculation in real time, avoiding full-frame storage overhead.

[0050] The detection process for horizontal and vertical interference stripes disclosed herein enables the identification of both horizontal and vertical interference stripes, thereby improving the real-time image quality of medical endoscopic surgery.

[0051] In a preferred embodiment of the present disclosure, the method for eliminating interference stripes in endoscopic images according to the above embodiments includes, as described above, converting the RGB image of the current image frame into a grayscale image, comprising: Image conversion of RGB images is performed based on the formula Gray=0.a×R+0.b×G+0.c×B; Where 0.a, 0.b, and 0.c are conversion coefficients; In this process, the conversion coefficients are expanded to integers in the FPGA, and after multiplication and addition operations, they are shifted and restored to achieve approximate decimal operations.

[0052] In a preferred embodiment of this disclosure, the conversion of the RGB image of the current image frame to a grayscale image uses the standard weighted average formula Gray = 0.2989 × R + 0.5870 × G + 0.1140 × B, where the coefficients 0.2989, 0.5870, and 0.1140 correspond to the human eye's sensitivity to the brightness of the three primary colors, red, green, and blue, respectively, ensuring that the converted grayscale value accurately reflects the image brightness information. The above formula involves decimal multiplication, which is not suitable for direct implementation of floating-point operations in FPGA hardware. Therefore, this disclosure expands the coefficients to integers (e.g., by multiplying by an appropriate factor), performs integer multiplication and addition operations first, and then restores the original value through right shifting, achieving approximate decimal calculation. This avoids the use of resource-intensive floating-point units, significantly reducing hardware overhead and computational latency, and improving the overall efficiency and real-time performance of interference stripe detection.

[0053] Preferably, the above conversion coefficients preferably satisfy 0.a+0.b+0.c=1.

[0054] For the method of eliminating interference stripes in endoscopic images disclosed herein, preferably, the step of performing a convolution operation on the grayscale image using the Sobel vertical operator to obtain a vertical pixel gradient map includes: Using a first FIFO and a second FIFO as row buffers, the three rows of data of the grayscale image are extracted and convolved with a 3×3 Sobel vertical operator. The depth of each FIFO is equal to the row width of the grayscale image and is used to store a whole row of data. The first FIFO and the second FIFO respectively buffer the first two rows of data of the currently extracted row of data of the grayscale image, and the third row of data of the three rows is the currently extracted row of data. The Sobel vertical operator is as follows: .

[0055] In a preferred embodiment of this disclosure, the Sobel vertical operator is a 3×3 matrix kernel used to calculate the pixel gradient in the vertical direction of the image. This Sobel vertical operator highlights horizontal edge variations through weighted difference between the left and right columns, making it suitable for detecting horizontal interference stripes such as those caused by holmium lasers. The "convolution operation" refers to summing the kernel with the corresponding pixel of the grayscale image and its 3×3 neighborhood point by point to generate a vertical pixel gradient map of the same size as the original image.

[0056] In the FPGA hardware implementation, two FIFOs (first FIFO and second FIFO) are used as line buffers with a depth equal to the number of pixels in the image row. The first two rows of data are cached in real time, and the current pixel row is directly input to form three rows of data in the sliding window. This avoids storing the entire frame image and only requires a small amount of buffer resources to calculate the convolution result pixel by pixel in parallel.

[0057] This implementation solves the problems of traditional convolution requiring large-capacity memory and high latency, realizes pipelined processing, outputs a pixel gradient value every clock cycle, significantly reduces computation latency, and reduces hardware resource consumption.

[0058] For the method of eliminating interference stripes in endoscopic images disclosed herein, preferably, the step of performing a convolution operation on the grayscale image using the Sobel horizontal operator to obtain a horizontal pixel gradient map includes: The third and fourth FIFOs are used as row buffers. The three rows of data of the grayscale image are extracted and convolved with a 3×3 Sobel horizontal operator. The depth of each FIFO is equal to the row width of the grayscale image and is used to store a whole row of data. The third and fourth FIFOs respectively buffer the first two rows of data of the currently extracted row of data of the grayscale image. The third row of data of the three rows is the currently extracted row of data. The Sobel level operator is: .

[0059] In a preferred embodiment of this disclosure, the Sobel horizontal operator is a 3×3 matrix kernel used to calculate the pixel gradient in the horizontal direction of the image. This Sobel horizontal operator highlights vertical edge changes through up-down weighted difference and is suitable for detecting vertical interference stripes such as those caused by holmium lasers. The "convolution operation" refers to summing the kernel with the corresponding pixel of the grayscale image and its 3×3 neighborhood point by point to generate a horizontal pixel gradient map with the same size as the original image.

[0060] In the FPGA hardware implementation, vertical interference stripe detection is performed independently and in parallel with horizontal interference stripe detection. The third and fourth FIFOs are used as row buffers with a depth equal to the number of pixels in the image row. The first two rows of data are cached in real time, and the current pixel row is directly input to form three rows of data in the sliding window. The convolution with the horizontal stripe detection achieves a symmetrical structure, avoiding full-frame storage. Only a small amount of buffer resources are needed to pipeline the convolution result pixel by pixel.

[0061] In some embodiments of the method for eliminating interference stripes in endoscopic images described above in this disclosure, the vertical pixel gradient map is a feature map with the same size as the grayscale image, wherein each pixel value of the vertical pixel gradient map is a gradient value obtained by multiplying the corresponding pixel in the grayscale image and its 3×3 neighboring pixel values ​​with the weights of the Sobel vertical operator and summing them.

[0062] In some embodiments of the method for eliminating interference stripes in endoscopic images described above in this disclosure, the horizontal pixel gradient map is a feature map with the same size as the grayscale image, wherein each pixel value of the horizontal pixel gradient map is a gradient value obtained by multiplying the corresponding pixel in the grayscale image and its 3×3 neighboring pixel values ​​with the weights of the Sobel horizontal operator and summing them.

[0063] For each of the above embodiments, preferably, in the horizontal interference stripe detection, the step of column accumulation of the vertical pixel gradient map to obtain the column accumulation result includes: For each row of the vertical pixel gradient map, the gradient values ​​of all pixels in that row are summed to obtain the cumulative value of that row; the column accumulation result is a one-dimensional array composed of the cumulative values ​​of all rows of the vertical pixel gradient map. In the FPGA, a dedicated FIFO (FIFO3 in the figure) for horizontal interference stripe detection is used to cache the accumulated result of each row in sequence, and a copy is synchronously cached in the second random access memory.

[0064] The column accumulation processing described in this embodiment compresses the two-dimensional features of the vertical pixel gradient map into a one-dimensional signal. By accumulating pixel gradient values ​​row by row, it effectively amplifies the inter-row differences caused by horizontal stripes. In the FPGA implementation, a dedicated FIFO (FIFO3) can be used as a pipeline buffer to store the accumulation results in row order, avoiding the storage of the entire frame image while maintaining the temporal continuity of the data.

[0065] This implementation method synchronously caches the data to a second random access memory, enabling the subsequent gradient calculation module to quickly access historical row data and perform inter-row difference calculation.

[0066] This implementation solves the problems of high feature extraction dimensionality and computational complexity in traditional image processing, reduces the detection complexity of horizontal interference stripes, significantly improves processing speed, and ensures the accuracy of feature extraction.

[0067] For each of the above embodiments, preferably, in the vertical interference stripe detection, the step of performing row accumulation on the horizontal pixel gradient map to obtain the row accumulation result includes: For each column of the horizontal pixel gradient map, the gradient values ​​of all pixels in that column are summed to obtain the cumulative value of that column. The row accumulation result is a one-dimensional array composed of the cumulative values ​​of all columns of the horizontal pixel gradient map. In the FPGA, a first random access memory is used for row accumulation. Each time, the accumulation result in the first random access memory is read and accumulated with a new row, and then stored in the first random access memory. After the accumulation calculation of the last row of the current image frame, a copy is synchronously cached in the second random access memory.

[0068] The row accumulation processing in this embodiment converts the two-dimensional features of the horizontal pixel gradient map into a one-dimensional signal. By accumulating the gradient values ​​of each column of pixels, the inter-column differences caused by the vertical stripes are highlighted.

[0069] In this embodiment, preferably, unlike horizontal stripe detection, vertical stripe detection uses a first random access memory to implement row accumulation. By updating the column accumulation value row by row, the requirement to store the entire column of the image is avoided.

[0070] This implementation leverages the random access capabilities of FPGAs, requiring only the reading and updating of the accumulated result from the previous row when processing the current row, significantly reducing storage resource consumption. At the end of the frame, the data is synchronously cached into a second random access memory, providing a data foundation for subsequent gradient calculations and feature extraction.

[0071] This implementation achieves real-time and accurate detection of vertical interference stripes.

[0072] For the methods for eliminating interference stripes in endoscopic images according to the above embodiments, preferably, in the detection of horizontal interference stripes, calculating the gradient of the column accumulation result to obtain a pixel gradient change map includes: In the FPGA, a first register stores the accumulated value of the current row in the column accumulation result. The first register captures input data in each clock cycle and outputs the input data captured in the previous clock cycle in the next clock cycle, thereby achieving a one-clock-cycle delay and obtaining a one-beat delay data. The accumulated value of the current row is subtracted from the one-beat delay data to obtain the gradient value of the current row. The gradient values ​​of all rows are combined into a one-dimensional array to form the pixel gradient change map. The pixel gradient change map is synchronously cached in a third random access memory.

[0073] This implementation uses a single register to calculate inter-row gradients. A one-clock-cycle delay mechanism is used to obtain the difference between the accumulated values ​​of adjacent rows, forming a pixel gradient change map reflecting abrupt changes between rows. This method avoids using FIFO or RAM for multi-row data storage, using only one register to calculate the difference between adjacent row data, significantly reducing hardware resource consumption. Simultaneously, the single-clock-cycle delay design ensures low latency in the calculation process, effectively capturing abrupt changes in the horizontal interference stripes and providing an accurate data foundation for subsequent regional feature extraction.

[0074] Preferably, in the vertical interference stripe detection, calculating the gradient of the row accumulation result to obtain a pixel gradient change map includes: In the FPGA, a second register is used to store the accumulated value of the current column in the row accumulation result. This second register captures input data in each clock cycle and outputs the input data captured in the previous clock cycle in the next clock cycle, thereby realizing a one-clock-cycle delay and obtaining a one-beat delay data. The accumulated value of the current column is subtracted from the one-beat delay data to obtain the gradient value of the current column. The gradient values ​​of all columns are combined into a one-dimensional array to form the pixel gradient change map. The pixel gradient change map is synchronously cached in a third random access memory.

[0075] This implementation uses a single register to calculate inter-column gradients. A one-cycle delay mechanism is used to obtain the difference between the accumulated values ​​of adjacent columns, forming a pixel gradient change map reflecting abrupt changes between columns. This method uses only one register to complete the difference calculation of adjacent column data, requiring no additional storage resources and solving the problem of high resource consumption in traditional difference calculations. The single-cycle delay design of this implementation ensures low latency in vertical interference stripe detection, accurately capturing the abrupt changes in vertical stripes and providing high-quality data for subsequent feature extraction.

[0076] For the above-mentioned related embodiments, preferably, in the endoscopic image interference stripe elimination method of this disclosure, the step of calculating the region feature quantity based on the pixel gradient change map in the horizontal interference stripe detection includes: Using the location of the maximum absolute value of the gradient in the pixel gradient change map as the center, the regions on the left and right sides of the center are selected as the read addresses of the second random access memory and the third random access memory according to a preset configuration range. The maximum value of the column summation result read from the second random access memory is taken as the first region feature quantity; The difference between the maximum and minimum gradient values ​​read from the third random access memory is used as the second region feature quantity.

[0077] In a preferred embodiment of this disclosure, the above-mentioned regional feature calculation takes the position of the maximum absolute value of the gradient in the pixel gradient change map as the center, and selects the regions on the left and right sides of the center according to a preset configuration range (such as the number of pixels dynamically set by the user) as the read addresses of the second random access memory (stores the column accumulation result) and the third random access memory (stores the pixel gradient change map).

[0078] The maximum value of the column summation result read from the second random access memory is used as the first region feature quantity, reflecting the overall intensity of the horizontal stripes within the region; the difference between the maximum and minimum values ​​of the gradient values ​​read from the third random access memory is used as the second region feature quantity, quantifying the abrupt change amplitude of the stripe edges.

[0079] Among them, "regional feature quantity" refers to the quantitative index extracted from the local region, which is used for the fine characterization of interference stripes.

[0080] This implementation solves the technical problems of traditional global feature extraction being sensitive to noise and having a high false detection rate. By using center-guided local window analysis, it avoids interference from irrelevant areas, achieves accurate positioning of horizontal stripes, enhances detection stability, reduces computational overhead, and ensures efficient execution in the FPGA pipeline, making it suitable for real-time endoscopic image processing.

[0081] For the above-mentioned related embodiments, preferably, in the method for eliminating interference stripes in endoscopic images disclosed herein, the step of calculating the region feature quantity based on the pixel gradient change map in the vertical interference stripe detection includes: Using the location of the maximum absolute value of the gradient in the pixel gradient change map as the center, the regions above and below the center are selected as the read addresses of the second random access memory and the third random access memory according to a preset configuration range. The maximum value of the row accumulation result read from the second random access memory is taken as the first region feature quantity; The difference between the maximum and minimum gradient values ​​read from the third random access memory is used as the second region feature quantity.

[0082] In a preferred embodiment of this disclosure, the calculation of the aforementioned regional feature quantity is centered on the location of the maximum absolute value of the gradient in the pixel gradient change map. Regions above and below this center are selected according to a preset configuration range (such as a number of pixels dynamically set by the user) as the read addresses for the second random access memory (storing row accumulation results) and the third random access memory (storing pixel gradient change maps). The maximum value of the row accumulation result read from the second random access memory is taken as the first regional feature quantity, reflecting the overall intensity of the vertical stripes within the region. The difference between the maximum and minimum gradient values ​​read from the third random access memory is taken as the second regional feature quantity, quantifying the abrupt change amplitude of the stripe edges.

[0083] Among them, "regional feature quantity" refers to the quantitative index extracted from the local region, which is used for the fine characterization of interference stripes.

[0084] This implementation solves the technical problems of traditional global feature extraction being sensitive to noise and having a high false detection rate. By using center-guided local window analysis, it avoids interference from irrelevant areas, achieves accurate positioning of vertical stripes, enhances detection stability, reduces computational overhead, and ensures efficient execution in the FPGA pipeline.

[0085] For the above-mentioned related implementation methods, preferably, the step of comparing the region feature quantity with a preset threshold, and determining the presence of transverse interference stripes when the region feature quantity is greater than or equal to the threshold, includes: The first region feature value is compared with a preset first threshold, and the second region feature value is compared with a preset second threshold. When the first region feature value or the second region feature value is greater than or equal to the first threshold or the second threshold, it is determined that there are horizontal interference stripes in the current image frame.

[0086] In a preferred embodiment of this disclosure, the threshold determination compares the feature quantity of the first region with a preset first threshold and the feature quantity of the second region with a preset second threshold. When any feature quantity is greater than or equal to the corresponding threshold, it is determined that there are horizontal interference stripes.

[0087] Here, the "threshold" is a preset numerical limit used to distinguish interference signals from normal image features. This implementation solves the technical problems of high false detection rate and inability to distinguish real structures in traditional simple threshold filtering. By using the "OR" logic judgment of dual feature quantities, it improves the sensitivity and robustness of detection, achieves accurate identification of horizontal stripes, and reduces computational complexity, ensuring the efficiency of FPGA real-time processing.

[0088] For the above-mentioned related implementation methods, preferably, the step of comparing the region feature quantity with a preset threshold, and determining the presence of vertical interference stripes when the region feature quantity is greater than or equal to the threshold, includes: The first region feature value is compared with a preset first threshold, and the second region feature value is compared with a preset second threshold. When the first region feature value or the second region feature value is greater than or equal to the first threshold or the second threshold, it is determined that there are vertical interference stripes in the current image frame.

[0089] In a preferred embodiment of this disclosure, the threshold determination compares the feature quantity of the first region with a preset first threshold and the feature quantity of the second region with a preset second threshold. When any feature quantity is greater than or equal to the corresponding threshold, it is determined that there are vertical interference stripes.

[0090] It should be noted that the first and second thresholds set during the vertical interference stripe detection process are independent of the first and second thresholds set during the horizontal interference stripe detection process. That is, the "first threshold and second threshold" can be set separately in the two detection processes.

[0091] Here, "threshold" refers to a preset numerical limit used to distinguish interference signals from normal image features. This implementation solves the technical problems of high false detection rate and inability to distinguish real structures in traditional simple threshold filtering. By using "OR" logic judgment of dual features, it improves the sensitivity and robustness of detection, achieves accurate identification of vertical stripes, and reduces computational complexity, ensuring the efficiency of FPGA real-time processing.

[0092] Based on the methods for eliminating interference stripes in endoscopic images according to the various embodiments described above, this disclosure also provides an apparatus for eliminating interference stripes in endoscopic images.

[0093] Figure 5 This is a schematic block diagram of the structure of an interference stripe elimination device according to one embodiment of the present disclosure.

[0094] refer to Figure 5 In some embodiments of this disclosure, the interference stripe elimination device for endoscopic images is implemented based on an FPGA and includes: Horizontal interference stripe detection module 200; Vertical interference stripe detection module 300; The horizontal interference stripe detection module 200 and the vertical interference stripe detection module 300 perform horizontal and vertical interference stripe detection in parallel on the current image frame (RGB data) output by the endoscope to determine whether interference stripes exist. In response to the presence of horizontal or vertical interference stripes in the current image frame, the circular buffer 400 is read and written. The image data of the current image frame is written to the storage area corresponding to the storage address pointed to by the write pointer of the circular buffer 400, and the writing pointer is kept unchanged. The image data of the next image frame is written to the storage area of ​​the image data of the current image frame to overwrite the image data of the current image frame. The reading pointer of the circular buffer 400 is controlled to point to the storage address above the storage address pointed to by the write pointer.

[0095] In some embodiments of this disclosure, the ring buffer 400 may be implemented using DDR memory (e.g., a ring buffer pattern of DDR4 memory) as a circular storage structure for image frames to manage data read and write operations.

[0096] Specifically, when interference stripes are detected, the ring buffer 400 keeps the write pointer unchanged, so that the image data of the next frame overwrites the image data of the current frame with interference stripes, while the read pointer points to the storage area of ​​the previous normal frame, thereby repeatedly outputting the previous frame image to the host computer, which can realize the instant elimination of interference images in real-time surgery.

[0097] In some embodiments of this disclosure, reference continues to be made to Figure 5 The interference stripe elimination device disclosed herein also includes: Image conversion module 100 converts the RGB image of the current image frame into a grayscale image.

[0098] Thus, the horizontal interference stripe detection module 200 and the vertical interference stripe detection module 300 perform interference stripe detection in parallel based on grayscale images.

[0099] Figure 6 This is a schematic block diagram of an FPGA structure for implementing transverse interference stripe detection according to one embodiment of the present disclosure.

[0100] refer to Figure 6 In some embodiments of this disclosure, the transverse interference stripe detection module 200 of the interference stripe elimination device of this disclosure includes: The first convolution operation module 201 uses the Sobel vertical operator to perform convolution operation on the grayscale image to obtain a vertical pixel gradient map. The column accumulation module 202 performs column accumulation on the vertical pixel gradient map to obtain the column accumulation result. The gradient calculation module 203 calculates the gradient of the column accumulation result to obtain a pixel gradient change map. The region feature calculation module includes a first region feature calculation module 204 and a second region feature calculation module 205, wherein the first region feature calculation module 204 and the second region feature calculation module 205 calculate the region feature based on the pixel gradient change map. The horizontal interference stripe judgment module 206 compares the region feature quantity with a preset threshold, and determines that horizontal interference stripes exist when the region feature quantity is greater than or equal to the threshold.

[0101] In a preferred embodiment of this disclosure, reference is made to Figure 6 The FPGA structure for detecting transverse interference stripes operates in a pipeline manner.

[0102] First, the RGB image data is converted to grayscale using the Mult (multiplier) and Add (adder) modules (image conversion module 100). Preferably, integer coefficients are used for multiplication, addition, and shift operations to obtain a grayscale image.

[0103] Subsequently, the first convolution operation module 201 uses the Sobel vertical operator to extract 3 rows of data through FIFO1 and FIFO2 (first-in-first-out queues, used as row buffers) and perform 3×3 convolution. The Mult and Add modules of the first convolution operation module 201 complete the dot product summation and output the vertical pixel gradient map.

[0104] The column accumulation module 202 uses Sum (summer) and FIFO3 to accumulate the gradient values ​​of each row to obtain the column accumulation result, and synchronously caches it to RAM2 (random access memory).

[0105] The gradient calculation module 203 implements a one-clock delay through Reg (register), subtracts the current accumulated value from the gradient value through Sub (subtractor) to obtain the gradient value, and caches it in RAM3.

[0106] The first region feature calculation module 204 takes the position of the maximum absolute value of the gradient (calculated by the Abs module) as the center and reads RAM2 and RAM3 according to the configuration range: the first region feature calculation module 204 calculates the Max (maximum value) from RAM2 as the first feature quantity, and the second region feature calculation module 205 calculates the Max and Min (minimum values) from RAM3 and then subtracts them through Sub as the second feature quantity.

[0107] The horizontal interference stripe judgment module 206 compares the first feature quantity with the first threshold, compares the second feature quantity with the second threshold, and uses "OR" logic to determine whether horizontal interference stripes exist.

[0108] Figure 7 This is a schematic block diagram of an FPGA structure for detecting vertical interference stripes according to one embodiment of the present disclosure.

[0109] refer to Figure 7 In some embodiments of this disclosure, the vertical interference stripe detection module 300 of the interference stripe elimination device of this disclosure includes: The second convolution operation module 301 uses the Sobel horizontal operator to perform convolution operation on the grayscale image to obtain a horizontal pixel gradient map. The row accumulation module 302 performs row accumulation on the horizontal pixel gradient map to obtain the row accumulation result. The gradient calculation module 303 calculates the gradient of the row accumulation result to obtain a pixel gradient change map. The region feature calculation module includes a first region feature calculation module 304 and a second region feature calculation module 305. The first region feature calculation module 304 and the second region feature calculation module 305 calculate the region feature based on the pixel gradient change map. The vertical interference stripe judgment module 306 compares the regional feature quantity with a preset threshold, and determines that vertical interference stripes exist when the regional feature quantity is greater than or equal to the threshold.

[0110] In a preferred embodiment of this disclosure, reference is made to Figure 7 The FPGA structure for detecting vertical interference stripes operates in a pipeline manner.

[0111] First, the RGB image input is converted to grayscale by the Mult (multiplier) and Add (adder) modules (image conversion module 100). Preferably, integer coefficients are used for multiplication, addition and shift operations to obtain a grayscale image.

[0112] Subsequently, the second convolution operation module 301 uses the Sobel horizontal operator to extract 3 rows of data through FIFO1 and FIFO2 (first-in-first-out queues, used as row buffers) for 3×3 convolution. The Mult and Add modules complete the dot product summation and output the horizontal pixel gradient map.

[0113] The row accumulation module 302 uses RAM1 (random access memory) to accumulate the gradient value of each column row by row, updates it through Add and writes it back to RAM1, and synchronously caches it to RAM2 at the end of the frame.

[0114] The gradient calculation module 303 implements a one-clock delay through Reg (register), subtracts the current accumulated value from the gradient value through Sub (subtractor) to obtain the gradient value, and caches it in RAM3.

[0115] The first region feature calculation module 304 takes the position of the maximum absolute value of the gradient (calculated by the Abs module) as the center and reads RAM2 and RAM3 according to the configuration range: the first region feature calculation module 304 calculates the Max (maximum value) from RAM2 as the first feature quantity, and the second region feature calculation module 305 calculates the Max and Min (minimum values) from RAM3 and then subtracts them through Sub as the second feature quantity.

[0116] The vertical interference stripe judgment module 306 compares the first feature quantity with the first threshold, compares the second feature quantity with the second threshold, and uses "OR" logic to determine whether vertical interference stripes exist.

[0117] It should be noted that, in some embodiments of this disclosure, different areas of a single FPGA can be used to configure the horizontal interference stripe detection module and the vertical interference stripe detection module described above. In other embodiments of this disclosure, two different FPGAs can be used to configure the horizontal interference stripe detection module and the vertical interference stripe detection module respectively, and the image conversion module described above can be configured on each FPGA, all of which fall within the protection scope of this disclosure.

[0118] In the description of this specification, the references to terms such as "one embodiment / mode," "some embodiments / modes," "example," "specific example," or "some examples," etc., refer to specific features, structures, or characteristics described in connection with that embodiment / mode or example, which are included in at least one embodiment / mode or example of this disclosure. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment / mode or example. Moreover, the specific features, structures, or characteristics described may be combined in any suitable manner in one or more embodiments / modes or examples. Furthermore, without contradiction, those skilled in the art can combine and integrate the different embodiments / modes or examples described in this specification, as well as the features of different embodiments / modes or examples.

[0119] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this disclosure, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0120] Those skilled in the art should understand that the above embodiments are merely for illustrating the present disclosure and are not intended to limit the scope of the disclosure. Those skilled in the art can make other changes or modifications based on the above disclosure, and these changes or modifications still fall within the scope of the present disclosure.

Claims

1. A method for eliminating interference stripes in endoscopic images, characterized in that, The interference stripe elimination method is implemented based on FPGA and includes: Obtain the current image frame output by the endoscope; Horizontal and vertical interference stripe detection are performed in parallel on the current image frame to determine whether interference stripes exist; and In response to the presence of horizontal or vertical interference stripes in the current image frame, read / write control is performed on the FPGA's circular buffer. The image data of the current image frame is written to the storage area corresponding to the storage address pointed to by the write pointer of the circular buffer, and the writing pointer is kept unchanged. This allows the image data of the next image frame to be written to the storage area of ​​the current image frame's image data to overwrite the image data of the current image frame. The read pointer of the circular buffer is then controlled to point to the storage address preceding the storage address pointed to by the write pointer.

2. The method for eliminating interference stripes in endoscopic images according to claim 1, characterized in that, The method further includes: In response to the absence of interference stripes in the current image frame, read and write control is performed on the FPGA's ring buffer. The image data of the current image frame is written to the storage area corresponding to the storage address pointed to by the write pointer, and the read pointer of the ring buffer is controlled to point to the storage address pointed to by the write pointer. Then, the storage address pointed to by the write pointer is changed to the next storage address of the ring buffer.

3. The method for eliminating interference stripes in endoscopic images according to claim 1 or 2, characterized in that, When the number of image frames that continuously detect interference stripes has reached the preset limit, the current image frame will be assumed to be free of interference stripes.

4. The method for eliminating interference stripes in endoscopic images according to claim 1 or 2, characterized in that, The detection of transverse interference stripes includes: Convert the RGB image of the current image frame to a grayscale image; The grayscale image is convolved using the Sobel vertical operator to obtain a vertical pixel gradient map. The vertical pixel gradient map is accumulated column by column to obtain the column accumulation result; Calculate the gradient of the column accumulation result to obtain the pixel gradient change map; Calculate region feature quantities based on the pixel gradient change map; and The region feature quantity is compared with a preset threshold. When the region feature quantity is greater than or equal to the threshold, it is determined that there are horizontal interference stripes. The vertical interference stripe detection includes: Convert the RGB image of the current image frame to a grayscale image; The grayscale image is convolved using the Sobel horizontal operator to obtain a horizontal pixel gradient map. The horizontal pixel gradient map is accumulated row by row to obtain the row accumulation result; Calculate the gradient of the row accumulation result to obtain the pixel gradient change map; Calculate region feature quantities based on the pixel gradient change map; and The region feature quantity is compared with a preset threshold. When the region feature quantity is greater than or equal to the threshold, it is determined that there are vertical interference stripes.

5. The method for eliminating interference stripes in endoscopic images according to claim 4, characterized in that, The step of converting the RGB image of the current image frame to a grayscale image includes: Image conversion of RGB images is performed based on the formula Gray=0.a×R+0.b×G+0.c×B; Where 0.a, 0.b, and 0.c are conversion coefficients; In this process, the conversion coefficients are expanded to integers in the FPGA, and after multiplication and addition operations, they are shifted and restored to achieve approximate decimal operations.

6. The method for eliminating interference stripes in endoscopic images according to claim 5, characterized in that, The conversion coefficient preferably satisfies 0.a+0.b+0.c=1.

7. The method for eliminating interference stripes in endoscopic images according to claim 4, characterized in that, The step of performing a convolution operation on the grayscale image using the Sobel vertical operator to obtain a vertical pixel gradient map includes: Using a first FIFO and a second FIFO as row buffers, the three rows of data of the grayscale image are extracted and convolved with a 3×3 Sobel vertical operator. The depth of each FIFO is equal to the row width of the grayscale image and is used to store a whole row of data. The first FIFO and the second FIFO respectively buffer the first two rows of data of the currently extracted row of data of the grayscale image, and the third row of data of the three rows is the currently extracted row of data. The Sobel vertical operator is as follows: 。 8. The method for eliminating interference stripes in endoscopic images according to claim 4, characterized in that, The step of performing convolution operations on the grayscale image using the Sobel level operator to obtain a horizontal pixel gradient map includes: The third and fourth FIFOs are used as row buffers. The three rows of data of the grayscale image are extracted and convolved with a 3×3 Sobel horizontal operator. The depth of each FIFO is equal to the row width of the grayscale image and is used to store a whole row of data. The third and fourth FIFOs respectively buffer the first two rows of data of the currently extracted row of data of the grayscale image. The third row of data of the three rows is the currently extracted row of data. The Sobel level operator is: 。 9. The method for eliminating interference stripes in endoscopic images according to any one of claims 1 to 8, characterized in that, The vertical pixel gradient map is a feature map with the same size as the grayscale image. Each pixel value in the vertical pixel gradient map is a gradient value obtained by multiplying the corresponding pixel in the grayscale image and its 3×3 neighboring pixel values ​​with the weights of the Sobel vertical operator and summing them. The horizontal pixel gradient map is a feature map with the same size as the grayscale image. Each pixel value in the horizontal pixel gradient map is a gradient value obtained by multiplying the corresponding pixel in the grayscale image and its 3×3 neighboring pixel values ​​with the weights of the Sobel horizontal operator and summing them. Optionally, in the horizontal interference stripe detection, the column accumulation of the vertical pixel gradient map to obtain the column accumulation result includes: For each row of the vertical pixel gradient map, the gradient values ​​of all pixels in that row are summed to obtain the cumulative value of that row; the column accumulation result is a one-dimensional array composed of the cumulative values ​​of all rows of the vertical pixel gradient map. In the FPGA, a dedicated FIFO (FIFO3 in the figure) for horizontal interference stripe detection is used to cache the accumulated result of each row in sequence, and a copy is synchronously cached in the second random access memory. In the vertical interference stripe detection, the step of performing row accumulation on the horizontal pixel gradient map to obtain the row accumulation result includes: For each column of the horizontal pixel gradient map, the gradient values ​​of all pixels in that column are summed to obtain the cumulative value of that column; the row accumulation result is a one-dimensional array composed of the cumulative values ​​of all columns of the horizontal pixel gradient map. In the FPGA, a first random access memory is used for row accumulation. Each time, the accumulation result in the first random access memory is read and accumulated with a new row, and then stored in the first random access memory. After the accumulation calculation of the last row of the current image frame, a copy is synchronously cached in the second random access memory. Optionally, in the horizontal interference stripe detection, calculating the gradient of the column accumulation result to obtain a pixel gradient change map includes: In the FPGA, a first register is used to store the accumulated value of the current row in the column accumulation result. The first register captures input data in each clock cycle and outputs the input data captured in the previous clock cycle in the next clock cycle, thereby realizing a one-clock-cycle delay and obtaining a one-beat delay data. The accumulated value of the current row is subtracted from the one-beat delay data to obtain the gradient value of the current row. The gradient values ​​of all rows are combined into a one-dimensional array to form the pixel gradient change map. The pixel gradient change map is synchronously cached in the third random access memory. In the vertical interference stripe detection, calculating the gradient of the row accumulation result to obtain a pixel gradient change map includes: In the FPGA, a second register is used to store the accumulated value of the current column in the row accumulation result. The second register captures input data in each clock cycle and outputs the input data captured in the previous clock cycle in the next clock cycle, thereby realizing a clock cycle delay and obtaining a one-beat delay data. The accumulated value of the current column is subtracted from the one-beat delay data to obtain the gradient value of the current column. The gradient values ​​of all columns are combined into a one-dimensional array to form the pixel gradient change map. The pixel gradient change map is synchronously cached in the third random access memory. Optionally, in the detection of transverse interference stripes, the calculation of region feature quantities based on the pixel gradient change map includes: Using the location of the maximum absolute value of the gradient in the pixel gradient change map as the center, the regions on the left and right sides of the center are selected as the read addresses of the second random access memory and the third random access memory according to a preset configuration range. The maximum value of the column summation result read from the second random access memory is taken as the first region feature quantity; The difference between the maximum and minimum gradient values ​​read from the third random access memory is used as the second region feature quantity; Optionally, in the vertical interference stripe detection, the calculation of region feature quantities based on the pixel gradient change map includes: Using the location of the maximum absolute value of the gradient in the pixel gradient change map as the center, the regions above and below the center are selected as the read addresses of the second random access memory and the third random access memory according to a preset configuration range. The maximum value of the row accumulation result read from the second random access memory is taken as the first region feature quantity; The difference between the maximum and minimum gradient values ​​read from the third random access memory is used as the second region feature quantity; Optionally, comparing the region feature quantity with a preset threshold, and determining the presence of transverse interference stripes when the region feature quantity is greater than or equal to the threshold, includes: The first region feature value is compared with a preset first threshold, and the second region feature value is compared with a preset second threshold. When the first region feature value or the second region feature value is greater than or equal to the first threshold or the second threshold, it is determined that there are horizontal interference stripes in the current image frame. Optionally, comparing the region feature quantity with a preset threshold, and determining the presence of vertical interference stripes when the region feature quantity is greater than or equal to the threshold, includes: The first region feature value is compared with a preset first threshold, and the second region feature value is compared with a preset second threshold. When the first region feature value or the second region feature value is greater than or equal to the first threshold or the second threshold, it is determined that there are vertical interference stripes in the current image frame.

10. A device for eliminating interference stripes in endoscopic images, characterized in that, The device is implemented based on an FPGA and includes: Horizontal interference stripe detection module; Vertical interference stripe detection module; The horizontal interference stripe detection module and the vertical interference stripe detection module perform horizontal and vertical interference stripe detection in parallel on the current image frame output by the endoscope to determine whether interference stripes exist. A circular buffer, in response to the presence of horizontal or vertical interference stripes in the current image frame, performs read and write control on the circular buffer, writes the image data of the current image frame into the storage area corresponding to the storage address pointed to by the write pointer of the circular buffer, and controls the writing pointer to remain unchanged, so that the image data of the next image frame of the current image frame is written into the storage area of ​​the image data of the current image frame to overwrite the image data of the current image frame, and controls the read pointer of the circular buffer to point to the storage address above the storage address pointed to by the write pointer; Optionally, it also includes: An image conversion module that converts the RGB image of the current image frame into a grayscale image; Optionally, the transverse interference stripe detection module includes: The first convolution operation module uses the Sobel vertical operator to perform convolution operation on the grayscale image to obtain a vertical pixel gradient map. A column accumulation module performs column accumulation on the vertical pixel gradient map to obtain a column accumulation result. A gradient calculation module calculates the gradient of the column accumulation result to obtain a pixel gradient change map; A region feature calculation module calculates region features based on the pixel gradient change map; and A horizontal interference stripe detection module compares the region feature quantity with a preset threshold, and determines the presence of horizontal interference stripes when the region feature quantity is greater than or equal to the threshold. The vertical interference stripe detection includes: The second convolution operation module uses the Sobel horizontal operator to perform convolution operation on the grayscale image to obtain a horizontal pixel gradient map. A row accumulation module performs row accumulation on the horizontal pixel gradient map to obtain a row accumulation result. The gradient calculation module calculates the gradient of the row accumulation result to obtain a pixel gradient change map. A region feature calculation module calculates region features based on the pixel gradient change map; and The vertical interference stripe detection module compares the region feature quantity with a preset threshold, and determines the presence of vertical interference stripes when the region feature quantity is greater than or equal to the threshold.