A method for determining channel scratch depth and width based on speckle domain gaussian distribution fitting

By using the speckle domain Gaussian distribution fitting method, combined with guide beam and coherent laser illumination, the problem of measuring the depth and width of scratches in endoscopic instrument channels was solved, and accurate measurement was achieved even under lens distortion conditions.

CN115628692BActive Publication Date: 2026-04-28SHANGHAI CMDY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI CMDY CO LTD
Filing Date
2022-09-30
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing technologies are insufficient to effectively measure the depth and width of scratches in the endoscope instrument channel lens, especially in the absence of a reference object, and the extent of damage to the endoscope inner wall caused by the cleaning brush is difficult to quantify.

Method used

A method based on Gaussian distribution fitting in the speckle domain is adopted. The original laser speckle image in the channel is acquired by using the probe beam and camera in conjunction with coherent laser illumination. The depth and width of the speckle are determined by fitting a Gaussian distribution by drawing a straight line perpendicular to the speckle.

Benefits of technology

It enables accurate measurement of scratches on endoscopic instrument channels, exhibits good robustness and noise immunity, and can accurately measure the depth and width of scratches even under lens distortion conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115628692B_ABST
    Figure CN115628692B_ABST
Patent Text Reader

Abstract

The application discloses a channel scratch depth and width determination method based on speckle domain Gaussian distribution fitting. The method is characterized in that a light guide beam and a camera are cooperated with coherent laser illumination to explore a channel, original laser speckle images in the channel are collected, Gaussian distribution fitting of speckle domains is carried out through drawing a straight line vertical to a scratch in the image, and the depth and width of the target scratch are determined. The scheme provided by the application can be applied to a specific endoscope pipeline diameter, and the depth and width of the scratch can be effectively determined.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of optical imaging, and in particular to a method for measuring channel scratches. Background Technology

[0002] Endoscopic instrument access is an emerging tool in surgical procedures, providing real-time depth sensing. By reconstructing the contour data of internal tissues, organs, or lesions in three dimensions, endoscopic instrument access effectively improves the accuracy, feasibility, and scientific rigor of current diagnostic and treatment processes. Currently, endoscopic instrument access has been introduced and used in various departments, including abdominal, cranial, and gastroenterology.

[0003] However, endoscopes can become contaminated during use, including with blood and fragments of human tissue adhering to the endoscope tubing, necessitating post-operative cleaning. The cleaning brush, to some extent, damages the inner wall of the endoscope.

[0004] When using endoscopic instrument channel imaging for flaw detection, due to lens distortion, it is difficult to measure the depth and width of scratches within the lens without a reference object. Furthermore, it is impossible to effectively statistically analyze the damage caused by cleaning brushes of different diameters. Over time, this will gradually become a major hidden danger to the lifespan, quality, safety, and postoperative cleanliness of endoscopes.

[0005] Therefore, how to effectively measure the scratches on endoscopic instrument channels is a problem that urgently needs to be solved in this field. Summary of the Invention

[0006] To address the problem that it is difficult to measure the depth and width of scratches in the lens when using existing imaging methods for flaw detection of endoscopic instrument channels, the present invention aims to provide a method for measuring the depth and width of channel scratches based on speckle domain Gaussian distribution fitting, thereby enabling effective measurement of scratches in endoscopic instrument channels.

[0007] To achieve the above objectives, the present invention provides a method for determining the depth and width of channel scratches based on speckle domain Gaussian distribution fitting. This method uses a probe beam and a camera in conjunction with coherent laser illumination to acquire the original laser speckle image within the channel. The depth and width of the target scratch are then determined by fitting the speckle domain Gaussian distribution to the straight line perpendicular to the scratch in the image.

[0008] In some embodiments of the present invention, the determination method includes the following steps:

[0009] Step S1: Connect the coherent laser source to the guide beam of the channel and use a probe camera to synchronously acquire raw speckle images. Acquire N raw speckle images in one illumination cycle.

[0010] Step S2: For each pixel position in the image, calculate the contrast value corresponding to each pixel position, and convert the initial original speckle image into a contrast value image.

[0011] Step S3: Dynamically stretch the contrast value image;

[0012] Step S4: Mark the center point coordinates and the effective area of ​​the algorithm in the contrast value image;

