Protector defect detection system based on machine vision

By dynamically adjusting the light source configuration and image preprocessing strategy, and combining scene matching of material and defect type, the problem of missed detection and false judgment in existing detection systems under changing ambient light conditions has been solved, and high-precision defect detection of motor protectors has been achieved.

CN121830684APending Publication Date: 2026-04-10JIANGSU CHANGSHENG ELECTRIC APPLIANCE
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JIANGSU CHANGSHENG ELECTRIC APPLIANCE
Filing Date
2026-03-11
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing machine vision-based defect detection systems for protectors struggle to simultaneously achieve optimal imaging results for different material areas, and are prone to missed detections or misjudgments, especially when ambient light changes, thus failing to ensure high-precision appearance quality inspection.

Method used

The parameter acquisition module synchronously collects material type, defect type to be inspected, and ambient light intensity. The scene matching module determines the target detection scene based on the combination of material type and defect type to be inspected, generates suitable light source configuration, image preprocessing and visual detection strategy, and dynamically compensates the detection strategy to offset the influence of ambient light fluctuations.

Benefits of technology

It enables adaptive testing of motor protectors with multiple materials and defect types under different environmental conditions, ensuring that the testing logic is compatible with the essential characteristics of the tested object, and improving the stability and accuracy of the testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121830684A_ABST
    Figure CN121830684A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of protector detection, in particular to a protector defect detection system based on machine vision, which comprises a parameter acquisition module used for acquiring the material type of a protector to be detected and the type of a defect to be detected, and acquiring the environment illumination intensity of an imaging area in real time; the scene matching module is used for matching and determining a current target detection scene from a plurality of predefined detection scenes based on the combination of the material type and the to-be-detected defect type; the strategy generation module is used for calling a corresponding reference cooperative detection strategy according to the target detection scene, performing dynamic parameter compensation on the reference cooperative detection strategy based on the environment illumination intensity, and generating a detection operation instruction; and the cooperative execution module is used for executing the operation instruction to obtain defect information of the protector to be detected. According to the invention, adaptive detection of multiple materials and multiple defect types of the motor protector is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of protector inspection, and more particularly to a protector defect inspection system based on machine vision. Background Technology

[0002] Motor protectors, as key components ensuring the safe operation of motors, are widely used in industrial production and household appliances. Their manufacturing quality directly affects the operational safety of downstream equipment. To achieve efficient quality control, the industry generally adopts automated inspection technology based on machine vision to replace traditional manual visual inspection.

[0003] Existing machine vision-based defect detection systems generally employ pre-defined, fixed detection strategies, including fixed light source configurations, image preprocessing parameters, and visual detection algorithm execution schemes. However, motor protectors are made of diverse materials, including plastic shells and metal contacts with varying reflective properties, and the types of defects to be detected are also diverse. For example, diffuse illumination schemes optimized for plastic shells may not effectively highlight subtle imperfections on metal contacts; conversely, high-angle illumination suitable for metal detection is prone to overexposure on plastic surfaces. Existing methods struggle to simultaneously achieve optimal imaging effects for different material areas, especially when ambient light changes, which can easily lead to missed or misjudged defects of certain types, failing to ensure high-precision appearance quality inspection of motor protectors. Summary of the Invention

[0004] This invention provides a machine vision-based protector defect detection system, which can effectively solve the problems in the background art.

