CN114511565B - 2.5D defect detection method, device, equipment and medium based on multi-angle light source - Google Patents

2.5D defect detection method, device, equipment and medium based on multi-angle light source Download PDF

Info

Publication number
CN114511565B
CN114511565B CN202210409340.4A CN202210409340A CN114511565B CN 114511565 B CN114511565 B CN 114511565B CN 202210409340 A CN202210409340 A CN 202210409340A CN 114511565 B CN114511565 B CN 114511565B
Authority
CN
China
Prior art keywords
value
gray
defect
gray value
light source
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210409340.4A
Other languages
Chinese (zh)
Other versions
CN114511565A (en
Inventor
王灿
丁丁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Lingxi Robot Intelligent Technology Co ltd
Original Assignee
Hangzhou Lingxi Robot Intelligent Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Lingxi Robot Intelligent Technology Co ltd filed Critical Hangzhou Lingxi Robot Intelligent Technology Co ltd
Priority to CN202210409340.4A priority Critical patent/CN114511565B/en
Publication of CN114511565A publication Critical patent/CN114511565A/en
Application granted granted Critical
Publication of CN114511565B publication Critical patent/CN114511565B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image

Abstract

The invention discloses a 2.5D defect detection method and device based on a multi-angle light source, electronic equipment and a medium, relates to the technical field of image processing, and aims to solve the problem of low defect detection accuracy of a detection method in the related art. The method comprises the following steps: acquiring two groups of gray data, wherein any one group of gray data comprises a first gray value, a second gray value and an auxiliary gray value which correspond to a pixel point to be processed; for any group of gray data, constructing a parabola according to the point (-1, the first gray value), the point (0, the auxiliary gray value) and the point (1, the second gray value) on a coordinate system, obtaining the distance from the symmetry axis of the parabola to the y axis, and recording the distance as a deviation distance; and calculating a defect processing value reflecting the defect degree according to a processing formula. The invention improves the accuracy of defect result detection.

Description

2.5D defect detection method, device, equipment and medium based on multi-angle light source
Technical Field
The invention relates to the technical field of image processing, in particular to a method and a device for detecting 2.5D defects based on a multi-angle light source, electronic equipment and a medium.
Background
With the progress of society and the development of science and technology, more and more production line adopts the machine to detect the object in order to replace the manual work gradually to reduce the human cost and improve detection efficiency. For example, a part of an article needs to ensure the flatness of its surface, i.e. it needs to detect whether the surface of the article is defective, in the related art, the detection method may include: and controlling a camera to shoot the surface to be measured of the object to obtain a target image, and then judging whether the target image has defects or not by combining the trained machine model.
However, since the surface to be detected of a part of the object may have false defects such as patterns, water marks, doodles and the like, the flatness of the surface to be detected is not affected, but shadows are left on the target image, so that the machine model is determined to have defects, and detection results are erroneous.
At present, no effective solution is provided for the problem of low defect detection accuracy of a detection method in the related art.
Disclosure of Invention
The embodiment of the application provides a 2.5D defect detection method, a device, an electronic device and a medium based on a multi-angle light source, which aim to reduce the influence of pseudo defects and improve the accuracy of defect result detection.
In a first aspect, an embodiment of the present application provides a method for detecting a 2.5D defect based on a multi-angle light source, where the method includes:
acquiring two groups of gray data, wherein any one group of gray data comprises a first gray value, a second gray value and an auxiliary gray value corresponding to a pixel point to be processed, a light source corresponding to the first gray value and a light source corresponding to the second gray value are uniformly distributed on the circumference which is parallel to and higher than a surface to be detected, the light source associated with any one group of gray data and the light source associated with the other group of gray data are vertically arranged relative to the surface to be detected, and a luminous body corresponding to the auxiliary gray value is directly or indirectly positioned right above the surface to be detected;
for any group of gray data, constructing a parabola according to the point (-1, a first gray value), the point (0, an auxiliary gray value) and the point (1, a second gray value) on a coordinate system, obtaining the distance from the symmetry axis of the parabola to the y axis, and recording the distance as a deviation distance;
calculating a defect process value reflecting a degree of a defect according to a process formula, the process formula including:
Figure DEST_PATH_IMAGE001
wherein q is the defect handling value, d i Is the ith offset distance.
In some of these embodiments, the method further comprises:
acquiring defect processing values of all pixel points, and calculating an average defect processing value;
calculating a defect adjustment value according to an adjustment formula, the adjustment formula comprising:
Figure 100002_DEST_PATH_IMAGE002
wherein p is the defect adjustment value, u is the average defect handling value, s and m are preset values, s is greater than or equal to 4, and m is greater than or equal to 4.
In some of these embodiments, the method further comprises:
production of original region [ 2 ]
Figure DEST_PATH_IMAGE003
min ,p max ],
Figure 2743DEST_PATH_IMAGE003
min Is the minimum value, p, of the defect adjustment values of all pixels that is not zero max The maximum value of the defect adjustment values of all the pixel points is obtained;
acquiring a demand interval, and determining a mapping function according to the original interval and the demand interval;
the defect adjustment value is passed through the mapping function to obtain a resulting gray scale value.
In some of these embodiments, the method further comprises: and generating a defect result graph according to all the pixel points and the corresponding result gray values.
In some of these embodiments, the method further comprises: in the process of constructing the parabola, if the point (-1, the first gray value), the point (0, the auxiliary gray value) and the point (1, the second gray value) are collinear, the deviation distance is zero.
In some embodiments, for any one set of gray scale data, the obtaining of the auxiliary gray scale value comprises:
calculating the auxiliary gray value according to an equivalent formula, wherein the equivalent formula is as follows:
Figure 100002_DEST_PATH_IMAGE004
where s is the auxiliary gray value, g 1 A first gray value, g, of another set of gray data 2 And theta is a second gray value of the other group of gray data, and theta is the degree of an included angle formed between the light source and the surface to be measured.
In some embodiments, for any one set of gray scale data, the obtaining of the auxiliary gray scale value comprises:
acquiring an auxiliary image, wherein a luminous body corresponding to the auxiliary image is directly positioned right above the surface to be detected, and the distance from the luminous body to the surface to be detected is equal to the distance from the light source to the surface to be detected;
and reading the gray value of the auxiliary image at the pixel point to be processed and recording the gray value as the auxiliary gray value.
In a second aspect, an embodiment of the present application provides a 2.5D defect detection apparatus based on a multi-angle light source, the apparatus including:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring two groups of gray data, any one group of gray data comprises a first gray value, a second gray value and an auxiliary gray value corresponding to a pixel point to be processed, a light source corresponding to the first gray value and a light source corresponding to the second gray value are uniformly distributed on the circumference which is parallel to and higher than a surface to be detected, the light source associated with any one group of gray data and the light source associated with the other group of gray data are vertically arranged relative to the surface to be detected, and a luminous body corresponding to the auxiliary gray value is directly or indirectly positioned right above the surface to be detected;
the building module is used for building a parabola according to the point (-1, the first gray value), the point (0, the auxiliary gray value) and the point (1, the second gray value) on the coordinate system for any group of gray data, obtaining the distance from the symmetry axis of the parabola to the y axis, and recording the distance as a deviation distance;
a processing module for calculating a defect processing value reflecting a defect degree according to a processing formula, the processing formula including:
Figure 716621DEST_PATH_IMAGE001
wherein q is the defect handling value, d i Is the ith offset distance.
In a third aspect, an embodiment of the present application provides an electronic apparatus, which includes a memory and a processor, where the memory stores a computer program, and the processor is configured to implement the method for detecting a 2.5D defect based on a multi-angle light source as described in the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for detecting a 2.5D defect based on multiple angles of light sources as described in the first aspect above.
Compared with the related art, the invention has the beneficial effects that: because the light source corresponding to the first gray value and the light source corresponding to the second gray value are 180-degree symmetric and form the same included angle with the surface to be detected, the defect of the surface to be detected can be reflected according to the deviation distance obtained by the first gray value, the second gray value and the auxiliary gray value under the condition that the surface to be detected has the defect, so that the influence of pseudo-defect is reduced, and the accuracy of defect result detection is improved; the calculation related to the method only has a few operations of addition, subtraction, multiplication and division, namely the complexity of the algorithm is reduced, and therefore the overall processing efficiency is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a flowchart of a multi-angle light source based 2.5D defect detection method according to an embodiment of the present application;
FIG. 2 is a flowchart of a method for detecting a 2.5D defect based on multi-angle light sources according to another embodiment of the present application;
FIG. 3 is a schematic view of the position of an object and a light source according to an embodiment of the present application;
FIG. 4 is a schematic diagram illustrating data processing trend of a multi-angle light source based 2.5D defect detection method according to an embodiment of the present application;
FIG. 5 is a block diagram of a 2.5D defect detection apparatus based on a multi-angle light source according to an embodiment of the present application;
fig. 6 is a block diagram of a structure of an electronic device according to an embodiment of the present application.
Description of reference numerals: 51. an acquisition module; 52. building a module; 53. a processing module;
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be described and illustrated below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments provided in the present application without any inventive step are within the scope of protection of the present application. Moreover, it should be appreciated that such a development effort might be complex and tedious, but would nevertheless be a routine undertaking of design, fabrication, and manufacture for those of ordinary skill having the benefit of this disclosure, given the benefit of this disclosure, without departing from the scope of this disclosure.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the specification. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is to be expressly and implicitly understood by one of ordinary skill in the art that the embodiments described herein may be combined with other embodiments without conflict.
The embodiment provides a 2.5D defect detection method based on a multi-angle light source, and aims to solve the problem that the defect detection accuracy of a detection method in the related art is low.
Fig. 1 is a flowchart of a 2.5D defect detection method based on a multi-angle light source according to an embodiment of the present application, and referring to fig. 1, the method includes steps S101 to S103.
And step S101, acquiring two groups of gray data.
And any group of gray data comprises a first gray value, a second gray value and an auxiliary gray value corresponding to the pixel point to be processed, the light source corresponding to the first gray value and the light source corresponding to the second gray value are uniformly distributed on the circumference which is parallel to and higher than the surface to be measured, the light source associated with any group of gray data and the light source associated with the other group of gray data are vertically arranged relative to the surface to be measured, and the luminous body corresponding to the auxiliary gray value is directly or indirectly positioned right above the surface to be measured.
Step S102, for any group of gray data, constructing a parabola according to the point (-1, the first gray value), the point (0, the auxiliary gray value) and the point (1, the second gray value) on the coordinate system, and obtaining the distance from the symmetry axis of the parabola to the y axis, and recording the distance as a deviation distance.
Step S103, calculating a defect processing value reflecting the defect degree according to a processing formula, wherein the processing formula comprises the following steps:
Figure DEST_PATH_IMAGE005
wherein q is a defect processing value, d i Is the ith offset distance.
It is worth mentioning that the steps of the method may be performed based on the execution device. Specifically, the execution device may be a server, a cloud server, a client, a processor, or the like, but the execution device is not limited to the above type.
In summary, the light source corresponding to the first gray scale value and the light source corresponding to the second gray scale value are 180-degree symmetric and form an included angle with the surface to be detected with the same angle, so that when the surface to be detected has a defect, the defect of the surface to be detected can be reflected according to the deviation distance obtained by the first gray scale value, the second gray scale value and the auxiliary gray scale value, so as to reduce the influence of the false defect, and improve the accuracy of the defect result detection; the calculation related to the method only has a few operations of addition, subtraction, multiplication and division, namely the complexity of the algorithm is reduced, and therefore the overall processing efficiency is improved.
It can be understood that, since the shadow detection effect of the present invention on the object is not ideal, and the large protruded part of the object surface will generate the shadow, thereby generating the error on the result, the surface to be measured of the object to be detected of the present invention should be smooth.
As an alternative embodiment, in step S101, the first gray scale value and the second gray scale value are obtained.
Fig. 3 is a schematic position diagram of the object and the light sources in the embodiment of the present application, in which the four light sources are all located right above the surface to be measured of the object, and angles formed by any light source and the surface to be measured are the same. It should be noted that, since the surface to be measured has a certain size, the angle formed by the point on the surface to be measured and the light source is not completely the same, and the type of the light source and the distance between the light source and the surface to be measured can be selected to compensate for the above-mentioned defects. For example: under the condition that the light source selects a surface light source, the light source is more than 60cm away from the center of the surface to be measured; under the condition that a point light source is selected as the light source, the distance between the light source and the center of the surface to be measured is 5 m-6 m, and the light source is preferably a surface light source in consideration of working space. The size influence of the surface to be measured can be ignored through the setting, namely, the included angle formed by the light source and the center of the surface to be measured can be used as the included angle formed by the light source and the surface to be measured.
The four light sources can be respectively referred to as a first light source, a second light source, a third light source and a fourth light source, and can be regarded as being positioned in front of, behind, on the left of and on the right of the surface to be measured, and the brightness of each light source is the same. For the sake of convenience of distinction only, the two gradation data are referred to as gradation data E and gradation data F herein, the gradation data E corresponds to the first light source and the second light source, and the gradation data F corresponds to the third light source and the fourth light source. Correspondingly, when the first light source works and the second light source, the third light source and the fourth light source are all turned off, the camera shoots a to-be-detected surface to obtain a target image, then the gray value of the target image at a to-be-processed pixel point is read, namely the first gray value of the gray data E, and then the second gray value of the gray data E, the first gray value of the gray data F and the second gray value of the gray data F can be obtained according to the same mode.
It should be noted that the position and the shooting angle of the camera are always unchanged, the camera is located right above the object to be detected and can completely shoot the surface to be detected, and therefore, each target image is only the light source position is changed, the gray value of the same pixel point can be calculated, the step of conversion between the target images is omitted, the complexity of the method is reduced, and the working efficiency is improved.
The gray scale on the target image is regular because the distance between the surface to be detected and the light source is close to or far from each other, and the dark surface with different degrees exists on the surface to be detected if the surface to be detected has defects, so that the gray scale on the target image is damaged, and the detection method based on the basis can detect the surface defects of the object.
It should also be noted that the method may use four light sources and then distribute them as shown in fig. 3, or may use only one light source by moving it to each light source position shown in fig. 3, which is not limited herein.
As an alternative embodiment, in step S101, it also involves an auxiliary gray value obtaining manner. The method specifically comprises the following steps:
and acquiring an auxiliary image, wherein the luminous body corresponding to the auxiliary image is directly positioned right above the surface to be measured, and the distance from the luminous body to the surface to be measured is equal to the distance from the light source to the surface to be measured.
And reading the gray value of the auxiliary image at the pixel point to be processed and recording the gray value as an auxiliary gray value.
It should be noted that, the position and the angle of the camera are still unchanged, and the auxiliary gray-scale value of the gray-scale data E is the same as the auxiliary gray-scale value of the gray-scale data F, that is, only one acquisition of the auxiliary image is needed. The parameters of the luminary, such as brightness, should be the same as the respective light sources, although they may be the same. It should be understood that, when the illuminant operates, the shadow surface generated by the defect on the surface to be measured is small, which can be used as a reference for the influence of the light source on the defect, i.e. the parabola is constructed in step S102.
In the embodiment, only one more auxiliary image needs to be acquired to provide corresponding data for subsequent processing, so that the operation is simple and the accuracy of subsequent results is improved although the time cost is increased.
As an alternative embodiment, fig. 4 is a schematic data processing trend diagram of a 2.5D defect detection method based on a multi-angle light source in the embodiment of the present application, and referring to fig. 1 and fig. 4, another method may be adopted to assist in obtaining a gray scale value, specifically, the method includes the following steps:
and calculating the auxiliary gray value according to an equivalent formula, wherein the equivalent formula is as follows:
Figure 293096DEST_PATH_IMAGE004
where s is the auxiliary gray value, g 1 A first gray value, g, of another set of gray data 2 And theta is the degree of an included angle formed between the light source and the surface to be measured.
For example: in the gray data E, the first gray value and the second gray value are 10 and 20, respectively, θ is 30 °, and the auxiliary gray values in the gray data F are calculated as:
Figure 100002_DEST_PATH_IMAGE006
= 17.321. It should be noted that: this method can be regarded as a virtual illuminant indirectly located right above the surface to be measured.
In this embodiment, it is not necessary to acquire other images except the target image, but the auxiliary gray-scale value of the gray-scale data is calculated directly by using the gray-scale data of another group, but due to the influence of the defect, the accuracy of the auxiliary gray-scale value with respect to the auxiliary gray-scale value using the auxiliary image is low, the time cost is also reduced, and the operability is higher than the accuracy of the auxiliary gray-scale value using the auxiliary image.
As an alternative embodiment, for step S102, in the process of constructing the parabola, for any gray data, the equation of the parabola is:
Figure DEST_PATH_IMAGE007
the three points are (-1, the first gray value), point (0, the auxiliary gray value), point (1, the second gray value), the deviation distance can be obtained through a parabola, the process can be obtained through a modeling mode, and of course, the deviation distance can also be directly obtained through a formula
Figure 100002_DEST_PATH_IMAGE008
Wherein r is an auxiliary gray value, the above formulaThe formula is obtained through the characteristics of the parabola, and the larger the deviation distance is, the farther the opposite of the parabola is away from the y axis, the higher the possibility that the pixel point to be processed has defects is, so that even if a parabola model is not established and the deviation distance is directly obtained by the formula, the method also can be considered to fall into the protection scope of the invention.
It should be noted that
Figure DEST_PATH_IMAGE009
In the case of (1), i.e., -0, the first gray value, and (1, the second gray value), the deviation distance tends to infinity, and the deviation distance can be directly set to 0.
As an alternative embodiment, FIG. 2 is a flowchart of a 2.5D defect detection method based on multi-angle light sources according to another embodiment of the present application. Step 201 to step S203 in fig. 2 may refer to the related description of step S101 to step S103, which is not described herein again. Referring to fig. 2 and 4, the 2.5D defect detection method based on a multi-angle light source may further include steps S204 to S205.
And step S204, acquiring defect processing values of all the pixel points, and calculating an average defect processing value. It should be noted that all the pixel points may be all the pixel points on the target image, or all the pixel points on the target image corresponding to the surface to be measured, and preferably the latter.
Step S205, calculating a defect adjustment value according to an adjustment formula, wherein the adjustment formula comprises:
Figure 100002_DEST_PATH_IMAGE010
wherein p is a defect adjustment value, u is an average defect handling value, s and m are preset values, s is larger than or equal to 4, and m is larger than or equal to 4. Here, by way of example: when s =6, m =10, and u =1, p ranges from [ 0, 10 ], and when q is 100, p =10, and when q is 2, p = 2.
Through the embodiment, the defect processing value with a obviously larger numerical value can be processed, the consistency of the defect adjustment value is improved under the condition of not influencing the accuracy, and the difference between the defect adjustment values is reduced.
Further, as shown in fig. 2 and 4, the 2.5D defect detection method based on a multi-angle light source may further include steps S206 to S208.
Step S206, generating original region
Figure DEST_PATH_IMAGE011
Figure 355816DEST_PATH_IMAGE003
min Is the minimum value of the defect adjustment values of all the pixel points which is not zero,
Figure 435768DEST_PATH_IMAGE003
max the maximum value among the defect adjustment values at all the pixel points. It should be noted that, if the defect adjustment value is zero, the pixel is defect-free, and the subsequent processing may not be performed.
And step S207, acquiring a demand interval, and determining a mapping function according to the original interval and the demand interval. The requirement interval may be set by the developer, but the right boundary of the requirement interval should be greater than p max . The mapping relationship may be:
Figure 100002_DEST_PATH_IMAGE012
wherein
Figure DEST_PATH_IMAGE013
k max The left boundary value and the right boundary value of the demand interval are respectively. Of course, the mapping relationship is not limited to the above formula.
Step S208, the defect adjustment value obtains a result gray value through a mapping function. Referring to the mapping relationship in the above example, if the defect adjustment value is {2, 3, 4} in the case where the original interval is [ 2, 4 ] and the required interval is [ 0, 200 ], it is able to obtain the result gray-level value of {0, 100, 200 }.
By the embodiment, the result gray value with larger numerical difference can be obtained, so that the surface defects of the object can be distinguished according to the result gray value.
Further, referring to fig. 2 and 4, the 2.5D defect detecting method based on a multi-angle light source may further include step S209.
And S209, generating a defect result graph according to all the pixel points and the corresponding result gray values. In the above embodiment, the determination condition is too single only for determining whether the pixel point to be processed has a defect. In this embodiment, the result gray values of all the pixel points are presented on the defect result graph, so that the defect position can be determined more intuitively, and the defect detection results of other normal pixel points by the defect are reduced.
Through the defect result graph, the object defects can be displayed in a visual degree, and can be better viewed manually.
The embodiment further provides a 2.5D defect detection device based on a multi-angle light source, which is used for implementing the above embodiments and preferred embodiments, and the description of the device is omitted. As used hereinafter, the terms "module," "unit," "subunit," and the like may implement a combination of software and/or hardware for a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 5 is a block diagram of a 2.5D defect detection apparatus based on a multi-angle light source according to an embodiment of the present application, and as shown in fig. 5, the apparatus includes an obtaining module 51, a constructing module 52, and a processing module 53.
The acquisition module 51 is configured to acquire two sets of gray data, where any one set of gray data includes a first gray value, a second gray value, and an auxiliary gray value corresponding to a pixel to be processed, and a light source corresponding to the first gray value and a light source corresponding to the second gray value are uniformly distributed on a circumference parallel to and higher than a surface to be measured, where the light source associated with any one set of gray data and the light source associated with another set of gray data are vertically arranged with respect to the surface to be measured, and a light-emitting body corresponding to the auxiliary gray value is directly or indirectly located right above the surface to be measured;
the building module 52 is configured to build a parabola according to the point (-1, the first gray value), the point (0, the auxiliary gray value) and the point (1, the second gray value) on the coordinate system for any group of gray data, obtain a distance from a symmetry axis of the parabola to the y axis, and record the distance as a deviation distance;
a processing module 53, configured to calculate a defect processing value reflecting a defect degree according to a processing formula, where the processing formula includes:
Figure 54968DEST_PATH_IMAGE001
wherein q is a defect processing value, d i Is the ith offset distance.
The above modules may be functional modules or program modules, and may be implemented by software or hardware. For a module implemented by hardware, the modules may be located in the same processor; or the modules may be located in different processors in any combination.
In this embodiment, an electronic device is further provided, fig. 6 is a block diagram of a structure of the electronic device shown in this embodiment of the present application, and referring to fig. 6, the electronic device includes a memory and a processor, where the memory stores a computer program, and the processor is configured to run the computer program to execute implementing any one of the 2.5D defect detection methods based on a multi-angle light source in the foregoing embodiments.
Optionally, the electronic device may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
In addition, by combining the 2.5D defect detection method based on the multi-angle light source in the above embodiments, the fifth embodiment of the present application can be implemented by providing a storage medium. The storage medium having stored thereon a computer program; the computer program, when executed by a processor, implements any one of the above-described embodiments of a method for multi-angle light source based 2.5D defect detection, the method comprising:
acquiring two groups of gray data, wherein any one group of gray data comprises a first gray value, a second gray value and an auxiliary gray value corresponding to a pixel point to be processed, a light source corresponding to the first gray value and a light source corresponding to the second gray value are uniformly distributed on the circumference which is parallel to and higher than a surface to be detected, the light source associated with any one group of gray data and the light source associated with the other group of gray data are vertically arranged relative to the surface to be detected, and a luminous body corresponding to the auxiliary gray value is directly or indirectly positioned right above the surface to be detected;
for any group of gray data, constructing a parabola according to the point (-1, a first gray value), the point (0, an auxiliary gray value) and the point (1, a second gray value) on a coordinate system, obtaining the distance from the symmetry axis of the parabola to the y axis, and recording the distance as a deviation distance;
calculating a defect treatment value reflecting a defect degree according to a treatment formula, wherein the treatment formula comprises:
Figure 100002_DEST_PATH_IMAGE014
wherein q is a defect processing value, d i Is the ith offset distance.
As shown in fig. 6, taking a processor as an example, the processor, the memory, the input device and the output device in the electronic device may be connected by a bus or other means, and fig. 6 takes the connection by a bus as an example.
The memory, which is a computer-readable storage medium, may include a high-speed random access memory, a non-volatile memory, and the like, and may be used to store an operating system, a software program, a computer-executable program, and a database, such as program instructions/modules corresponding to the multi-angle light source based 2.5D defect detection method according to the embodiment of the present invention, and may further include a memory, which may be used to provide an operating environment for the operating system and the computer program. In some examples, the memory may further include memory remotely located from the processor, which may be connected to the electronic device over a network.
The processor, which is used to provide computing and control capabilities, may include a Central Processing Unit (CPU), or A Specific Integrated Circuit (ASIC), or may be configured to implement one or more Integrated circuits of embodiments of the present Application. The processor executes various functional applications and data processing of the electronic device by running the computer-executable program, the software program, the instructions and the modules stored in the memory, that is, the method for detecting a 2.5D defect based on a multi-angle light source of the first embodiment is implemented.
The output device of the electronic equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on a shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
The electronic device may further include a network interface/communication interface, the network interface of the electronic device being for connecting communication with an external terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
It will be understood by those skilled in the art that the structure shown in fig. 6 is a block diagram of only a portion of the structure related to the present application, and does not constitute a limitation on the electronic device to which the present application is applied, and a particular electronic device may include more or less components than those shown in the drawings, or may combine certain components, or have a different arrangement of components.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), synchronous link (Synchlink), DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It should be noted that, in the embodiment of the 2.5D defect detection method based on multi-angle light source, the included units and modules are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
Unless otherwise defined, technical or scientific terms referred to herein should have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The use of the terms "a" and "an" and "the" and similar referents in the context of describing the invention (including a single reference) are to be construed in a non-limiting sense as indicating either the singular or the plural. The terms "comprises," "comprising," "including," "has," "having," and any variations thereof, as referred to herein, are intended to cover a non-exclusive inclusion. Reference to "connected," "coupled," and the like in this application is not intended to be limited to physical or mechanical connections, but rather can include electrical connections, whether direct or indirect. The term "plurality" as used herein means two or more. "and/or" describes the association relationship of the association object, indicating that there may be three relationships. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. Reference herein to the terms "first," "second," "third," and the like, are merely to distinguish similar objects and do not denote a particular ordering for the objects.
The above examples only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent application shall be subject to the appended claims.

Claims (7)

1. A2.5D defect detection method based on a multi-angle light source is characterized by comprising the following steps:
acquiring two groups of gray data, wherein any one group of gray data comprises a first gray value, a second gray value and an auxiliary gray value corresponding to a pixel point to be processed, a light source corresponding to the first gray value and a light source corresponding to the second gray value are uniformly distributed on the circumference which is parallel to and higher than a surface to be detected, the light source associated with any one group of gray data and the light source associated with the other group of gray data are vertically arranged relative to the surface to be detected, and a luminous body corresponding to the auxiliary gray value is directly or indirectly positioned right above the surface to be detected;
for any group of gray data, constructing a parabola according to the point (-1, a first gray value), the point (0, an auxiliary gray value) and the point (1, a second gray value) on a coordinate system, obtaining the distance from the symmetry axis of the parabola to the y axis, and recording the distance as a deviation distance;
calculating a defect process value reflecting a degree of a defect according to a process formula, the process formula including:
Figure DEST_PATH_IMAGE002
wherein q is the defect handling value, d i Is the ith deviation distance;
the method further comprises the following steps:
acquiring defect processing values of all pixel points, and calculating an average defect processing value;
calculating a defect adjustment value according to an adjustment formula, the adjustment formula comprising:
Figure DEST_PATH_IMAGE004
wherein p is the defect adjustment value, u is the average defect processing value, s and m are preset values, s is greater than or equal to 4, and m is greater than or equal to 4;
the method further comprises the following steps:
between the original regions
Figure DEST_PATH_IMAGE006
Figure DEST_PATH_IMAGE008
Is the minimum value, p, of the defect adjustment values of all pixels that is not zero max The maximum value of the defect adjustment values of all the pixel points is obtained;
acquiring a demand interval, and determining a mapping function according to the original interval and the demand interval;
the defect adjustment value obtains a result gray value through the mapping function;
the method further comprises the following steps: and generating a defect result graph according to all the pixel points and the corresponding result gray values.
2. The multi-angle light source-based 2.5D defect detection method of claim 1, further comprising: in the process of constructing the parabola, if the point (-1, the first gray value), the point (0, the auxiliary gray value) and the point (1, the second gray value) are collinear, the deviation distance is zero.
3. The method of any of claims 1 to 2, wherein the obtaining of the auxiliary gray scale value comprises, for any set of gray scale data:
calculating the auxiliary gray value according to an equivalent formula, wherein the equivalent formula is as follows:
Figure DEST_PATH_IMAGE010
where s is the auxiliary gray value, g 1 Is a first gray value of another set of gray data, g 2 For another set of grey scale dataAnd a second gray value theta is the degree of an included angle formed by the light source and the surface to be measured.
4. The method of any of claims 1 to 2, wherein the obtaining of the auxiliary gray scale value comprises, for any set of gray scale data:
acquiring an auxiliary image, wherein a luminous body corresponding to the auxiliary image is directly positioned right above the surface to be detected, and the distance from the luminous body to the surface to be detected is equal to the distance from the light source to the surface to be detected;
and reading the gray value of the auxiliary image at the pixel point to be processed and recording the gray value as the auxiliary gray value.
5. A2.5D defect detecting device based on multi-angle light source, its characterized in that includes:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring two groups of gray data, any one group of gray data comprises a first gray value, a second gray value and an auxiliary gray value corresponding to a pixel point to be processed, a light source corresponding to the first gray value and a light source corresponding to the second gray value are uniformly distributed on the circumference which is parallel to and higher than a surface to be detected, the light source associated with any one group of gray data and the light source associated with the other group of gray data are vertically arranged relative to the surface to be detected, and a luminous body corresponding to the auxiliary gray value is directly or indirectly positioned right above the surface to be detected;
the building module is used for building a parabola according to the point (-1, the first gray value), the point (0, the auxiliary gray value) and the point (1, the second gray value) on the coordinate system for any group of gray data, obtaining the distance from the symmetry axis of the parabola to the y axis, and recording the distance as a deviation distance;
a processing module for calculating a defect processing value reflecting a defect degree according to a processing formula, the processing formula including:
Figure DEST_PATH_IMAGE012
wherein q is the defect handling value, d i Is the ith deviation distance;
the processing module is further configured to perform the following operations:
acquiring defect processing values of all pixel points, and calculating an average defect processing value;
calculating a defect adjustment value according to an adjustment formula, the adjustment formula comprising:
Figure DEST_PATH_IMAGE014
wherein p is the defect adjustment value, u is the average defect processing value, s and m are preset numerical values, s is more than or equal to 4, and m is more than or equal to 4;
generating original cell
Figure 355618DEST_PATH_IMAGE006
Figure DEST_PATH_IMAGE016
Is the minimum value, p, of the defect adjustment values of all pixels that is not zero max The maximum value of the defect adjustment values of all the pixel points is obtained;
acquiring a demand interval, and determining a mapping function according to the original interval and the demand interval;
the defect adjustment value obtains a result gray value through the mapping function;
and generating a defect result graph according to all the pixel points and the corresponding result gray values.
6. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to implement the multi-angle light source based 2.5D defect detection method of any one of claims 1 to 4 when executing the computer program.
7. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the multi-angle light source based 2.5D defect detection method of any one of claims 1 to 4.
CN202210409340.4A 2022-04-19 2022-04-19 2.5D defect detection method, device, equipment and medium based on multi-angle light source Active CN114511565B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210409340.4A CN114511565B (en) 2022-04-19 2022-04-19 2.5D defect detection method, device, equipment and medium based on multi-angle light source

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210409340.4A CN114511565B (en) 2022-04-19 2022-04-19 2.5D defect detection method, device, equipment and medium based on multi-angle light source

Publications (2)

Publication Number Publication Date
CN114511565A CN114511565A (en) 2022-05-17
CN114511565B true CN114511565B (en) 2022-07-26

Family

ID=81554634

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210409340.4A Active CN114511565B (en) 2022-04-19 2022-04-19 2.5D defect detection method, device, equipment and medium based on multi-angle light source

Country Status (1)

Country Link
CN (1) CN114511565B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110441313A (en) * 2019-07-30 2019-11-12 天津工程机械研究院有限公司 A kind of multistation, multiangle visual surface defects detection system
CN212459442U (en) * 2020-04-24 2021-02-02 深圳精创视觉科技有限公司 2.5D cell-phone glass apron defect optical detection equipment
CN112669318A (en) * 2021-03-17 2021-04-16 上海飞机制造有限公司 Surface defect detection method, device, equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11676260B2 (en) * 2019-09-26 2023-06-13 Kla Corporation Variation-based segmentation for wafer defect detection
CN112241699A (en) * 2020-10-13 2021-01-19 无锡先导智能装备股份有限公司 Object defect category identification method and device, computer equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110441313A (en) * 2019-07-30 2019-11-12 天津工程机械研究院有限公司 A kind of multistation, multiangle visual surface defects detection system
CN212459442U (en) * 2020-04-24 2021-02-02 深圳精创视觉科技有限公司 2.5D cell-phone glass apron defect optical detection equipment
CN112669318A (en) * 2021-03-17 2021-04-16 上海飞机制造有限公司 Surface defect detection method, device, equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Surface Defects Detection of Stamping and Grinding Flat Parts Based on Machine Vision;Hongzhi Tian et al.;《sensors》;20200813;第1-17页 *
基于HALCON的四光源光度立体法金属表面缺陷检测方法;王进峰 等;《制造技术与机床》;20220331;第2022年卷(第3期);第157-161页 *

