Defect detection system, method, apparatus, computer equipment and readable storage medium

By designing a defect detection system and utilizing the collaborative work of transmission equipment, image acquisition equipment, control equipment, rejection equipment, and alarm equipment, automated defect detection and rejection are achieved, solving the problem of insufficient flexibility in defect detection in existing technologies and improving detection efficiency and accuracy.

CN119375237BActive Publication Date: 2026-04-21CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
Filing Date
2024-11-19
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing defect detection technologies lack flexibility. Manual inspection is limited by the human eye's ability to identify defects, while X-ray inspection cannot adapt to large-scale production lines and lacks flexibility.

Method used

Design a defect detection system, including a transmission device, an image acquisition device, a control device, a rejection device, and an alarm device. The system automatically rejects defective objects through image acquisition and defect detection, and alarms when the number of defective objects reaches a certain threshold. The system uses a transmission device to transport objects, an image acquisition device to acquire images, a control device to perform defect detection, a rejection device to reject defective objects, and an alarm device to issue an alarm.

Benefits of technology

It enables rapid removal of defective objects, improves the flexibility and timeliness of defect detection, reduces the need for manual intervention, and enhances detection efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119375237B_ABST
    Figure CN119375237B_ABST
Patent Text Reader

Abstract

This application relates to a defect detection system, method, apparatus, computer device, and readable storage medium. The system includes: a conveying device for simultaneously conveying at least one object via motion; an image acquisition device for acquiring an image of a target object located within the acquisition range of the image acquisition device on the conveying device, and transmitting the acquired object image to a control device; a control device for performing defect detection on the target object in the object image, obtaining a defect detection result for the target object, and sending a rejection command to a rejection device if the defect detection result indicates the presence of a defect; a rejection device for rejecting the target object from the conveying device in response to the rejection command, causing the target object to slide into a chute; and an alarm device for updating the number of defective objects in response to the target object sliding into the chute, and triggering an alarm when the number of defective objects reaches a threshold. This method improves the flexibility of defect detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of defect detection technology, and in particular to a defect detection system, method, apparatus, computer equipment, and readable storage medium. Background Technology

[0002] With the development of defect detection technology, it is being used in more and more scenarios. Defect detection technology is a technique used to detect defects in objects.

[0003] Currently, defect detection mainly relies on two methods: manual inspection and X-ray non-destructive testing. Manual inspection is limited by the human eye's ability to detect defects and lacks flexibility. X-ray inspection, on the other hand, has strict environmental requirements, making it unsuitable for current large-scale production lines and also insufficient in flexibility.

[0004] Therefore, there is an urgent need for a defect detection solution that can improve the flexibility of defect detection. Summary of the Invention

[0005] Therefore, it is necessary to provide a defect detection system, method, apparatus, computer equipment, and readable storage medium that can improve the flexibility of defect detection in response to the above-mentioned technical problems.

[0006] On one hand, this application provides a defect detection system, comprising: a conveying device for simultaneously conveying at least one object via motion; an image acquisition device for acquiring an image of a target object located within the acquisition range of the image acquisition device on the conveying device, and transmitting the acquired object image to a control device; a control device for performing defect detection on the target object in the object image, obtaining a defect detection result for the target object, and sending a rejection command to a rejection device if the defect detection result indicates the presence of a defect; a rejection device for rejecting the target object from the conveying device in response to the rejection command, so that the target object slides into a slide rail; and an alarm device for updating the number of defective objects in response to the target object sliding into the slide rail, and issuing an alarm when the number of defective objects reaches a threshold.

[0007] On the other hand, this application also provides a defect detection method applied to a control device in a defect detection system. The system further includes a conveying device, an image acquisition device, a rejection device, and an alarm device. The conveying device is used to simultaneously convey at least one object via motion. The image acquisition device is used to acquire images of target objects located within its acquisition range on the conveying device and transmit the acquired object images to the control device. The method includes: receiving the acquired object images; performing defect detection on the target objects in the object images to obtain a defect detection result for the target objects; and, if the defect detection result indicates the presence of a defect, sending a rejection command to the rejection device to instruct the rejection device to reject the target objects from the conveying device, causing the target objects to slide into a chute. The alarm device, in response to the target objects sliding into the chute, updates the number of defective objects and issues an alarm when the number of defective objects reaches a threshold.

[0008] On the other hand, this application also provides a defect detection device, which belongs to the control equipment of a defect detection system. The system further includes a conveying device, an image acquisition device, a rejection device, and an alarm device. The conveying device is used to simultaneously convey at least one object through movement. The image acquisition device is used to acquire images of target objects located within the acquisition range of the image acquisition device on the conveying device and transmit the acquired object images to the control device. The device includes: an image receiving module for receiving the acquired object images; a defect detection module for performing defect detection on the target objects in the object images to obtain the defect detection results of the target objects; and an instruction sending module for sending a rejection instruction to the rejection device when the defect detection result indicates the presence of a defect, so as to instruct the rejection device to reject the target objects from the conveying device, causing the target objects to slide into a slide, and causing the alarm device to update the number of defective objects in response to the target objects sliding into the slide, and to issue an alarm when the number of defective objects reaches a number threshold.

[0009] On the other hand, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described defect detection method.

[0010] On the other hand, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the above-described defect detection method.

[0011] On the other hand, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps in the above-described defect detection method.

[0012] The aforementioned defect detection system, method, apparatus, computer equipment, computer-readable storage medium, and computer program product simultaneously transmit at least one object via a transmission device. An image acquisition device acquires images of the target object located within its acquisition range on the transmission device and transmits the acquired object images to a control device. The control device performs defect detection on the target object in the object image, obtaining the defect detection result. If the defect detection result indicates the presence of a defect, a rejection command is sent to a rejection device. The rejection device, in response to the rejection command, removes the target object from the transmission device, causing it to slide into a chute. An alarm device, in response to the target object sliding into the chute, updates the number of defective objects and triggers an alarm when the number of defective objects reaches a threshold. Because a rejection command is sent to the rejection device upon the presence of a defect, defective objects can be quickly removed from the transmission device. The timely alarm response to the target object sliding into the chute and the alarm triggered when the number of defective objects reaches a threshold provide timely alerts and improve the flexibility of defect detection. Attached Figure Description

[0013] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0014] Figure 1 Here is a framework diagram of the defect detection system in some embodiments;

[0015] Figure 2 This is a flowchart illustrating the updating of the number of defective objects in some embodiments;

[0016] Figure 3 The circuit diagrams for the alarm devices in some embodiments are shown below;

[0017] Figure 4 This is a schematic diagram of the components of the defect detection system in some embodiments;

[0018] Figure 5 Here are structural diagrams of the light-shielding device in some embodiments;

[0019] Figure 6 These are schematic diagrams of the defect detection system in some embodiments;

[0020] Figure 7 This is a flowchart illustrating defect detection performed by the defect detection system in some embodiments;

[0021] Figure 8 This is a schematic diagram illustrating the working principle of the rejection device in some embodiments;

[0022] Figure 9 Here are pneumatic schematic diagrams of the removal device in some embodiments;

[0023] Figure 10 Here are flowcharts of the target detection models obtained in some embodiments;

[0024] Figure 11 Here are flowcharts of the defect detection procedures corresponding to the defect detection system in some embodiments;

[0025] Figure 12 This is a diagram showing the internal structure of a computer device in some embodiments. Detailed Implementation

[0026] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0027] This application provides a defect detection system, such as... Figure 1 As shown, the defect detection system includes: a conveying device 102, an image acquisition device 104, a control device 106, a rejection device 108, and an alarm device 110. Among them:

[0028] The conveying device 102 is used to simultaneously convey at least one object by motion.

[0029] In this context, the conveying equipment comes into contact with the object and serves as both a carrying mechanism and a traction mechanism; for example, it could be a conveyor belt.

[0030] The object can be any object, such as a device or product. The object can be a device or product applied to a vehicle, such as the top cover of a generator controller. The vehicle can be any vehicle, including passenger cars, buses, trucks, or tractor-trailers; it can be a sedan, SUV, truck, or bus; it can be a gasoline-powered vehicle or a new energy vehicle; and it can be a driverless vehicle, an autonomous vehicle, a semi-autonomous vehicle, or a non-autonomous vehicle.

[0031] Specifically, the transmission device is used to transmit objects placed on it, and the defect detection rate, i.e. the rate of defect detection, can be controlled by controlling the rate of transmission of the objects. The defect detection rate refers to the time required to detect one object.

[0032] Image acquisition device 104 is used to acquire images of target objects located within the acquisition range of the image acquisition device on the transmission device, and to transmit the acquired object images to the control device.

[0033] Specifically, the image acquisition device acquires images from the transmission device, and the image acquisition device can be any type of camera.

[0034] The control device 106 is used to perform defect detection on the target object in the object image, obtain the defect detection result of the target object, and send a rejection instruction to the rejection device if the defect detection result indicates that a defect exists.

[0035] The control device can be, but is not limited to, a smartphone, tablet, desktop computer, laptop, or server. Defect detection can be any defect in the object being detected; for example, for the top cover of a generator controller, it can detect various defects such as dents, scratches, and dirt.

[0036] Specifically, the control device is used to process the object image acquired by the image acquisition device and determine whether the object has defects. If defects are found, a rejection instruction is sent to the rejection device.

[0037] The rejection device 108 is used to reject the target object from the conveying device in response to a rejection command, so that the target object slides into the chute.

[0038] The function of the rejection device is to remove the target object from the production line, i.e., the conveyor, after receiving a rejection instruction, thereby ensuring product quality. The chute is used for objects to slide off the conveyor; for example, it could be a ramp next to the conveyor.

