Circuit breaker defect detection method and device, storage medium and electronic equipment
By performing image acquisition and enhancement processing on the circuit breaker, combined with edge detection and support vector machine model, the automatic detection of the circuit breaker thread defect is realized, solving the problems of low detection efficiency and insufficient accuracy in the existing technology, and improving the detection efficiency and accuracy ensures the quality and safety of the circuit breaker.
Patent Information
- Application Number
- CN202411138844.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-08-19
AI Technical Summary
The existing technology has low efficiency and insufficient accuracy in the detection of circuit breaker thread defects, making it difficult to meet the demands of modern manufacturing for high efficiency and high accuracy, and there are problems of missed inspection and misjudgment, which increases production costs and may lay safety hazards. .
By performing image acquisition, image enhancement processing and edge detection on the circuit breaker, the support vector machine model is used to identify thread defects, realize automated detection, and improve detection efficiency and accuracy.
It realizes the rapid and accurate identification of the thread defects of the circuit breaker, improves detection efficiency and accuracy, reduces interference from human factors, and ensures the quality and safety of the circuit breaker.
Smart Images

Figure CN119090829A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of machine vision, and in particular to a circuit breaker defect detection method, device, storage medium and electronic equipment. Background Art
[0002] In modern industrial production, circuit breakers are an important type of electrical equipment, and the reliability of their performance is directly related to the stable operation of the power system. The threaded part of the circuit breaker, as a key structure for connection and transmission, has a quality that directly affects the service life and safety of the circuit breaker. However, the thread defect detection methods in the prior art mainly rely on manual visual inspection or simple machine vision technology, which have many shortcomings, such as low detection efficiency, low accuracy, and susceptibility to human factors. Especially under high-speed and large-scale production, the current existing detection methods can no longer meet the modern manufacturing industry's demand for high efficiency and high precision. In addition, there are problems of missed detection and misjudgment in the process of manual inspection, which not only increases production costs, but also may pose safety hazards.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present invention provide a circuit breaker defect detection method, device, storage medium and electronic device to at least solve the technical problems of slow circuit breaker thread defect detection speed and insufficient accuracy in the related art.
[0005] According to one aspect of an embodiment of the present invention, a circuit breaker defect detection method is provided, comprising: performing image acquisition on a circuit breaker to obtain an initial image, wherein the initial image includes the thread of the circuit breaker; performing image enhancement processing on the initial image to obtain a target image, wherein the distinctiveness of the initial contour line of the thread in the initial image is less than the distinctiveness of the target contour line of the thread in the target image; extracting the target contour line to obtain a first image feature, wherein the first image feature is a feature corresponding to an area in the target image where a thread defect exists, and the first image feature is different from a second image feature, and the second image feature is a feature corresponding to an area in the target image where no thread defect exists; and determining a defect recognition result of the circuit breaker based on the first image feature.
[0006] Optionally, the circuit breaker is placed on a conveyor belt, and the image acquisition of the circuit breaker to obtain an initial image includes: when the circuit breaker is conveyed to a predetermined shooting position by the conveyor belt, obtaining an occlusion signal of the circuit breaker to a photoelectric sensor at the predetermined shooting position; in response to the occlusion signal, controlling the image acquisition of the circuit breaker to obtain the initial image.
[0007] Optionally, performing image enhancement processing on the initial image to obtain a target image includes: processing the initial image by grayscale processing to obtain a first image; and processing the first image by Gaussian filtering processing to obtain a target image.
[0008] Optionally, after performing image enhancement processing on the initial image to obtain the target image, the method further includes: processing the target image by means of binarization processing to obtain a second image; in the case of multiple first pixels included in the second image, determining, for a target first pixel among the multiple first pixels, a grayscale difference between the target first pixel and other first pixels, wherein the other first pixels are first pixels among the multiple first pixels excluding the target first pixel; based on the grayscale difference, determining whether the target first pixel belongs to a thread defect area included in the target image; in the case where the target first pixel belongs to a thread defect area included in the target image, determining that the target first pixel belongs to a defective pixel set; determining whether the multiple first pixels respectively belong to the defective pixel set by determining that the target first pixel belongs to the defective pixel set; determining the defect recognition result based on the defective pixel set.
[0009] Optionally, the target contour line is extracted to determine that a thread defect area in the target image is displayed as a first image feature, including: using an edge detection algorithm to extract the target contour line to determine the grayscale values corresponding to multiple second pixels included in the target contour line; based on the grayscale values corresponding to the multiple second pixels, the first image feature is obtained.
[0010] Optionally, obtaining the first image feature based on the grayscale values corresponding to the multiple second pixels includes: using a target model to identify a change trend between the grayscale values corresponding to the second pixels, and determining the first image feature, wherein the target model is trained using a grayscale data set, the grayscale data set is obtained based on a captured image of a training circuit breaker, and the type of the circuit breaker matches the type of the training circuit breaker.
[0011] Optionally, the circuit breaker is placed on a conveyor belt, and the defect recognition result is determined based on the first image feature, including: in response to a prompt signal that the defect recognition result is a thread defect area of the circuit breaker, controlling the circuit breaker to be subjected to a jet treatment for a predetermined time so that the circuit breaker leaves the conveyor belt, wherein the predetermined time is determined based on the force characteristics of the circuit breaker.
[0012] According to another aspect of an embodiment of the present invention, a circuit breaker defect detection device is provided, comprising: an acquisition module, configured to acquire an image of a circuit breaker to obtain an initial image, wherein the initial image includes the thread of the circuit breaker; a processing module, configured to perform image enhancement processing on the initial image to obtain a target image, wherein the degree of distinction of the initial contour line of the thread in the initial image is less than the degree of distinction of the target contour line of the thread in the target image; an extraction module, configured to extract the target contour line to obtain a first image feature, wherein the first image feature is a feature corresponding to a region in the target image where a thread defect exists, and the first image feature is different from a second image feature, and the second image feature is a feature corresponding to a region in the target image where no thread defect exists; and an identification module, configured to determine a defect identification result of the circuit breaker based on the first image feature.
[0013] According to another aspect of an embodiment of the present invention, a non-volatile storage medium is provided, wherein the non-volatile storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing any one of the circuit breaker defect detection methods.
[0014] According to another aspect of an embodiment of the present invention, there is provided an electronic device, comprising: one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any one of the circuit breaker defect detection methods.
[0015] In an embodiment of the present invention, an initial image is obtained by performing image acquisition on a circuit breaker, wherein the initial image includes the thread of the circuit breaker; the initial image is subjected to image enhancement processing to obtain a target image, wherein the distinction of the initial contour line of the thread in the initial image is less than the distinction of the target contour line of the thread in the target image; the target contour line is extracted to obtain a first image feature, wherein the first image feature is a feature corresponding to an area in the target image where a thread defect exists, and the first image feature is different from the second image feature, and the second image feature is a feature corresponding to an area in the target image where no thread defect exists; based on the first image feature, a defect recognition result of the circuit breaker is determined. The purpose of automatically detecting the thread defect of the circuit breaker and improving the detection efficiency and accuracy is achieved, and the technical effect of quickly and accurately identifying the thread defect is achieved through machine vision and image processing technology, thereby solving the technical problems of slow detection speed and insufficient accuracy of the thread defect of the circuit breaker in the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0017] Figure 1 is a flow chart of an optional circuit breaker defect detection method provided according to an embodiment of the present invention;
[0018] Figure 2 is a schematic diagram of an optional circuit breaker defect detection device provided according to an embodiment of the present invention. DETAILED DESCRIPTION
[0019] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0020] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0021] For the convenience of description, some nouns or terms involved in the embodiments of the present application are explained below:
[0022] A photoelectric sensor is a device that converts light signals into electrical signals. Its working principle is based on the photoelectric effect, that is, when light shines on certain materials, it causes the excitation of electrons inside the material, thereby generating changes in current or voltage.
[0023] CDD (Charge-Coupled Device) is a technology used in image sensors. The light signal captured by each pixel is converted into a charge packet, which is gradually transmitted to the register through the shift register and finally converted into a voltage signal to form an image.
[0024] CMOS (Complementary Metal-Oxide-Semiconductor) is a technology used for image sensors. Each pixel has an amplifier and readout circuit associated with it. CMOS directly converts light signals into voltage signals at each pixel and processes them through the readout circuit.
[0025] Edge detection algorithm is an image processing technology used to identify the outline of objects in an image. The boundaries of objects are determined by analyzing the brightness changes of pixels in the image.
[0026] The STC89C52RC single-chip microcomputer is a microcontroller, belonging to the 8-unit single-chip microcomputer, which is widely used in the field of automation control for receiving signals and sending control instructions.
[0027] Open CV (Open Source Computer Vision Library, cross-platform computer vision library) is an open source computer vision and machine learning software library. It provides a large number of image and video analysis tools, which are often used in real-time image processing, facial recognition, object detection and other applications.
[0028] Gaussian filtering is an image smoothing technology that performs convolution operations on images through Gaussian functions to reduce image noise and achieve blurring effects to highlight image features.
[0029] The Hough circle detection function is an algorithm used to identify circles in an image. It determines the possible center and radius of the circle by analyzing the edge points of the image. In the Open CV library, the HoughCircles function implements this algorithm and can be used to detect circular contours in an image.
[0030] The Canny operator is an edge detection algorithm that can extract the boundaries of objects in an image and is widely used in image segmentation, feature retrieval, image analysis and other fields.
[0031] SVM (Support Vector Machine) is a supervised learning algorithm mainly used for classification and regression. It distinguishes different categories by finding the optimal boundary between data points. It can handle linear and nonlinear problems and has good generalization ability.
[0032] According to an embodiment of the present invention, a method embodiment for detecting defects in a circuit breaker is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0033] Figure 1 is a flow chart of an optional circuit breaker defect detection method according to an embodiment of the present invention, such as Figure 1 As shown, the method comprises the following steps:
[0034] Step S102, capturing an image of the circuit breaker to obtain an initial image, wherein the initial image includes the threads of the circuit breaker.
[0035] It can be understood that the acquisition of the initial image including the circuit breaker thread is the basis for the subsequent determination of whether there is a defect.
[0036] Optionally, the device for collecting the initial image is an industrial camera, which has higher image stability, transmission capability and anti-interference capability. Among them, there can be multiple types of industrial cameras, including CDD cameras and CMOS cameras. Generally, the transmission speed of industrial cameras with universal serial bus (USB) interface is relatively slow, which is difficult to meet the real-time requirements of this application. Therefore, an industrial camera with a network interface is used. This industrial camera has a fast transmission speed, which can reach more than one gigabit, and can capture a clear initial image of the circuit breaker thread within an effective range, meeting the shooting accuracy requirements.
[0037] Optionally, multiple industrial cameras are set to collect initial images of the circuit breaker at different angles, each industrial camera is connected to the computer via a switch, and each industrial camera is distinguished by configuring different URLs for the multiple industrial cameras.
[0038] Optionally, the industrial camera is greatly affected by external interference light during shooting. The present application uses a ring-shaped shadowless light source that can be fixed above the industrial camera to reduce interference from external light.
[0039] In an optional embodiment, a circuit breaker is placed on a conveyor belt, and an image of the circuit breaker is captured to obtain an initial image, including: when the circuit breaker is conveyed to a predetermined shooting position by the conveyor belt, an occlusion signal of the circuit breaker to a photoelectric sensor at the predetermined shooting position is obtained; in response to the occlusion signal, image capture of the circuit breaker is controlled to obtain an initial image.
[0040] It can be understood that a photoelectric sensor is set at a predetermined shooting position. When the circuit breaker is conveyed to the predetermined shooting position by a conveyor belt, the circuit breaker blocks the light signal emitted by the photoelectric sensor. The photoelectric sensor converts the light signal into a blocking signal. In response to the blocking signal, the circuit breaker is imaged to obtain a target image. Automatic collection of circuit breaker images is achieved.
[0041] Step S104, performing image enhancement processing on the initial image to obtain a target image, wherein the degree of distinction of the initial contour line of the thread in the initial image is smaller than the degree of distinction of the target contour line of the thread in the target image.
[0042] It can be understood that the target image is obtained by performing enhancement processing on the collected initial image, so that the contour lines of the target image are more distinct, making the subsequent edge detection and defect determination results more accurate.
[0043] It should be noted that the distinctiveness of the thread contour is the distinctiveness of the pixel values of the pixel points.
[0044] In an optional embodiment, image enhancement processing is performed on the initial image to obtain a target image, including: using a grayscale processing method to process the initial image to obtain a first image; using a Gaussian filter processing method to process the first image to obtain a target image.
[0045] It can be understood that the initial image is grayed to obtain the first image, and then the Gaussian filter is used to remove noise from the first image to obtain the target image. In the target image, the contour line of the thread has a higher contrast, which improves the visualization quality of the thread part and lays the foundation for the subsequent defect detection steps.
[0046] Optionally, grayscale processing is to convert a color or multi-channel image into a single-channel grayscale image. This is achieved by calculating the weighted red, green, and blue color channels of each pixel to obtain a single value that reflects the information of the pixel. The grayscaled first image reduces the amount of data while retaining important visual information in the original image.
[0047] Optionally, Gaussian filtering is a linear filtering technique that uses a Gaussian function to smooth an image. Gaussian filtering applies a Gaussian function around each pixel and performs a weighted average of adjacent pixels to reduce random noise in the image and retain edge information. Gaussian filtering is particularly effective in removing Gaussian noise, and due to its smoothing properties, it can make the edges of the image smoother, reduce the jagged effect, and provide a clearer target image for subsequent edge detection.
[0048] In an optional embodiment, after performing image enhancement processing on the initial image to obtain the target image, the method also includes: processing the target image by means of binarization processing to obtain a second image; in the case of multiple first pixels included in the second image, for the target first pixel in the multiple first pixels, determining the grayscale difference between the target first pixel and other first pixels, wherein the other first pixels are the first pixels in the multiple first pixels excluding the target first pixel; based on the grayscale difference, determining whether the target first pixel belongs to the thread defect area included in the target image; in the case where the target first pixel belongs to the thread defect area included in the target image, determining that the target first pixel belongs to a defective pixel set; using a method for determining that the target first pixel belongs to the defective pixel set, determining whether multiple first pixels respectively belong to the defective pixel set; and determining a defect recognition result based on the defective pixel set.
[0049] It can be understood that the target image after image enhancement is binarized, and the target image is converted into a second image containing only black and white pixels. By comparing the grayscale difference between the target first pixel and other first pixels, it is determined whether the target first pixel belongs to the area with thread defects. Once it is determined that the target first pixel belongs to the defective area, it will be included in the defective pixel set. Traverse multiple target first pixels and determine the defect recognition result based on the defective pixel set. Traverse all target first pixels in the second image, and realize the thread defect detection of the circuit breaker through pixel-level analysis. However, since the processing speed of the algorithm will be very low due to the need to traverse the entire image, it is not suitable for high-speed detection systems.
[0050] Optionally, the binarization process simplifies the image content by converting the image into a form containing only two pixel values, and a specific threshold is selected. All pixels in the target image above the threshold are marked as foreground (foreground is white), and pixels below the threshold are marked as background (background is black). In this way, the target image is highlighted in a highly contrasted form.
[0051] Step S106, extracting the target contour line to obtain a first image feature, wherein the first image feature is a feature corresponding to an area in the target image where thread defects exist, and the first image feature is different from the second image feature, and the second image feature is a feature corresponding to an area in the target image where no thread defects exist.
[0052] It can be understood that after obtaining the target image, the target contour line is further extracted to display the defective area of the thread as the first image feature. By analyzing the target image, the first image feature and the second image feature of the thread are distinguished, providing a basis for the defect recognition result.
[0053] In an optional embodiment, the target contour line is extracted to determine that a thread defect area in the target image is displayed as a first image feature, including: using an edge detection algorithm to extract the target contour line, and the grayscale values corresponding to multiple second pixels included in the target contour line; based on the grayscale values corresponding to the multiple second pixels, the first image feature is obtained.
[0054] It can be understood that the target image is processed using an edge detection algorithm to extract the target contour line of the thread and determine the grayscale values corresponding to the multiple second pixels included in the target contour line. By analyzing the grayscale values corresponding to the multiple second pixels, a set of pixels with significant differences compared to the normal area is identified, thereby determining the thread defect area. The thread defect area is displayed as a first image feature, which is different from the second image feature displayed as a region without a thread defect. The first image feature reflects the thread defect area and provides a basis for subsequent judgment and identification of thread defects.
[0055] Optionally, in the present application, the edge detection algorithm adopts the Canny operator method, which is an edge detection algorithm with high detection accuracy and robustness to noise, and its main steps include gradient calculation, non-maximum suppression, hysteresis threshold processing and edge tracking. The gradient calculation includes the calculation of gradient amplitude and direction. The gradient amplitude reflects the drastic degree of change of the pixel value of the target image and is a measure of the edge strength. The gradient component can be represented by the Sobel operator, and the calculation formula of the gradient amplitude G and direction θ is: Among them, G x and G y are the gradient components along the x and y directions, respectively. Non-maximum suppression is used to refine the edge to ensure that the edge is as thin as possible. This is achieved by comparing the gradient amplitude of the current second pixel with the adjacent second pixel, and only retaining the pixel point with the local maximum gradient amplitude. Hysteresis threshold processing is to further determine and connect the edge. A double threshold method is used. The second pixel above the high threshold is determined as a strong edge, the second pixel above the low threshold but not connected to the strong edge is ignored, and the second pixel above the low threshold and connected to the strong edge is determined as a weak edge, thereby connecting the edge fragments. By tracking the edge points, the isolated second pixels are connected into continuous edge lines to ensure the integrity and coherence of the edge.
[0056] In an optional embodiment, a first image feature is obtained based on the grayscale values corresponding to the plurality of second pixels, including: using a target model to identify a change trend between the grayscale values corresponding to the second pixels, and determining the first image feature, wherein the target model is trained using a grayscale data set, the grayscale data set is obtained based on a captured image of a training circuit breaker, and the type of the circuit breaker matches the type of the training circuit breaker.
[0057] It can be understood that grayscale data is obtained by collecting training images of circuit breakers, a target model is obtained by training using a grayscale data set, and the trained target model is used to identify the change trend between the grayscale values corresponding to the second pixel in the target image to obtain the first image feature. The first image feature obtained by the target model is the area where the thread defect exists, which can effectively identify the defective area of the circuit breaker thread.
[0058] Optionally, the target model can be a support vector machine (SVM). After receiving the target image, the support vector machine forms a gray value matrix with the gray values corresponding to the second pixel in each target image, and converts the gray value matrix into a feature column vector in an n-dimensional feature space, and inputs the obtained feature column vector into the support vector machine model as a feature. The support vector machine determines the classification hyperplane through an optimization process, which aims to maximize the interval between two types of data points. The support vector machine processes nonlinear separable data by selecting a suitable kernel function, and trains the support vector machine model through a gray data set, so that it learns how to distinguish defective and non-defective circuit breaker thread images based on the feature column vector. During the training process, only the feature vectors located on the boundary contribute to the decision function of the model, which makes the support vector machine model also have good generalization ability for high-dimensional data.
[0059] It should be noted that the training circuit breakers include multiple defective circuit breakers and multiple non-defective circuit breakers. In order to avoid being affected by external light, when collecting the target image of the training circuit breaker, an industrial camera is used in a dark box that is not affected by external light. The final grayscale data set is divided into a training set and a test set in a ratio of 4:1.
[0060] Step S108: determining a defect recognition result of the circuit breaker based on the first image feature.
[0061] It can be understood that after the target model determines the first image feature, it is determined that the circuit breaker has a defect.
[0062] In an optional embodiment, a circuit breaker is placed on a conveyor belt, and a defect recognition result is determined based on a first image feature, including: in response to a prompt signal that the defect recognition result is a thread defect area of the circuit breaker, controlling the circuit breaker to be subjected to a jet treatment for a predetermined time so that the circuit breaker leaves the conveyor belt, wherein the predetermined time is determined based on the force characteristics of the circuit breaker.
[0063] It can be understood that when the circuit breaker is placed on the conveyor belt, based on the first image feature, after determining that the circuit breaker has defects, a prompt signal is issued that the circuit breaker has a thread defect area, and the circuit breaker is subjected to a predetermined time of jet treatment so that the circuit breaker leaves the conveyor belt. This ensures that only defect-free circuit breakers can enter the next stage of the conveyor belt.
[0064] Optionally, the air pump and solenoid valve are used to perform the jet treatment for a predetermined time on the circuit breaker. The air pump is responsible for providing the necessary compressed air, and the solenoid valve controls the flow direction and opening time of the compressed air. When it is determined that the circuit breaker has a thread defect area, the microcontroller sends a rejection signal to the solenoid valve, which responds quickly and directs the compressed air to the position of the circuit breaker, effectively rejecting the defective circuit breaker.
[0065] Optionally, in the present application, data is transmitted and instructions are sent through a microcontroller, and the microcontroller may be a STC89C52RC single-chip microcomputer. The STC89C52RC single-chip microcomputer is simple and convenient to use, easy to operate, and the number of interfaces meets the requirements.
[0066] Through the above step S102, the circuit breaker is imaged to obtain an initial image, wherein the initial image includes the thread of the circuit breaker; step S104, the initial image is image enhanced to obtain a target image, wherein the distinction of the initial contour line of the thread in the initial image is less than the distinction of the target contour line of the thread in the target image; step S106, the target contour line is extracted to obtain a first image feature, wherein the first image feature is a feature corresponding to an area in the target image where a thread defect exists, and the first image feature is different from the second image feature, and the second image feature is a feature corresponding to an area in the target image where no thread defect exists; step S108, based on the first image feature, the defect recognition result of the circuit breaker is determined. The purpose of automatically detecting the thread defect of the circuit breaker and improving the detection efficiency and accuracy can be achieved, and the technical effect of quickly and accurately identifying the thread defect is achieved through machine vision and image processing technology, thereby solving the technical problems of slow detection speed and insufficient accuracy of the circuit breaker thread defect in the related art.
[0067] Based on the above embodiments and optional embodiments, the present invention proposes an optional implementation manner.
[0068] Step S1, setting a photoelectric sensor at a predetermined shooting position. When the circuit breaker is conveyed to the predetermined shooting position by a conveyor belt, the circuit breaker blocks the light signal emitted by the photoelectric sensor. The photoelectric sensor converts the light signal into a blocking signal. In response to the blocking signal, the circuit breaker is imaged to obtain a target image.
[0069] Optionally, the device for collecting the initial image is an industrial camera, which has higher image stability, transmission capability and anti-interference capability.
[0070] Step S2, performing enhancement processing on the collected initial image to obtain a target image, so that the contour lines of the target image are more distinct.
[0071] Optionally, the enhanced processing of the collected initial image includes grayscale processing and Gaussian filtering processing. Among them, grayscale processing is to convert a color or multi-channel image into a single-channel grayscale image. The grayscaled first image reduces the amount of data while retaining important visual information in the initial image. Gaussian filtering is a linear filtering technology that uses a Gaussian function to smooth an image, and due to its smoothing characteristics, it can make the edge of the image smoother and reduce the jagged effect.
[0072] Step S21, binarize the enhanced target image, convert the target image into a second image containing only black and white pixels, and judge whether the target first pixel belongs to an area with thread defects by comparing the grayscale difference between the target first pixel and other first pixels. Once it is determined that the target first pixel belongs to the defective area, it will be included in the defective pixel set. Traverse multiple target first pixels and determine the defect recognition result based on the defective pixel set. Traverse all target first pixels in the second image, and realize the thread defect detection of the circuit breaker through pixel-level analysis.
[0073] Step S3, after obtaining the target image, the target image is processed using an edge detection algorithm to extract the target contour line of the thread, and the grayscale values corresponding to the multiple second pixels included in the target contour line are determined. By analyzing the grayscale values corresponding to the multiple second pixels, a set of pixels with significant differences compared to the normal area is identified, thereby determining the thread defect area, and the thread defect area is displayed as the first image feature.
[0074] Step S4, using the trained target model, identifying the change trend between the grayscale values corresponding to the second pixel in the target image to obtain the first image feature.
[0075] Optionally, the target model may be a support vector machine (SVM). After receiving the target image, the support vector machine forms a gray value matrix with the gray values corresponding to the second pixel in each target image, and converts the gray value matrix into a feature column vector in an n-dimensional feature space, and inputs the obtained feature column vector as a feature into the support vector machine model to classify the circuit breakers with or without defects.
[0076] Step S5: after the target model determines the first image feature, it is determined that the circuit breaker has a defect, a prompt signal indicating that the circuit breaker has a thread defect area is issued, and the circuit breaker is subjected to a jetting treatment for a predetermined time so that the circuit breaker leaves the conveyor belt.
[0077] The above optional implementation method achieves at least the following effects: This application realizes accurate detection of circuit breaker thread defects by combining edge detection algorithm with support vector machine. The edge detection capability of Canny operator eliminates the interference of pseudo defects and ensures the accuracy of target image and feature vector extraction. The support vector machine is trained to achieve the ability to accurately identify whether the circuit breaker has defects. The detection speed and accuracy are improved, the interference of human factors is reduced, and defective circuit breakers are eliminated by compressed air to ensure that only circuit breakers that meet the standards can enter the next stage.
[0078] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0079] In this embodiment, a circuit breaker defect detection device is also provided, which is used to implement the above embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the terms "module" and "device" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0080] According to an embodiment of the present invention, there is also provided an apparatus embodiment for implementing a circuit breaker defect detection method. Figure 2 is a schematic diagram of an optional circuit breaker defect detection device provided according to an embodiment of the present invention, such as Figure 2 As shown, the circuit breaker defect detection device includes a collection module 202, a processing module 204, an extraction module 206, and an identification module 208. The device is described below.
[0081] The acquisition module 202 is used to acquire an image of the circuit breaker to obtain an initial image, wherein the initial image includes the threads of the circuit breaker.
[0082] The processing module 204 is connected to the acquisition module 202 and is used to perform image enhancement processing on the initial image to obtain a target image, wherein the distinction of the initial contour line of the thread in the initial image is smaller than the distinction of the target contour line of the thread in the target image.
[0083] The extraction module 206 is connected to the processing module 204 and is used to extract the target contour line and determine that the thread defect area in the target image is displayed as a first image feature, wherein the first image feature and the thread defect area is displayed as a second image feature which is different from each other.
[0084] The recognition module 208 is connected to the extraction module 206 and is used to determine a defect recognition result based on the first image feature.
[0085] In a circuit breaker defect detection device provided by an embodiment of the present invention, an acquisition module 202 is set to acquire an image of the circuit breaker to obtain an initial image, wherein the initial image includes the thread of the circuit breaker. A processing module 204 is connected to the acquisition module 202 and is used to perform image enhancement processing on the initial image to obtain a target image, wherein the distinction of the initial contour line of the thread in the initial image is less than the distinction of the target contour line of the thread in the target image. An extraction module 206 is connected to the processing module 204 and is used to extract the target contour line and determine that the region with thread defects in the target image is displayed as a first image feature, wherein the first image feature is different from the region without thread defects displayed as a second image feature. An identification module 208 is connected to the extraction module 206 and is used to determine a defect identification result based on the first image feature. The purpose of automatically detecting circuit breaker thread defects and improving detection efficiency and accuracy is achieved. Through machine vision and image processing technology, the technical effect of quickly and accurately identifying thread defects is achieved, thereby solving the technical problems of slow detection speed and insufficient accuracy of circuit breaker thread defects in related technologies.
[0086] It should be noted that the above modules can be implemented by software or hardware. For example, for the latter, it can be implemented in the following ways: the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0087] It should be noted that the acquisition module 202, the processing module 204, the extraction module 206, and the identification module 208 correspond to steps S102 to S108 in the embodiment, and the examples and application scenarios implemented by the modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above embodiment. It should be noted that the modules as part of the device can be run in a computer terminal.
[0088] It should be noted that the optional or preferred implementation of this embodiment can refer to the relevant description in the embodiment, which will not be repeated here.
[0089] The above-mentioned circuit breaker defect detection device may also include a processor and a memory. The acquisition module 202, the processing module 204, the extraction module 206, the identification module 208, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.
[0090] The processor includes a kernel, which retrieves the corresponding program unit from the memory. There can be one or more kernels. The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one storage chip.
[0091] An embodiment of the present invention provides a non-volatile storage medium on which a program is stored. When the program is executed by a processor, a circuit breaker defect detection method is implemented.
[0092] An embodiment of the present invention provides an electronic device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the following steps are implemented: performing image acquisition on a circuit breaker to obtain an initial image, wherein the initial image includes the threads of the circuit breaker; performing image enhancement processing on the initial image to obtain a target image, wherein the distinction of the initial contour line of the thread in the initial image is less than the distinction of the target contour line of the thread in the target image; extracting the target contour line to obtain a first image feature, wherein the first image feature is a feature corresponding to an area in the target image where a thread defect exists, and the first image feature is different from the second image feature, and the second image feature is a feature corresponding to an area in the target image where no thread defect exists; based on the first image feature, determining a defect recognition result of the circuit breaker. The device in this article may be a server, a PC, etc.
[0093] The present invention also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that is initialized with the following method steps: performing image acquisition on the circuit breaker to obtain an initial image, wherein the initial image includes the thread of the circuit breaker; performing image enhancement processing on the initial image to obtain a target image, wherein the distinctiveness of the initial contour line of the thread in the initial image is less than the distinctiveness of the target contour line of the thread in the target image; extracting the target contour line to obtain a first image feature, wherein the first image feature is a feature corresponding to an area in the target image where a thread defect exists, and the first image feature is different from the second image feature, and the second image feature is a feature corresponding to an area in the target image where no thread defect exists; based on the first image feature, determining a defect recognition result of the circuit breaker.
[0094] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0095] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0096] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0097] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0098] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0099] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0100] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0101] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0102] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0103] The above are only embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.
Claims
1. A circuit breaker defect detection method, characterized in that: include: Capturing an image of the circuit breaker to obtain an initial image, wherein the initial image includes the threads of the circuit breaker; Performing image enhancement processing on the initial image to obtain a target image, wherein the degree of distinction of the initial contour line of the thread in the initial image is less than the degree of distinction of the target contour line of the thread in the target image; Extracting the target contour line to obtain a first image feature, wherein the first image feature is a feature corresponding to a region in the target image where a thread defect exists, and the first image feature is different from a second image feature, and the second image feature is a feature corresponding to a region in the target image where no thread defect exists; Based on the first image feature, a defect recognition result of the circuit breaker is determined.
2. The method according to claim 1, characterized in that The circuit breaker is placed on a conveyor belt, and the image acquisition of the circuit breaker is performed to obtain an initial image, including: When the circuit breaker is conveyed to a predetermined shooting position by the conveyor belt, obtaining a shielding signal of the circuit breaker to a photoelectric sensor at the predetermined shooting position; In response to the blocking signal, image acquisition of the circuit breaker is controlled to obtain the initial image.
3. The method according to claim 1, characterized in that The performing image enhancement processing on the initial image to obtain a target image comprises: Processing the initial image in a grayscale manner to obtain a first image; The first image is processed by Gaussian filtering to obtain a target image.
4. The method according to claim 3, characterized in that After performing image enhancement processing on the initial image to obtain the target image, the method further includes: Processing the target image by binarization to obtain a second image; In the case of a plurality of first pixels included in the second image, for a target first pixel among the plurality of first pixels, determining a grayscale difference between the target first pixel and other first pixels, wherein the other first pixels are first pixels among the plurality of first pixels excluding the target first pixel; Based on the grayscale difference, determining whether the target first pixel belongs to a thread defect area included in the target image; In a case where the target first pixel belongs to a thread defect region included in the target image, determining that the target first pixel belongs to a defective pixel set; Determine whether each of the plurality of first pixels belongs to the defective pixel set by determining that the target first pixel belongs to the defective pixel set; The defect recognition result is determined based on the defective pixel set.
5. The method according to claim 1, characterized in that Extracting the target contour line and determining that a thread defect area in the target image is displayed as a first image feature includes: Using an edge detection algorithm to extract the target contour line, and determining grayscale values corresponding to a plurality of second pixels included in the target contour line; The first image feature is obtained based on the grayscale values respectively corresponding to the multiple second pixels.
6. The method according to claim 5, characterized in that The obtaining the first image feature based on the grayscale values respectively corresponding to the plurality of second pixels includes: A target model is used to identify the change trend between the grayscale values corresponding to the second pixels, and the first image feature is determined, wherein the target model is trained using a grayscale data set, the grayscale data set is obtained based on a captured image of a training circuit breaker, and the type of the circuit breaker matches the type of the training circuit breaker.
7. The method according to any one of claims 1 to 6, characterized in that: The circuit breaker is placed on a conveyor belt, and the defect recognition result is determined based on the first image feature, including: In response to a prompt signal indicating that the defect identification result is a thread defect area of the circuit breaker, the circuit breaker is controlled to be subjected to an air jet treatment for a predetermined time so that the circuit breaker leaves the conveyor belt, wherein the predetermined time is determined based on the stress characteristics of the circuit breaker.
8. A circuit breaker defect detection device, characterized in that: include: An acquisition module, used for acquiring an image of the circuit breaker to obtain an initial image, wherein the initial image includes the threads of the circuit breaker; a processing module, configured to perform image enhancement processing on the initial image to obtain a target image, wherein the degree of distinction of the initial contour line of the thread in the initial image is less than the degree of distinction of the target contour line of the thread in the target image; An extraction module extracts the target contour line to obtain a first image feature, wherein the first image feature is a feature corresponding to a region in the target image where a thread defect exists, and the first image feature is different from a second image feature, and the second image feature is a feature corresponding to a region in the target image where no thread defect exists; The recognition module determines a defect recognition result of the circuit breaker based on the first image feature.
9. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the circuit breaker defect detection method according to any one of claims 1 to 7.
10. An electronic device, characterized in that: include: One or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the circuit breaker defect detection method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Screw thread defect detection apparatus and method based on CCD camera image processing technology
CN108387516A
Defect detection method and device, electronic device and storage medium
CN110766736A
Cylindrical pot surface defect detection method and system, controller and industrial personal computer
CN114705686A
Non-contact high-voltage circuit breaker defect detection method and system
CN114757925A
Thread defect detection method and device, computing equipment and storage medium
CN115760747A
