CN-122023225-A - Method for processing endoscopic image, endoscopic imaging device, and storage medium
Abstract
The invention provides a method for processing an endoscopic image, an endoscopic imaging device and a storage medium. The above processing method is performed by a field programmable gate array and off-chip memory. The field programmable gate array performs the steps of acquiring the endoscope image and buffering the endoscope image to an off-chip memory. The coordinate range of the target image is determined according to the endoscope image, and the target image is divided into image blocks. For each image block, the source coordinate value of the image block is determined, and then the reading address range of the source pixel is determined. For each image block, the off-chip memory is read based on the read address range of the source pixel respectively to obtain the read data of the image block. For each pixel to be assigned, determining a source coordinate value based on the coordinate value and the corresponding relation of the pixel to be assigned to determine a source pixel value, and further determining a pixel value assigned to the pixel to be assigned. According to the scheme provided by the embodiment of the invention, the overall generation efficiency of the target image is improved.
Inventors
- WEN KANGYI
Assignees
- 深圳开立生物医疗科技股份有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20250916
Claims (16)
- 1. A processing method of an endoscope image, characterized in that the processing method is performed by a field programmable gate array and an off-chip memory to process the endoscope image into a target image, the field programmable gate array performing: acquiring an endoscope image and caching the endoscope image to the off-chip memory; dividing the target image into a set number of image blocks according to the coordinate range of the target image; For each image block, determining a source coordinate value of a boundary of the image block corresponding to the image block in the endoscope image based on a corresponding relation between coordinate values of at least part of boundary pixels in the image block in the target image and coordinate values of pixels between the endoscope image and the target image, and determining a reading address range of a source pixel corresponding to the image block in the endoscope image based on the source coordinate value of the boundary, wherein the corresponding relation is determined by a preset processing operation of processing the endoscope image into the target image; for each image block, reading the off-chip memory based on a reading address range of a source pixel corresponding to the image block to obtain a source coordinate value and a source pixel value of the source pixel corresponding to the image block in the endoscope image, wherein the source coordinate value and the source pixel value are used as reading data of the image block; For each pixel to be assigned in each image block, determining a source coordinate value of at least one source pixel corresponding to the pixel to be assigned based on the coordinate value of the pixel to be assigned in the target image and the corresponding relation, so as to determine a source pixel value of at least one source pixel corresponding to the pixel to be assigned from the read data of the image block, and determining a pixel value assigned to the pixel to be assigned according to the source pixel value of at least one source pixel corresponding to the pixel to be assigned.
- 2. The method of claim 1, wherein the dividing the target image into a set number of image blocks according to the coordinate range of the target image comprises: And dividing the target image into a plurality of image blocks with the same pixel number according to the coordinate range of the target image.
- 3. The method of claim 1, wherein the predetermined processing operation comprises at least one of a distortion correction process, a rotational correction process.
- 4. The method of claim 1, wherein the preset processing operation comprises a plurality of processing operations, and the correspondence is determined by a combination of the plurality of processing operations.
- 5. The method of claim 1, wherein the source coordinate values of the corresponding boundaries of the image block in the endoscopic image comprise a minimum abscissa value, a maximum abscissa value, a minimum ordinate value, a maximum ordinate value; Accordingly, the determining, based on the source coordinate value of the boundary, the read address range of the source pixel corresponding to the image block in the endoscope image includes: And taking a reading address range of a source pixel, wherein an abscissa value in the endoscope image is located between the minimum abscissa value and the maximum abscissa value, and an ordinate value in the endoscope image is located between the minimum ordinate value and the maximum ordinate value, as a reading address range of the source pixel corresponding to the image block.
- 6. The method of claim 1, wherein the determining a read address range of a source pixel in the endoscopic image corresponding to the image block based on a source coordinate value of the boundary comprises: And determining an overlapping region of the image block and other image blocks in the endoscope image, and determining the reading address range based on the overlapping region, wherein the reading address range does not comprise the reading address of the source pixels in the overlapping region in the case that the source pixels in the overlapping region have been read.
- 7. The method of claim 6, wherein the field programmable gate array further performs: And determining the rotation angle of the endoscope when the endoscope image is acquired, and executing the determination of the overlapping area of the image block and other image blocks in the endoscope image only when the rotation angle is in a preset angle section.
- 8. The method of claim 1, wherein the reading the off-chip memory based on the read address range of the source pixel corresponding to the image block comprises: And reading the off-chip memory through a burst mode based on the read address range of the source pixel corresponding to the image block.
- 9. The method of claim 1, wherein determining the source coordinate value of the at least one source pixel corresponding to the pixel to be assigned based on the coordinate value of the pixel to be assigned in the target image and the correspondence, to determine the source pixel value of the at least one source pixel corresponding to the pixel to be assigned from the read data of the image block, and determining the pixel value assigned to the pixel to be assigned according to the source pixel value of the at least one source pixel corresponding to the pixel to be assigned, comprises: Determining a corresponding target source coordinate value of the pixel to be assigned in the endoscope image based on the coordinate value of the pixel to be assigned in the target image and the corresponding relation; Determining a source coordinate value of at least one source pixel corresponding to the pixel to be assigned based on the difference value with the target source coordinate value falling within a preset difference value range, so as to determine a source pixel value of at least one source pixel corresponding to the pixel to be assigned from the read data of the image block; And determining a pixel value assigned to the pixel to be assigned according to the source pixel value of at least one source pixel corresponding to the pixel to be assigned.
- 10. The method of claim 9, wherein determining the pixel value assigned to the pixel to be assigned according to the source pixel value of the at least one source pixel corresponding to the pixel to be assigned comprises any one of: determining an average value of source pixel values of at least one source pixel corresponding to the pixel to be assigned as a pixel value of the pixel to be assigned; And determining the pixel value of the pixel to be assigned based on the source pixel value of at least one source pixel corresponding to the pixel to be assigned and the corresponding weight thereof, wherein the weight corresponding to each source pixel is inversely related to the difference value between the source coordinate value of the source pixel and the target source coordinate value.
- 11. The method of claim 1, wherein the field programmable gate array further performs: and buffering the assigned pixels, and outputting the row of assigned pixels to the display assembly when all the pixels to be assigned in the target image are assigned and are completed as the assigned pixels.
- 12. The method according to any one of claims 1 to 11, wherein the field programmable gate array performs one or more steps of the method according to any one of claims 1 to 11 by means of parallel processing by a plurality of processing modules.
- 13. The method of claim 12, wherein the plurality of processing modules perform the method of any of claims 1 to 11 for each of the image blocks by way of a ping-pong buffer process.
- 14. An endoscopic imaging device, characterized in that the device comprises a field programmable gate array, an off-chip memory, the field programmable gate array being configured to perform the method of processing endoscopic images of any of claims 1 to 13.
- 15. A storage medium storing a computer program/instruction which, when executed, is adapted to carry out the method of processing an endoscopic image as claimed in any one of claims 1 to 13.
- 16. A computer program product comprising computer program instructions, which, when executed by a processor, are for performing the method of processing an endoscopic image as claimed in any one of claims 1 to 13.
Description
Method for processing endoscopic image, endoscopic imaging device, and storage medium Technical Field The present invention relates to the field of medical image processing technology, and more particularly to a method of processing an endoscopic image, an endoscopic imaging apparatus, a storage medium and a computer program product. Background Endoscopy is widely used as an important medical diagnostic tool for examining various body cavities and ducts such as the digestive tract and respiratory tract. The endoscope may be inserted into a lumen (e.g., intestinal, gastric, tracheal, etc.) of a target subject, and then images of the interior of the lumen may be acquired and transmitted to an upper computer. The upper computer can display the acquired image in a display screen so as to enable a user to observe the cavity of the target object. And in combination with an actual scene, the radial distortion of an image can be caused due to the smaller endoscope lens, so that the observation by a user is not facilitated. In particular, radial distortion can cause nonlinear geometric distortion of the image, such as a straight line becoming a curved line due to radial distortion. Severe image radial distortion affects the user's judgment of the organ shape size and depth, and therefore requires correction of the distorted image. In addition, in the use process of the endoscope, in order to reduce the problem that the visual field changes to generate dizziness caused by the rotation of the endoscope in the operation process, the reverse rotation (or automatic rotation and correction function) of any angle is required to be carried out aiming at the rotation angle of the endoscope body, so that the image of the endoscope can still ensure the visual field to be always forward, and the observation of a user is facilitated. Therefore, in the related art, the original image collected by the endoscope needs to be processed to obtain an output image which is favorable for the user to observe, while the processing process in the prior art can generate larger delay, and if the delay is required to be reduced, the requirement on hardware performance is higher. Therefore, how to reduce the delay of image processing while controlling the hardware cost is a technical problem that needs to be solved by those skilled in the art. Disclosure of Invention The present invention has been made in view of the above-described problems. The invention provides a method for processing an endoscopic image, an endoscopic imaging device, a storage medium and a computer program product. According to one aspect of the invention, a processing method of an endoscope image is provided, the processing method is executed through a field programmable gate array and an off-chip memory to process the endoscope image into a target image, the field programmable gate array is executed to acquire the endoscope image and buffer the endoscope image to the off-chip memory, the target image is divided into a set number of image blocks according to the coordinate range of the target image, for each image block, the source coordinate value of a source pixel corresponding to the image block and the source pixel value of a pixel between the endoscope image and the target image are determined based on the corresponding relation between the coordinate value of at least part of boundary pixels in the image block in the target image and the coordinate value of the pixel between the endoscope image and the target image, the reading address range of the source pixel corresponding to the image block in the endoscope image is determined based on the source coordinate value of the boundary, the corresponding relation is determined by the preset processing operation of the endoscope image into the target image, the off-chip memory is read based on the reading address range of the source pixel corresponding to each image block, the source coordinate value and the source pixel corresponding to the image block in the endoscope image block is obtained, at least one pixel value is assigned to the pixel value corresponding to the pixel value in the image block is assigned to the pixel value, and at least one pixel value is assigned to the pixel value is determined to be assigned to the pixel value. Illustratively, dividing the target image into a set number of image blocks according to the coordinate range of the target image includes: The target image is divided into a plurality of image blocks of the same number of pixels according to the coordinate range of the target image. Illustratively, the preset processing operation includes at least one of a distortion correction process, a rotational correction process. Illustratively, the preset processing operation includes a plurality of processing operations, and the correspondence is determined by a combination of the plurality of processing operations. Illustratively, the source coordinate values of the corresponding boundaries of