CN117094991A - Optical cable detection method and system based on image processing - Google Patents

Optical cable detection method and system based on image processing Download PDF

Info

Publication number
CN117094991A
CN117094991A CN202311336684.8A CN202311336684A CN117094991A CN 117094991 A CN117094991 A CN 117094991A CN 202311336684 A CN202311336684 A CN 202311336684A CN 117094991 A CN117094991 A CN 117094991A
Authority
CN
China
Prior art keywords
optical cable
image data
image
workbench
point
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311336684.8A
Other languages
Chinese (zh)
Inventor
张坤
曹帅
宋明泽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Oriental Smart Optical Network Communication Co ltd
Original Assignee
Shandong Oriental Smart Optical Network Communication Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong Oriental Smart Optical Network Communication Co ltd filed Critical Shandong Oriental Smart Optical Network Communication Co ltd
Priority to CN202311336684.8A priority Critical patent/CN117094991A/en
Publication of CN117094991A publication Critical patent/CN117094991A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0464Convolutional networks [CNN, ConvNet]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration using local operators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/40Image enhancement or restoration using histogram techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/12Edge-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/42Global feature extraction by analysis of the whole pattern, e.g. using frequency domain transformations or autocorrelation
    • G06V10/422Global feature extraction by analysis of the whole pattern, e.g. using frequency domain transformations or autocorrelation for representing the structure of the pattern or shape of an object therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/54Extraction of image or video features relating to texture
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/56Extraction of image or video features relating to colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • G01N2021/8887Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges based on image processing techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Computing Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Medical Informatics (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Molecular Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Signal Processing (AREA)
  • Chemical & Material Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Biochemistry (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)

Abstract

The invention provides an optical cable detection method and system based on image processing, and relates to the field of optical fibers, wherein the method comprises the following steps: collecting image data of the optical cable and the workbench in real time, and preprocessing the collected image data; extracting optical cable detection data according to the preprocessed image data to obtain an optical cable surface data set; constructing an optical cable defect detector according to the optical cable surface data set; and performing defect detection on the optical cable of the target workbench according to the optical cable defect detector. The invention can accurately and efficiently detect the optical cable on the workbench, does not depend on manual experience any more, and improves the efficiency of optical cable detection.

Description

Optical cable detection method and system based on image processing
Technical Field
The invention relates to the field of optical fibers, in particular to an optical cable detection method and system based on image processing.
Background
With the rapid development of optical fiber communication networks, optical cables are used as core infrastructures, the requirements on quality and reliability of the optical cables are higher and higher, and various defects such as scratches, pits, corrosion and the like can appear on the surfaces of the optical cables in the long-term use process, so that the transmission performance of the optical fibers can be reduced, and network accidents are finally caused.
Therefore, the regular and comprehensive inspection of the optical cable lines is an important measure for ensuring the stable and reliable operation of the network; however, at present, the inspection is mainly performed by means of manual visual inspection, and the detection method has the problems of low efficiency, easiness in fatigue and difficulty in detecting fine defects.
In the related art, the optical cable is usually placed on a workbench, and the optical cable is detected by experience and eyes of a worker, so that the method has the problems of large subjectivity and poor repeatability in evaluation, and is difficult to accurately detect the optical cable in a large amount.
Disclosure of Invention
The invention aims to solve the technical problem of providing an optical cable detection method and system based on image processing, which can accurately and efficiently detect the optical cable on a workbench without relying on manual experience, and improve the efficiency of optical cable detection.
In order to solve the technical problems, the technical scheme of the invention is as follows:
in a first aspect, a method for detecting an optical cable based on image processing, the method comprising:
image data of the optical cable and the workbench are collected in real time, and the collected image data is preprocessed, and the method comprises the following steps:
by the formula:denoising the acquired image data, in this case +.>For denoised image, +.>For inputting images +.>In order to getPixel value for coordinates +.>Is the offset relative to the center point (0, 0) in the Gaussian kernel matrix is +.>K is the radius of the gaussian kernel;
by the formula:the denoised image is subjected to histogram equalization, which, in this formula,for outputting the gray value of the image +.>For grey values in the input image +.>Is to apply a transformation function to each pixel value +.>The enhanced image is obtained, L is the gray level of the input image, r is the gray value of the pixel, and k is the sum of the number of pixel points in the range from 0 to r;
by the formula:improving the sharpness of the histogram equalized image, in this formula,/for the image>For high resolution images, +.>F is an SRCNN model, and W and b are weights and biases of the SRCNN model respectively;
extracting optical cable detection data according to the preprocessed image data to obtain an optical cable surface data set;
constructing an optical cable defect detector according to the optical cable surface data set;
and performing defect detection on the optical cable of the target workbench according to the optical cable defect detector.
Further, extracting optical cable detection data according to the preprocessed image data, including:
calculating color data in the image data corresponding to the optical cable and the workbench to obtain color distribution vectors of the image data corresponding to the optical cable and the workbench;
extracting brightness data in the image data corresponding to the optical cable and the workbench through a local binary mode to obtain brightness vectors in the image data corresponding to the optical cable and the workbench;
extracting direction data in the image data corresponding to the optical cable and the workbench through the gradient histogram, and obtaining direction vectors in the image data corresponding to the optical cable and the workbench;
calculating texture data in the image data corresponding to the optical cable and the workbench through the gray level co-occurrence matrix to obtain texture vectors in the image data corresponding to the optical cable and the workbench;
acquiring key area vectors in the image data corresponding to the optical cable and the workbench;
obtaining shape vectors in the image data corresponding to the optical cable and the workbench according to the edge data in the image data corresponding to the optical cable and the workbench;
and constructing a comprehensive detection vector set of the optical cable and a comprehensive detection vector set of the workbench according to the color distribution vector, the brightness vector, the direction vector, the texture vector, the key area vector and the shape vector of the image data corresponding to the optical cable and the workbench.
Further, before calculating the color data in the image data corresponding to the optical cable and the workbench, and obtaining the color distribution vector of the image data corresponding to the optical cable and the workbench, the method further comprises:
performing edge detection on the image data to obtain edge image data;
and carrying out morphological operation on the edge image data to obtain a plurality of connected areas, setting templates of the optical cable and the workbench, carrying out similarity calculation on the connected areas according to the templates of the optical cable and the workbench, and judging the connected areas as the types of the corresponding templates if the similarity is larger than a similarity threshold value to obtain image areas respectively corresponding to the optical cable and the workbench.
Further, performing edge detection on the image data to obtain edge image data, including:
by the formulaSmoothing the image data, wherein the degree of smoothing is controlled through a distribution parameter sigma of a Gaussian function, the smaller the sigma is, the higher the positioning precision of a filter is, the lower the signal-to-noise ratio is, and vice versa;
by the formula:
;/>calculating a gradient magnitude G and a gradient θ direction for each point in the image data I, wherein +.>And->Partial derivatives of point (i, j) in the x, y directions, respectively;
taking the point (i, j) as the center point of the domain, the gradient value of each point in the theta (i, j) direction in the domainComparing, namely taking the point (i, j) where the gradient value is the largest as a candidate edge point, otherwise, taking the point as a non-edge point, and obtaining a candidate edge image;
setting a high threshold Th and a low threshold Tl, detecting any point (i, j) of the obtained candidate edge points, and if the gradient value of the point (i, j) is obtainedIf > Th, then determine that this point is the edge point, if +.>< Tl, then the point is not an edge point; if Tl </>And judging whether an edge point exists in the field of the point or not, if so, judging that the point is the edge point, otherwise, judging that the point is not the edge point.
Further, constructing a cable defect detector from the cable surface dataset, comprising:
inputting and outputting the optical cable surface data set as an input layer of an optical cable defect detector into a defect type, initializing network parameters, and setting a learning rate and a training round number;
a cross entropy loss function is defined and a back propagation algorithm is used to train the cable defect detector.
Further, performing defect detection on the optical cable of the target workbench according to the optical cable defect detector, including:
k-fold cross verification is adopted on the training set, and the training effect of the optical cable defect detector is evaluated;
and inputting the acquired image data into an optical cable defect detector for detection to obtain a detection result.
In a second aspect, an optical cable detection system based on image processing includes:
the acquisition module is used for acquiring the image data of the optical cable and the workbench in real time and preprocessing the acquired image data, and comprises the following steps: by the formula:denoising the acquired image data, in this case +.>For denoised image, +.>For inputting images +.>In order to getPixel value for coordinates +.>Is the offset relative to the center point (0, 0) in the Gaussian kernel matrix is +.>Is the radius of the gaussian kernelThe method comprises the steps of carrying out a first treatment on the surface of the By the formula: />Performing histogram equalization on the denoised image, wherein in the formula, the +.>For outputting the gray value of the image +.>For grey values in the input image +.>Is to apply a transformation function to each pixel value +.>The enhanced image is obtained, L is the gray level of the input image, r is the gray value of the pixel, and k is the sum of the number of pixel points in the range from 0 to r; by the formula: />Improving the sharpness of the histogram equalized image, in this formula,/for the image>For high resolution images, +.>F is an SRCNN model, and W and b are weights and biases of the SRCNN model respectively;
the extraction module is used for extracting optical cable detection data according to the preprocessed image data to obtain an optical cable surface data set;
the construction module is used for constructing an optical cable defect detector according to the optical cable surface data set;
and the detection module is used for carrying out defect detection on the optical cable of the target workbench according to the optical cable defect detector.
In a third aspect, a computing device includes:
one or more processors;
and a storage device for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the above-described methods.
In a fourth aspect, a computer readable storage medium stores a program that when executed by a processor implements the above method.
The scheme of the invention at least comprises the following beneficial effects:
the scheme of the invention can make the details of the surface of the optical cable more obvious, fully represent the characteristics of the surface of the optical cable, is favorable for detection, can accurately position the optical cable area, avoid background interference, improve the accuracy of subsequent detection, can automatically identify complex defects, avoid manual judgment errors, can detect the optical cable on line in real time, greatly improve the detection efficiency, reduce the labor cost, realize the automatic defect detection and classification of the optical cable, provide powerful support for ensuring the quality of the optical cable, and improve the use safety of the optical cable.
Drawings
Fig. 1 is a schematic flow chart of an optical cable detection method based on image processing according to an embodiment of the present invention.
Fig. 2 is a schematic diagram of an optical cable detection system based on image processing according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As shown in fig. 1, an embodiment of the present invention proposes an optical cable detection method based on image processing, which includes:
step 1, acquiring image data of an optical cable and a workbench in real time, and preprocessing the acquired image data;
step 2, extracting optical cable detection data according to the preprocessed image data to obtain an optical cable surface data set;
step 3, constructing an optical cable defect detector according to the optical cable surface data set;
and 4, performing defect detection on the optical cable of the target workbench according to the optical cable defect detector.
More specifically, step 1, collecting image data of an optical cable and a workbench in real time, and preprocessing the collected image data, including:
step 11, through the formula:denoising the acquired image data, in this case +.>For denoised image, +.>For inputting images +.>In order to getPixel value for coordinates +.>Is the offset relative to the center point (0, 0) in the Gaussian kernel matrix is +.>K is the radius of the gaussian kernel;
step 12, by the formula:performing histogram equalization on the denoised image, wherein in the formula, the +.>For outputting the gray value of the image +.>For grey values in the input image +.>Is to apply a transformation function to each pixel value +.>The enhanced image is obtained, L is the gray level of the input image, r is the gray value of the pixel, and k is the sum of the number of pixel points in the range from 0 to r;
step 13, through the formula:improving the sharpness of the histogram equalized image, in this formula,/for the image>For high resolution images, +.>For a low resolution image, F is the srccn model, and W and b are the weight and bias of the srccn model, respectively.
In the optical cable detection method based on image processing, noise caused by illumination change, sensor noise and the like can be effectively eliminated by denoising. The Gaussian filter smoothes the image, which can effectively suppress the noise and improve the image quality. Histogram equalization may enhance image contrast such that the otherwise dull detail portions become more apparent. The purpose of enhancing contrast is achieved by stretching the pixel value distribution range. This is very helpful in improving the detectability of microscopic imperfections on the surface of the cable. The super-resolution reconstruction can further improve the resolution and definition of the image. The method can recover more detail information in the high-resolution image by learning the high-frequency detail characteristics of the image. This can make the finer minute flaw on the surface of the optical cable appear, and is more favorable for subsequent feature extraction and detection. The image preprocessing method can be used in combination, so that noise can be removed, contrast can be enhanced, and resolution can be improved. The quality of the optical cable image is improved, the surface detail is clearer and more distinguishable, the detection and the identification of the surface flaws by a subsequent algorithm are facilitated, and the detection performance is improved. The image preprocessing can also comprise operations such as cutting, rotating and the like, the surface area of the optical cable is aligned, irrelevant background areas are removed, and the efficiency of subsequent processing can be improved.
More specifically, step 2, extracting optical cable detection data according to the preprocessed image data, includes:
step 21, calculating color data in the image data corresponding to the optical cable and the workbench to obtain color distribution vectors of the image data corresponding to the optical cable and the workbench;
step 22, extracting brightness data in the image data corresponding to the optical cable and the workbench through a local binary mode to obtain brightness vectors in the image data corresponding to the optical cable and the workbench;
step 23, extracting direction data in the image data corresponding to the optical cable and the workbench through the gradient histogram, and obtaining direction vectors in the image data corresponding to the optical cable and the workbench;
step 24, calculating texture data in the image data corresponding to the optical cable and the workbench through the gray level co-occurrence matrix to obtain texture vectors in the image data corresponding to the optical cable and the workbench;
step 25, obtaining key area vectors in the image data corresponding to the optical cable and the workbench;
step 26, obtaining shape vectors in the image data corresponding to the optical cable and the workbench according to the edge data in the image data corresponding to the optical cable and the workbench;
and step 27, constructing a comprehensive detection vector set of the optical cable and a comprehensive detection vector set of the workbench according to the color distribution vector, the brightness vector, the direction vector, the texture vector, the key area vector and the shape vector of the image data corresponding to the optical cable and the workbench.
In the optical cable detection method based on image processing, which is disclosed by the embodiment of the invention, the color characteristics can reflect the conditions of the surface material, corrosion and the like of the optical cable, and are important distinguishing characteristics. Calculating the color distribution vector may result in an overall description of the cable surface color information. The brightness characteristics can reflect the concave-convex degree, scratches and the like of the surface of the optical cable through the distribution of different brightness levels. The luminance vector extracts this information. The direction characteristic uses gradient direction histogram to represent the direction distribution characteristic of the texture of the optical cable, and can be used for identifying linear flaws such as cracks, scratches and the like. The texture features are calculated based on the gray level co-occurrence matrix, and can effectively represent the texture thickness features of the material on the surface of the optical cable. The key area features can locate important parts on the surface of the optical cable for targeted local analysis. The shape features extract the profile shape of the fiber optic cable using the edge information, which can be used to locate the fiber optic cable position.
And constructing a comprehensive feature vector set, carrying out comprehensive feature description of the optical cable, and identifying various flaw conditions on the surface of the optical cable by complementing the features. Compared with the optical cable, the characteristic expression of the workbench can be obtained and used for distinguishing the optical cable from the background, and the pertinence of detection is improved. The feature extraction lays a foundation for subsequent flaw identification and classification, and improves the detection performance.
More specifically, in step 21, before calculating color data in the image data corresponding to the optical cable and the workbench, and obtaining color distribution vectors of the image data corresponding to the optical cable and the workbench, the method further includes:
step 201, performing edge detection on the image data to obtain edge image data;
step 202, morphological operation is carried out on edge image data to obtain a plurality of connected areas, templates of the optical cable and the workbench are arranged, similarity calculation is carried out on the connected areas according to the templates of the optical cable and the workbench, if the similarity is larger than a similarity threshold value, the connected areas are judged to be the types of the corresponding templates, and image areas respectively corresponding to the optical cable and the workbench are obtained.
In the optical cable detection method based on image processing, which is disclosed by the embodiment of the invention, the edge detection can effectively extract the outline information in the image and locate the boundary between the optical cable and the workbench. Edge detection algorithms such as Sobel, canny, etc. can detect edge contours of images. Morphological operations may further optimize edges, eliminate breaks, and connect boundaries. The usual expansion and corrosion can make the edges smoother and more continuous. The edge-processed image is segmented into a plurality of connected regions, each of which may correspond to a portion of a fiber optic cable or a workstation. Fiber optic cable and table templates are provided that contain typical profile information for both. And calculating the similarity between each divided region and the template, and judging the region category according to a similarity threshold value. And finally, the area corresponding to the optical cable and the workbench in the image can be positioned. The surface area of the optical cable can be accurately extracted, the background interference is avoided, and the subsequent feature extraction and detection are more targeted. And the characteristic analysis is carried out based on the positioned optical cable image, so that the detection performance can be improved, and the interference of background noise is avoided.
More specifically, step 201, performing edge detection on the image data to obtain edge image data, including:
step 2011, by the formulaSmoothing the image data, wherein the degree of smoothing is controlled through a distribution parameter sigma of a Gaussian function, the smaller the sigma is, the higher the positioning precision of a filter is, the lower the signal-to-noise ratio is, and vice versa;
step 2012, by the formula:
;/>calculating a gradient magnitude G and a gradient θ direction for each point in the image data I, wherein +.>And->Partial derivatives of point (i, j) in the x, y directions, respectively;
step 2013, taking the point (i, j) as the domain center point, and setting the gradient value of each point in the theta (i, j) direction in the domainComparing, namely taking the point (i, j) where the gradient value is the largest as a candidate edge point, otherwise, taking the point as a non-edge point, and obtaining a candidate edge image;
step 2014, setting a high threshold Th and a low threshold Tl, detecting any point (i, j) of the obtained candidate edge points, and if the gradient value of the point (i, j) is obtainedIf > Th, then determine that this point is the edge point, if +.>< Tl, then the point is not an edge point; if Tl </>And judging whether an edge point exists in the field of the point or not, if so, judging that the point is the edge point, otherwise, judging that the point is not the edge point.
In the optical cable detection method based on image processing, the smoothing process can filter image noise, and is beneficial to extracting real edges. The gaussian filter has an adjustable parameter sigma, which can control the smoothness, and balance between denoising and preserving edge information. The gradient calculation can effectively reflect the gray level change of the image and is used for detecting the edge. The Sobel operator calculates horizontal and vertical direction gradients, synthesizing edge gradients and directions. The non-maximum suppression may extract edge points and suppress non-edge points. The method has the advantages that the gradient local maximum point is reserved as the edge point, and the whole edge contour is extracted. The dual threshold detection further eliminates isolated noise and connects broken edges. The high and low threshold combination can balance the effect of extracting strong and weak edges. The main edge outline of the image can be effectively extracted, the boundary between the optical cable and the workbench can be detected, and a foundation is laid for subsequent segmentation and positioning. The sensitivity of edge extraction can be controlled by adjusting parameters and high and low thresholds, and the method is suitable for the illumination conditions of different images. The edge extraction is accurate and closed, is a key link for realizing accurate segmentation and positioning, and directly influences the effect of subsequent detection.
More specifically, step 3, constructing a cable defect detector from the cable surface dataset, includes:
step 31, taking the optical cable surface data set as an input layer of an optical cable defect detector, inputting and outputting the optical cable surface data set as a defect type, initializing network parameters, and setting a learning rate and a training round number;
step 32, defining a cross entropy loss function, and training the cable defect detector using a back propagation algorithm.
In the optical cable detection method based on image processing, the extracted optical cable surface features are used as an input layer and are transmitted into a convolutional neural network. Different types of flaws are noted as different classes of output. Network parameters such as convolution kernel size, number of convolution layers, etc. are initialized. The network structure is set appropriately. Reasonable learning rate and training round number are set. The learning rate affects the training convergence rate and the number of training rounds affects the model performance. The cross entropy loss function can evaluate the difference between the network classification output and the real label and guide the iterative optimization of the model.
The back propagation algorithm enables the network parameters to be updated according to the gradient descending direction, so that cross entropy loss is reduced, and classification effect is improved.
Through training, the model can learn the feature expression representing different flaw types, and automatic classification of complex flaws is realized. The CNN model structure has strong interpretation and good modeling effect on feature extraction and classification. Compared with manual identification, the method can greatly reduce judgment subjectivity and improve detection consistency. By means of GPU (graphic processing unit) accelerated deep learning training, the model can be optimized rapidly, and the method is suitable for different optical cable detection scenes.
More specifically, step 4, performing defect detection on the optical cable of the target workbench according to the optical cable defect detector, including:
step 41, adopting k-fold cross validation on a training set to evaluate the training effect of the optical cable defect detector;
and 42, inputting the acquired image data into an optical cable defect detector for detection to obtain a detection result.
In the optical cable detection method based on image processing, the generalization capability of the model can be evaluated through k-fold cross validation, and overfitting is avoided. Dividing the training set into k parts, taking the k parts as verification sets in turn, and finally merging the results. And calculating indexes such as precision, recall rate and the like on the verification set. This allows evaluation of the detection effect of the model. And parameter adjustment, sample addition or model structure adjustment are carried out, so that the verification index is continuously optimized, and a stable and reliable detector is obtained. And inputting the actual optical cable image into a detector, and automatically outputting the type result of the flaw. The detection flow is quick and efficient, real-time online detection can be performed, and the detection efficiency is greatly improved. The consistency of the detection result is high, the detection result is not influenced by manual experience, and the judgment subjectivity is reduced. Complex or new types of surface imperfections can be detected without human eye limitations. Inputs may be provided for subsequent processing such as flaw localization, severity assessment, and the like. By adopting the end-to-end detection system, complex step-by-step processing is avoided, and the whole technical flow is simplified.
As shown in fig. 2, an optical cable detection system based on image processing includes:
the acquisition module is used for acquiring the image data of the optical cable and the workbench in real time and preprocessing the acquired image data;
the extraction module is used for extracting optical cable detection data according to the preprocessed image data to obtain an optical cable surface data set;
the construction module is used for constructing an optical cable defect detector according to the optical cable surface data set;
and the detection module is used for carrying out defect detection on the optical cable of the target workbench according to the optical cable defect detector.
It should be noted that the apparatus is an apparatus corresponding to the above method, and all implementation manners in the above method embodiment are applicable to this embodiment, so that the same technical effects can be achieved.
Embodiments of the present invention also provide a computing device comprising: a processor, a memory storing a computer program which, when executed by the processor, performs the method as described above. All the implementation manners in the method embodiment are applicable to the embodiment, and the same technical effect can be achieved.
Embodiments of the present invention also provide a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform a method as described above. All the implementation manners in the method embodiment are applicable to the embodiment, and the same technical effect can be achieved.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk, etc.
Furthermore, it should be noted that in the apparatus and method of the present invention, it is apparent that the components or steps may be disassembled and/or assembled. Such decomposition and/or recombination should be considered as equivalent aspects of the present invention. Also, the steps of performing the series of processes described above may naturally be performed in chronological order in the order of description, but are not necessarily performed in chronological order, and some steps may be performed in parallel or independently of each other. It will be appreciated by those of ordinary skill in the art that all or any of the steps or components of the methods and apparatus of the present invention may be implemented in hardware, firmware, software, or a combination thereof in any computing device (including processors, storage media, etc.) or network of computing devices, as would be apparent to one of ordinary skill in the art after reading this description of the invention.
The object of the invention can thus also be achieved by running a program or a set of programs on any computing device. The computing device may be a well-known general purpose device. The object of the invention can thus also be achieved by merely providing a program product containing program code for implementing said method or apparatus. That is, such a program product also constitutes the present invention, and a storage medium storing such a program product also constitutes the present invention. It is apparent that the storage medium may be any known storage medium or any storage medium developed in the future. It should also be noted that in the apparatus and method of the present invention, it is apparent that the components or steps may be disassembled and/or assembled. Such decomposition and/or recombination should be considered as equivalent aspects of the present invention. The steps of executing the series of processes may naturally be executed in chronological order in the order described, but are not necessarily executed in chronological order. Some steps may be performed in parallel or independently of each other.
While the foregoing is directed to the preferred embodiments of the present invention, it will be appreciated by those skilled in the art that various modifications and adaptations can be made without departing from the principles of the present invention, and such modifications and adaptations are intended to be comprehended within the scope of the present invention.

Claims (9)

1. An optical cable detection method based on image processing, the method comprising: image data of the optical cable and the workbench are collected in real time, and the collected image data is preprocessed, and the method comprises the following steps: by the formula:the acquired image data is denoised, in this formula,for denoised image, +.>For inputting images +.>Middle->Pixel value for coordinates +.>Is the offset relative to the center point (0, 0) in the Gaussian kernel matrix is +.>K is the radius of the gaussian kernel; by the formula: />Performing histogram equalization on the denoised image, wherein in the formula, the +.>For outputting the gray value of the image +.>For grey values in the input image +.>Applying a transform function to each pixel valueThe enhanced image is obtained, L is the gray level of the input image, r is the gray value of the pixel, and k is the sum of the number of pixel points in the range from 0 to r; by the formula: />Improving the sharpness of the histogram equalized image, in this formula,/for the image>For high resolution images, +.>F is an SRCNN model, and W and b are weights and biases of the SRCNN model respectively; extracting optical cable detection data according to the preprocessed image data to obtain an optical cable surface data set; constructing an optical cable defect detector according to the optical cable surface data set; and performing defect detection on the optical cable of the target workbench according to the optical cable defect detector.
2. The image processing-based optical cable testing method of claim 1, wherein extracting optical cable testing data from the preprocessed image data comprises: calculating color data in the image data corresponding to the optical cable and the workbench to obtain color distribution vectors of the image data corresponding to the optical cable and the workbench; extracting brightness data in the image data corresponding to the optical cable and the workbench through a local binary mode to obtain brightness vectors in the image data corresponding to the optical cable and the workbench; extracting direction data in the image data corresponding to the optical cable and the workbench through the gradient histogram, and obtaining direction vectors in the image data corresponding to the optical cable and the workbench; calculating texture data in the image data corresponding to the optical cable and the workbench through the gray level co-occurrence matrix to obtain texture vectors in the image data corresponding to the optical cable and the workbench; acquiring key area vectors in the image data corresponding to the optical cable and the workbench; obtaining shape vectors in the image data corresponding to the optical cable and the workbench according to the edge data in the image data corresponding to the optical cable and the workbench; and constructing a comprehensive detection vector set of the optical cable and a comprehensive detection vector set of the workbench according to the color distribution vector, the brightness vector, the direction vector, the texture vector, the key area vector and the shape vector of the image data corresponding to the optical cable and the workbench.
3. The method for detecting an optical cable based on image processing according to claim 2, wherein before calculating color data in the image data corresponding to the optical cable and the table, obtaining color distribution vectors of the image data corresponding to the optical cable and the table, further comprising: performing edge detection on the image data to obtain edge image data; and carrying out morphological operation on the edge image data to obtain a plurality of connected areas, setting templates of the optical cable and the workbench, carrying out similarity calculation on the connected areas according to the templates of the optical cable and the workbench, and judging the connected areas as the types of the corresponding templates if the similarity is larger than a similarity threshold value to obtain image areas respectively corresponding to the optical cable and the workbench.
4. The method for detecting an optical cable based on image processing according to claim 3, wherein performing edge detection on the image data to obtain edge image data comprises: by the formulaSmoothing the image data, wherein the degree of smoothing is controlled through a distribution parameter sigma of a Gaussian function, the smaller the sigma is, the higher the positioning precision of a filter is, the lower the signal-to-noise ratio is, and vice versa; by the formula:
;/>calculating a gradient magnitude G and a gradient θ direction for each point in the image data I, wherein +.>And->Partial derivatives of point (i, j) in the x, y directions, respectively; taking the point (i, j) as the center point of the domain, the gradient value of each point in the theta (i, j) direction in the domain is +.>Comparing, namely taking the point (i, j) where the gradient value is the largest as a candidate edge point, otherwise, taking the point as a non-edge point, and obtaining a candidate edge image; setting a high threshold Th and a low threshold Tl, detecting any point (i, j) of the obtained candidate edge points, and if the gradient value of the point (i, j) is +.>If > Th, then determine that this point is the edge point, if +.>< Tl, then the point is not an edge point; if Tl </>And judging whether an edge point exists in the field of the point or not, if so, judging that the point is the edge point, otherwise, judging that the point is not the edge point.
5. The image processing based cable inspection method of claim 4, wherein constructing a cable defect detector from a cable surface dataset comprises: inputting and outputting the optical cable surface data set as an input layer of an optical cable defect detector into a defect type, initializing network parameters, and setting a learning rate and a training round number; a cross entropy loss function is defined and a back propagation algorithm is used to train the cable defect detector.
6. The image processing-based optical cable inspection method as in claim 5, wherein the performing defect inspection of the optical cable of the target stage according to the optical cable defect detector comprises: k-fold cross verification is adopted on the training set, and the training effect of the optical cable defect detector is evaluated; and inputting the acquired image data into an optical cable defect detector for detection to obtain a detection result.
7. An image processing-based fiber optic cable detection system, comprising: the acquisition module is used for acquiring the image data of the optical cable and the workbench in real time and preprocessing the acquired image data, and comprises the following steps: by the formula:the acquired image data is denoised, in this formula,for denoised image, +.>For inputting images +.>Middle->Pixel value for coordinates +.>Is the offset relative to the center point (0, 0) in the Gaussian kernel matrix is +.>K is the radius of the gaussian kernel; by the formula: />The denoised image is subjected to histogram equalization, which, in this formula,for outputting the gray value of the image +.>For grey values in the input image +.>Is to apply a transformation function to each pixel value +.>The enhanced image is obtained, L is the gray level of the input image, r is the gray value of the pixel, and k is the sum of the number of pixel points in the range from 0 to r; by the formula: />Improving the sharpness of the histogram equalized image, in this formula,/for the image>For high resolution images, +.>F is an SRCNN model, and W and b are weights and biases of the SRCNN model respectively; the extraction module is used for extracting optical cable detection data according to the preprocessed image data to obtain an optical cable surface data set; the construction module is used for constructing an optical cable defect detector according to the optical cable surface data set; and the detection module is used for carrying out defect detection on the optical cable of the target workbench according to the optical cable defect detector.
8. A computing device, comprising: one or more processors; one or more processors; storage means for storing one or more programs which when executed by the one or more processors cause the one or more processors to implement the method of any of claims 1-6.
9. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a program which, when executed by a processor, implements the method according to any of claims 1-6.
CN202311336684.8A 2023-10-17 2023-10-17 Optical cable detection method and system based on image processing Pending CN117094991A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311336684.8A CN117094991A (en) 2023-10-17 2023-10-17 Optical cable detection method and system based on image processing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311336684.8A CN117094991A (en) 2023-10-17 2023-10-17 Optical cable detection method and system based on image processing

Publications (1)

Publication Number Publication Date
CN117094991A true CN117094991A (en) 2023-11-21

Family

ID=88775634

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311336684.8A Pending CN117094991A (en) 2023-10-17 2023-10-17 Optical cable detection method and system based on image processing

Country Status (1)

Country Link
CN (1) CN117094991A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110222648A (en) * 2019-06-10 2019-09-10 国网上海市电力公司 A kind of aerial cable fault recognition method and device
CN116778174A (en) * 2023-06-26 2023-09-19 福建永信数控科技股份有限公司 Open-width type single facer control method and system
CN116777917A (en) * 2023-08-24 2023-09-19 山东东方智光网络通信有限公司 Defect detection method and system for optical cable production

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110222648A (en) * 2019-06-10 2019-09-10 国网上海市电力公司 A kind of aerial cable fault recognition method and device
CN116778174A (en) * 2023-06-26 2023-09-19 福建永信数控科技股份有限公司 Open-width type single facer control method and system
CN116777917A (en) * 2023-08-24 2023-09-19 山东东方智光网络通信有限公司 Defect detection method and system for optical cable production

Similar Documents

Publication Publication Date Title
CN114549522B (en) Textile quality detection method based on target detection
CN113989279B (en) Plastic film quality detection method based on artificial intelligence and image processing
CN110349126B (en) Convolutional neural network-based marked steel plate surface defect detection method
CN108090902B (en) Non-reference image quality objective evaluation method based on multi-scale generation countermeasure network
CN110148130B (en) Method and device for detecting part defects
CN113592845A (en) Defect detection method and device for battery coating and storage medium
CN107564002A (en) Plastic tube detection method of surface flaw, system and computer-readable recording medium
CN111507426B (en) Non-reference image quality grading evaluation method and device based on visual fusion characteristics
CN116758491B (en) Printing monitoring image analysis method and system applied to 3D printing
CN109241867B (en) Method and device for recognizing digital rock core image by adopting artificial intelligence algorithm
Zhang et al. Efficient system of cracking-detection algorithms with 1-mm 3D-surface models and performance measures
CN114926407A (en) Steel surface defect detection system based on deep learning
CN113393454A (en) Method and device for segmenting pathological target examples in biopsy tissues
CN113935666A (en) Building decoration wall tile abnormity evaluation method based on image processing
CN111783616A (en) Data-driven self-learning-based nondestructive testing method
CN117314826A (en) Performance detection method of display screen
CN116777917A (en) Defect detection method and system for optical cable production
CN116735610A (en) Steel pipe surface defect detection method based on machine vision
Zhang et al. An investigation of ramie fiber cross-section image analysis methodology based on edge-enhanced image fusion
CN117094991A (en) Optical cable detection method and system based on image processing
Liu et al. Texture smoothing quality assessment via information entropy
Zhang et al. Method of surface defect detection for agricultural machinery parts based on image recognition technology
CN117541483B (en) Structural performance evaluation method and system for diffusion plate
CN117275130B (en) Intelligent access control verification system based on face recognition
Setiawan et al. Improved Edge Detection Based on Adaptive Gaussian Smoothing in X-Ray Image

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination