Detection and judgment method and device for simple cattle assembling machine
Through the method of automatically obtaining and optimizing light source and image processing parameters, the problem of inefficient manual adjustment of Jianniu connector detection parameters in flexible production lines is solved, and an efficient and automated detection process is realized, which improves the line replacement and detection efficiency of the production line.
Patent Information
- Application Number
- CN202510467562.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-15
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-04-15
AI Technical Summary
In the prior art, when replacing product models of flexible production lines, the detection parameters of Jianniu connectors require a lot of manual intervention, resulting in low efficiency in line replacement of production lines and unable to meet the rapid flexible production needs of modern electronic product manufacturing.
Through the automated detection method, the light source parameters and image processing algorithm parameters are automatically obtained according to the specifications of the Jianniu connector, image acquisition and processing are carried out, detection accuracy is evaluated, and the light source and image processing algorithm parameters are adaptively optimized when insufficient until the preset goal is reached.
It realizes efficient and automated inspection of Jianniu connectors, improves the line replacement efficiency and detection efficiency of flexible production lines, and ensures detection accuracy.
Smart Images

Figure CN120374564A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of detection technology, and particularly to a detection and determination method and device for a simplex connector assembly machine. Background Art
[0002] Currently, in order to improve production capacity, electronic product manufacturing factories generally adopt high-speed automated simplex connector assembly lines. In order to better meet the market demand for diversified products, the flexible production mode has gradually become the mainstream trend, and it has become normal for production lines to frequently switch different models of electronic products. This flexible production mode requires the production line to frequently detect simplex connectors of various specifications to ensure product quality. However, on existing production lines, traditional detection equipment still highly relies on manual off-line operations when switching product models. The specific operations include manually replacing mechanical tooling adapted to specific specifications of simplex connectors, and manually adjusting various parameters of the vision detection system by professional personnel, such as key detection parameters like light source brightness, camera focal length, and image processing algorithm parameters. The above-mentioned manual adjustment process is not only cumbersome and complex, but also time-consuming, seriously restricting the ability of the production line to quickly change lines, and has become a key bottleneck restricting the improvement of flexible production efficiency. Especially in the context of the increasingly rapid update rate of electronic products and the rapidly changing market demand, this inefficient manual adjustment detection method has obviously been unable to meet the urgent needs of high-speed flexible production in modern electronic product manufacturing, seriously restricting the development of the industry.
[0003] In view of the above problems, the existing technology urgently needs to be improved. Summary of the Invention
[0004] In view of the deficiencies of the above-mentioned existing technology, the present application provides a detection and determination method and device for a simplex connector assembly machine, which solves the problem of low efficiency caused by manual adjustment of simplex connector detection parameters in a flexible production line through automated detection and adjustment, and has the beneficial effect of improving the line change efficiency and detection efficiency of the flexible production line.
[0005] In a first aspect, a detection and determination method for a simplex connector assembly machine is used in a flexible production line of electronic products. When the production line switches product models, it automatically detects and determines different specifications of simplex connectors. The method includes the following steps:
[0006] S1: Obtain corresponding light source parameters and image processing algorithm parameters according to the specifications of the currently to-be-detected simplex connector;
[0007] S2: Collect the original image of the currently to-be-detected simplex connector under the light source parameters;
[0008] S3: Process the original image using the image processing algorithm parameters to obtain the detection result of the simplex connector;
[0009] S4: Evaluate the current detection accuracy rate according to the detection result.
[0010] S5: If the detection accuracy rate is lower than the preset target value, adjust the light source parameters and image processing algorithm parameters according to the preset optimization strategy, collect the image of the current to-be-detected simple bull connector under the adjusted light source parameters, and detect the image by using the adjusted image processing algorithm parameters until the detection accuracy rate reaches the preset target value.
[0011] Further, step S1 includes:
[0012] S11: Receive a specification data packet including the model, size, and material information of the current to-be-detected simple bull connector.
[0013] S12: Analyze the specification data packet, extract the model information of the current to-be-detected simple bull connector, and construct a hash index key based on the model information.
[0014] S13: Use the hash index key to perform a quick search in the preset detection parameter database. If the search hits, directly obtain the corresponding light source parameters and image processing algorithm parameters; if the search misses, calculate the similarity between the model information and the existing model information in the database, select the model with the highest similarity, and prompt the operator to confirm whether to use the parameters corresponding to this model.
[0015] Further, step S3 includes:
[0016] S31: Preprocess the collected image by using the image processing algorithm parameters to extract the target region image of the simple bull connector.
[0017] S32: Perform a Fourier transform on the target region image to filter out high-frequency noise and low-frequency illumination change components to obtain an enhanced image.
[0018] S33: Use morphological opening and closing operations to smooth the details of the enhanced image to eliminate small interferences and obtain a smoothed detail image.
[0019] S34: According to the detail image, extract the edge, hole, and size feature parameters of the current to-be-detected simple bull connector, compare them with the preset standard parameters, determine whether there are defects in the simple bull connector, and generate a detection result.
[0020] Further, step S31 includes:
[0021] S311: Determine the position range of the simple cow connector in the original image according to the image processing algorithm parameters, and based on the position range, adopt a multi-scale sliding window strategy to slide different-sized windows in the original image and extract image patches from each window;
[0022] S312: For each of the image patches, calculate the gradient magnitude and gradient direction, and statistically analyze the gradient direction histogram. According to the peak distribution of the gradient direction histogram, determine whether the image patch contains the edge features of the current simple cow connector to be detected;
[0023] S313: Merge the image patches containing the edge features, and calculate the area and perimeter of the merged region. If the ratio of the area to the perimeter is greater than a preset threshold and the average gradient magnitude of the merged region is greater than a preset gradient threshold, then determine that this region is the target region of the simple cow connector, and extract the image of the target region.
[0024] Further, step S4 includes:
[0025] S41: According to the detection result, extract the defect type and defect quantity information of the current simple cow connector to be detected, and combine with the preset defect weight coefficient corresponding to the defect type to calculate the comprehensive defect score;
[0026] S42: According to the comprehensive defect score, classify the quality level of the current simple cow connector to be detected into three levels: qualified, acceptable, and unqualified, and count the number of simple cow connectors in each level;
[0027] S43: According to the number of the current simple cow connectors to be detected in each level, calculate the qualified rate, acceptable rate, and unqualified rate, and calculate the comprehensive quality index according to the preset weight coefficient corresponding to the quality level;
[0028] S44: Compare the comprehensive quality index with the preset quality target value. If the comprehensive quality index is greater than or equal to the quality target value, then determine that the current detection accuracy rate reaches the preset target value; otherwise, determine that the current detection accuracy rate is lower than the preset target value.
[0029] Further, step S41 includes:
[0030] S411: According to the detection result, extract the defect type and defect quantity information of the current simple cow connector to be detected, query the preset defect knowledge base, and obtain the defect severity level corresponding to the defect type;
[0031] S412: Select the corresponding defect weight coefficient from the preset defect weight coefficient table according to the defect severity level;
[0032] S413: Multiply the number of defects by the corresponding defect weight coefficient to obtain the weighted number of defects, and sum the weighted numbers of defects for all the defect types to obtain the comprehensive defect score.
[0033] Further, step S5 includes:
[0034] S51: If the detection accuracy rate is lower than the preset target value, construct a parameter space for the light source parameters and the image processing algorithm parameters. The parameter space includes multiple parameter combinations, each parameter combination corresponding to a set of the light source parameters and the image processing algorithm parameters, and assign a unique index value to each parameter combination;
[0035] S52: Select a parameter combination according to the preset optimization strategy, and use the index value of the parameter combination as the current index value;
[0036] S53: Adjust the light source parameters and the parameters of the image processing algorithm according to the parameter combination corresponding to the current index value;
[0037] S54: Collect an image of the current to-be-detected simple bull connector under the adjusted light source parameters, and detect the image by using the adjusted parameters of the image processing algorithm to obtain the detection accuracy rate, and record the corresponding relationship between the current index value and the detection accuracy rate;
[0038] S55: Determine whether the detection accuracy rate reaches the preset target value. If it reaches, end the optimization; otherwise, select the next parameter combination from the parameter space according to the preset optimization strategy in combination with the recorded corresponding relationship between the index value and the detection accuracy rate, use the index value of the parameter combination as the current index value, and return to execute S53 until the detection accuracy rate reaches the preset target value or the parameter space is traversed.
[0039] Further, step S53 includes:
[0040] S531: According to the current index value, obtain the corresponding light source brightness value, light source color temperature value, image filtering algorithm type, image filtering parameters, and edge detection algorithm type from the preset parameter space lookup table;
[0041] S532: Adjust the light source parameters according to the light source brightness value and the light source color temperature value;
[0042] S533: Adjust the parameters of the image processing algorithm according to the image filtering algorithm type, the image filtering parameters, and the edge detection algorithm type.
[0043] Further, step S533 includes:
[0044] S5321: Send a brightness adjustment command and a color temperature adjustment command according to the light source brightness value and the light source color temperature value, and monitor the actual brightness value and the actual color temperature value of the light source in real time;
[0045] S5322: Calculate the first difference between the actual brightness value and the preset target brightness value, and the second difference between the actual color temperature value and the preset target color temperature value. When the first difference and the second difference are greater than the allowed deviation value, resend the adjustment command until the first difference and the second difference are less than or equal to the allowed deviation value.
[0046] In a second aspect, a detection and determination device for a simplex assembly machine is applied to the steps of the detection and determination method for the simplex assembly machine according to any one of the above. The device includes:
[0047] A data acquisition module for obtaining corresponding light source parameters and image processing algorithm parameters according to the specifications of the current simplex connector to be detected;
[0048] An image acquisition module for acquiring an image of the current simplex connector to be detected under the light source parameters;
[0049] An image processing module for processing the acquired image by using the image processing algorithm parameters to obtain a detection result of the simplex connector;
[0050] A performance evaluation module for evaluating the current detection accuracy rate according to the detection result;
[0051] A parameter optimization module for, if the detection accuracy rate is lower than the preset target value, adjusting the light source parameters and the image processing algorithm parameters according to a preset optimization strategy, acquiring an image of the current simplex connector to be detected under the adjusted light source parameters, and detecting the image by using the adjusted image processing algorithm parameters until the detection accuracy rate reaches the preset target value.
[0052] Beneficial effects: A detection and determination method and device for a SIM card socket assembly machine proposed in this application achieve automatic detection parameter adjustment through the following steps: First, according to the specifications of the SIM card socket connector to be detected, the corresponding light source parameters and image processing algorithm parameters are automatically obtained, eliminating the need for manual parameter search and setting, and realizing the automatic configuration of detection parameters; Next, an image of the SIM card socket connector is collected under the obtained light source parameters to provide image data for subsequent image processing; Then, the obtained image processing algorithm parameters are used to process and detect the image to obtain the detection result, realizing automatic detection; The detection accuracy is evaluated to provide performance feedback for subsequent parameter optimization; Finally, when the detection accuracy is insufficient, the light source parameters and image processing algorithm parameters are automatically adjusted according to the preset optimization strategy, and the image acquisition and detection steps are repeated until the detection accuracy reaches the preset target value. The self-adaptive optimization ability of the detection system is realized. Through the above steps, this technical solution can automatically adjust the detection parameters according to different specifications of SIM card socket connectors and perform self-optimization when the detection accuracy is insufficient, thereby improving the line change efficiency and detection efficiency of the flexible production line while ensuring the detection accuracy. Description of the Drawings
[0053] Figure 1 It is a flowchart of a detection and determination method for a SIM card socket assembly machine proposed in this application.
[0054] Figure 2 It is a structural diagram of a detection and determination device for a SIM card socket assembly machine proposed in this application.
[0055] Label description: 201, data acquisition module; 202, image acquisition module; 203, image processing module; 204, performance evaluation module; 205, parameter optimization module. Specific Embodiments
[0056] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and marked in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the present application to be protected, but only represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present application.
[0057] It should be noted that similar reference numerals and letters denote similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, terms such as "first" and "second" are only used for distinguishing descriptions and cannot be construed as indicating or implying relative importance.
[0058] Please refer to Figure 1 , in a first aspect, a detection and determination method for a single in-line (SIL) connector assembly machine, which is used in a flexible production line of electronic products. When switching product models on the production line, it automatically detects and determines different specifications of SIL connectors. The method includes the steps:
[0059] S1: According to the specifications of the current SIL connector to be detected, obtain the corresponding light source parameters and image processing algorithm parameters;
[0060] S2: Under the light source parameters, collect the original image of the current SIL connector to be detected;
[0061] S3: Use the image processing algorithm parameters to process the original image to obtain the detection result of the SIL connector;
[0062] S4: According to the detection result, evaluate the current detection accuracy rate;
[0063] S5: If the detection accuracy rate is lower than the preset target value, then adjust the light source parameters and image processing algorithm parameters according to the preset optimization strategy, collect the image of the current SIL connector to be detected under the adjusted light source parameters, and use the adjusted image processing algorithm parameters to detect the image until the detection accuracy rate reaches the preset target value.
[0064] Among them, in step S1, obtaining the light source parameters and image processing algorithm parameters according to the specifications of the SIL connector is realized by establishing a database storing various specifications of SIL connectors and their corresponding detection parameters. When it is necessary to detect a SIL connector of a specific specification, the system queries this database and automatically obtains the preset light source parameters, such as light source brightness and color temperature, and image processing algorithm parameters, such as filtering algorithm and edge detection algorithm.
[0065] In step S2, under the obtained light source parameters, control the image acquisition device to collect the image of the SIL connector. The adjustment of the light source parameters is achieved by sending control instructions to the light source controller. The image acquisition device can be an industrial camera, and the image data is used for subsequent image processing and detection.
[0066] In step S3, the acquired image is processed using the image processing algorithm parameters obtained in step S1. Image processing may include image preprocessing operations such as denoising, contrast enhancement, as well as feature extraction and defect detection algorithms. The detection result is the determination information about the quality status of the simplex connector, such as whether there are defects, defect types, defect locations, etc.
[0067] In step S4, based on the detection result of step S3, the current detection accuracy is evaluated. The evaluation process requires preset evaluation criteria and target values for the detection accuracy. The evaluation criteria may include indicators such as the qualified rate, false detection rate, and missed detection rate.
[0068] In step S5, when the detection accuracy evaluated in step S4 does not reach the preset target value, the system starts the parameter optimization process. The parameter optimization strategy can be a preset parameter adjustment rule or optimization algorithm, such as traversing parameter combinations, gradient descent algorithm, etc. By adjusting the light source parameters and image processing algorithm parameters, and repeating the image acquisition and detection steps, the detection parameters are continuously iteratively optimized until the detection accuracy reaches the preset target value.
[0069] Specifically, when detecting simplex connectors on the flexible production line of electronic products, first, the detection system receives the specification information of the current simplex connector to be detected. According to this specification information, the system automatically retrieves and obtains the corresponding light source parameters and image processing algorithm parameters from the preset parameter database. The light source parameters are used to control the lighting system to ensure that images are acquired under suitable lighting conditions; the image processing algorithm parameters are used to guide the subsequent image analysis and defect detection process. Under the action of the light source parameters, the image acquisition device captures the image of the simplex connector. After obtaining the image, the image processing module loads and executes the preset image processing algorithm, analyzes the image, extracts the key features of the simplex connector, such as edges, holes, dimensions, etc., and compares the extracted features with the preset standard parameters to determine whether there are defects in the simplex connector and output the detection result. Subsequently, the system calculates the detection accuracy, such as the qualified rate, based on the detection result. If the detection accuracy is lower than the set target value, it indicates that the current combination of detection parameters may not be optimal. At this time, the system automatically adjusts the light source parameters and image processing algorithm parameters according to the preset optimization strategy, such as adjusting the light source brightness and replacing the image filtering algorithm. After completing the parameter adjustment, the system re-acquires the image and performs the detection, and evaluates the detection accuracy again. This adaptive optimization process is repeated until the detection accuracy reaches the preset target, so as to achieve efficient and accurate detection of different specifications of simplex connectors.
[0070] Furthermore, step S1 includes:
[0071] S11: Receive a specification data packet containing the model, size, and material information of the current simplex connector to be detected;
[0072] S12: Parse the specification data packet, extract the model information of the current Simplex connector to be detected, and construct a hash index key based on the model information;
[0073] S13: Use the hash index key to perform a quick search in the preset detection parameter database. If the search hits, directly obtain the corresponding light source parameters and image processing algorithm parameters; if the search misses, calculate the similarity between the model information and the existing model information in the database, select the model with the highest similarity, and prompt the operator to confirm whether to use the parameters corresponding to this model.
[0074] Among them, in step S11, the specification data packet is received, and the packet encapsulates the detailed specification information of the current Simplex connector to be detected, and this information forms the basis for the subsequent rapid acquisition of parameters.
[0075] In step S12, the specification data packet is parsed, the model information is extracted, and a hash index key is constructed based on the model information. For example, the construction of the hash index key can process the model information through a hash algorithm to generate a unique hash value, and this hash value will be used as the index for the quick search.
[0076] In step S13, the hash index key is used to perform a quick search in the preset detection parameter database. The database pre-stores the light source parameters and image processing algorithm parameters corresponding to various models of Simplex connectors. If the search hits during the retrieval process, it means that the parameter configuration of the current model exists in the database, and the parameters are directly obtained, realizing the rapid automatic loading of the parameters. If the search misses, the system calculates the similarity between the current model information and the existing model information in the database. For example, the similarity calculation can adopt the edit distance algorithm or the cosine similarity algorithm to evaluate the similarity degree between the model information. The model with the highest similarity is selected, and the operator is prompted to confirm whether to use the parameters corresponding to this model, ensuring that the system still has a certain degree of intelligence and flexibility when the database does not completely cover all models. With the assistance of the operator, the parameters can be quickly determined.
[0077] Further, step S3 includes:
[0078] S31: Use the image processing algorithm parameters to preprocess the collected image and extract the target area image of the Simplex connector;
[0079] S32: Perform a Fourier transform on the target area image to filter out high-frequency noise and low-frequency illumination change components to obtain an enhanced image;
[0080] S33: Use morphological opening and closing operations to smooth the details of the enhanced image to eliminate small interferences and obtain a smoothed detailed image;
[0081] S34: Extract the edge, hole, and size feature parameters of the current to-be-detected box header connector from the detailed image, compare them with the preset standard parameters, determine whether there are defects in the box header connector, and generate a detection result.
[0082] Among them, in step S31, image preprocessing and target region extraction are performed, the image processing range is reduced, the processing efficiency is improved, the noise interference in the non-target region is reduced, and a clearer processing object is provided for subsequent image processing steps. The preprocessing operations can include operations such as image grayscale conversion and image denoising. The target region extraction can be achieved by defining the region of interest (ROI) or image segmentation algorithms.
[0083] In step S32, the Fourier transform is performed on the target region image, and the image is converted from the spatial domain to the frequency domain. In the frequency domain, the high-frequency components and low-frequency components are processed separately, and the high-frequency noise and low-frequency illumination change components are filtered out, and the image quality is improved. Frequency domain filtering can be implemented using a band-stop filter or a high-pass filter, etc.
[0084] In step S33, morphological opening and closing operations are used to enhance the image, the image details are smoothed, the small interferences are eliminated, and the detailed image is clearer and more regular. The specific parameters of the morphological operations, such as the size and shape of the structural element, can be adjusted according to the actual application requirements.
[0085] In step S34, the feature parameters such as the edge, hole, and size of the box header connector are extracted from the detailed image, compared with the preset standard parameters, the defects of the box header connector are accurately judged, and the detection result is finally generated. The extraction of feature parameters can be achieved using edge detection operators, hole filling algorithms, and size measurement tools, etc.
[0086] Further, step S31 includes:
[0087] S311: According to the image processing algorithm parameters, determine the position range of the box header connector in the original image, and based on the position range, adopt a multi-scale sliding window strategy, slide the windows of different sizes in the original image, and extract image patches from each window;
[0088] S312: For each image patch, calculate the gradient magnitude and gradient direction, and statistically calculate the gradient direction histogram. According to the peak distribution of the gradient direction histogram, judge whether the image patch contains the edge feature of the current to-be-detected box header connector;
[0089] S313: Merge the image patches containing the edge features, and calculate the area and perimeter of the merged region. If the ratio of the area to the perimeter is greater than the preset threshold, and the average gradient magnitude of the merged region is greater than the preset gradient threshold, then determine that this region is the target region of the box header connector, and extract the target region image.
[0090] Among them, in step S311, when the multi-scale sliding window strategy is specifically implemented, the window size can be set to include but not limited to three sizes. For example, 5x5 pixels, 10x10 pixels, and 15x15 pixels. These windows slide at a step size of 1 pixel within the preset position range of the original image, so as to ensure effective coverage of the edge features of the simple cow connectors of different sizes.
[0091] In step S312, for the statistics of the histogram of gradient directions, the gradient direction range from 0 to 180 degrees is divided into, for example, 9 image blocks, each with a width of 20 degrees. The number of pixels whose gradient directions fall into each image block within each image block is counted. The peak distribution of the histogram of gradient directions is defined as the maximum peak in the histogram exceeding the preset threshold, and the gradient directions corresponding to the peaks are concentrated in, for example, two adjacent image blocks, indicating that there are edge features with concentrated directions within the image block.
[0092] In step S313, the preset threshold for the ratio of area to perimeter is set to, for example, 0.5, and the preset gradient threshold for the average gradient magnitude is set to, for example, 50. When the merged region satisfies the two conditions that the ratio of area to perimeter is greater than 0.5 and the average gradient magnitude is greater than 50, this region is determined as the target region of the simple cow connector.
[0093] Further, step S4 includes:
[0094] S41: According to the detection results, extract the defect type and defect quantity information of the currently to-be-detected simple cow connector, and combine with the preset defect weight coefficients corresponding to the defect types to calculate the comprehensive defect score;
[0095] S42: According to the comprehensive defect score, classify the quality level of the currently to-be-detected simple cow connector into three levels: qualified, acceptable, and unqualified, and count the number of simple cow connectors in each level;
[0096] S43: According to the number of currently to-be-detected simple cow connectors in each level, calculate the qualification rate, acceptance rate, and unqualified rate, and calculate the comprehensive quality index according to the preset weight coefficients corresponding to the quality levels;
[0097] S44: Compare the comprehensive quality index with the preset quality target value. If the comprehensive quality index is greater than or equal to the quality target value, it is determined that the current detection accuracy rate reaches the preset target value; otherwise, it is determined that the current detection accuracy rate is lower than the preset target value.
[0098] Among them, for step S41, the combination of defect type and defect weight coefficient is performed to calculate the comprehensive defect score. Specifically, a defect knowledge base can be established in advance, in which various possible defect types are stored. For example, the possible defect types of the Jianniu connector include pin missing, pin bending, surface scratches, etc. Each defect type is assigned a preset defect severity level. For example, the severity level of pin missing is higher than that of surface scratches. Subsequently, based on the defect severity level, the corresponding defect weight coefficient is selected from the preset defect weight coefficient table. The defect weight coefficient table defines the mapping relationship between different severity levels and weight coefficients. The higher the severity level, the higher the corresponding weight coefficient. When the comprehensive defect score is actually calculated, the number of defects is multiplied by the corresponding defect weight coefficient to obtain the weighted number of defects. The weighted defect numbers of all defect types are summed up, and the comprehensive defect score is finally obtained. As a result, the severity of different types of defects is distinguished in the comprehensive defect score, making the defect assessment more refined.
[0099] For step S42, quality grade division and quantity statistics are performed. Specifically, a threshold range of the comprehensive defect score is pre-set to divide the quality into three levels: qualified, acceptable and unqualified. For example, a comprehensive defect score between 0-2 points is divided into a qualified level, between 3-5 points is divided into an acceptable level, and above 5 points is divided into an unqualified level. After obtaining the comprehensive defect score of each Jianniu connector, the quality level to which it belongs is determined according to the preset threshold range, and the number of Jianniu connectors of each level is counted.
[0100] For step S43, the calculation of the comprehensive quality index is performed. Specifically, the weight coefficient corresponding to the quality grade is pre-set, for example, the weight coefficient of the qualified grade is 1, the weight coefficient of the acceptable grade is 0.8, and the weight coefficient of the unqualified grade is 0. Based on the number of connectors of each grade, the qualified rate, the acceptable rate and the unqualified rate are calculated. Then, the yield rate of each grade is multiplied by the corresponding weight coefficient to obtain the weighted yield rate. The weighted yield rates of all quality grades are summed to calculate the comprehensive quality index. As a result, the comprehensive quality index takes into account the weights of different quality grades and can more comprehensively reflect the overall quality level of the product.
[0101] For step S44, the determination of the detection accuracy is performed. Specifically, a quality target value is preset, and the quality target value represents the minimum comprehensive quality index expected to be achieved. The comprehensive quality index is compared with the preset quality target value. If the comprehensive quality index is greater than or equal to the quality target value, it is determined that the current detection accuracy reaches the preset target value; otherwise, it is determined that the current detection accuracy is lower than the preset target value. Therefore, whether the detection accuracy meets the preset target is quantitatively determined, providing a clear evaluation basis for subsequent parameter optimization.
[0102] Furthermore, step S41 includes:
[0103] S411: According to the detection results, extract the defect type and defect quantity information of the current simple bull connector to be detected, query the preset defect knowledge base, and obtain the defect severity level corresponding to the defect type;
[0104] S412: According to the defect severity level, select the corresponding defect weight coefficient from the preset defect weight coefficient table;
[0105] S413: Multiply the defect quantity by the corresponding defect weight coefficient to obtain the weighted defect quantity, sum up the weighted defect quantities of all defect types, and obtain the comprehensive defect score.
[0106] Among them, for step S411, the defect knowledge base can be implemented in the form of a database or a data table, where each defect type is associated with a preset severity level. The defect severity level is a quantification of the defect hazard degree, which can be divided into multiple levels, such as minor, medium, severe, etc., or represented by a numerical value. The larger the numerical value, the higher the defect degree.
[0107] For step S412, the weight coefficient table can be implemented in the form of a table or a mapping, where each defect severity level corresponds to a preset weight coefficient. The numerical value of the weight coefficient is positively correlated with the defect severity level, that is, the higher the defect severity level, the larger the corresponding weight coefficient.
[0108] Finally, in step S4, multiply the defect quantity of each defect type by its corresponding weight coefficient to obtain the weighted defect quantity. By summing up the weighted defect quantities of all defect types, a comprehensive defect score is calculated.
[0109] Furthermore, step S5 includes:
[0110] S51: If the detection accuracy rate is lower than the preset target value, construct a parameter space of light source parameters and image processing algorithm parameters. The parameter space includes multiple parameter combinations, each parameter combination corresponds to a set of light source parameters and image processing algorithm parameters, and assign a unique index value to each parameter combination;
[0111] S52: According to the preset optimization strategy, select a parameter combination, and use the index value of the parameter combination as the current index value;
[0112] S53: According to the parameter combination corresponding to the current index value, adjust the light source parameters and the parameters of the image processing algorithm;
[0113] S54: Collect the image of the current to-be-detected SIM card socket connector under the adjusted light source parameters, and detect the image using the adjusted image processing algorithm parameters to obtain the detection accuracy rate. Meanwhile, record the corresponding relationship between the current index value and the detection accuracy rate.
[0114] S55: Determine whether the detection accuracy rate reaches the preset target value. If it reaches, end the optimization; otherwise, according to the preset optimization strategy, combined with the recorded corresponding relationship between the index value and the detection accuracy rate, select the next parameter combination from the parameter space, use the index value of this parameter combination as the current index value, and return to execute S53 until the detection accuracy rate reaches the preset target value or the parameter space is traversed.
[0115] Among them, in step S51, the possible value ranges of the light source parameters and the image processing algorithm parameters are determined in advance. For example, the light source brightness value can be set to three levels: 100, 200, and 300 lumens, the light source color temperature value can be set to two levels: cold light and warm light, the types of image filtering algorithms can include mean filtering and Gaussian filtering, and the types of edge detection algorithms can include Canny edge detection and Sobel edge detection.
[0116] In step S52, the optimization strategy can be algorithms such as exhaustive search, random search, and gradient descent. The exhaustive search strategy tries parameter combinations one by one according to the order of the index values of the parameter combinations. The random search strategy randomly selects parameter combinations in the parameter space for testing. The gradient descent strategy is based on the existing detection accuracy rate results and selects the direction of the parameter combination with the fastest improvement in the detection accuracy rate for searching.
[0117] In step S53, according to the current index value, find the specific values of the corresponding light source parameters and image processing algorithm parameters from the parameter space. The adjustment of the light source parameters is achieved by controlling the output of the light source controller. For example, send brightness adjustment instructions and color temperature adjustment instructions to the light source controller, and the controller adjusts the brightness value and color temperature value of the light source according to the instructions. The adjustment of the image processing algorithm parameters is achieved by modifying the configuration file of the image processing software or calling the corresponding API interface. For example, set the type and parameters of the filtering algorithm, the type of the edge detection algorithm, etc.
[0118] In step S54, the process of evaluating and recording the detection accuracy rate is executed. Under the adjusted parameters, collect the image of the SIM card socket connector and perform detection to obtain the detection result and the detection accuracy rate. The calculation method of the detection accuracy rate can be to count the detection results of a certain number of SIM card socket connectors and calculate the proportion of qualified products. The current index value and the corresponding detection accuracy rate are recorded for reference in the subsequent optimization strategy.
[0119] In step S55, the optimization iteration process is executed. It is determined whether the current detection accuracy rate has reached a preset target value. If it has reached, the parameter optimization process ends, and the current parameter combination is determined as the optimal parameter. If it has not reached, according to the preset optimization strategy, the next parameter combination is selected from the parameter space. The optimization strategy utilizes the corresponding relationship between the recorded index values and the detection accuracy rate to guide the selection direction of the parameter combination. For example, if the gradient descent strategy is adopted, the parameter combination direction with the fastest increase in the detection accuracy rate is selected. The parameter adjustment, detection accuracy rate evaluation and recording, and optimization iteration process are repeated until the detection accuracy rate reaches the preset target value or the entire parameter space is traversed.
[0120] Further, step S53 includes:
[0121] S531: According to the current index value, obtain the corresponding light source brightness value, light source color temperature value, image filtering algorithm type, image filtering parameter, and edge detection algorithm type from the preset parameter space lookup table;
[0122] S532: Adjust the light source parameters according to the light source brightness value and the light source color temperature value;
[0123] S533: Adjust the image processing algorithm parameters according to the image filtering algorithm type, the image filtering parameter, and the edge detection algorithm type.
[0124] Among them, the parameter space lookup table can be implemented as a database table, a CSV file, or a memory data structure. Each parameter combination is associated with a unique index value and stored in the parameter space lookup table. Step S531 retrieves a corresponding set of specific parameter values, including the light source brightness value, the color temperature value, the image filtering algorithm type, the filtering parameter, and the edge detection algorithm type, from the parameter space lookup table by using the current index value as the retrieval keyword.
[0125] In step S532, the light source control system receives the retrieved light source brightness value and color temperature value, and issues an adjustment instruction accordingly to control the light source hardware to be adjusted to the target brightness value and color temperature value.
[0126] In step S533, the image processing system configures the corresponding algorithms and parameters in the image processing software according to the retrieved image filtering algorithm type, filtering parameter, and edge detection algorithm type. Thus, through the cooperation of the index value and the parameter space lookup table, the automatic configuration of the light source parameters and the image processing algorithm parameters is realized. This method avoids the cumbersome operation of manually adjusting the parameters, and improves the parameter adjustment efficiency and accuracy.
[0127] Further, step S533 includes:
[0128] S5321: Send brightness adjustment instructions and color temperature adjustment instructions based on the light source brightness value and the light source color temperature value, and monitor the actual brightness value and the actual color temperature value of the light source in real time;
[0129] S5322: Calculate the first difference between the actual brightness value and the preset target brightness value, and the second difference between the actual color temperature value and the preset target color temperature value. When the first difference and the second difference are greater than the allowed deviation value, resend the adjustment instructions until the first difference and the second difference are less than or equal to the allowed deviation value.
[0130] Among them, after sending the brightness adjustment instructions and the color temperature adjustment instructions, the system will use sensors to monitor the actual brightness value and the actual color temperature value of the light source in real time. The monitored actual values will be fed back to the control system for subsequent adjustment decisions. The control system then calculates the first difference between the actual brightness value and the preset target brightness value, and the second difference between the actual color temperature value and the preset target color temperature value. These differences represent the degree of deviation between the actual state and the desired state of the light source. The system will preset an allowed deviation value range. When any one of the first difference or the second difference, or both, are greater than this allowed deviation value, the system determines that there is a deviation in the light source parameters and needs to be readjusted. In response, the system will resend the brightness adjustment instructions and the color temperature adjustment instructions for iterative adjustment. This iterative adjustment process will continue until the first difference between the actual brightness value and the preset target brightness value, and the second difference between the actual color temperature value and the preset target color temperature value are both less than or equal to the allowed deviation value. Thus, the light source parameters are accurately adjusted to near the target value, ensuring the stability and accuracy of the lighting conditions in the image acquisition process.
[0131] Please refer to Figure 2 Second, a detection and determination device for a simplex terminal block assembly machine is applied to the steps of a detection and determination method for a simplex terminal block assembly machine according to any one of the above. The device includes:
[0132] A data acquisition module 201, configured to obtain corresponding light source parameters and image processing algorithm parameters according to the specifications of the current simplex terminal block connector to be detected;
[0133] An image acquisition module 202, configured to acquire an image of the current simplex terminal block connector to be detected under the light source parameters;
[0134] An image processing module 203, configured to process the acquired image using the image processing algorithm parameters to obtain a detection result of the simplex terminal block connector;
[0135] A performance evaluation module 204, configured to evaluate the current detection accuracy rate according to the detection result;
[0136] The parameter optimization module 205 is configured to, if the detection accuracy rate is lower than a preset target value, adjust the light source parameters and image processing algorithm parameters according to a preset optimization strategy, collect an image of the current to-be-detected simplex connector under the adjusted light source parameters, and detect the image by using the adjusted image processing algorithm parameters until the detection accuracy rate reaches the preset target value.
[0137] Among them, the data acquisition module 201 is configured to receive simplex connector specification data. The specification data includes model, size, and material information. The data acquisition module parses the specification data packet and extracts the model information. The model information is used to construct a hash index key. The hash index key performs a retrieval in a preset detection parameter database. The database stores the light source parameters and image processing algorithm parameters. The light source parameters include the light source brightness value and the light source color temperature value. The image processing algorithm parameters include the type of image filtering algorithm, the image filtering parameters, and the type of edge detection algorithm. When the retrieval hits, the data acquisition module directly obtains the corresponding parameters. When the retrieval misses, the data acquisition module 201 calculates the similarity between the model information and the existing model information in the database. The model with the highest similarity is selected, and manual confirmation is prompted to determine whether to adopt the corresponding parameters.
[0138] The image acquisition module 202 operates under the light source parameters provided by the data acquisition module. The image acquisition module includes a camera and a light source. The camera is used to capture the original image of the simplex connector. The light source provides the illumination required for image acquisition. The image processing module receives the original image collected by the image acquisition module and the image processing algorithm parameters provided by the data acquisition module.
[0139] The image processing module 203 performs image preprocessing, target region extraction, image enhancement, feature extraction, and defect judgment. Image preprocessing includes image filtering. Target region extraction adopts a multi-scale sliding window strategy. Image enhancement adopts Fourier transform. Feature extraction includes the extraction of edge, hole, and size feature parameters. Defect judgment is achieved by comparing the extracted feature parameters with preset standard parameters.
[0140] The performance evaluation module 204 evaluates the detection accuracy rate. The performance evaluation module analyzes the detection results of the image processing module. The detection results include defect type, defect quantity, and quality grade information. The performance evaluation module calculates a comprehensive defect score and a comprehensive quality index. The comprehensive quality index is compared with a preset quality target value to determine whether the detection accuracy rate reaches the preset target value.
[0141] The parameter optimization module 205 is activated when the detection accuracy rate is lower than the preset target value. The parameter optimization module constructs a parameter space for the light source parameters and the image processing algorithm parameters. The parameter space contains multiple parameter combinations. Each parameter combination corresponds to a set of light source parameters and image processing algorithm parameters. The parameter optimization module 205 selects a parameter combination from the parameter space according to the preset optimization strategy. The parameter optimization module 205 adjusts the light source parameters and the image processing algorithm parameters. The adjusted parameters are used by the data acquisition module and the image processing module for a new round of image acquisition and detection. The parameter optimization module 205 records the correspondence between the parameter combination index value and the detection accuracy rate. The optimization process is iteratively performed until the detection accuracy rate reaches the preset target value or the parameter space is traversed.
[0142] In this document, relational terms such as first and second are used solely to distinguish one entity or action from another entity or action, and do not necessarily require or imply any actual relationship or order between these entities or actions.
[0143] The above description is only for the embodiments of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various changes and modifications. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A detection and determination method for a single in-line (SIL) connector assembly machine, which is used in the flexible production line of electronic products. When the product model is switched on the production line, it automatically detects and determines different specifications of SIL connectors. It is characterized in that, The method includes the steps of: S1: Obtain corresponding light source parameters and image processing algorithm parameters according to the specifications of the current Sub-D connector to be detected; S2: Collect the original image of the current Sub-D connector to be detected under the light source parameters; S3: Process the original image by using the image processing algorithm parameters to obtain the detection result of the Sub-D connector; S4: Evaluate the current detection accuracy rate according to the detection result; S5: If the detection accuracy rate is lower than the preset target value, adjust the light source parameters and image processing algorithm parameters according to the preset optimization strategy, collect the image of the current Sub-D connector to be detected under the adjusted light source parameters, and detect the image by using the adjusted image processing algorithm parameters until the detection accuracy rate reaches the preset target value.
2. The detection and determination method of a simplex socket assembly machine according to claim 1, characterized in that Step S1 includes: S11: Receive a specification data packet including the model, size, and material information of the current Sub-D connector to be detected; S12: Analyze the specification data packet, extract the model information of the current Sub-D connector to be detected, and construct a hash index key based on the model information; S13: Use the hash index key to perform a quick search in the preset detection parameter database. If the search hits, directly obtain the corresponding light source parameters and image processing algorithm parameters; if the search misses, calculate the similarity between the model information and the existing model information in the database, select the model with the highest similarity, and prompt the operator to confirm whether to use the parameters corresponding to this model.
3. The detection and determination method of a simple bull assembly machine according to claim 1, characterized in that, Step S3 includes: S31: Preprocess the collected image by using the image processing algorithm parameters to extract the target region image of the Sub-D connector; S32: Perform a Fourier transform on the target region image to filter out high-frequency noise and low-frequency illumination change components to obtain an enhanced image; S33: Use morphological opening and closing operations to smooth the details of the enhanced image to eliminate small interferences and obtain a smoothed detail image; S34: According to the detail image, extract the edge, hole, and size feature parameters of the current Sub-D connector to be detected, compare them with the preset standard parameters, determine whether there are defects in the Sub-D connector, and generate a detection result.
4. The detection and determination method of a single in-line socket assembly machine according to claim 3, wherein Step S31 includes: S311: Determine the position range of the Sub-D connector in the original image according to the image processing algorithm parameters, and based on the position range, adopt a multi-scale sliding window strategy to slide windows of different sizes in the original image and extract image patches from each window; S312: For each image patch, calculate the gradient magnitude and gradient direction, and statistically analyze the gradient direction histogram. According to the peak distribution of the gradient direction histogram, determine whether the image patch contains the edge features of the current Sub-D connector to be detected; S313: Merge the image patches containing the edge features, and calculate the area and perimeter of the merged region. If the ratio of the area to the perimeter is greater than a preset threshold and the average gradient magnitude of the merged region is greater than a preset gradient threshold, determine that this region is the target region of the Sub-D connector and extract the target region image.
5. The detection and determination method of a simple cow assembler according to claim 1, characterized in that Step S4 includes: S41: Extract the defect type and defect quantity information of the current to-be-detected box header connector according to the detection result, and calculate a comprehensive defect score by combining with the preset defect weight coefficient corresponding to the defect type. S42: Divide the quality grade of the current to-be-detected box header connector into three grades: qualified, acceptable, and unqualified according to the comprehensive defect score, and count the number of box header connectors in each grade. S43: Calculate the qualification rate, acceptance rate, and unqualified rate according to the number of the current to-be-detected box header connectors in each grade, and calculate a comprehensive quality index according to the preset weight coefficient corresponding to the quality grade. S44: Compare the comprehensive quality index with the preset quality target value. If the comprehensive quality index is greater than or equal to the quality target value, it is determined that the current detection accuracy rate reaches the preset target value; otherwise, it is determined that the current detection accuracy rate is lower than the preset target value.
6. The detection and determination method of a simple bull assembly machine according to claim 5, characterized in that, Step S41 includes: S411: Extract the defect type and defect quantity information of the current to-be-detected box header connector according to the detection result, query the preset defect knowledge base, and obtain the defect severity level corresponding to the defect type. S412: Select the corresponding defect weight coefficient from the preset defect weight coefficient table according to the defect severity level. S413: Multiply the defect quantity by the corresponding defect weight coefficient to obtain the weighted defect quantity, sum the weighted defect quantities of all defect types, and obtain the comprehensive defect score.
7. The detection and determination method of a simple cow assembly machine according to claim 1, characterized in that, Step S5 includes: S51: If the detection accuracy rate is lower than the preset target value, construct a parameter space of the light source parameters and the image processing algorithm parameters. The parameter space includes multiple parameter combinations, each parameter combination corresponding to a set of the light source parameters and the image processing algorithm parameters, and assign a unique index value to each parameter combination. S52: Select a parameter combination according to the preset optimization strategy, and use the index value of the parameter combination as the current index value. S53: Adjust the light source parameters and the image processing algorithm parameters according to the parameter combination corresponding to the current index value. S54: Collect an image of the current to-be-detected box header connector under the adjusted light source parameters, and detect the image using the adjusted image processing algorithm parameters to obtain the detection accuracy rate, and record the corresponding relationship between the current index value and the detection accuracy rate. S55: Determine whether the detection accuracy rate reaches the preset target value. If it reaches, end the optimization; otherwise, select the next parameter combination from the parameter space according to the preset optimization strategy in combination with the recorded corresponding relationship between the index value and the detection accuracy rate, use the index value of the parameter combination as the current index value, and return to execute S53 until the detection accuracy rate reaches the preset target value or the parameter space is traversed.
8. A detection and determination method for a simple cow assembly machine according to claim 7, characterized in that, Step S53 includes: S531: According to the current index value, obtain the corresponding light source brightness value, light source color temperature value, image filtering algorithm type, image filtering parameter, and edge detection algorithm type from the preset parameter space lookup table. S532: Adjust the light source parameters according to the light source brightness value and the light source color temperature value; S533: Adjust the image processing algorithm parameters according to the type of the image filtering algorithm, the image filtering parameters, and the type of the edge detection algorithm.
9. The detection and determination method of a single in-line socket assembly machine according to claim 8, characterized in that, Step S533 includes: S5321: Send a brightness adjustment instruction and a color temperature adjustment instruction according to the light source brightness value and the light source color temperature value, and monitor the actual brightness value and the actual color temperature value of the light source in real time; S5322: Calculate a first difference between the actual brightness value and a preset target brightness value, and a second difference between the actual color temperature value and a preset target color temperature value. When the first difference and the second difference are greater than an allowable deviation value, resend the adjustment instruction until the first difference and the second difference are less than or equal to the allowable deviation value.
10. A detection and determination device for a D-Sub assembly machine, characterized in that, In the steps of the detection and determination method of the above-mentioned simple bull assembler applied to any one of claims 1-9, the device includes: A data acquisition module, configured to obtain corresponding light source parameters and image processing algorithm parameters according to the specifications of the current simple bull connector to be detected; An image acquisition module, configured to acquire an image of the current simple bull connector to be detected under the light source parameters; An image processing module, configured to process the acquired image by using the image processing algorithm parameters to obtain a detection result of the simple bull connector; A performance evaluation module, configured to evaluate the current detection accuracy according to the detection result; A parameter optimization module, configured to, if the detection accuracy is lower than a preset target value, adjust the light source parameters and the image processing algorithm parameters according to a preset optimization strategy, acquire an image of the current simple bull connector to be detected under the adjusted light source parameters, and detect the image by using the adjusted image processing algorithm parameters until the detection accuracy reaches the preset target value.
Citation Information
Patent Citations
Visual inspection system for power distributor
CN116840240A
Visual detection system for inner side of belt blank weaving
CN119619003A
Circuit board FQC automatic inspection system and method
CN119715609A
Self-adaptive regulation and control method and device for brightness of wafer detection light source
CN119804330A
Cited By
Plastic film surface defect detection method based on machine vision
CN120976210A
A Machine Vision-Based Method for Detecting Surface Defects in Plastic Films
CN120976210B