Probe-based confocal endoscope field of view measuring method
通过对探头式共聚焦内窥镜进行光栅成像和图像处理,计算探头式共聚焦内窥镜的视场大小,解决了现有技术中视场大小测量不够客观准确的问题,实现了更高的测量 Accuracy and objectivity.
Patent Information
- Application Number
- PCT/CN2023/141091
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-07-25
- Filing Date
- 2023-12-22
- Publication Date
- 2025-01-30
AI Technical Summary
In the prior art, the field size measurement of the probe confocal microscope is not objective and accurate enough, and it is prone to errors due to visual fatigue.
By using the probe -style to focus on the endoscopic image, the grating image is obtained, and the grid line in the grating image is used as a line segment.
The probe -type co -focus on the accuracy and objective measurement of the size of the endoscopic field. The error is only the pixel granular level, which avoids the impact of artificial operation errors and subjective factors.
Smart Images

Figure CN2023141091_30012025_PF_FP_ABST
Abstract
Description
Field of view detection method for probe-type confocal endoscope
[0001] This application claims priority to the Chinese patent application filed by the applicant on July 25, 2023 with the Chinese Patent Office application number 202310915112.9 and the invention name “Probe-type confocal endoscope field of view detection method”, the entire contents of which are incorporated by reference into this application, and all related applications cited and included in this application are an integral part of this application. Technical Field
[0002] The present application belongs to the field of medical imaging, and more specifically, to a method for detecting the field of view of a probe-type confocal endoscope. Background Art
[0003] A probe-type confocal microendoscope is a medical device that can be inserted into the human body through channels such as a gastroscope and colonoscope to obtain local histological images for accurate diagnosis of tiny lesions, gastrointestinal lesions, and early gastrointestinal cancers. While the magnification of a probe-type confocal microendoscope is high, its field of view is relatively small, typically measuring several hundred micrometers. Field of view is a key performance parameter of a probe-type confocal microendoscope. Currently, the field of view of a probe-type confocal microendoscope is measured visually. This method is often not objective and accurate, and is prone to errors due to visual fatigue. Therefore, accurate and objective measurement of the field of view of a probe-type confocal microendoscope is currently difficult to achieve.
[0004] Summary of the Invention
[0005] In response to the above defects or improvement needs of the existing technology, the present application provides a probe-type confocal endoscope field of view detection method, which aims to solve the technical problem in the existing technology that the field of view size measurement of the probe-type confocal microendoscope is not objective and accurate enough.
[0006] To achieve the above objectives, according to one aspect of the present application, a method for detecting the field of view of a probe-type confocal endoscope is provided, comprising the following steps:
[0007] S1, use a probe-type confocal endoscope to image the grating and obtain a grating image;
[0008] S2, processing all raster lines in the raster image into line segments to obtain a line segment set;
[0009] S3, performing circle fitting on all the line segments in the line segment set to obtain the diameter diam of the fitted circle; calculating the average distance between two adjacent line segments in the line segment set to obtain
[0010] S4, calculate the field of view size FOV, S is the specification parameter of the grating, which represents the physical distance of one line pair in the grating.
[0011] In the above technical solution, a probe-type confocal endoscope is used to image the grating, and the grating lines in the grating image are used to measure the field of view size. The grating lines are processed into line segments, and the grating lines are measured by the grating line. The field of view of the probe-type confocal endoscope can be directly obtained by obtaining the number of grating line pairs within the field of view and then multiplying it by the physical distance of a line pair. Among them, all line segments are fitted into circles to obtain the diam value as the dividend, and the average distance between two adjacent line segments is As a divisor, compared with directly finding the longest line segment and using its length as the dividend, or finding the direct distance between two adjacent line segments as the divisor to calculate the number of grating line pairs, or compared with directly counting to obtain the number of grating line pairs, the error is smaller and the obtained field of view size is more objective and accurate. Since the field of view of the probe-type confocal endoscope is only a few hundred microns, the measurement is difficult and the measurement process is prone to errors, which may lead to significant deviations in the results. This application proposes a new measurement idea, which uses the number of line pairs of grating lines in the grating image and the specification parameters of the grating. The error is not affected by the operation during the measurement process, and the only factors that affect the measurement result are diam and There are two parameters, and the error of these two parameters is the size of the pixel particles in the image, which is negligible compared to the entire field of view, so it can be applied to such extremely small field of view measurement scenarios.
[0012] Preferably, in S2, all raster lines in the raster image are processed into line segments to obtain a line segment set, specifically:
[0013] S201, performing binarization processing on the grating image using a threshold value T2 to obtain a binarized image;
[0014] S202, performing an image morphological closing operation on the binary image, and then thinning it to obtain a thinned line segment image;
[0015] S203 , using a line detection algorithm to detect all line segments in the line segment image, obtaining endpoint coordinates of all line segments, and saving them as the line segment set.
[0016] Preferably, the step of obtaining the threshold T2 is specifically as follows:
[0017] S2011, collecting statistics on a pixel value histogram Hist1 of the grating image, performing curve fitting on the pixel value histogram Hist1, selecting a minimum value point in the curve as a threshold T1, performing binarization processing on the grating image using the threshold T1, saving the pixel values of areas in the grating image with pixel values greater than T1 as 1, and saving the pixel values of areas with pixel values less than T1 as 0, thereby obtaining a reference image;
[0018] S2012 , within the region of the reference image where the pixel value is 1, collect statistics on the pixel value histogram Hist2 of the grating image, perform curve fitting on the pixel value histogram Hist2 , and select the minimum value point in the curve as the threshold T2 .
[0019] Preferably, the line segment set is LSs, LSs={LS n}, n=1,2,L,N, N is the number of line segments in the line segment set, where LS n represents a line segment, Represents line segment LS respectively n The starting point x coordinate, starting point y coordinate, end point x coordinate, and end point y coordinate.
[0020] Preferably, in S3, the average distance between two adjacent line segments in the line segment set is calculated to obtain Specifically:
[0021] S301, removing edge line segments from the line segment set and retaining the remaining line segments, where the number of the remaining line segments is N';
[0022] S302, finding the two shortest line segments among the remaining line segments;
[0023] S303, obtaining the distance dis between the two line segments in S302;
[0024] S304,
[0025] Preferably, removing edge line segments from the line segment set in S301 is specifically:
[0026] S3011, find the longest line segment in the line segment set and calculate its length L m ;
[0027] S3012, set the rejection threshold T3, T3 = α * L m , α is a proportional constant greater than 0 and less than 1, and the line segments with lengths less than T3 in the line segment set are eliminated.
[0028] Preferably, 0.3≤α≤0.8.
[0029] Preferably, the two line segments found in S302 are located on both sides of the longest line segment in S3011, respectively. The specific steps are:
[0030] After sorting all the line segments from short to long, find the shortest line segment LS1, and then start from the second shortest line segment to determine whether it is located on both sides of the longest line segment. P ,like Then judge LS1 and LS P These two line segments are located on both sides of the longest line segment. They represent the starting point x coordinate, starting point y coordinate, end point x coordinate, and end point y coordinate of LS1 respectively. Represents LS P The starting point x coordinate, starting point y coordinate, end point x coordinate, end point y coordinate, They represent the starting point x-coordinate, starting point y-coordinate, end point x-coordinate, and end point y-coordinate of the longest line segment respectively.
[0031] Preferably, in S303,
[0032] , where LS1 and LS2 represent the two line segments found in S302, They represent the starting point x coordinate, starting point y coordinate, end point x coordinate, and end point y coordinate of LS2 respectively.
[0033] In general, the above technical solutions conceived by this application can achieve the following beneficial effects compared with the existing technology:
[0034] (1) The grating lines in the grating image are processed into line segments to measure and calculate the field of view size, and the measurement error is only at the pixel particle level;
[0035] (2) The field of view size is measured and calculated using the number of grating line pairs within the field of view and the grating specification parameters. Compared with other measurement methods, this method directly avoids the influence of manual operation errors and subjective factors, which is conducive to improving measurement accuracy.
[0036] (3) The number of line pairs of the grating is determined by Calculation is performed instead of counting directly in the raster image, which further reduces the measurement error;
[0037] (4) In the process of calculating the number of line pairs of the grating, diam and Both parameters are calculated using multiple line segments instead of directly selecting one or two line segments, which further reduces measurement errors.
[0038] (5) During the parameter calculation process, the edge segments that are short, blurry, and difficult to identify are eliminated. The retained segments are used for calculation, and the results obtained will be more accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 is a raster image in S1;
[0040] Figure 2 shows the diameter of the circle in S3 and the average distance between two adjacent line segments. Schematic diagram of;
[0041] FIG3 is a binarized image in S201;
[0042] FIG4 is an image after the image morphological closing operation is performed in S202;
[0043] FIG5 is a line segment image obtained after thinning in S202;
[0044] Figure 6 is the baseline image obtained after binarization in S2011;
[0045] FIG7 is a schematic diagram of some operators of S202 in an embodiment;
[0046] Figure 8 shows the average distance between two adjacent line segments calculated in S3 Schematic diagram of . DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solutions and advantages of this application more clearly understood, this application is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely for explaining this application and are not intended to limit this application. In addition, the technical features involved in the various embodiments of this application described below may be combined with each other as long as they do not conflict with each other.
[0048] This application proposes a method for detecting the field of view of a probe-type confocal endoscope, comprising the following steps:
[0049] S1, using a probe-type confocal endoscope to image the grating to obtain a grating image, as shown in Figure 1;
[0050] S2, processing all raster lines in the raster image into line segments to obtain a line segment set;
[0051] S3, perform circle fitting on all line segments in the line segment set to obtain the diameter of the fitted circle diam; calculate the average distance between two adjacent line segments in the line segment set to obtain As shown in Figure 2;
[0052] S4, calculate the field of view size FOV, S is the specification parameter of the grating, which represents the physical distance of one line pair in the grating.
[0053] This application uses a probe-type confocal endoscope to image the grating, and calculates the number of grating line pairs within the field of view by processing the grating lines in the grating image into line segments. Then multiply it by the physical distance of a line pair to directly get the field of view size of the probe-type confocal endoscope. Among them, the physical distance of a line pair in the grating is the specification parameter of the grating. For example, for a grating with a specification of 100lp / mm, This parameter can be obtained directly without measurement and there is no measurement error. The number of grating line pairs is not obtained by directly counting line segments in this application. The error of directly counting line segments in the extremely small field of view of the probe-type confocal endoscope is very large. This application obtains it by dividing the two parameters of S3. In the process of obtaining these two parameters, all line segments are used to fit the diameter, and the average distance This also shows that using more than two line segments for calculation can reduce errors in processing and calculation, making the measurement results more accurate. The entire process is achieved through image processing, eliminating the need for manual counting or measurement, making it more objective.
[0054] In S2, all raster lines in the raster image are processed into line segments to obtain a line segment set, specifically:
[0055] S201, using a threshold value T2 to perform binarization processing on the grating image to obtain a binarized image, as shown in FIG3;
[0056] S202, performing an image morphological closing operation on the binary image, as shown in FIG4, and then thinning to obtain a thinned line segment image, as shown in FIG5;
[0057] S203: Detect all line segments in the line segment image using a line detection algorithm, obtain the endpoint coordinates of all line segments, and save them as a line segment set.
[0058] In S201, after the binarization process, the pixel values of the areas with pixel values greater than T2 in the raster image are all saved as 1, and the pixel values of the areas with pixel values less than T2 are all saved as 0, and the raster image becomes a binary image with a clear black and white boundary. B(x,y) represents the binary image, and I(x,y) represents the raster image. Then, by performing morphological closing and thinning operations on the binary image, a line segment image with clear boundaries can be obtained.
[0059] The specific steps for obtaining the threshold T2 are:
[0060] S2011, statistically calculate the pixel value histogram Hist1 of the raster image, perform curve fitting on the pixel value histogram Hist1, select the minimum value point in the curve as the threshold T1, use the threshold T1 to perform binarization processing on the raster image, save the pixel values of the area with pixel values greater than T1 as 1, and save the pixel values of the area with pixel values less than T1 as 0, and obtain the reference image. M(x,y) represents the binary image, and I(x,y) represents the raster image. The binarization result in this step is that the pixel value of the four corner areas is 0, and the pixel value of the area in the middle close to the circular part is 1, as shown in Figure 6.
[0061] In step S2012, within the region of the reference image where the pixel value is 1, a pixel value histogram Hist2 of the raster image is statistically analyzed. A curve fitting is performed on the pixel value histogram Hist2, and the minimum value point in the curve is selected as the threshold value T2. The OTSU algorithm can be used to obtain the threshold value by fitting the histogram in both S2011 and S2012.
[0062] In S202, in some embodiments, the morphological closing operation can be performed using a disk type with a 7*7 operator, as shown in FIG7 . After this operation, the edge burrs of the white stripes corresponding to the grating lines in the image can be effectively removed. Thinning can be performed using existing thinning algorithms, such as the Hilditch algorithm, the Rosenfeld algorithm, the Pavlidis algorithm, the Zhang-Suen algorithm, and thinning algorithms based on index table queries. Edge processing and thinning of the line segments facilitates subsequent detection and recognition of the line segments.
[0063] In S203, the line detection algorithm can use Hough transform, and the detected line segment set is LSs, LSs = {LS n}, n=1,2,L,N, N is the number of line segments in the line segment set, where LS n Represents a line segment, a line segment contains the starting point x coordinate, starting point y coordinate, end point x coordinate, end point y coordinate. Therefore, Represents line segment LS respectively n The starting point x coordinate, starting point y coordinate, end point x coordinate, and end point y coordinate.
[0064] In S3, a circle is fitted using N line segments with a total of 2N endpoints. This fitting method can use methods such as the least squares method and the RANSAC algorithm. Obtaining the diam value through circle fitting using 2N endpoints has lower error and higher accuracy than directly calculating the length of the longest line segment as the diam value.
[0065] In S3, the average distance between two adjacent line segments in the line segment set is calculated to obtain d, as shown in Figure 8. Specifically, it is:
[0066] S301, removing edge line segments from the line segment set and retaining the remaining line segments, the number of which is N';
[0067] S302, finding the two shortest line segments among the remaining line segments;
[0068] S303, obtaining the distance dis between the two line segments in S302;
[0069] S304,
[0070] Usually, the line segments at the edge are short and fuzzy. In S301, by removing the edge segments, N' line segments with longer lengths are retained, which are clear and obvious, and convenient for statistics, and can further reduce the subsequent calculation of the average distance between two adjacent line segments. It can reduce the error in the field of view size measurement process and help improve the measurement accuracy.
[0071] In S301, edge segments in the segment set are removed, specifically:
[0072] S3011, find the longest line segment in the line segment set and calculate its length L m ;
[0073] S3012, set the rejection threshold T3, T3 = α * L m , α is a proportional constant greater than 0 and less than 1, and segments with lengths less than T3 are eliminated from the segment set. Preferably, The value of α can be selected based on the grating line density. When the grating lines are dense, for example, S ≥ 120 lp / mm, α can be selected with a larger value within the above range to remove more edge line segments. When the grating lines are sparse, for example, S ≤ 120 lp / mm, α can be selected with a smaller value within the above range to retain more remaining line segments. The elimination criteria are combined with the grating image and grating specifications to avoid the influence of human subjective factors, thereby further improving the objectivity and accuracy of field of view detection.
[0074] The two line segments found in S302 are located on both sides of the longest line segment in S3011.
[0075] In S303,
[0076] , where LS1 and LS2 represent the two shortest line segments respectively. They represent the starting point x coordinate, starting point y coordinate, end point x coordinate, and end point y coordinate of LS1 respectively. They represent the starting point x coordinate, starting point y coordinate, end point x coordinate, and end point y coordinate of LS2 respectively.
[0077] Since the line segment set contains the two endpoints of each line segment, the length of the line segment can be calculated by the starting point coordinates and the end point coordinates. The calculation formula can be: Represents line segment LS respectively n The starting point x coordinate, starting point y coordinate, end point x coordinate, end point y coordinate, then the line segment LS n The length is:
[0078] After calculating the lengths of all line segments, sort them from short to long. You can determine the longest and shortest line segments. Starting from the second shortest line segment, determine whether it is on both sides of the longest line segment with the shortest line segment. The coordinates of the two end points of the longest line segment are recorded as The coordinates of the endpoints of the two line segments to be determined are The method to determine whether these two line segments are on both sides of the longest line segment is:
[0079] if Then the two line segments to be determined are located on both sides of the longest line segment.
[0080] It is easy for those skilled in the art to understand that the above is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application should be included in the scope of protection of the present application. Industrial Applicability
[0081] The field of view detection method of the probe-type confocal endoscope provided in each embodiment of the present application uses a probe-type confocal endoscope to image a grating, uses the grating lines in the grating image to measure the field of view size, processes the grating lines into line segments, and obtains the number of grating line pairs within the field of view, and then multiplies it by the physical distance of a line pair. The field of view size of the probe-type confocal endoscope can be directly obtained. Compared with the existing confocal endoscope field of view detection method, its error is smaller, the obtained field of view size is more objective and accurate, the performance is excellent, and it is convenient for practical application. Therefore, the field of view detection method of the probe-type confocal endoscope provided in each embodiment of the present application has industrial applicability.
Claims
1. A method for detecting the field of view of a probe-type confocal endoscope, characterized in that: The following steps are involved: S1, using a probe-type confocal endoscope to image the grating and obtain a grating image; S2, processing all raster lines in the raster image into line segments to obtain a line segment set; S3, performing circle fitting on all the line segments in the line segment set to obtain the diameter diam of the fitted circle; calculating the average distance between two adjacent line segments in the line segment set to obtain S4, calculate the field of view size FOV, S is the specification parameter of the grating, which represents the physical distance of a line pair in the grating.
2. The method for detecting the field of view according to claim 1, characterized in that: In S2, all the raster lines in the raster image are processed into line segments to obtain a line segment set, which is specifically: S201, using a threshold value T2 to perform binarization processing on the grating image to obtain a binarized image; S202, performing an image morphological closing operation on the binary image, and then thinning it to obtain a thinned line segment image; S203, using a straight line detection algorithm to detect all line segments in the line segment image, obtaining the endpoint coordinates of all line segments, and saving them as the line segment set.
3. The method for detecting the field of view according to claim 2, characterized in that: The steps for obtaining the threshold T2 are specifically as follows: S2011, counting the pixel value histogram Hist1 of the grating image, performing curve fitting on the pixel value histogram Hist1, selecting the minimum value point in the curve as the threshold T1, using the threshold T1 to perform binarization processing on the grating image, saving the pixel values of the area with pixel values greater than T1 in the grating image as 1, and saving the pixel values of the area with pixel values less than T1 as 0, to obtain a reference image; S2012, within the region where the pixel value in the reference image is 1, counting the pixel value histogram Hist2 of the grating image, performing curve fitting on the pixel value histogram Hist2, and selecting the minimum value point in the curve as the threshold value T2.
4. The method for detecting the field of view according to claim 1, characterized in that: The line segment set is LSs, LSs={LS n }, n = 1, 2, L, N, N is the number of line segments in the line segment set, where LS n represents a line segment, Represents line segment LS n The starting point x coordinate, starting point y coordinate, end point x coordinate, and end point y coordinate.
5. The method for detecting the field of view according to claim 4, characterized in that: In S3, the average distance between two adjacent line segments in the line segment set is calculated to obtain Specifically: S301, removing edge line segments from the line segment set and retaining the remaining line segments, where the number of the remaining line segments is N'; S302, finding the two shortest line segments among the remaining line segments; S303, obtaining the distance dis between the two line segments in S302; S304, 6. The method for detecting the field of view according to claim 5, characterized in that: In S301, edge line segments in the line segment set are removed, specifically: S3011, find the longest line segment in the line segment set and calculate its length L m ; S3012, set the rejection threshold T3, T3 = α*L m , α is a proportional constant greater than 0 and less than 1, and the line segments with a length less than T3 in the line segment set are eliminated.
7. The method for detecting the field of view according to claim 6, characterized in that: 0.3≤α≤0.8。 8. The method for detecting the field of view according to claim 6, characterized in that: The two line segments found in S302 are located on both sides of the longest line segment in S3011. The specific steps are: After sorting all the line segments from short to long, find the shortest line segment LS1, and then start from the second shortest line segment to determine whether it is located on both sides of the longest line segment. P ,like Then judge LS1 and LS P These two line segments are located on both sides of the longest line segment. They represent the starting point x coordinate, starting point y coordinate, end point x coordinate, and end point y coordinate of LS1 respectively. Respectively represent LS P The starting point x coordinate, starting point y coordinate, end point x coordinate, end point y coordinate, They represent the starting point x-coordinate, starting point y-coordinate, end point x-coordinate, and end point y-coordinate of the longest line segment respectively.
9. The method for detecting the field of view according to claim 8, characterized in that: In S303, , where LS1 and LS2 represent the two line segments found in S302, They represent the starting point x coordinate, starting point y coordinate, end point x coordinate, and end point y coordinate of LS2 respectively.
Citation Information
Patent Citations
Measuring system based on optical transfer function of endoscope with special spatial frequency and calibrating method thereof
CN103411757A
Endoscope imaging system and endoscope imaging device based on fiber bragg grating array detection
CN105147230A
Confocal microendoscopic system probe wire-breakage monitoring method
CN106872143A
Sine distortion image correction method used for confocal endoscope
CN108171666A
Probe type confocal endoscope field-of-view detection method
CN117073982A