Endoscopic image extraction method

Through the endoscopic image picking method, a two-dimensional coordinate system is constructed to detect the edge of the screen and extract effective images based on RGB values, solving the problems of small images under the mirror and insufficient processing frequency, and achieving efficient synchronous extraction and delay-free under the mirror image display.

CN119205737BActive Publication Date: 2025-08-12NANJING SUOTU TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411687609.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-08-12
Estimated Expiration
2044-11-25

AI Technical Summary

Technical Problem

Medical endoscopic images contain non-mirror information, which makes the mirror images small and difficult to observe, the frequency of real-time data processing is insufficient, which increases the delay, affects the effects of teaching, remote consultation and printing reports.

Method used

The endoscopic image picking method is adopted to construct a two-dimensional Cartesian coordinate system, detect the edge of the picture and detect points based on the RGB value, extract effective image content, remove non-mirror content, and meet the processing frequency of full frame rate.

Benefits of technology

It realizes synchronous extraction of under-mirror images at 60FPS and 1920×1080 resolution, removing non-mirror content, ensuring no delay in the picture synchronization, and improving processing frequency and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119205737B_ABST
    Figure CN119205737B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for extracting endoscopic images, comprising: obtaining image data from a medical endoscope host, using the rightmost position in the horizontal direction and the middle position in the vertical direction as a starting point, and searching for the edge of the image to the left in the horizontal direction; sequentially using a quarter of a clock face as a detection range, and detecting points in a counterclockwise direction based on the RGB value of the color of the area to be removed; comprehensively detecting the points obtained to obtain a contour path of the upper half of the image screen area; calculating a contour path of the lower half of the image screen area; and synchronously extracting valid endoscopic image content from the medical endoscope host image data based on the complete image screen contour path, and removing redundant non-endoscopic image content. The present invention can synchronously extract valid endoscopic image content and remove redundant non-endoscopic image content, and its performance fully meets the processing frequency of the full frame rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of medical endoscope image display, and in particular relates to an endoscope image extraction method. Background Art

[0002] The image output by the medical endoscope host not only contains the endoscopic image, but also other parameters and status information. This information is distributed on the left or right side of the endoscopic image. This results in the actual endoscopic image being too small and difficult to observe during teaching, remote consultation, and live broadcasts. It is also not conducive to combining with other intraoperative images (such as the surgical field) within the limited display range of the terminal screen. In addition, the image captured on the reporting workstation often contains a large amount of black background (up to 50% of the total size), resulting in a small endoscopic image on the printed report, which is difficult to identify and looks unsightly. At the same time, this large amount of black consumes a large amount of printing consumables during printing.

[0003] Traditional processing methods are mainly used to process images and do not have high time requirements. However, when faced with real-time data of medical imaging images with a full frame rate of 60FPS (Frames Per Second), the processing frequency of traditional processing methods is obviously insufficient, increasing the delay of real-time data. Summary of the Invention

[0004] In response to the technical problem in the existing technology that the real-time data processing frequency of medical imaging images is obviously insufficient, thereby increasing the delay of real-time data, the present invention discloses an endoscopic image extraction method, which can synchronously extract effective endoscopic image content and remove redundant non-endoscopic image content, and its performance fully meets the processing frequency of full frame rate.

[0005] The present invention discloses a method for extracting images under an endoscope, which comprises the following steps:

[0006] Acquire the image data of the medical endoscope host and construct a two-dimensional Cartesian coordinate system. The upper left corner of the screen is used as the origin of the coordinate system (0, 0), the horizontal direction of the screen is used as the X-axis, with the right direction being positive, and the vertical direction is used as the Y-axis, with the downward direction being positive. The unit is pixel.

[0007] Use the rightmost horizontal point and the middle vertical point as the starting point and search for the edge of the image to the left horizontally. After finding the edge of the image, start at 12 o'clock and use the clock as a guide. Set the detection range from before 12 o'clock to 9 o'clock as the starting and ending point. Based on the RGB value of the color of the area to be removed, detect points in a counterclockwise direction. When the expected point range reaches one-quarter of the clock face, use the clock end point of the detection range as the new starting point, adjust one-quarter of the clock face in the counterclockwise direction, and detect points in the counterclockwise direction as the new detection range. Repeat the above detection process until the clock end point of the detection range returns to the 12 o'clock direction.

[0008] The points obtained by comprehensive detection are used to obtain the contour path of the upper half of the image area;

[0009] Calculate the contour path of the lower half of the image area;

[0010] Merge the upper half of the image area contour path and the lower half of the image area contour path to obtain a complete image area contour path;

[0011] According to the complete image outline path, effective endoscopic image content is synchronously extracted from the medical endoscope host image data, and redundant non-endoscopic image content is removed.

[0012] Furthermore, the frame rate of the medical endoscope host image data is not less than 60FPS.

[0013] Furthermore, the resolution of the medical endoscope host image data is 1920×1080.

[0014] Furthermore, the process of obtaining the contour path of the upper half of the image area includes the following steps:

[0015] S1, input a frame of RGB data of medical image; set a point named CurrentPos, the X-axis coordinate is the width of the image size minus 1, and the Y-axis coordinate is the height of the image size divided by 2; from the point CurrentPos, get the RGB value of the color of the area to be removed, named C0, and set a variable-length list set named listEdgePoint;

[0016] S2, move the X-axis coordinate of point CurrentPos 10 pixels to the left, and assign the new coordinate point value to CurrentPos, repeating this step until the new coordinate point value is different from C0;

[0017] S3, move the X-axis coordinate of point CurrentPos to the right by 1 pixel, and assign the new coordinate point value to CurrentPos, repeating this step until the new coordinate point value is different from C0;

[0018] S4, set a coordinate named BeginPos (BeginPos.X, BeginPos.Y), the coordinate value is the same as CurrentPos (CurrentPos.X, CurrentPos.Y), and add the CurrentPos coordinate to the listEdgePoint collection;

[0019] S5, starting from the position of CurrentPos in the direction of 12 o'clock, counterclockwise direction, obtain the pixel values of the coordinate points between 12 o'clock and 9 o'clock;

[0020] S6, take the pixel value at the coordinate point (CurrentPos.X-1, CurrentPos.Y-1) to determine whether it is the same as C0. If it is the same, go to step S7; otherwise, assign the value of the next coordinate point (CurrentPos.X, CurrentPos.Y-1) in the clockwise direction to CurrentPos, add the coordinates of CurrentPos to the set listEdgePoint, and determine whether CurrentPos.Y is the same as BeginPos.Y. If so, go to step S17, if not, return to step S5;

[0021] Step S7, take the pixel value at the coordinate point (CurrentPos.X-1, CurrentPos.Y) to determine whether it is the same as C0. If it is the same, go to step S8; otherwise, assign the value of the next coordinate point (CurrentPos.X-1, CurrentPos.Y-1) in the clockwise direction to CurrentPos, add the coordinates of CurrentPos to the set listEdgePoint, and determine whether CurrentPos.Y is the same as BeginPos.Y. If so, go to step S17, if not, return to step S5;

[0022] S8, starting from the position of CurrentPos in the nine o'clock direction, counterclockwise direction, obtain the pixel values of the coordinate points between nine o'clock and six o'clock;

[0023] S9, take the pixel value at the coordinate point (CurrentPos.X-1, CurrentPos.Y+1) to determine whether it is the same as C0. If it is the same, go to step S10; otherwise, assign the value of the next coordinate point (CurrentPos.X-1, CurrentPos.Y) in the clockwise direction to CurrentPos, add the coordinates of CurrentPos to the set listEdgePoint, and determine whether CurrentPos.Y is the same as BeginPos.Y. If so, go to step S17, if not, return to step S8;

[0024] S10, take the pixel value at the coordinate point (CurrentPos.X, CurrentPos.Y+1) to determine whether it is the same as C0. If it is the same, go to step S11; otherwise, assign the value of the next coordinate point in the clockwise direction (CurrentPos.X-1, CurrentPos.Y+1) to CurrentPos, add the coordinates of CurrentPos to the set listEdgePoint, and determine whether CurrentPos.Y is the same as BeginPos.Y. If so, go to step S17, if not, return to step S8;

[0025] S11, starting from the position of CurrentPos in the six o'clock direction, counterclockwise direction, obtain the pixel values of the coordinate points between six o'clock and three o'clock;

[0026] S12, take the pixel value at the coordinate point (CurrentPos.X+1, CurrentPos.Y+1) to determine whether it is the same as C0. If the same, go to step S13; otherwise, assign the value of the next coordinate point (CurrentPos.X, CurrentPos.Y+1) in the clockwise direction to CurrentPos, add the coordinates of CurrentPos to the set listEdgePoint, and determine whether CurrentPos.Y is the same as BeginPos.Y. If so, go to step S17, if not, return to step S11;

[0027] S13, take the pixel value at the coordinate point (CurrentPos.X+1, CurrentPos.Y) to determine whether it is the same as C0. If it is the same, go to step S14; otherwise, assign the value of the next coordinate point (CurrentPos.X+1, CurrentPos.Y+1) in the clockwise direction to CurrentPos, add the coordinates of CurrentPos to the set listEdgePoint, and determine whether CurrentPos.Y is the same as BeginPos.Y. If so, go to step S17, if not, return to step S11;

[0028] S14, starting from the position of CurrentPos in the 3 o'clock direction, counterclockwise direction, obtain the pixel values of the coordinate points between 3 o'clock and 12 o'clock;

[0029] S15, take the pixel value at the coordinate point (CurrentPos.X+1, CurrentPos.Y-1) to determine whether it is the same as C0. If it is the same, go to step S16; otherwise, assign the value of the next coordinate point (CurrentPos.X+1, CurrentPos.Y) in the clockwise direction to CurrentPos, add the coordinates of CurrentPos to the set listEdgePoint, and determine whether CurrentPos.Y is the same as BeginPos.Y. If so, go to step S17, if not, return to step S14;

[0030] S16, take the pixel value at the coordinate point (CurrentPos.X, CurrentPos.Y-1) to determine whether it is the same as C0. If it is the same, go to step S5; otherwise, assign the value of the next coordinate point in the clockwise direction (CurrentPos.X+1, CurrentPos.Y-1) to CurrentPos, add the coordinates of CurrentPos to the set listEdgePoint, and determine whether CurrentPos.Y is the same as BeginPos.Y. If so, go to step S17, if not, return to step S14;

[0031] S17, the coordinate points in the integrated set listEdgePoint are used to draw and save the outline path of the upper half of the image screen area.

[0032] Furthermore, the process of calculating the contour path of the lower half of the image area includes the following steps:

[0033] Traverse the contour path of the upper half of the image area from back to front and extract all the coordinate points in listEdgePoint;

[0034] For each coordinate point, keep the X-axis coordinate value unchanged, use BeginPos.Y + (BeginPos.Y - CurrentPos.Y) as the Y-axis coordinate value to generate a new coordinate point;

[0035] All the new coordinate points generated are drawn and saved as the outline path of the lower half of the image screen area.

[0036] Furthermore, the endoscopic image extraction method includes the following steps:

[0037] The complete image contour path obtained by merging is cached; before the next detection, the contour is checked to see if it matches. If it does, the existing image contour path is used directly.

[0038] Furthermore, the process of checking whether the contours match before the next detection includes the following steps:

[0039] Retrieve the full outline path of an existing image;

[0040] Extract the pixel values of the coordinate points at the positions of 0%, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, and 90% from the full contour path point set of the image screen;

[0041] Determine whether the pixel points at the 10 extracted positions are the same. If so, based on the full contour path of the image screen, obtain all pixel point data within the full contour path except the path points from the RGB data matrix of the medical image screen in order from top to bottom and left to right, and use the obtained pixel point data as the data content containing the actual microscopic image of the medical image; if not, regenerate the image screen contour path according to the medical image screen.

