An endoscope defect detection system and detection method based on image analysis
Through the endoscopic defect detection system based on image analysis, the problem of defect detection and repair during the use of the endoscopic is solved, and the accuracy and efficiency of medical operations are improved.
Patent Information
- Application Number
- CN202411350562.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2044-09-26
AI Technical Summary
The prior art is difficult to efficiently and accurately detect and repair defects such as physical damage and chemical corrosion caused by endoscopes during use, affecting the accuracy of medical operations.
An endoscopic defect detection system based on image analysis is adopted to perform defect repair through structural participation evaluation, image preprocessing, feature extraction, defect location and classification in combination with a big data network.
It realizes efficient detection and repair of endoscopic defects, improves the accuracy and efficiency of medical operations, and provides better support for medical tools.
Smart Images

Figure CN119251187B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of endoscopic anomaly detection, and particularly to an endoscopic defect detection system and detection method based on image analysis. Background Art
[0002] An endoscope is a medical instrument used for examining and treating internal organs or structures of the human body. It usually consists of a long and flexible tube with a small camera and light source at the front end, and is connected to a display at the back end. Doctors can observe real-time images inside the body through the endoscope, so as to perform operations such as diagnosis, biopsy, and surgery. During the operation of the endoscope, physical damage is inevitable. For example, when using the endoscope, if the endoscope lens or housing collides or rubs against a hard object, it may cause scratches, cracks or other physical damage; or if the endoscope is bent or twisted excessively, it may cause fiber optic breakage or damage to the endoscope structure. Chemical corrosion may also occur. For example, during the disinfection or cleaning of the endoscope, if inappropriate chemicals are used, it may corrode the lens, housing or internal optical components, resulting in coating peeling or material deterioration. Or if it is exposed to a humid environment for a long time, especially if it is not dried sufficiently after use, it may cause oxidation and corrosion of the lens surface or internal optical components, thereby affecting the image quality. Since the endoscope is a medical device, if a defect occurs during use, resulting in deviation during the endoscopic process, it may affect the doctor's diagnosis of the patient. Therefore, defect diagnosis of the endoscope is required. The image analysis method can observe whether there are physical damage, chemical corrosion or aging wear after the use of the endoscope, which is more accurate and efficient than manually checking whether the endoscope has defects. Summary of the Invention
[0003] The present invention overcomes the deficiencies of the prior art and provides an endoscopic defect detection system and detection method based on image analysis.
[0004] To achieve the above object, the technical solution adopted by the present invention is as follows:
[0005] In a first aspect of the present invention, an endoscopic defect detection method based on image analysis is provided, including the following steps:
[0006] Determine the usage arrangement of the target endoscope, evaluate the structural participation degree of the target endoscope based on the usage arrangement of the target endoscope, and classify the structure of the target endoscope after the structural participation degree evaluation;
[0007] Obtain the surface image of the necessary structure of the target endoscope in the target endoscope, and perform image preprocessing and image feature extraction processing on the surface image of the necessary structure of the target endoscope after the surface image is obtained, so as to obtain the surface image feature data of the necessary structure of the target endoscope;
[0008] Based on the surface image feature data of the necessary structures of the target endoscope, defect localization, defect analysis, and defect classification are performed on the necessary structures of the target endoscope, and defect repair is performed on the necessary structures of the target endoscope after the defect analysis and defect classification results.
[0009] Further, in a preferred embodiment of the present invention, the usage arrangement of the target endoscope is determined, the structural participation degree of the target endoscope is evaluated based on the usage arrangement of the target endoscope, and the structure of the target endoscope is classified after the structural participation degree evaluation, specifically:
[0010] The endoscope that needs to be analyzed and diagnosed by image is calibrated as the target endoscope, and the usage scenario of the target endoscope is obtained;
[0011] The usage instructions of the target endoscope are obtained, and based on the usage instructions of the target endoscope, the structure of the target endoscope is obtained;
[0012] In the usage scenario of the target endoscope, the usage arrangement of the target endoscope is obtained, wherein the usage arrangement of the target endoscope includes the endoscope position, endoscope plan, and endoscope time of the target endoscope;
[0013] The big data network is obtained, and the functions of different structures of the target endoscope are obtained from the usage instructions of the target endoscope. The functions of different structures of the endoscope and the usage arrangement of the endoscope are imported into the big data network for combination, and after the combination, the participation degree of different structures of the target endoscope in the usage arrangement is retrieved through the big data network and calibrated as the first participation degree;
[0014] A first participation degree standard threshold is preset, the relationship between the first participation degree of different structures of the target endoscope and the first participation degree standard threshold is judged, the target endoscope structures with the first participation degree greater than the first participation degree standard threshold are calibrated as the necessary structures of the target endoscope, and the target endoscope structures with the first participation degree less than the first participation degree standard threshold are calibrated as the non-necessary structures of the target endoscope.
[0015] Further, in a preferred embodiment of the present invention, the surface image of the necessary structure of the target endoscope is obtained in the target endoscope, and after the surface image is obtained, image preprocessing and image feature extraction processing are performed on the surface image of the necessary structure of the target endoscope to obtain the surface image feature data of the necessary structure of the target endoscope, specifically:
[0016] Based on the image acquisition device, the surface image of the necessary structure of the target endoscope is collected and calibrated as the target surface image, and at the same time, the pixel values of all pixel points in the target surface image are calculated;
[0017] A median filter is introduced, where a median filtering sliding window is included in the median filter, and the target surface image is imported into the median filter;
[0018] Traverse the target surface image through the median filtering sliding window in the median filter, and based on the pixel values of all pixel points in the target surface image, during the process of traversing the target surface image by the median filtering sliding window, take the median of the pixel values of the pixel points of the target surface image in the median filtering sliding window as the filtering output value, and apply the filtering output value in the target surface image to obtain a median-filtered surface image;
[0019] Apply the CLAHE algorithm, i.e., the Contrast Limited Adaptive Histogram Equalization algorithm, to the median-filtered surface image to obtain the adaptive histogram of the median-filtered surface image, and at the same time obtain the image contrast of the median-filtered surface image, and preset an image contrast threshold;
[0020] Analyze the image contrast of the median-filtered surface image. If there is an area in the median-filtered surface image where the image contrast is not within the image contrast threshold, then adaptively stretch the adaptive histogram of the median-filtered surface image so that there is no area in the median-filtered surface image where the image contrast is not within the image contrast threshold, and obtain a median-filtered contrast qualified surface image;
[0021] Perform image correction and image feature extraction processing on the median-filtered contrast qualified surface image to obtain the surface image feature data of the necessary structures of the target endoscope.
[0022] Further, in a preferred embodiment of the present invention, the performing image correction and image feature extraction processing on the median-filtered contrast qualified surface image to obtain the surface image feature data of the necessary structures of the target endoscope is specifically as follows:
[0023] Obtain an image color temperature correction device, obtain the color temperature parameter of the median-filtered contrast qualified surface image in the image color temperature correction device, and based on the retrieval of the big data network, retrieve the color clarity of the image at different color temperature parameters when analyzing the image of the endoscope;
[0024] Based on the color clarity of the image of the endoscope at different color temperatures when analyzing the image of the endoscope, obtain the color temperature parameter of the image of the endoscope with the highest color clarity, calibrate it as the optimal color temperature parameter, and control the image correction device to adjust the color temperature parameter of the median-filtered contrast qualified surface image to the optimal color temperature parameter to obtain the surface image of the necessary structures of the target endoscope;
[0025] Introduce an edge detection algorithm, calculate the image gradient of the surface image of the necessary structures of the target endoscope based on the edge detection algorithm, and preset an image standard gradient threshold for the surface image of the necessary structures of the target endoscope;
[0026] Within the surface image of the necessary structure of the target endoscope, the surface image of the necessary structure of the target endoscope whose image gradient does not maintain at the image standard gradient threshold is calibrated as the background image, and the surface image of the necessary structure of the target endoscope whose image gradient maintains at the image standard gradient threshold is calibrated as the foreground image;
[0027] Calculate the shape features of the foreground image within the surface image of the necessary structure of the target endoscope. Among them, the shape features include the number of pixels, the boundary length, and the geometric moment of the foreground image. According to the shape features of the foreground image, obtain the surface image feature data of the necessary structure of the target endoscope.
[0028] Furthermore, in a preferred embodiment of the present invention, based on the surface image feature data of the necessary structure of the target endoscope, perform defect location, defect analysis, and defect classification on the necessary structure of the target endoscope, and perform defect repair on the necessary structure of the target endoscope after the defect analysis and classification results. Specifically:
[0029] Based on the usage instructions of the target endoscope, obtain the structural specification parameters of the necessary structure of the target endoscope, and based on the structural specification parameters of the necessary structure of the target endoscope, obtain the standard data of the surface image features of the necessary structure of the target endoscope;
[0030] Calculate the Mahalanobis distance between the surface image feature data of the necessary structure of the target endoscope and the standard data of the surface image features of the necessary structure of the target endoscope, and preset the Mahalanobis distance interval;
[0031] If the Mahalanobis distance between the surface image feature data of the necessary structure of the target endoscope and the standard data of the surface image features of the necessary structure of the target endoscope maintains within the Mahalanobis distance interval, then calibrate the necessary structure of the target endoscope as a qualified necessary structure of the endoscope, and evaluate the target endoscope corresponding to the qualified necessary structure of the endoscope as a qualified endoscope;
[0032] If the Mahalanobis distance between the surface image feature data of the necessary structure of the target endoscope and the standard data of the surface image features of the necessary structure of the target endoscope does not maintain within the Mahalanobis distance interval, then calibrate the necessary structure of the target endoscope as a necessary structure of the surface defect endoscope, and calibrate the surface image feature data of the necessary structure of the target endoscope as the to-be-analyzed feature data;
[0033] Based on the surface image of the necessary structure of the target endoscope, obtain the foreground image of the surface image of the necessary structure of the surface defect endoscope, and perform analysis in combination with the to-be-analyzed feature data to locate the defect position of the necessary structure of the surface defect endoscope, and calibrate it as the target defect position;
[0034] Based on the feature data to be analyzed, analyze the shape features of the foreground image of the surface image of the necessary structure of the surface defect endoscope, and obtain the surface defect depth and surface defect area of the target defect position;
[0035] Conduct defect threshold analysis on the surface defect depth and surface defect area of the target defect position, and classify and repair the defects of the necessary structure of the surface defect endoscope based on the results of the defect threshold analysis.
[0036] Further, in a preferred embodiment of the present invention, the conduct of defect threshold analysis on the surface defect depth and surface defect area of the target defect position, and the classification and repair of the defects of the necessary structure of the surface defect endoscope based on the results of the defect threshold analysis are specifically as follows:
[0037] Preset the surface dangerous defect depth and surface dangerous defect area of the target defect position. If the surface defect depth of the target defect position is greater than the surface dangerous defect depth, scrap the target endoscope corresponding to the necessary structure of the surface defect endoscope;
[0038] If the surface defect depth of the target defect position is less than the surface dangerous defect depth, label the necessary structure of the surface defect endoscope as a type of repairable endoscope necessary structure;
[0039] If the surface defect area of the target defect position is greater than the surface dangerous defect area, scrap the target endoscope corresponding to the necessary structure of the surface defect endoscope;
[0040] If the surface defect area of the target defect position is less than the surface dangerous defect area, label the necessary structure of the surface defect endoscope as a type of repairable endoscope necessary structure;
[0041] Based on the big data network, respectively retrieve and output the repair methods and protection methods for the target defect positions corresponding to the type of repairable endoscope necessary structure and the type of repairable endoscope necessary structure, so that the necessary structure of the surface defect endoscope corresponding to the target defect position is labeled as a qualified endoscope necessary structure, and the target endoscope corresponding to the qualified endoscope necessary structure is evaluated as a qualified endoscope.
[0042] The second aspect of the present invention also provides an endoscope defect detection system based on image analysis. The endoscope defect detection system includes a memory and a processor. An endoscope defect detection method program is stored in the memory. When the endoscope defect detection method program is executed by the processor, the following steps are implemented:
[0043] Determine the usage arrangement of the target endoscope, evaluate the structural participation degree of the target endoscope based on the usage arrangement of the target endoscope, and classify the structure of the target endoscope after the evaluation of the structural participation degree;
[0044] Acquire the surface image of the necessary structures of the target endoscope in the target endoscope, and after the surface image acquisition, perform image preprocessing and image feature extraction processing on the surface image of the necessary structures of the target endoscope to obtain the surface image feature data of the necessary structures of the target endoscope;
[0045] Based on the surface image feature data of the necessary structures of the target endoscope, perform defect location, defect analysis, and defect classification on the necessary structures of the target endoscope, and perform defect repair on the necessary structures of the target endoscope after the defect analysis and defect classification results.
[0046] The technical defects existing in the background art solved by the present invention, the present invention has the following beneficial effects: evaluate the structural participation degree of the endoscope, determine the structure of the endoscope that needs to be defect diagnosed based on the evaluation result of the structural participation degree, perform surface image analysis and preprocessing on this structure, and finally perform defect location, defect analysis, defect classification, and defect repair on the endoscope based on the results of the analysis and preprocessing to obtain a qualified endoscope. The present invention can find the defect location of the endoscope through image analysis of the endoscope, and perform defect repair on the endoscope according to the type of the defect location, preventing the error of the endoscope from increasing during use, providing better tool services for doctors during use, and helping to improve the medical efficiency and medical effect of doctors. Brief Description of the Drawings
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can also obtain the drawings of other embodiments without creative work.
[0048] Figure 1 Shows a flowchart of an endoscope defect detection method based on image analysis;
[0049] Figure 2 Shows a method flowchart for performing image preprocessing and image feature extraction processing on the surface image of the necessary structures of the target endoscope;
[0050] Figure 3 Shows a schematic diagram of an endoscope defect detection system based on image analysis. Detailed Description of the Embodiments
[0051] In order to be able to more clearly understand the above-mentioned objects, features, and advantages of the present invention, the following will further describe the present invention in detail with reference to the drawings and specific embodiments. It should be noted that, without conflict, the embodiments of the present application and the features in the embodiments can be combined with each other.
[0052] In the following description, many specific details are set forth in order to provide a thorough understanding of the present invention. However, the present invention may be practiced in other ways different from those described herein. Therefore, the scope of protection of the present invention is not limited by the specific embodiments disclosed below.
[0053] Figure 1 The flowchart of an endoscope defect detection method based on image analysis is shown, including the following steps:
[0054] S102: Determine the usage arrangement of the target endoscope, evaluate the structural participation degree of the target endoscope based on the usage arrangement of the target endoscope, and classify the structure of the target endoscope after the structural participation degree evaluation;
[0055] S104: Obtain the surface image of the necessary structure of the target endoscope in the target endoscope, and perform image preprocessing and image feature extraction processing on the surface image of the necessary structure of the target endoscope after the surface image is obtained, to obtain the surface image feature data of the necessary structure of the target endoscope;
[0056] S106: Based on the surface image feature data of the necessary structure of the target endoscope, perform defect location, defect analysis and defect classification on the necessary structure of the target endoscope, and repair the defects of the necessary structure of the target endoscope after the defect analysis and defect classification results.
[0057] Further, in a preferred embodiment of the present invention, the determining the usage arrangement of the target endoscope, evaluating the structural participation degree of the target endoscope based on the usage arrangement of the target endoscope, and classifying the structure of the target endoscope after the structural participation degree evaluation are specifically as follows:
[0058] Calibrate the endoscope that needs to be diagnosed by image analysis as the target endoscope, and obtain the usage scenario of the target endoscope;
[0059] Obtain the usage instructions of the target endoscope, and based on the usage instructions of the target endoscope, obtain the structure of the target endoscope;
[0060] In the usage scenario of the target endoscope, obtain the usage arrangement of the target endoscope, wherein the usage arrangement of the target endoscope includes the endoscope position, endoscope plan and endoscope time of the target endoscope;
[0061] Obtain the big data network, and obtain the functions of different structures of the target endoscope in the usage instructions of the target endoscope. Import the functions of different structures of the endoscope and the usage arrangement of the endoscope into the big data network for combination, and after the combination, retrieve the participation degree of different structures of the target endoscope in the usage arrangement through the big data network, and calibrate it as the first participation degree;
[0062] Preset a first participation standard threshold, determine the relationship between the first participation of different structures of the target endoscope and the first participation standard threshold, label the target endoscope structures with the first participation greater than the first participation standard threshold as necessary structures of the target endoscope, and label the target endoscope structures with the first participation less than the first participation standard threshold as non-necessary structures of the target endoscope.
[0063] It should be noted that after obtaining the target endoscope, the target endoscope consists of multiple different structures, mainly including a long and flexible tube, a small camera at the front end of the tube, a light source, and a display at the rear end of the tube, and some secondary structures such as labels and brackets are added. The importance of different structures is different, and the evaluation of importance depends on the participation of the endoscope during use. When problems occur in the endoscope structures with high participation, such as physical damage or chemical corrosion, etc., defect repair needs to be carried out on these structures, that is, the necessary structures of the target endoscope. For example, a long and flexible tube, a small camera at the front end of the tube, a light source, and a display at the rear end of the tube are usually necessary structures of the target endoscope. Classifying the importance of the target endoscope structures needs to be determined according to the usage arrangement of the target endoscope, and the usage arrangement of the endoscope needs to be determined by the usage scenario of the endoscope. Some usage arrangements may not require the use of some upper structures. For example, when examining the digestive tract, colonoscopes and gastroscopes are needed, and different mirrors are used for different parts, that is, the usage arrangements are different. In the big data network, the participation of the endoscope in different usage arrangements can be retrieved, and the structures can be classified according to the participation to obtain the necessary structures and non-necessary structures of the target endoscope.
[0064] Further, in a preferred embodiment of the present invention, based on the surface image feature data of the necessary structures of the target endoscope, defect location, defect analysis, and defect classification are performed on the necessary structures of the target endoscope, and after the defect analysis and defect classification results, defect repair is performed on the necessary structures of the target endoscope, specifically:
[0065] Based on the usage instructions of the target endoscope, obtain the structural specification parameters of the necessary structures of the target endoscope, and based on the structural specification parameters of the necessary structures of the target endoscope, obtain the standard data of the surface image features of the necessary structures of the target endoscope;
[0066] Calculate the Mahalanobis distance between the surface image feature data of the necessary structures of the target endoscope and the standard data of the surface image features of the necessary structures of the target endoscope, and preset the Mahalanobis distance interval;
[0067] If the Mahalanobis distance between the target endoscope necessary structure surface image feature data and the target endoscope necessary structure surface image feature standard data is maintained within the Mahalanobis distance interval, the target endoscope necessary structure is calibrated as a qualified endoscope necessary structure, and the target endoscope corresponding to the qualified endoscope necessary structure is evaluated as a qualified endoscope;
[0068] If the Mahalanobis distance between the target endoscope necessary structure surface image feature data and the target endoscope necessary structure surface image feature standard data is not maintained within the Mahalanobis distance interval, the target endoscope necessary structure is calibrated as a surface defect endoscope necessary structure, and the target endoscope necessary structure surface image feature data is calibrated as feature data to be analyzed;
[0069] Based on the target endoscope necessary structure surface image, a foreground image of the surface image of the surface defect endoscope necessary structure is obtained, and the foreground image is analyzed in combination with the feature data to be analyzed to locate the defect position of the surface defect endoscope necessary structure and mark it as the target defect position;
[0070] Based on the feature data to be analyzed, the shape features of the foreground image of the surface image of the necessary structure of the surface defect endoscope are analyzed to obtain the surface defect depth and surface defect area of the target defect position.
[0071] It should be noted that after the endoscope obtains the surface image feature data, it is necessary to judge whether there are defects on the surface of the endoscope according to the surface image feature data, including but not limited to physical damage, chemical corrosion, etc. The Mahalanobis distance between the surface image feature data and the standard data can be calculated to judge whether there are defects on the surface of the endoscope. The Mahalanobis distance between the data reflects the similarity between the data. The smaller the Mahalanobis distance, the higher the similarity. If the Mahalanobis distance between the surface image feature data and the standard data is greater than the preset value, that is, it is not within the Mahalanobis distance interval, it is judged that the similarity between the data is low. Since the necessary structure of the endoscope under the standard data is intact and the similarity between the data is low, it is judged that the necessary structure of the target endoscope has defects. The foreground image of the surface image of the necessary structure of the target endoscope is obtained, and the foreground image is the image of the necessary structure in the surface image, and the position of the defect in the necessary structure can be determined in combination with the feature data to be analyzed, and marked as the target defect position. There may be many types of defects at the target defect position, and different defect types correspond to different defect repair schemes. First, the type of defect needs to be determined at the target defect position. Since physical damage is easier to judge, it is necessary to first perform defect detection on the physical damage level of the necessary structures of the endoscope. The surface defect depth and area of the target defect position are determined based on the characteristic data to be analyzed, and the corresponding defect classification and repair are performed based on the surface defect depth and area.
[0072] Further, in a preferred embodiment of the present invention, the surface defect depth and surface defect area of the target defect position are subjected to defect threshold analysis, and the necessary structures of the surface defect endoscope are classified and repaired based on the defect threshold analysis results, specifically as follows:
[0073] Preset the surface dangerous defect depth and surface dangerous defect area of the target defect position. If the surface defect depth of the target defect position is greater than the surface dangerous defect depth, the target endoscope corresponding to the necessary structure of the surface defect endoscope is scrapped;
[0074] If the surface defect depth of the target defect position is less than the surface dangerous defect depth, the necessary structure of the surface defect endoscope is calibrated as a type-I repairable endoscope necessary structure;
[0075] If the surface defect area of the target defect position is greater than the surface dangerous defect area, the target endoscope corresponding to the necessary structure of the surface defect endoscope is scrapped;
[0076] If the surface defect area of the target defect position is less than the surface dangerous defect area, the necessary structure of the surface defect endoscope is calibrated as a type-II repairable endoscope necessary structure;
[0077] Based on the big data network, retrieve and output the repair methods and protection methods for the target defect positions corresponding to the necessary structures of the type-I and type-II repairable endoscopes, so that the necessary structures of the surface defect endoscope corresponding to the target defect position are calibrated as qualified endoscope necessary structures, and the target endoscopes corresponding to the qualified endoscope necessary structures are evaluated as qualified endoscopes.
[0078] It should be noted that the surface defect depth and surface defect area of the target defect position are analyzed to determine whether the surface defect depth and surface defect area are greater than the preset values. Since the necessary structure of the endoscope already has a defect, it is determined whether the necessary structure of the surface defect endoscope can be repaired according to whether the surface defect depth and surface defect area are greater than the preset values. If the surface defect depth or surface defect area is greater than the preset value, the target defect position cannot be repaired. If the defect degree is large, such as the defect depth is too large, the repair difficulty is huge, or the defect cannot be repaired at all. At this time, the target endoscope can only be scrapped and cannot be used continuously. If the necessary structure of the endoscope is forcibly repaired and used continuously, it may cause a decrease in the accuracy of the endoscopy or damage to the patient. When the surface defect depth or surface defect area is not greater than the preset value, it proves that the necessary structure of the surface defect endoscope may be repaired accordingly. For example, if there are cracks, scratches, degumming, etc. at the defect position, the corresponding repair methods and protection methods for the defect position can be retrieved through the big data network according to the defect type of the target defect position, such as abnormal defect depth or abnormal defect area. The repair methods include, but are not limited to, patching treatment if there is degumming, painting treatment if there are cracks, scratches, etc. The protection methods include, but are not limited to, maintaining and protecting the endoscope, adding a protective case during idle time, etc. Finally, the repair methods and protection methods for the target defect positions corresponding to the necessary structures of the first type of repairable endoscope and the second type of repairable endoscope are output to obtain a qualified endoscope.
[0079] Figure 2 The method flow chart for image preprocessing and image feature extraction processing of the surface image of the necessary structure of the target endoscope is shown, including the following steps:
[0080] S202: Perform median filtering processing on the collected surface image of the necessary structure of the target endoscope to obtain a median-filtered surface image;
[0081] S204: Perform adaptive adjustment of the image contrast on the median-filtered surface image to obtain a median-filtered surface image with qualified contrast;
[0082] S206: Perform image correction and image feature extraction processing on the median-filtered surface image with qualified contrast to obtain the surface image feature data of the necessary structure of the target endoscope.
[0083] Further, in a preferred embodiment of the present invention, the performing median filtering processing on the collected surface image of the necessary structure of the target endoscope to obtain a median-filtered surface image is specifically:
[0084] Based on the image acquisition device, collect the surface image of the necessary structure of the target endoscope, label it as the target surface image, and calculate the pixel values of all pixel points in the target surface image;
[0085] Introduce a median filter, where the median filter contains a median filtering sliding window, and import the target surface image into the median filter;
[0086] Traverse the target surface image through the median filtering sliding window in the median filter, and based on the pixel values of all pixel points in the target surface image, during the process of traversing the target surface image by the median filtering sliding window, take the median of the pixel values of the pixel points of the target surface image in the median filtering sliding window as the filtering output value, and apply the filtering output value in the target surface image to obtain a median filtered surface image.
[0087] It should be noted that whether there are defects on the surface of the necessary structure of the target endoscope can be judged by image analysis. First, obtain the image of the surface of the necessary structure of the target endoscope, that is, the surface defect image. After obtaining the image, since there may be external factors blocking during image acquisition, resulting in unclear parts in the image, that is, there are noises and other situations, so it is necessary to perform filtering processing on the image to reduce the noise in the image and achieve the purpose of enhancing the image clarity. The median filtering method is a commonly used image processing technology, mainly used to remove noise in the image. By extracting the median of the neighborhood of each pixel in the image to replace the value of the pixel, the edge details of the image can be retained while reducing noise. The median filtering sliding window in the median filtering device can sort the pixel values within the window, and after finding the median, replace the pixel values within the window with the median, and traverse and slide the window in the image to achieve the purpose of median filtering.
[0088] Further, in a preferred embodiment of the present invention, the image contrast of the median filtered surface image is adaptively adjusted to obtain a median filtered contrast qualified surface image, specifically as follows:
[0089] Apply the CLAHE algorithm, that is, the contrast limited adaptive histogram equalization algorithm, in the median filtered surface image to obtain the adaptive histogram of the median filtered surface image, and at the same time obtain the image contrast of the median filtered surface image, and preset the image contrast threshold;
[0090] Analyze the image contrast of the median filtered surface image. If there is an area in the median filtered surface image where the image contrast is not within the image contrast threshold, then perform adaptive stretching on the adaptive histogram of the median filtered surface image so that there is no area in the median filtered surface image where the image contrast is not within the image contrast threshold, and obtain a median filtered contrast qualified surface image.
[0091] It should be noted that after the image is subjected to median filtering, it is necessary to perform image enhancement to highlight the useful information in the image for subsequent processing. Because if there are dark parts in the image, there may be incomplete extraction of features when observing and extracting image features. Therefore, it is necessary to perform image enhancement on the median-filtered surface image. The image enhancement method can be achieved by increasing the contrast of the image, so that all positions of the median-filtered surface image are clearly visible. Increasing the contrast of the median-filtered surface image can be achieved by adaptively stretching the histogram of the image, thereby realizing the image enhancement process. The adaptive histogram is a histogram in which the image can adaptively adjust the contrast. The adaptive histogram can be obtained through the CLAHE algorithm. Perform contrast threshold analysis on different regions of the image. If there is a region where the contrast is less than the contrast threshold, continue to adjust the contrast through the adaptive histogram until there is no region in the image where the contrast is less than the contrast threshold, and obtain a median-filtered surface image with qualified contrast.
[0092] Further, in a preferred embodiment of the present invention, the median-filtered surface image with qualified contrast is subjected to image correction and image feature extraction processing to obtain the surface image feature data of the necessary structure of the target endoscope, specifically:
[0093] Obtain an image color temperature correction device, obtain the color temperature parameters of the median-filtered surface image with qualified contrast in the image color temperature correction device, and retrieve the color clarity of the image at different color temperature parameters when performing image analysis on the endoscope based on the big data network;
[0094] Based on the color clarity of the image at different color temperatures when performing image analysis on the endoscope, obtain the color temperature parameters of the image of the endoscope with the highest color clarity, calibrate them as the optimal color temperature parameters, and control the image correction device to adjust the color temperature parameters of the median-filtered surface image with qualified contrast to the optimal color temperature parameters to obtain the surface image of the necessary structure of the target endoscope;
[0095] Introduce an edge detection algorithm, calculate the image gradient of the surface image of the necessary structure of the target endoscope based on the edge detection algorithm, and preset the image standard gradient threshold of the surface image of the necessary structure of the target endoscope;
[0096] In the surface image of the necessary structure of the target endoscope, label the surface image of the necessary structure of the target endoscope where the image gradient does not maintain at the image standard gradient threshold as the background image, and label the surface image of the necessary structure of the target endoscope where the image gradient maintains at the image standard gradient threshold as the foreground image;
[0097] Calculate the shape features of the foreground image in the necessary structure surface image of the target endoscope. The shape features include the number of pixels, the boundary length, and the geometric moments of the foreground image. Based on the shape features of the foreground image, obtain the feature data of the necessary structure surface image of the target endoscope.
[0098] It should be noted that after the contrast of the image is adjusted to obtain the median-filtered contrast qualified surface image, the median-filtered contrast qualified surface image needs to be corrected and the image features need to be extracted. The purpose of image correction is that after the contrast adjustment, the color clarity of some areas of the image may be small. If the color clarity is small, misjudgment may occur when observing whether there are defects in the image. Therefore, it is necessary to enhance the color clarity of the image. Adjusting the color temperature of the image can adjust the color clarity of the image. Detect the color temperature parameters in the median-filtered contrast qualified surface image, and retrieve the color clarity of the image under different color temperature parameters when analyzing the image of the endoscope. Based on the color clarity of the image under different color temperature parameters when analyzing the image of the endoscope, adjust the current color temperature parameter to the most suitable color temperature parameter to make the color clarity the highest, and obtain the necessary structure surface image of the target endoscope. The purpose of image feature extraction is to compare and analyze the extracted feature data with the standard data to determine whether there are defects in the necessary structure of the endoscope. Introduce the edge detection algorithm, and label the necessary structure surface image of the target endoscope whose image gradient does not maintain at the image standard gradient threshold as the background image. On the contrary, label the necessary structure surface image of the target endoscope whose image gradient maintains at the image standard gradient threshold as the foreground image. Among them, the foreground image is mainly the necessary structure of the endoscope, and the background image is the unnecessary structure of the endoscope and other background information.
[0099] In addition, the endoscopic defect detection method based on image analysis further includes the following steps:
[0100] Obtain the necessary structure of the qualified endoscope, and obtain the surface image of the necessary structure of the qualified endoscope, which is labeled as the surface image of the necessary structure of the qualified endoscope;
[0101] Perform color temperature parameter analysis on the foreground image of the surface image of the necessary structure of the qualified endoscope, calculate the color temperature parameters of different pixel points in the surface image of the necessary structure of the qualified endoscope, and preset the standard threshold for the change of color temperature parameters between adjacent pixel points in the surface image of the necessary structure of the qualified endoscope;
[0102] According to the color temperature parameters of different pixel points in the surface image of the necessary structure of the qualified endoscope, calculate the change value of the color temperature parameters between adjacent pixel points in the surface image of the necessary structure of the qualified endoscope, and determine whether the change value of the color temperature parameters between adjacent pixel points in the surface image of the necessary structure of the qualified endoscope maintains within the standard threshold for the change of color temperature parameters between adjacent pixel points in the surface image of the necessary structure of the qualified endoscope;
[0103] If so, it is determined that there is no abnormal color clarity in the necessary structure of the qualified endoscope;
[0104] If not, it is determined that there is abnormal color clarity in the necessary structure of the qualified endoscope, and the position where the change value of the color temperature parameter of adjacent pixel points does not maintain the standard threshold of the change of the color temperature parameter of adjacent pixel points in the surface image of the necessary structure of the qualified endoscope is marked as the target color clarity abnormal area;
[0105] Retrieve the color temperature parameter - chemical corrosion type comparison atlas in the big data network, and import the color temperature parameters of all pixel points in the target color clarity abnormal area into the color temperature parameter - chemical corrosion type comparison atlas to preliminarily determine all chemical corrosion types in the target color clarity abnormal area;
[0106] After preliminarily determining all chemical corrosion types in the target color clarity abnormal area, based on all chemical corrosion types in the target color clarity abnormal area, retrieve the sampling detection scheme and chemical corrosion removal scheme for different chemical corrosion types in the big data network;
[0107] Based on the sampling detection scheme for different chemical corrosion types, sample and detect the target color clarity abnormal area to determine the actual chemical corrosion type in the target color clarity abnormal area, and according to the actual chemical corrosion type in the target color clarity abnormal area, combine the chemical corrosion removal schemes for different chemical corrosion types, and output the chemical corrosion removal scheme corresponding to the actual chemical corrosion type in the target color clarity abnormal area, so that there is no abnormal color clarity in the necessary structure of the qualified endoscope.
[0108] It should be noted that chemical corrosion may exist in the necessary structure of a qualified endoscope, so chemical corrosion analysis of the qualified endoscope is required. After chemical corrosion, the qualified endoscope may discolor. For example, the outer shell of the endoscope after oxidation may rust, and the color of the rust may be yellow, green, etc., which is different from the main color of the endoscope outer shell. Therefore, according to the color temperature parameters of the necessary structure of the endoscope, it is judged whether chemical corrosion exists in the necessary structure of the endoscope. In the foreground image, calculate the color temperature parameters of the pixel points, and calculate whether the change value of the color temperature parameters between adjacent pixel points remains within the standard value. Because there may be two regions in the necessary structure with different original colors, it is not possible to directly judge the occurrence of chemical corrosion by judging the change of the color temperature parameters, that is, judging the corresponding region. When the change value of the color temperature parameters between adjacent pixel points does not remain within the standard value, it proves that chemical corrosion has occurred in the corresponding region. At this time, the chemically corroded region needs to be removed by corrosion. Before removal, the type of chemical corrosion needs to be determined and the right medicine should be applied. For example, rust removal treatment is carried out for rust, and mold removal treatment is carried out for mold, etc. Obtain a color temperature parameter - chemical corrosion type comparison map, and the color temperature parameter - chemical corrosion type comparison map reflects the type of color temperature parameters corresponding to different chemical corrosion types. Since there may be many chemical corrosion types corresponding to the color temperature parameters, it is necessary to initially determine all the chemical corrosion types corresponding to the color temperature parameters, and then sample the target color clarity abnormal area. The sampling detection methods and chemical corrosion removal methods for different chemical corrosion types are different. Therefore, after initially determining the type of chemical corrosion, sampling and detection are respectively carried out in the target color clarity abnormal area on this basis to achieve the purpose of determining the accurate chemical corrosion type, and according to the correct chemical corrosion type, select the corresponding chemical corrosion removal scheme to make the necessary structure of the qualified endoscope free of color clarity abnormalities.
[0109] As Figure 3 shown, the second aspect of the present invention also provides an endoscope defect detection system based on image analysis. The endoscope defect detection system includes a memory 31 and a processor 32. The memory 31 stores an endoscope defect detection method. When the endoscope defect detection method is executed by the processor 32, the following steps are implemented:
[0110] Determine the usage arrangement of the target endoscope, evaluate the structural participation degree of the target endoscope based on the usage arrangement of the target endoscope, and classify the structure of the target endoscope after the structural participation degree evaluation;
[0111] Obtain the surface image of the necessary structure of the target endoscope in the target endoscope, and perform image preprocessing and image feature extraction processing on the surface image of the necessary structure of the target endoscope after the surface image is obtained to obtain the surface image feature data of the necessary structure of the target endoscope;
[0112] Based on the image feature data of the necessary structure surface of the target endoscope, defect localization, defect analysis and defect classification are carried out on the necessary structure of the target endoscope, and defect repair is carried out on the necessary structure of the target endoscope after the defect analysis and defect classification results.
[0113] The above is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of changes or substitutions, which should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. An endoscope defect detection method based on image analysis, characterized in that It includes the following steps: Determine the usage arrangement of the target endoscope, evaluate the structural participation degree of the target endoscope based on the usage arrangement of the target endoscope, and classify the structure of the target endoscope after the structural participation degree evaluation; Acquire the surface image of the necessary structure of the target endoscope in the target endoscope, and perform image preprocessing and image feature extraction processing on the surface image of the necessary structure of the target endoscope after the surface image acquisition to obtain the surface image feature data of the necessary structure of the target endoscope; Specifically: Based on the image acquisition device, acquire the surface image of the necessary structure of the target endoscope, calibrate it as the target surface image, and calculate the pixel values of all pixel points in the target surface image at the same time; Introduce a median filter, where the median filter contains a median filtering sliding window, and import the target surface image into the median filter; Traverse the target surface image through the median filtering sliding window in the median filter, and based on the pixel values of all pixel points in the target surface image, use the median of the pixel values of the pixel points of the target surface image in the median filtering sliding window as the filtering output value during the process of traversing the target surface image by the median filtering sliding window, and apply the filtering output value to the target surface image to obtain a median filtered surface image; Apply the CLAHE algorithm, that is, the contrast limited adaptive histogram equalization algorithm, to the median filtered surface image to obtain the adaptive histogram of the median filtered surface image, and at the same time obtain the image contrast of the median filtered surface image, and preset the image contrast threshold; Analyze the image contrast of the median filtered surface image. If there is an area in the median filtered surface image where the image contrast is not within the image contrast threshold, then perform adaptive stretching on the adaptive histogram of the median filtered surface image so that there is no area in the median filtered surface image where the image contrast is not within the image contrast threshold, and obtain a median filtered surface image with qualified contrast; Perform image correction and image feature extraction processing on the median filtered surface image with qualified contrast to obtain the surface image feature data of the necessary structure of the target endoscope; Based on the surface image feature data of the necessary structure of the target endoscope, perform defect location, defect analysis and defect classification on the necessary structure of the target endoscope, and repair the necessary structure of the target endoscope after the defect analysis and defect classification results; 2. The endoscopic defect detection method based on image analysis according to claim 1, wherein The determination of the usage arrangement of the target endoscope, the evaluation of the structural participation degree of the target endoscope based on the usage arrangement of the target endoscope, and the classification of the structure of the target endoscope after the structural participation degree evaluation are specifically as follows: Calibrate the endoscope that needs to be analyzed and diagnosed by image as the target endoscope, and obtain the usage scenario of the target endoscope; Obtain the usage instructions of the target endoscope, and based on the usage instructions of the target endoscope, obtain the structure of the target endoscope; In the usage scenario of the target endoscope, obtain the usage arrangement of the target endoscope, where the usage arrangement of the target endoscope includes the endoscope position, endoscope plan and endoscope time of the target endoscope; Obtain a big data network, and obtain the functions of different structures of the target endoscope in the user manual of the target endoscope. Combine the functions of different structures of the endoscope with the usage arrangement of the endoscope and import them into the big data network for combination. After combination, retrieve the participation degree of different structures of the target endoscope in the usage arrangement through the big data network, and calibrate it as the first participation degree; Preset the first participation degree standard threshold, judge the relationship between the first participation degree of different structures of the target endoscope and the first participation degree standard threshold, calibrate the target endoscope structure with the first participation degree greater than the first participation degree standard threshold as the necessary structure of the target endoscope, and calibrate the target endoscope structure with the first participation degree less than the first participation degree standard threshold as the non-necessary structure of the target endoscope.
3. The endoscopic defect detection method based on image analysis according to claim 1, wherein, Perform image correction and image feature extraction processing on the median-filtered contrast-qualified surface image to obtain the surface image feature data of the necessary structure of the target endoscope. Specifically: Obtain an image color temperature correction device, obtain the color temperature parameter of the median-filtered contrast-qualified surface image in the image color temperature correction device, and retrieve the color clarity of the image under different color temperature parameters when analyzing the image of the endoscope based on the big data network; Based on the color clarity of the image of the endoscope under different color temperatures when analyzing the image of the endoscope, obtain the color temperature parameter of the image of the endoscope with the highest color clarity, calibrate it as the optimal color temperature parameter, and control the image correction device to adjust the color temperature parameter of the median-filtered contrast-qualified surface image to the optimal color temperature parameter to obtain the surface image of the necessary structure of the target endoscope; Introduce an edge detection algorithm, calculate the image gradient of the surface image of the necessary structure of the target endoscope based on the edge detection algorithm, and preset the image standard gradient threshold of the surface image of the necessary structure of the target endoscope; In the surface image of the necessary structure of the target endoscope, calibrate the surface image of the necessary structure of the target endoscope with the image gradient not maintaining at the image standard gradient threshold as the background image, and calibrate the surface image of the necessary structure of the target endoscope with the image gradient maintaining at the image standard gradient threshold as the foreground image; Calculate the shape features of the foreground image in the surface image of the necessary structure of the target endoscope. Among them, the shape features include the number of pixels, the boundary length, and the geometric moment of the foreground image. According to the shape features of the foreground image, obtain the surface image feature data of the necessary structure of the target endoscope.
4. The endoscopic defect detection method based on image analysis according to claim 1, wherein Based on the surface image feature data of the necessary structure of the target endoscope, perform defect location, defect analysis, and defect classification on the necessary structure of the target endoscope, and perform defect repair on the necessary structure of the target endoscope after the defect analysis and defect classification results. Specifically: Based on the user manual of the target endoscope, obtain the structural specification parameters of the necessary structure of the target endoscope, and based on the structural specification parameters of the necessary structure of the target endoscope, obtain the standard data of the surface image features of the necessary structure of the target endoscope; Calculate the Mahalanobis distance between the surface image feature data of the necessary structure of the target endoscope and the standard data of the surface image features of the necessary structure of the target endoscope, and preset the Mahalanobis distance interval; If the Mahalanobis distance between the target endoscope necessary structure surface image feature data and the target endoscope necessary structure surface image feature standard data is maintained within the Mahalanobis distance interval, the target endoscope necessary structure is calibrated as a qualified endoscope necessary structure, and the target endoscope corresponding to the qualified endoscope necessary structure is evaluated as a qualified endoscope; If the Mahalanobis distance between the target endoscope necessary structure surface image feature data and the target endoscope necessary structure surface image feature standard data is not maintained within the Mahalanobis distance interval, the target endoscope necessary structure is calibrated as a surface defect endoscope necessary structure, and the target endoscope necessary structure surface image feature data is calibrated as feature data to be analyzed; Based on the target endoscope necessary structure surface image, a foreground image of the surface image of the surface defect endoscope necessary structure is obtained, and the foreground image is analyzed in combination with the feature data to be analyzed to locate the defect position of the surface defect endoscope necessary structure and mark it as the target defect position; Based on the feature data to be analyzed, the shape features of the foreground image of the surface image of the necessary structure of the surface defect endoscope are analyzed to obtain the surface defect depth and surface defect area of the target defect position; The surface defect depth and surface defect area of the target defect position are subjected to defect threshold analysis, and the necessary structures of the surface defect endoscope are subjected to defect classification and defect repair based on the defect threshold analysis results.
5. A method for endoscopic defect detection based on image analysis according to claim 4, characterized in that, The defect threshold analysis is performed on the surface defect depth and surface defect area of the target defect position, and defect classification and defect repair are performed on the necessary structure of the surface defect endoscope based on the defect threshold analysis result, specifically: The surface dangerous defect depth and surface dangerous defect area of the target defect position are preset. If the surface defect depth of the target defect position is greater than the surface dangerous defect depth, the target endoscope corresponding to the necessary structure of the surface defect endoscope is scrapped; If the surface defect depth of the target defect position is less than the surface dangerous defect depth, the surface defect endoscope necessary structure is calibrated as a type of repairable endoscope necessary structure; If the surface defect area of the target defect position is larger than the surface dangerous defect area, the target endoscope corresponding to the necessary structure of the surface defect endoscope is scrapped; If the surface defect area of the target defect position is smaller than the surface dangerous defect area, the surface defect endoscope necessary structure is calibrated as a Class II repairable endoscope necessary structure; Based on the big data network, the repair methods and protection methods for the target defect positions corresponding to the first type of repairable endoscope necessary structure and the second type of repairable endoscope necessary structure are retrieved and output respectively, so that the surface defect endoscope necessary structure corresponding to the target defect position is calibrated as a qualified endoscope necessary structure, and the target endoscope corresponding to the qualified endoscope necessary structure is evaluated as a qualified endoscope.
6. An endoscope defect detection system based on image analysis, characterized in that, The endoscope defect detection system includes a memory and a processor, wherein the memory stores an endoscope defect detection method program. When the endoscope defect detection method program is executed by the processor, the endoscope defect detection method as described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Full grouting sleeve defect depth detection method and system based on endoscope measurement
CN118154598A
Intelligent endoscope image feature processing method and device
CN118470481A