[0039] Alarm device 110 is used to update the number of defective objects in response to a target object sliding into the slide, and to issue an alarm when the number of defective objects reaches a threshold.

[0040] The quantity threshold can be set as needed, and can be, but is not limited to, 2, 4, or 10. There are two scenarios where a certain number of defective objects appear consecutively: first, a problem occurs in the upstream equipment of the defect detection system, causing multiple objects to show defects; second, the defect detection system itself malfunctions, mistakenly identifying objects without defects as defective. Timely alarms can alert relevant personnel to conduct inspections. The number of defective objects can refer to the number of objects with consecutive defect detection results showing defects, or it can be the total number of defective objects detected up to the current time.

[0041] In some embodiments, the alarm device includes an alarm that triggers an alarm when the number of defective objects reaches a certain threshold, thereby alerting relevant personnel to conduct an inspection. The alarm may be, but is not limited to, an audible and visual alarm, such as a buzzer.

[0042] In some embodiments, the alarm device is also used to display the number of defective objects to facilitate a clear understanding of the quantity of defective objects. For example, the alarm device also includes a display. The display is used to show the number of defective objects. The display may be, but is not limited to, a screen such as an LED (Light Emitting Diode) display or an LCD (Liquid Crystal Display) display.

[0043] In the aforementioned defect detection system, at least one object is simultaneously transmitted via a conveying device. An image acquisition device captures images of the target object within its acquisition range on the conveying device and transmits the captured object images to a control device. The control device performs defect detection on the target object in the object image, obtaining the defect detection result. If the defect detection result indicates the presence of a defect, a rejection command is sent to a rejection device. The rejection device, in response to the rejection command, removes the target object from the conveying device, causing it to slide into a chute. An alarm device, in response to the target object sliding into the chute, updates the number of defective objects and triggers an alarm when the number of defective objects reaches a threshold. Because a rejection command is sent to the rejection device upon the presence of a defect, defective objects can be quickly removed from the conveying device. The timely alarm response upon the target object sliding into the chute and the alarm triggered when the number of defective objects reaches a threshold provide timely alerts and improve the flexibility of defect detection.

[0044] In some embodiments, the alarm device includes an infrared sensor and a microcontroller; the infrared sensor is used to emit infrared light towards the slide rail, and the infrared light is reflected after being blocked by the target object as the target object slides on the slide rail; the infrared sensor is also used to receive the reflected light and modulate the reflected light to generate a modulation signal; the microcontroller is used to record the number of defective objects and update the number of defective objects upon receiving the modulation signal sent by the infrared sensor.

[0045] In this context, an object with defects can be called a defective object; therefore, if a target object has defects, then the target object is a defective object. Reflected light is the light reflected when infrared light hits the target object. The microcontroller can be, but is not limited to, a single-chip microcomputer. The microcontroller is connected to the infrared sensor to process signals from the sensor, and also to count and display the number of defective objects on a display screen. This allows for a clear understanding of the quantity of defective objects, and, upon detecting a certain number of defective objects consecutively, it controls an alarm to sound.

[0046] In some embodiments, the infrared sensor is connected to the microcontroller. The rejected object slides down a ramp. As the object slides down the ramp, it blocks the infrared light emitted by the transmitter of the infrared sensor. The infrared light is reflected and the reflected light is received by the phototube in the infrared sensor and regulated to obtain a regulation signal. The regulation signal is input to the microcontroller for counting defective objects and alarm.

[0047] In this embodiment, the number of defective objects can be recorded conveniently and accurately using an infrared sensor and a microcontroller, and the number of defective objects can be updated efficiently.

[0048] In some embodiments, the defect detection system performs defect detection according to a preset defect detection cycle, the mediation signal is the current mediation signal, and updating the number of defective objects includes: obtaining the first moment when the mediation signal was last received, and determining the second moment when the current mediation signal was received; determining the time interval between the first moment and the second moment; if the time interval is greater than the duration of the defect detection cycle, updating the number of defective objects to a preset number; if the time interval is less than or equal to the duration of the defect detection cycle, incrementing the number of defective objects.

[0049] The preset quantity is 1. The defect detection cycle is determined by the defect detection rate. The defect detection rate refers to the time required to detect one object. For example, if the defect detection rate is X seconds / object, then the defect detection cycle is X seconds, where X seconds is, for example, 1.5 seconds (s). If the time interval between two consecutive received mediation signals is less than or equal to X seconds, it indicates that two defective objects have been detected consecutively; otherwise, it indicates that the two defective objects were not detected consecutively. Incrementing the number of defective objects means incrementing the number of defective objects by 1.

[0050] In some embodiments, the microcontroller can be configured with a first mode and a second mode. The first mode does not distinguish between continuously detected defective objects; instead, it increments the defect count by 1 whenever a mediation message is received. The second mode increments the defect count by 1 only when defective objects are continuously detected, and triggers an alarm if the number of defective objects exceeds a threshold. In the second mode, the microcontroller can determine whether to trigger an alarm based on the configured mode. Figure 2 As shown, a flowchart for determining the number of defective objects is provided. Mode 0 is the first mode, and mode 1 is the second mode. n represents the number of defective objects in mode 0, m represents the number of defective objects in mode 1, 1.5s is the duration of the defect detection cycle, the signal refers to the modulation signal, and num represents the quantity threshold. The alarm device provides buttons for selecting the mode, setting the threshold, and clearing the alarm. After an alarm occurs, pressing the clear alarm button will clear the alarm.

[0051] In some embodiments, such as Figure 3The diagram shows the circuit schematic of an alarm device, including a power supply circuit, a microcontroller minimum system circuit, an infrared sensing module circuit, an LCD display circuit, a button module circuit, and a buzzer alarm circuit. In the power supply circuit, R1 represents a resistor, 1K indicates that R1 is 1KΩ (kiloohms), LED1 RED represents a red LED light-emitting diode, DC1 represents DC power supply, DC interface represents a DC power supply interface, SW represents a switch, and SW-DPDT refers to a double-pole double-throw switch (DPDT). In the minimum system circuit of a microcontroller, U1 represents the microcontroller itself, the numbers 1 to 40 represent that U1 has 40 pins, P followed by a number such as P10 represents the pin type, VCC is the voltage pin or the connected voltage, RST (Reset) represents the reset signal input, VPD (Vcc Power Down) represents the backup power input, EA (Enable Address) represents the external program memory access enable control pin, Vpp represents the on-chip EPROM programming power supply, ALE (Address Latch Enable) represents the address latch enable signal output pin, PROG (Program) represents the programming pulse input pin, TXD (Transmit Data) represents the transmit data pin, INT1 and INT0 are external interrupt pins, T0 and T1 are timer / counter pins, WR (Write) represents the write operation control pin, RD (Read) represents the read operation control pin, XTAL1 and XTAL2 represent the inverting input and output pins of the crystal oscillator circuit, PSEN (ProgramStore Enable) represents the external ROM read strobe signal, and GND (Ground) represents the ground pin. S1 represents a button, Y1 represents a crystal oscillator, C1 is a capacitor, and 30pF is the capacitance value of capacitor C1. EC1 is a capacitor. In the infrared sensor circuit, OUT represents the output terminal of the infrared sensor. In the button module, S2~S6 are buttons. In the buzzer alarm circuit, Buzzer represents the buzzer, and PNP is a transistor. In the LCD display circuit, LCD1602 is a character LCD module based on LCD technology. VO, or V0, is the LCD contrast adjustment terminal. VL is the LCD contrast adjustment terminal, RS is the register select pin, RW is the read / write signal line, EN is the enable terminal, D0~D7 are 8-bit bidirectional data lines, BL+ is the backlight positive terminal, and BL- is the backlight negative terminal.

[0052] In this embodiment, when the time interval is greater than the duration of the defect detection cycle, the number of defective objects is updated to a preset number so that counting can start again. When the time interval is less than or equal to the duration of the defect detection cycle, the number of defective objects is incremented so that the number of defective objects can be counted correctly.

[0053] In some embodiments, the system further includes a lighting device and a light-shielding device located below the image acquisition device, the light-shielding device surrounding the target object: the light-shielding device is used to block ambient light from reaching the target object within the acquisition range of the image acquisition device, the ambient light being light other than light emitted by the lighting device; the lighting device is used to illuminate the interior of the light-shielding device to illuminate the target object surrounded by the light-shielding device.

[0054] The lighting equipment serves as a light source, illuminating the interior of the darkroom to reduce interference from ambient light on the images acquired by the image acquisition equipment, thereby improving the accuracy and precision of the detection. The darkroom can also be called a darkroom. It may have one or more lighting devices, with "multiple" meaning at least two. Ambient light is light other than the light emitted by the lighting devices. The lighting equipment can be installed inside the darkroom, for example, on its side walls.

[0055] In situations where ambient light is complex, the illumination of an object is a superposition of ambient light and light emitted by the lighting equipment. Ambient light can easily interfere with the image. By using light-blocking devices, the ambient light received by the object can be reduced, thereby reducing the interference of ambient light on the image.

[0056] In some embodiments, such as Figure 4 As shown, the defect detection system can be divided into mechanical, electrical, and image detection sections. The mechanical section includes conveying equipment and rejection equipment; the rejection equipment includes relays, solenoid valves, cylinders, and air compressors. The electrical section includes power supply and alarm equipment; the power supply powers the alarm equipment. The alarm equipment includes a microcontroller, infrared sensors, alarms, and displays. The image detection section includes image acquisition equipment, lighting equipment, and control equipment; the lighting equipment includes lighting devices and light-shielding devices.

[0057] In some embodiments, the light-blocking device is fixed directly below the image acquisition device, and the light-blocking device remains relatively stationary with respect to the image acquisition device. The light-blocking device does not affect the conveying device's transport of the object. When the object moves under the image acquisition device, the light-blocking device can block at least part of the ambient light from the object; for example, when the object moves directly under the image acquisition device, the light-blocking device can completely surround the object. Figure 5The diagram illustrates the structure of a light-shielding device. This device consists of two cuboids connected by a through-hole. The length and width of the upper cuboid can be designed according to the image acquisition device; for example, the upper cuboid can completely surround the image acquisition device. The lower cuboid has two through-holes, one horizontal and one vertical. The horizontal through-hole ensures the normal passage of the conveyor belt and the object; its width should be greater than the width of the conveyor equipment (e.g., the conveyor belt), and its height should be greater than the height of the object. The vertical through-hole is used to mount the cylinder piston rod. The size of the vertical through-hole is determined based on the specific installation environment. This light-shielding device should minimize the entry of external light while meeting requirements, preventing interference with imaging and thus affecting the accuracy of the detection.

[0058] In some embodiments, the defect detection system includes Figure 6 The middle part or all of the structure may also include Figure 6 Structures not shown in the drawing include, for example, removal equipment. An ellipse represents an object; the text "No Defects" inside the ellipse indicates the object has no defects detected; the text "Defective" indicates the object has defects detected; and the text "Unknown" indicates that no defect detection result has been obtained, meaning defect detection has not yet been performed or is in progress. For example... Figure 7 As shown, it displays the relationship with Figure 6 The corresponding workflow diagram shows that, specifically, the conveyor transports objects to the light-shielding device below the image acquisition device, where lighting equipment provides illumination. The image acquisition device captures images of the objects and uploads them to the control device. After defect detection by the control device, defective objects are rejected. Infrared sensors and a microcontroller count the number of defective objects. When a certain number of end caps pass through consecutively, an alarm is triggered, causing the defect detection system to stop immediately, alerting staff to check for malfunctions. Objects without defects continue to be conveyed to the next process on the production line.

[0059] In this embodiment, since the light-shielding device can block ambient light for the object being transmitted to the image acquisition device, the object is mainly affected by the light emitted by the lighting device. This reduces the complexity of the light received by the object, reduces the interference of light on the image acquired by the image acquisition device, and improves the quality of the acquired image.

[0060] In some embodiments, the rejection device includes a relay, a solenoid valve, and a cylinder; the relay controls the solenoid valve to open or close based on a rejection command to drive the piston rod of the cylinder to move; rejecting the target object from the conveying device includes: rejecting the target object from the conveying device by the movement of the piston rod.

[0061] Specifically, the rejection equipment may also include an air compressor connected to a solenoid valve to power a cylinder piston rod. The cylinder, located next to the conveying equipment and connected to the solenoid valve, removes defective objects from the conveying equipment through the movement of the piston rod, thus achieving automatic rejection of defective objects.

[0062] In some embodiments, when a relay receives a rejection command from a control device, the relay jogs and controls the on / off state of a solenoid valve via a circuit. The solenoid valve is connected to the relay and controls the flow of gas based on electromagnetic control principles, thereby enabling the reciprocating motion of the cylinder piston rod.

[0063] like Figure 8 The diagram illustrates a principle for rejecting defective objects. The rejection device mainly consists of two parts: a circuit and a pneumatic system. The working principle is as follows: An air compressor compresses air to generate high-pressure gas, which serves as the power source. This high-pressure gas is filtered by an air processor and then flows to a solenoid valve. When a defect, such as a substandard product, is detected (image processing section), the control device sends a rejection command to a relay connected to the control device, causing the relay to jog. The relay controls the opening and closing of the solenoid valve via the circuit. The opening and closing of the solenoid valve controls the flow of high-pressure gas, thereby controlling the movement of the cylinder piston rod. When the solenoid valve is energized, it actuates, allowing high-pressure gas to enter the cylinder and push the piston rod, which pushes the object out of a conveyor system, such as a conveyor belt. When the solenoid valve is de-energized, it closes, and the high-pressure gas flows out in the reverse direction, resetting the cylinder rod. The pneumatic principle is as follows. Figure 9 As shown, 1 is an air compressor, 2 is a filter, 3 is an overflow valve, 4 is a pressure gauge, 5 is an oil mist lubricator, 6 is a throttle valve, 7 is a solenoid valve, 8 is a cylinder, and 1YA and 2YA represent the electromagnet designations used to distinguish different electromagnets.

[0064] In this embodiment, relays, solenoid valves, and cylinders can accurately remove objects from the conveying equipment, improving the efficiency and accuracy of object removal.

[0065] In some embodiments, performing defect detection on a target object in an object image to obtain a defect detection result for the target object includes: obtaining the image region where the target object is located from the object image to obtain a target object image; performing defect detection on the target object in the target object image to obtain a defect detection result; the control device is further configured to: if the defect detection result indicates the presence of a defect, obtain the location information of the defect region from the defect detection result and mark the defect region in the object image.

[0066] In this context, a defective region refers to an image area containing defects. Defective regions can be marked by outlining them with a border within the image. The border can be represented by its positional information within the image. This positional information includes the coordinates of the border's center, its length, and its height. The coordinates of the border's center are represented by (bx, by), the length by bh, and the height by bw.

[0067] Specifically, the control device can display an image of the object and show the border of the defective area within the image. The control device can also mark the defective area in a target object image, display the target object image, and show the border of the defective area within the image.

[0068] In some embodiments, the control device can input a target object image into a target detection model to obtain defect detection results. The defect detection results output by the target detection model are in the form of a vector y.

[0069]

[0070] Where c1, c2, c3, ... cn are category labels, and n corresponds to the actual number of category labels. At most one of c1, c2, c3, ... cn is 1. If Pc = 1, it means a defect was detected; if Pc = 0, it means no defect was detected. Pc = 1 if at least one of c1, c2, c3, ... cn is 1; Pc = 0 if all of c1, c2, c3, ... cn are 0.

[0071] In some embodiments, the object detection model can be a model trained using a detection model to be trained on sample images. The detection model to be trained can be a model implemented using the YOLOv5 algorithm. YOLOv5 (You Only Look Once Version 5) is a real-time object detection algorithm based on deep learning. The sample image contains a detection object. The detection object in the sample image can occupy part or all of the sample image, for example, occupying the entire sample image. The detection object in the sample image can be located at any position in the sample image, for example, in the center of the sample image. The sample image can be an image obtained by cropping an image containing a detection object; therefore, the sample image can also be called a cropped sample image.

[0072] In some embodiments, the process of training the object detection model is as follows: Figure 10As shown, the process includes: Image acquisition: Taking pictures of the defective object to obtain defective object images. Multiple pictures of the defective object can be taken to obtain multiple defective object images; Selection and cropping: Selecting clean defective object images with obvious defect features from the multiple defective object images, and then cropping the selected defective object images to obtain sample images. During cropping, the object should occupy the entire sample image as much as possible and be located within the sample image; Preprocessing and annotation: Preprocessing the sample images, such as using grayscale transformation, image sharpening, image filtering, etc., for image enhancement preprocessing. Since the objects being inspected on the actual inspection production line are moving, and for metal objects such as end caps (aluminum metal objects), they are prone to reflection, coupled with the influence of the surrounding environment, the captured images may have problems such as blurriness and unclear edge boundaries, which cannot truly reflect the characteristics of the object being measured, which is not conducive to subsequent image inspection. Therefore, by performing image enhancement preprocessing on sample images using methods such as grayscale transformation, image sharpening, and image filtering, detection accuracy can be improved, facilitating subsequent detection and improving image quality. Then, in the preprocessed sample images, defective regions are outlined and labeled using bounding boxes (which should be as small as possible). The position information of the bounding boxes in the sample image, along with the sample image itself, constitutes training samples. Objects with defects can be called defective objects. Sampling in the same way yields training samples determined based on different defective objects. Multiple training samples can constitute a dataset. Validation and image testing: The detection model to be trained is trained using the dataset to obtain a trained detection model. The trained detection model is then validated, for example, using target images containing defective objects. If the validation is successful, the trained detection model is used as the target detection model.

[0073] In some embodiments, the control device can perform defect detection based on the Python + OpenCV + YOLOv5 algorithm. For example... Figure 11The flowchart shown illustrates the defect detection process, including: ① Importing modules: This includes importing the runtime environment configuration, referencing the OpenCV library, calling functions, and accessing the serial port module. ② Setting up the serial port: This uses the serial port to send commands to the relays, primarily setting the baud rate and the commands sent. ③ Configuring parameters: This involves setting thresholds, building a parameter parser, configuring the NMS (Network Management System), and configuring interface parameters. ④ Loading the model: This loads the trained YOLOv5 model. ⑤ Setting up the device interface: This sets up the device display interface for ease of operation, naming it "Object Detection Program." ⑥ Processing input: This sets up three detection methods: image detection, camera detection, and video detection. Image detection reads images stored in files for detection; video detection reads videos stored in files and detects specified objects within the video; camera detection uses the camera to detect specified objects in the captured image. Pressing the "Close Camera" button on the interface turns off the camera and stops detection. ⑦ Display Output: After pressing any detection button on the interface, if a defect is detected, the defect will be circled with the smallest border. Functions can be called to set the border color, thickness, etc. The detection time will be displayed above the border, and functions can be called to make the set text appear above the border.

[0074] In this embodiment, the location information of the defect area is obtained from the defect detection results, and the defect area is marked on the object image, so that the specific location of the defect can be understood intuitively.