Also Published As

Publication number Publication date
CN114511565A (en) 2022-05-17

Similar Documents

Publication Publication Date Title
CN107680124B (en) System and method for improving three-dimensional attitude score and eliminating three-dimensional image data noise
WO2018195797A1 (en) Visual detection method, detection device, and robot
EP3051793B1 (en) Imaging apparatus, systems and methods
CN110858872B (en) Optical axis offset compensation method and device
CN110675440A (en) Confidence evaluation method and device for three-dimensional depth data and computer equipment
CN111311671B (en) Workpiece measuring method and device, electronic equipment and storage medium
CN113793387A (en) Calibration method, device and terminal of monocular speckle structured light system
CN115564723A (en) Wafer defect detection method and application
CN114051626A (en) Joint ambient reconstruction and camera calibration
CN116051600A (en) Optimizing method and device for product detection track
CN114511565B (en) 2.5D defect detection method, device, equipment and medium based on multi-angle light source
CN111915681A (en) External parameter calibration method and device for multi-group 3D camera group, storage medium and equipment
CN111640108B (en) Object material determining method and device
CN114841943A (en) Part detection method, device, equipment and storage medium
CN115205224A (en) Adaptive feature-enhanced multi-source fusion visual detection method, device and medium
CN114697433A (en) Under screen phase machine
CN112894154A (en) Laser marking method and device
US20240029288A1 (en) Image processing apparatus, image processing method, and storage medium
US11949843B1 (en) System and method for enhancing three-dimensional (3D) depth acquisition
CN117115233B (en) Dimension measurement method and device based on machine vision and electronic equipment
CN116309782B (en) Image angle detection method based on reverse feature
CN115980059B (en) Surface defect detection system, detection method, detection device, detection equipment and storage medium
WO2024002186A1 (en) Image fusion method and apparatus, and storage medium
CN110992465A (en) Light source uniformity processing method, device and system
CN117132795A (en) Data association method, device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant