Parameter adjustment method and device of visual system, electronic equipment and storage medium
By combining rule-based models and parametric prediction models, the parameters of the vision system are automatically adjusted, solving the problems of low efficiency and large errors in existing technologies. This achieves efficient and accurate parameter adjustment, meeting the operation and maintenance requirements of industrial production.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- DONGGUAN ANDA AUTOMATIC EQUIP
- Filing Date
- 2026-01-13
- Publication Date
- 2026-05-15
AI Technical Summary
Existing vision systems suffer from low parameter adjustment efficiency and large error, failing to meet the timeliness requirements of industrial production operations and maintenance.
Defect detection is performed on the work images using a rule-based model. By combining this with a parameter prediction model to obtain matching adjustment parameters, the parameters of the vision system are automatically adjusted until the detection requirements are met.
It improves the operation and maintenance efficiency of vision systems, reduces manpower and time costs, improves the accuracy of parameter adjustment, avoids incorrect and missed adjustments, and meets the operation and maintenance needs of industrial production.
Smart Images

Figure CN122049313A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of system operation and maintenance, and in particular to a method, apparatus, electronic device and storage medium for adjusting parameters of a vision system. Background Technology
[0002] With the continuous development of computer technology, machine vision systems are widely used in industrial production to achieve target recognition, measurement and control through image acquisition and processing. As a result, the operation and maintenance of vision systems has become an important issue in the field of industrial production.
[0003] Because vision systems are characterized by high precision, it is necessary to adjust their various operating parameters in a timely and accurate manner to ensure that they acquire accurate images of the work. In the existing technology, the parameter adjustment of vision systems is usually based on the operation and maintenance experience of the maintenance personnel. The parameters are adjusted by manually analyzing defective images, and the adjustment is eventually completed through continuous parameter trials.
[0004] However, this method of parameter adjustment is not only inefficient in operation and maintenance, requiring a lot of manpower and time, but also prone to errors and omissions in manual analysis, resulting in large errors in the parameter adjustment results and failing to meet the timeliness requirements of operation and maintenance in industrial production processes. Summary of the Invention
[0005] This invention provides a method, apparatus, electronic device, and storage medium for adjusting parameters of a vision system, in order to solve the problems of low efficiency and large error in parameter adjustment results in vision systems.
[0006] According to another aspect of the present invention, a method for adjusting parameters of a vision system is provided, comprising: In response to acquiring the first task image from the vision system, defect detection is performed on the first task image using a rule model; If it is determined that the first work image fails the defect detection, a matching first adjustment parameter is obtained through a parameter prediction model based on the visual parameters of the vision system, environmental parameters, and the first work image. The vision system is adjusted according to the first adjustment parameter to obtain a second working image after parameter adjustment, and the parameter adjustment quality of the vision system is obtained according to the second working image.
[0007] The step of performing defect detection on the first job image using a rule model includes: performing defect detection on at least one of the following in the first job image: contrast, edge continuity, shape fidelity, and illumination uniformity.
[0008] After determining that the first working image fails the defect detection, the method further includes: obtaining matching second adjustment parameters based on the defect type of the first working image; wherein, if the defect type includes a low contrast defect, the second adjustment parameters include at least one of illumination type, light source angle, and aperture value; if the defect type includes an edge discontinuity defect, the second adjustment parameters include at least one of illumination type, light source angle, and polarizing filter parameter; if the defect type includes a shape fidelity defect, the second adjustment parameters include at least one of lens distortion parameter and lens orientation parameter; if the defect type includes an uneven illumination defect, the second adjustment parameters include at least one of light source type, light source distance, and light source angle; adjusting the parameters of the vision system according to the second adjustment parameters to obtain a parameter-adjusted third working image through the vision system, and obtaining the parameter adjustment quality of the vision system based on the third working image.
[0009] The step of obtaining the parameter adjustment quality of the vision system based on the third task image includes: performing defect detection on the third task image using a rule model, and when it is determined that the third task image fails the defect detection, comparing the defect detection result of the third task image with the defect detection result of the first task image; if it is determined that the defect detection result of the third task image is better than the defect detection result of the first task image, obtaining a matching third adjustment parameter based on the visual parameters and environmental parameters matched with the third task image, and the third task image; adjusting the parameters of the vision system according to the third adjustment parameter to obtain a fourth task image through the vision system, and determining the parameter adjustment quality of the vision system based on the fourth task image.
[0010] The step of obtaining a matching first adjustment parameter through a parameter prediction model based on the visual parameters of the vision system, environmental parameters, and the first job image specifically includes: if it is determined that the defect detection result of the first job image is better than the defect detection result of the third job image, obtaining a matching first adjustment parameter through a parameter prediction model based on the visual parameters and environmental parameters matching the first job image and the first job image.
[0011] The step of obtaining a matching first adjustment parameter through a parameter prediction model based on the visual parameters of the vision system, environmental parameters, and the first task image further includes: obtaining matching alternative adjustment parameters based on the defect type of the first task image, and obtaining the first adjustment parameter through a parameter prediction model based on the visual parameters of the vision system, environmental parameters, the first task image, and the alternative adjustment parameters.
[0012] According to another aspect of the present invention, a parameter adjustment device for a vision system is provided, comprising: The defect detection execution module is used to perform defect detection on the first task image obtained by the vision system using a rule model in response to acquiring the first task image. The adjustment parameter acquisition module is used to obtain a matching first adjustment parameter based on the visual parameters of the vision system, environmental parameters, and the first work image if it is determined that the first work image has failed the defect detection. The adjustment quality acquisition module is used to adjust the parameters of the vision system according to the first adjustment parameter, so as to acquire a second working image after parameter adjustment through the vision system, and to acquire the parameter adjustment quality of the vision system according to the second working image.
[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the parameter adjustment method of the vision system according to any embodiment of the present invention.
[0014] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the parameter adjustment method of the vision system according to any embodiment of the present invention.
[0015] According to another aspect of the present invention, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the parameter adjustment method of the vision system described in any embodiment of the present invention.
[0016] The technical solution of this invention, in response to acquiring a first operational image of the vision system, performs defect detection on the first operational image using a rule model. If it is determined that the first operational image fails the defect detection, a matching first adjustment parameter is obtained based on the visual parameters of the vision system, environmental parameters, and the first operational image, using a parameter prediction model. The vision system is then adjusted according to the first adjustment parameter to acquire a second operational image with adjusted parameters, and the parameter adjustment quality of the vision system is obtained based on the second operational image. Thus, the visual parameter optimization of the vision system through a combination of a rule model and a parameter adjustment model not only improves the operational efficiency of the vision system and reduces the manpower and time costs of parameter adjustment, but also improves the accuracy of the parameter adjustment results, avoiding incorrect or missed adjustments, and meeting the timeliness requirements of industrial production processes.
[0017] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a flowchart of a parameter adjustment method for a vision system according to Embodiment 1 of the present invention; Figure 2 This is a flowchart of another method for adjusting the parameters of a vision system according to Embodiment 2 of the present invention; Figure 3 This is a flowchart of another method for adjusting the parameters of a vision system according to Embodiment 3 of the present invention; Figure 4 This is a flowchart of another method for adjusting the parameters of a vision system according to Embodiment 4 of the present invention; Figure 5 This is a schematic diagram of the structure of a parameter adjustment device for a vision system according to Embodiment 5 of the present invention; Figure 6 This is a schematic diagram of the structure of an electronic device that implements the parameter adjustment method of the vision system according to an embodiment of the present invention. Detailed Implementation
[0020] To enable those skilled in the art to better understand the present invention, 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. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0021] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0022] Example 1 Figure 1 This is a flowchart of a parameter adjustment method for a vision system provided in Embodiment 1 of the present invention. This embodiment is applicable to situations where visual parameters of a vision system are adjusted through defect detection using a rule-based model and parameter prediction using a parameter prediction model. This method can be executed by a parameter adjustment device for the vision system, which can be implemented in hardware and / or software and can be configured in an electronic device. Figure 1 As shown, the method includes: S101. In response to acquiring the first task image of the vision system, perform defect detection on the first task image using a rule model.
[0023] A vision system consists of an image acquisition module and an image processing module. The image acquisition module may include a light source, lens, camera, and image acquisition card, while the image processing module includes various functional software required for image processing. A work image refers to a workpiece or equipment image captured and processed by the vision system in an industrial production environment. Taking screw installation as an example, when screws are automatically installed using industrial equipment, the vision system needs to acquire a detection image of the area where the screw hole is located, and then identify this detection image to locate the screw hole.
[0024] Since the screw hole exists in the form of a circular hole, the above-mentioned working image is actually used to "find the circle", that is, to identify the circular area in the working image (i.e. the first working image) and use it to complete the screw hole positioning. Therefore, whether the first working image can complete the "finding the circle" operation, that is, whether the image quality of the first working image meets the quality requirements of the "finding the circle" operation, becomes the basis for detecting whether there are defects in the first working image, and also the basis for whether the visual parameters of the vision system need to be adjusted.
[0025] A rule-based model is a decision-making model based on preset logical rules. It relies on manually defined explicit logic and describes the model's behavior through the mapping relationship between conditions and decisions. If the rule-based model determines that one or more detection items of the first task image do not conform to the preset detection rules, it means that the first task image cannot accurately identify and locate the target object, i.e., the first task image has defects. If the rule-based model determines that all detection items of the first task image conform to the preset detection rules, it means that the first task image can accurately identify and locate the target object, i.e., the first task image has no defects.
[0026] Taking the above "finding the circle" image as an example, the target circle presented by the screw hole cannot be obscured by other objects, because obscuration will cause edge loss problems and affect the accuracy of the recognition results. At the same time, there should be no interfering arcs or ring structures similar to the target circle in the working image, as these will cause the image detection algorithm to find the wrong circle. In this case, the first working image can be defect-detected by detecting whether there are edge loss problems in the area where the target circle is located in the working image, and whether there are strong edge arc structures in the non-target area (i.e., the area where the non-target circle is located).
[0027] When the region containing the target circle in the first task image has no missing edges and the non-target region does not have a strong edge arc structure, the first task image passes the defect detection of the rule model. Conversely, when the region containing the target circle in the first task image has missing edges, or the non-target region has a strong edge arc structure, the first task image fails the defect detection of the rule model. This achieves task image defect detection based on a rule model. Furthermore, while outputting the defect detection results, the rule model also outputs the corresponding defect type or defect index value for use by the subsequent parameter prediction model when obtaining adjustment parameters.
[0028] S102. If it is determined that the first work image has failed the defect detection, a matching first adjustment parameter is obtained through a parameter prediction model based on the visual parameters of the vision system, the environmental parameters, and the first work image.
[0029] Visual parameters include image acquisition parameters from the image acquisition module and image processing parameters from the image processing module. Image acquisition parameters refer to those affecting image quality during the acquisition process, such as camera parameters like resolution, image source size, and frame rate; lens parameters like focal length, working distance, field of view, depth of field, and distortion rate; and light source parameters like light source type and illuminance. Image processing parameters refer to the software parameters involved in image processing after acquisition, such as processing algorithms, thresholding rules, color modes, and filtering strategies. Environmental parameters may include illuminance stability, ambient temperature, ambient humidity, and vibration frequency, which can be obtained through corresponding sensors.
[0030] Parametric prediction models are pre-trained artificial intelligence models. These models include, but are not limited to, Transformer-based visual language models, Convolutional Neural Network (CNN) models, or other deep learning models. The training process is as follows: First, the visual system captures images of different scenes (e.g., different lighting, different objects, different angles) as sample images, and records the visual parameters corresponding to each sample image. Then, the current sample image is augmented with data (e.g., rotation, scaling, and flipping) to simulate variations in real-world scenes, thereby improving the generalization ability of the parametric prediction model.
[0031] The sample images are then preprocessed, including image correction, noise suppression, and feature enhancement. Finally, the preprocessed sample images, along with the current visual parameters of the vision system and the environmental parameters of the environment in which the vision system exists, are used as input information. The adjusted parameters (i.e., the adjusted visual parameters) are used as output information to iteratively train the supervised learning model or transfer learning model. This allows the trained model to learn the mapping relationship between the input information and the adjusted parameters, thereby obtaining the trained parameter prediction model. Based on this, the adjusted visual parameters of the vision system are predicted using the parameter prediction model to obtain the matching first adjusted parameter.
[0032] S103. Adjust the parameters of the vision system according to the first adjustment parameter, so as to obtain a second working image after parameter adjustment through the vision system, and obtain the parameter adjustment quality of the vision system according to the second working image.
[0033] After the vision system completes parameter adjustment based on the first adjustment parameter, the second task image of the vision system is acquired again. Defect detection is then performed on the second task image using a rule model. If the second task image passes the defect detection, the parameter adjustment of the vision system is complete. If the second task image fails the defect detection, the second task image, along with the visual parameters and environmental parameters of the vision system (i.e., the visual parameters and environmental parameters corresponding to the second task image), are input back into the parameter prediction model, and the above defect detection method is repeated until the current task image of the vision system passes the defect detection, thus completing this visual parameter adjustment of the vision system.
[0034] Specifically, when sending the visual parameters, environmental parameters, and work images of the vision system to the parameter prediction model, these parameters can be serialized into a standard format (e.g., JSON format) to conform to the input format of the parameter prediction model, facilitating its parsing. Simultaneously, after the parameter prediction model completes one parameter acquisition and one parameter adjustment of the vision system, the debugging count is incremented by 1. If the work image passes defect detection before the debugging count exceeds a preset threshold (e.g., 20 times), or if the change in the adjusted visual parameters is less than the preset threshold, it indicates successful parameter adjustment, and the vision system can proceed with normal operation based on the current parameter adjustment results, while simultaneously resetting the debugging count to zero. If the debugging count exceeds the preset threshold and the work image still fails defect detection, it indicates parameter adjustment failure. In this case, a prompt message is issued to guide maintenance personnel to intervene manually, thus preventing the parameter prediction model from entering an infinite prediction loop, and the debugging count is also reset to zero.
[0035] The technical solution of this invention, in response to acquiring a first operational image of the vision system, performs defect detection on the first operational image using a rule model. If it is determined that the first operational image fails the defect detection, a matching first adjustment parameter is obtained based on the visual parameters of the vision system, environmental parameters, and the first operational image, using a parameter prediction model. The vision system is then adjusted according to the first adjustment parameter to obtain a second operational image with adjusted parameters, and the parameter adjustment quality of the vision system is obtained based on the second operational image. Thus, the visual parameter optimization of the vision system through a combination of a rule model and a parameter adjustment model not only improves the operational efficiency of the vision system and reduces the manpower and time costs of parameter adjustment, but also improves the accuracy of the parameter adjustment results, avoiding incorrect or missed adjustments, and meeting the timeliness requirements of industrial production processes.
[0036] Example 2 Figure 2This is a flowchart of a parameter adjustment method for a vision system provided in Embodiment 2 of the present invention. The relationship between this embodiment and the above embodiments is that defect detection is performed on multiple detection items of the first working image, such as... Figure 2 As shown, the method specifically includes: S201. In response to acquiring a first task image of the vision system, at least one of the contrast, edge continuity, shape fidelity and illumination uniformity of the first task image is detected by a rule model.
[0037] Taking the aforementioned "circle finding" image as an example, the target circle needs to have sufficiently high contrast with the background image. This is because low contrast will blur the edges of the screw hole, causing the edge detection process to fail. It may either fail to find the edge, making edge detection of the hole impossible, or it may find a large number of false edges, resulting in positioning deviations of the hole edge. Therefore, the gradient magnitude of the hole edge can be obtained near the expected hole area, and this gradient magnitude should be significantly higher than the gradient magnitude of other areas in the image. Based on this, the gradient magnitude of the hole edge can be compared with a preset gradient threshold. If the gradient magnitude is less than the preset threshold, it indicates that the current image has a low contrast defect; if the gradient magnitude is greater than or equal to the preset threshold, it means that the current image passes the contrast detection.
[0038] Circle detection algorithms rely on edge information. A circle with severely broken edges may be mistaken by the algorithm as multiple short arcs, making it impossible to fit a complete circle. Therefore, after edge detection, the connectivity results of edge pixels can be obtained. An ideal circle edge should be a connected component. If it is divided into multiple small connected components, it indicates that the edge is discontinuous. Based on this, the number of connected components can be compared with a preset connectivity threshold. If the number of connected components is less than or equal to the preset connectivity threshold, it means that the current image passes the edge continuity detection. If the number of connected components is greater than the preset connectivity threshold, it means that the current image has edge discontinuity defects.
[0039] Because screw holes have standardized models with shapes close to ideal geometric circles, the first image cannot contain severe deformation. This is because circle fitting algorithms (e.g., least squares-based circle fitting algorithms) assume the target circle is perfect. If the object itself is deformed or deformed due to lens distortion, the fitted circle's center and radius will deviate. Therefore, after fitting the circle, the standard deviation of the distance from all edge points to the center is calculated. This standard deviation is compared to a preset distance threshold. If the standard deviation is less than or equal to the preset distance threshold, the current image passes the shape fidelity test; if the standard deviation is greater than the preset distance threshold, the current image has shape fidelity defects.
[0040] Uneven lighting (e.g., light spots) can cause inconsistent edge contrast, where bright edges may be sharp while dark edges may disappear, resulting in discontinuous edges. In this case, the standard deviation of pixel intensity in the target circular region can be calculated. If the standard deviation is less than or equal to a preset intensity threshold, the current image passes the lighting uniformity test. If the standard deviation is greater than the preset intensity threshold, the current image has an uneven lighting defect.
[0041] S202. If it is determined that the first work image fails the defect detection, a matching first adjustment parameter is obtained through a parameter prediction model based on the visual parameters of the vision system, the environmental parameters, and the first work image.
[0042] S203. Adjust the parameters of the vision system according to the first adjustment parameter, so as to obtain a second working image after parameter adjustment through the vision system, and obtain the parameter adjustment quality of the vision system according to the second working image.
[0043] The technical solution of this invention uses a rule model to detect defects in the contrast, edge continuity, shape fidelity, and illumination uniformity of the first work image, thereby expanding the defect detection range of the work image, ensuring that the detection results cover more defect types, improving the accuracy of the defect detection results of the work image, and avoiding identification and positioning deviations in industrial production caused by defective images.
[0044] Example 3 Figure 3 This is a flowchart of a parameter adjustment method for a vision system provided in Embodiment 3 of the present invention. The relationship between this embodiment and the above embodiments is that different defect types correspond to different adjustment parameters, such as... Figure 3 As shown, the method specifically includes: S301. In response to acquiring the first task image of the vision system, perform defect detection on the first task image using a rule model.
[0045] S302. Defect detection is performed on at least one of the following in the first working image: contrast, edge continuity, shape fidelity, and illumination uniformity, using a rule-based model.
[0046] S303. If it is determined that the first working image fails the defect detection, a matching second adjustment parameter is obtained according to the defect type of the first working image; wherein, if the defect type includes a low contrast defect, the second adjustment parameter includes at least one of illumination type, light source angle, and aperture value; if the defect type includes an edge discontinuity defect, the second adjustment parameter includes at least one of illumination type, light source angle, and polarizing filter parameter; if the defect type includes a shape non-fidelity defect, the second adjustment parameter includes at least one of lens distortion parameter and lens orientation parameter; if the defect type includes an uneven illumination defect, the second adjustment parameter includes at least one of light source type, light source distance, and light source angle.
[0047] For low-contrast images, if the circular aperture in the scene is opaque, a high-contrast, sharp outline can be produced by using backlighting (i.e., illumination type); if the surface where the aperture is located is a smooth and reflective plane, shadows can be eliminated by using coaxial lighting (i.e., illumination type), enhancing the contrast between the aperture and the background; alternatively, the edges of the aperture can be highlighted by configuring low-angle dome lights or ring lights; in addition, the amount of light entering the aperture can be increased by increasing the aperture value, thereby enhancing the contrast between the aperture and the background.
[0048] For images with discontinuous edges, the same lighting type and light source angle can be used as for low-contrast images. That is, if the circular aperture in the scene is opaque, backlighting can be used to create a clear, continuous outline; if the aperture is located on a smooth, reflective plane, coaxial lighting can be used to eliminate shadow areas and clarify the continuity of the edge outline; alternatively, low-angle dome or ring lights can be configured to highlight the edge outline of the aperture. Furthermore, reflections can be eliminated by configuring and activating a polarizing filter to prevent reflections from obscuring edge information.
[0049] For images with inaccurate shapes, the camera calibration results (e.g., using a checkerboard calibration board to calibrate the camera) can be used to obtain lens distortion parameters (e.g., radial distortion, tangential distortion), and the distortion parameters can be configured to enable the vision system to perform distortion correction before image processing. In addition, the lens axis can be adjusted to be perpendicular to the circular plane (i.e., lens orientation parameters), because if the lens is not aligned with the circular plane, the circle captured may become an ellipse, resulting in a deviation in the positioning results.
[0050] For images with uneven illumination, the vision system can be guided to select a suitable light source. For example, uniform illumination can be achieved by configuring diffused light sources (e.g., dome lights and integrating spheres). Alternatively, the distance and angle between the light source and the target circle can be adjusted to ensure the light source has a large coverage area relative to the object being measured, while maintaining a greater interval distance to achieve uniform illumination. In particular, after determining the defect type, specific adjustment values can be obtained based on specific defect values (e.g., edge gradient magnitude, number of connected components, distance standard deviation, and pixel intensity standard deviation) through calculation rules or by querying a mapping table.
[0051] S304. Adjust the parameters of the vision system according to the second adjustment parameters to obtain a third working image after parameter adjustment through the vision system, and obtain the parameter adjustment quality of the vision system based on the third working image.
[0052] After adjusting the parameters of the vision system according to the second adjustment parameter, the third working image after parameter adjustment is obtained through the vision system, and the third working image is used to detect defects through the rule model. If the defect detection is successful, there is no need for the subsequent parameter prediction model to intervene, thereby improving the parameter adjustment efficiency of the vision system and avoiding the high time consumption of the prediction process.
[0053] The technical solution of this invention, after obtaining the second adjustment parameter according to the defect type of the first work image, adjusts the parameters of the vision system according to the second adjustment parameter, so as to obtain the third work image after parameter adjustment through the vision system, and performs defect detection on the third work image through a rule model. This makes it possible to complete the parameter adjustment based on the parameter adjustment scheme corresponding to the defect detection result without the need for subsequent parameter prediction model intervention, thereby improving the parameter adjustment efficiency of the vision system, avoiding the high time consumption of the prediction process, and improving the timeliness of the parameter adjustment of the vision system.
[0054] Example 4 Figure 4 This is a flowchart of a parameter adjustment method for a vision system provided in Embodiment 4 of the present invention. The relationship between this embodiment and the above embodiments is that, when the third task image fails the defect detection, the defect detection result of the third task image is compared with the defect detection result of the first task image, such as... Figure 4 As shown, the method specifically includes: S401. In response to acquiring the first task image of the vision system, perform defect detection on the first task image using a rule model.
[0055] S402. Defect detection is performed on at least one of the following in the first working image: contrast, edge continuity, shape fidelity, and illumination uniformity, using a rule-based model.
[0056] S403. If it is determined that the first work image has failed the defect detection, obtain the matching second adjustment parameter according to the defect type of the first work image.
[0057] S404. Adjust the parameters of the vision system according to the second adjustment parameter to obtain the third working image after parameter adjustment through the vision system.
[0058] S405. Perform defect detection on the third work image using a rule model, and when it is determined that the third work image fails the defect detection, compare the defect detection result of the third work image with the defect detection result of the first work image.
[0059] If the third task image fails the defect detection, it means that the parameter adjustment scheme based on the rule model has not solved the visual bias problem of the vision system. At this time, the intervention of the parameter prediction model is still needed. The defect detection result of the third task image is compared with the defect detection result of the first task image. For example, one or more of the edge gradient magnitude, number of connected components, distance standard deviation and pixel intensity standard deviation of the third task image are compared with the first task image.
[0060] S406. If it is determined that the defect detection result of the third work image is better than the defect detection result of the first work image, a matching third adjustment parameter is obtained through a parameter prediction model based on the visual parameters and environmental parameters matched with the third work image and the third work image.
[0061] If the defect detection result of the third task image is better than that of the first task image, then the third task image and the visual parameters and environmental parameters matched by the third task image are used as input information for the parameter prediction model. The parameter prediction model is then used to adjust the parameters of the vision system. This reduces the difficulty of parameter adjustment of the parameter prediction model and improves the parameter prediction efficiency of the parameter prediction model by using the third task image with improved optimization effect as input information.
[0062] S407. Adjust the parameters of the vision system according to the third adjustment parameter to obtain a fourth working image through the vision system, and determine the parameter adjustment quality of the vision system based on the fourth working image.
[0063] S408. If it is determined that the defect detection result of the first work image is better than the defect detection result of the third work image, a matching first adjustment parameter is obtained through a parameter prediction model based on the visual parameters and environmental parameters matched with the first work image and the first work image.
[0064] If the defect detection result of the first task image is better than that of the third task image, then the original first task image, as well as the visual parameters and environmental parameters matched by the first task image, are still used as the input information of the parameter prediction model. The parameter prediction model is used to adjust the parameters of the vision system, avoiding the parameter adjustment scheme of the rule model, increasing the difficulty of parameter adjustment of the parameter prediction model, and maintaining the original parameter prediction efficiency of the parameter prediction model.
[0065] S409. Adjust the parameters of the vision system according to the first adjustment parameter, so as to obtain a second working image after parameter adjustment through the vision system, and obtain the parameter adjustment quality of the vision system according to the second working image.
[0066] Optionally, in this embodiment of the invention, obtaining a matching first adjustment parameter through a parameter prediction model based on the visual parameters of the vision system, environmental parameters, and the first task image specifically includes: obtaining matching alternative adjustment parameters based on the defect type of the first task image, and obtaining the first adjustment parameter through a parameter prediction model based on the visual parameters of the vision system, environmental parameters, the first task image, and the alternative adjustment parameters.
[0067] Specifically, the second adjustment parameter mentioned above is an adjustment parameter obtained based on the defect type and defect value. This adjustment parameter is directly configured to the vision system to adjust the visual parameters of the vision system. The alternative adjustment parameter is a set of all feasible parameter adjustment methods obtained based on the defect type. The alternative adjustment parameter is also used as input information to the parameter prediction model, thereby providing retrieval enhancement information to the parameter prediction model and improving the accuracy of the results generated by the parameter prediction model built and trained based on large model technology.
[0068] In the technical solution of this invention, if the defect detection result of the third work image is better than the defect detection result of the first work image, the third work image with improved optimization effect is used as input information, which reduces the difficulty of parameter adjustment of the parameter prediction model and improves the parameter prediction efficiency of the parameter prediction model; if the defect detection result of the first work image is better than the defect detection result of the third work image, the original first work image is still used as input information of the parameter prediction model, avoiding the parameter adjustment scheme of the rule model, increasing the difficulty of parameter adjustment of the parameter prediction model, and maintaining the original parameter prediction efficiency of the parameter prediction model.
[0069] Example 5 Figure 5 This is a structural block diagram of a parameter adjustment device for a vision system provided in Embodiment 5 of the present invention. The device specifically includes: The defect detection execution module 501 is used to perform defect detection on the first work image by a rule model in response to acquiring the first work image of the vision system. The adjustment parameter acquisition module 502 is used to obtain a matching first adjustment parameter based on the visual parameters of the vision system, environmental parameters, and the first work image if it is determined that the first work image has failed the defect detection. The adjustment quality acquisition module 503 is used to adjust the parameters of the vision system according to the first adjustment parameter, so as to acquire the second working image after parameter adjustment through the vision system, and to acquire the parameter adjustment quality of the vision system according to the second working image.
[0070] The technical solution of this invention, in response to acquiring a first operational image of the vision system, performs defect detection on the first operational image using a rule model. If it is determined that the first operational image fails the defect detection, a matching first adjustment parameter is obtained based on the visual parameters of the vision system, environmental parameters, and the first operational image, using a parameter prediction model. The vision system is then adjusted according to the first adjustment parameter to obtain a second operational image with adjusted parameters, and the parameter adjustment quality of the vision system is obtained based on the second operational image. Thus, the visual parameter optimization of the vision system through a combination of a rule model and a parameter adjustment model not only improves the operational efficiency of the vision system and reduces the manpower and time costs of parameter adjustment, but also improves the accuracy of the parameter adjustment results, avoiding incorrect or missed adjustments, and meeting the timeliness requirements of industrial production processes.
[0071] Optionally, the defect detection execution module 501 is specifically used to perform defect detection on at least one of the contrast, edge continuity, shape fidelity and illumination uniformity of the first working image through a rule model.
[0072] Optionally, the parameter adjustment device of the vision system is further configured to obtain matching second adjustment parameters according to the defect type of the first working image; wherein, if the defect type includes a low contrast defect, the second adjustment parameters include at least one of illumination type, light source angle, and aperture value; if the defect type includes an edge discontinuity defect, the second adjustment parameters include at least one of illumination type, light source angle, and polarizing filter parameter; if the defect type includes a shape inaccuracy defect, the second adjustment parameters include at least one of lens distortion parameter and lens orientation parameter; if the defect type includes an uneven illumination defect, the second adjustment parameters include at least one of light source type, light source distance, and light source angle; the vision system is parameter-adjusted according to the second adjustment parameters to obtain a parameter-adjusted third working image through the vision system, and the parameter adjustment quality of the vision system is obtained based on the third working image.
[0073] Optionally, the parameter adjustment device of the vision system is further configured to perform defect detection on the third task image using a rule model, and when it is determined that the third task image fails the defect detection, compare the defect detection result of the third task image with the defect detection result of the first task image; if it is determined that the defect detection result of the third task image is better than the defect detection result of the first task image, obtain a matching third adjustment parameter through a parameter prediction model based on the visual parameters and environmental parameters matched with the third task image, and the third task image; adjust the parameters of the vision system according to the third adjustment parameter to obtain a fourth task image through the vision system, and determine the parameter adjustment quality of the vision system based on the fourth task image.
[0074] Optionally, the adjustment parameter acquisition module 502 is further configured to, if it is determined that the defect detection result of the first work image is better than the defect detection result of the third work image, acquire a matching first adjustment parameter through a parameter prediction model based on the visual parameters and environmental parameters matched with the first work image and the first work image.
[0075] Optionally, the adjustment parameter acquisition module 502 is further configured to acquire matching alternative adjustment parameters based on the defect type of the first job image, and acquire the first adjustment parameter through a parameter prediction model based on the visual parameters of the vision system, environmental parameters, the first job image, and the alternative adjustment parameters.
[0076] The above-described apparatus can execute the parameter adjustment method of the vision system provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in this embodiment can be found in the parameter adjustment method of the vision system provided in any embodiment of the present invention.
[0077] Example 6 Figure 6 A schematic diagram of an electronic device 10, which can be used to implement embodiments of the present invention, is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, electronic devices, blade electronic devices, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0078] like Figure 6 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0079] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0080] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as parameter tuning methods for a vision system.
[0081] In some embodiments, the parameter tuning method for the vision system can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as a storage unit. In some embodiments, part or all of the computer program can be loaded and / or installed on a heterogeneous hardware accelerator via ROM and / or a communication unit. When the computer program is loaded into RAM and executed by a processor, one or more steps of the parameter tuning method for the vision system described above can be performed. Alternatively, in other embodiments, the processor can be configured to perform the parameter tuning method for the vision system by any other suitable means (e.g., by means of firmware).
[0082] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0083] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0084] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0085] To provide user interaction, the systems and techniques described herein can be implemented on a heterogeneous hardware accelerator, which includes: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the heterogeneous hardware accelerator. Other types of devices can also be used to provide user interaction; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or haptic feedback); and input from the user can be received in any form (including sound input, voice input, or haptic input).
[0086] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0087] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0088] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0089] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for adjusting parameters of a vision system, characterized in that, include: In response to acquiring the first task image from the vision system, defect detection is performed on the first task image using a rule model; If it is determined that the first work image fails the defect detection, a matching first adjustment parameter is obtained through a parameter prediction model based on the visual parameters of the vision system, environmental parameters, and the first work image. The vision system is adjusted according to the first adjustment parameter to obtain a second working image after parameter adjustment, and the parameter adjustment quality of the vision system is obtained according to the second working image.
2. The parameter adjustment method for a vision system according to claim 1, characterized in that, The defect detection of the first job image using a rule model includes: Defect detection is performed on at least one of the following in the first task image: contrast, edge continuity, shape fidelity, and illumination uniformity, using a rule-based model.
3. The parameter adjustment method for a vision system according to claim 2, characterized in that, After determining that the first job image failed the defect detection, the process further includes: Based on the defect type of the first working image, a matching second adjustment parameter is obtained; wherein, if the defect type includes a low contrast defect, the second adjustment parameter includes at least one of illumination type, light source angle, and aperture value; if the defect type includes an edge discontinuity defect, the second adjustment parameter includes at least one of illumination type, light source angle, and polarizing filter parameter; if the defect type includes a shape inaccuracy defect, the second adjustment parameter includes at least one of lens distortion parameter and lens orientation parameter; if the defect type includes an uneven illumination defect, the second adjustment parameter includes at least one of light source type, light source distance, and light source angle. The vision system is adjusted according to the second adjustment parameter to obtain a third working image after parameter adjustment, and the parameter adjustment quality of the vision system is obtained based on the third working image.
4. The parameter adjustment method for a vision system according to claim 3, characterized in that, The step of adjusting the quality based on the parameters of the vision system obtained from the third task image includes: The third work image is subjected to defect detection using a rule model. When it is determined that the third work image fails the defect detection, the defect detection result of the third work image is compared with the defect detection result of the first work image. If it is determined that the defect detection result of the third work image is better than the defect detection result of the first work image, a matching third adjustment parameter is obtained through a parameter prediction model based on the visual parameters and environmental parameters matched with the third work image, as well as the third work image. The vision system is adjusted according to the third adjustment parameter to acquire a fourth task image, and the parameter adjustment quality of the vision system is determined based on the fourth task image.
5. The parameter adjustment method for a vision system according to claim 4, characterized in that, The step of obtaining a matching first adjustment parameter through a parameter prediction model based on the visual parameters of the vision system, environmental parameters, and the first task image specifically includes: If it is determined that the defect detection result of the first job image is better than the defect detection result of the third job image, a matching first adjustment parameter is obtained through a parameter prediction model based on the visual parameters and environmental parameters matched with the first job image and the first job image.
6. The parameter adjustment method for a vision system according to claim 1 or 2, characterized in that, The step of obtaining a matching first adjustment parameter through a parameter prediction model based on the visual parameters of the vision system, environmental parameters, and the first task image further includes: Based on the defect type of the first task image, matching alternative adjustment parameters are obtained, and based on the visual parameters of the vision system, environmental parameters, the first task image, and the alternative adjustment parameters, a first adjustment parameter is obtained through a parameter prediction model.
7. A parameter adjustment device for a vision system, characterized in that, include: The defect detection execution module is used to perform defect detection on the first task image obtained by the vision system using a rule model in response to acquiring the first task image. The adjustment parameter acquisition module is used to obtain a matching first adjustment parameter based on the visual parameters of the vision system, environmental parameters, and the first work image if it is determined that the first work image has failed the defect detection. The adjustment quality acquisition module is used to adjust the parameters of the vision system according to the first adjustment parameter, so as to acquire a second working image after parameter adjustment through the vision system, and to acquire the parameter adjustment quality of the vision system according to the second working image.
8. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the parameter adjustment method of the vision system according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the parameter adjustment method of the vision system according to any one of claims 1-6.
10. A computer program product comprising a computer program that, when executed by a processor, implements the parameter adjustment method of the vision system according to any one of claims 1-6.