[0075] In some embodiments, a defect detection method is provided. This method is applied to a control device in the aforementioned defect detection system. The system further includes a conveying device, an image acquisition device, a rejection device, and an alarm device. The conveying device is used to simultaneously convey at least one object via motion. The image acquisition device is used to acquire images of target objects located within its acquisition range on the conveying device and transmit the acquired object images to the control device. The method includes: 1. Receiving the acquired object images; 2. Performing defect detection on the target objects in the object images to obtain defect detection results for the target objects; 3. If the defect detection result indicates the presence of a defect, sending a rejection command to the rejection device to instruct it to remove the target objects from the conveying device, causing the target objects to slide into a chute. The alarm device responds to the target objects sliding into the chute by updating the number of defective objects and triggering an alarm when the number of defective objects reaches a threshold.

[0076] The defect detection system, based on Python and OpenCV, utilizes the YOLOv5 algorithm for intelligent defect detection through various methods. It allows for customized defect severity, avoiding the one-size-fits-all approach of traditional methods. When the defect detection results indicate the presence of defects, defective objects are removed, and the number of defective objects is counted. An alarm is triggered when a certain number of defective objects are found consecutively. The streamlined process saves time across multiple steps, and the equipment used in the defect detection system is inexpensive, reducing costs for enterprises. In summary, this defect detection system and method effectively improve the accuracy, efficiency, convenience, and cost reduction of defect detection.

[0077] The YOLOv5 algorithm typically involves IOU (Intersection over Union) and Non-Maximum Suppression (NMS). IOU, as the name suggests, is the overlap ratio between the generated candidate bounding boxes and the original ground truth bounding boxes; it's the ratio of their intersection to their union. Ideally, they overlap completely, meaning the ratio is 1. The calculation formula is:

[0078]

[0079] in, Let be the area of ​​the candidate box. This represents the area of ​​the original bounding box. When the Intersection over Union (IOU) is greater than a certain threshold (e.g., 0.5), the candidate bounding box is generally considered correct. During the YOLO algorithm's operation, multiple grid cells may predict the same target object, resulting in multiple labeled bounding boxes. In this case, non-maximum suppression ratio (NMR) is used to resolve this situation. Specifically, first, remove bounding boxes whose IOU is below the threshold, select the bounding box with the highest IOU value, and then calculate the IOU with other bounding boxes. If the IOU is less than a certain threshold, such as 0.5, then remove this bounding box.

[0080] In the aforementioned defect detection method, at least one object is simultaneously transmitted via a conveying device. An image acquisition device captures images of the target object located within its acquisition range on the conveying device and transmits the captured object images to a control device. The control device performs defect detection on the target object in the object image to obtain the defect detection result. If the defect detection result indicates the presence of a defect, a rejection command is sent to a rejection device. The rejection device, in response to the rejection command, removes the target object from the conveying device, causing it to slide into a chute. An alarm device, in response to the target object sliding into the chute, updates the number of defective objects and triggers an alarm when the number of defective objects reaches a threshold. Because a rejection command is sent to the rejection device upon the defect detection result indicating the presence of a defect, defective objects can be quickly removed from the conveying device. The timely alarm response upon the target object sliding into the chute and the alarm triggered when the number of defective objects reaches a threshold provide timely alerts and improve the flexibility of defect detection.

[0081] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0082] Based on the same inventive concept, this application also provides a defect detection device for implementing the defect detection method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more defect detection device embodiments provided below can be found in the limitations of the defect detection method described above, and will not be repeated here.

[0083] In some embodiments, a defect detection device is provided. The device is a control device within a defect detection system. The system further includes a conveying device, an image acquisition device, a rejection device, and an alarm device. The conveying device is used to simultaneously convey at least one object via motion. The image acquisition device is used to acquire images of target objects located within its acquisition range on the conveying device and transmit the acquired object images to the control device. The device includes:

[0084] The image receiving module is used to receive the acquired object images.

[0085] The defect detection module is used to detect defects in target objects in an object image and obtain the defect detection results of the target objects.

[0086] The instruction sending module is used to send a rejection instruction to the rejection device when the defect detection result indicates the presence of a defect. This instruction instructs the rejection device to remove the target object from the conveyor device so that the target object slides into the slide. The alarm device then responds by updating the number of defective objects when the number of defective objects reaches a threshold.

[0087] Each module in the aforementioned defect detection device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0088] In some embodiments, a computer device is provided, which may be a control device, and its internal structure diagram may be as follows: Figure 12 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a defect detection method.

[0089] Those skilled in the art will understand that Figure 12 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0090] In some embodiments, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0091] In some embodiments, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.

[0092] In some embodiments, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0093] It should be noted that the data involved in this application (including but not limited to data used for analysis, data stored, data displayed, etc.) are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0094] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0095] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0096] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A defect detection system, characterized in that, The system includes: A conveying device for simultaneously conveying at least one object by motion; An image acquisition device is used to acquire images of target objects located within the acquisition range of the image acquisition device on the transmission device, and to transmit the acquired object images to a control device. A control device is used to perform defect detection on the target object in the object image, obtain the defect detection result of the target object, and send a rejection instruction to the rejection device if the defect detection result indicates that a defect exists. A rejection device is used to reject the target object from the conveying device in response to the rejection command, so that the target object slides into the slide rail, and infrared light is reflected after being blocked by the target object during the sliding process of the target object on the slide rail; An alarm device is used to receive the current mediation signal generated by demodulating the reflected light, determine the time interval between the last time the mediation signal was received and the time of receiving the current mediation signal, update the number of defective objects to a preset number if the time interval is greater than the duration of the defect detection cycle, increment the number of defective objects if the time interval is less than or equal to the duration of the defect detection cycle, and trigger an alarm when the number of defective objects reaches a quantity threshold.

2. The system according to claim 1, characterized in that, The alarm device includes an infrared sensor and a microcontroller; The infrared sensor is used to emit infrared light towards the slide rail; The infrared sensor is also used to receive the reflected light and modulate the reflected light to generate the current modulation signal; The microcontroller is used to record the number of defective objects and update the number of defective objects upon receiving the current mediation signal sent by the infrared sensor.

3. The system according to claim 1, characterized in that, The alarm device is also used to display the number of defective objects.

4. The system according to any one of claims 1 to 3, characterized in that, The system also includes lighting equipment and a light-shielding device located below the image acquisition device, the light-shielding device surrounding the target object: The light-blocking device is used to block ambient light from the target object within the acquisition range of the image acquisition device, wherein the ambient light is light other than the light emitted by the lighting device. The lighting device is used to illuminate the interior of the light-shielding device to illuminate the target object surrounded by the light-shielding device.

5. The system according to any one of claims 1 to 3, characterized in that, The rejection device includes a relay, a solenoid valve, and a cylinder; The relay controls the solenoid valve to open or close based on the rejection command, so as to drive the piston rod of the cylinder to move; Removing the target object from the transmission device includes: The target object is removed from the conveying device by the movement of the piston rod.

6. The system according to any one of claims 1 to 3, characterized in that, The step of performing defect detection on the target object in the object image to obtain the defect detection result of the target object includes: The image region containing the target object is obtained from the object image to obtain the target object image; Defect detection is performed on the target object in the target object image to obtain the defect detection result; The control device is also used for: If the defect detection result indicates the presence of a defect, the location information of the defect area is obtained from the defect detection result, and the defect area is marked in the object image.

7. A defect detection method, characterized in that, The system is a control device applied in a defect detection system. The system also includes a conveying device, an image acquisition device, a rejection device, and an alarm device. The conveying device is used to simultaneously convey at least one object through movement. The image acquisition device is used to acquire images of target objects located within the acquisition range of the image acquisition device on the conveying device and transmit the acquired object images to the control device. The method includes: Receive the acquired image of the object; Defect detection is performed on the target object in the object image to obtain the defect detection result of the target object; If the defect detection result indicates the presence of a defect, a rejection command is sent to the rejection device to instruct it to remove the target object from the conveying device, causing the target object to slide into the chute. During this sliding process, infrared light is reflected off the target object, and the alarm device receives the current mediation signal generated by demodulating the reflected light. The time interval between the last received mediation signal and the current received mediation signal is determined. If the time interval is greater than the defect detection cycle, the number of defective objects is updated to a preset number. If the time interval is less than or equal to the defect detection cycle, the number of defective objects is incremented, and an alarm is triggered when the number of defective objects reaches a threshold.

8. A defect detection device, characterized in that, The device belongs to the control equipment of a defect detection system. The system also includes a conveying device, an image acquisition device, a rejection device, and an alarm device. The conveying device is used to simultaneously convey at least one object via motion. The image acquisition device is used to acquire images of target objects located within its acquisition range on the conveying device and transmit the acquired object images to the control equipment. The device includes: An image receiving module is used to receive the acquired image of the object; The defect detection module is used to perform defect detection on the target object in the object image and obtain the defect detection result of the target object; The instruction sending module is used to send a rejection instruction to the rejection device when the defect detection result indicates the presence of a defect, instructing the rejection device to remove the target object from the conveying device so that the target object slides into the slide rail, causing infrared light to be reflected on the target object during its sliding process. The alarm device receives the current mediation signal generated by demodulating the reflected light, determines the time interval between the last time the mediation signal was received and the time of receiving the current mediation signal, updates the number of defective objects to a preset number if the time interval is greater than the length of the defect detection cycle, increments the number of defective objects if the time interval is less than or equal to the length of the defect detection cycle, and triggers an alarm when the number of defective objects reaches a threshold.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method described in claim 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method described in claim 7.

Citation Information

Patent Citations

  • Detection system and method for product surface defects

    CN109406533A

  • Object removing method, system and device, control equipment and storage medium

    CN118491904A

  • Silkworm cocoon image acquisition and screening system based on machine vision

    CN217180623U