Monocular high-precision quantitative defect detection device based on endoscope
By adopting monocular visual ranging and image processing technology in the endoscope, the probe size and accuracy problems in the existing technology are solved, and high-precision narrow space detection is achieved, which reduces system complexity and cost and improves detection efficiency .
Patent Information
- Application Number
- CN202411247377.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2024-12-27
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the existing industrial endoscopic detection methods, the laser ranging technology probe is too large and the heat dissipation is not good. The size of the sonar or ultrasonic ranging unit is not suitable for small probes. The binocular measurement technology is complex, expensive and has low accuracy, making it difficult to achieve high Accurate small space detection.
An endoscopic detection device based on monocular visual ranging is designed, and an automatic calibration detection mechanism is adopted, including connectors, light guide connectors, controllers, monitors, computers, optical fibers, signal transmission cables, image sensors and objective lenses. 通过图像处理算法如Brenner函数、Canny边缘检测和Matlab语言,实现对划痕的定量检测和长度计算。
Based on monocular visual ranging, it realizes that the detection accuracy is improved through image processing, the system complexity and cost are reduced, the detection time is shortened, and the detection efficiency is improved. It is suitable for defect detection in narrow spaces.
Smart Images

Figure CN119198731A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of industrial detection, and more specifically, particularly relates to a monocular high-precision defect quantitative detection device based on an endoscope. Background Art
[0002] In the process of industrial product quality control, it is often necessary to detect the internal conditions of relatively narrow spaces or pipelines. The channels reserved for pipeline entry are extremely small, and it is difficult to effectively detect them using general detection methods. Industrial endoscopes can visually detect and identify cracks, peeling, scratches, pits, corrosion, weld defects, excess objects, foreign matter, etc. on the inner surface of components. It is a non-destructive testing instrument that is easy to use and simple to operate. It adopts a non-destructive visual inspection method. It uses COMS or CCD image sensors as photosensitive devices to convert light signals into electrical signals, and then converts them into image signals that can be displayed on the LCD screen through a series of modules. The end user can observe the images captured by the front-end lens through the host display.
[0003] Common measurement methods for industrial endoscopes include laser ranging technology, precise ranging using sonar or ultrasonic ranging technology, and binocular measurement technology; 1. Laser ranging technology, which calculates the distance by emitting a laser beam and measuring the time required for the laser beam to return. It usually has high accuracy, but it requires the integration of a laser ranging unit in the probe, which makes the probe too large and is not conducive to heat dissipation, limiting its use occasions; 2. Use sonar or ultrasonic ranging technology for precise distance measurement. These technologies can calculate the distance based on the propagation time of sound waves and are suitable for some specific industrial endoscope application scenarios. However, the unit is large in size and is not conducive to integration into small probes. 3. Binocular measurement technology, which is based on the principle of parallax and uses imaging equipment to obtain two images of the object to be measured from different positions, and obtains the three-dimensional geometric information of the object by calculating the position deviation between corresponding points of the images. Binocular measurement technology requires two cameras to measure simultaneously, which makes the design structure of the equipment complex, expensive, the method has a large amount of calculation, slow calculation speed, and low measurement accuracy. Summary of the invention
[0004] In order to solve the above technical problems, the present invention provides a monocular high-precision defect quantitative detection device based on an endoscope to solve the above problems.
[0005] A monocular high-precision defect quantitative detection device based on an endoscope comprises an endoscope, wherein the endoscope is provided with a first hard shell, a second hard shell and a soft shell, wherein the first hard shell is fixedly installed below the second hard shell, and the soft shell is fixedly installed on the side wall of the second hard shell: An automatic calibration detection mechanism is provided on the surface of the first hard shell; The automatic calibration detection mechanism comprises a connector, and a light guide connector is fixedly mounted on the side wall of the first hard shell, and the light guide connector is located on the side wall of the connector.
[0006] Preferably, the automatic calibration detection mechanism also includes an interface, a controller, a monitor, a computer, an optical fiber, a signal transmission cable, an image sensor and an objective lens.
[0007] Preferably, the interface is arranged on a side wall of the light guide connector, and the light guide connector and the interface are both located below the second hard shell and the soft shell.
[0008] Preferably, the controller is connected to a connector, and the controller is connected to a monitor and a computer respectively.
[0009] Preferably, the monitor is located below the computer, and the optical fibers are located inside the first hard shell, the second hard shell and the soft shell respectively.
[0010] Preferably, the optical fiber is fixedly installed inside the interface, and the signal transmission cable is connected to the connector.
[0011] Preferably, the signal transmission cable is located above the optical fiber, and the signal transmission cable is located inside the first hard shell, the second hard shell and the soft shell respectively.
[0012] Preferably, the signal transmission cable is fixedly installed with the image sensor, and the image sensor is located inside the soft shell.
[0013] Preferably, the image sensor is fixedly mounted on the first hard shell, and the objective lens is located at the end of the soft shell away from the connector.
[0014] Preferably, the objective lens is fixedly mounted on the soft shell, and the optical fiber is located below the objective lens.
[0015] Compared with the prior art, the present invention has the following beneficial effects: In the present invention, scratch detection is performed on the image with the best clarity, grayscale processing is performed on the image, edge detection is performed for feature extraction, holes are filled, noise points are removed, and the connected area is extracted to locate the longest area as the scratch area, thereby calculating the pixel length of the scratch and inferring the actual length of the scratch to be measured. A quantitative algorithm for parameters such as length, width, area, and perimeter can be realized without a reference object. In the present invention, the device uses a monocular visual ranging method for detection, so that the error of the monocular ranging system can be eliminated through subsequent adjustment. This means that even if there are some errors in the initial ranging results, the image processing algorithm or optimization model inside the endoscope can be controlled in real time by a monitor or a computer to improve the ranging accuracy, which is more convenient to use. In the present invention, the device adopts a monocular vision ranging method for detection, which has a small amount of calculation and a relatively low cost, because the monocular vision ranging method does not need to be equipped with a second objective lens and complex image processing equipment, thereby reducing the complexity and cost of the system; In the present invention, since the algorithm of the device adopts the Matlab language and fully utilizes the functions in the Matlab toolbox, the compilation process of the algorithm is simple and easy to understand, and the operation speed is very fast, which can greatly shorten the operation time and improve the detection efficiency of defects, scratches, etc. in the endoscope, thereby reducing the power consumption of the whole machine and achieving the advantage of improving the battery life; In the present invention, the algorithm flow adopted by the device is simple, can accurately analyze images, and takes into account the imaging effect, and is relatively practical. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a schematic diagram of the planar structure of the present invention; Figure 2 It is a plane principle diagram of pinhole imaging of the present invention; Figure 3 It is the Matlab language algorithm flow chart of the present invention.
[0017] In the figure, the correspondence between the component names and the figure numbers is: 11, first hard shell; 12, second hard shell; 13, soft shell; 14, connector; 15, light guide connector; 16, interface; 17, controller; 18, monitor; 19, computer; 21, optical fiber; 22, signal transmission cable; 23, image sensor; 24, objective lens. DETAILED DESCRIPTION
[0018] The following embodiments of the present invention are described in further detail in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.
[0019] See also Figure 1 , Figure 2 and Figure 3 The present invention provides a technical solution, including an endoscope, on which a first hard shell 11, a second hard shell 12 and a soft shell 13 are provided, the first hard shell 11 is fixedly installed below the second hard shell 12, and the soft shell 13 is fixedly installed on the side wall of the second hard shell 12: An automatic calibration detection mechanism is provided on the surface of the first hard shell 11; The automatic calibration detection mechanism includes a connector 14, a light guide connector 15 is fixedly installed on the side wall of the first hard shell 11, and the light guide connector 15 is located on the side wall of the connector 14. The automatic calibration detection mechanism also includes an interface 16, a controller 17, a monitor 18, a computer 19, an optical fiber 21, a signal transmission cable 22, an image sensor 23 and an objective lens 24. When in use, first insert a light source into the interface 16, then insert a light source into the interface 16 of the light guide connector 15, then put the endoscope into the detection object, and set the initial distance D between the measured object and the objective lens 24, then the light source will assist in illuminating the objective lens 24 through the optical fiber 21, and take a picture, and the picture taken will be The image is transmitted to the inside of the connector 14 through the image sensor 23 and the signal transmission cable 22 (after the light passes through the lens, it is captured by the image sensor 23, and the image sensor 23 can convert the optical signal into a digital signal and transmit it to the signal transmission cable 22 and the connector 14), so that the connector 14 sends the image to the monitor 18 and the computer 19 through the controller 17, and takes pictures to divide the acquired image into a matrix, takes the small image in the center and uses the Brenner function to evaluate its clarity. The Brenner function is shown in formula A. The Brenner function is used to measure the degree of change of each pixel in the image, and evaluates the clarity of the image by calculating the gradient. The endoscope lens is moved at a distance to determine whether the target area reaches the optimal clarity evaluation result. If the optimal clarity evaluation result is reached, it can be determined that the object distance of the measurement target is the obtainable data, and the image at this time is the image with the best clarity. If the optimal clarity evaluation result is not reached, the endoscope lens continues to be moved back and forth until the optimal clarity evaluation result is found, thereby finding the clearest image.
[0020] The interface 16 is arranged on the side wall of the light guide connector 15. The light guide connector 15 and the interface 16 are both located below the second hard shell 12 and the soft shell 13. The controller 17 is connected to the connector 14. The controller 17 is connected to the monitor 18 and the computer 19 respectively. The monitor 18 is located below the computer 19. The optical fiber 21 is located inside the first hard shell 11, the second hard shell 12 and the soft shell 13 respectively. The optical fiber 21 is fixedly installed inside the interface 16. The signal transmission cable 22 is connected to the connector 14. The signal transmission cable 22 is located at the optical fiber 2 1, the signal transmission cable 22 is respectively located inside the first hard shell 11, the second hard shell 12 and the soft shell 13, the signal transmission cable 22 and the image sensor 23 are fixedly installed, the image sensor 23 is located inside the soft shell 13, the image sensor 23 and the first hard shell 11 are fixedly installed, the objective lens 24 is located at the end of the soft shell 13 away from the connector 14, the objective lens 24 and the soft shell 13 are fixedly installed, and the optical fiber 21 is located below the objective lens 24. By performing scratch detection and image graying processing on the picture with the highest evaluation value (in In some cases, the image needs to be processed to improve contrast, reduce noise or improve image quality, which is usually done through the image processing algorithm inside the endoscope). Use Canny edge detection to find the edges in the image for feature extraction, then fill the holes, use morphological operations to remove small noise points, extract connected areas, find the pixel list of the longest connected area, and calculate the distance between each pixel to deduce the actual length of the scratch (convert pixel length to actual length). The specific method is based on the pinhole imaging principle diagram and the principle of similar triangles. The actual length / pixel length = object distance / focal length is derived to deduce the actual length = pixel length * the distance between the object and the objective lens 24 (object distance) / focal length of the objective lens 24. Scratch detection is performed on the image with the best clarity, grayscale processing is performed on the image, edge detection is performed for feature extraction, and then holes are filled, noise points are removed, and the connected area is extracted to locate the longest area as the scratch area. The actual length of the scratch to be measured is deduced by calculating the pixel length of the scratch. The quantitative algorithm of parameters such as length, width, area, and perimeter can be completed without a reference object, which is more practical.
[0021] Working principle: The first step is to insert a light source into the interface 16 when using it, and then insert a light source into the interface 16 of the light guide connector 15, and then put the endoscope into the detection object, and set the initial distance D between the measured object and the objective lens 24, and then the light source will assist the objective lens 24 through the optical fiber 21 (the function of installing the optical fiber 21 on the probe of the endoscope is to transmit the light from the interface 16 to the objective lens 24, so that the image of the area can be displayed in the endoscope camera, which is convenient for the staff to observe), and take a picture, and then the picture taken will be passed through the image sensor 23 (the image sensor 23 is a device for converting optical images into electrical signals, which is often used in digital cameras, video cameras, mobile phone cameras and other devices. The function of the image sensor 23 is to capture light and convert it into digital or analog signals to create images or videos) The signal transmission cable 22 is transmitted to the inside of the connector 14 (after the light passes through the lens, it is captured by the image sensor 23, and the image sensor 23 can convert the light signal into a digital signal and transmit it to the signal transmission cable 22 and the connector 14), so that the connector 14 sends the picture to the monitor 18 and the computer 19 through the controller 17, and takes pictures to divide the acquired picture into a matrix, takes the small picture at the center and uses the Brenner function (the Brenner function is a function commonly used in image clarity evaluation, which is used to measure the degree of change of each pixel in the image and evaluate the clarity of the image by calculating the gradient) to evaluate its clarity. The Brenner function is shown in formula A. The Brenner function is used to measure the degree of change of each pixel in the image and evaluate the clarity of the image by calculating the gradient; A: Next, the objective lens 24 is The distance of the interval before and after is Take pictures separately, as shown in formula B, and perform matrix segmentation on the obtained picture information. Take the small picture in the center and use the Brenner function to evaluate the clarity. Normalize the clarity evaluation values of all the small pictures obtained, and perform curve fitting to draw a curve graph of the clarity evaluation function. B: Again, the pictures with the highest evaluation values are subjected to scratch detection and image grayscale processing (in some cases, the pictures need to be processed to improve contrast, reduce noise or improve image quality, usually through the image processing algorithm inside the endoscope). Canny is used (Canny is a widely used algorithm for detecting image edges in vision. It determines the edges by detecting the locations where the gradient changes greatly in the image. The main steps of the Canny algorithm include Gaussian filtering, calculating the gradient strength and direction, non-maximum suppression and double threshold processing. Among them, Gaussian filtering is used to smooth the image and reduce noise, gradient calculation is used to find the edges in the image, non-maximum suppression is used to refine the edges, and double threshold processing is used to determine the final The Canny algorithm has good noise suppression ability and more accurate edge positioning, and is widely used in image processing, edge detection, target detection and other fields in vision.) Edge detection finds the edges in the image for feature extraction, then fills the holes, uses morphological operations to remove small noise points, extracts connected areas, finds the pixel list of the longest connected area, and calculates the distance between each pixel to deduce the actual length of the scratch (converts the pixel length to the actual length). The specific method is based on the pinhole imaging principle diagram and the principle of similar triangles. The actual length / pixel length = object distance / focal length, and it is deduced that the actual length = pixel length * the distance between the object and the objective lens 24 (object distance) / objective lens 24 focal length.
[0022] The second step is to use the Canny operator (the Canny operator is a commonly used edge detection operator in image processing. The Canny operator detects edges in images through the following steps: Gaussian filtering, gradient calculation, non-maximum suppression, dual threshold detection, and edge connection. The advantage of the Canny operator is that it can extract edges with clear details, continuous and accurate, and has good noise suppression capabilities.) The specific algorithm steps for finding edge points are as follows: Use Gaussian filter to smooth the image, reduce the error rate, and apply Gaussian smoothing to the image. Canny pointed out that the Gaussian operator is the best for image smoothing. The two-dimensional Gaussian smoothing operator is as follows: = Differentiating in both the horizontal and vertical directions, we can obtain:
[0023] By differentiation, the two-dimensional smoothing operator is decomposed into filters in the horizontal and vertical directions, thereby improving the smoothing speed. Compute the gradient magnitude and direction using first-order partial derivative finite differences: The traditional Canny operator uses the finite difference of the first-order partial derivative of the 2X2 neighborhood to calculate the smoothed data array The gradient magnitude and direction of , where the horizontal and vertical difference operators are:
[0024] The gradient magnitude and direction here are:
[0025]
[0026] Perform non-maximum suppression on the gradient amplitude: The edge in a digital image corresponds to the part of the image where the grayscale changes dramatically, that is, the part where the gradient modulus is relatively large. Therefore, the edge detection problem can be converted into the problem of calculating the local maximum of the gradient modulus, that is, the local maximum of the gradient modulus is taken as the edge. This process is the process of suppressing the local non-maximum. By suppressing the local non-maximum, the rough edge information in the image can be extracted. The Canny operator searches for the gradient modulus of the adjacent pixels along the gradient direction for each point with non-zero gradient. If the gradient modulus of the point is less than the gradient modulus of any adjacent pixel, the point is removed and its gradient modulus is set to zero; if the gradient modulus of the point is greater than the gradient modulus of the two adjacent pixels, the point is retained as a candidate point for the edge pixel. By suppressing the local non-maximum, the rough edge information in the image can be extracted. Detect and connect edges using a dual threshold algorithm: The edges in the image after non-maximum suppression are only rough edges, and double threshold detection is required to eliminate pseudo edge points. The Canny operator sets two high and low thresholds. If the gradient modulus of the edge candidate point is less than the low threshold, the point is determined to be a pseudo edge point; if the gradient modulus of the edge candidate point is greater than the high threshold, the point is determined to be an edge point; if the gradient modulus of the edge candidate point is less than the high threshold but greater than the low threshold, then it is determined whether this point is 8-connected with the edge point obtained previously. If so, this point is recorded as an edge point, and the obtained image is an edge image.
[0027] In the third step, the goal of the Canny algorithm is to find an optimal edge detection algorithm. The meaning of optimal edge detection is: A good detection algorithm identifies as many actual edges in the image as possible; Good positioning - the identified edges should be as close as possible to the actual edges in the actual image; Minimum response - an edge in an image can be identified only once, and possible image noise should not be identified as an edge; This working principle uses the Canny operator to find the local maximum of the image gradient, so that the Canny operator can find more targets. The Canny operator is a multi-stage optimization operator with filtering, enhancement and detection. The compilation of the entire algorithm in this working principle uses the Matlab language and makes full use of the functions in the Matlab toolbox, so as to calculate the pixel length of the scratch and infer the actual length of the scratch to be measured.
[0028] The embodiments of the present invention are given for the purpose of illustration and description, and are not intended to be exhaustive or to limit the present invention to the disclosed form. Many modifications and changes are obvious to those of ordinary skill in the art. The embodiments are selected and described in order to better illustrate the principles and practical applications of the present invention and to enable those of ordinary skill in the art to understand the present invention and thereby design various embodiments with various modifications suitable for specific purposes.
Claims
1. A monocular high-precision defect quantitative detection device based on an endoscope, comprising an endoscope, wherein the endoscope is provided with a first hard shell (11), a second hard shell (12) and a soft shell (13), wherein the first hard shell (11) is fixedly installed below the second hard shell (12), and the soft shell (13) is fixedly installed on the side wall of the second hard shell (12), characterized in that: An automatic calibration detection mechanism is provided on the surface of the first hard shell (11); The automatic calibration detection mechanism comprises a connector (14), and a light guide connector (15) is fixedly mounted on the side wall of the first hard shell (11), and the light guide connector (15) is located on the side wall of the connector (14).
2. The monocular high-precision defect quantitative detection device based on an endoscope as claimed in claim 1, characterized in that: The automatic calibration detection mechanism also includes an interface (16), a controller (17), a monitor (18), a computer (19), an optical fiber (21), a signal transmission cable (22), an image sensor (23) and an objective lens (24).
3. The monocular high-precision defect quantitative detection device based on an endoscope as claimed in claim 2, characterized in that: The interface (16) is arranged on a side wall of the light guide connector (15); the light guide connector (15) and the interface (16) are both located below the second hard shell (12) and the soft shell (13).
4. The monocular high-precision defect quantitative detection device based on an endoscope as claimed in claim 3, characterized in that: The controller (17) is connected to the connector (14), and the controller (17) is connected to a monitor (18) and a computer (19) respectively.
5. The monocular high-precision defect quantitative detection device based on an endoscope as claimed in claim 4, characterized in that: The monitor (18) is located below the computer (19), and the optical fibers (21) are respectively located inside the first hard shell (11), the second hard shell (12), and the soft shell (13).
6. The monocular high-precision defect quantitative detection device based on an endoscope as claimed in claim 5, characterized in that: The optical fiber (21) is fixedly installed inside the interface (16), and the signal transmission cable (22) is connected to the connector (14).
7. The monocular high-precision defect quantitative detection device based on an endoscope as claimed in claim 6, characterized in that: The signal transmission cable (22) is located above the optical fiber (21), and the signal transmission cable (22) is located inside the first hard shell (11), the second hard shell (12) and the soft shell (13), respectively.
8. The monocular high-precision defect quantitative detection device based on endoscope as claimed in claim 7, characterized in that: The signal transmission cable (22) and the image sensor (23) are fixedly installed, and the image sensor (23) is located inside the soft housing (13).
9. The monocular high-precision defect quantitative detection device based on endoscope as claimed in claim 8, characterized in that: The image sensor (23) is fixedly mounted on the first hard shell (11), and the objective lens (24) is located at the end of the soft shell (13) on a side away from the connector (14).
10. The monocular high-precision defect quantitative detection device based on endoscope according to claim 9, characterized in that: The objective lens (24) is fixedly mounted on the soft housing (13), and the optical fiber (21) is located below the objective lens (24).
