Defect Detection Method, Device and Electronic Equipment for U-shaped Tube
Through deep learning models and edge blur algorithms, the U-shaped tube defects of the air conditioner external unit are identified, which solves the problems of low human eye detection efficiency and missed detection, and achieves efficient and accurate defect detection.
Patent Information
- Application Number
- CN202210821238.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-13
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2042-07-13
AI Technical Summary
In the prior art, the detection of the bottom defect of the U-shaped tube of the air conditioner external unit depends on human eye detection, and there are problems such as low efficiency, easy to detect and miss the inspection.
Deep learning method is used to train the defect detection model, obtain the image data of the U-shaped tube, and use the deep learning network model to perform defect detection. Combining the edge blur algorithm and the OPENCV contour detection algorithm, we can identify and distinguish the defect types of U-shaped tubes.
It improves the accuracy of detection, reduces misjudgment and missed detection, improves detection efficiency, and reduces manual intervention and time costs.
Smart Images

Figure CN115147386B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing, and more specifically, to a method, device, and electronic equipment for detecting defects in a U-shaped tube. Background Art
[0002] Computer vision has been applied to various industries and manufacturing industries, among which target detection is widely used in image processing, video processing and other fields. For manufacturers and users, product quality determines product sales and reputation, so product defect detection is a very important link.
[0003] The U-shaped tube inside the air conditioner's outdoor unit can develop irregularities during manufacturing, transportation, and storage, creating concave and convex defects on the fragile bottom of the tube. Using the tube with these defects can be dangerous, so it's crucial to eliminate these defects before use to ensure product quality. Currently, most industrial inspections are performed visually, requiring specialized personnel to visually inspect the bottom of the U-shaped tube. Due to the weight of the U-shaped tube, the long inspection process can lead to eye fatigue and false or missed detections of subtle defects.
[0004] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention
[0005] The embodiments of the present application provide a method, device and electronic equipment for detecting defects in a U-shaped tube, so as to at least solve the technical problems of currently using the human eye to observe the bottom of the U-shaped tube of the air conditioner outdoor unit, which has low detection efficiency and is prone to false detection and missed detection.
[0006] According to one aspect of an embodiment of the present application, a defect detection method for a U-shaped tube is provided, comprising: acquiring image data of the U-shaped tube; inputting the image data into a defect detection model for detection to obtain a detection result, wherein the defect detection model is used to detect all defective parts of the U-shaped tube; and determining defect information of a target part of the U-shaped tube from the detection result.
[0007] Optionally, the defect detection model is trained in the following manner: obtaining a sample image set of a U-shaped tube, wherein the sample image set includes sample images of defective parts of the U-shaped tube and label information indicating the defect type to which the sample image belongs; inputting the sample image set into a deep learning network model for training to obtain a defect detection model.
[0008] Optionally, before inputting the sample image set into the deep learning network model for training, the method further includes: separating the foreground and background parts of each image in the sample image set; and blurring the background part.
[0009] Optionally, defect information of a target portion of the U-shaped tube is determined from the detection results, including: obtaining the defect position of the image data indicated by the detection result, and obtaining a first position range of a side panel in the image data, wherein the side panel is a panel in the image data that has a connection relationship with the panel where the U-shaped tube is located; when the defect position is within the first position range where the side panel is located, determining that the defect type corresponding to the defect position within the first position range is a first type defect, wherein the first type defect does not belong to the defect type corresponding to the target image.
[0010] Optionally, after determining that the defect type corresponding to the defect position within the first position range is a first type defect, the method also includes: obtaining a horizontal straight line formed by connecting the first center point positions of multiple U-shaped tube bottom contours in each row of the image data; and determining the defect whose second center point position corresponding to the defect position is not on the horizontal straight line as a second type defect, wherein the second type defect does not belong to the defect type corresponding to the target image.
[0011] Optionally, after determining that the defect type corresponding to the defect position within the first position range is a first type of defect, the method also includes: obtaining a second position range of the bottom of the U-shaped tube in the image data; when the defect position is within the second position range, determining that the defect type corresponding to the defect position within the second position range is the defect type corresponding to the target image.
[0012] Optionally, after determining that the defect type corresponding to the defect position within the second position range is the defect type corresponding to the target image, the method also includes: obtaining the minimum circumscribed rectangle of the reflective area in the image data; when the short side length of the minimum circumscribed rectangle exceeds a preset length, determining that the image data is the target image.
[0013] According to another aspect of an embodiment of the present application, a defect detection device for a U-shaped tube is also provided, including: an acquisition module for acquiring image data of the U-shaped tube; a detection module for inputting the image data into a defect detection model for detection to obtain a detection result, wherein the defect detection model is used to detect all defective parts of the U-shaped tube; and a determination module for determining the defect information of the target part of the U-shaped tube from the detection result.
[0014] According to another aspect of the embodiment of the present application, an electronic device is also provided, including: a memory for storing program instructions; a processor, connected to the memory, for executing program instructions to implement the following functions: obtaining image data of a U-shaped tube; inputting the image data into a defect detection model for detection to obtain detection results, wherein the defect detection model is used to detect all defective parts of the U-shaped tube; and determining the defect information of the target part of the U-shaped tube from the detection results.
[0015] According to another aspect of the embodiment of the present application, a non-volatile storage medium is further provided, which includes a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the above-mentioned U-shaped tube defect detection method.
[0016] In an embodiment of the present application, by acquiring image data of a U-shaped tube; inputting the image data into a defect detection model for detection to obtain a detection result; and determining the defect information of a target portion of the U-shaped tube from the detection result, the purpose of improving the detection accuracy is achieved, thereby achieving the technical effect of reducing misjudgment of U-shaped tube defects, and further solving the current technical problem of using the human eye to observe the bottom of the U-shaped tube of the air conditioner outdoor unit, which has low detection efficiency and is prone to false detection and missed detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0018] Figure 1 This is a hardware structure block diagram of a computer terminal (or electronic device) for implementing a defect detection method for a U-shaped tube according to an embodiment of the present application;
[0019] Figure 2 is a flow chart of a defect detection method for a U-shaped tube according to an embodiment of the present application;
[0020] Figure 3a This is a schematic diagram of a concave-convex defect at the bottom of a U-shaped tube of an air conditioner outdoor unit, taken by a camera according to an embodiment of the present application;
[0021] Figure 3b is a flow chart of obtaining a defect detection model according to an embodiment of the present application;
[0022] Figure 4 is a flow chart for determining a first type of defect according to an embodiment of the present application;
[0023] Figure 5 is a flow chart for determining a second type of defect according to an embodiment of the present application;
[0024] Figure 6a is a flow chart of determining a defect type corresponding to a defect position as a defect type corresponding to a target image according to an embodiment of the present application;
[0025] Figure 6b This is a schematic diagram of a defect in a reflective portion of a U-shaped tube according to an embodiment of the present application;
[0026] Figure 7is a structural diagram of a defect detection device for a U-shaped tube according to an embodiment of the present application;
[0027] Figure 8 This is an overall flow chart of defect detection for a U-shaped tube according to an embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention 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 in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0030] Computer vision has been applied to various industries and manufacturing, with object detection being widely used in image processing and video processing. Product quality determines sales and reputation for manufacturers and users, making defect detection a crucial step. Currently, most industrial inspections are performed using the human eye, which results in low efficiency and a high risk of false detections and missed inspections. Using deep learning methods to detect concave and convex defects on the bottom of U-shaped tubes can mitigate the safety risks associated with these issues, while also increasing detection efficiency and reducing inspection time. This is explained in detail below.
[0031] The U-shaped tube defect detection method embodiment provided in the embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 The hardware structure block diagram of a computer terminal (or electronic device) for implementing a defect detection method for a U-shaped tube is shown. Figure 1As shown, the computer terminal 10 (or electronic device 10) may include one or more (illustrated by 102a, 102b, ..., 102n in the figure) processors (the processor may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply and / or a camera. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.
[0032] It should be noted that the one or more processors and / or other data processing circuits described above may generally be referred to herein as "data processing circuitry." The data processing circuitry may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuitry may be a single, independent processing module, or may be incorporated in whole or in part into any of the other components of the computer terminal 10 (or electronic device). As described in the embodiments of the present application, the data processing circuitry serves as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0033] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the U-shaped tube defect detection method in the embodiment of the present application. The processor executes the software programs and modules stored in the memory 104 to perform various functional applications and data processing, that is, to implement the above-mentioned U-shaped tube defect detection method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory remotely located relative to the processor, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0034] The transmission module 106 is configured to receive or transmit data via a network. A specific example of the aforementioned network may include a wireless network provided by the communications provider of the computer terminal 10. In one embodiment, the transmission module 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission module 106 may be a radio frequency (RF) module, which is configured to communicate with the Internet wirelessly.
[0035] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or electronic device).
[0036] It should be noted that, in some optional embodiments, the above Figure 1 The computer device (or electronic device) shown may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of hardware elements and software elements. Figure 1 This is merely one example of a particular embodiment and is intended to illustrate the types of components that may be present in the computer device (or electronic device) described above.
[0037] In the above operating environment, an embodiment of the present application provides an embodiment of a defect detection method for a U-shaped tube. 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.
[0038] Figure 2 Flowchart of a defect detection method for a U-shaped tube according to an embodiment of the present application. Figure 2 As shown, the method includes the following steps:
[0039] Step S202, acquiring image data of the U-shaped tube;
[0040] Step S204: input the image data into a defect detection model for detection to obtain a detection result, wherein the defect detection model is used to detect all defective parts of the U-shaped tube;
[0041] Step S206: Determine defect information of the target portion of the U-shaped tube from the detection results.
[0042] In the above steps S202 to S206, the image data of the U-shaped tube is an image with a side panel scene. The U-shaped tube can be, for example, a U-shaped tube in an air conditioner outdoor unit. A shooting device is set up in the production line, that is, a camera is set up in the air conditioner outdoor unit U-shaped tube assembly line. The camera is positioned directly above the material to be inspected and can cover the entire U-shaped tube surface field of view, so as to shoot a bird's-eye view of the material. Figure 3a As shown. Image data of an air conditioner U-shaped tube taken from a top view (top surface) using an industrial camera is obtained. The image data may or may not contain a U-shaped tube concave problem. The image data of the air conditioner U-shaped tube is processed through image preprocessing to remove most of the interference of the image background on the detection and improve the detection accuracy. The image data that has undergone image preprocessing is then input into the defect detection model for detection. The detection results are analyzed and judged, which can solve the problem of misjudgment of U-shaped tube concave and convex defects, and thus find the target image, which is the image with the U-shaped tube bottom defect, and save it to the database. This method can improve detection efficiency and reduce detection time.
[0043] In step S204 of the above-mentioned U-shaped tube defect detection method, the defect detection model is trained in the following manner: Figure 3b The method further includes the following steps:
[0044] Step S302: Acquire a set of sample images of the U-shaped tube, wherein the set of sample images includes sample images of defective portions of the U-shaped tube and label information indicating the defect type to which the sample images belong.
[0045] Step S304: input the sample image set into the deep learning network model for training to obtain a defect detection model.
[0046] In the above steps S302 to S304, the label information is a location information file of the defective part corresponding to each image in the training image set, specifically: the training image set processed by the edge blurring algorithm is data labeled, the defect type at the bottom of the U-shaped tube is determined, the labeled position is the defect at the bottom of the U-shaped tube of the air-conditioning outdoor unit, the defect at the bottom of the U-shaped tube is labeled and a label is set, wherein the labeled position, shape and size are consistent with the picture taken from the top surface looking down, and a labeling file is obtained after the labeling is completed, and then the original labeled picture and the location information file of the defective part after the labeling are input into the deep learning network model CNN-transformer for unidirectional training, that is, the training image set processed by the edge blurring algorithm and the labeling file are input into the model for training, and the output of the model is the CNN-transformer defect detection model.
[0047] The CNN in this embodiment primarily extracts local features, namely the defect characteristics at the bottom of the U-shaped tube. The Transformer primarily extracts global variables, namely the overall characteristics of the detected image, including color, texture, and shape. The network structure is connected in parallel, performing bidirectional feature extraction.
[0048] The image data of the U-shaped tube in step S202 is imported into the trained CNN-Transformer defect detection model to obtain information such as defect score, defect location, and number of defects. After the model training is completed, a rectangular frame will be rendered in the image to render the defective part, and there will be a corresponding defect score or confidence value. Specifically, after the image to be tested is imported into the trained model for testing, the defect location detected in the image to be tested will be marked with a rectangular frame, and the corresponding defect score will be obtained on the rectangular frame at the same time, that is, the trained model will automatically identify the defect area and the model will perform a defect score. The defect score can also be said to be the probability of the existence of a defect.
[0049] In the above step S304, before the sample image set is input into the deep learning network model for training, the method specifically further includes the following steps: separating the foreground and background parts of each image in the sample image set through an edge blurring algorithm, wherein the foreground is the main detection object, i.e., the U-shaped tube and the side panel area, and the background part is blurred, blurring most of the useless areas, such as the side panels, the background black area, etc., thereby removing the influence of the background on the detection results.
[0050] The defect detection model's detection results may indicate defects in the panel where the U-shaped tube resides, the side panels connected to the panel, or the bottom U-shaped tube. While the panel may contain recessed areas, these recessed areas are not considered defects. Although the edge blurring algorithm blurs the side panels, there's still a chance that circular holes in the side panels will be identified as recessed areas. Therefore, the model must identify the locations of recessed areas to eliminate misleading information.
[0051] In step S206 of the above-mentioned U-shaped tube defect detection method, the defect information of the target part of the U-shaped tube is determined from the detection results, such as Figure 4 The flowchart shown specifically includes the following steps:
[0052] Step S402: obtaining a defect position in the image data indicated by the inspection result, and obtaining a first position range of a side panel in the image data, wherein the side panel is a panel in the image data that is connected to the panel where the U-shaped tube of the air conditioner is located;
[0053] Step S404 , when the defect position is within the first position range of the edge plate, determining that the defect type corresponding to the defect position within the first position range is a first type defect, wherein the first type defect does not belong to the defect type corresponding to the target image.
[0054] In steps S402 through S404, the circular hole on the side panel is likely identified as a defect. Using the OPENCV contour detection algorithm and increasing the area threshold, a contour matching the side panel area is found. The algorithm then calculates the coordinates of all points within the side panel area. Based on the coordinates within the side panel area, the first position range of the side panel is determined. If the defect location calculated by the defect detection model falls within the side panel's coordinate range, the defect is considered a false positive, meaning a first-class defect, a side panel defect. Therefore, it is necessary to remove all false positives within the side panel's position range to eliminate interference from the circular hole on the side panel in defect detection.
[0055] In the above step S404, after determining that the defect type corresponding to the defect position within the first position range is the first type of defect, Figure 5 The method further includes the following steps:
[0056] Step S502, obtaining a horizontal straight line formed by connecting the first center points of the bottom contours of multiple U-shaped tubes in each row of the image data;
[0057] Step S504 : Determine the defect whose second center point corresponding to the defect position is not on the horizontal line as a second type of defect, wherein the second type of defect does not belong to the defect type corresponding to the target image.
[0058] In the above steps S502 to S504, since the concave parts on the panel are not defects but unique to the panel, after removing the defects on the side panels in the above steps S402 to S404, it is necessary to determine whether the defective parts are on the panel, by determining whether the center points of the defective parts are on the same horizontal line. If the center points are not on the same horizontal line, it is determined that there is a panel misjudgment defect. Removing discrete defects means removing defects on the panel, that is, the second type of defect is the air conditioner U-tube panel defect.
[0059] According to the relevant OPENCV algorithm, the center coordinates of the bottom contour of each U-shaped tube are determined. The line connecting the center coordinates of the bottom contours of the same U-shaped tube is the horizontal straight line of the defect. The OPENCV contour algorithm is used to determine whether the defect position is on the horizontal line. The left side of the contour center point is determined and connected to obtain a contour horizontal line, which means that the detection results that are not near the horizontal line are removed.
[0060] In the above step S404, after determining that the defect type corresponding to the defect position within the first position range is the first type of defect, Figure 6aThe method further includes the following steps:
[0061] Step S602, obtaining a second position range of the bottom of the U-shaped tube in the image data;
[0062] Step S604 : When the defect position is within the second position range, determine that the defect type corresponding to the defect position within the second position range is the defect type corresponding to the target image.
[0063] In the above steps S602 to S604, if the center point of the defect position is on the same horizontal line but not within the second position range of the bottom of the U-shaped tube, the defect is excluded. If the defect position is within the second position range, that is, the defect position is considered to be in the bottom contour of the U-shaped tube, then this defect is a U-shaped tube bottom defect, which is the defect type corresponding to the target image.
[0064] In the above step S604, after determining that the defect type corresponding to the defect position within the second position range is the defect type corresponding to the target image, the method specifically further includes the following steps: obtaining the minimum enclosing rectangle of the reflective area in the image data; when the short side length of the minimum enclosing rectangle exceeds the preset length, determining that the image data is the target image.
[0065] After eliminating misjudgment defects, we also need to consider whether there are misjudgment defects caused by reflection. There will be reflections at the bottom of the U-shaped tube due to the illumination of the light source. In this case, we need to judge the characteristics of the reflective area to eliminate the misjudgment of defects caused by the light spots formed by the reflection. For example Figure 6b The schematic diagram of the defect in the reflective part of the U-shaped tube is shown. The normal defect at the bottom of the U-shaped tube is streamlined. The distance from the uppermost point to the lowermost point in the streamlined spot area is 3mm-4mm. If the length exceeds 4mm, there is a concave defect, resulting in excessive upper and lower curvature.
[0066] The specific steps are as follows: first, determine the center point information of the reflective area, determine whether the total length from the center point area to the upper and lower edges of the light spot is between 3mm and 4mm, and use the relevant Opencv algorithm to obtain the minimum circumscribed rectangle of the light spot outline. If the width of the circumscribed rectangle exceeds the preset length of 4mm, it is determined that there is a defect, and the image with the defect is the target image, that is, the greater the distance from the uppermost edge point to the lowermost edge point, the larger the area of the defect depression can be determined. If a defect is determined to exist and there is an inflection point at the defective part, the smaller the angle between the tangent line from the inflection point to the highest point of the defect and the vertical line of the center point, the larger the area of the depression defect, and vice versa.
[0067] If there is a defect at the bottom of the U-shaped tube, the image encoding information of the defect is transmitted to the database, and the image with the defect is added to the training data set to expand the data volume in the data set. If the model determines that there is no defect at the bottom of the U-shaped tube or the defect does not meet the false positive condition, it will display OK.
[0068] Through the above steps, position detection and reflective curvature detection logic are applied to remove image information not located at the bottom of the U-shaped tube. These images also identify difficult-to-detect concave and convex defects in the reflective area, preventing false detection of defects. Reflective curvature detection similarly extracts the outline of the reflective area and uses an algorithm to determine the length of the minimum circumscribed rectangle of the outline, which is the length of the curvature. Determining the length of the curvature determines the reflective curvature. By setting a model training threshold and determining whether the defect location is on the horizontal line at the bottom of the U-shaped tube, it is possible to determine whether a defect exists, whether the defect at the bottom of the U-shaped tube is only on the panel but not within the contour, and whether the reflective contour at the bottom of the U-shaped tube is streamlined. This prevents defects in other locations from interfering with the overall detection, thereby increasing detection efficiency and precision and accuracy. Compared to traditional U-shaped tube bottom defect detection, this method only requires an industrial camera to capture the U-shaped tube and import the model, eliminating the need for manual intervention. This solves the labor-intensive and time-consuming issues of traditional manual inspection, while increasing accuracy and reducing inspection time. It should be noted that setting the threshold is different from the method of determining the defect location information. The threshold is the threshold of the internal function of the model. For example, if the confidence level is set to 0.6, the model after training will render the target with a rectangular box annotation only if the confidence level of the defect location is above 0.6.
[0069] Figure 7 FIG. 1 is a structural diagram of a defect detection device for a U-shaped tube according to an embodiment of the present application. Figure 7 As shown, the device includes:
[0070] An acquisition module 702 is used to acquire image data of the U-shaped tube;
[0071] The detection module 704 is used to input the image data into the defect detection model for detection to obtain a detection result, wherein the defect detection model is used to detect all defective parts of the U-shaped tube;
[0072] The determination module 706 is used to determine defect information of a target portion of the U-shaped tube from the detection results.
[0073] In the above-mentioned defect detection device for the U-shaped tube, the defect detection model is trained in the following manner: obtaining a set of sample images of the U-shaped tube, wherein the sample image set includes sample images of defective parts of the U-shaped tube and label information for indicating the defect type to which the sample image belongs; inputting the sample image set into a deep learning network model for training to obtain a defect detection model.
[0074] In the above-mentioned U-shaped tube defect detection device, before inputting the sample image set into the deep learning network model for training, the device also includes: separating the foreground and background parts of each image in the sample image set; and blurring the background part.
[0075] The determination module in the above-mentioned defect detection device for the U-shaped tube determines the defect information of the target part of the U-shaped tube from the detection results, specifically including the following process: obtaining the defect position of the image data indicated by the detection result, and obtaining the first position range of the side panel of the image data, wherein the side panel is a panel in the image data that has a connection relationship with the panel where the U-shaped tube is located; when the defect position is within the first position range where the side panel is located, determining that the defect type corresponding to the defect position within the first position range is a first type defect, wherein the first type defect does not belong to the defect type corresponding to the target image.
[0076] In the above-mentioned U-shaped tube defect detection device, after determining that the defect type corresponding to the defect position within the first position range is a first-type defect, the device also includes: obtaining a horizontal straight line formed by connecting the first center point positions of multiple U-shaped tube bottom contours in each row of the image data; and determining the defect whose second center point position corresponding to the defect position is not on the horizontal straight line as a second-type defect, wherein the second-type defect does not belong to the defect type corresponding to the target image.
[0077] In the above-mentioned U-shaped tube defect detection device, after determining that the defect type corresponding to the defect position within the first position range is a first type of defect, the device also includes: obtaining a second position range of the bottom of the U-shaped tube in the image data; when the defect position is within the second position range, determining that the defect type corresponding to the defect position within the second position range is the defect type corresponding to the target image.
[0078] In the above-mentioned U-shaped tube defect detection device, after determining that the defect type corresponding to the defect position within the second position range is the defect type corresponding to the target image, the device also includes the following process: obtaining the minimum circumscribed rectangle of the reflective area in the image data; when the short side length of the minimum circumscribed rectangle exceeds the preset length, determining that the image data is the target image.
[0079] It should be noted that Figure 7 The U-shaped tube defect detection device shown is used to perform Figure 2 The defect detection method of the U-shaped tube shown in the figure, therefore the relevant explanations in the above-mentioned defect detection method of the U-shaped tube are also applicable to the defect detection device of the U-shaped tube, and will not be repeated here.
[0080] Figure 8 This is an overall flow chart of defect detection of a U-shaped tube according to an embodiment of the present application, such as Figure 8As shown, in step 801, a camera captures a top view of the bottom of the U-shaped tube to obtain a training image set; in step 802, data enhancement is performed on the images in the training image set, including common data enhancement methods such as flipping, rotating, cropping, deformation, and scaling; in step 803, an edge blurring algorithm is used to separate the foreground and background parts of the image; in step 804, the image separated by the edge blurring algorithm is input into a deep learning network model to obtain a defect detection model; in step 805, the image to be detected is subjected to data enhancement and then input into the defect detection model to obtain a detection result; in step 806, the image to be detected is subjected to data enhancement and input into the defect detection model to obtain a detection result; If there is no defect, step 807 is performed to output and save the defect-free image to the database; step 808 is performed to determine whether the defect position is at the bottom of the U-tube. If the determination result is yes, step 809 is performed to output the number of defects and the defect position of the image to the database. If the determination result is no, step 810 is performed to determine whether the defect contours are on the same horizontal line. If the determination result is yes, step 809 is performed, otherwise step 811 is performed to determine whether the panel area defect is in the bottom contour of the U-tube. If the determination result is yes, step 809 is performed, otherwise step 807 is performed.
[0081] An embodiment of the present application also provides a non-volatile storage medium, which includes a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the following U-shaped tube defect detection method: obtaining image data of the U-shaped tube; inputting the image data into a defect detection model for detection to obtain a detection result, wherein the defect detection model is used to detect all defective parts of the U-shaped tube; and determining the defect information of the target part of the U-shaped tube from the detection result.
[0082] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0083] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0084] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0085] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0086] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0087] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0088] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for detecting defects in a U-shaped tube, characterized in that: include: Acquire image data of the U-shaped tube; Inputting the image data into a defect detection model for detection to obtain a detection result, wherein the defect detection model is used to detect all defective parts of the U-shaped tube; Determining defect information of a target portion of the U-shaped tube from the detection result includes: obtaining a defect position of the image data indicated by the detection result, and obtaining a first position range of a side panel of the image data, wherein the side panel is a panel in the image data that has a connection relationship with the panel where the U-shaped tube is located; when the defect position is within the first position range of the side panel, determining that the defect type corresponding to the defect position within the first position range is a first type of defect, wherein the first type of defect does not belong to the defect type corresponding to the target image.
2. The method according to claim 1, characterized in that The defect detection model is trained in the following way: Acquire a set of sample images of the U-shaped tube, wherein the set of sample images includes sample images of defective portions of the U-shaped tube and label information indicating defect types of the sample images; The sample image set is input into a deep learning network model for training to obtain the defect detection model.
3. The method according to claim 2, characterized in that Before inputting the sample image set into the deep learning network model for training, the method further includes: separating a foreground portion and a background portion of each image in the sample image set; The background portion is blurred.
4. The method according to claim 1, wherein After determining that the defect type corresponding to the defect position within the first position range is a first type defect, the method further includes: Acquire a horizontal straight line formed by connecting the first center point positions of the bottom contours of the multiple U-shaped tubes in each row of the image data; A defect in which the second center point corresponding to the defect position is not on the horizontal straight line is determined as a second type of defect, wherein the second type of defect does not belong to the defect type corresponding to the target image.
5. The method according to claim 4, characterized in that After determining that the defect type corresponding to the defect position within the first position range is a first type defect, the method further includes: Acquire a second position range of the bottom of the U-shaped tube in the image data; In a case where the defect position is within the second position range, the defect type corresponding to the defect position within the second position range is determined to be the defect type corresponding to the target image.
6. The method according to claim 5, characterized in that After determining that the defect type corresponding to the defect position within the second position range is the defect type corresponding to the target image, the method further includes: Obtaining a minimum circumscribed rectangle of a reflective area in the image data; When the length of the short side of the minimum circumscribed rectangle exceeds a preset length, the image data is determined to be the target image.
7. A defect detection device for a U-shaped tube, characterized in that: include: An acquisition module, used for acquiring image data of the U-shaped tube; a detection module, configured to input the image data into a defect detection model for detection to obtain a detection result, wherein the defect detection model is configured to detect all defective portions of the U-shaped tube; a determination module, configured to determine defect information of a target portion of the U-shaped tube from the detection result, comprising: obtaining a defect position of the image data indicated by the detection result, and obtaining a first position range of a side panel of the image data, wherein the side panel is a panel in the image data that is connected to the panel where the U-shaped tube is located; and, when the defect position is within the first position range of the side panel, determining that a defect type corresponding to the defect position within the first position range is a first type of defect, wherein the first type of defect does not belong to a defect type corresponding to the target image.
8. An electronic device, characterized in that: include: a memory for storing program instructions; A processor, connected to the memory, is used to execute program instructions that implement the following functions: obtaining image data of the U-shaped tube; inputting the image data into a defect detection model for detection to obtain a detection result, wherein the defect detection model is used to detect all defective parts of the U-shaped tube; determining defect information of a target part of the U-shaped tube from the detection result, including: obtaining a defect position of the image data indicated by the detection result, and obtaining a first position range of a side panel of the image data, wherein the side panel is a panel in the image data that has a connection relationship with the panel where the U-shaped tube is located; when the defect position is within the first position range of the side panel, determining that the defect type corresponding to the defect position within the first position range is a first type defect, wherein the first type defect does not belong to the defect type corresponding to the target image.
9. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored program, wherein when the program is executed, the device where the non-volatile storage medium is located is controlled to execute the U-shaped tube defect detection method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Surface defect detection method, device and system
CN114648480A