A method of endoscope video superimposition OSD menu image
By designing and compressing OSD menu images using an ARM processor and transmitting them to an FPGA, and combining FPGA caching and decompression algorithms, the problems of high hardware requirements and high software complexity in existing technologies are solved, achieving high real-time performance and complex interface OSD menu display with low complexity.
Patent Information
- Application Number
- CN202310334705.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-31
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2043-03-31
AI Technical Summary
Existing methods for overlaying endoscopic video onto OSD have high hardware requirements, are difficult to implement in software, and cannot meet the needs of complex interfaces.
The OSD menu image is designed using an ARM processor and processed using a compression algorithm before being transmitted to the FPGA via a communication interface. The FPGA performs ping-pong buffering and decompression before superimposing it onto the endoscope video stream. Real-time superimposition of the OSD menu image is achieved by combining a bilinear interpolation amplification algorithm.
The bandwidth requirements for OSD menu image transmission have been reduced, hardware requirements have been simplified, the real-time performance of OSD interface images and the requirements of complex interfaces have been guaranteed, and a more user-friendly OSD menu display has been achieved.
Smart Images

Figure CN116567162B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of endoscope video image processing, in particular to a method for superimposing OSD on endoscope video. BACKGROUND
[0002] OSD is the abbreviation of On-Screen Display, that is, some special characters or graphics are generated on the screen of the display to let the user get some information. In the process of endoscope video processing, the image parameters in the OSD menu are operated to complete the adjustment of the image.
[0003] At present, the method for superimposing OSD on endoscope video mainly includes two schemes:
[0004] The first scheme is to make OSD menu image by ARM or DSP, generate OSD menu video stream, and then superimpose the OSD menu video stream and the endoscope video stream processed by FPGA. This method can ensure the real-time of video superimposition and the menu is more beautiful, but the development is more complex and the hardware requirement is higher, and the portability is poor.
[0005] For example, the Chinese invention patent with the application number "201910305231.6". The invention adopts the idea of scheme one. The purpose is to solve the problem of time delay in the existing method of adding OSD to video.
[0006] The invention provides a method for adding OSD to 4K real-time video. Any OSD UI interface can be designed by Qt creator, and mouse, keyboard and touch screen can be used to control OSD menu. Powerful FPGA can also perform some algorithm processing on video, such as noise reduction, dark field enhancement, contour enhancement, color restoration, wide dynamic range, etc. The OSD generated by ARM and the video source input by the camera are superimposed and synthesized by FPGA (the video can be processed before superimposing OSD, or the video can be processed after superimposing OSD). Due to the parallelism of FPGA, there is no delay in superimposing OSD, which breaks the traditional architecture of inputting video source first, then processing image by FPGA, and then superimposing OSD by ARM, thereby reducing the delay of real-time video and improving the real-time of image.
[0007] The second scheme is to superimpose the OSD display menu made in the image processor and the processed endoscope video stream. The interface made by this method is relatively simple, and is limited by the internal logic resources of the processor, which cannot guarantee the beauty of the interface and the function cannot meet the requirements of complex parameter setting.
[0008] For example, the Chinese invention patent with application number "201410247922.2" discloses a method and device for character superimposition on video images. The method includes: obtaining OSD character information from a character superimposition OSD configuration structure, the OSD character information including character content, character position and font library, the character position being the display position of the character content in the video image; copying the image corresponding to the character position from the video image in the memory to the cache area; in the cache area, superimposing the character content contained in the OSD character information on the copied image according to the font library to obtain a superimposed character image, and copying the superimposed character image back to the memory; and superimposing the character image on the position corresponding to the display position in the video image in the memory. The method can reduce the occupation of system resources when performing character superimposition, and improve the superimposition efficiency.
[0009] The present application mainly aims to reduce the occupation of system resources by character superimposition, by locally extracting an OSD position video screenshot, by completing the OSD character superimposition algorithm in the cache, and then returning the superimposed video screenshot. However, this method does not avoid the background key information, and the background information is still covered after the OSD character superimposition, affecting the intelligent analysis and extraction of key information such as faces and portraits in the background.
[0010] The first scheme has a high implementation difficulty, and the hardware needs a video output interface, which has high requirements for hardware and high requirements for the design ability of ARM software. The second scheme cannot realize the design of a relatively complex interface, and the menu interface is relatively simple.
[0011] Therefore, the prior art still needs to be improved and developed. SUMMARY
[0012] The technical problem to be solved by the present application is: high hardware requirements, high software implementation difficulty, and meeting real-time and complex interface requirements.
[0013] To solve the above technical problems, the technical scheme adopted by the present application is:
[0014] A method for superimposing an OSD menu on an endoscope video, comprising the following steps:
[0015] Step S1. Designing an interface by an ARM processor to design an RGB image of an OSD menu with a size of N*M, wherein N is the row pixel width and M is the column pixel width;
[0016] Step S2. Compressing the OSD menu image using a compression algorithm, and the size of the processed OSD menu image is ( )*( ), wherein ROW is the row compression ratio, COL is the column compression ratio, and the data amount OB required for processing one OSD menu interface is:
[0017]
[0018] wherein the unit of OB is byte;
[0019] Step S3. The OSD menu image processed in step S2 is transmitted to the FPGA through a communication interface, and the interface transmission rate Spd can be calculated and obtained from the endoscope video frame rate F and OB, i.e.:
[0020]
[0021] wherein the unit of Spd is MB / S;
[0022] Step S4. The FPGA end receives the OSD menu image data using the same communication interface as the ARM processor, and uses a ping-pong operation to cache the OSD menu image data;
[0023] Step S5. The OSD menu image data cached in step S4 is decompressed using a decompression algorithm;
[0024] Step S6. The FPGA end superimposes the OSD menu image processed in step S5 on the specified position of the endoscope video stream.
[0025] Further, the values of the row pixel width N and the column pixel width M in step S1 are both positive integers, the value range of N is [240, 480], and the value range of M is [160, 320].
[0026] Further, the compression algorithm in step S2 operates using the following steps:
[0027] Step S21. The OSD menu image is converted from the RGB color space to the HSV color space to obtain the brightness image V and the hue H of the OSD menu image;
[0028] Step S22. The hue H of the OSD menu image is extracted for bit width conversion from the original bit width m to 4 bits to obtain the transmitted hue H T , i.e.
[0029]
[0030] Step S23. The brightness image V of the OSD menu image is extracted for bit width conversion from the original bit width m to 4 bits to obtain the transmitted brightness V T , i.e.
[0031]
[0032] Step S24. Re-combining the OSD menu image data, each pixel data is composed of a hue H T and a luminance image V T into one byte;
[0033] Step S25. Interlaced and staggered sampling processing of the OSD menu image, wherein the row sampling interval is determined by ROW, and the column sampling interval is determined by COL,
[0034] Correspondingly, the decompression algorithm of step S5 uses the following steps:
[0035] Step S51. Reading the OSD menu image data of four pixel points f(i, j), f(i, j+1), f(i+1, j), f(i+1, j+1) in FIFO3, wherein i, j represents the position of the pixel point in the OSD menu image, wherein i takes the value range [0, N / 2], and j takes the value range [0, M / 2];
[0036] Step S52. Using a bilinear interpolation enlargement algorithm, the bilinear interpolation enlargement formula is used to calculate the pixel luminance data and hue data corresponding to the f(i+u, j+v) position after bilinear interpolation enlargement, wherein u takes the value range [0, 1], v takes the value range [0, 1], and u, v take the value rule u, v=1 / H, wherein H is the enlargement multiple;
[0037] Specifically, the bilinear interpolation enlargement formula is:
[0038] .
[0039] Further, the ping-pong operation of step S4 is to design FIFO1 and FIFO2 two buffers in FPGA, which are used for ping-pong of the OSD menu image data received by the communication interface, and design FIFO3 for buffering the data read out by FIFO1 or FIFO2, and the write data bit width of FIFO3 is consistent with FIFO1 and FIFO2, and the read data bit width is set to one byte; when there is data on the communication bus and FIFO1 is currently empty, start reading of FIFO2 and write data to FIFO3, and at the same time, cache the data received by the communication bus to FIFO1, when the amount of received data reaches OB, stop writing of FIFO1, and at the same time, stop reading of FIFO2; when there is data on the communication bus and FIFO2 is currently empty, start reading of FIFO1 and write data to FIFO3, and at the same time, cache the data received by the communication bus to FIFO2, when the amount of received data reaches OB, stop writing of FIFO2, and at the same time, stop reading of FIFO1.
[0040] Further, step S6 includes:
[0041] Step S61. Obtain the row count hcnt and column count vcnt of the endoscope video stream using the frame synchronization signal, the line synchronization signal and the data valid signal in the endoscope video stream, both hcnt and vcnt are cleared when the rising edge of the frame synchronization signal in the endoscope video stream comes, the column count is accumulated when the rising edge of the line synchronization signal in the endoscope video stream comes, and the hcnt count is accumulated when the data valid signal in the endoscope video stream is high;
[0042] Step S62. It is known from step S1 that the size of the OSD menu image is N*M, so the size of the screen OSD display area is set to N*M, and the starting row position h_start and the column position v_start of the display area are set;
[0043] Step S63. Determine whether the value of hcnt is located in [h_start, h_start+N] and the value of vcnt is located in [v_start, v_start+M]; if yes, perform OSD menu image superposition; if not, output the original endoscope image;
[0044] Step S64. Obtain the current OSD menu image and superimpose it into the endoscope image R, G and B to realize OSD menu image superposition;
[0045] Further, the specified position in step S6 is set as a surrounding area of 1-640 columns and 1-960 rows of the endoscope video image.
[0046] An endoscope video superposition OSD menu system, comprising an ARM processor, an FPGA and a display, the ARM processor is in communication connection with the FPGA, the FPGA is connected with a display device, the ARM processor is used for making an OSD menu image, and the OSD menu image is processed by using a compression algorithm and then transmitted to the FPGA through a communication interface, the FPGA is used for performing ping-pong buffer processing on the received OSD menu image, then performing decompression algorithm processing, and then superimposing the processed OSD menu image on an endoscope video data stream and transmitting the endoscope video data stream to the display device for display.
[0047] The beneficial effects of the present application are:
[0048] By providing a method for endoscope video superimposition OSD menu, the OSD menu image is designed using an ARM processor, and after the OSD menu image is processed using a compression algorithm, it is transmitted to the FPGA through a communication bus, the FPGA performs ping-pong buffer processing on the received OSD menu image, and then uses a decompression algorithm to decompress and superimpose it into the specified position of the endoscope video data stream. By using a compression algorithm to compress the OSD menu image, the transmission bandwidth of the OSD menu image can be reduced, so that it can be transmitted to the FPGA through a commonly used communication interface, ensuring that the OSD menu part is low in implementation difficulty and has low hardware requirements. At the same time, the ping-pong operation through the internal buffer of the FPGA can ensure that the OSD interface image is not lost and has high real-time performance. Using a compression algorithm in combination with a decompression operation can ensure that a more user-friendly OSD menu image is realized and can meet the complex interface requirements. BRIEF DESCRIPTION OF DRAWINGS
[0049] Figure 1 The step flow chart of the embodiment of the present application.
[0050] Figure 2 The structural schematic diagram of the embodiment of the present application. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme of the embodiments of the present application will be described clearly and completely below in combination with the drawings of the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the described embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without any creative effort belong to the scope of protection of the present application.
[0052] Unless otherwise defined, technical terms or scientific terms used in the present application shall have the usual meaning understood by those of ordinary skill in the art to which the present application belongs. The terms "first", "second" and similar words used in the present application do not represent any order, number or importance, but are only used to distinguish different components. The terms "include" or "contain" and similar words mean that the elements or objects before the words cover the elements or objects listed after the words and their equivalents, and do not exclude other elements or objects. The terms "connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. The terms "up", "down", "left", "right" and the like are only used to represent relative positional relationships, and when the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0053] For keeping the following description of the embodiments of the present application clear and brief, the present application omits the detailed description of some known functions and known components.
[0054] As shown in Figure 1 , the embodiment of the present application provides a method for endoscope video superimposed OSD menu, which is implemented on the endoscope video with super high definition 4K@60 frame resolution, comprising the following steps:
[0055] Step S1. Interface design is performed by an ARM processor to design an RGB image of an OSD menu with a size of N*M, wherein N is the row pixel width, M is the column pixel width, N is a positive integer with a value range of 240-480, and M is a positive integer with a value range of 160-320, the value range of N and M can ensure that the image quality of the OSD menu image is high and the transmission data volume is low, in the embodiment, N is valued at 480 and M is valued at 320;
[0056] Step S2. The OSD menu image is compressed using a compression algorithm, the ROW row compression coefficient is 2, and the COL column compression coefficient is 2, the compression algorithm used in the embodiment is as follows:
[0057] Step S21. Conversion from RGB color space to HSV color space is performed to obtain the brightness image V and the hue H of the OSD menu image, after conversion, H has a value range of [0, 360], H is an integer, and V has a value range of 0-2 n , n is the image bit number, preferably, n is 8, 10 or 12, the image bit number value can ensure that the OSD menu image has the same image bit number as the endoscope video image, in the embodiment, the RGB to HSV algorithm uses 12 bits, and the specific formula is:
[0058]
[0059] Step S22. The hue H of the OSD menu image is extracted for bit width conversion from the original bit width m to the hue H transmitted with 4 bits T , that is:
[0060]
[0061] Step S23. The brightness image V of the OSD menu image is extracted for bit width conversion to convert the OSD menu brightness image from the original bit width m to the 4-bit transmitted brightness VT, that is:
[0062]
[0063] m is valued at 5;
[0064] Step S24. The OSD menu image data is recombined, each pixel data is composed of the hue H T and the brightness VT combined into one byte, where the high 4 bits are H T and the low 4 bits are V T ;
[0065] Step S25. Interlaced and intercolumnar sampling processing is performed on the OSD menu image, and the size of the processed OSD menu image is (N / 2)*(M / 2), so the data amount OB required for one OSD menu interface is:
[0066]
[0067] where the unit of OB is byte, and the calculated result of OB is 38400 bytes;
[0068] Step S3. The OSD menu interface data is transmitted to the FPGA through a communication interface, and the interface transmission rate Spd can be obtained by calculating the endoscope video frame rate F and OB, that is:
[0069]
[0070] where the video frame rate is 60, 90 or 120, which can meet the requirement of the endoscope video frame rate, the unit of Spd is MB / S, and the communication interface is one of an SPI interface, an IIC interface or an SDIO interface, which has low requirements on hardware, and in the embodiment, the SPI interface is selected, and the calculated result of Spd is MB / S;
[0071] Step S4. The FPGA end receives the interface data using the same communication interface as the ARM processor, and uses ping-pong operation to cache the OSD menu image data.
[0072] The ping-pong operation is as follows: two FIFOs, FIFO1 and FIFO2, are designed inside the FPGA to ping-pong the OSD menu image data received by the communication interface, and FIFO3 is designed to cache the data read out by FIFO1 or FIFO2, the write data bit width of FIFO3 is consistent with that of FIFO1 and FIFO2, the read data bit width is set to one byte, when there is data on the communication bus and FIFO1 is currently empty, the reading of FIFO2 is started, the data is written into FIFO3, and the data received by the communication bus is cached into FIFO1, when the received data amount reaches OB, the writing of FIFO1 is stopped, and the reading of FIFO2 is also stopped, when there is data on the communication bus and FIFO2 is currently empty, the reading of FIFO1 is started, the data is written into FIFO3, and the data received by the communication bus is cached into FIFO2, when the received data amount reaches OB, the writing of FIFO2 is stopped, and the reading of FIFO1 is also stopped.
[0073] Step S5. The OSD menu image data cached in step S4 is decompressed using a decompression algorithm, and the decompression algorithm used in this embodiment is bilinear interpolation enlargement;
[0074] The bilinear interpolation enlargement is specifically operated as follows:
[0075] Step S51. The OSD menu image data of four pixel points f(i, j), f(i, j+1), f(i+1, j), and f(i+1, j+1) in FIFO3 is read, wherein i, j represents the position of the pixel point in the OSD menu image, wherein i takes the value range of [0, N / 2], and j takes the value range of [0, M / 2];
[0076] Step S52. The pixel brightness data and hue data corresponding to the position f(i+u, j+v) after bilinear interpolation enlargement are calculated according to the bilinear enlargement formula, wherein u takes the value range of [0, 1], v takes the value range of [0, 1], and u, v take the value rule of u, v=1 / H, wherein H is the enlargement multiple, and in this embodiment, H takes the value of 2;
[0077] Specifically, the bilinear enlargement formula is:
[0078]
[0079] Step S6. The FPGA end superimposes the OSD menu image after bilinear interpolation enlargement in step S5 at a specified position of the endoscope video stream, and in this embodiment, the specified position is set as the enclosed area of 1~640 columns and 1~960 rows of the endoscope video image, which is the best display effect of the OSD menu image and does not occupy the main observation area of the endoscope video;
[0080] The specific operation is as follows:
[0081] Step S61. The line count hcnt and column count vcnt of the endoscope video stream are obtained using the frame synchronization signal, the line synchronization signal, and the data valid signal in the endoscope video stream, hcnt and vcnt are both cleared when the rising edge of the frame synchronization signal in the endoscope video stream comes, the column count is accumulated when the rising edge of the line synchronization signal in the endoscope video stream comes, and hcnt count is accumulated when the data valid signal in the endoscope video stream is high;
[0082] Step S62. It is known from step S1 that the OSD menu image size is N*M, so the size of the screen OSD display area is set to N*M, and the starting line position h_start and column position v_start of the display area are set, and in this embodiment, h_start takes the value of 3240, and v_start takes the value of 1600;
[0083] Step S63. Determine whether the value of hcnt is located in [h_start, h_start+N] and the value of vcnt is located in [v_start, v_start+M]; if yes, proceed with OSD menu image superposition; if no, output the original endoscope image;
[0084] Step S64. Obtain the current OSD menu image and superimpose the endoscope RGB image to realize OSD menu image superposition.
[0085] From the above description, the beneficial effects of the embodiment one of the present application are as follows:
[0086] By providing an endoscope video superimposed OSD menu method, an ARM processor is used to design an OSD menu image, and the OSD menu image is compressed using a compression algorithm and then transmitted to an FPGA through a communication bus, the FPGA performs ping-pong buffer processing on the received OSD menu image and then decompresses it using a decompression algorithm and superimposes it into a specified position in the endoscope video data stream. By compressing the OSD menu image using a compression algorithm, the transmission bandwidth of the OSD menu image can be reduced, so that it can be transmitted to the FPGA through a commonly used communication interface, ensuring that the OSD menu part is low in implementation difficulty and has low hardware requirements, and the ping-pong operation of the internal buffer of the FPGA can ensure that the OSD interface image is not lost and has high real-time performance. Using a compression algorithm in combination with a decompression operation can ensure that a more user-friendly OSD menu image is realized and the problem of complex interface requirements can be met.
[0087] As shown in Figure 2 The present application also provides an embodiment two, an endoscope video superimposed OSD menu system, which matches the above method.
[0088] The system comprises an ARM processor, an FPGA and a display, the ARM processor is in communication connection with the FPGA, the FPGA is connected with a display device, the ARM processor is used to make an OSD menu image, and the OSD menu image is compressed using a compression algorithm and then transmitted to the FPGA, the FPGA is used to perform ping-pong buffer processing on the received OSD menu image and then decompress it using a decompression algorithm and superimpose it into an endoscope video data stream and then transmit it to the display device for display.
[0089] In this embodiment, the ARM processor adopts an ARM Cortex-M3 series STM32F103ZET6 processor, the FPGA adopts an Xilinx Kintex-7 series XC7K325T-1FFG676, and the display adopts a medical display device Sony 4K display.
[0090] In summary, the method for superimposing an endoscope video on an OSD menu provided by the application uses an ARM processor to design an OSD menu image, and transmits the OSD menu image to an FPGA after using a compression algorithm to process the OSD menu image through a communication bus. The FPGA uses a decompression algorithm to decompress the received OSD menu image after ping-pong buffer processing, and then superimposes the OSD menu image on a specified position of an endoscope video data stream. The use of a compression algorithm to compress the OSD menu image can reduce the transmission bandwidth of the OSD menu image, so that the OSD menu image can be transmitted to the FPGA through a commonly used communication interface, ensuring that the OSD menu part is low in implementation difficulty and has low requirements on hardware. At the same time, the use of ping-pong operation through the internal buffer of the FPGA can ensure that the OSD interface image is not lost and has high real-time performance. The use of a compression algorithm in combination with a decompression operation can ensure that a more user-friendly OSD menu image is realized and can meet the problem of complex interface requirements.
[0091] The above description is only an embodiment of the application, and does not limit the patent scope of the application. Any equivalent transformation or direct or indirect application in the related technical field using the content of the specification and drawings is also included in the patent protection scope of the application.
Claims
1. A method for overlaying OSD menus onto endoscopic video, characterized in that, Includes the following steps: Step S1. Design the interface using an ARM processor, designing an RGB image of an OSD menu with a size of N*M, where N is the row pixel width and M is the column pixel width; Step S2. Compress the OSD menu image designed in Step S1 using a compression algorithm. The size of the processed OSD menu image is ( )*( ), where ROW is the row compression ratio and COL is the column compression ratio. The amount of data OB required for one OSD menu interface after processing is: OB is in bytes; The compression algorithm described in step S2 operates using the following steps: Step S21. Convert the OSD menu image from RGB color space to HSV color space, and obtain the brightness image V and hue H of the OSD menu image; Step S22. Extract the hue H from the OSD menu image and perform bit-width conversion, converting the original bit-width m to 4 bits to obtain the transmitted hue H. T ,Right now: ; Step S23. Extract the brightness image V of the OSD menu image, perform bit width conversion, and convert the OSD menu brightness image from the original bit width m to a 4-bit extracted brightness V. T ,Right now: ; Step S24. Reassemble the OSD menu image data, with each pixel data consisting of hue H. T and brightness image V T Combined into a single byte; Step S25. Perform interlaced row and column sampling processing on the OSD menu image, where the row sampling interval is determined by ROW and the column sampling interval is determined by COL. Step S3. Transmit the OSD menu image processed in step S2 to the FPGA through the communication interface. The interface transmission rate Spd can be calculated from the endoscope video frame rate F and OB, that is: ,in The unit is MB / s; Step S4. The FPGA side uses the same communication interface as the ARM processor to receive OSD menu image data, and uses ping-pong operation to buffer the OSD menu image data; Step S5. Process the OSD menu image data cached in step S4 using a decompression algorithm; The decompression algorithm used in step S5 operates as follows: Step S51. Read the OSD menu image data of four pixels f(i,j), f(i,j+1), f(i+1,j), and f(i+1,j+1) in FIFO3, where i and j represent the position of the pixel in the OSD menu image, and the value of i is in the range of [0, N / 2] and the value of i is in the range of [0, M / 2]. Step S52. Calculate the pixel brightness data and hue data corresponding to position f(i+u, j+v) after bilinear interpolation amplification according to the bilinear amplification formula, where u takes the value range of [0, 1] and v takes the value range of [0, 1]. The rule for u and v is u, v = 1 / H, where H is the amplification factor. The specific bilinear amplification formula is as follows: Step S6. The OSD menu image processed by the decompression algorithm in step S5 is superimposed on a specified position of the endoscope video stream on the FPGA.
2. The method for overlaying OSD menus onto endoscopic video according to claim 1, characterized in that, In step S1, the values of the row pixel width N and column pixel width M are both positive integers, with N ranging from [240, 480] and M ranging from [160, 320].
3. The method for overlaying OSD menus onto endoscopic video according to claim 1, characterized in that, The ping-pong operation described in step S4 is as follows: Two buffers, FIFO1 and FIFO2, are designed internally in the FPGA to ping-pong the OSD menu image data received from the communication interface. FIFO3 is designed to buffer the data read from FIFO1 or FIFO2, and the write data width of FIFO3 is the same as that of FIFO1 and FIFO2, while the read data width is set to one byte. When there is data on the communication bus and FIFO1 is currently empty, FIFO2 is started to read and write the data to FIFO3, while the data received from the communication bus is buffered in FIFO1. When the amount of received data reaches OB, the writing to FIFO1 is stopped, and the reading to FIFO2 is also stopped. When there is data on the communication bus and FIFO2 is currently empty, FIFO1 is started to read and write the data to FIFO3, while the data received from the communication bus is buffered in FIFO2. When the amount of received data reaches OB, the writing to FIFO2 is stopped, and the reading to FIFO1 is also stopped.
4. The method for overlaying OSD menus onto endoscopic video according to claim 1, characterized in that, Step S6 includes: Step S61. Use the frame synchronization signal, row synchronization signal, and data valid signal in the endoscope video stream to obtain the row count hcnt and column count vcnt of the endoscope video stream. When the rising edge of the frame synchronization signal in the endoscope video stream arrives, hcnt and vcnt are both cleared to zero. When the rising edge of the row synchronization signal in the endoscope video stream arrives, the column count is accumulated. When the data valid signal in the endoscope video stream is high, the hcnt count is accumulated. Step S62. As can be seen from step S1, the size of the OSD menu image is N*M. Therefore, the size of the OSD display area on the screen is set to N*M, and the starting row position h_start and column position v_start of the display area are set. Step S63. Determine whether the value of hcnt is within [h_start, h_start+N] and the value of vcnt is within [v_start, v_start+M]; if yes, perform OSD menu image overlay; if no, output the original endoscope image. Step S64. Obtain the current OSD menu image and overlay it onto the endoscope images R, G, and B to achieve OSD menu image overlay.
5. The method for overlaying OSD menus onto endoscopic video according to claim 1, characterized in that, The designated location in step S6 is set as the area enclosed by columns 1 to 640 and rows 1 to 960 of the endoscopic video image.
Citation Information
Patent Citations
Method and device for character superimposition of video image
CN105450942A
Method and system for adding OSD to 4K real-time video
CN110012249A
Display device and display method thereof
CN114880052A
Image magnification and OSD superposition coding method and system
CN115278264A