A digital video signal acquisition method and system for electronic gastroscope

By analyzing the frame images in the digital video of electronic gastroscopy and identifying and deleting useless frames, the image quality problems caused by doctors' unstable operation or patient response are solved, and the image quality of electronic gastroscopy is improved, making it easier to judge the lesion.

CN120355719BActive Publication Date: 2025-08-22XUZHOU FIRST PEOPLES HOSPITAL
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510848582.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-24
Publication Date
2025-08-22
Estimated Expiration
2045-06-24

AI Technical Summary

Technical Problem

In electronic gastroscopy, the unstable visual field of gastroscopy caused by the doctor's inexperience in operation or the patient's reaction may lead to image shaking, deformed motion blur, overexposed or underexposed, affecting the image quality and thus affecting the doctor's judgment.

Method used

By analyzing the frame images in the digital video of electronic gastroscopy, the gastric cavity dilation state coefficient and irregular characteristic coefficient of gastric wall peristalsis are determined, useless frames are identified and deleted, and the target digital video signal is obtained.

Benefits of technology

It reduces the impact of invalid frames, improves image quality, and facilitates doctors to accurately judge the lesions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120355719B_ABST
    Figure CN120355719B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image communication technology, and particularly to a digital video signal acquisition method and system for an electronic gastroscope. The method and system acquire several frames of images from a digital video of an electronic gastroscope, determine the expansion state coefficient of the gastric cavity corresponding to each frame of image and the irregular characteristic coefficient of gastric wall peristalsis corresponding to each frame of image based on the several frames of image, determine the possibility that each frame of image is a useless frame based on the expansion state coefficient and the irregular characteristic coefficient, analyze the quality of each frame of image based on the expansion state of the gastric cavity and the gastric wall peristalsis law to determine the possibility that the image is a useless frame, and finally determine the useless frames based on the possibility of the useless frames and a possibility threshold, and delete all useless frames in the several frames of image to obtain a final acquired target digital video signal. This method is beneficial to reducing the impact caused by invalid frames and facilitates doctors to make judgments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image communication, and in particular to a method and system for acquiring digital video signals of an electronic gastroscope. Background Art

[0002] An electronic gastroscope is a medical electronic optical instrument that can be inserted into the human stomach cavity for direct observation, diagnosis, and treatment of gastrointestinal diseases. It uses a tiny objective lens system to image objects within the stomach onto an imaging array photoelectric sensor. The received image signal is then transmitted to an image processing system, and the processed image is output on a monitor, producing high-definition images. This image processing allows for three-dimensional visualization and measurement of mucosal blood flow, local hemoglobin content, and temperature. Typically, an electronic gastroscope is equipped with a micro-image sensor at the front end. A built-in light source directs light into the stomach via optical fibers to illuminate the examination area. After receiving the light, the image sensor converts the optical signal into an electrical signal, which is then transmitted via a cable to an external image processing unit. During this process, the electrical signal undergoes analog-to-digital conversion. The image processing unit processes the received digital signal, including noise removal, image enhancement, color correction, and deletion of invalid video frames, to improve image quality. The resulting digital video signal, equivalent to the final acquired digital video signal, can be output to a monitor via various interfaces (such as HDMI and SDI).

[0003] However, in actual electronic gastroscopy, the doctor may be unskilled or insert the gastroscope too quickly, or the gastrointestinal motility may be accelerated or spasmed due to excessive stretching of the stomach wall or fear or tension of the patient during the operation. This may cause the gastroscopy field of view to be unstable, and may result in image shaking, deformation, motion blur, overexposure, underexposure or other reasons, resulting in useless frames of poor quality. If these useless frames are collected and output to the display as the final digital video signal, the invalid frames will affect the doctor's judgment, which is not conducive to the doctor's accurate judgment of the lesion. Summary of the Invention

[0004] In order to solve the above technical problems, the purpose of the present invention is to provide a method and system for collecting digital video signals of an electronic gastroscope. The technical solutions adopted are as follows:

[0005] In a first aspect, an embodiment of the present application provides a method for acquiring digital video signals of an electronic gastroscope, comprising:

[0006] Acquire several frames of images from a digital video of an electronic gastroscope;

[0007] Determining, based on the plurality of frames of images, a coefficient of expansion state of the gastric cavity corresponding to each frame of image and a coefficient of irregular characteristic of gastric wall peristalsis corresponding to each frame of image;

[0008] determining the possibility that each frame of image is a useless frame based on the expansion state coefficient and the irregular characteristic coefficient;

[0009] The useless frames are determined according to the probability of the useless frames and the probability threshold, and all the useless frames in the plurality of frames of the image are deleted to obtain the final collected target digital video signal.

[0010] In one embodiment, determining the expansion state coefficient of the gastric cavity corresponding to each frame of the image based on the plurality of frames of the image includes:

[0011] Performing grayscale change analysis on each frame of the image to determine grayscale non-uniformity of each frame of the image;

[0012] Detecting corner points in each frame of image using a corner detection algorithm, performing corner point matching based on the corner points, and determining the convex hull of each frame of image, wherein the convex hull is the smallest polygon containing all corner points;

[0013] According to the convex hull of each frame of image, the centroid coordinates and the convex hull area of ​​each convex hull are determined, and the moving speed analysis is performed on the centroid coordinates of each convex hull to obtain the moving speed analysis result corresponding to each frame of image;

[0014] The expansion state coefficient of the gastric cavity corresponding to each frame of image is determined according to the grayscale non-uniformity, the movement speed analysis result and the convex hull area.

[0015] In one embodiment, performing grayscale change analysis on each frame of the image to determine grayscale non-uniformity of each frame of the image includes:

[0016] Determining a preset frame of image following each frame of the image as a matching image corresponding to each frame of the image, and determining, in the matching image corresponding to each frame of the image, each second pixel point that matches each first pixel point of each frame of the image;

[0017] Calculating the absolute value of the gradient difference between each first pixel point and each corresponding matched second pixel point;

[0018] The absolute value corresponding to each first pixel point is respectively used as the grayscale value weight of the first pixel point, and based on the grayscale value weight and grayscale value of each first pixel point, the weighted variance of all first pixel points in each frame of the image is calculated as the grayscale non-uniformity of each frame of the image.

[0019] In one embodiment, performing movement speed analysis on the centroid coordinates of each convex hull to obtain a movement speed analysis result corresponding to each frame of the image includes:

[0020] Determining the moving speed of the centroids of two adjacent frame images according to the centroid coordinates of each convex hull;

[0021] Determine a subsequence of movement speeds corresponding to each frame of the image according to the movement speeds of the centroids of each frame of the image and a specified number of frames of image after the frame of the image.

[0022] The variance of the movement speed subsequence corresponding to each frame of the image is calculated respectively to obtain the movement speed analysis result corresponding to each frame of the image.

[0023] In one embodiment, determining the expansion state coefficient of the gastric cavity corresponding to each frame of image based on the grayscale non-uniformity, the movement speed analysis result, and the convex hull area includes:

[0024] Determine an image sequence corresponding to each frame of the image according to a specified number of frames of images following each frame of the image;

[0025] Determining, based on the convex hull area of ​​each frame of the image, a mean value of the area difference between the convex hull area of ​​each frame of the image and the convex hull areas of each frame of the image in the corresponding image sequence;

[0026] The expansion state coefficient of the gastric cavity corresponding to each frame of image is obtained according to the product of the grayscale non-uniformity, the movement speed analysis result and the mean value of the area difference.

[0027] In one embodiment, determining, based on the plurality of frames of images, the irregular characteristic coefficient of gastric wall peristalsis corresponding to each frame of image includes:

[0028] Performing edge detection on several frames of the image to obtain all edge pixels in each frame of the image, determining the movement speed and movement direction of each edge pixel, and determining a movement speed change curve of each edge pixel within the time period of appearance based on the movement speed of the edge pixel;

[0029] Determining, based on the motion speed change curve within the appearance time of each edge pixel point, the similarities between the first target edge pixel point with unstable motion speed and the motion speed change curves of each pair of the first target edge pixel points in each frame of the image, and determining a similarity mean based on all the similarities;

[0030] Determining a difference in motion speeds of all edge pixels in each frame of the image based on the similarity mean, a first number of first target edge pixels in each frame of the image, and a second number of edge pixels in each frame of the image;

[0031] Determine, based on the motion direction of each edge pixel point, a second target edge pixel point with an abnormal motion direction in each frame of the image, and determine, based on the second target edge pixel point with an abnormal motion direction in each frame of the image, an abnormal direction clutter degree of each frame of the image;

[0032] The irregular characteristic coefficient of gastric wall peristalsis corresponding to each frame of the image is determined according to the abnormal direction clutter, the movement speed difference and the movement direction of each edge pixel point of each frame of the image.

[0033] In one embodiment, determining the abnormal direction clutter degree of each frame of the image according to the second target edge pixel point with abnormal motion direction in each frame of the image includes:

[0034] Clustering the second target edge pixel points with abnormal motion directions in each frame of the image, respectively, according to the motion directions of the second target edge pixel points, to obtain a plurality of clusters corresponding to each frame of the image;

[0035] Determining the center edge pixel point of each cluster respectively, taking the movement direction of the center edge pixel point as the representative direction of the cluster, and determining the angle difference between the representative directions of each two clusters in the clusters corresponding to each frame of the image;

[0036] The sum of angle differences of all angle differences corresponding to each frame of the image is determined respectively, and the abnormal direction clutter of each frame of the image is determined according to the number of clusters corresponding to each frame of the image and the product of the sum of angle differences.

[0037] In one embodiment, determining the irregular characteristic coefficient of gastric wall peristalsis corresponding to each frame of the image based on the abnormal direction clutter, the movement speed difference, and the movement direction of each edge pixel of each frame of the image includes:

[0038] According to the movement direction of each edge pixel point, respectively determining the movement direction angle between each identical edge pixel point in two adjacent frame images;

[0039] Determining an average of the motion direction angles corresponding to each edge pixel point based on all the motion direction angles, and summing the average of the motion direction angles corresponding to each edge pixel point and a second number of edge pixels in each frame of the image to obtain a summation result;

[0040] The irregular characteristic coefficient of gastric wall peristalsis corresponding to each frame of the image is obtained according to the product of the summation result corresponding to each frame of the image, the abnormal direction clutter of each frame of the image, and the size of the movement speed difference.

[0041] In one embodiment, determining the possibility that each frame of image is a useless frame based on the expansion state coefficient and the irregular feature coefficient includes:

[0042] Determining a probability value of each frame of image being a useless frame according to the product of the expansion state coefficient and the irregular feature coefficient;

[0043] The possibility that each frame of image is a useless frame is obtained according to the possibility value of each frame of image being a useless frame and the normalization function.

[0044] In a second aspect, an embodiment of the present application provides a digital video signal acquisition system for an electronic gastroscope, comprising:

[0045] An acquisition module is used to acquire a plurality of frames of images from a digital video of an electronic gastroscope;