[0042] The present invention's endoscopic image extraction method performs full-contour path detection on medical endoscope host image data with a resolution of 1920×1080 and a frame rate of 60 FPS (frames per second). When compared with a video image that has not undergone this processing, both images are synchronized without any delay. Furthermore, the image contour path detection is accurate, and the content of the endoscope image is accurately extracted. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 This is a flow chart of the endoscopic image extraction method of the present invention;

[0044] Figure 2 Flow chart of the overall detection steps of the present invention;

[0045] Figure 3 This is a flow chart of the detection steps between 12 o'clock and 9 o'clock;

[0046] Figure 4 This is a flow chart of the testing steps between 9:00 and 6:00;

[0047] Figure 5 This is a flow chart of the detection steps between 6 o'clock and 3 o'clock;

[0048] Figure 6 This is a flow chart of the detection steps between 3 o'clock and 12 o'clock;

[0049] Figure 7 To find the upper contour path diagram;

[0050] Figure 8 Schematic diagram of deriving and calculating the lower contour path from the upper contour path. DETAILED DESCRIPTION

[0051] The following examples may enable those skilled in the art to more fully understand the present invention, but are not intended to limit the present invention in any way.

[0052] See also Figure 1 and Figure 2 The present invention discloses a method for extracting images under an endoscope, and the method comprises the following steps:

[0053] Acquire the image data of the medical endoscope host and construct a two-dimensional Cartesian coordinate system. The upper left corner of the screen is used as the origin of the coordinate system (0, 0), the horizontal direction of the screen is used as the X-axis, with the right direction being positive, and the vertical direction is used as the Y-axis, with the downward direction being positive. The unit is pixel.

[0054] Use the rightmost horizontal point and the middle vertical point as the starting point and search for the edge of the image to the left horizontally. After finding the edge of the image, start at 12 o'clock and use the clock as a guide. Set the detection range from before 12 o'clock to 9 o'clock as the starting and ending point. Based on the RGB value of the color of the area to be removed, detect points in a counterclockwise direction. When the expected point range reaches one-quarter of the clock face, use the clock end point of the detection range as the new starting point, adjust one-quarter of the clock face in the counterclockwise direction, and detect points in the counterclockwise direction as the new detection range. Repeat the above detection process until the clock end point of the detection range returns to the 12 o'clock direction.

[0055] The points obtained by comprehensive detection are used to obtain the contour path of the upper half of the image area;

[0056] Calculate the contour path of the lower half of the image area;

[0057] Merge the upper half of the image area contour path and the lower half of the image area contour path to obtain a complete image area contour path;

[0058] According to the complete image outline path, effective endoscopic image content is synchronously extracted from the medical endoscope host image data, and redundant non-endoscopic image content is removed.

[0059] In the present invention, the frame rate of the medical endoscope host image data is not less than 60 FPS. The resolution of the medical endoscope host image data is 1920×1080.

[0060] See also Figures 3 to 6 The process of obtaining the contour path of the upper half of the image area includes the following steps:

[0061] S1, input a frame of RGB data of medical image; set a point named CurrentPos, the X-axis coordinate is the width of the image size minus 1, and the Y-axis coordinate is the height of the image size divided by 2; from the point CurrentPos, get the RGB value of the color of the area to be removed, named C0, and set a variable-length list set named listEdgePoint;

[0062] S2, move the X-axis coordinate of point CurrentPos 10 pixels to the left, and assign the new coordinate point value to CurrentPos, repeating this step until the new coordinate point value is different from C0;

[0063] S3, move the X-axis coordinate of point CurrentPos to the right by 1 pixel, and assign the new coordinate point value to CurrentPos, repeating this step until the new coordinate point value is different from C0;

[0064] S4, set a coordinate named BeginPos (BeginPos.X, BeginPos.Y), the coordinate value is the same as CurrentPos (CurrentPos.X, CurrentPos.Y), and add the CurrentPos coordinate to the listEdgePoint collection;

[0065] S5, starting from the position of CurrentPos in the direction of 12 o'clock, counterclockwise direction, obtain the pixel values of the coordinate points between 12 o'clock and 9 o'clock;

[0066] S6, take the pixel value at the coordinate point (CurrentPos.X-1, CurrentPos.Y-1) to determine whether it is the same as C0. If it is the same, go to step S7; otherwise, assign the value of the next coordinate point (CurrentPos.X, CurrentPos.Y-1) in the clockwise direction to CurrentPos, add the coordinates of CurrentPos to the set listEdgePoint, and determine whether CurrentPos.Y is the same as BeginPos.Y. If so, go to step S17, if not, return to step S5;

[0067] Step S7, take the pixel value at the coordinate point (CurrentPos.X-1, CurrentPos.Y) to determine whether it is the same as C0. If it is the same, go to step S8; otherwise, assign the value of the next coordinate point (CurrentPos.X-1, CurrentPos.Y-1) in the clockwise direction to CurrentPos, add the coordinates of CurrentPos to the set listEdgePoint, and determine whether CurrentPos.Y is the same as BeginPos.Y. If so, go to step S17, if not, return to step S5;

[0068] S8, starting from the position of CurrentPos in the nine o'clock direction, counterclockwise direction, obtain the pixel values of the coordinate points between nine o'clock and six o'clock;

[0069] S9, take the pixel value at the coordinate point (CurrentPos.X-1, CurrentPos.Y+1) to determine whether it is the same as C0. If it is the same, go to step S10; otherwise, assign the value of the next coordinate point (CurrentPos.X-1, CurrentPos.Y) in the clockwise direction to CurrentPos, add the coordinates of CurrentPos to the set listEdgePoint, and determine whether CurrentPos.Y is the same as BeginPos.Y. If so, go to step S17, if not, return to step S8;

[0070] S10, take the pixel value at the coordinate point (CurrentPos.X, CurrentPos.Y+1) to determine whether it is the same as C0. If it is the same, go to step S11; otherwise, assign the value of the next coordinate point in the clockwise direction (CurrentPos.X-1, CurrentPos.Y+1) to CurrentPos, add the coordinates of CurrentPos to the set listEdgePoint, and determine whether CurrentPos.Y is the same as BeginPos.Y. If so, go to step S17, if not, return to step S8;

[0071] S11, starting from the position of CurrentPos in the six o'clock direction, counterclockwise direction, obtain the pixel values of the coordinate points between six o'clock and three o'clock;

[0072] S12, take the pixel value at the coordinate point (CurrentPos.X+1, CurrentPos.Y+1) to determine whether it is the same as C0. If the same, go to step S13; otherwise, assign the value of the next coordinate point (CurrentPos.X, CurrentPos.Y+1) in the clockwise direction to CurrentPos, add the coordinates of CurrentPos to the set listEdgePoint, and determine whether CurrentPos.Y is the same as BeginPos.Y. If so, go to step S17, if not, return to step S11;

[0073] S13, take the pixel value at the coordinate point (CurrentPos.X+1, CurrentPos.Y) to determine whether it is the same as C0. If it is the same, go to step S14; otherwise, assign the value of the next coordinate point (CurrentPos.X+1, CurrentPos.Y+1) in the clockwise direction to CurrentPos, add the coordinates of CurrentPos to the set listEdgePoint, and determine whether CurrentPos.Y is the same as BeginPos.Y. If so, go to step S17, if not, return to step S11;

[0074] S14, starting from the position of CurrentPos in the 3 o'clock direction, counterclockwise direction, obtain the pixel values of the coordinate points between 3 o'clock and 12 o'clock;

[0075] S15, take the pixel value at the coordinate point (CurrentPos.X+1, CurrentPos.Y-1) to determine whether it is the same as C0. If it is the same, go to step S16; otherwise, assign the value of the next coordinate point (CurrentPos.X+1, CurrentPos.Y) in the clockwise direction to CurrentPos, add the coordinates of CurrentPos to the set listEdgePoint, and determine whether CurrentPos.Y is the same as BeginPos.Y. If so, go to step S17, if not, return to step S14;

[0076] S16, take the pixel value at the coordinate point (CurrentPos.X, CurrentPos.Y-1) to determine whether it is the same as C0. If it is the same, go to step S5; otherwise, assign the value of the next coordinate point in the clockwise direction (CurrentPos.X+1, CurrentPos.Y-1) to CurrentPos, add the coordinates of CurrentPos to the set listEdgePoint, and determine whether CurrentPos.Y is the same as BeginPos.Y. If so, go to step S17, if not, return to step S14;

[0077] S17, the coordinate points in the integrated set listEdgePoint are used to draw and save the outline path of the upper half of the image screen area. Figure 7 Schematic diagram for finding the upper contour path.

[0078] Taking into account the characteristics of the endoscope image as a vertically symmetrical image, only the contour path of the upper half of the image area is detected, and the contour path of the lower half of the image area is calculated from the contour path of the upper half of the image area. After merging, the complete image contour path can be obtained, which greatly improves the detection speed.

[0079] See also Figure 8 The process of calculating the contour path of the lower half of the image screen area includes the following steps: traverse the contour path of the upper half of the image screen area from back to front, and extract all coordinate points in listEdgePoint; for each coordinate point, keep the X-axis coordinate value unchanged, use BeginPos.Y+(BeginPos.Y-CurrentPos.Y) as the Y-axis coordinate value, and generate a new coordinate point; all the new coordinate points generated are drawn and saved as the contour path of the lower half of the image screen area.

[0080] In order to reduce the processing time of a single image screen area, the detected image screen contour path is cached, and the contour is checked before the next detection to see if it matches. If it matches, the existing image screen contour path can be used directly, avoiding the resources and time required for each detection, thereby greatly improving the processing efficiency; if it does not match, the image screen contour is re-detected.

[0081] As one of the preferred options, the process of checking whether the contour matches before the next detection includes the following steps:

[0082] Retrieve the full contour path of an existing image screen; extract the pixel values of the coordinate points at the positions of 0%, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, and 90% from the full contour path point set of the image screen; determine whether the pixel points at the 10 extracted positions are the same; if so, obtain all pixel point data within the full contour path except the path points from the RGB data matrix of the medical image screen in order from top to bottom and from left to right based on the full contour path of the image screen, and use the obtained pixel point data as the data content containing the actual microscopic image of the medical image; if not, regenerate the image screen contour path according to the medical image screen.

[0083] Using the method described in the present invention, when performing full-contour path detection on medical endoscope image data with a resolution of 1920×1080 and a frame rate of 60 FPS (Frames Per Second), compared with a video image that had not undergone this processing, both images were synchronized without any delay. Furthermore, the image contour path detection was accurate, and the content of the endoscope image was accurately extracted.

[0084] The above are merely preferred embodiments of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions based on the principles of the present invention are within the scope of protection of the present invention. It should be noted that for those skilled in the art, various improvements and modifications that do not depart from the principles of the present invention should be considered within the scope of protection of the present invention.

Claims

1. A method for extracting an image under an endoscope, characterized in that: The endoscopic image extraction method comprises the following steps: Acquire the image data of the medical endoscope host and construct a two-dimensional Cartesian coordinate system. The upper left corner of the screen is used as the origin of the coordinate system (0, 0), the horizontal direction of the screen is used as the X-axis, with the right direction being positive, and the vertical direction is used as the Y-axis, with the downward direction being positive. The unit is pixel. Use the rightmost horizontal point and the middle vertical point as the starting point and search for the edge of the image to the left horizontally. After finding the edge of the image, start at 12 o'clock and use the clock as a guide. Set the detection range from before 12 o'clock to 9 o'clock as the starting and ending point. Based on the RGB value of the color of the area to be removed, detect points in a counterclockwise direction. When the expected point range reaches one-quarter of the clock face, use the clock end point of the detection range as the new starting point, adjust one-quarter of the clock face in the counterclockwise direction, and detect points in the counterclockwise direction as the new detection range. Repeat the detection process until the clock end point of the detection range returns to the 12 o'clock direction. The points obtained by comprehensive detection are used to obtain the contour path of the upper half of the image area; Calculate the contour path of the lower half of the image area; Merge the upper half of the image screen area contour path and the lower half of the image screen area contour path to obtain a complete image screen contour path; According to the complete image outline path, the effective endoscopic image content is synchronously extracted from the medical endoscope host image data, and the redundant non-endoscopic image content is removed; The process of obtaining the contour path of the upper half of the image area includes the following steps: S1, input a frame of RGB data of medical image; set a point named CurrentPos, the X-axis coordinate is the width of the image size minus 1, and the Y-axis coordinate is the height of the image size divided by 2; from the point CurrentPos, get the RGB value of the color of the area to be removed, named C0, and set a variable-length list set named listEdgePoint; S2, move the X-axis coordinate of point CurrentPos 10 pixels to the left, and assign the new coordinate point value to CurrentPos, repeating this step until the new coordinate point value is different from C0; S3, move the X-axis coordinate of point CurrentPos to the right by 1 pixel, and assign the new coordinate point value to CurrentPos, repeating this step until the new coordinate point value is different from C0; S4, set a coordinate named BeginPos (BeginPos.X, BeginPos.Y), the coordinate value is the same as CurrentPos (CurrentPos.X, CurrentPos.Y), and add the CurrentPos coordinate to the listEdgePoint collection; S5, starting from the position of CurrentPos in the direction of 12 o'clock, counterclockwise, obtain the pixel values of the coordinate points between 12 o'clock and 9 o'clock; S6, take the pixel value at the coordinate point (CurrentPos.X-1, CurrentPos.Y-1) to determine whether it is the same as C0. If it is the same, go to step S7; otherwise, assign the value of the next coordinate point (CurrentPos.X, CurrentPos.Y-1) in the clockwise direction to CurrentPos, add the coordinates of CurrentPos to the set listEdgePoint, and determine whether CurrentPos.Y is the same as BeginPos.Y. If so, go to step S17, if not, return to step S5; Step S7, take the pixel value at the coordinate point (CurrentPos.X-1, CurrentPos.Y) to determine whether it is the same as C0. If it is the same, go to step S8; otherwise, go to the next coordinate point in the clockwise direction. Assign the value of (CurrentPos.X-1, CurrentPos.Y-1) to CurrentPos, add the coordinates of CurrentPos to the set listEdgePoint, and determine whether CurrentPos.Y is the same as BeginPos.Y. If so, go to step S17; if not, return to step S5; S8, starting from the position of CurrentPos in the nine o'clock direction, counterclockwise direction, obtain the pixel values of the coordinate points between nine o'clock and six o'clock; S9, take the pixel value at the coordinate point (CurrentPos.X-1, CurrentPos.Y+1) to determine whether it is the same as C0. If it is the same, go to step S10; otherwise, assign the value of the next coordinate point (CurrentPos.X-1, CurrentPos.Y) in the clockwise direction to CurrentPos, add the coordinates of CurrentPos to the set listEdgePoint, and determine whether CurrentPos.Y is the same as BeginPos.Y. If so, go to step S17, if not, return to step S8; S10, take the pixel value at the coordinate point (CurrentPos.X, CurrentPos.Y+1) to determine whether it is the same as C0. If it is the same, go to step S11; otherwise, assign the value of the next coordinate point in the clockwise direction (CurrentPos.X-1, CurrentPos.Y+1) to CurrentPos, add the coordinates of CurrentPos to the set listEdgePoint, and determine whether CurrentPos.Y is the same as BeginPos.Y. If so, go to step S17, if not, return to step S8; S11, starting from the position of CurrentPos in the six o'clock direction, counterclockwise direction, obtain the pixel values of the coordinate points between six o'clock and three o'clock; S12, take the pixel value at the coordinate point (CurrentPos.X+1, CurrentPos.Y+1) to determine whether it is the same as C0. If the same, go to step S13; otherwise, assign the value of the next coordinate point (CurrentPos.X, CurrentPos.Y+1) in the clockwise direction to CurrentPos, add the coordinates of CurrentPos to the set listEdgePoint, and determine whether CurrentPos.Y is the same as BeginPos.Y. If so, go to step S17, if not, return to step S11; S13, take the pixel value at the coordinate point (CurrentPos.X+1, CurrentPos.Y) to determine whether it is the same as C0. If it is the same, go to step S14; otherwise, assign the value of the next coordinate point (CurrentPos.X+1, CurrentPos.Y+1) in the clockwise direction to CurrentPos, add the coordinates of CurrentPos to the set listEdgePoint, and determine whether CurrentPos.Y is the same as BeginPos.Y. If so, go to step S17, if not, return to step S11; S14, starting from the position of CurrentPos in the 3 o'clock direction, counterclockwise direction, obtain the pixel values of the coordinate points between 3 o'clock and 12 o'clock; S15, take the pixel value at the coordinate point (CurrentPos.X+1, CurrentPos.Y-1) to determine whether it is the same as C0. If it is the same, go to step S16; otherwise, go to the next coordinate point in the clockwise direction. Assign the value of (CurrentPos.X+1, CurrentPos.Y) to CurrentPos, add the coordinates of CurrentPos to the set listEdgePoint, and determine whether CurrentPos.Y is the same as BeginPos.Y. If so, go to step S17; if not, return to step S14; S16, take the pixel value at the coordinate point (CurrentPos.X, CurrentPos.Y-1) to determine whether it is the same as C0. If it is the same, go to step S5; otherwise, assign the value of the next coordinate point in the clockwise direction (CurrentPos.X+1, CurrentPos.Y-1) to CurrentPos, add the coordinates of CurrentPos to the set listEdgePoint, and determine whether CurrentPos.Y is the same as BeginPos.Y. If so, go to step S17, if not, return to step S14; S17, drawing and saving the outline path of the upper half of the image screen area based on the coordinate points in the listEdgePoint set; The process of calculating the contour path of the lower half of the image area includes the following steps: Traverse the contour path of the upper half of the image area from back to front and extract all the coordinate points in listEdgePoint; For each coordinate point, keep the X-axis coordinate value unchanged and set BeginPos.Y+(BeginPos.Y- CurrentPos.Y) as the Y-axis coordinate value to generate a new coordinate point; All the new coordinate points generated are drawn and saved as the outline path of the lower half of the image screen area.

2. The method for extracting endoscopic images according to claim 1, characterized in that: The frame rate of the medical endoscope host image data is not less than 60FPS.

3. The method for extracting endoscopic images according to claim 1, characterized in that: The resolution of the medical endoscope host image data is 1920×1080.

4. The method for extracting endoscopic images according to claim 1, wherein: The endoscopic image extraction method comprises the following steps: The complete image contour path obtained by merging is cached; before the next detection, the contour is checked to see if it matches. If it does, the existing image contour path is used directly.

5. The method for extracting endoscopic images according to claim 4, characterized in that: The process of checking whether the contours match before the next detection includes the following steps: Retrieve the full outline path of an existing image; Extract the pixel values of the coordinate points at the positions of 0%, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, and 90% from the full contour path point set of the image screen; Determine whether the pixel points at the 10 extracted positions are the same. If so, based on the full contour path of the image screen, obtain all pixel point data within the full contour path except the path points from the RGB data matrix of the medical image screen in order from top to bottom and left to right, and use the obtained pixel point data as the data content containing the actual microscopic image of the medical image; if not, regenerate the image screen contour path according to the medical image screen.

Citation Information

Patent Citations

  • Medical image contour rapid extraction method

    CN111127404A

  • Fluorescent observation endoscope apparatus

    JP2005319115A