Methods and apparatus for detecting the stability of a vision system
By using affine transformation of the reference contour model in the vision system to the current image, the stability of the vision system is detected, which solves the problems of high cost and low accuracy of traditional manual inspection and realizes efficient and accurate inspection of machine vision system.
Patent Information
- Application Number
- CN202280087491.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-29
- Publication Date
- 2026-11-10
- Estimated Expiration
- 2042-07-29
AI Technical Summary
Traditional industrial component inspection relies on manual methods, which results in high costs, low accuracy, and low efficiency. Furthermore, instability in machine vision systems can affect the accuracy of measurement results.
By acquiring the position information of the patch in the current image of the vision system, the reference contour model is affinely transformed into the current image, the current contour model is fitted, and compared with the reference contour model to detect the stability of the vision system.
It enables rapid and accurate detection of the stability of vision systems, ensures the accuracy of measurement results, reduces labor costs, and improves detection efficiency and precision.
Smart Images

Figure CN118475952B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of non-contact detection, and in particular to a method and apparatus for detecting the stability of a vision system. Background Technology
[0002] Traditionally, the dimensions of industrial parts are mostly inspected manually, for example, by using contact instruments such as film rulers or inspection chambers. This method is costly, has low accuracy and efficiency, and makes it difficult to achieve high-speed online inspection.
[0003] In recent years, machine vision systems have gradually replaced manual inspection in many fields, finding widespread application in production process control and product quality inspection. However, when a machine vision system is unstable, such as when the camera position changes, it can affect the accuracy of the measurement results. Therefore, there is an urgent need for a method to detect the stability of the vision system and ensure the accuracy of the measurement results. Summary of the Invention
[0004] This application provides a method for detecting the stability of a vision system, which can detect whether the vision system is stable, so as to report errors in time when it is unstable and ensure the accuracy of vision system measurement results.
[0005] In a first aspect, this application provides a method for detecting the stability of a vision system, comprising: acquiring first position information of a patch in a current image under the vision system; based on the first position information, performing an affine transformation on a reference contour model of the patch to the position of the patch in the current image; fitting a current contour model of the patch in the current image according to the reference contour model; and confirming the stability of the vision system based on the reference contour model and the current contour model.
[0006] In the technical solution of this application embodiment, the reference contour model of the inspection piece is affinely transformed to the position of the inspection piece in the current image under the vision system to achieve a rough match of the current contour model. Then, a precise current contour model is fitted. By comparing the current contour model with the reference contour model, it can be seen whether the current contour model has changed compared with the reference contour model, thereby detecting whether the vision system is stable, so as to report errors in time when it is unstable and ensure the accuracy of the measurement results of the vision system.
[0007] In some embodiments, before affinely transforming the reference contour model of the inspection piece to the position of the inspection piece in the current image, the method further includes: obtaining the reference contour model based on the reference image of the inspection piece; obtaining second position information of the inspection piece in the reference image; wherein, affinely transforming the reference contour model of the inspection piece to the position of the inspection piece in the current image includes: affinely transforming the reference contour model of the inspection piece to the position of the inspection piece in the current image according to the first position information and the second position information.
[0008] By obtaining the second position information of the inspection piece in the reference image, the position information of the reference contour model can be obtained. That is, the position of the reference contour model is the same as the position of the inspection piece in the reference image. Therefore, based on the second position information and the first position information of the inspection piece in the current image, the reference contour model can be affinely transformed to the position of the inspection piece in the current image to achieve a rough match of the contour model.
[0009] In some embodiments, the inspection patch includes at least one rectangular frame, each rectangular frame including a circle and a grayscale area outside the circle; the reference contour model and the current contour model include the contours of the rectangular frames and the circles.
[0010] Since a circle has only one linear dimension, namely its diameter, compared to other polygons that require measuring the dimensions of each side, the amount of measurement work can be reduced, allowing for quick comparison of the measured values to confirm whether the camera position of the vision system has changed.
[0011] In some embodiments, there are multiple rectangles, the diameters of the multiple circles corresponding to the multiple rectangles are different, and the gray values of the multiple grayscale areas corresponding to the multiple rectangles are different.
[0012] By comparing the diameters of different circles and the gray values of different gray areas in the baseline contour model with those in the current contour model, the accuracy of the stability detection vision system can be increased.
[0013] In some embodiments, one of the rectangular frames in the inspection patch includes a notch for indicating the orientation of the inspection patch. By indicating the orientation of the inspection patch through the notch, a more accurate approximate match can be achieved before fitting the current contour model based on a reference contour model, thereby reducing the time required to fit the current contour model and improving the rate of stability of the detection vision system.
[0014] In some embodiments, fitting the current contour model based on the reference contour model includes: fitting a second circle of the current contour model based on a first circle in the reference contour model.
[0015] When fitting the current contour model, it is only necessary to fit the second circle of the current contour model to obtain the parameters required for detecting the stability of the vision system, namely the diameter of the circle and the gray value of the gray area. In other words, it is not necessary to fit the contour of the rectangle, which reduces the time required to obtain the parameters required for detecting the stability of the vision system and improves the efficiency of detecting the stability of the vision system.
[0016] In some embodiments, fitting a second circle of the current contour model based on a first circle in the reference contour model includes: obtaining multiple pixels with significant grayscale value changes in the current image based on the contour of the first circle, wherein the multiple pixels with significant grayscale value changes form the second circle.
[0017] Compared to directly obtaining pixels with significant pixel changes in the current image, obtaining pixels with significant pixel changes based on the outline of the first circle not only reduces the time required to obtain the pixel, but also improves the accuracy of obtaining the pixel, thereby improving the efficiency and accuracy of fitting the second circle.
[0018] In some embodiments, confirming the stability of the vision system based on the reference contour model and the current contour model includes: obtaining the diameter of the first circle based on the reference contour model; obtaining the diameter of the second circle based on the current contour model; and confirming whether the camera position of the vision system has changed based on the diameter of the first circle and the diameter of the second circle.
[0019] Determining whether the camera position of the vision system has changed by comparing the diameter of the first circle with the diameter of the second circle is more intuitive than using other dimensions of the circle, such as the circumference, and is beneficial for quickly detecting the stability of the vision system.
[0020] In some embodiments, determining whether the camera position of the vision system has changed based on the diameters of the first circle and the second circle includes: if the difference between the diameters of the first circle and the second circle is greater than a first threshold, then confirming that the camera position has changed. By setting the first threshold, different customers' requirements for measurement accuracy can be met.
[0021] In some embodiments, obtaining the diameter of the second circle based on the current contour model includes: calculating the size of each pixel based on the diameter of the first circle and the number of pixels included in the diameter of the first circle; obtaining the number of pixels included in the diameter of the second circle based on the contour of the second circle; and calculating the diameter of the second circle based on the number of pixels included in the diameter of the second circle and the size of each pixel.
[0022] In a vision system, the size of each pixel in the reference image is calculated by using the diameter of the first circle in the reference image and the number of pixels it contains. When the second circle in the current image is fitted, the diameter of the second circle can be directly obtained by detecting the number of pixels in the diameter of the second circle. By comparing the diameter of the second circle with the diameter of the first circle, it is possible to quickly determine whether the camera position of the vision system has changed, thereby detecting the stability of the vision system.
[0023] In some embodiments, confirming the stability of the visual system based on the reference contour model and the current contour model further includes: obtaining a first gray value of the gray area corresponding to the first circle based on the reference contour model; obtaining a second gray value of the gray area corresponding to the second circle based on the current contour model; and confirming whether the illumination in the visual system has changed based on the first gray value and the second gray value.
[0024] Excessive changes in illumination within the current vision system can slightly affect dimensional measurements. For example, overexposure can cause the edges of the target object to shrink after imaging, resulting in a smaller measured size. Comparing the first grayscale value of the baseline contour model with the second grayscale value of the current contour model helps detect whether the illumination of the vision system has changed, preventing excessive illumination changes from affecting the accuracy of the measurement results.
[0025] In some embodiments, confirming whether the illumination in the vision system has changed based on the first grayscale value and the second grayscale value includes: if the difference between the first grayscale value and the second grayscale value is greater than a second threshold, then confirming that the illumination has changed. By setting the second threshold, different requirements of different customers regarding the degree of change in the illumination environment of the vision system can be met.
[0026] In some embodiments, the first location information and the second location information include row information, column information and angle information of the inspection piece, wherein the angle information is used to indicate the direction of the inspection piece.
[0027] In addition to the usual row and column information, the first and second position information also include angle information indicating the direction of the inspection piece. This allows for a rough match of the current contour model during affine transformation, regardless of how the inspection piece is placed before saving the baseline contour model. This enables the fitting of a more accurate current contour model, eliminating the need to place the inspection piece at a fixed angle before each vision system stability test, thus facilitating rapid detection of vision system stability.
[0028] Secondly, this application provides an apparatus for detecting the stability of a vision system, comprising: an acquisition unit for acquiring first position information of a patch in a current image under the vision system; a processing unit for, based on the first position information, performing an affine transformation of a reference contour model of the patch to the position of the patch in the current image, fitting a current contour model of the patch in the current image according to the reference contour model; and confirming the stability of the vision system based on the reference contour model and the current contour model.
[0029] In the technical solution of this application embodiment, the reference contour model of the inspection piece is affinely transformed to the position of the inspection piece in the current image under the vision system to achieve a rough match of the current contour model. Then, a precise current contour model is fitted. By comparing the current contour model with the reference contour model, it can be seen whether the current contour model has changed compared with the reference contour model, thereby detecting whether the vision system is stable, so as to report errors in time when it is unstable and ensure the accuracy of the measurement results of the vision system.
[0030] In some embodiments, the acquisition unit is further configured to: acquire the reference contour model based on the reference image of the inspection piece; acquire the second position information of the inspection piece in the reference image; the processing unit is further configured to: affinely transform the reference contour model of the inspection piece to the position of the inspection piece in the current image according to the first position information and the second position information.
[0031] By obtaining the second position information of the inspection piece in the reference image, the position information of the reference contour model can be obtained. That is, the position of the reference contour model is the same as the position of the inspection piece in the reference image. Therefore, based on the second position information and the first position information of the inspection piece in the current image, the reference contour model can be affinely transformed to the position of the inspection piece in the current image to achieve a rough match of the contour model.
[0032] In some embodiments, the inspection patch includes at least one rectangular frame, each rectangular frame including a circle and a grayscale area outside the circle; the reference contour model and the current contour model include the contours of the rectangular frames and the circles.
[0033] Since a circle has only one linear dimension, namely its diameter, compared to other polygons that require measuring the dimensions of each side, the amount of measurement work can be reduced, allowing for quick comparison of the measured values to confirm whether the camera position of the vision system has changed.
[0034] In some embodiments, there are multiple rectangles, the diameters of the multiple circles corresponding to the multiple rectangles are different, and the gray values of the multiple grayscale areas corresponding to the multiple rectangles are different.
[0035] By comparing the diameters of different circles and the gray values of different gray areas in the baseline contour model with those in the current contour model, the accuracy of the stability detection vision system can be increased.
[0036] In some embodiments, one of the rectangular frames in the inspection patch includes a notch for indicating the orientation of the inspection patch. By indicating the orientation of the inspection patch through the notch, a more accurate approximate match can be achieved before fitting the current contour model based on a reference contour model, thereby reducing the time required to fit the current contour model and improving the rate of stability of the detection vision system.
[0037] In some embodiments, the processing unit is further configured to fit a second circle of the current contour model based on a first circle in the reference contour model.
[0038] In some embodiments, the acquisition unit is further configured to: acquire multiple pixels with significant grayscale value changes in the current image based on the outline of the first circle, wherein the multiple pixels with significant grayscale value changes form the second circle.
[0039] When fitting the current contour model, it is only necessary to fit the second circle of the current contour model to obtain the parameters required for detecting the stability of the vision system, namely the diameter of the circle and the gray value of the gray area. In other words, it is not necessary to fit the contour of the rectangle, which reduces the time required to obtain the parameters required for detecting the stability of the vision system and improves the efficiency of detecting the stability of the vision system.
[0040] In some embodiments, the acquisition unit is further configured to: acquire the diameter of the first circle based on the reference contour model; acquire the diameter of the second circle based on the current contour model; the processing unit is further configured to: determine whether the camera position of the vision system has changed based on the diameter of the first circle and the diameter of the second circle.
[0041] Determining whether the camera position of the vision system has changed by comparing the diameter of the first circle with the diameter of the second circle is more intuitive than using other dimensions of the circle, such as the circumference, and is beneficial for quickly detecting the stability of the vision system.
[0042] In some embodiments, the processing unit is further configured to: confirm that the camera position has changed if the difference between the diameter of the first circle and the diameter of the second circle is greater than a first threshold. By setting the first threshold, different customers' requirements for measurement accuracy can be met.
[0043] In some embodiments, the processing unit is further configured to: calculate the size of each pixel based on the diameter of the first circle and the number of pixels included in the diameter of the first circle; the acquisition unit is further configured to: acquire the number of pixels included in the diameter of the second circle based on the outline of the second circle; the processing unit is further configured to: calculate the diameter of the second circle based on the number of pixels included in the diameter of the second circle and the size of each pixel.
[0044] In a vision system, the size of each pixel in the reference image is calculated by using the diameter of the first circle in the reference image and the number of pixels it contains. When the second circle in the current image is fitted, the diameter of the second circle can be directly obtained by detecting the number of pixels in the diameter of the second circle. By comparing the diameter of the second circle with the diameter of the first circle, it is possible to quickly determine whether the camera position of the vision system has changed, thereby detecting the stability of the vision system.
[0045] In some embodiments, the acquisition unit is further configured to: acquire a first gray value of the gray area corresponding to the first circle based on the reference contour model; acquire a second gray value of the gray area corresponding to the second circle based on the current contour model; the processing unit is further configured to: confirm whether the illumination in the vision system has changed based on the first gray value and the second gray value.
[0046] Excessive changes in illumination within the current vision system can slightly affect dimensional measurements. For example, overexposure can cause the edges of the target object to shrink after imaging, resulting in a smaller measured size. Comparing the first grayscale value of the baseline contour model with the second grayscale value of the current contour model helps detect whether the illumination of the vision system has changed, preventing excessive illumination changes from affecting the accuracy of the measurement results.
[0047] In some embodiments, the processing unit is further configured to: confirm a change in illumination if the difference between the first grayscale value and the second grayscale value is greater than a second threshold. By setting the second threshold, different requirements from different customers regarding the degree of change in the illumination environment of the visual system can be met.
[0048] In some embodiments, the first location information and the second location information include row information, column information and angle information of the inspection piece, wherein the angle information is used to indicate the direction of the inspection piece.
[0049] In addition to the usual row and column information, the first and second position information also include angle information indicating the direction of the inspection piece. This allows for a rough match of the current contour model during affine transformation, regardless of how the inspection piece is placed before saving the baseline contour model. This enables the fitting of a more accurate current contour model, eliminating the need to place the inspection piece at a fixed angle before each vision system stability test, thus facilitating rapid detection of vision system stability.
[0050] Thirdly, embodiments of this application provide an apparatus for detecting the stability of a vision system, including a processor and a memory, wherein the memory is used to store a program, and the processor is used to call and run the program from the memory to perform the method for detecting the stability of a vision system as described in the first aspect or any possible implementation of the first aspect.
[0051] Fourthly, embodiments of this application provide a computer-readable storage medium including a computer program that, when run on a computer, causes the computer to perform the method for detecting visual system stability as described in the first aspect or any possible implementation thereof.
[0052] Fifthly, embodiments of this application provide a computer program product containing instructions that, when executed by a computer, cause the computer to perform the defect detection method in the first aspect or any possible implementation thereof.
[0053] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description
[0054] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on the drawings without creative effort.
[0055] Figure 1 This is a schematic diagram of a system architecture disclosed in one embodiment of this application;
[0056] Figure 2 This is a schematic flowchart of a method for detecting the stability of a vision system disclosed in an embodiment of this application;
[0057] Figure 3 This is a schematic diagram of the structure of an inspection piece disclosed in an embodiment of this application;
[0058] Figure 4 This is a schematic diagram illustrating a process of fitting a current contour model, as disclosed in an embodiment of this application.
[0059] Figure 5 This is a schematic flowchart of another method for detecting the stability of a vision system disclosed in an embodiment of this application;
[0060] Figure 6 This is a schematic process diagram of another method for detecting the stability of a vision system disclosed in an embodiment of this application;
[0061] Figure 7 This is a schematic structural block diagram of a device for detecting the stability of a vision system according to an embodiment of this application;
[0062] Figure 8 This is a schematic diagram of the hardware structure of a device for detecting the stability of a vision system according to an embodiment of this application.
[0063] The accompanying drawings are not drawn to scale. Detailed Implementation
[0064] The embodiments of the technical solution of this application will now be described in detail with reference to the accompanying drawings. These embodiments are only used to more clearly illustrate the technical solution of this application and are therefore merely examples, and should not be used to limit the scope of protection of this application.
[0065] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.
[0066] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.
[0067] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0068] Currently, vision systems can replace human eyes in performing functions such as recognition, measurement, and positioning using industrial cameras. A typical vision system consists of a camera and a light source, and can replace manual labor in inspecting barcode characters, cracks, packaging, surface coating integrity, dents, and dimensions. Using vision systems can effectively improve the inspection speed and accuracy of production lines, significantly increasing output and quality, reducing labor costs, and preventing misjudgments caused by human error. Therefore, vision systems are widely used in production process control and product quality inspection. When a vision system is used to inspect the dimensions of workpieces or other target objects, changes in camera position or significant changes in lighting can affect the accuracy of the measurement results. Therefore, to ensure accurate and effective measurement results, the stability of the vision system must be checked before each use.
[0069] In view of the above problems, this application proposes a method for detecting the stability of a vision system. Specifically, a point detection patch is designed, and the stability of the vision system is detected by comparing the contour models of the point detection patch under the current image and the point detection patch under a reference image. The contour model can include different graphics. By measuring the size change of the graphics, it can be determined whether the camera position of the vision system has changed. By measuring the change of the gray value of the graphics, it can be determined whether the illumination has changed, so that when changes occur, errors can be reported in time, thereby ensuring the accuracy of the measurement results of the vision system.
[0070] The method for detecting the stability of a vision system disclosed in this application is a general detection method that can be used in various vision systems including cameras and light sources, such as battery defect detection vision systems, battery size detection vision systems, and electrode sheet detection vision systems. In addition to being used in the aforementioned vision systems for detecting batteries, it can also be used in vision systems for detecting other workpieces, such as displays and bearings. This application does not limit this application.
[0071] Figure 1 A schematic diagram of a vision system architecture applicable to an embodiment of this application is shown, such as... Figure 1 As shown, the vision system 100 includes: a controller 10 and at least one detection station 20. Each detection station includes a camera 30 and multiple light sources 40. The light-emitting surfaces of the multiple light sources 40 face the surface of the target object corresponding to each detection station 20. The controller 10 is connected to the camera 30 and multiple light sources 40 of each detection station 20.
[0072] Camera 30 can also be other image acquisition devices with image acquisition capabilities, such as webcams. In each inspection station 20, camera 30 is located at a preset height above the surface of the target object corresponding to each inspection station 20. The light source can be a light strip or other types of light sources.
[0073] The controller 10 can be a terminal, such as a mobile phone, tablet computer, or laptop computer, or it can be a server or cloud. The controller 10 can include a computing module and a data storage system. The computing module can be used to process the received input data (such as an image to be processed). When the computing module performs relevant processing, the controller 10 can call data, code, etc. in the data storage system for corresponding processing, and can also store the processed data, instructions, etc. into the data storage system.
[0074] When measuring the dimensions of a target object, a measurement piece can be placed on the inspection station 20, positioned next to the target object. The measurement piece, with its known dimensions, is then used as a caliper to measure the object's dimensions. During this process, camera 20 is used to acquire images of the measurement piece and the target object. Controller 10 is used to detect the dimensions of the target object using the measurement piece and relevant algorithms.
[0075] In the process of detecting the stability of the vision system 100 in this embodiment, the controller 10 is further configured to compare the inspection patch in the current image captured by the camera 20 with the inspection patch previously stored in the controller 10. If the two are different or the degree of difference is greater than a preset value, it is confirmed that the stability of the vision system 100 has changed. The controller 10 can issue an error message, such as NG, when the vision system 100 is unstable, to indicate that the vision system 100 is unstable or needs calibration, thereby ensuring the accuracy of the detection results of the vision system 100.
[0076] The following is combined Figure 2 The method 200 for detecting the stability of a vision system provided in the embodiments of this application will be described in detail. Figure 2 This is a schematic flowchart illustrating a method for detecting the stability of a vision system according to an embodiment of this application. The method can be executed by a device for detecting the stability of a vision system, which can be... Figure 1 The controller 10 in the method 200 includes at least some of the following.
[0077] S210, the device for detecting the stability of the vision system acquires the first position information of the inspection piece in the current image under the vision system.
[0078] The visual system can be Figure 1 The vision system 10 in the system can measure the dimensions of target objects using inspection pieces. The target object can be any workpiece, such as a battery cell, bolt, or display screen, or it can be a defect on the workpiece. The height of the camera in the vision system can be set according to the area of the target object's surface to be acquired. The larger the area to be acquired, the higher the camera should be positioned.
[0079] The current image can be an image of the inspection piece captured by the camera of the vision system under the current light source, before the size of the target object is measured using the vision system. The first position information can include the row information, column information, and angle information of the inspection piece in the coordinate system of the image.
[0080] S220, the device for detecting the stability of the vision system, based on the first position information, performs an affine transformation of the reference contour model of the inspection piece to the position of the inspection piece in the current image, and fits the current contour model of the inspection piece in the current image according to the reference contour model.
[0081] Affine transformation is a linear transformation from two-dimensional coordinates (x, y) to two-dimensional coordinates (u, v). Affine transformation preserves the "straightness" (a straight line remains a straight line after an affine transformation) and "parallelism" (the relative positional relationship between straight lines remains unchanged, parallel lines remain parallel lines after an affine transformation, and the order of points on the lines does not change). Therefore, to accurately obtain the current contour model of a point patch in the current image, a reference contour model can first be affinely transformed to the location of the point patch in the current image to obtain the approximate contour of the current contour model, i.e., to achieve approximate or coarse matching of the contour model. This allows for subsequent fitting of a precise current contour model based on the approximate matching contour model.
[0082] S230, The device for detecting the stability of the vision system confirms the stability of the vision system based on the reference contour model and the current contour model.
[0083] In the technical solution of this application embodiment, the reference contour model of the inspection piece is affinely transformed to the position of the inspection piece in the current image under the vision system. The reference contour model at this position can achieve a rough match of the current contour model. Then, a precise current contour model is fitted. By comparing the current contour model with the reference contour model, it can be seen whether the current contour model has changed compared with the reference contour model, thereby detecting whether the vision system is stable, so as to report errors in time when it is unstable, and ensure the accuracy of the measurement results of the vision system.
[0084] According to some embodiments of this application, optionally, before the device for detecting visual system stability in step 220 transforms the reference contour model of the inspection piece to the position of the inspection piece in the current image, the device for detecting visual system stability may also obtain a reference contour model based on the reference image of the inspection piece, obtain the second position information of the inspection piece in the reference image, and then transform the reference contour model of the inspection piece to the position of the inspection piece in the current image according to the first position information and the second position information.
[0085] To affinely transform the reference contour model to the location of the inspection piece in the current image, it is necessary to know the position information of the reference contour model and the position information of the inspection piece in the current image (first position information) in advance. Since the inspection piece in the reference image includes the reference contour model, the position information of the reference contour model can be obtained from the position information of the inspection piece in the reference image. The reference image of the inspection piece can be regarded as the image of the inspection piece taken by the vision system when the built-in caliper standard is used.
[0086] A baseline contour model can be a contour model formed by connecting pixels with significant grayscale value changes that are manually marked on a patch of the baseline image after it has been captured.
[0087] By obtaining the second position information of the inspection patch in the reference image, the position information of the reference contour model can be obtained. That is, the position of the reference contour model is the same as the position of the inspection patch in the reference image. Therefore, based on the second position information and the first position information of the inspection patch in the current image, the reference contour model can be affinely transformed to the position of the inspection patch in the current image, so as to achieve a rough match of the current contour model and improve the efficiency of fitting the current contour model.
[0088] According to some embodiments of this application, optionally, before the device for detecting the stability of the vision system performs an affine transformation of the reference contour model to the position of the inspection piece in the current image, the reference contour model can also be saved at the origin of the coordinate system. Specifically, firstly, a reference contour model is obtained based on the reference image of the inspection piece, and second position information of the inspection piece in the reference image is obtained, that is, the position information of the reference contour model. For example, the second position information is represented as (R, C, A), where R represents the row where the center point of the inspection piece is located, C represents the column where the center point of the inspection piece is located, and A represents the placement angle of the inspection piece. Then, based on the second position information, the reference contour model is affinely transformed to the origin of the coordinate system, and the reference contour model at the origin is saved. With this implementation, when performing step 220, it is not necessary to know the position information of the reference contour model in advance, and the vision system does not need to save or record the position information of the reference contour model. During the affine transformation, it is only necessary to affinely transform the reference contour model at the origin to the position of the inspection piece in the current image based on the first position information.
[0089] According to some embodiments of this application, optionally, the inspection piece may include at least one rectangular frame, each rectangular frame including a circle and a grayscale area outside the circle, and the reference contour model and the current contour model include the contours of the rectangular frames and the circle. For example Figure 3 The image shown is of an inspection piece. The inspection piece includes four rectangular frames. Taking frame number 1 as an example, the area within the frame other than the circle is a grayscale area. The grayscale areas of the other rectangular frames are similar. The circle within the rectangular frame can be used as a dimension measurement pattern for the inspection piece, and the grayscale area serves as a grayscale value measurement pattern for the inspection piece.
[0090] When the current contour model is fitted, the size of the circle on the current contour model is compared with the size of the circle on the reference contour to determine whether the camera position of the vision system has changed; the gray value of the gray area on the current contour is compared with the gray value of the gray area on the reference contour to determine whether the illumination of the vision system has changed.
[0091] Since a circle has only one linear dimension, namely its diameter, compared to other polygons that require measuring the dimensions of each side, the amount of measurement work can be reduced, allowing for quick comparison of the measured values to confirm whether the camera position of the vision system has changed.
[0092] According to some embodiments of this application, optionally, such as Figure 3 As shown, when there are multiple bounding boxes, the diameters of the circles corresponding to these multiple bounding boxes are different, and the gray values of the grayscale areas corresponding to these multiple bounding boxes are also different. By comparing the diameters of the multiple circles and the grayscale values of the different grayscale areas in the baseline contour model and the current contour model, the accuracy of the stability of the detection vision system can be increased.
[0093] According to some embodiments of this application, optionally, a rectangular frame in the inspection piece includes a notch for indicating the orientation of the inspection piece.
[0094] like Figure 3 As shown, the upper right corner of rectangle number 2 includes a notch, which could be, for example, a... Figure 3 The triangle in the image can be any other shape, as long as it can represent the direction of the inspection piece. This application does not limit this.
[0095] By using notches to indicate the direction of the inspection piece or its angle of deviation from the coordinate axis, in addition to matching the approximate contour of the current contour model using row and column information, the orientation information of the inspection piece is also added, so as to quickly and accurately fit the current contour model and improve the efficiency of the detection system.
[0096] According to some embodiments of this application, optionally, the apparatus for detecting the stability of the vision system can fit a second circle of the current contour model based on a first circle in a reference contour model.
[0097] by Figure 3 Taking the circle within rectangle 1 (hereinafter referred to as circle 1) as an example, circle 1 in the reference contour model is the first circle, and circle 1 in the current contour model is the second circle. It should be understood that the first and second circles are only used to distinguish the same circle at the same location in the reference image. After affinely transforming the reference contour model to the first position, a rough match can be achieved with the current contour model. That is, the roughly matched current contour model may have slight deviations from the actual or precise position of the current contour model. For example… Figure 4As shown in (a), taking the circle within rectangle 1 as an example, Figure 4 (a) can be understood as the image formed by affine transformation of the first circle in the reference contour model to the position of the point patch in the current image. Circle 11 is the circle matched at the first position according to the first circle of the reference contour model. This circle deviates slightly from the second circle, which is the circle formed by connecting pixels with significant pixel value changes, i.e., circle number 1 of the current contour model. At this time, it is necessary to fit the accurate second circle. After fitting the second circle in the current contour model, the gray area can be obtained, that is, the area outside the circle is the gray area corresponding to the circle.
[0098] When fitting the current contour model, it is only necessary to fit the second circle of the current contour model to obtain the parameters required for detecting the stability of the vision system, namely the diameter of the circle and the gray value of the gray area. In other words, it is not necessary to fit the contour of the rectangle, which reduces the time required to obtain the parameters required for detecting the stability of the vision system and improves the efficiency of detecting the stability of the vision system.
[0099] According to some embodiments of this application, optionally, the device for detecting the stability of the vision system can obtain multiple pixels with significant gray value changes in the current image based on the outline of the first circle, and the multiple pixels with significant gray value changes form a second circle.
[0100] like Figure 4 (b) and Figure 4 As shown in (c), circle 11 is a circle matched at the first position based on the first circle of the reference contour model. A rectangular strip can be used to find pixel points with significant pixel value changes around the contour of circle 11. The pixel point is at the center of the rectangular strip. Then, the multiple found pixel points can be connected to fit an accurate second circle 22.
[0101] Compared to directly obtaining pixels with significant pixel changes in the current image, obtaining pixels with significant pixel changes based on the outline of the first circle not only reduces the time required to obtain the pixel, but also improves the accuracy of obtaining the pixel, thereby improving the efficiency and accuracy of fitting the second circle.
[0102] According to some embodiments of this application, optionally, the device for detecting the stability of the vision system can obtain the diameter of a first circle based on a reference contour model; obtain the diameter of a second circle based on the current contour model; and determine whether the camera position of the vision system has changed based on the diameter of the first circle and the diameter of the second circle.
[0103] Since this embodiment uses a reference contour model as the standard, the diameter of the first circle is known. If the measured diameter of the second circle of the current contour model is different from the diameter of the first circle, it indicates that the caliper accuracy of the current vision system is inaccurate, leading to inaccurate measurement results. This can be understood as follows: under a standard, each division of the caliper is fixed, representing the size of one pixel. When the camera position changes, the number of pixels within the target object will change compared to the number of pixels within the target object in the reference image. If the original standard is used for calculation, the calculated result will differ from the original size. The method described above, which compares the diameter of the first circle with the diameter of the second circle to determine whether the camera position of the vision system has changed, is more intuitive than using other dimensions of the circle, such as the circumference, and is beneficial for quickly detecting the stability of the vision system.
[0104] According to some embodiments of this application, optionally, if the difference between the diameter of the first circle and the diameter of the second circle is greater than a first threshold, the device for detecting the stability of the vision system confirms that the camera position has changed.
[0105] The first threshold represents the required accuracy of the vision system measurement. The smaller the first threshold, the higher the accuracy requirement. For example, the first threshold could be 0.01 mm. If the difference between the diameter of the first circle and the diameter of the second circle is greater than 0.01 mm, it is confirmed that the camera position of the vision system has changed, i.e., the vision system is unstable. If the difference between the diameters of the first circle and the second circle is less than or equal to 0.01 mm, it is confirmed that the camera position of the vision system has not changed. Of course, the first threshold can also be set to other values according to different customers' different requirements for measurement accuracy; this application does not limit this. By setting the first threshold, different customers' different requirements for measurement accuracy can be met.
[0106] According to some embodiments of this application, optionally, the apparatus for detecting the stability of the vision system can obtain the diameter of the second circle based on the current contour model by: calculating the size of each pixel based on the diameter of the first circle and the number of pixels included in the diameter of the first circle; obtaining the number of pixels included in the diameter of the second circle based on the contour of the second circle; and calculating the diameter of the second circle based on the number of pixels included in the diameter of the second circle and the size of each pixel.
[0107] In a vision system, the size of each pixel in a reference image is calculated by using the diameter of a first circle in the reference image and the number of pixels it contains. When a second circle is fitted in the current image, its diameter can be directly obtained by detecting the number of pixels in its diameter. This second circle's diameter is then compared to the first circle's diameter to quickly determine if the camera position of the vision system has changed, thus detecting the stability of the vision system. For example, assuming the diameter of the first circle in the reference contour model is 2mm and includes 10 pixels, the size of each pixel is 0.2mm. In this case, the vision system measures the size based on this 0.2mm per pixel. However, if the diameter of the second circle in the current contour model includes 20 pixels, the diameter calculated based on the reference is 4mm, which is twice the 2mm diameter of the circle in the reference contour model. This indicates that a change in the camera position of the vision system has caused the measured diameter to be larger than the actual (reference) diameter. In this situation, if the vision system continues to be used to detect the size of the target object, the measurement results will certainly be inaccurate.
[0108] According to some embodiments of this application, optionally, the device for detecting the stability of a vision system can obtain a first gray value of the gray area corresponding to the first circle based on a reference contour model, obtain a second gray value of the gray area corresponding to the second circle based on the current contour model, and confirm whether the illumination in the vision system has changed based on the first gray value and the second gray value.
[0109] Taking the first circle as Figure 3 Taking circle number 1 as an example, the grayscale area corresponding to the first circle is the region within rectangle number 1 excluding circle number 1. The grayscale value of this region is the first grayscale value. This first grayscale value serves as a reference and can be compared with the second grayscale value at the same location under the current contour to determine whether the illumination of the vision system has changed. Excessive changes in illumination within the current vision system can slightly affect size measurements. For example, overexposure can cause the edges of the target object to shrink after imaging, resulting in a smaller measured size. Comparing the first grayscale value of the reference contour model with the second grayscale value of the current contour model helps detect whether the illumination of the vision system has changed, preventing excessive illumination changes from affecting the accuracy of the measurement results.
[0110] According to some embodiments of this application, optionally, the device for detecting the stability of the visual system determines whether the illumination in the visual system has changed based on a first gray value and a second gray value. If the difference between the first gray value and the second gray value is greater than a second threshold, then the device for detecting the stability of the visual system confirms that the illumination has changed.
[0111] The second threshold represents the tolerance of the visual system to changes in the lighting environment. The smaller the second threshold, the lower the degree of lighting variation allowed for the visual system. By setting the second threshold, different requirements of different customers regarding the degree of change in the lighting environment of the visual system can be met.
[0112] According to some embodiments of this application, optionally, the first position information and the second position information may include row information, column information and angle information of the inspection piece, wherein the angle information is used to indicate the direction of the inspection piece.
[0113] The angle information can be the angle between the inspection patch and the x-axis of the coordinate system, or the angle between the inspection patch and the y-axis of the coordinate system. In addition to the usual row and column information, the first and second position information also include angle information indicating the direction of the inspection patch. This allows for a rough match of the current contour model during affine transformation, regardless of how the inspection patch is placed before saving the baseline contour model. This enables the fitting of a more accurate current contour model, eliminating the need to place the inspection patch at a fixed angle before each vision system stability test, thus facilitating rapid detection of vision system stability.
[0114] In another alternative implementation, the method for detecting the stability of a visual system provided in this application embodiment may include, for example: Figure 5 The process 500 shown may include at least a portion of the content. For easier understanding of process 500, please refer to [reference needed]. Figure 6 A schematic diagram illustrating the process of detecting the stability of a vision system.
[0115] 501, A device for detecting the stability of a vision system captures an image of an inspection piece. Once the inspection piece is prepared, an image of it is captured by the camera of the vision system. For example, the image is... Figure 3 The image shown.
[0116] 502, marks the outer contour of the inspection image. For example... Figure 6 As shown in (a), the white border lines mark the outer contour.
[0117] 503. Save the image within the outer contour. Extract the inspection image based on the outer contour, leaving the image within the outer contour, such as... Figure 6 As shown in (b).
[0118] 504 marks all contours within the outer contour of the image that need to be detected. For example... Figure 6 As shown in (c), all the outlines are marked, including the outlines of four rectangles and the outlines of four circles.
[0119] 505. Save the baseline contour model. The combination of all contours to be detected in the image within the marked outer contour is used as the baseline contour model. The baseline contour model is then affinely transformed to the origin. For example... Figure 6 As shown in (d), the center point of the inspection piece is at the center of the graphic formed by the four rectangles, and the origin of the coordinate system is at the upper left corner. Therefore, when the reference contour model is affinely transformed to the origin, only the rectangles and circles in the second row and second column can be seen.
[0120] 506. Obtain the position information of the inspection piece in the current image under the vision system. The inspection piece is captured by the camera of the vision system and used as the current image. Simultaneously, the position information of the inspection piece in the current image of the vision system is obtained.
[0121] 507. Obtain the current contour model. Based on the position information of the point patch in the current image, perform an affine transformation on the reference contour model to the position of the point patch in the current image, and fit the current contour model based on the reference contour model.
[0122] 508 retrieves the diameter of the circle and the grayscale value of the grayscale area in the current contour model. For example... Figure 6 (e), with the top left corner representing the final measured diameter of each circle and the grayscale value of the grayscale area in each rectangle.
[0123] 509. Confirm whether the camera position and illumination of the vision system have changed. Specifically, confirm whether the camera position of the vision system has changed based on the difference between the diameter of the first circle and the diameter of the second circle and a first threshold, and confirm whether the illumination of the vision system has changed based on the first grayscale value and the second grayscale value.
[0124] The method for detecting the stability of a vision system provided in this application embodiment achieves approximate matching of the current contour model by performing an affine transformation on the reference contour model of the inspection patch to the position of the inspection patch in the current image. Then, the current contour model is precisely fitted, and the reference contour model is compared with the current contour model to confirm whether the stability of the vision system has changed. This allows for timely error reporting in case of changes, ensuring the accuracy of the vision system detection results.
[0125] The method embodiments of this application have been described in detail above. The device embodiments of this application are described below. The device embodiments correspond to the method embodiments. Therefore, for any part not described in detail, please refer to the preceding method embodiments. The device can implement any possible implementation of the above methods.
[0126] Figure 7 A schematic block diagram of a defect detection apparatus 700 according to an embodiment of this application is shown. The apparatus 700 can perform the method for detecting the stability of a vision system described in the embodiments of this application; for example, the apparatus 700 can be the aforementioned controller 10.
[0127] like Figure 7 As shown, the device includes:
[0128] The acquisition unit 710 is used to acquire the first position information of the inspection piece in the current image under the vision system.
[0129] The processing unit 720 is used to perform an affine transformation of the reference contour model of the inspection piece to the position of the inspection piece in the current image based on the first position information, fit the current contour model of the inspection piece in the current image according to the reference contour model, and confirm the stability of the vision system based on the reference contour model and the current contour model.
[0130] According to some embodiments of this application, optionally, the acquisition unit 710 can also be used to acquire a reference contour model based on the reference image of the inspection piece, and acquire the second position information of the inspection piece in the reference image; the processing unit 720 can also be used to affinely transform the reference contour model of the inspection piece to the position of the inspection piece in the current image according to the first position information and the second position information.
[0131] According to some embodiments of this application, optionally, the inspection piece may include at least one rectangular frame, each rectangular frame may include a circle and a gray area outside the circle; the reference contour model and the current contour model include the contours of the rectangle and the circle.
[0132] According to some embodiments of this application, optionally, there can be multiple rectangles, the diameters of the multiple circles corresponding to the multiple rectangles are different, and the gray values of the multiple gray areas corresponding to the multiple rectangles are different.
[0133] According to some embodiments of this application, optionally, a rectangular frame in the inspection piece may include a notch for indicating the orientation of the inspection piece.
[0134] According to some embodiments of this application, optionally, the processing unit 720 can also be used to fit a second circle of the current contour model based on a first circle in the reference contour model.
[0135] According to some embodiments of this application, optionally, the acquisition unit is also used to acquire multiple pixels with significant grayscale value changes in the current image based on the outline of the first circle, and the multiple pixels with significant grayscale value changes form a second circle.
[0136] According to some embodiments of this application, optionally, the acquisition unit 710 can also be used to acquire the diameter of the first circle based on the reference contour model; acquire the diameter of the second circle based on the current contour model; the processing unit 720 can also be used to confirm whether the camera position of the vision system has changed based on the diameter of the first circle and the diameter of the second circle.
[0137] According to some embodiments of this application, optionally, the processing unit 720 can also be used to confirm that the camera position has changed if the difference between the diameter of the first circle and the diameter of the second circle is greater than a first threshold.
[0138] According to some embodiments of this application, optionally, the processing unit 720 can also be used to calculate the size of each pixel based on the diameter of the first circle and the number of pixels included in the diameter of the first circle; the acquisition unit 710 can also be used to: acquire the number of pixels included in the diameter of the second circle based on the outline of the second circle; the processing unit 720 can also be used to calculate the diameter of the second circle based on the number of pixels included in the diameter of the second circle and the size of each pixel.
[0139] According to some embodiments of this application, optionally, the acquisition unit 710 can also be used to acquire the first gray value of the gray area corresponding to the first circle according to the reference contour model; acquire the second gray value of the gray area corresponding to the second circle according to the current contour model; the processing unit 720 can also be used to confirm whether the illumination in the vision system has changed according to the first gray value and the second gray value.
[0140] According to some embodiments of this application, optionally, the processing unit 720 can also be used to confirm a change in illumination if the difference between the first gray value and the second gray value is greater than a second threshold.
[0141] According to some embodiments of this application, optionally, the first position information and the second position information may include row information, column information and angle information of the inspection piece, wherein the angle information is used to indicate the direction of the inspection piece.
[0142] Figure 8 This is a schematic diagram of the hardware structure of the defect detection device according to an embodiment of this application. Figure 7 The defect detection device 800 shown includes a memory 801, a processor 802, a communication interface 803, and a bus 804. The memory 801, processor 802, and communication interface 803 are interconnected via the bus 804.
[0143] The memory 801 may be a read-only memory (ROM), a static storage device, or a random access memory (RAM). The memory 801 may store a program, and when the program stored in the memory 801 is executed by the processor 802, the processor 802 and the communication interface 803 are used to execute the various steps of the defect detection method of the embodiments of this application.
[0144] The processor 802 may be a general-purpose central processing unit (CPU), microprocessor, application-specific integrated circuit (ASIC), graphics processing unit (GPU), or one or more integrated circuits, used to execute relevant programs to achieve the functions required by the units in the defect detection apparatus of this application embodiment, or to execute the defect detection method of this application embodiment.
[0145] The processor 802 can also be an integrated circuit chip with signal processing capabilities. In implementation, each step of the defect detection method in this embodiment can be accomplished through integrated logic circuits in the processor 802 or through software instructions.
[0146] The processor 802 described above can also be a general-purpose processor, a digital signal processor (DSP), an ASIC, a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of hardware processors, or can be executed by a combination of hardware and software modules in the processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory 801. The processor 802 reads the information in memory 801 and, in conjunction with its hardware, completes the functions required by the units included in the defect detection apparatus of the embodiments of this application, or executes the defect detection method of the embodiments of this application.
[0147] The communication interface 803 uses transceiver devices, such as, but not limited to, transceivers, to enable communication between the device 800 and other devices or communication networks. For example, traffic data from unknown devices can be obtained through the communication interface 803.
[0148] Bus 804 may include a pathway for transmitting information between various components of device 800 (e.g., memory 801, processor 802, communication interface 803).
[0149] It should be noted that although the above-described device 800 only shows a memory, processor, and communication interface, those skilled in the art should understand that in specific implementations, device 800 may also include other devices necessary for normal operation. Furthermore, depending on specific needs, those skilled in the art should understand that device 800 may also include hardware devices for implementing other additional functions. Moreover, those skilled in the art should understand that device 800 may only include the devices necessary for implementing the embodiments of this application, and may not necessarily include... Figure 8 All the devices shown.
[0150] This application also provides a computer-readable storage medium storing program code for execution by a device, the program code including instructions for performing the steps in the above-described defect detection method.
[0151] This application also provides a computer program product, which includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions, which, when executed by a computer, cause the computer to perform the above-described defect detection method.
[0152] The aforementioned computer-readable storage medium may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.
[0153] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the device described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0154] Although this application has been described with reference to preferred embodiments, various modifications can be made thereto and components can be replaced with equivalents without departing from the scope of this application. In particular, the technical features mentioned in the various embodiments can be combined in any manner, provided there is no structural conflict. This application is not limited to the specific embodiments disclosed herein, but includes all technical solutions falling within the scope of the claims.
Claims
1. A method for detecting the stability of a visual system, characterized in that, include: Obtain the first position information of the inspection patch in the current image under the vision system; The inspection piece includes at least one rectangular frame, and each rectangular frame includes a circle and a gray area outside the circle; Based on the first position information, the reference contour model of the inspection piece is affinely transformed to the position of the inspection piece in the current image, and the current contour model of the inspection piece in the current image is fitted according to the reference contour model; the reference contour model and the current contour model include the contours of the rectangle and the circle; The stability of the vision system is confirmed based on the baseline contour model and the current contour model.
2. The method according to claim 1, characterized in that, Before performing an affine transformation of the reference contour model of the inspection patch to the position of the inspection patch in the current image, the method further includes: The reference contour model is obtained based on the reference image of the inspection piece; Obtain the second position information of the inspection piece in the reference image; The step of affinely transforming the reference contour model of the inspection patch to the position of the inspection patch in the current image includes: Based on the first location information and the second location information, the reference contour model of the inspection piece is affinely transformed to the position of the inspection piece in the current image.
3. The method according to claim 1, characterized in that, There are multiple rectangular frames, and the diameters of the multiple circles corresponding to the multiple rectangular frames are different, and the gray values of the multiple gray areas corresponding to the multiple rectangular frames are different.
4. The method according to claim 3, characterized in that, One of the rectangular frames in the inspection piece includes a notch, the notch being used to indicate the orientation of the inspection piece.
5. The method according to claim 1, characterized in that, The step of fitting the current contour model based on the baseline contour model includes: The second circle of the current contour model is fitted based on the first circle in the reference contour model.
6. The method according to claim 5, characterized in that, The step of fitting a second circle of the current contour model based on a first circle in the reference contour model includes: Based on the outline of the first circle, multiple pixels with significant grayscale value changes in the current image are obtained, and these multiple pixels with significant grayscale value changes form the second circle.
7. The method according to claim 5 or 6, characterized in that, The step of confirming the stability of the vision system based on the baseline contour model and the current contour model includes: The diameter of the first circle is obtained based on the reference contour model; The diameter of the second circle is obtained based on the current contour model; Based on the diameters of the first circle and the second circle, determine whether the camera position of the vision system has changed.
8. The method according to claim 7, characterized in that, The step of determining whether the camera position of the vision system has changed based on the diameters of the first circle and the second circle includes: If the difference between the diameter of the first circle and the diameter of the second circle is greater than a first threshold, then it is confirmed that the camera position has changed.
9. The method according to claim 7, characterized in that, Obtaining the diameter of the second circle based on the current contour model includes: The size of each pixel is calculated based on the diameter of the first circle and the number of pixels included in the diameter of the first circle; Based on the outline of the second circle, obtain the number of pixels included in the diameter of the second circle; The diameter of the second circle is calculated based on the number of pixels included in the diameter of the second circle and the size of each pixel.
10. The method according to any one of claims 1 to 6, characterized in that, The step of confirming the stability of the vision system based on the baseline contour model and the current contour model further includes: The first gray value of the gray area corresponding to the first circle is obtained according to the reference contour model; The second grayscale value of the grayscale area corresponding to the second circle is obtained based on the current contour model. Based on the first grayscale value and the second grayscale value, it is determined whether the illumination in the vision system has changed.
11. The method according to claim 10, characterized in that, The step of determining whether the illumination in the vision system has changed based on the first gray value and the second gray value includes: If the difference between the first grayscale value and the second grayscale value is greater than the second threshold, then it is confirmed that the illumination has changed.
12. The method according to claim 2, characterized in that, The first location information and the second location information include the row information, column information and angle information of the inspection piece, wherein the angle information is used to indicate the direction of the inspection piece.
13. A device for detecting the stability of a vision system, characterized in that, include: The acquisition unit is used to acquire the first position information of the inspection piece in the current image under the vision system; The inspection piece includes at least one rectangular frame, and each rectangular frame includes a circle and a gray area outside the circle; The processing unit, based on the first position information, performs an affine transformation on the reference contour model of the inspection piece to the position of the inspection piece in the current image, and fits the current contour model of the inspection piece in the current image according to the reference contour model; and confirms the stability of the vision system based on the reference contour model and the current contour model; the reference contour model and the current contour model include the contours of the rectangle and the circle.
14. The apparatus according to claim 13, characterized in that, The acquisition unit is further configured to: acquire the reference contour model based on the reference image of the inspection piece; and acquire the second position information of the inspection piece in the reference image; The processing unit is further configured to: based on the first position information and the second position information, perform an affine transformation of the reference contour model of the inspection piece to the position of the inspection piece in the current image.
15. The apparatus according to claim 13, characterized in that, The processing unit is also used to fit a second circle of the current contour model based on the first circle in the reference contour model.
16. The apparatus according to claim 15, characterized in that, The acquisition unit is also used for: Based on the outline of the first circle, multiple pixels with significant grayscale value changes in the current image are obtained, and these multiple pixels with significant grayscale value changes form the second circle.
17. The apparatus according to claim 15 or 16, characterized in that, The acquisition unit is further configured to: acquire the diameter of the first circle based on the reference contour model; and acquire the diameter of the second circle based on the current contour model; The processing unit is further configured to: determine whether the camera position of the vision system has changed based on the diameter of the first circle and the diameter of the second circle.
18. The apparatus according to claim 13, characterized in that, The acquisition unit is further configured to: acquire a first gray value of the gray area corresponding to the first circle based on the reference contour model; and acquire a second gray value of the gray area corresponding to the second circle based on the current contour model. The processing unit is further configured to: determine whether the illumination in the vision system has changed based on the first grayscale value and the second grayscale value.
19. A device for detecting the stability of a vision system, characterized in that, The system includes a processor and a memory, the memory being used to store a program, and the processor being used to call and run the program from the memory to perform the method for detecting the stability of a vision system as described in any one of claims 1 to 12.
20. A computer-readable storage medium, characterized in that, Includes a computer program that, when run on a computer, causes the computer to perform the method for detecting the stability of a vision system as described in any one of claims 1 to 12.
Citation Information
Patent Citations
Vision inspection method
CN106204540A
Method for measuring deformation based on laser
CN111412851A