[0046] a first determining module, configured to determine, based on the plurality of frames of images, a coefficient of expansion state of the gastric cavity corresponding to each frame of image and a coefficient of irregular characteristic of gastric wall peristalsis corresponding to each frame of image;

[0047] a second determining module, configured to determine the possibility that each frame of image is a useless frame based on the expansion state coefficient and the irregular characteristic coefficient;

[0048] The processing module is used to determine useless frames according to the possibility of the useless frames and the possibility threshold, and delete all the useless frames in the plurality of frames of the image to obtain the final collected target digital video signal.

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

[0050] By acquiring several frames of images from the digital video of the electronic gastroscope, the expansion state coefficient of the gastric cavity corresponding to each frame of image and the irregular characteristic coefficient of the gastric wall peristalsis corresponding to each frame of image are determined based on the several frames of image, and the possibility of each frame of image being a useless frame is determined based on the expansion state coefficient and the irregular characteristic coefficient respectively. The quality of each frame of image is analyzed based on the expansion state of the gastric cavity and the gastric wall peristalsis law to determine the possibility that the image is a useless frame. Finally, the useless frames are determined based on the possibility and possibility threshold of the useless frames, and all useless frames in the several frames of image are deleted to obtain the final acquired target digital video signal, which is beneficial to reduce the impact caused by invalid frames and facilitates doctors to make judgments. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0052] Figure 1 A schematic flow chart of the steps of a method for acquiring digital video signals of an electronic gastroscope provided by one embodiment of the present invention;

[0053] Figure 2 A schematic diagram of the convex hull of one frame of an image provided by one embodiment of the present invention;

[0054] Figure 3 This is a structural block diagram of a digital video signal acquisition system for an electronic gastroscope provided by one embodiment of the present invention. DETAILED DESCRIPTION

[0055] To further illustrate the technical means and effectiveness of the present invention in achieving its intended objectives, the following, in conjunction with the accompanying drawings and preferred embodiments, describes in detail the specific implementation, structure, features, and effectiveness of a digital video signal acquisition method and system for an electronic gastroscope according to the present invention. In the following description, references to "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.

[0056] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0057] It should be noted that the term “exemplary” in the embodiments of the present application refers to examples listed for the convenience of explanation, and other embodiments are not limited to the examples listed.

[0058] The following describes in detail a method and system for collecting digital video signals of an electronic gastroscope provided by the present invention with reference to the accompanying drawings.

[0059] See also Figure 1 , which shows a flow chart of a digital video signal acquisition method of an electronic gastroscope provided by an embodiment of the present invention. The digital video signal acquisition method of an electronic gastroscope may include at least steps S100-S400:

[0060] S100: Acquire several frames of images from a digital video of an electronic gastroscope.

[0061] S200 , determining, based on a plurality of frames of images, a coefficient of expansion state of the gastric cavity corresponding to each frame of image and a coefficient of irregular characteristic of gastric wall peristalsis corresponding to each frame of image.

[0062] S300 , determining the possibility that each frame of image is a useless frame according to the expansion state coefficient and the irregular characteristic coefficient.

[0063] S400 , determining useless frames according to the probability of useless frames and a probability threshold, and deleting all useless frames from a plurality of frames of images to obtain a final collected target digital video signal.

[0064] The technical solution of the embodiment of the present application is to obtain several frames of images in the digital video of the electronic gastroscope, determine the expansion state coefficient of the gastric cavity corresponding to each frame of image and the irregular characteristic coefficient of the gastric wall peristalsis corresponding to each frame of image based on the several frames of images, determine the possibility of each frame of image being a useless frame based on the expansion state coefficient and the irregular characteristic coefficient, analyze the quality of each frame of image based on the expansion state of the gastric cavity and the gastric wall peristalsis law to determine the possibility of the image being a useless frame, finally determine the useless frames based on the possibility of useless frames and the possibility threshold, and delete all useless frames in the several frames of image to obtain the final acquired target digital video signal, which is beneficial to reduce the impact caused by invalid frames and facilitate doctors to make judgments.

[0065] In one embodiment, a micro-image sensor at the front end of the electronic gastroscope is used to obtain a digital video of the electronic gastroscope during the gastroscopy examination. After receiving the digital video, the image processing unit can perform pre-processing operations such as noise removal and image enhancement. Then, the image processing unit uses an image editing tool to convert the digital video to obtain several frames of images in the digital video, and the several frames of images in the digital video are sorted in chronological order.

[0066] It should be noted that when performing an electronic gastroscopy, it is very important to keep the gastric cavity in a well-expanded state. A well-expanded gastric cavity allows the gastric mucosa to fully stretch and flatten its folds, allowing the doctor to clearly observe the subtle structure, color, and presence of lesions in the gastric mucosa, helping to accurately determine the size, range, and location of the lesions. For example, for some ulcerative lesions, the ability to accurately measure their long and short diameters, determine the depth of the ulcer, and the condition of the surrounding mucosa, helps to accurately assess the condition. Furthermore, good expansion can reduce the number of times the lens position and angle need to be repeatedly adjusted due to unclear vision during the examination, shortening the examination time, reducing patient discomfort, and also improving examination efficiency. However, during the actual examination process, the patient's physical condition or poor cooperation may cause uneven gas distribution, which cannot effectively fill the gastric cavity, resulting in poor expansion of the gastric cavity. Uneven expansion of the gastric cavity leads to inconsistent light reflection, resulting in areas with large grayscale differences in the image. On the contrary, when the gastric cavity is well expanded, the gastroscope lens can illuminate the inner wall of the gastric cavity more evenly, the gastric wall is evenly stretched, and its overall grayscale value is evenly distributed. The more even the grayscale distribution is, the better the gastric cavity expansion may be. Therefore, the grayscale change analysis can be used to determine the expansion state coefficient of the gastric cavity corresponding to each frame of the image.

[0067] In one embodiment, determining the expansion state coefficient of the gastric cavity corresponding to each frame of image according to the plurality of frames of image in step S200 includes steps S201-S204:

[0068] S201 , performing grayscale change analysis on each frame of image to determine grayscale non-uniformity of each frame of image.

[0069] First, using the optical flow method, the preset frame image after each frame image is determined as the matching image corresponding to each frame image. Exemplarily, the preset frame image is the third frame image. For example, the third frame image after the first frame image is the fourth frame image, so the fourth frame image is determined as the matching image for the first frame image. Then, in the matching image corresponding to each frame image, the second pixel points corresponding to the first pixel points of each frame image are determined. Pixel points at the same position in the two images are matching pixels. Therefore, it is finally possible to determine the second pixel points corresponding to the first pixel points of each frame image.

[0070] Secondly, the absolute value of the gradient difference between each first pixel and the corresponding second pixel is calculated, which is recorded as , used to represent the grayscale change of each first pixel, The larger the value is, the greater the grayscale change between the first pixel and its matching second pixel is, and the less likely it is a pixel in the diseased area. This is because when there is a diseased area in the gastric cavity, the grayscale value of the diseased area is different from that of the normal area, which makes the grayscale value variance of the current frame image larger.

[0071] Then, the absolute value corresponding to each first pixel is As the gray value weight of the first pixel point, and according to the gray value weight and gray value of each first pixel point, calculate the weighted variance of all first pixels in each frame image as the grayscale nonuniformity of each frame image , that is, The weighted variance of all first pixels (i.e. pixels) in the frame image, or the weighted variance of the ... Grayscale non-uniformity of the frame image, The larger the value, the more uneven the grayscale is, and the more likely it is that the current expansion of the gastric cavity is insufficient.

[0072] S202: Detect corner points in each frame of image using a corner detection algorithm, perform corner point matching based on the corner points, and determine the convex hull of each frame of image.

[0073] Alternatively, the existing corner detection algorithm is used to detect corner points in each frame. In the gastroscopic image, the edge of the gastric cavity, the intersection of mucosal folds, etc. may be corner points. Then, corner point matching is performed based on the corner points to determine the convex hull of each frame, such as Figure 2 As shown, the horizontal and vertical axes represent the horizontal and vertical coordinates of the corner points in the image, and A, B, C, D, E, F, G, H, I, J, etc. are corner points. Specifically: taking a preset number of 15 as an example, the 15 frames of images after each frame of image are used as video segments, and corner point matching is performed on each frame of image in each video segment to determine the successfully matched corner points (which can be based on existing matching methods). Convex hull detection is performed on the successfully matched corner points to determine the convex hull of each frame of image. The convex hull is the smallest (convex) polygon containing all corner points. In the gastroscopic image, the convex hull can roughly outline the outline of the gastric cavity and can represent the shape of the gastric cavity in each frame.

[0074] S203 , determining the centroid coordinates and the area of ​​each convex hull according to the convex hull of each frame of image, and performing a moving speed analysis on the centroid coordinates of each convex hull to obtain a moving speed analysis result corresponding to each frame of image.

[0075] Optionally, the area of ​​each convex hull is determined according to the convex hull of each frame of image, and the centroid coordinates of the convex hull are determined according to the average value of the coordinates of all corner points in the convex hull.

[0076] It should be noted that in order to gain a preliminary understanding of the movement of the gastroscope in the stomach, the position change of the convex hull in consecutive frames can be analyzed. If the convex hull moves in a certain direction as a whole in consecutive frames, and the movement distance is relatively uniform, it may indicate that the gastroscope has a smooth advancement or withdrawal movement in the stomach. If the direction and speed of the translation are unstable, it may be due to the doctor's unstable technique or too fast speed during operation, or the peristalsis of the stomach causing the gastroscope to move. Specifically, the movement speed coordinates of the center of mass of each convex hull are analyzed to obtain the movement speed analysis results corresponding to each frame of the image, including:

[0077] First, the centroid moving speeds of two adjacent frame images are determined based on the centroid coordinates of each convex hull. For example, the centroid moving speeds of adjacent frame images can be obtained by dividing the centroid coordinate difference between adjacent frame images by time.

[0078] Secondly, the moving speed subsequence corresponding to each frame image is determined based on the centroid moving speed of each frame image and the specified number of frame images after the frame image. For example, if the specified number is 5, the moving speed subsequence includes 6 frames of images (a certain frame image and the 5 frames after the frame image, a total of 6 frames of images), that is, the moving speed subsequence includes the centroid moving speed of each two adjacent frame images in the 6 frames, thereby obtaining the moving speed subsequence corresponding to the frame image. Based on this principle, the moving speed subsequence corresponding to each frame image can be obtained.

[0079] Then, the variance of the moving speed subsequence corresponding to each frame image is calculated respectively to obtain the moving speed analysis result corresponding to each frame image. , that is, The variance of the moving speed subsequence corresponding to the frame image, that is, The moving speed analysis results corresponding to the frame image.

[0080] S204 , determining the expansion state coefficient of the gastric cavity corresponding to each frame of image according to the grayscale non-uniformity, the movement speed analysis results, and the convex hull area.

[0081] First, the image sequence corresponding to each frame image is determined according to the specified number of frame images after each frame image.

[0082] Secondly, according to the convex hull area of ​​each frame image, the average difference between the convex hull area of ​​each frame image and the convex hull area of ​​each frame image in the corresponding image sequence is determined. For example, Frame image, calculate the The convex hull area of ​​the frame image is The area difference of the convex hull area of ​​each frame image in the image sequence corresponding to the frame image, and the mean area difference is obtained by summing up all area differences and dividing by the number of area differences. , that is, The convex hull area of ​​the frame image and the average difference between the convex hull areas of each frame image in the corresponding image sequence, referred to as the The mean area difference corresponding to the frame image.

[0083] Then, according to the grayscale non-uniformity , Movement speed analysis results and the mean area difference The product of and is used to obtain the expansion state coefficient of the gastric cavity corresponding to each frame of image:

[0084] ;

[0085] in, For the The expansion state coefficient of the gastric cavity corresponding to the frame image, The larger the The larger the frame image, the more likely it is that the gastric cavity is not fully expanded and the gastroscope moves unsteadily during the operation.

[0086] It should be noted that under normal circumstances, the gastric cavity exhibits regular peristalsis, manifested as wave-like contraction and relaxation of the gastric wall. In gastroscopic images, the gastric wall can be seen gradually contracting and then relaxing into the cavity. If gastric wall peristalsis weakens or disappears, or if irregular peristalsis, such as localized spasmodic contractions, occurs, it indicates possible abnormalities in the gastric cavity morphology. When the gastric cavity morphology is abnormal, the acquired images may not accurately reflect the gastric cavity state, hindering the diagnosis of symptom characteristics. Therefore, it is necessary to consider gastric peristalsis to more accurately identify useless frames.

[0087] In one embodiment, step S200 determines the irregular characteristic coefficient of gastric wall peristalsis corresponding to each frame of image based on a plurality of frames of image, including steps S205-S209:

[0088] S205. Perform edge detection on several frames of images respectively to obtain all edge pixels in each frame of image, determine the movement speed and movement direction of each edge pixel, and determine the movement speed change curve of each edge pixel within the appearance time according to the movement speed of the edge pixel.

[0089] Alternatively, edge detection is performed on several frames of images using an existing edge detection algorithm to obtain all edge pixels in each frame and determine the position coordinates of each edge pixel. SIFT (Scale-Invariant Feature Transform) is then used to determine whether the edge pixels in each frame continue to exist in the next frame. If so, the position coordinates of the edge pixels in the next frame are obtained; if not, the process stops, thereby obtaining a sequence of position coordinates corresponding to all edge pixels in each frame. Based on this sequence of position coordinates, the optical flow method is used to determine the speed and direction of motion of each edge pixel.

[0090] It should be noted that when the gastric cavity is peristaltic normally, the movement speed of the edge pixels of the gastric wall is relatively stable and uniform, but when the peristalsis is irregular, the movement speed of the pixels in different parts will be significantly different. For example, at a certain edge of the stomach, some edge pixels may move quickly, while the speed of adjacent edge pixels is very slow, resulting in uneven movement speeds at different positions of the gastric wall in the same frame image; at the same time, when the peristalsis is irregular, the movement speed of the edge pixels may change significantly in a short period of time. For example, the original movement speed is normal, but it may suddenly accelerate or decelerate in the next frame image. The peristalsis of the gastric cavity can be analyzed by analyzing the speed change. Therefore, in the embodiment of the present application, according to the movement speed of an edge pixel point, a movement speed change curve is drawn within the time when each edge pixel point appears, wherein the horizontal axis is time and the vertical axis is its movement speed.

[0091] S206. Determine the similarities between the first target edge pixel point with unstable motion speed and the motion speed change curves of each pair in each frame of the image based on the motion speed change curve within the appearance time of each edge pixel point, and determine the similarity mean based on all the similarities.

[0092] Optionally, according to the motion speed change curve within the time when each edge pixel point appears, the number of extreme value points in each motion speed change curve is determined respectively. and the extreme difference in movement speed to determine , For the The stability of the motion speed of edge pixels, is the normalization function, For the The number of extreme points in the motion speed change curve of edge pixels, For the The range of motion speed corresponding to the edge pixel points indicates the range of motion speed fluctuation. The larger the range, the more extreme points there are. The larger the The more unstable the movement speed of edge pixels is.

[0093] Among them, when When the stability threshold is greater than or equal to 0.6, the The motion speed of the edge pixel point is unstable, which is recorded as the first target edge pixel point with unstable motion speed, thereby determining the unstable first target edge pixel point in each frame image.

[0094] Then, the motion speed change curves corresponding to all edge pixels in the same frame image are plotted in the same coordinate system, and the DTW algorithm is used to calculate the similarity between the motion speed change curves in the coordinate system. The similarity mean is determined based on all similarities and the number of similarities. , that is, The mean similarity of frame images, The smaller it is, the more similar the movement speeds of all edge pixels are. In the frame image, the stomach cavity is more likely to show regular peristalsis, and vice versa. The larger the value of In a frame image, the greater the difference in the movement speed of different edge pixels, the more likely it is that there is irregular peristalsis.

[0095] S207 , determining a difference in motion speeds of all edge pixels in each frame of image according to the similarity mean, a first number of first target edge pixels in each frame of image, and a second number of edge pixels in each frame of image.

[0096] Specifically, the calculation formula is:

[0097] ;

[0098] in, Indicates the The difference in the motion speed of all edge pixels in the frame image, Indicates the The first number of first target edge pixels in the frame image, Indicates the The second number of edge pixels in the frame image, Indicates the The mean similarity of frame images, The larger the value, the more likely it is that the gastric wall motility is irregular.

[0099] It should be noted that in order to better analyze the peristaltic characteristics of the stomach wall, the movement direction of the edge pixels should also be considered. Under normal circumstances, the movement direction of the edge pixels of the stomach wall is basically consistent, moving toward the center of the stomach cavity during contraction and returning to the relative original position during relaxation. However, when the peristalsis is irregular, the movement direction of the pixels will become chaotic. In the same frame image, some edge pixels of the stomach wall may be seen moving upward, while other edge pixels move downward or sideways, without a unified direction.

[0100] S208. Determine the second target edge pixel point with abnormal motion direction in each frame of image according to the motion direction of each edge pixel point, and determine the abnormal direction clutter degree of each frame of image according to the second target edge pixel point with abnormal motion direction in each frame of image.

[0101] In one embodiment, in each image frame, rays are drawn along the direction of motion of each edge pixel, starting from each edge pixel. The intersection points of these rays are determined for each pair of edge pixels, thereby obtaining the intersection points of the rays for a number of edge pixels. The coordinate center of each intersection is determined based on the average of the coordinates of the intersection points, and the direction from each edge pixel to the coordinate center is used as the normal peristaltic direction of each edge pixel. Next, the minimum angle between the motion direction of each edge pixel and the normal peristaltic direction of the edge pixel is determined (representing the difference between the actual motion direction and the normal peristaltic direction). When the difference between the two is less than a preset angle (e.g., 3°), the actual motion direction of the edge pixel is considered to be consistent with the normal peristaltic direction, and the motion direction of the edge pixel is recorded as the normal direction. Conversely, if the difference is greater than or equal to the preset angle (e.g., 3°), the motion direction of the edge pixel is recorded as the abnormal direction. This allows the identification of a second target edge pixel with an abnormal motion direction in each image frame.

[0102] Optionally, determining the abnormal direction clutter degree of each frame of image according to the second target edge pixel point with abnormal motion direction in each frame of image includes:

[0103] First, the second target edge pixels with abnormal motion directions in each image frame are clustered, resulting in several clusters corresponding to each image frame. The more consistent the motion directions of all the second target edge pixels contained in each cluster, the more clusters are obtained, indicating that the current second target edge pixels have more chaotic motion directions and are more likely to be a manifestation of irregular gastric wall motility.

[0104] Secondly, the center edge pixel points of each cluster are determined respectively (the same method can be used to calculate the mean of the coordinates), and the movement direction of the center edge pixel points is used as the representative direction of the cluster. In addition, the angle difference between the representative directions of each cluster corresponding to each frame image is determined respectively.

[0105] Then, determine the sum of the angle differences of all angle differences corresponding to each frame image , that is, The sum of the angle differences of all angle differences corresponding to the frame images, and the number of clusters corresponding to each frame image (i.e. The number of clusters corresponding to the frame image) and the sum of the angle differences The product of determines the abnormal direction clutter of each frame image , For the Abnormal direction clutter of the frame image.

[0106] S209 , determining the irregular characteristic coefficient of gastric wall peristalsis corresponding to each frame of image based on the abnormal direction clutter, movement speed difference, and movement direction of each edge pixel point of each frame of image.

[0107] First, since the movement speed and movement direction of each edge pixel point are determined, it is equivalent to that each edge pixel point has a corresponding movement speed and movement direction sequence. Therefore, according to the movement direction of each edge pixel point, the movement direction angle between each identical edge pixel point in two adjacent frame images can be determined respectively, that is, based on the sequence of the movement directions of each edge pixel point, the movement direction angle between adjacent movement directions in the sequence is determined.

[0108] Secondly, according to all the motion direction angles, determine the mean motion direction angle corresponding to each edge pixel point For example, the mean value of the motion direction angles is obtained by summing all the motion direction angles and dividing by the number of motion direction angles. For the Frame image The average of the motion direction angles corresponding to the edge pixels. And, according to the average of the motion direction angles corresponding to each edge pixel And the second number of edge pixels in each frame image Perform summation and obtain the summation result .

[0109] Then, the irregular characteristic coefficient of gastric wall peristalsis corresponding to each frame of image is obtained based on the product of the summation result corresponding to each frame of image, the abnormal direction clutter of each frame of image, and the difference in motion speed:

[0110] ;

[0111] in, Indicates the The irregular characteristic coefficient of gastric wall peristalsis corresponding to the frame image, The larger the value, the Frame image The more the movement direction of the edge pixels changes; Indicates the The motion direction change characteristics of all edge pixels in the frame image, The larger the value, the more likely the gastric wall peristalsis is to be irregular.

[0112] In one embodiment, step S300 includes steps S301-S302:

[0113] S301 , determining a probability value of each frame of image being a useless frame according to the product of the expansion state coefficient and the irregular feature coefficient.

[0114] Optionally, according to the expansion state coefficient and irregular characteristic coefficient The product of determines the probability value of each frame image being a useless frame , expansion state coefficient Characterization A preliminary probability value that the image is a useless frame.

[0115] S302: Based on the probability value of each frame image being a useless frame and the normalization function , and obtain the possibility that each frame of image is a useless frame.

[0116] The specific formula is:

[0117] ;

[0118] in, Indicates the The possibility that the frame image is a useless frame, The larger the The lower the image quality of a frame image, the greater the possibility that it is a useless frame.

[0119] In one embodiment, based on a pre-set probability threshold (e.g., 0.7), when The possibility that the frame image is a useless frame Greater than or equal to 0.7, then the The frame image is determined as a useless frame, thereby obtaining all useless frames.

[0120] Specifically, after the micro-image sensor at the front end of the electronic gastroscope obtains the digital video of the electronic gastroscope, the image processing unit converts the digital video to obtain several frames of images in the digital video. The image processing unit then deletes all useless frames to obtain the final target digital video signal. This final target digital video signal will be transmitted to the display, so that the doctor only sees the target digital video signal after deleting useless frames, reducing the impact of invalid frames and facilitating the doctor's judgment.

[0121] Reference Figure 3 , shows a structural block diagram of a digital video signal acquisition system for an electronic gastroscope according to an embodiment of the present application, which may include:

[0122] An acquisition module is used to acquire a plurality of frames of images from a digital video of an electronic gastroscope;

[0123] A first determination module is configured to determine, based on a plurality of frames of images, a coefficient of expansion state of the gastric cavity corresponding to each frame of image and a coefficient of irregular characteristic of gastric wall peristalsis corresponding to each frame of image;

[0124] A second determination module is used to determine the possibility that each frame of image is a useless frame according to the expansion state coefficient and the irregular characteristic coefficient;

[0125] The processing module is used to determine useless frames according to the possibility of useless frames and the possibility threshold, and delete all useless frames in several frames of images to obtain the final collected target digital video signal.

[0126] In the embodiment of the present application, the functions of each module in the system can be referred to the corresponding description in the above method and will not be repeated here.

[0127] It should be noted that the order in which the embodiments of the present invention are described above is for illustrative purposes only and does not necessarily represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

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

Claims

1. A method for collecting digital video signals of an electronic gastroscope, characterized in that: The method comprises: Acquire several frames of images from a digital video of an electronic gastroscope; Determining, based on the plurality of frames of images, a coefficient of expansion state of the gastric cavity corresponding to each frame of image and a coefficient of irregular characteristic of gastric wall peristalsis corresponding to each frame of image; determining the possibility that each frame of image is a useless frame based on the expansion state coefficient and the irregular characteristic coefficient; Determine useless frames according to the probability of the useless frames and the probability threshold, and delete all the useless frames in the plurality of frames of the image to obtain a final collected target digital video signal; Determining the expansion state coefficient of the gastric cavity corresponding to each frame of the image based on the plurality of frames of the image includes: Performing grayscale change analysis on each frame of the image to determine grayscale non-uniformity of each frame of the image; Detecting corner points in each frame of image using a corner detection algorithm, performing corner point matching based on the corner points, and determining the convex hull of each frame of image, wherein the convex hull is the smallest polygon containing all corner points; According to the convex hull of each frame of image, the centroid coordinates and the convex hull area of ​​each convex hull are determined, and the moving speed analysis is performed on the centroid coordinates of each convex hull to obtain the moving speed analysis result corresponding to each frame of image; determining an expansion state coefficient of the gastric cavity corresponding to each frame of image according to the grayscale non-uniformity, the movement speed analysis result, and the convex hull area; Determining the irregular characteristic coefficient of gastric wall peristalsis corresponding to each frame of the image based on the plurality of frames includes: Performing edge detection on several frames of the image to obtain all edge pixels in each frame of the image, determining the movement speed and movement direction of each edge pixel, and determining a movement speed change curve of each edge pixel within the time period of appearance based on the movement speed of the edge pixel; Determining, based on the motion speed change curve within the appearance time of each edge pixel point, the similarities between the first target edge pixel point with unstable motion speed and the motion speed change curves of each pair of the first target edge pixel points in each frame of the image, and determining a similarity mean based on all the similarities; Determining a difference in motion speeds of all edge pixels in each frame of the image based on the similarity mean, a first number of first target edge pixels in each frame of the image, and a second number of edge pixels in each frame of the image; Determine, based on the motion direction of each edge pixel point, a second target edge pixel point with an abnormal motion direction in each frame of the image, and determine, based on the second target edge pixel point with an abnormal motion direction in each frame of the image, an abnormal direction clutter degree of each frame of the image; The irregular characteristic coefficient of gastric wall peristalsis corresponding to each frame of the image is determined according to the abnormal direction clutter, the movement speed difference and the movement direction of each edge pixel point of each frame of the image.

2. The method for acquiring digital video signals of an electronic gastroscope according to claim 1, characterized in that: The performing grayscale change analysis on each frame of the image to determine the grayscale non-uniformity of each frame of the image includes: Determining a preset frame of image following each frame of the image as a matching image corresponding to each frame of the image, and determining, in the matching image corresponding to each frame of the image, each second pixel point that matches each first pixel point of each frame of the image; Calculating the absolute value of the gradient difference between each first pixel point and each corresponding matched second pixel point; The absolute value corresponding to each first pixel point is respectively used as the grayscale value weight of the first pixel point, and based on the grayscale value weight and grayscale value of each first pixel point, the weighted variance of all first pixel points in each frame of the image is calculated as the grayscale non-uniformity of each frame of the image.

3. The method for acquiring digital video signals of an electronic gastroscope according to claim 1, characterized in that: The performing of movement speed analysis on the centroid coordinates of each convex hull to obtain the movement speed analysis result corresponding to each frame of the image includes: Determining the moving speed of the centroids of two adjacent frame images according to the centroid coordinates of each convex hull; Determine a subsequence of movement speeds corresponding to each frame of the image according to the movement speeds of the centroids of each frame of the image and a specified number of frames of image after the frame of the image. The variance of the movement speed subsequence corresponding to each frame of the image is calculated respectively to obtain the movement speed analysis result corresponding to each frame of the image.

4. The method for collecting digital video signals of an electronic gastroscope according to claim 1, characterized in that: Determining the expansion state coefficient of the gastric cavity corresponding to each frame of image according to the grayscale non-uniformity, the movement speed analysis result, and the convex hull area includes: Determine an image sequence corresponding to each frame of the image according to a specified number of frames of images following each frame of the image; Determining, based on the convex hull area of ​​each frame of the image, a mean value of the area difference between the convex hull area of ​​each frame of the image and the convex hull areas of each frame of the image in the corresponding image sequence; The expansion state coefficient of the gastric cavity corresponding to each frame of image is obtained according to the product of the grayscale non-uniformity, the movement speed analysis result and the mean value of the area difference.

5. The method for collecting digital video signals of an electronic gastroscope according to claim 1, characterized in that: Determining the abnormal direction clutter degree of each frame of the image according to the second target edge pixel point with abnormal motion direction in each frame of the image includes: Clustering the second target edge pixel points with abnormal motion directions in each frame of the image, respectively, according to the motion directions of the second target edge pixel points, to obtain a plurality of clusters corresponding to each frame of the image; Determining the center edge pixel point of each cluster respectively, taking the movement direction of the center edge pixel point as the representative direction of the cluster, and determining the angle difference between the representative directions of each two clusters in the clusters corresponding to each frame of the image; The sum of angle differences of all angle differences corresponding to each frame of the image is determined respectively, and the abnormal direction clutter of each frame of the image is determined according to the number of clusters corresponding to each frame of the image and the product of the sum of angle differences.

6. The method for collecting digital video signals of an electronic gastroscope according to claim 1, characterized in that: Determining the irregular characteristic coefficient of gastric wall peristalsis corresponding to each frame of the image according to the abnormal direction clutter, the movement speed difference, and the movement direction of each edge pixel of each frame of the image includes: According to the movement direction of each edge pixel point, respectively determining the movement direction angle between each identical edge pixel point in two adjacent frame images; Determining an average of the motion direction angles corresponding to each edge pixel point based on all the motion direction angles, and summing the average of the motion direction angles corresponding to each edge pixel point and a second number of edge pixels in each frame of the image to obtain a summation result; The irregular characteristic coefficient of gastric wall peristalsis corresponding to each frame of the image is obtained according to the product of the summation result corresponding to each frame of the image, the abnormal direction clutter of each frame of the image, and the size of the movement speed difference.

7. The method for acquiring digital video signals from an electronic gastroscope according to any one of claims 1 to 6, characterized in that: The determining, based on the expansion state coefficient and the irregular characteristic coefficient, of the possibility that each frame of image is a useless frame includes: Determining a probability value of each frame of image being a useless frame according to the product of the expansion state coefficient and the irregular feature coefficient; The possibility that each frame of image is a useless frame is obtained according to the possibility value of each frame of image being a useless frame and the normalization function.

8. A digital video signal acquisition system for an electronic gastroscope, characterized in that: include: An acquisition module is used to acquire a plurality of frames of images from a digital video of an electronic gastroscope; a first determining module, configured to determine, based on the plurality of frames of images, a coefficient of expansion state of the gastric cavity corresponding to each frame of image and a coefficient of irregular characteristic of gastric wall peristalsis corresponding to each frame of image; a second determining module, configured to determine the possibility that each frame of image is a useless frame based on the expansion state coefficient and the irregular characteristic coefficient; A processing module, configured to determine useless frames according to the probability of the useless frames and a probability threshold, and delete all the useless frames from the plurality of frames of the image to obtain a final collected target digital video signal; Determining the expansion state coefficient of the gastric cavity corresponding to each frame of the image based on the plurality of frames of the image includes: Performing grayscale change analysis on each frame of the image to determine grayscale non-uniformity of each frame of the image; Detecting corner points in each frame of image using a corner detection algorithm, performing corner point matching based on the corner points, and determining the convex hull of each frame of image, wherein the convex hull is the smallest polygon containing all corner points; According to the convex hull of each frame of image, the centroid coordinates and the convex hull area of ​​each convex hull are determined, and the moving speed analysis is performed on the centroid coordinates of each convex hull to obtain the moving speed analysis result corresponding to each frame of image; determining an expansion state coefficient of the gastric cavity corresponding to each frame of image according to the grayscale non-uniformity, the movement speed analysis result, and the convex hull area; Determining the irregular characteristic coefficient of gastric wall peristalsis corresponding to each frame of the image based on the plurality of frames includes: Performing edge detection on several frames of the image to obtain all edge pixels in each frame of the image, determining the movement speed and movement direction of each edge pixel, and determining a movement speed change curve of each edge pixel within the time period of appearance based on the movement speed of the edge pixel; Determining, based on the motion speed change curve within the appearance time of each edge pixel point, the similarities between the first target edge pixel point with unstable motion speed and the motion speed change curves of each pair of the first target edge pixel points in each frame of the image, and determining a similarity mean based on all the similarities; Determining a difference in motion speeds of all edge pixels in each frame of the image based on the similarity mean, a first number of first target edge pixels in each frame of the image, and a second number of edge pixels in each frame of the image; Determine, based on the motion direction of each edge pixel point, a second target edge pixel point with an abnormal motion direction in each frame of the image, and determine, based on the second target edge pixel point with an abnormal motion direction in each frame of the image, an abnormal direction clutter degree of each frame of the image; The irregular characteristic coefficient of gastric wall peristalsis corresponding to each frame of the image is determined according to the abnormal direction clutter, the movement speed difference and the movement direction of each edge pixel point of each frame of the image.

Citation Information

Patent Citations

  • Effective mirror retreating time evaluation method and device for enteroscopy and storage medium

    CN113962998A

  • Target tracking method and system based on recurrent neural network, and electronic equipment

    CN118397047A