A full-view multi-task complex defect high-speed intelligent detection method and related equipment
By employing a multi-task, all-view complex defect detection method that combines traditional image processing with deep learning dual-channel detection, high-speed, high-precision, and full-coverage intelligent detection of the 360° outer surface of industrial products is achieved. This solves the problems of blind spots and insufficient measurement accuracy in existing technologies, thereby improving detection efficiency and system stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- INST OF INTELLIGENT MFG GUANGDONG ACAD OF SCI
- Filing Date
- 2026-02-12
- Publication Date
- 2026-06-05
Smart Images

Figure CN122156102A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial visual inspection, and in particular to a high-speed intelligent inspection method and related equipment for complex defects with multiple viewing angles and tasks. Background Technology
[0002] Industrial visual inspection is a key technology for achieving online product quality control in modern intelligent manufacturing, especially crucial on production lines for rotating industrial products (such as bottle caps and cans) with stringent requirements for sealing and appearance integrity. As production lines become increasingly high-speed and flexible, higher demands are placed on inspection systems in terms of accuracy, speed, and adaptability to various product types. Achieving comprehensive, high-precision, and real-time detection of various complex defects on product surfaces has become a critical technological bottleneck that the industry urgently needs to overcome.
[0003] Currently, visual inspection technologies applied to such scenarios mainly fall into two categories: one is rule-based traditional image processing technology, which achieves defect identification by setting fixed thresholds and extracting geometric features. It boasts strong real-time performance but is sensitive to changes in lighting, making it difficult to stably detect complex defects with varying shapes (such as minor scratches and random damage), and its debugging during production changes is cumbersome. The other category is data-driven single deep learning detection technology, which can identify complex defects through model training. However, it generally suffers from high computational load and inference speeds that cannot match the pace of high-speed production lines, and its accuracy is insufficient for defect types requiring precise measurement, such as dimensions and gaps. Furthermore, some solutions attempt to simply combine the two, but a systematic and configurable fusion architecture has not yet been formed.
[0004] Existing technical solutions suffer from the following significant drawbacks: First, it is difficult to balance detection coverage and accuracy. Fixed camera layouts are prone to blind spots or edge image distortion, leading to missed detections or inaccurate measurements. Second, the system lacks flexibility. Traditional methods have fixed parameters, and deep learning models are inconvenient to replace, making it difficult to quickly adapt to the needs of multi-variety, small-batch production changes. Third, the detection logic is simplistic. When multiple defect features appear in the same area, the system is prone to generating multiple conflicting alarms, affecting sorting decision efficiency. Fourth, for rotating products prone to positional shifts, existing positioning methods lack stability, easily leading to subsequent detection reference drift. Therefore, there is an urgent need for an intelligent visual inspection solution that can balance high speed, high accuracy, strong adaptability, and high decision-making efficiency. Summary of the Invention
[0005] To address the aforementioned issues, this invention provides a high-speed intelligent detection method and related equipment for complex defects across multiple perspectives and tasks. By integrating traditional and deep learning dual-channel parallel detection, it achieves high-precision identification of complex defects.
[0006] In a first aspect, embodiments of the present invention provide a high-speed intelligent detection method for complex defects across multiple viewing angles and tasks. The method includes: simultaneously acquiring multiple surface images of an industrial product under test in its circumferential direction; the multiple surface images collectively covering a 360° outer surface area of the industrial product under test in its circumferential direction; performing image localization and geometric correction on each surface image to obtain a corresponding standard viewing angle detection image; inputting each standard viewing angle detection image in parallel into a rule-based traditional image processing detection channel and a data-driven deep learning detection channel; wherein the traditional image processing detection channel performs defect identification and quantization based on a preset image processing algorithm; the deep learning detection channel performs defect identification and classification based on a neural network model; fusing the identification results from the traditional image processing detection channel and the deep learning detection channel, and outputting a final defect judgment according to preset decision rules.
[0007] In one possible embodiment, multiple surface images of the industrial product under test are acquired simultaneously in the circumferential direction, including:
[0008] Image acquisition is performed using M industrial cameras arranged in a ring, where M is 3 or 4;
[0009] When M=3, each camera covers an area of approximately 120°; when M=4, each camera covers an area of approximately 90°.
[0010] The encoder receives the product arrival signal and simultaneously triggers all M industrial cameras to take pictures.
[0011] In one possible embodiment, for each surface image, image localization and geometric correction are performed to obtain a corresponding standard viewpoint detection image, including:
[0012] Define the region of interest in the image that contains the features of the product to be inspected;
[0013] Within the region of interest, at least two feature points are located using a pre-stored template with left-right asymmetry and a normalized correlation coefficient matching algorithm.
[0014] Based on the coordinates of the matched feature points and the preset target coordinates, solve the perspective transformation matrix;
[0015] A standard viewpoint detection image is obtained by performing a geometric transformation on the region of interest using a perspective transformation matrix.
[0016] In one possible embodiment, defect identification and quantization based on a preset image processing algorithm includes executing at least two of the following defect detection sub-algorithms in parallel:
[0017] Crack and defect detection algorithm based on background row difference;
[0018] An involute defect detection algorithm based on column-direction pixel statistics and variance analysis;
[0019] A collapse defect detection algorithm based on contour and convex hull difference analysis.
[0020] In one possible embodiment, the crack defect detection algorithm based on background row difference includes:
[0021] Extract the crack detection area from the standard viewpoint image;
[0022] Select consecutive pixels in the area to be inspected that are far from the high-incidence area of defects, calculate the pixel mean of each column to construct a background reference row, and expand the background reference row into a background image with the same size as the area to be inspected;
[0023] Calculate the difference image between the image of the region to be inspected and the background image;
[0024] The difference image is binarized, and suspected defect areas that meet the area threshold are screened out by connected component analysis.
[0025] Parameters characterizing the degree of defect are calculated based on the selected defect areas and compared with preset thresholds to complete the judgment.
[0026] In one possible embodiment, the recognition results from the traditional image processing detection channel and the deep learning detection channel are fused, and a final defect judgment is output according to a preset decision rule, including:
[0027] A weight is preset for each type of defect, where the weight of the traditional image processing detection channel result is wt, and the weight of the deep learning detection channel result is wd, and wt+wd=1 is satisfied.
[0028] For the same suspected defect, confidence scores Straditional and Sdl were obtained from two channels respectively;
[0029] Calculate the overall score using the following formula:
[0030]
[0031] Calculate the overall score and make the final decision based on the overall score.
[0032] In one possible embodiment, the method further includes:
[0033] Select and switch to the appropriate testing mode according to the specifications or quality requirements of the product to be tested. The testing modes include:
[0034] The first mode only enables the traditional image processing detection channel;
[0035] The second mode simultaneously enables both the traditional image processing detection channel and the deep learning detection channel, and fuses the results of the two.
[0036] The third mode allows for independent configuration and activation of either traditional image processing detection channels or deep learning detection channels for different defect types.
[0037] Secondly, embodiments of the present invention provide a high-speed intelligent detection device for complex defects with a full-view, multi-task approach. This device includes: a data acquisition module, a data acquisition module, an input module, and a judgment module, wherein:
[0038] The acquisition module is used to simultaneously acquire multiple surface images of the industrial product under test in the circumferential direction; the multiple surface images together cover the 360° outer surface area of the industrial product under test in the circumferential direction.
[0039] The module is used to perform image localization and geometric correction for each surface image to obtain the corresponding standard view detection image;
[0040] The input module is used to input the detection images from each standard viewpoint in parallel to the rule-based traditional image processing detection channel and the data-driven deep learning detection channel. The traditional image processing detection channel performs defect identification and quantization based on a preset image processing algorithm, while the deep learning detection channel performs defect identification and classification based on a neural network model.
[0041] The judgment module is used to fuse the recognition results from the traditional image processing detection channel and the deep learning detection channel, and output the final defect judgment according to the preset decision rules.
[0042] Thirdly, embodiments of the present invention provide a computer storage medium storing multiple instructions adapted for loading by a processor and executing the steps of the above-described method.
[0043] Fourthly, embodiments of the present invention provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being adapted to be loaded by the processor and to execute the steps of the above-described method.
[0044] The beneficial effects of the technical solutions provided by some embodiments of the present invention include at least the following: constructing an integrated technical solution of "synchronous multi-view imaging - geometric reference correction - traditional and deep learning dual-channel parallel detection - intelligent fusion decision-making", which realizes high-speed, high-precision, and full-coverage intelligent detection of 360° external surface defects of industrial products; this solution effectively solves the industry pain points in the prior art, such as the difficulty in balancing detection blind spots and measurement accuracy, the contradiction between insufficient ability to identify complex defects and real-time requirements, reference drift caused by changes in product pose, and output conflicts of multiple decision sources. Ultimately, while improving the defect detection rate and measurement accuracy, it ensures the stable operation of the system within the production cycle. Attached Figure Description
[0045] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0046] Figure 1 This is an exemplary system architecture diagram of a high-speed intelligent detection system for complex defects with a full-view, multi-task approach, provided in an embodiment of the present invention.
[0047] Figure 2 A flowchart illustrating the high-speed intelligent detection method for complex defects with a full-view, multi-task approach provided in this embodiment of the invention;
[0048] Figure 3 This is a schematic diagram of a camera layout mode provided in an embodiment of the present invention;
[0049] Figure 4 This is a structural block diagram of a high-speed intelligent detection device for complex defects with a full-view, multi-task capability, provided in an embodiment of the present invention.
[0050] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0051] To make the features and advantages of the present invention more apparent and understandable, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0052] In the following description, when referring to the accompanying drawings, the same numbers in different drawings denote the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the invention as detailed in the appended claims.
[0053] In the description of this invention, it should be understood that the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Those skilled in the art can understand the specific meaning of these terms in this invention based on the specific circumstances. Furthermore, in the description of this invention, unless otherwise stated, "multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0054] As mentioned earlier, machine vision technology is widely used in industrial automation production, especially for quality inspection of rotating industrial products such as bottle caps and cans, due to its advantages of non-contact operation and high efficiency. Current mainstream inspection solutions mainly rely on rule-based traditional image processing algorithms or data-driven single deep learning models. Traditional algorithms achieve rapid detection through preset thresholds and geometric feature extraction, but their defect recognition capabilities are rigid, with poor adaptability to defects such as changes in lighting, minor product deformations, and subtle scratches or random damage against complex texture backgrounds, resulting in high rates of missed and false detections. Furthermore, manual parameter readjustment is required when changing product models, lacking flexibility. While single deep learning models have made breakthroughs in complex defect recognition, their large size and slow inference speed make them difficult to meet the real-time requirements of high-speed production lines, and their ability to detect defects requiring sub-pixel precision, such as height and gap measurements, is weak. Existing technical solutions suffer from several core contradictions: First, achieving 360° coverage often requires increasing the number of cameras, which exacerbates image edge distortion, leading to decreased measurement accuracy and making it difficult to balance "full coverage" with "precise measurement." Secondly, traditional algorithms and deep learning models typically operate in isolation, failing to complement each other's strengths. This results in the system either sacrificing the recognition rate of complex defects at high speeds or failing to meet production cycle time in pursuit of high accuracy. Thirdly, existing positioning methods lack robustness for tilting or positional shifts that may occur during the transport of rotating products, leading to unstable detection benchmarks and directly affecting the accuracy of all subsequent detection steps. Fourthly, when multiple defect characteristics appear in the same area, the system lacks an effective decision fusion mechanism, easily generating multiple or conflicting alarms, causing problems for subsequent sorting operations.
[0055] In view of this, the present invention provides a high-speed intelligent detection method, device, computer storage medium, and electronic device for complex defects with all-view, multi-task capabilities. It aims to fundamentally ensure the globality and consistency of image acquisition through an adaptable multi-view synchronous imaging system; to significantly improve the detection rate and measurement accuracy of complex defects while ensuring high-speed processing through a dual-channel parallel and complementary fusion architecture of traditional image processing and deep learning; and to introduce robust positioning correction and intelligent decision-making mechanisms to ensure the stability of the detection process and the clarity of the results output, thereby providing a reliable and efficient all-round quality inspection solution for high-speed, flexible production lines.
[0056] Please see Figure 1 , Figure 1 This is an exemplary system architecture diagram of a high-speed intelligent detection method for complex defects from all perspectives and multiple tasks, provided in an embodiment of the present invention.
[0057] like Figure 1 As shown, the system architecture may include a terminal 101, a network 102, and a server 103. The network 102 serves as the medium for providing a communication link between the terminal 101 and the server 103. The network 102 may include various types of wired or wireless communication links, such as wired communication links including fiber optic cables, twisted-pair cables, or coaxial cables, and wireless communication links including Bluetooth communication links, wireless-Fidelity (Wi-Fi) communication links, or microwave communication links, etc.
[0058] Terminal 101 can interact with server 103 via network 102 to receive messages from or send messages to server 103. Alternatively, terminal 101 can interact with server 103 via network 102 to receive messages or data sent to server 103 by other users. Terminal 101 can be hardware or software. When terminal 101 is hardware, it can be various electronic devices, including but not limited to smartwatches, smartphones, tablets, laptops, and desktop computers. When terminal 101 is software, it can be installed in the aforementioned electronic devices and can be implemented as multiple software programs or software modules (e.g., to provide distributed services) or as a single software program or software module; no specific limitation is made here.
[0059] In this embodiment of the invention, terminal 101 can simultaneously acquire multiple surface images of the industrial product under test around its circumference; the multiple surface images collectively cover the 360° outer surface area of the industrial product under test around its circumference; for each surface image, image localization and geometric correction are performed to obtain a corresponding standard view detection image; each standard view detection image is input in parallel to a rule-based traditional image processing detection channel and a data-driven deep learning detection channel; wherein, the traditional image processing detection channel performs defect identification and quantification based on a preset image processing algorithm; the deep learning detection channel performs defect identification and classification based on a neural network model; the identification results from the traditional image processing detection channel and the deep learning detection channel are fused, and the final defect judgment is output according to the preset decision rules.
[0060] Server 103 can be a business server providing various services. It should be noted that server 103 can be either hardware or software. When server 103 is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When server 103 is software, it can be implemented as multiple software programs or software modules (e.g., used to provide distributed services), or as a single software program or software module; no specific limitations are made here.
[0061] Alternatively, the system architecture may not include server 103. In other words, server 103 may be an optional device in the embodiments of this specification. That is, the method provided in the embodiments of this specification can be applied to a system structure that only includes terminal 101. The embodiments of this invention do not limit this.
[0062] It should be understood that Figure 1 The number of terminals, networks, and servers shown is only illustrative; the number can be any number of terminals, networks, and servers depending on the implementation requirements.
[0063] Please see Figure 2 , Figure 2 This is a flowchart illustrating a high-speed intelligent detection method for complex defects with a multi-task, all-view perspective, provided in an embodiment of the present invention. The execution entity of this embodiment can be an electronic device performing high-speed intelligent detection of complex defects with a multi-task, all-view perspective, or a processor within the electronic device performing the high-speed intelligent detection method for complex defects with a multi-task, all-view perspective, or a high-speed intelligent detection service for complex defects with a multi-task, all-view perspective, or a processor within the electronic device performing the high-speed intelligent detection method .... For ease of description, the following uses a processor within an electronic device as an example to describe the specific execution process of the high-speed intelligent detection method for complex defects with a multi-task, all-view perspective, or a processor within the electronic device.
[0064] like Figure 2 As shown, a high-speed intelligent detection method for complex defects from multiple perspectives and tasks can include at least the following:
[0065] S201. Simultaneously acquire multiple surface images of the industrial product under test in the circumferential direction; the multiple surface images together cover the 360° outer surface area of the industrial product under test in the circumferential direction.
[0066] Specifically, to achieve blind-spot-free inspection of the outer surface of rotating industrial products (such as bottle caps and aluminum cans), it is essential to ensure that the entire circumferential surface is completely covered by the image. This step is achieved by constructing a multi-camera synchronous imaging system. First, the field of view of a single camera is calculated based on the diameter of the product to be inspected and the required inspection resolution. Then, M industrial area array cameras (e.g., Basler ace series cameras from Germany or Cognex In-Sight series cameras from Japan) are arranged in a ring around the product inspection station on the conveyor line, with the optical axes of all cameras approximately intersecting at the central axis of the product. The number of cameras M is at least 2 to ensure 360° coverage, preferably 3 or 4, to achieve a balance between coverage integrity and cost / processing load.
[0067] In one possible embodiment, please refer to Figure 3 , Figure 3 This is a schematic diagram of a camera layout mode provided in an embodiment of the present invention. Figure 3 As shown in (A), when M=3, mounting three cameras at 120° intervals on a rigid ring bracket is sufficient to cover the 360° inspection needs of most rotating products (such as bottle caps and medicine bottles), resulting in relatively low system complexity and data processing volume. Figure 3As shown in (B), when M=4, four cameras are installed at 90° intervals. In this layout, each camera needs to cover a narrower field of view, thus achieving higher single-image resolution for products of the same size. Alternatively, at the same resolution, lenses with shorter focal lengths and wider fields of view can be used, reducing the impact of lens edge distortion on measurement accuracy. This is particularly suitable for scenarios with extremely high requirements for printing defects on top surfaces and recognizing extremely small characters. During actual installation, the camera angles and focal lengths are fine-tuned to ensure a small overlap between the fields of view of adjacent cameras, eliminating minor blind spots that may result from installation errors. To achieve strict synchronous acquisition and avoid mismatches between images from different perspectives due to product movement, the system employs an encoder triggering mechanism. A rotary encoder is coupled to the main shaft of the conveyor line and outputs pulse signals in real time. When the photoelectric sensor (i.e., the "electric eye") installed at the entrance of the inspection station detects the arrival of a product, the industrial computer or PLC controller begins to accumulate encoder pulses. When the number of pulses reaches a preset value (corresponding to the product moving to the center of the inspection station), the controller simultaneously sends trigger signals to all M cameras. All cameras then synchronously expose within microseconds, capturing images of different sides of the product at the same moment. This collection of M images is seamlessly stitched together spatially, forming a complete image of the product's 360° outer surface. A circular layout ensures complete spatial coverage, while synchronous encoder triggering ensures consistency in the temporal dimension. It should be noted that the term "approximately" here refers to the fact that, during actual installation, considering camera dimensions, wiring space, and the need to ensure overlapping fields of view, the angle between the optical axes of adjacent cameras may not be strictly 120° or 90°, but the overall layout ensures circular coverage. Through the camera calibration process, the actual internal and external parameters and field of view of each camera can be accurately calculated.
[0068] S202. For each surface image, perform image localization and geometric correction to obtain the corresponding standard view detection image.
[0069] Specifically, because products may tilt, rotate, or be off-center on the conveyor line, the areas to be inspected in directly acquired images (e.g., the top or side label area of a bottle cap) may be skewed or perspective-distorted, which severely affects the accuracy of subsequent geometric measurements and the stability of defect identification. Therefore, normalization processing is required for each original surface image. In one specific implementation, firstly, a general region of interest (ROI) is defined in the image. This region should contain stable features on the product used for positioning, such as the toothed edge of a bottle cap or the pull tab of a can. Next, a template matching algorithm is used for precise positioning within this ROI. Specifically, a normalized correlation coefficient matching method can be used, with pre-stored template images of the "left mark" and "right mark" when the product is in a standard orthogonal view (the relative positions of these two templates in the image are known and fixed). In the image to be processed, the algorithm slides to search for the region most similar to these two templates, thereby obtaining the actual pixel coordinates of the left and right mark points in the current image. Based on the actual coordinates of at least two found left and right mark points and their corresponding target coordinates in a standard orthogonal view, a perspective transformation matrix can be calculated. Finally, the matrix is used to resample and geometrically transform the entire inspection area in the original image (e.g., using the warpPerspective function in OpenCV), "straightening" and correcting it into a standard frontal rectangular image, i.e., the standard viewpoint inspection image. This eliminates the image geometric distortion introduced by changes in product pose, establishes a unified and accurate visual benchmark for all inspection samples, and solves the "detection benchmark drift" problem caused by inconsistent product placement.
[0070] In one possible implementation, if the rotating product is shown rotating around its center in the image, it may cause ambiguity in symmetrical template matching (i.e., matching to a mirror position). To prevent this problem, two distinct local regions are manually selected as templates in the standard front view of the product. For example, a specific tooth shape at the 12 o'clock position on the bottle cap is selected as the "left template," and another unique tooth shape or a printed mark at the 4 o'clock position is selected as the "right template." Alternatively, an algorithm can be used for automatic extraction. For example, the product outline is first detected, and then the image blocks with the most significant local gradient features are extracted from the left and right sides of the outline, respectively, as two asymmetrical templates. The template images should be pre-stored in the system configuration file in binarized or grayscale form. The left and right marker points are located within the preset region of interest using a normalized correlation coefficient template matching algorithm.
[0071]
[0072] Where T is the template image, I is the image to be matched, and (x,y) is the matching position. The closer the R(x,y) value is to 1, the higher the similarity. The position with the largest R(x,y) is the left marker point position. Similarly, the right marker point is found using the right template. To increase stability, two points can be selected from each (e.g., top left, bottom left, top right, bottom right), for a total of four points. Using "asymmetrical templates" is to uniquely determine the product's orientation and position, avoiding mismatches.
[0073] Furthermore, let the coordinates of the four source points obtained from the matching be... and the vertex of the target rectangle The perspective transformation matrix M is obtained by solving the following system of linear equations:
[0074]
[0075] Where (x,y) are the source image coordinates, The target image coordinates are given. Then, the perspective transformation matrix M is used to perform geometric correction on the tilted inspection area to obtain a rectangular area at the frontal view angle. Finally, through precise positioning and geometric correction using dual templates, the rotated and corrected product inspection area (Roverall) can be cropped from the original image. Using "perspective transformation" instead of simple rotation and translation is to correct perspective distortion caused by camera angle or product tilt, for example, preventing a circular bottle cap from being imaged as an ellipse. This improves the robustness and uniqueness of positioning, allowing for precise positioning even if the product rotates, while also achieving high-precision geometric correction.
[0076] S203. Input each standard viewpoint detection image in parallel to the rule-based traditional image processing detection channel and the data-driven deep learning detection channel; wherein, the traditional image processing detection channel performs defect identification and quantification based on a preset image processing algorithm; the deep learning detection channel performs defect identification and classification based on a neural network model.
[0077] Specifically, to simultaneously leverage the advantages of traditional algorithms in terms of well-defined rules, precise measurement, and extremely high speed, and the high adaptability of deep learning in identifying complex, irregular, and textured defects, two channels operate in parallel without blocking each other, fully utilizing the heterogeneous computing capabilities of modern industrial control computers (CPU+GPU). Parallel input means the system launches two independent processing threads or processes. The main thread copies the standard viewpoint detection image twice (or shares it via memory pointers) and passes them to the two detection channels respectively. The traditional image processing detection channel is executed by the CPU, which loads a pre-configured "detection recipe" for the current product model. This recipe contains a series of parameterized image processing algorithms, such as: contour extraction and perimeter comparison algorithms for detecting the integrity of bottle cap teeth; grayscale variance statistics for detecting stains on printed labels; and edge detection and spacing measurement algorithms for detecting can height deviations. These algorithms operate based on explicit mathematical rules and logical judgments. Specifically, firstly, multi-threading technology is used to synchronously execute eight detection algorithms optimized for specific defects. By controlling the time complexity of each algorithm to O(n) (where n is the number of pixels), employing a streaming processing mechanism to ensure peak memory usage does not exceed 1.5 times the original image, and optimizing the algorithm flow, real-time performance and stable operation on high-speed production lines are ensured. The optimal threshold strategy is dynamically selected based on image characteristics to adapt to different lighting conditions and product characteristics. The calculation method is as follows:
[0078]
[0079] in The mean of the image. Let be the standard deviation, k be the empirical coefficient, and α and β be the weighting parameters that satisfy α + β = 1.
[0080] Then, through algorithms such as binary pixel analysis of the region of interest and precise contour extraction, high-precision detection of measurement-related defects is achieved. For example, for workpiece height / gap / inclination detection, sub-pixel accuracy is achieved through edge detection and gap measurement algorithms. The calculation formula is as follows:
[0081]
[0082] in, Number of pixels Δx and Δy represent the pixel-to-millimeter conversion coefficients, and Δx and Δy represent the coordinate differences between the left and right marker points. For the detection of other size-related defects, precise quantitative measurement is achieved based on contour analysis and geometric feature extraction.
[0083] The deep learning detection channel is GPU-accelerated and loads a pre-trained neural network model file. This model is a convolutional neural network (CNN) trained using a large number of sample images labeled with defects such as "scratches," "damage," and "fraying," such as, but not limited to, variants of YOLOv5, YOLOv8, or U-Net. This channel inputs an image into the model and directly outputs the presence of defects in the image, along with the category and location confidence score of the defects. In a single processing flow, it simultaneously achieves high-precision measurement of "quantifiable defects" and high-accuracy identification of "difficult-to-describe defects," balancing speed and accuracy. Specifically, for complex and subtle defects such as damage, wrinkles, and scratches, whose locations and sizes on the product are random and whose features are complex and difficult to discern, a deep learning target model based on YOLOv8 is used. By collecting on-site product data, a dynamic AI detection model for complex and subtle defects is constructed to adapt to the needs of actual industrial production. An improved YOLOv8 architecture is used, enabling inference speeds up to 45fps on an RTX 3060, ensuring efficient operation on industrial control computers or embedded devices. Then, an FPN (Feature Pyramid Network) structure is constructed to fuse shallow detail features and deep semantic features. The fusion process is represented as follows:
[0084]
[0085] in, This represents the upsampling operation, where Fhigh represents deep features and Flow represents shallow features. Subsequently, CBAM (Convolutional Block Attention Module) is embedded in the backbone network to improve sensitivity to minor defects. The computation process of this mechanism is as follows:
[0086]
[0087] Among them, M c For channel attention, M s For spatial attention, This represents element-wise multiplication.
[0088] It should be noted that this embodiment provides a highly flexible multi-mode detection strategy. This method supports three configurable detection modes, which can be flexibly selected according to different product characteristics and detection requirements. Specifically, it is configured through a recipe file and supports three switchable detection modes: The first mode (high-speed mode) is a pure traditional image processing mode suitable for standard products or high-speed production lines with relatively low accuracy requirements. Its technical configuration is to only enable the traditional image processing algorithm engine, and can select to use a small-sized deep learning inference module after bypass quantization to assist in discrimination as needed. It is suitable for scenarios where regular defects need to be screened extremely quickly. The second mode (high-precision fusion mode) simultaneously enables traditional and deep learning dual channels and performs result fusion. It is suitable for high-value products, complex and subtle defects (such as randomly distributed damage, wrinkles, cracks, and small impurities), and scenarios with strict quality requirements. Its technical configuration is to process traditional algorithms and deep learning in parallel and perform result fusion decision-making. The third mode (customized mode) is suitable for products with special specifications, scenarios that require special attention to specific defects, or scenarios with special balance requirements. Its technical configuration allows for independent selection of detection methods for each defect type and supports dynamic adjustment of weights. Performance indicators can be flexibly adjusted according to specific configurations to balance accuracy and speed. Formula parameterized management system: The system centrally manages the testing parameters of different products through formula files in formats such as ini and JSON, which realizes the flexibility and maintainability of configuration. This allows for dynamic adaptation to the different needs of different production lines for testing speed, accuracy and computing resources, effectively solving the problem that fixed testing strategies are difficult to cope with the challenges of flexible production of multiple varieties and small batches.
[0089] In one possible implementation, defect identification and quantization based on a preset image processing algorithm includes parallel execution of at least two of the following defect detection sub-algorithms: a crack defect detection algorithm based on background row difference; an involute defect detection algorithm based on column-direction pixel statistics and variance analysis; and a collapsed edge defect detection algorithm based on contour and convex hull difference analysis. The crack defect detection algorithm based on background row difference targets longitudinal cracks on the side (curved surface) of a rotating body. First, on the standard viewpoint detection image, a rectangular region of interest is defined to cover the area where cracks may occur (e.g., the sidewall of a bottle cap). K consecutive rows of pixels at the bottom of this region of interest are taken, for example, the last 10 rows, where K is a parameter. Considering the lighting characteristics of curved surfaces, the row illumination at the same height is uniform. The average grayscale value of each column within these K rows is calculated to form a row background reference vector R. bkgd(j) .
[0090]
[0091] in, For the first one in the figure The pixel value of row and column j. Copy and expand this row vector to create a background image I with the same height as the region of interest. bkgdCalculate the original image I and the background image I of the region of interest. bkgd Absolute difference image I diff Background reference vector R bkgd(j) Calculation formula:
[0092]
[0093] Difference graph Calculation formula:
[0094]
[0095] Furthermore, regarding I diff Binarization is performed using a fixed threshold T to initially extract areas that are significantly darker or brighter than the background (i.e., cracks). Morphological opening operations are performed on the binary image to remove small noise, followed by connected component analysis to calculate the area, height (crack width), and length (span in the row direction) of each connected region. If a connected region exists whose area and height exceed the preset thresholds, it is identified as a crack defect. Based on the precisely selected defective connected regions, the parameters calculated here can accurately quantify the degree of ring breakage defects in the surface of revolution (unaffected by differences in lighting at different curvatures or micro-deformations of the surface): Crack length: ,in The x-coordinate of the defect area represents the distribution range of the crack defect in the circumferential direction of the rotating body; crack height: ,in The width and height of the minimum bounding rectangle of the defect region reflect the defect amplitude of the crack in the radial direction of the body of revolution. Crack area: ,in The number of pixels in the defective connected region retained after connected region analysis corresponds to the actual coverage area of the crack defect on the surface of the rotating body. The severity of the defect can be further determined by combining the crack length and height. Based on the actual risk priority of cracks in the rotating body product, a simple discrimination strategy is set: pre-calibrate the qualified thresholds (circumferential length of crack ≤20%, radial height ≤15%, area ≤1%), prioritize the judgment of high-risk radial cracks - if the height exceeds the threshold, it is directly judged as "unqualified"; then check the circumferential length, if the length exceeds the threshold and the area also exceeds the threshold, it is also judged as "unqualified"; if none of the three exceed the threshold, it is judged as "qualified".
[0096] A collapse edge defect detection algorithm based on contour and convex hull difference analysis targets the depressions (collapsed edges) at the top or bottom edges of bottle caps. First, adaptive threshold binarization is performed on the image of a specific region of interest inside the bottle cap to separate the edge region from the background. For the binary image, the number of white (foreground) pixels is counted column by column to obtain a one-dimensional array C. i Where i is the column index. The formula for calculating the column direction statistical sequence Ci is:
[0097]
[0098] in, These are the pixel values of the binary image.
[0099] This reflects the "thickness" of the edge in each column. Calculate C. i The mean μ and variance σ² of the array are calculated using the following formulas:
[0100] Mean:
[0101] variance:
[0102] Normal involute edges should be relatively uniform with a small σ². When involute defects exist, white pixels at the defective areas will be locally dense or missing, leading to a significant increase in σ². Simultaneously, the total area A of foreground pixels within the entire region of interest is calculated. involution The calculation formula is as follows:
[0103]
[0104] in, This is an indicator function; its value is 1 if the condition is true, and 0 otherwise.
[0105] Finally, the judgment criteria are established:
[0106]
[0107] If A involution If the area is greater than the area threshold (ensuring it's not small noise) and σ² is greater than the variance threshold, then an involution defect is identified. The variance threshold is crucial; it effectively distinguishes between uniform edges and locally anomalous involution.
[0108] A collapse edge defect detection algorithm based on contour and convex hull difference analysis targets the depressions (collapsed edges) at the top or bottom edges of bottle caps. First, edge detection (e.g., using the Canny operator) or binarization is performed on the region of interest image of the bottle cap edge to extract the edge contour point set C. Then, the convex hull H of the contour point set C is calculated. The convex hull is the smallest convex polygon containing all contour points, and can be considered as an "ideal full" edge shape. For each edge of the convex hull H, the maximum vertical distance d from the corresponding line segment on the original contour C to this edge of the convex hull is calculated; this d is the depth of the depression at that location. The algorithm then finds the maximum d. max and the convex hull edge it contains. Let d max The depth of the collapsed edge is measured by the width *w* along the convex rim of the depression. The area of the collapsed edge can then be calculated. The overall scale of the collapse can be comprehensively assessed by examining the collapsed area. Ultimately, based on... As a criterion, the system not only filters out true collapsed edges by combining depth and width, but also uses area thresholds to distinguish between "acceptable minor depressions" and "excessive collapsed edges that need to be removed," ensuring the accuracy and practicality of the detection.
[0109] S204. The recognition results from the traditional image processing detection channel and the deep learning detection channel are fused, and the final defect judgment is output according to the preset decision rules.
[0110] Specifically, to address potential conflicts, redundancy, or information complementarity issues arising from multiple detection sources and to arrive at a unique and reliable final conclusion, one or more "defect event" descriptions are generated after processing by both channels. These descriptions include, but are not limited to, defect type, location, and confidence level. These results are collected through a fusion module. A basic fusion strategy is "complementary coverage": if the traditional channel reports "missing teeth," it is directly adopted; if the deep learning channel reports "minor scratches," but the traditional channel does not report such defects, it is also adopted. For cases where both channels report defects—for example, the traditional channel reports a "suspected stain" based on brightness differences, while the deep learning channel reports the same area as "oil stains"—a decision is required. Preset decision rules may include: 1) Priority rules: defining a priority list for defect types, such as "through cracks" > "large-area stains" > "minor scratches," retaining the highest priority judgment. 2) Confidence-weighted rules: calculating a weighted score for the two judgments of the same area; if the score exceeds a threshold, it is judged as a defect. The weights can be pre-set according to the defect type. 3) AND / OR Rules: For specific defects, it may be necessary for both channels to determine "yes" before final confirmation (AND logic) to improve accuracy; or confirmation may be granted if either channel determines "yes" (OR logic) to improve detection rate. Ultimately, the fusion module outputs a unified, conflict-free defect judgment list, which can be triggered via the I / O interface or displayed on the host computer interface. This avoids production line malfunctions (such as incorrect or missed rejections) caused by inconsistent judgments within the system, improving the reliability and practicality of the entire detection system's decision-making, and enabling the fusion system's output to directly and stably guide production actions.
[0111] In one possible implementation, for traditional image processing detection channels, the "confidence level" is not a probability value, but a quantitative indicator calculated based on rules. For example, for a "height deviation" defect, S... traditional It can be (measured height - standard height) / upper tolerance limit; the closer this value is to 1 or exceeds 1, the higher the confidence level. Alternatively, the binary judgment result of the algorithm (0 or 1) can be mapped to a confidence level (e.g., if it is judged to be defective, then S). traditional =0.95, no defects then S traditional=0.05). For defects with a definite value, a function can be designed to map the degree of exceeding the standard to the interval [0, 1]. For deep learning detection channels, the "confidence" comes directly from the output of the neural network model itself. For example, when using the YOLO model, the model outputs a class confidence for each detection box, which is between 0 and 1 and can be directly used as the S. dl Weight w t and w d It's not fixed, but rather pre-defined in the configuration table based on the defect type. For example, for defects with clear geometric features, such as "missing teeth" or "height out of tolerance," where traditional algorithms are highly reliable, w can be set. t =0.9,w d =0.1. This means that the final result mainly depends on the traditional algorithm, with the deep learning result serving only as a weak reference. For defects with complex textures, such as "minor scratches" or "invisible damage," which are difficult for traditional algorithms to describe, w can be set to 0.1. t =0.2,w d =0.8. This means the final result depends primarily on the deep learning model. For defects like "stains" and "blemishes," which may be detected by both, w can be set to... t =0.5,w d =0.5. Furthermore, the weights can be fine-tuned based on historical testing data for this product model to form a better fusion strategy. First, the two channels detect defects separately, generating several candidate defect regions and their confidence levels. The fusion module compares the positions of the defect regions output by the two channels (e.g., calculating IoU). If the positions highly overlap, it is considered to describe the same suspected defect. For the same suspected defect that matches, a preset weight (w) is found based on its defect type. t ,w d ), and obtain the corresponding S traditional and S dl Further calculations Calculate the overall score and assign S to it. final Compare with a global decision threshold. The decision threshold can be 0.6: if S final If the value is greater than or equal to 0.6, the defect is considered valid; otherwise, it is not valid or requires further review.
[0112] This invention provides a high-speed intelligent detection method for complex defects across multiple viewing angles and tasks. It constructs an integrated technical solution of "synchronous multi-view imaging - geometric reference correction - parallel detection via traditional and deep learning dual channels - intelligent fusion decision-making," achieving high-speed, high-precision, and full-coverage intelligent detection of 360° external surface defects in industrial products. This solution effectively addresses industry pain points in existing technologies, such as the difficulty in balancing detection blind spots and measurement accuracy, the contradiction between insufficient complex defect recognition capabilities and real-time requirements, reference drift caused by product pose changes, and output conflicts from multiple decision sources. Ultimately, while improving defect detection rate and measurement accuracy, it ensures stable system operation within the production cycle.
[0113] Please see Figure 4 , Figure 4 This is a structural block diagram of a high-speed intelligent detection device for complex defects with a full-view, multi-task capability, provided as an embodiment of the present invention. Figure 4 As shown: The high-speed intelligent detection device 400 for complex defects with full-view multi-task capability includes: a data acquisition module 401, an acquisition module 402, an input module 403, and a judgment module 404, wherein:
[0114] The acquisition module 401 is used to simultaneously acquire multiple surface images of the industrial product under test in the circumferential direction; the multiple surface images together cover the 360° outer surface area of the industrial product under test in the circumferential direction.
[0115] The module 402 is used to perform image localization and geometric correction for each of the surface images to obtain the corresponding standard view detection image;
[0116] The input module 403 is used to input each of the standard viewpoint detection images in parallel to a rule-based traditional image processing detection channel and a data-driven deep learning detection channel; wherein, the traditional image processing detection channel performs defect identification and quantization based on a preset image processing algorithm; and the deep learning detection channel performs defect identification and classification based on a neural network model.
[0117] The determination module 404 is used to fuse the recognition results from the traditional image processing detection channel and the deep learning detection channel, and output the final defect determination according to the preset decision rules.
[0118] In one possible embodiment, the acquisition module 401 includes:
[0119] The acquisition unit is used to acquire images using M industrial cameras arranged in a ring, where M is 3 or 4; when M=3, each camera covers an area of approximately 120°; when M=4, each camera covers an area of approximately 90°.
[0120] The trigger unit is used to receive the product arrival signal through the encoder and synchronously trigger all M industrial cameras to take pictures.
[0121] In one possible embodiment, module 402 is obtained, comprising:
[0122] The setting unit is used to set the region of interest in the image, which contains the features of the product to be inspected;
[0123] The localization unit is used to locate at least two feature points within the region of interest using a pre-stored template with left and right asymmetry and a normalized correlation coefficient matching algorithm.
[0124] The solving unit is used to solve the perspective transformation matrix based on the coordinates of the matched feature points and the preset target coordinates;
[0125] The obtained unit is used to perform geometric transformation on the region of interest using the perspective transformation matrix to obtain a standard viewpoint detection image.
[0126] In one possible embodiment, the input module 403 includes:
[0127] The first algorithm unit is used for a crack defect detection algorithm based on background row difference;
[0128] The second algorithm unit is used for an involute defect detection algorithm based on column-direction pixel statistics and variance analysis;
[0129] The third algorithm unit is used for the collapse defect detection algorithm based on contour and convex hull difference analysis.
[0130] In one possible embodiment, the input module 403 includes:
[0131] An extraction unit is used to extract the crack detection area from a standard viewpoint detection image;
[0132] The selection unit is used to select continuous pixels in the area to be inspected that are far away from the high-incidence area of defects, calculate the pixel mean of each column to construct a background reference row, and expand the background reference row into a background image with the same size as the area to be inspected;
[0133] The calculation unit is used to calculate the difference image between the image of the region to be inspected and the background image;
[0134] The filtering unit is used to binarize the difference image and filter out suspected defect areas that meet the area threshold through connected component analysis.
[0135] The judgment unit is used to calculate parameters representing the degree of defect based on the selected defect areas and compare them with preset thresholds to complete the judgment.
[0136] In one possible embodiment, the determination module 404 includes:
[0137] The preset unit is used to preset a weight for each type of defect, wherein the weight of the traditional image processing detection channel result is wt, the weight of the deep learning detection channel result is wd, and the weight satisfies wt+wd=1.
[0138] The calculation unit is used to obtain confidence scores Straditional and Sdl from two channels respectively for the same suspected defect;
[0139] Calculate the overall score using the following formula:
[0140]
[0141] Calculate the overall score and make the final decision based on the overall score.
[0142] In one possible embodiment, the high-speed intelligent detection system for complex defects with a full-view, multi-task approach 400 further includes:
[0143] The selection device is used to select and switch to the appropriate testing mode according to the specifications or quality requirements of the product to be tested. The testing modes include:
[0144] The first mode only enables the traditional image processing detection channel;
[0145] The second mode simultaneously enables both the traditional image processing detection channel and the deep learning detection channel, and fuses the results of the two.
[0146] The third mode allows for independent configuration and activation of either traditional image processing detection channels or deep learning detection channels for different defect types.
[0147] It should be noted that the high-speed intelligent detection device for complex defects with all-view multi-task operation provided in the above embodiments is only illustrated by the division of the above functional modules when executing the high-speed intelligent detection method for complex defects with all-view multi-task operation. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the high-speed intelligent detection device for complex defects with all-view multi-task operation provided in the above embodiments and the high-speed intelligent detection method for complex defects with all-view multi-task operation are based on the same concept, and the implementation process is detailed in the method embodiments, which will not be repeated here.
[0148] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0149] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Figure 5As shown, the electronic device 500 may include: at least one processor 501, at least one network interface 504, user interface 503, memory 505, and at least one communication bus 502.
[0150] The communication bus 502 is used to enable communication between these components.
[0151] The user interface 503 may include a display screen and a camera. Optional user interfaces 503 may include standard wired interfaces and wireless interfaces.
[0152] The network interface 504 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).
[0153] The processor 501 may include one or more processing cores. The processor 501 connects to various parts within the electronic device 500 using various interfaces and lines, and performs various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 505, and by calling data stored in the memory 505. Optionally, the processor 501 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 501 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content required for display; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 501 and may be implemented as a separate chip.
[0154] The memory 505 may include random access memory (RAM) or read-only memory. Optionally, the memory 505 may include a non-transitory computer-readable storage medium. The memory 505 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 505 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 505 may also be at least one storage device located remotely from the aforementioned processor 501. Figure 5 As shown, the memory 505, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a high-speed intelligent detection application for complex defects with a full-view, multi-tasking capability.
[0155] exist Figure 5 In the illustrated electronic device 500, the user interface 503 is mainly used to provide an input interface for the user and acquire user input data; while the processor 501 can be used to call the all-view multi-task complex defect high-speed intelligent detection application stored in the memory 505, and specifically perform the following operations: synchronously acquire multiple surface images of the industrial product under test around its circumference; multiple surface images jointly cover the 360° outer surface area of the industrial product under test around its circumference; for each surface image, perform image localization and geometric correction to obtain the corresponding standard view detection image; input each standard view detection image in parallel to the rule-based traditional image processing detection channel and the data-driven deep learning detection channel; wherein, the traditional image processing detection channel performs defect identification and quantification based on a preset image processing algorithm; the deep learning detection channel performs defect identification and classification based on a neural network model; fuse the identification results from the traditional image processing detection channel and the deep learning detection channel, and output the final defect judgment according to the preset decision rules.
[0156] In some possible embodiments, the processor 501 performs the simultaneous acquisition of multiple surface images of the industrial product under test in the circumferential direction, specifically for performing:
[0157] Image acquisition is performed using M industrial cameras arranged in a ring, where M is 3 or 4;
[0158] When M=3, each camera covers an area of approximately 120°; when M=4, each camera covers an area of approximately 90°.
[0159] The encoder receives the product arrival signal and simultaneously triggers all M industrial cameras to take pictures.
[0160] In some possible embodiments, the processor 501 performs image localization and geometric correction for each surface image to obtain a corresponding standard view detection image, specifically for performing:
[0161] Define the region of interest in the image that contains the features of the product to be inspected;
[0162] Within the region of interest, at least two feature points are located using a pre-stored template with left-right asymmetry and a normalized correlation coefficient matching algorithm.
[0163] Based on the coordinates of the matched feature points and the preset target coordinates, solve the perspective transformation matrix;
[0164] A standard viewpoint detection image is obtained by performing a geometric transformation on the region of interest using a perspective transformation matrix.
[0165] In some possible embodiments, the processor 501 performs defect identification and quantization based on a preset image processing algorithm, specifically for executing at least two of the following defect detection sub-algorithms in parallel:
[0166] Crack and defect detection algorithm based on background row difference;
[0167] An involute defect detection algorithm based on column-direction pixel statistics and variance analysis;
[0168] A collapse defect detection algorithm based on contour and convex hull difference analysis.
[0169] In some possible embodiments, processor 501 executes a crack defect detection algorithm based on background row difference, specifically for performing:
[0170] Extract the crack detection area from the standard viewpoint image;
[0171] Select consecutive pixels in the area to be inspected that are far from the high-incidence area of defects, calculate the pixel mean of each column to construct a background reference row, and expand the background reference row into a background image with the same size as the area to be inspected;
[0172] Calculate the difference image between the image of the region to be inspected and the background image;
[0173] The difference image is binarized, and suspected defect areas that meet the area threshold are screened out by connected component analysis.
[0174] Parameters characterizing the degree of defect are calculated based on the selected defect areas and compared with preset thresholds to complete the judgment.
[0175] In some possible embodiments, the processor 501 performs the fusion of recognition results from the conventional image processing detection channel and the deep learning detection channel, and outputs the final defect judgment according to preset decision rules, specifically for the following purposes:
[0176] A weight is preset for each type of defect, where the weight of the traditional image processing detection channel result is w. t The weight of the deep learning detection channel results is w. d And satisfy w t +w d =1;
[0177] For the same suspected defect, confidence scores S are obtained from two channels respectively. traditional and S dl ;
[0178] Calculate the overall score using the following formula:
[0179]
[0180] Calculate the overall score and make the final decision based on the overall score.
[0181] In some possible embodiments, processor 501 is also used to perform:
[0182] Select and switch to the appropriate testing mode according to the specifications or quality requirements of the product to be tested. The testing modes include:
[0183] The first mode only enables the traditional image processing detection channel;
[0184] The second mode simultaneously enables both the traditional image processing detection channel and the deep learning detection channel, and fuses the results of the two.
[0185] The third mode allows for independent configuration and activation of either traditional image processing detection channels or deep learning detection channels for different defect types.
[0186] This invention also provides a computer-readable storage medium storing instructions that, when executed on a computer or processor, cause the computer or processor to perform the above-described instructions. Figure 2 One or more steps in the illustrated embodiment. If the constituent modules of the above-described high-speed intelligent detection device for complex defects with a full-view, multi-task capability are implemented as software functional units and sold or used as independent products, they can be stored in the computer-readable storage medium.
[0187] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., digital versatile discs (DVDs)), or semiconductor media (e.g., solid state disks (SSDs)).
[0188] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The aforementioned storage medium includes various media capable of storing program code, such as read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks. Unless otherwise specified, the technical features of this embodiment and its implementation schemes can be combined arbitrarily.
[0189] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. It will be apparent to those skilled in the art that various modifications can be made to these embodiments, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A high-speed intelligent detection method for complex defects from all perspectives and multiple tasks, characterized in that, The method includes: Simultaneously acquire multiple surface images of the industrial product under test in the circumferential direction; the multiple surface images together cover the 360° outer surface area of the industrial product under test in the circumferential direction. For each surface image, image localization and geometric correction are performed to obtain the corresponding standard view detection image; Each of the standard viewpoint detection images is input in parallel to a rule-based traditional image processing detection channel and a data-driven deep learning detection channel; wherein, the traditional image processing detection channel performs defect identification and quantification based on a preset image processing algorithm; and the deep learning detection channel performs defect identification and classification based on a neural network model. The recognition results from the traditional image processing detection channel and the deep learning detection channel are fused together, and the final defect judgment is output according to the preset decision rules.
2. The high-speed intelligent detection method for complex defects with all-view multi-task capabilities according to claim 1, characterized in that, The simultaneous acquisition of multiple surface images of the industrial product under test in the circumferential direction includes: Image acquisition is performed using M industrial cameras arranged in a ring, where M is 3 or 4; When M=3, each camera covers an area of approximately 120°; when M=4, each camera covers an area of approximately 90°. The encoder receives the product arrival signal and simultaneously triggers all M industrial cameras to take pictures.
3. The high-speed intelligent detection method for complex defects with full-view multi-task capability according to claim 1 or 2, characterized in that, For each of the surface images, image localization and geometric correction are performed to obtain the corresponding standard view detection image, including: Define the region of interest in the image that contains the features of the product to be inspected; Within the region of interest, at least two feature points are located using a pre-stored template with left-right asymmetry and a normalized correlation coefficient matching algorithm. Based on the coordinates of the matched feature points and the preset target coordinates, solve the perspective transformation matrix; The region of interest is geometrically transformed using the perspective transformation matrix to obtain the standard viewpoint detection image.
4. The high-speed intelligent detection method for complex defects with all-view multi-task capabilities according to claim 1, characterized in that, The defect identification and quantization based on the preset image processing algorithm includes the parallel execution of at least two of the following defect detection sub-algorithms: Crack and defect detection algorithm based on background row difference; An involute defect detection algorithm based on column-direction pixel statistics and variance analysis; A collapse defect detection algorithm based on contour and convex hull difference analysis.
5. The high-speed intelligent detection method for complex defects with all-view multi-task capabilities according to claim 4, characterized in that, The crack defect detection algorithm based on background row difference includes: Extract the crack detection area from the image detected from the standard viewpoint; Select consecutive pixels in the area to be inspected that are far from the high-incidence area of defects, calculate the pixel mean of each column to construct a background reference row, and expand the background reference row into a background image with the same size as the area to be inspected; Calculate the difference image between the image of the region to be inspected and the background image; The difference image is binarized, and suspected defect regions that meet the area threshold are screened out by connected component analysis. Parameters characterizing the degree of defect are calculated based on the selected defect areas and compared with preset thresholds to complete the judgment.
6. The high-speed intelligent detection method for complex defects with all-view multi-task capabilities according to claim 1, characterized in that, The process of fusing the recognition results from the traditional image processing detection channel and the deep learning detection channel, and outputting the final defect judgment according to preset decision rules, includes: A weight is preset for each type of defect, where the weight of the traditional image processing detection channel result is w. t The weight of the deep learning detection channel result is w. d And satisfy w t +w d =1; For the same suspected defect, confidence scores S are obtained from two channels respectively. traditional and S dl ; Calculate the overall score using the following formula: Calculate the overall score and make a final determination based on the overall score.
7. The high-speed intelligent detection method for complex defects with all-view multi-task capabilities according to claim 1, characterized in that, The method further includes: Select and switch to the appropriate testing mode according to the specifications or quality requirements of the product to be tested. The testing modes include: In the first mode, only the traditional image processing detection channel is enabled; The second mode simultaneously enables the traditional image processing detection channel and the deep learning detection channel, and fuses the results of the two. The third mode allows for independent configuration and activation of either the traditional image processing detection channel or the deep learning detection channel for different defect types.
8. A high-speed intelligent detection device for complex defects with all-view, multi-task operation, characterized in that, The device includes: The acquisition module is used to simultaneously acquire multiple surface images of the industrial product under test in the circumferential direction; the multiple surface images together cover the 360° outer surface area of the industrial product under test in the circumferential direction. The module is used to perform image localization and geometric correction for each surface image to obtain the corresponding standard view detection image; The input module is used to input each of the standard viewpoint detection images in parallel to a rule-based traditional image processing detection channel and a data-driven deep learning detection channel; wherein, the traditional image processing detection channel performs defect identification and quantization based on a preset image processing algorithm; and the deep learning detection channel performs defect identification and classification based on a neural network model. The determination module is used to fuse the recognition results from the traditional image processing detection channel and the deep learning detection channel, and output the final defect determination according to the preset decision rules.
9. A computer storage medium, characterized in that, The computer storage medium stores a plurality of instructions adapted for loading by a processor and executing the steps of the method as described in any one of claims 1 to 7.
10. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the method as described in any one of claims 1 to 7.