[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A machine vision-based protector defect detection system includes: The parameter acquisition module is used to acquire the material type and defect type of the protector to be inspected, as well as the ambient light intensity of the imaging area in real time. The scene matching module is used to match and determine the current target detection scene from a combination of the material type and the type of defect to be inspected; The strategy generation module is used to call the corresponding benchmark collaborative detection strategy according to the target detection scene, and to perform dynamic parameter compensation on the benchmark collaborative detection strategy based on the ambient light intensity to generate detection operation instructions; the benchmark collaborative detection strategy defines the collaborative relationship between the light source configuration strategy, image preprocessing strategy and visual detection algorithm execution strategy adapted to the target detection scene; The collaborative execution module is used to execute the above-mentioned operation instructions and obtain the defect information of the protector to be tested.

[0006] Furthermore, the types of defects to be inspected include at least one of surface defects, marking defects, and assembly defects.

[0007] Furthermore, the defects in the marking include content defects, appearance quality defects, and positional defects in the printed marking information.

[0008] Furthermore, the benchmark collaborative detection strategy includes: The first collaborative solution for plastic shell material with surface defects is configured with a ring diffuse reflection light source, preprocessed with adaptive median filtering, and executed with a gray-scale gradient anomaly detection algorithm. The second collaborative scheme for metal contact material with surface defects involves configuring a coaxial oblique light source, using Gaussian filtering and edge enhancement for preprocessing, and executing a crack feature template matching algorithm. For the third collaborative solution for assembly defects, a 2D planar camera and a 3D structured light camera are configured to collaboratively acquire images, and template matching and localization based on 2D images and assembly dimension analysis algorithms based on 3D point cloud data are executed. The fourth collaborative solution, which targets plastic shell material and defects classified as identification defects, is equipped with a bar light source, preprocesses the data using character segmentation, and executes OCR recognition and sharpness detection algorithms. The fifth collaborative scheme, which targets metal casings and identifies defects as identification defects, employs a composite light source, preprocesses the defects using histogram equalization, and executes character contour matching and position deviation calculation algorithms.

[0009] Furthermore, the collaborative execution module includes: The light source unit is used to provide illumination according to the light source configuration strategy in the detection operation instruction; An image acquisition unit is used to acquire an image of the protector to be tested under the illumination conditions of the light source unit; The image processing unit is used to process and analyze the image according to the image preprocessing strategy and visual detection algorithm execution strategy in the detection job instruction, and output the defect detection result.

[0010] Furthermore, the defect detection results include defect type, defect location, and defect parameters.

[0011] Furthermore, the parameter acquisition module includes: The RFID read / write unit is used to read the RFID tag pre-installed on the protector to be tested in order to obtain initial information about the material type. An optical reflectivity detection unit, located downstream of the RFID read / write unit, is used to emit detection light onto the surface of the protector and receive reflected light to calculate the actual reflectivity. The parameter acquisition module is configured to verify whether the initial information of the material type matches the actual reflectivity according to a preset material reflectivity mapping relationship, and to confirm the final material type based on the verification result.

[0012] Furthermore, the scene matching module is configured as follows: The received material type and the defect type to be inspected are mapped to the corresponding material feature vector and defect feature vector, respectively. Calculate the first similarity between the material feature vector and the predefined material feature vector group of each detection scenario, and the second similarity between the defect feature vector and the defect feature vector group of each detection scenario; Based on the first similarity and the second similarity, the target detection scene is determined from the predefined detection scene.

[0013] Furthermore, the scene matching module is also configured as follows: When the number of candidate detection scenarios determined based on similarity is greater than 1, a pre-set priority rule base is invoked for arbitration. The priority rule base includes decision rules for making a unique choice among multiple candidate scenarios.

[0014] Furthermore, the strategy generation module is configured as follows: According to the target detection scenario, the corresponding benchmark collaborative detection strategy is invoked. The benchmark collaborative detection strategy includes benchmark ambient light intensity, light source benchmark parameters, image preprocessing benchmark parameters, and visual detection algorithm benchmark parameters. Calculate the deviation factor between the real-time ambient light intensity and the reference ambient light intensity; Based on the deviation factor, the light source reference parameters, image preprocessing reference parameters, and visual detection algorithm reference parameters are compensated in layers to generate the detection operation instruction.

[0015] The following technical effects are achieved: The parameter acquisition module synchronously collects material type, defect type, and ambient light intensity. The scene matching module determines the target detection scene based on the combination of material type and defect type, forming a two-dimensional scene definition. This ensures that the detection strategy is no longer limited to a single adaptation standard, guaranteeing that the detection logic matches the essential characteristics of the object being detected and providing the best imaging basis for defects in different material regions. After matching the target detection scene, a baseline collaborative detection strategy adapted to the scene is first invoked, followed by dynamic parameter compensation based on the real-time acquired ambient light intensity. This ensures the adaptability of the detection logic to the material defect combination, offsets the negative impact of ambient light fluctuations, and achieves stability in defect imaging and recognition under different environmental conditions. The baseline collaborative detection strategy determines the collaborative relationship between light source configuration, image preprocessing, and detection algorithms, ensuring that the detection method matches the specific detection task, achieving adaptive detection of multiple materials and multiple defect types for motor protectors.

[0016] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

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

[0018] Figure 1 This is a schematic diagram of the process of the machine vision-based protector defect detection system of the present invention; Figure 2 This is an execution flowchart of the parameter acquisition module in an embodiment of the present invention; Figure 3 This is a flowchart illustrating the execution of the scene matching module in an embodiment of the present invention. Detailed Implementation

[0019] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.

[0020] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0021] like Figure 1 As shown, the machine vision-based protector defect detection system of the present invention specifically includes the following modules: The parameter acquisition module is used to acquire the material type and defect type of the protector to be inspected, as well as the ambient light intensity of the imaging area in real time. The scene matching module is used to match and determine the current target detection scene from a combination of the material type and the type of defect to be inspected; The strategy generation module is used to call the corresponding benchmark collaborative detection strategy according to the target detection scene, and to perform dynamic parameter compensation on the benchmark collaborative detection strategy based on the ambient light intensity to generate detection operation instructions; the benchmark collaborative detection strategy defines the collaborative relationship between the light source configuration strategy, image preprocessing strategy and visual detection algorithm execution strategy adapted to the target detection scene; The collaborative execution module is used to execute the above-mentioned operation instructions and obtain the defect information of the protector to be tested.