[0013] Step S5: Fit a Gaussian curve for the scratch location. Draw a straight line on the contrast value image. The range of the drawn line is within the effective area of ​​the algorithm, and the drawn line is perpendicular to the scratch. By drawing the values ​​of L pixels on the line, a curve can be drawn, and the curve is fitted using a Gaussian distribution.

[0014] Step S6: Calculate the half-width and half-height and the half-width on the optimal Gaussian fitting curve obtained by fitting.

[0015] Step S7: Fit the width of the scratch in the real physical space based on the half-width and half-height, and fit the depth of the scratch in the real physical space based on the half-width and half-height.

[0016] In some embodiments of the present invention, in step S2, when converting the initial original speckle image into a contrast value image, the contrast value K of each pixel (x, y) in the original speckle image is calculated according to the laser speckle contrast calculation formula. 2 Set the size of the spatial window W to 3*3*3, and center the spatial window on the point (x,y). Calculate the speckle contrast value using three consecutive frames of images.

[0017] In some embodiments of the present invention, the effective region of the algorithm marked in step S4 is a ring, which is generated based on the center point and the image size.

[0018] In some embodiments of the present invention, in step S5, half of the length of the straight line is drawn to cover the scratch, and the other half is symmetrically drawn to cover both sides of the scratch.

[0019] In some embodiments of the present invention, in step S5, the pixel values ​​of each point on the drawn straight line are used to form a one-dimensional matrix Sdata.

[0020] In some embodiments of the present invention, the calculation formula in step S6 is as follows:

[0021] w = 2.355 * σ;

[0022] h = |G(μ) - max(Sdata)|;

[0023] In the formula, w and h are the half-width and half-width-height of the best-fit Gaussian distribution curve, and max(Sdata) is the maximum value of the one-dimensional Sdata matrix. The coordinates of the maximum pixel value in the Sdata matrix are (x1, y1) in the image.

[0024] In some embodiments of the present invention, step S7 involves measuring the scratch depth in real physical space.

[0025] The formula for fitting the width is as follows:

[0026]

[0027]

[0028] In the formula, a, b, c, β1, β2, and β3 are the quantities to be fitted, and W and H are the width and depth of the scratch in the actual physical space, respectively. The stochastic gradient descent (SGD) method is used for fitting, and two sets of a, b, c, β1, β2, and β3 values ​​are finally obtained. The formula for calculating L is as follows:

[0029]

[0030] The proposed method for measuring the depth and width of channel scratches based on Gaussian distribution fitting in the speckle domain can extract information about the depth and width implicit in the scratch line by using parameters such as half-width and half-height obtained from Gaussian distribution fitting. It has good robustness and resistance to noise interference, thus enabling accurate measurement of the depth and width of the target scratch.

[0031] Furthermore, the channel scratch depth and width measurement scheme based on speckle domain Gaussian distribution fitting proposed in this invention further adopts a new equation corresponding to the real physical spatial distance and the distance between pixels on the image, and takes into account lens distortion and the degree of distortion at different lengths L from the center point of the image. Within the effective area of ​​the algorithm, it can achieve a good fit.

[0032] The solution provided by this invention can be applied to the measurement of the depth and width of scratches under a specific endoscope tube diameter. Attached Figure Description

[0033] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.

[0034] Figure 1 This is a flowchart of the method for measuring the depth and width of endoscopic instrument channel scratches based on speckle domain Gaussian distribution fitting in an example of the present invention;

[0035] Figure 2 This is a schematic diagram of the front end of the endoscopic instrument channel used in an example of the present invention. Detailed Implementation

[0036] To make the technical means, creative features, objectives and effects of this invention easier to understand, the invention will be further described below with reference to specific illustrations.

[0037] This invention addresses the problems of existing solutions by innovatively using speckle domain Gaussian distribution fitting to determine the depth and width of scratches on endoscopic instrument channels.

[0038] The measurement scheme provided by the present invention uses a probe beam and a camera in conjunction with coherent laser illumination to acquire the original laser speckle image within the channel. By drawing a straight line perpendicular to the scratch in the image and fitting the Gaussian distribution of the speckle domain, the depth and width of the target scratch can be determined.

[0039] The channel scratch depth and width measurement method based on speckle domain Gaussian distribution fitting provided by this invention is achieved through the following steps in combination:

[0040] Step S1: Connect the coherent laser source to the guide beam of the channel and use a probe camera to synchronously acquire raw speckle images. Acquire N raw speckle images in one illumination cycle.

[0041] Step S2: For each pixel position in the image, calculate the contrast value corresponding to each pixel position, and convert the initial original speckle image into a contrast value image.

[0042] Step S3: Dynamically stretch the contrast value image;

[0043] Step S4: Mark the center point coordinates and the effective area of ​​the algorithm in the contrast value image;

[0044] Step S5: Fit a Gaussian curve for the scratch location. Draw a straight line on the contrast value image. The range of the drawn line is within the effective area of ​​the algorithm, and the drawn line is perpendicular to the scratch. By drawing the values ​​of L pixels on the line, a curve can be drawn, and the curve is fitted using a Gaussian distribution.

[0045] Step S6: Calculate the half-width and half-height and the half-width on the optimal Gaussian fitting curve obtained by fitting.

[0046] Step S7: Fit the width of the scratch in the real physical space based on the half-width and half-height, and fit the depth of the scratch in the real physical space based on the half-width and half-height.

[0047] In some embodiments of the present invention, step S2, when converting the initial original speckle image into a contrast value image, is implemented using the following method:

[0048] Calculate the contrast value K of each pixel (x, y) in the original speckle image based on the laser speckle contrast calculation formula. 2The spatial window W is set to a size of 3*3*3, and centered at point (x,y). This means that three consecutive frames are needed to calculate the speckle contrast value. The calculation formula is as follows:

[0049]

[0050] In the above formula, μ W and σ W These are the mean and standard deviation of the speckle values ​​covered by W centered at point (x,y) in the initial speckle image, respectively.

[0051] In some embodiments of the present invention, in step S3, when dynamically stretching the contrast value image, the range of the stretched value is 0 to 1, and the stretching method is the histogram distribution method.

[0052] In some embodiments of the present invention, when marking the center point coordinates and the effective area of ​​the algorithm in step S4, the center point coordinates (x0, y0) and the effective area of ​​the algorithm are marked in the contrast value image, wherein the image center point needs to be manually selected. Simultaneously, considering the distortion caused by the lens, it is necessary to determine the range of the area where the distance can be calculated, calibrated according to the degree of blur and distortion. The area where the distance can be calculated is defined as an annular region (1 / 2*r to 3 / 4*r) within a circle with (x, y) as the center and r as the radius. The effective area of ​​the algorithm marked here is an annular region, automatically generated based on the center point and image size.

[0053] In some embodiments of the present invention, fitting the Gaussian curve of the scratch location in step S5 specifically includes the following steps:

[0054] First, a straight line is drawn on the contrast image. The line must be drawn within the effective area of ​​the algorithm, perpendicular to the scratch, and half of its length must cover the scratch, while the other half symmetrically covers both sides of the scratch. Thus, the values ​​of L pixels along the line can outline a curve S, and the pixel values ​​at each point on the line form a one-dimensional matrix Sdata.

[0055] Secondly, since the curve S is close to a one-dimensional Gaussian distribution, the curve S is fitted using a Gaussian distribution, and the fitting optimization algorithm is the trust region algorithm.

[0056] As a preferred option, the Gaussian distribution fitting equation is as follows:

[0057]

[0058] In the formula, γ, σ, and μ are the parameters to be fitted.

[0059] In some embodiments of the present invention, when calculating the half-width and half-width at half-maximum on the optimal Gaussian fitting curve obtained in step S6, the following formula is preferably used:

[0060] w = 2.355 * σ;

[0061] h = |G(μ) - max(Sdata)|;

[0062] In the formula, w and h are the half-width and half-width-height of the best-fit Gaussian distribution curve, and max(Sdata) is the maximum value in the Sdata matrix obtained in step S5. Furthermore, the coordinates of the maximum pixel value in the Sdata matrix are (x1, y1) in the image.

[0063] In some embodiments of the present invention, the following fitting formula is preferably used in step S7:

[0064]

[0065]

[0066] In the formula, a, b, c, β1, β2, and β3 are the quantities to be fitted, and W and H are the width and depth of the scratch in the actual physical space, respectively. The stochastic gradient descent (SGD) method is used for fitting, and two sets of a, b, c, β1, β2, and β3 values ​​are finally obtained. The formula for calculating L is as follows:

[0067]

[0068] The following is a specific application example to further illustrate the channel scratch depth and width measurement scheme provided by the present invention.

[0069] This example uses the endoscopic instrument channel as an example. See [link / reference] Figure 2 The diagram shown is an example of the front-end structure of the endoscope involved in this example.

[0070] Accordingly, the process of determining the scratch depth and width on the endoscopic instrument channel using the channel scratch depth and width measurement method based on speckle domain Gaussian distribution fitting provided by the present invention is as follows (in conjunction with...) Figure 1 As shown):

[0071] Step S1: A coherent laser (center wavelength 450nm, power 20mW) is introduced into the beam guide of the endoscope and passes through the tip of the endoscope (e.g., Figure 2 (As shown) The laser is irradiated into the instrument channel. In a single acquisition cycle, the camera of the endoscope acquires a total of N=8 frames of raw speckle images.

[0072] Step S2: Calculate the contrast value K of each pixel (x, y) in the original speckle image according to the laser speckle contrast calculation formula. 2 The spatial window W is set to a size of 3*3*3, and centered at point (x,y). This means that three consecutive frames are needed to calculate the speckle contrast value. The calculation formula is as follows:

[0073]

[0074] In the above formula, μ W and σ W These are the mean and standard deviation of the speckle values ​​covered by W centered at point (x,y) in the initial speckle image, respectively.

[0075] This transforms the initial speckle image into a contrast value image.

[0076] Step S3: Dynamically stretch the obtained contrast value image. The stretched value ranges from 0 to 1. The stretching method is the histogram distribution method.

[0077] Step S4: Mark the center point coordinates (x0, y0) and the effective region of the algorithm in the contrast value image. The image center point needs to be manually selected. Considering the distortion caused by the lens, it is necessary to determine the range of the region where the distance can be calculated, and calibrate it according to the degree of blur and distortion. Theoretically, within a circle with (x, y) as the center and r as the radius, the region where the distance can be calculated is annular (1 / 2*r to 3 / 4*r). The effective region of the algorithm is annular and is automatically generated based on the center point and the image size.

[0078] Step S5, fitting a Gaussian curve at the scratch location, specifically includes the following steps:

[0079] First, a straight line is drawn on the contrast image. The line must be located within the effective area of ​​the algorithm, perpendicular to the scratch, and half of its length must cover the scratch, while the other half symmetrically covers both sides of the scratch. The values ​​of L pixels along the line can be used to draw a curve S, and the pixel values ​​of each point on the line form a one-dimensional matrix Sdata.

[0080] Secondly, the curve S approximates a one-dimensional Gaussian distribution. Therefore, the curve S is fitted using a Gaussian distribution, and the optimization algorithm for fitting is the trust region algorithm. The Gaussian distribution fitting equation is as follows:

[0081]

[0082] In the formula, γ, σ, and μ are the parameters to be fitted.

[0083] Step S6: Calculate the half-width and half-height (FWHM) on the optimal Gaussian fitting curve. The formulas are as follows:

[0084] w = 2.355 * σ;

[0085] h = |G(μ) - max(Sdata)|;

[0086] In the formula, w and h are the half-width and half-width-height of the best-fit Gaussian distribution curve, and max(Sdata) is the maximum value in the Sdata matrix obtained in step S5. Furthermore, the coordinates of the maximum pixel value in the Sdata matrix are (x1, y1) in the image.

[0087] Step S7: Fit the width of the scratch in the actual physical space based on the half-width and half-height, and fit the depth of the scratch in the actual physical space based on the half-width and half-height. The fitting formula is as follows:

[0088]

[0089]

[0090] In the formula, a, b, c, β1, β2, and β3 are the quantities to be fitted, and W and H are the width and depth of the scratch in the actual physical space, respectively. The stochastic gradient descent (SGD) method is used for fitting, and two sets of a, b, c, β1, β2, and β3 values ​​are finally obtained. The formula for calculating L is as follows:

[0091]

[0092] As can be seen from the above examples, the channel scratch depth and width measurement scheme provided by the present invention can extract the information about depth and width implicit in the scratch line by using parameters such as half-width and half-height obtained by Gaussian distribution fitting, and has good robustness and resistance to noise interference.

[0093] Based on this, a new equation corresponding to the real physical spatial distance and the distance between pixels in the image is further adopted, and lens distortion and the degree of distortion at different lengths L from the center point of the image are taken into account. Within the effective area of ​​the algorithm, a good fit can be achieved.

[0094] Therefore, the solution provided by this invention can be applied to the determination of the depth and width of scratches under a specific endoscope tube diameter.

[0095] The method, specific system unit, or part thereof of the present invention described above is a pure software architecture. It can be deployed via program code on physical media, such as hard disks, optical discs, or any electronic device (such as smartphones or computer-readable storage media). When a machine loads and executes the program code (e.g., a smartphone loads and executes it), the machine becomes an apparatus for implementing the present invention. The method and apparatus of the present invention can also be transmitted in program code form via transmission media, such as cables, optical fibers, or any transmission method. When the program code is received, loaded, and executed by a machine (e.g., a smartphone), the machine becomes an apparatus for implementing the present invention.

[0096] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of this invention is defined by the appended claims and their equivalents.

Claims

1. A method for determining the depth and width of channel scratches based on Gaussian distribution fitting of speckle domain, characterized in that, By probing the channel's guide beam and using a camera in conjunction with coherent laser illumination, raw laser speckle images within the channel are acquired. The depth and width of the target scratch are determined by fitting a Gaussian distribution to the speckle domain using a straight line perpendicular to the scratch in the image. The determination method includes the following steps: Step S1: Connect the coherent laser source to the guide beam of the channel and use a probe camera to synchronously acquire the original speckle image; Step S2: For each pixel position in the image, calculate the contrast value corresponding to each pixel position, and convert the initial original speckle image into a contrast value image. Step S3: Dynamically stretch the contrast value image; Step S4: Mark the center point coordinates and the effective area of ​​the algorithm in the contrast value image; Step S5: Fit a Gaussian curve for the scratch location. Draw a straight line on the contrast value image. The range of the drawn line is within the effective area of ​​the algorithm, and the drawn line is perpendicular to the scratch. By drawing the values ​​of L pixels on the line, a curve can be drawn, and the curve is fitted using a Gaussian distribution. Step S6: Calculate the half-width and half-height and the half-width on the optimal Gaussian fitting curve obtained by fitting. Step S7: Fit the width of the scratch in the real physical space based on the half-width and half-height, and fit the depth of the scratch in the real physical space based on the half-width and half-height.

2. The method for measuring the depth and width of channel scratches according to claim 1, characterized in that, In step S2, when converting the initial original speckle image into a contrast value image, the contrast value of each pixel (x, y) in the original speckle image is calculated according to the laser speckle contrast calculation formula. Set the size of the spatial window W to 3*3*3, and center the spatial window on the point (x,y). Calculate the speckle contrast value using three consecutive frames of images.

3. The method for measuring the depth and width of channel scratches according to claim 1, characterized in that, The effective region of the algorithm marked in step S4 is a ring, which is generated based on the center point and the image size.

4. The method for measuring the depth and width of channel scratches according to claim 1, characterized in that, In step S5, half of the length of the straight line is drawn to cover the scratch, and the other half is symmetrically drawn to cover both sides of the scratch.

5. The method for measuring the depth and width of channel scratches according to claim 1, characterized in that, In step S5, the pixel values ​​of each point on the drawn line are used to form a one-dimensional matrix Sdata.

6. The method for measuring the depth and width of channel scratches according to claim 1, characterized in that, The calculation formula in step S6 is as follows: ; ; In the formula, w and h are the half-width and half-height of the best-fit Gaussian distribution curve. The maximum value of the one-dimensional matrix Sdata is given by the coordinates of the maximum pixel value in the image. , ).

7. The method for measuring the depth and width of channel scratches according to claim 1, characterized in that, The formulas for fitting the scratch depth and width in the real physical space in step S7 are as follows: ; ; In the formula, a, b, c, , , Let W and H be the values ​​to be fitted, respectively, representing the width and depth of the scratch in the real physical space. The stochastic gradient descent (SGD) method is used for fitting, ultimately yielding two sets of values ​​a, b, and c. , , Value; the formula for calculating L in the formula is as follows: 。

Citation Information

Patent Citations

  • Equipment for detecting endoscope and endoscope system

    CN108693191A

  • Binocular three-dimensional imaging method combining laser dot matrix and polarization vision

    CN111121722A