[0022] In this embodiment, the parameter acquisition module synchronously collects material type, defect type to be inspected, and ambient light intensity. The scene matching module determines the target detection scene based on the combination of material type and defect type to be inspected, forming a two-dimensional scene definition. This ensures that the detection strategy is no longer limited to a single adaptation standard, and that the detection logic is compatible with the essential characteristics of the object being detected, providing the best imaging basis for defects in different material regions. After matching the target detection scene, a benchmark collaborative detection strategy adapted to the scene is first invoked, and then dynamic parameter compensation is performed based on the real-time acquired ambient light intensity. This ensures the adaptability of the detection logic to the combination of material defects, offsets the negative impact of ambient light fluctuations, and achieves stability in defect imaging and recognition under different environmental conditions. The benchmark collaborative detection strategy determines the collaborative relationship between light source configuration, image preprocessing, and detection algorithm, ensuring that the detection method matches the specific detection task, and achieving adaptive detection of multiple materials and multiple defect types for motor protectors.

[0023] In a specific implementation, as one example, the parameter acquisition module automatically identifies the product and obtains its inherent attributes; simultaneously, it introduces an independent ambient light sensing unit to quantify variable environmental factors into input data that the system can process, such as... Figure 2 As shown, the specific implementation is as follows: To obtain the material type of the protector to be tested, an RFID reader is installed at the front end of the testing station on the motor protector production line. The RFID reader is connected to the production management system. During the production process, the motor protector's outer shell is pre-tagged with an RFID tag, which stores basic information such as product model and material type. The material type includes plastic shell, metal contacts, and mixed materials. When the motor protector is transported to the RFID reader's identification range along the production line, the RFID reader reads the initial material type information pre-stored in the tag. Simultaneously, an optical reflectivity detection unit is installed downstream of the RFID reader. The optical reflectivity detection unit includes an infrared emitting module and a receiving module. The emitting module outputs infrared light of a fixed wavelength to illuminate the surface of the motor protector, and the receiving module collects the intensity of the reflected light and calculates the reflectivity value. According to the preset material reflectivity mapping relationship, the initial material type information obtained by the RFID reader is verified. If the initial information matches the reflectivity calculation result, the material type is confirmed; if they do not match, an abnormal signal is generated and fed back to the production management system.

[0024] To acquire the types of defects to be inspected, the production management system stores preset inspection requirements corresponding to each product model. These preset inspection requirements clearly define the types of defects to be inspected, including surface defects, marking defects, and assembly defects. Marking defects further include content defects, appearance quality defects, and positional defects in printed markings. When the RFID reader reads the product model, the parameter acquisition module retrieves the preset inspection requirements corresponding to that model from the production management system and extracts the types of defects to be inspected. Simultaneously, a trigger switch is set at the inspection station. When the motor protector arrives at the inspection station, the trigger switch sends a signal to the parameter acquisition module. The parameter acquisition module confirms the type of defect to be inspected and locks the inspection range, ensuring that the inspection requirements are consistent with the actual inspection scenario of the product.

[0025] To acquire ambient light intensity in the imaging area, four photosensitive sensors are evenly arranged circumferentially in the image acquisition area of ​​the detection station. The sampling frequency of the photosensitive sensors is set to 50Hz, and the sampling accuracy is 1 lux. Each photosensitive sensor synchronously acquires ambient light intensity data at its location. After receiving the four acquisition data, the parameter acquisition module executes an outlier removal algorithm. The specific execution process is as follows: First, an initial arithmetic mean is calculated based on the four original acquisition data. This initial mean includes all four original acquisition data. Then, the relative deviation of each original data from the initial mean is calculated, and outliers deviating from the mean by ±10% are removed. Normal data; the remaining valid data are recalculated to obtain the arithmetic mean, which is then used as the actual ambient light intensity of the imaging area; if there are fewer than two valid data channels remaining after the removal, the parameter acquisition module immediately triggers the four photosensitive sensors to resynchronize and acquire data, and repeats the above outlier removal process; if there are still fewer than two valid data channels after three consecutive acquisitions, an ambient light acquisition anomaly signal is generated, fed back to the production management system, and the current detection process is paused; the photosensitive sensor and the lens of the image acquisition unit are at the same horizontal level, and the sensor surface is provided with an anti-reflective coating to avoid interference from reflected light from the light source unit with the acquisition results.

[0026] In this embodiment, material type acquisition is combined with RFID tag reading and optical reflectivity verification. The type of defect to be inspected is obtained by associating the product model with the production management system. Ambient light intensity is obtained by combining circumferential four-point acquisition with outlier rejection. The dual verification mechanism for material type acquisition avoids parameter deviations caused by tag information errors or detachment that may occur with a single reading method, ensuring the accuracy of material type data. The type of defect to be inspected is accurately associated with the product model without manual intervention, ensuring that no defect type is missed or mismatched, and adapting to the testing needs of different products. The combination of four-point acquisition and outlier rejection comprehensively reflects the light distribution of the imaging area, avoiding data distortion caused by sudden changes in local light intensity in single-point acquisition.

[0027] In some embodiments of the present invention, this embodiment provides a method for dynamically determining detection scenarios based on multi-dimensional feature vectors and rule arbitration for the scene matching module. Existing detection systems often use direct enumeration matching or simple conditional branching logic when selecting detection scenarios based on material and defect type. This requires the input parameters to precisely correspond to preset scene entries. When the material combination or defect type combination of the object to be detected exceeds the limited range of preset entries, the system may be unable to perform effective matching, or the matching result may not optimally adapt to the actual detection needs, leading to interruption of the detection process or a decrease in detection quality. Therefore, the scene matching module is configured with computational and decision-making capabilities, converting the predefined detection scenarios, input material types, and defect types into comparable feature expressions, and making a deterministic selection from multiple potential matching results based on preset rules by calculating their correlation strength. Figure 3 As shown, the specific implementation steps are as follows: The system maintains a scene configuration library. Each record in the scene configuration library defines a detection scene and contains two feature vector sets: material feature vector and defect feature vector. The material feature vector is used to encode the optical and physical property tendencies of one or more materials that the scene is adapted to, and the defect feature vector is used to encode the visual feature tendencies of one or more defects that the scene targets. Each record is also associated with a set of priority identifiers, which are used to provide decision-making basis during conflict arbitration.

[0028] First, the scene matching module receives structured data from the parameter acquisition module, including a set of material types and a set of defect types to be inspected. The module has a built-in feature encoder, which is a deterministic encoder with preset rule mapping. It does not require training of a machine learning model. Through standardized rules with fixed dimensions, it maps each item in the input set to a corresponding standard feature vector. For example, ABS plastic material type is mapped to a feature vector with specific reflectivity and texture properties, and surface scratch defects are mapped to feature vectors with specific gradient and morphological properties.

[0029] Specifically, the material feature vector is a 3-dimensional standardized vector with the format [reflectivity level, surface texture level, conductivity property]. The value range for each dimension is [0,1]. The specific mapping rules are as follows: the reflectivity level is calibrated based on the measured reflectivity of the material. For example, the value is 0.2 for low-reflectivity plastic materials, 0.6 for medium-reflectivity metal shell materials, and 0.9 for high-reflectivity metal contact materials; the surface texture level is calibrated based on the surface roughness of the material. For example, the value is 0.1 for smooth injection-molded plastic surfaces, 0.4 for stamped metal shell surfaces, and 0.7 for machined metal contact surfaces; the conductivity property is represented as 0 for insulating plastic materials and 1 for conductive metal materials.

[0030] The defect feature vector is a 4-dimensional standardized vector with the format [feature scale level, contrast sensitivity, spatial dimension requirement, morphological feature type]. Each dimension has a value range of [0,1]. The specific mapping rules are as follows: The feature scale level is calibrated based on the typical size of the defect. For example, a value of 0.2 is used for surface defects such as minor cracks / scratches, 0.5 for character-related marking defects, and 0.9 for assembly gap defects. The contrast sensitivity is calibrated based on the degree to which defect recognition depends on lighting contrast. For example, a value of 0.9 is used for metal surface defects, 0.6 for plastic surface defects, 0.5 for marking defects, and 0.2 for assembly defects. The spatial dimension requirement is calibrated based on the spatial dimension information required for defect detection. For example, a value of 0 is used for surface defects and marking defects that can be recognized in 2D planes, and a value of 1 is used for assembly defects that require 3D size information. The morphological feature type is calibrated based on the core visual features of the defect. For example, a value of 0.2 is used for grayscale gradient surface defects, 0.5 for character outline marking defects, and 0.9 for size deviation assembly defects.

[0031] Next, the scene matching module performs similarity calculations, comparing the similarity between the input material feature vector set and the material feature vector group recorded for each scene in the scene configuration library, and calculating the corresponding material matching score using the cosine similarity algorithm. Similarly, it compares the similarity between the input defect feature vector set and the defect feature vector group for each scene, and calculates the corresponding defect matching score using the cosine similarity algorithm. Then, a weighted fusion function combines these two scores into a comprehensive matching score; the weighted fusion function is a linear weighted fusion function, specifically defined as: S Q =W1×S1+W2×S2; Among them, S Q To achieve a comprehensive matching score, S1 represents the material matching score, S2 represents the defect matching score, W1 represents the material matching weight, and W2 represents the defect matching weight. The values ​​of both are limited to [0.2, 0.8] to avoid imbalance in the scene matching results due to an excessively high weight of any single factor. This weighted fusion function can be configured to reflect different emphases on material adaptability or defect targeting. For example, for general scenarios, the default configuration is used. Under the normal full-item inspection conditions of motor protectors, the default settings are W1=0.4 and W2=0.6. This configuration takes into account both the adaptability of material optical properties and the accuracy of defect detection, and is suitable for most conventional inspection scenarios. For specific scenarios, the matching weight values ​​are determined through pre-calibration experiments. The calibration process is consistent with the calibration system for light source, filtering, and algorithm compensation coefficients in this invention. Specifically, standard samples corresponding to the detection scenario are selected, including the target matching material and typical defects in the scenario. Within the limited value range of W1 and W2, multiple sets of equal gradient weight combinations are set, and the entire process of scenario matching and defect detection is executed respectively. The overall accuracy, false detection rate, and false negative rate of defect detection under different weight combinations are statistically analyzed. The weight combination with the highest overall detection accuracy is taken as the optimal configuration weight for the detection scenario and pre-stored in the scenario configuration library.

[0032] Then, the scene matching module generates a corresponding candidate scene list, which contains all scene records whose comprehensive matching scores exceed a preset threshold. If the candidate scene list contains only one scene, that scene is identified as the target detection scene. If the list contains multiple scenes, a rule arbitration process is initiated. The rule arbitration process calls an independently set priority rule library. This priority rule library contains a series of conflict resolution rules. For example, when candidate scenes involve different materials, the scene with higher reflectivity is selected first, or when candidate scenes involve different defects, the scene targeting structural defects rather than appearance defects is selected first. The scene matching module sorts or filters the candidate list according to the currently input set of material and defect types, as well as the attributes of each candidate scene, and finally outputs a uniquely determined target detection scene.

[0033] In this embodiment, scene matching is transformed from precise searching based on strings or enumeration values ​​to a flexible decision-making process based on feature vector similarity calculation and conflict rule arbitration. This can handle situations where input parameters do not precisely correspond to preset scenes, and the degree of fit is evaluated quantitatively. Through feature vector and similarity calculation, the system can effectively deal with material or defect combinations not explicitly defined in the configuration library, achieving functional degradation compatibility by finding the closest scene, thus improving the system's fault tolerance. Through configurable weighted fusion and rule arbitration, process knowledge and understanding of the inspection task are transformed into an executable matching strategy, making scene selection more in line with the priority considerations in actual quality control and optimizing the allocation efficiency of inspection resources. The explicit rule arbitration mechanism provides deterministic output for multiple candidate scene situations, avoiding randomness or uncertainty in the matching process.

[0034] In a specific implementation, as one example, the strategy generation module generates detection operation instructions that are adapted to the actual detection scene and environment, based on the target detection scene determined by the scene matching module and the ambient light intensity data of the imaging area collected by the parameter acquisition module, combined with predefined multiple sets of benchmark collaborative detection strategies.

[0035] Specifically, the strategy generation module stores a benchmark collaborative detection strategy library. This library contains multiple predefined benchmark collaborative detection strategies and a corresponding benchmark ambient light intensity L0 for each strategy. Each benchmark collaborative detection strategy corresponds one-to-one with a specific detection scene in the scene configuration library. Each benchmark collaborative detection strategy specifies the light source configuration parameters, image preprocessing parameters, and visual detection algorithm parameters, including: The first collaborative detection strategy is to adapt to the detection scenarios of plastic shell material and surface defects, configure a ring diffuse reflection light source, use adaptive median filtering for image preprocessing, and perform grayscale gradient anomaly detection using a visual detection algorithm. The second collaborative detection strategy is to adapt to the detection scenarios of metal contact materials and surface defects, configure a coaxial oblique light source, use Gaussian filtering and edge enhancement for image preprocessing, and perform crack feature template matching using a visual detection algorithm. The third collaborative detection strategy is to adapt to the detection scenario of assembly defects by configuring a 2D planar camera and a 3D structured light camera to acquire data collaboratively. The image preprocessing adopts threshold segmentation, and the visual detection algorithm performs template matching and localization based on 2D images and assembly size analysis based on 3D point cloud data. The fourth collaborative detection strategy is to adapt to the detection scenarios of plastic shell material and marking defects, configure a bar light source, use character segmentation for image preprocessing, and perform OCR recognition and sharpness detection using visual detection algorithms. The fifth collaborative detection strategy is to adapt to the detection scenarios of metal shell material and marking defects, configure a ring and bar composite light source, use histogram equalization for image preprocessing, and perform character contour matching and position deviation calculation using visual detection algorithms.

[0036] First, the strategy generation module receives the identifier of the target detection scene and real-time ambient light intensity data. Based on the scene identifier, it retrieves and loads the corresponding benchmark collaborative detection strategy from the benchmark collaborative detection strategy library to obtain its benchmark parameter set for the light source, preprocessing, and algorithm. The light source benchmark parameter set includes the light source type, benchmark brightness B0, or angle; the preprocessing benchmark parameter set includes the filtering algorithm, benchmark kernel size, or enhancement coefficient; and the algorithm benchmark parameter set includes the algorithm type or benchmark threshold T0.

[0037] Next, the strategy generation module calculates the illumination deviation factor Δ, Δ=(L-L0) / L0; where L is the real-time ambient light intensity, L0 is the reference ambient light intensity, and Δ is positive if the ambient light is stronger than the reference, and negative if the ambient light is weaker than the reference.

[0038] Then, the strategy generation module performs hierarchical parameter compensation; for light source parameters, compensation is used to counteract the interference of ambient light on the active lighting effect; the compensated light source brightness B is calculated. c This embodiment uses a compensation model: B c=B0×(1-α×Δ), where α is the light source brightness compensation gain coefficient, used to quantify the influence of ambient light changes on the active lighting effect. Its value is related to the optical characteristics of the light source used and the reflective properties of the surface of the material being tested; meanwhile, B c Constrained to the minimum value B allowed by the hardware min With the maximum value B max Between; if the strategy involves multiple light sources, the brightness of each light source is calculated independently according to this model; For preprocessing parameters, compensation is used to adjust the intensity of noise suppression and feature enhancement in preprocessing based on changes in overall image illumination. For filtering parameters, such as the Gaussian filter standard deviation σ, the compensation formula is: σ c =σ0×(1+β×Δ), where σ c The standard deviation of the Gaussian filter after compensation is σ0, the standard deviation of the baseline Gaussian filter is β, and the filter adjustment coefficient is used to characterize the influence weight of ambient light changes on image noise level and feature sharpness, and thus determine the adjustment range of the preprocessing filter intensity. Its value is related to the noise model of the camera sensor, the spectral characteristics of ambient light, and the filtering algorithm itself. For enhancement parameters, such as histogram equalization intensity, its compensation coefficient is negatively correlated with Δ. For the algorithm parameters, compensation is used to adapt the algorithm's decision threshold to the changes in the feature distribution of the compensated image; for a threshold T0 based on grayscale or gradient, the compensation formula is: T c =T0×(1+γ×Δ), where T c The compensated threshold for the algorithm is γ, which is the algorithm threshold compensation coefficient. This coefficient is used to convert the overall drift of image feature values ​​caused by ambient light into a precise adjustment of the algorithm's threshold. Its value is directly related to the type of visual feature of the defect and the feature extraction method of the algorithm used. For example, when Δ>0, it indicates stronger ambient light, a brighter overall image, and a potentially larger absolute value of the feature gradient. c The corresponding increase is made to avoid misjudging slight shading as a defect; when Δ < 0, T c The corresponding reduction is made to avoid missing defects caused by weakened contrast.

[0039] Finally, the strategy generation module integrates the compensated light source configuration parameters, image preprocessing parameters, and visual detection algorithm parameters, and generates a structured detection job instruction according to a preset data format. The instruction specifies the illumination parameters of the light source unit, the auxiliary parameters of the image acquisition unit, the preprocessing process parameters of the image processing unit, and the algorithm execution parameters.

[0040] In this embodiment, the binding of the benchmark collaborative detection strategy with the target detection scene ensures that the parameter set is suitable for the inherent characteristics of the material and defects; the dynamic compensation of ambient light intensity offsets the impact of environmental changes on imaging and algorithm recognition, and the compensation coefficient is calculated based on the light deviation to ensure the rationality of the adjustment; the structured detection operation instructions integrate collaborative parameters to ensure the consistency of the actions of each execution unit.

[0041] More specifically, the methods for determining the light source brightness compensation gain coefficient α, the filter adjustment coefficient β, and the algorithm threshold compensation coefficient γ are as follows: Regarding the light source brightness compensation gain coefficient, under the reference ambient light intensity L0, a standard sample is illuminated using a reference light source configuration corresponding to the target detection scene. The standard sample has the same material as the target area of ​​the protector under test. The ambient light intensity L is gradually changed, and the brightness B of the active light source is adjusted simultaneously to ensure that the overall gray-scale mean of the target area or the gray-scale standard deviation of a specific feature area in the image acquired by the camera remains consistent with the reference conditions. Each set of (L, B) data is recorded. Through data analysis, a functional relationship between the light source brightness B and the ambient light intensity L is fitted to maintain stable imaging effect under a specific material and light source combination. The light source brightness compensation gain coefficient is the linear or nonlinear gain parameter derived from this functional relationship. For example, for a combination of highly reflective metal contacts and a coaxial light source, the ambient light interference is strong, and the fitted light source brightness compensation gain coefficient may be close to 0.8. For a combination of a low-reflective plastic shell and a ring diffuse reflection light source, the ambient light influence is weak, and the light source brightness compensation gain coefficient may be 0.4. The system pre-stores the corresponding light source brightness compensation gain coefficient for each type of light source configuration and material combination in the strategy library. Regarding the filter adjustment coefficient, in a controlled illumination experimental environment, the active light source parameters are fixed as the baseline value. Under the baseline ambient light L0, an image I0 of a standard sample is acquired, containing standard defects or feature patterns. Subsequently, an image set {I} of the same standard sample is acquired under multiple different ambient light intensities L. For each image, its noise index, such as the standard deviation of grayscale calculated in a uniform region, and its feature sharpness index, such as the mean gradient magnitude of the edge region, are calculated. The variation of the above indices with the ambient light intensity L is analyzed. The goal of determining the filter adjustment coefficient is: when the filter parameters are adjusted to compensate for the noise or sharpness changes caused by the changes in L, the processed image should be as close as possible to the effect of the baseline image I0 in terms of noise and feature preservation. The filter adjustment coefficient is essentially a proportional factor that maps the change in ambient light to the relative change in filter parameters. This mapping relationship is obtained through regression analysis of the above calibration data. For the algorithm's threshold compensation coefficient, samples containing typical defects were used to acquire images under a baseline ambient light L0 and multiple different ambient light Ls. All images were illuminated using compensated light source parameters to ensure optimal lighting conditions. For each image, feature values ​​required by the algorithm, such as gray-level difference, maximum gradient, and template matching response value, were extracted from the defect area and adjacent normal areas. The statistical difference between each set of defect feature values ​​and normal feature values ​​was calculated. The trend of this statistical difference with ambient light intensity L was analyzed. The objective of determining the algorithm's threshold compensation coefficient is to ensure that the adjusted threshold T... c It can float in line with the trend of the above-mentioned feature differences, so as to maintain the algorithm's ability to distinguish between defects and background under changing ambient light. Specifically, the algorithm threshold compensation coefficient defines the approximate proportional relationship between the feature difference change rate and the ambient light change rate, which can be obtained by linear regression or piecewise linear fitting of calibration data.

[0042] In some embodiments of the present invention, the collaborative execution module includes a light source unit, an image acquisition unit, and an image processing unit. Each unit interacts with data and responds to commands via a system bus, and the action logic corresponds to the compensated parameters in the work command. The light source unit receives the light source configuration parameters in the work command, including the light source type, compensated brightness, and angle parameters. It starts the corresponding light source component according to the parameters, and the composite light source starts each component light source synchronously according to the command ratio. After the light source is started, the built-in light sensor collects the output brightness in real time and compares it with the compensated brightness in the command. If the deviation exceeds the allowable range, the light source drive current is automatically fine-tuned until the brightness stabilizes at the set value. The coaxial oblique light source maintains the angle set in the command unchanged and adjusts the brightness only through the current to ensure that the lighting direction matches the compensation parameters.

[0043] The image acquisition unit and the light source unit establish a timing synchronization mechanism. After the brightness of the light source unit stabilizes, image acquisition is started after a preset delay to avoid interference with imaging quality caused by transient fluctuations in the light source. During the acquisition process, camera parameters are adjusted according to the operation instructions. When the 2D planar camera and the 3D structured light camera acquire data in concert, they are triggered synchronously according to the instruction timing to ensure that the spatial coordinates of the 2D positioning image and the 3D point cloud data are aligned. After the acquisition is completed, the image data is standardized and cached, and the light source parameters and camera parameters corresponding to the acquisition time are marked synchronously. If the brightness adjustment of the light source unit exceeds the preset threshold, the image acquisition unit is triggered to re-acquire the data synchronously.

[0044] The image processing unit reads the cached image data and associated acquisition and light source parameters, and performs operations step by step according to the preprocessing strategy in the work instruction, adapting to the preprocessing requirements of different benchmark collaborative detection strategies. When performing operations such as filtering, enhancement, and segmentation, it follows the preprocessing parameters after compensation in the instruction to ensure that the processing intensity matches the characteristics of the compensated image. After preprocessing, it extracts corresponding defect features according to the visual detection algorithm strategy in the instruction. Surface defect detection focuses on features such as gray-level gradient and crack contour, assembling the positioning features of the defect detection associated 2D image with the size data of the 3D point cloud, and identifying the character contour, sharpness, and other features extracted by defect detection. During the analysis, it associates the preset defect type and location judgment rules, and simultaneously extracts defect parameters, including size, position deviation, and sharpness index, and integrates the defect type, defect location, defect parameters, and corresponding detection parameters and image frame identifiers to form structured defect information. Meanwhile, the image processing unit also has a built-in image quality judgment module. During the analysis process, it simultaneously detects indicators such as image noise level and contrast. The threshold for indicators that do not meet the standards is set using a benchmark calibration method. For example, under the benchmark ambient light intensity and the benchmark collaborative detection strategy of the corresponding detection scene, 100 defect-free standard qualified protector images are acquired, and the noise level and contrast index of each image are calculated. The arithmetic mean of all image indicators is taken as the benchmark value. The noise level index is quantized using the gray standard deviation of the uniform featureless region of the image, and the unqualified threshold is set to 150% of the benchmark value. The contrast index is quantized using the image gray dynamic range, and the unqualified threshold is set to 70% of the benchmark value. If the indicators do not meet the standards, it is determined that the preceding illumination or acquisition parameters are abnormal. The system bus feeds back the signal to the light source unit and the image acquisition unit, triggering parameter verification and re-execution of the process.

[0045] Although this application has been described in conjunction with specific features and embodiments, it is obvious that various modifications and combinations can be made thereto without departing from the spirit and scope of this application. Accordingly, this specification and drawings are merely exemplary illustrations of the application as defined herein, and are to be considered as covering any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from its scope. Thus, if such modifications and modifications fall within the scope of this application and its equivalents, this application intends to include such modifications and modifications.

Claims

1. A machine vision-based defect detection system for protectors, characterized in that, include: The parameter acquisition module is used to acquire the material type and defect type of the protector to be inspected, as well as the ambient light intensity of the imaging area in real time. The scene matching module is used to match and determine the current target detection scene from a combination of the material type and the type of defect to be inspected; The strategy generation module is used to call the corresponding benchmark collaborative detection strategy according to the target detection scenario, and to perform dynamic parameter compensation on the benchmark collaborative detection strategy based on the ambient light intensity to generate detection operation instructions; The benchmark collaborative detection strategy defines the collaborative relationship between the light source configuration strategy, image preprocessing strategy, and visual detection algorithm execution strategy adapted to the target detection scenario; The collaborative execution module is used to execute the above-mentioned operation instructions and obtain the defect information of the protector to be tested.

2. The machine vision-based protector defect detection system according to claim 1, characterized in that, The types of defects to be inspected include at least one of surface defects, marking defects, and assembly defects.

3. The machine vision-based protector defect detection system according to claim 2, characterized in that, The defects in the markings include content defects, appearance quality defects, and positional defects in the printed marking information.

4. The machine vision-based protector defect detection system according to claim 3, characterized in that, The benchmark collaborative detection strategy includes: The first collaborative solution for plastic shell material with surface defects is configured with a ring diffuse reflection light source, preprocessed with adaptive median filtering, and executed with a gray-scale gradient anomaly detection algorithm. The second collaborative scheme for metal contact material with surface defects involves configuring a coaxial oblique light source, using Gaussian filtering and edge enhancement for preprocessing, and executing a crack feature template matching algorithm. For the third collaborative solution for assembly defects, a 2D planar camera and a 3D structured light camera are configured to collaboratively acquire images, and template matching and positioning based on 2D images and assembly dimension analysis algorithms based on 3D point cloud data are executed. The fourth collaborative solution, which targets plastic shell material and defects classified as identification defects, is equipped with a bar light source, preprocesses the data using character segmentation, and executes OCR recognition and sharpness detection algorithms. The fifth collaborative scheme, which targets metal casings and identifies defects as identification defects, employs a composite light source, preprocesses the defects using histogram equalization, and executes character contour matching and position deviation calculation algorithms.

5. The machine vision-based protector defect detection system according to claim 4, characterized in that, The collaborative execution module includes: The light source unit is used to provide illumination according to the light source configuration strategy in the detection operation instruction; An image acquisition unit is used to acquire an image of the protector to be tested under the illumination conditions of the light source unit; The image processing unit is used to process and analyze the image according to the image preprocessing strategy and visual detection algorithm execution strategy in the detection job instruction, and output the defect detection result.

6. The machine vision-based protector defect detection system according to claim 5, characterized in that, The defect detection results include the defect type, defect location, and defect parameters.

7. The machine vision-based protector defect detection system according to claim 1, characterized in that, The parameter acquisition module includes: The RFID read / write unit is used to read the RFID tag pre-installed on the protector to be tested in order to obtain initial information about the material type. An optical reflectivity detection unit, located downstream of the RFID read / write unit, is used to emit detection light onto the surface of the protector and receive reflected light to calculate the actual reflectivity. The parameter acquisition module is configured to verify whether the initial information of the material type matches the actual reflectivity according to a preset material reflectivity mapping relationship, and to confirm the final material type based on the verification result.

8. The machine vision-based protector defect detection system according to claim 1, characterized in that, The scene matching module is configured as follows: The received material type and the defect type to be inspected are mapped to the corresponding material feature vector and defect feature vector, respectively. Calculate the first similarity between the material feature vector and the predefined material feature vector group of each detection scenario, and the second similarity between the defect feature vector and the defect feature vector group of each detection scenario; Based on the first similarity and the second similarity, the target detection scene is determined from the predefined detection scene.

9. The machine vision-based protector defect detection system according to claim 8, characterized in that, The scene matching module is also configured as follows: When the number of candidate detection scenarios determined based on similarity is greater than 1, a pre-set priority rule base is invoked for arbitration. The priority rule base includes decision rules for making a unique choice among multiple candidate scenarios.

10. The machine vision-based protector defect detection system according to claim 1, characterized in that, The strategy generation module is configured as follows: According to the target detection scenario, the corresponding benchmark collaborative detection strategy is invoked. The benchmark collaborative detection strategy includes benchmark ambient light intensity, light source benchmark parameters, image preprocessing benchmark parameters, and visual detection algorithm benchmark parameters. Calculate the deviation factor between the real-time ambient light intensity and the reference ambient light intensity; Based on the deviation factor, the light source reference parameters, image preprocessing reference parameters, and visual detection algorithm reference parameters are compensated in layers to generate the detection operation instruction.

Citation Information

Patent Citations

  • Mobile phone shell production quality detection method and device based on machine vision

    CN120782744A

  • Blank defect visual inspection method and system for plastic extruder

    CN121391841A

  • Plastic product flaw online detecting and sorting system based on machine vision

    CN121499378A

  • Toy part quality detection system and method based on image recognition

    CN121563874A