CN117058078B - Defect detection system and method, storage medium and electronic device - Google Patents
Defect detection system and method, storage medium and electronic device Download PDFInfo
- Publication number
- CN117058078B CN117058078B CN202310957604.4A CN202310957604A CN117058078B CN 117058078 B CN117058078 B CN 117058078B CN 202310957604 A CN202310957604 A CN 202310957604A CN 117058078 B CN117058078 B CN 117058078B
- Authority
- CN
- China
- Prior art keywords
- target object
- detected
- linear array
- edge
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/13—Edge detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10052—Images from lightfield camera
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30168—Image quality inspection
Landscapes
- Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
Abstract
The application discloses a defect detection system and method, a storage medium and electronic equipment, which relate to the technical field of optics and mainly aim at higher manual omission ratio due to the fact that concave-convex defects are various and weak in degree; the method is extremely easy to be influenced by subjectivity of people, and is difficult to formulate uniform judgment standards, and the capability requirement on detection personnel is high; meanwhile, the problem that the eyesight of the detection personnel is easily damaged because the detection personnel is required to be in the working environment of strong light irradiation for a long time. Comprising the following steps: acquiring a linear array image of a target object to be detected under a preset light source; extracting a background gray value in the linear array image; and generating a defect detection result of the target object to be detected according to the gray level difference value between the gray level value of each pixel point contained in the linear array image and the background gray level value.
Description
Technical Field
The present application relates to the field of optical technologies, and in particular, to a defect detection system and method, a storage medium, and an electronic device.
Background
Nowadays, the mobile phone has become one of the most familiar living tools, the annual output is huge, and the mobile phone cover plate is taken as an indispensable part in the mobile phone, so that the flatness of the mobile phone cover plate needs to be very severely detected. In the detection of the flatness of the cover plate, the concave-convex type defect is a very common defect type, and is a second major type defect except for scratch type defects. The appearance type can be divided into concave-convex points, dents, indentation, watermark concave-convex and the like; the defect positions can be divided into field-of-view region concave-convex, ink region concave-convex, plane concave-convex, arc edge concave-convex and the like. The concave-convex defects can seriously influence the visual sense and the use experience of a mobile phone screen, and belong to the defect of zero tolerance. Among many types of defects, the uneven defects are one of the defects that are most difficult to detect due to their large number and weak degree.
Currently, detection of flatness of a mobile phone cover plate still depends on manual detection. However, the artificial omission factor is high due to the fact that the number of concave-convex defects is large and the degree is weak; the method is extremely easy to be influenced by subjectivity of people, and is difficult to formulate a unified judgment standard, and high requirements are also put forward on the capability of detection personnel; meanwhile, as the detection personnel are required to be in the working environment of strong light irradiation for a long time, the eyesight of the detection personnel can be greatly damaged.
Disclosure of Invention
In view of the above, the present application provides a defect detection system and method, a storage medium, and an electronic device, which mainly aims to increase the manual omission factor due to the many and weak types of concave-convex defects; the method is extremely easy to be influenced by subjectivity of people, and is difficult to formulate uniform judgment standards, and the capability requirement on detection personnel is high; meanwhile, the problem that the eyesight of the detection personnel is easily damaged because the detection personnel is required to be in the working environment of strong light irradiation for a long time.
According to one aspect of the present application, there is provided a defect detection system comprising:
presetting a light source, a linear array camera, a lens, a detection and transmission module and a control and processing module;
The preset light source is used for turning on or off according to the position of a target object to be detected so as to illuminate the part of the target object to be detected, which moves to the view field of the linear array camera; arranging the preset light source at a preset position so that the field of view of the linear array camera is positioned in the middle of a light-dark transition zone generated by the preset light source;
the linear array camera and the lens are arranged right above the center of the detected area, the included angle between the lens and the z axis is zero, and the linear array camera and the lens are used for collecting linear array images of the part of the target object to be detected, which moves to the field of view of the linear array camera;
When the defect detection is carried out on the target object to be detected, the target object to be detected is placed on the detection and transmission module, and the detection and transmission device moves linearly at a constant speed along the x-axis direction, so that the target object to be detected placed on the detection and transmission device passes through the view field of the linear array camera at a constant speed;
The control processing module is used for extracting a background gray value in the linear array image; and generating a defect detection result of the target object to be detected according to the gray level difference value between the gray level value of each pixel point contained in the linear array image and the background gray level value.
Preferably, the preset light source comprises a plurality of light emitting units and a light homogenizing plate;
The light emitting units are arranged in a straight line at equal intervals;
the light homogenizing plate is used for adjusting the light rays emitted by the light emitting units so that the light rays emitted by the preset light source uniformly irradiate on the target object to be detected.
Preferably, the cross section of the light homogenizing plate is isosceles right triangle.
Preferably, the system further comprises a sensor;
The sensor is used for controlling the preset light source to be started and controlling the linear array camera to start collecting a linear array image when the first edge of the target object to be detected reaches the first edge of the visual field, wherein the first edge of the target object to be detected is used for representing the edge of the target object to be detected, which is closest to the visual field, and the first edge of the visual field is used for representing the edge of the visual field, which is closest to the target object to be detected;
The sensor is further configured to control the preset light source to be turned off and control the line camera to stop collecting the line image when it is detected that the second edge of the target object to be measured leaves the second edge of the field of view, the second edge of the target object to be measured is used for representing an edge of the target object to be measured, which is farthest from the first edge of the target object to be measured, and the second edge of the field of view is used for representing an edge opposite to the first edge of the field of view.
According to still another aspect of the present application, there is provided a defect detection method including:
acquiring a linear array image of a target object to be detected under a preset light source;
extracting a background gray value in the linear array image;
And generating a defect detection result of the target object to be detected according to the gray level difference value between the gray level value of each pixel point contained in the linear array image and the background gray level value.
Preferably, the generating a defect detection result of the target object according to a gray level difference between a gray level value of each pixel point included in the linear array image and the background gray level value specifically includes:
calculating gray level difference values between gray level values of the pixel points contained in the linear array image and the background gray level values;
screening out pixel points with gray difference values exceeding a preset gray difference value threshold, and marking the pixel points, wherein the marks carry positive marks or negative marks of the gray difference values of the pixel points;
If the pixel point carrying the positive mark and the pixel point carrying the negative mark exist in the preset distance range at the same time, a detection result of the concave-convex defects of the target object to be detected is generated.
Preferably, before the acquiring the linear array image of the target object to be detected under the preset light source, the method further includes:
Arranging the preset light source at a preset position so that the field of view of the linear array camera is positioned in the middle of a light-dark transition zone generated by the preset light source;
And placing the target object to be detected on a detection conveying device, wherein the detection conveying device moves linearly at a uniform speed along the x-axis direction, so that the target object to be detected passes through the field of view of the linear array camera at a uniform speed.
Preferably, the collecting the linear array image of the target object under the preset light source specifically includes:
When the first edge of the target object to be detected reaches the first edge of the view field, controlling the preset light source to be started, and controlling the linear array camera to start to collect a linear array image, wherein the first edge of the target object to be detected is used for representing the edge of the target object to be detected, which is closest to the view field, and the first edge of the view field is used for representing the edge of the view field, which is closest to the target object to be detected;
When the second edge of the target object to be detected leaves the second edge of the field of view, the preset light source is controlled to be turned off, the linear array camera is controlled to stop collecting the linear array image, the second edge of the target object to be detected is used for representing the edge of the target object to be detected, which is farthest from the first edge of the target object to be detected, and the second edge of the field of view is used for representing the edge opposite to the first edge of the field of view.
According to still another aspect of the present application, there is provided a storage medium having stored therein at least one executable instruction for causing a processor to perform operations corresponding to the above-described defect detection method.
According to still another aspect of the present application, there is provided an electronic apparatus including: the device comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete communication with each other through the communication bus;
The memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the operation corresponding to the defect detection method.
By means of the technical scheme, the technical scheme provided by the embodiment of the application has at least the following advantages:
The application provides a defect detection system and method, a storage medium and electronic equipment, wherein the defect detection system comprises the following steps: presetting a light source, a linear array camera, a lens, a detection and transmission module and a control and processing module; the preset light source is used for turning on or off according to the position of a target object to be detected so as to illuminate the part of the target object to be detected, which moves to the view field of the linear array camera; arranging the preset light source at a preset position so that the field of view of the linear array camera is positioned in the middle of a light-dark transition zone generated by the preset light source; the linear array camera and the lens are arranged right above the center of the detected area, the included angle between the lens and the z axis is zero, and the linear array camera and the lens are used for collecting linear array images of the part of the target object to be detected, which moves to the field of view of the linear array camera; when the defect detection is carried out on the target object to be detected, the target object to be detected is placed on the detection and transmission module, and the detection and transmission device moves linearly at a constant speed along the x-axis direction, so that the target object to be detected placed on the detection and transmission device passes through the view field of the linear array camera at a constant speed; the control processing module is used for extracting a background gray value in the linear array image; and generating a defect detection result of the target object to be detected according to the gray level difference value between the gray level value of each pixel point contained in the linear array image and the background gray level value. Compared with the prior art, the embodiment of the application has the advantages that the preset light source is arranged at the preset position, so that the field of view of the linear array camera is positioned at the middle position of the bright-dark transition zone generated by the preset light source, the occurrence of shielding condition is avoided, the imaging of concave-convex defects is more obvious, and the detection rate of the defects is improved; further, according to the gray level difference value between the gray level value of each pixel point contained in the linear array image and the background gray level value, a defect detection result is generated, automatic detection of the defects of the object to be detected is achieved, dependence on manual detection capability is avoided, the detection rate of the defects is further improved, and meanwhile damage to eyesight of detection staff is avoided.
The foregoing description is only an overview of the present application, and is intended to be implemented in accordance with the teachings of the present application in order that the same may be more clearly understood and to make the same and other objects, features and advantages of the present application more readily apparent.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the application. Also, like reference numerals are used to designate like parts throughout the figures. In the drawings:
FIG. 1 is a diagram showing a defect detection system according to an embodiment of the present application;
fig. 2 shows a schematic diagram of a preset light source according to an embodiment of the present application;
FIG. 3 is a flowchart of a defect detection method according to an embodiment of the present application;
FIG. 4 shows a linear array image of a defect-free cover plate provided by an embodiment of the application;
FIG. 5 is a flowchart of a method for generating a defect detection result according to an embodiment of the present application;
fig. 6 shows a linear array image 1 of a defective cover plate provided by an embodiment of the present application;
FIG. 7 shows a line image 2 of a defective cover plate provided by an embodiment of the present application;
FIG. 8 shows a flowchart of an image acquisition control method provided by an embodiment of the present application;
fig. 9 shows a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Meanwhile, it should be understood that the sizes of the respective parts shown in the drawings are not drawn in actual scale for convenience of description.
The following description of at least one exemplary embodiment is merely exemplary in nature and is in no way intended to limit the application, its application, or uses.
Techniques, methods, and apparatus known to one of ordinary skill in the relevant art may not be discussed in detail, but are intended to be part of the specification where appropriate.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further discussion thereof is necessary in subsequent figures.
Embodiments of the application are operational with numerous other general purpose or special purpose computing system environments or configurations. Examples of well known computing systems, environments, and/or configurations that may be suitable for use with the computer system/server include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, hand-held or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, mainframe computer systems, and distributed cloud computing technology environments that include any of the foregoing, and the like.
A computer system/server may be described in the general context of computer-system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc., that perform particular tasks or implement particular abstract data types. The computer system/server may be implemented in a distributed cloud computing environment in which tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computing system storage media including memory storage devices.
An embodiment of the present application provides a defect detection system, as shown in fig. 1, including:
Presetting a light source 11, a linear array camera and a lens 12, a detection and transmission module 13 and a control processing module 14;
The preset light source 11 is configured to turn on or off according to a position of a target object to be measured, so as to illuminate a portion of the target object to be measured, which moves to the field of view of the line camera; arranging the preset light source at a preset position so that the field of view of the linear array camera is positioned in the middle of a light-dark transition zone generated by the preset light source;
The linear array camera and lens 12 is arranged right above the center of the detected area, and has an included angle with the z-axis of zero, so as to collect a linear array image of a part of the target object to be detected, which moves to the field of view of the linear array camera;
When the defect detection is carried out on the target object to be detected, the target object to be detected is placed on the detection and transmission module 13, and the detection and transmission device moves linearly at a uniform speed along the x-axis direction, so that the target object to be detected placed on the detection and transmission device passes through the field of view of the linear array camera at a uniform speed;
The control processing module 14 is configured to extract a background gray value in the linear array image; and generating a defect detection result of the target object to be detected according to the gray level difference value between the gray level value of each pixel point contained in the linear array image and the background gray level value.
It should be noted that, in order to make the detected area be uniformly illuminated, the preset light source may be disposed above the center of the detected area, and further, in order to make the imaging of the concave-convex defect clearer, the position of the preset light source may be adjusted, so that the field of view of the line camera is located at the middle position of the bright-dark transition zone generated by the preset light source. The motion speed of the detection and transmission device is required to be matched with the line frequency of the linear array camera so as to acquire complete and clear linear array images of the target object to be detected. As the included angle between the lens and the Z direction is smaller, the available depth of field is larger, and the defect detection of transparent and opaque areas can be realized by covering a plurality of concave-convex defects.
In a specific application scenario, the preset light source includes a plurality of light emitting units 111 and a light homogenizing plate 112; the light emitting units are arranged in a straight line at equal intervals; the light homogenizing plate is used for adjusting the light rays emitted by the light emitting units so that the light rays emitted by the preset light source uniformly irradiate on the target object to be detected.
In the embodiment of the present application, an exemplary preset light source is shown in fig. 2, where the light emitting units 111 may use LED white light sources, and the intervals between each light emitting unit 111 may be 5mm, and are uniformly arranged; preferably, the cross section of the light homogenizing plate 112 can be isosceles right triangle, and compared with the cross section of other shapes, the condition of shielding the view field of the linear array camera can be avoided.
It should be noted that, the length of the preset light source may be selected according to the width of the target object to be measured, for example, the input voltage of the preset light source is 24V, the preset light source may emit white light with the maximum power of 72W, the length of the light source is 200 mm-300 mm, and the field of view with the width of 100mm may be uniformly illuminated, so long as the width of the target object to be measured does not exceed 100mm under the preset light source.
In a specific application scenario, as a preferable scheme, the cross section of the light homogenizing plate is isosceles right triangle.
In a specific application scenario, the system further comprises a sensor; the sensor is used for controlling the preset light source to be started and controlling the linear array camera to start collecting a linear array image when the first edge of the target object to be detected reaches the first edge of the visual field, wherein the first edge of the target object to be detected is used for representing the edge of the target object to be detected, which is closest to the visual field, and the first edge of the visual field is used for representing the edge of the visual field, which is closest to the target object to be detected; the sensor is further configured to control the preset light source to be turned off and control the line camera to stop collecting the line image when it is detected that the second edge of the target object to be measured leaves the second edge of the field of view, the second edge of the target object to be measured is used for representing an edge of the target object to be measured, which is farthest from the first edge of the target object to be measured, and the second edge of the field of view is used for representing an edge opposite to the first edge of the field of view.
In order to make the imaging of the concave-convex defects clearer, the power of the preset light source can be properly increased. Specifically, when the edge of the target object to be detected, which is closest to the field of view (namely, the first edge of the target object to be detected), reaches the edge of the field of view, which is closest to the target object to be detected (namely, the first edge of the field of view), the sensor is triggered to control the preset light source to be started, and the linear camera is controlled to start to acquire images; in the process, a preset light source is always started, and the linear array camera continuously performs image acquisition; until the edge of the target object to be detected, which is farthest from the first edge of the target object to be detected (namely, the second edge of the target object to be detected), is away from the edge of the field of view, which is opposite to the first edge of the field of view (namely, the second edge of the field of view), at the moment, the preset light source is controlled to be turned off, the linear array camera is controlled to stop acquiring images, and the linear array image acquisition aiming at the target object to be detected is finished.
The present application provides a defect detection system, comprising: presetting a light source, a linear array camera, a lens, a detection and transmission module and a control and processing module; the preset light source is used for turning on or off according to the position of a target object to be detected so as to illuminate the part of the target object to be detected, which moves to the view field of the linear array camera; arranging the preset light source at a preset position so that the field of view of the linear array camera is positioned in the middle of a light-dark transition zone generated by the preset light source; the linear array camera and the lens are arranged right above the center of the detected area, the included angle between the lens and the z axis is zero, and the linear array camera and the lens are used for collecting linear array images of the part of the target object to be detected, which moves to the field of view of the linear array camera; when the defect detection is carried out on the target object to be detected, the target object to be detected is placed on the detection and transmission module, and the detection and transmission device moves linearly at a constant speed along the x-axis direction, so that the target object to be detected placed on the detection and transmission device passes through the view field of the linear array camera at a constant speed; the control processing module is used for extracting a background gray value in the linear array image; and generating a defect detection result of the target object to be detected according to the gray level difference value between the gray level value of each pixel point contained in the linear array image and the background gray level value. Compared with the prior art, the embodiment of the application has the advantages that the preset light source is arranged at the preset position, so that the field of view of the linear array camera is positioned at the middle position of the bright-dark transition zone generated by the preset light source, the occurrence of shielding condition is avoided, the imaging of concave-convex defects is more obvious, and the detection rate of the defects is improved; further, according to the gray level difference value between the gray level value of each pixel point contained in the linear array image and the background gray level value, a defect detection result is generated, automatic detection of the defects of the object to be detected is achieved, dependence on manual detection capability is avoided, the detection rate of the defects is further improved, and meanwhile damage to eyesight of detection staff is avoided.
Further, in order to drive the system shown in fig. 1, an embodiment of the present application provides a defect detection method, as shown in fig. 3, including:
201. and acquiring a linear array image of the target object to be detected under a preset light source.
The target object to be detected can be a mobile phone cover plate, including a screen cover plate, a back plate and the like, and the transparency degree of the object to be detected are not particularly limited according to the screen cover plate including but not limited to a window area, an ink area, a plane area, an arc edge area and the like; the preset light source is used for representing a light source capable of emitting strong and uniform light rays to the target object to be detected, and the part of the target object to be detected in the detection area can be illuminated through the preset light source; the linear array image is acquired by a linear array camera, can be a linear array image with the width of a single camera view field, can be obtained by splicing a plurality of linear array images with the width of a single camera view field, and can reflect the overall condition of a target object to be detected. In the embodiment of the application, the current execution end may be a control processing module of the defect detection system of the object to be detected, and the control processing module is used for generating and generating a defect detection result of the object to be detected according to the linear array image of the object to be detected.
202. And extracting a background gray value in the linear array image.
If the surface of the object to be measured is flat and has no defects, the gray values of the pixels are consistent in the linear array image. In the embodiment of the application, the gray value of each pixel point in the linear array image is identified, a region with uniform gray value and always is found, and the gray value of the region is extracted as the background gray value, as shown in fig. 4.
203. And generating a defect detection result of the target object to be detected according to the gray level difference value between the gray level value of each pixel point contained in the linear array image and the background gray level value.
When the object to be measured has a concave-convex defect, the propagation direction of the light is changed, and the gray value is strongly changed when the object to be measured is further displayed in the linear array image. Based on this, in the embodiment of the present application, whether the object to be detected includes the concave-convex defect may be determined according to the gray level difference between the gray level value of each pixel point included in the linear array image and the background gray level value.
Compared with the prior art, the embodiment of the application has the advantages that the preset light source is arranged at the preset position, so that the field of view of the linear array camera is positioned at the middle position of the bright-dark transition zone generated by the preset light source, the occurrence of shielding condition is avoided, the imaging of concave-convex defects is more obvious, and the detection rate of the defects is improved; further, according to the gray level difference value between the gray level value of each pixel point contained in the linear array image and the background gray level value, a defect detection result is generated, automatic detection of the defects of the object to be detected is achieved, dependence on manual detection capability is avoided, the detection rate of the defects is further improved, and meanwhile damage to eyesight of detection staff is avoided.
In an embodiment of the present application, for further defining and describing, as shown in fig. 5, step 203 of the embodiment generates a defect detection result of the target object according to a gray level difference between a gray level value of each pixel point included in the line array image and a background gray level value, and specifically includes:
301. And calculating the gray level difference value between the gray level value of each pixel point contained in the linear array image and the background gray level value.
302. And screening out pixel points with gray difference values exceeding a preset gray difference value threshold, and marking the pixel points, wherein the marks carry positive marks or negative marks of the gray difference values of the pixel points.
303. If the pixel point carrying the positive mark and the pixel point carrying the negative mark exist in the preset distance range at the same time, a detection result of the concave-convex defects of the target object to be detected is generated.
In the embodiment of the present application, firstly, based on the background gray value extracted in the step 202 of the embodiment, the difference between the gray value of each pixel point included in the linear array image and the background gray value is calculated. When the gray level difference is calculated, the gray level value of each pixel point is subtracted by the background gray level value, and when the gray level value of each pixel point is higher than the background gray level value, the obtained gray level difference is positive to indicate that the gray level value of each pixel point is higher than the background gray level value; when the gray value of the pixel is lower than the background gray value, the obtained gray difference is negative, and the gray difference is required to carry a negative sign to indicate that the gray value of the pixel is lower than the background gray value. Further, the gray difference value of each pixel point is screened according to a pre-configured gray difference value threshold, and it should be noted that in the screening process, the gray difference value of each pixel point may be subjected to absolute value conversion, and screening is performed only according to the difference between the gray value of the pixel point and the background gray value, for example, the gray value of the pixel point a is 225, the background gray value is 255, and the gray difference value of the pixel point a is-30, and at this time, the gray difference value of the pixel point a may be subjected to absolute value conversion to obtain an absolute value of the gray difference value of-30; further, the preset gray difference value threshold is 20, and the pixel point a is marked and simultaneously marked with a negative mark because the absolute value 30 of the gray difference value exceeds the preset gray difference value threshold 20, so that the gray value of the pixel point a is lower than the background gray value and is shown as darker than the background, as shown in fig. 6; for another example, the gray value of the pixel point B is 285, and the background gray value is 255, and the gray difference of the pixel point B is 30, and at this time, the gray difference is 30; further, the preset gray difference value is 20, and the pixel B is marked and marked positively at the same time because the gray difference value 30 exceeds the preset gray difference value 20, so that the gray value of the pixel B is higher than the background gray value and is brighter than the background, as shown in fig. 7. Finally, according to the light propagation principle, a part which is brighter than the background (namely, the gray value is higher than the background gray value) and a part which is darker than the background (namely, the gray value is lower than the background gray value) are necessarily simultaneously present in the concave-convex defect area, and further, the part which is brighter than the background and the part which is darker than the background are simultaneously present in the concave-convex defect area, so that the pixel point carrying the positive mark and the pixel point carrying the negative mark can be simultaneously present in a certain distance range through the pre-configuration of the distance range, the area is the concave-convex defect area, and at the moment, the detection result of the concave-convex defect of the target object can be generated.
In an embodiment of the present application, for further defining and describing, before the embodiment step 201 collects the linear array image of the target object under the preset light source, the embodiment method further includes: and arranging the preset light source at a preset position so that the field of view of the linear array camera is positioned in the middle of a light-dark transition zone generated by the preset light source.
It should be noted that, in order to make the detected area be uniformly illuminated, the preset light source may be disposed above the center of the detected area, and further, in order to make the imaging of the concave-convex defect clearer, the position of the preset light source may be adjusted, so that the field of view of the line camera is located at the middle position of the bright-dark transition zone generated by the preset light source. Specifically, the preset light source can be placed at the initial position, imaging is achieved to be brightest by adjusting the preset light source, and then the position of the preset light source is adjusted to reduce the brightness, such as 30%, so as to obtain the bright-dark transition zone. In an embodiment of the present application, an exemplary preset position may be above the center of the area to be measured, and the distance between the preset position and the plane of the object to be measured is 2mm, so that the field of view of the line camera is located in the middle of the bright-dark transition zone, that is, the field of view is located in a half bright field.
In an embodiment of the present application, for further defining and describing, before the embodiment step 201 collects the linear array image of the target object under the preset light source, the embodiment method further includes: and placing the target object to be detected on a detection conveying device, and enabling the detection conveying device to linearly move at a uniform speed along the x-axis direction so that the target object to be detected passes through the field of view of the linear array camera at a uniform speed.
In the embodiment of the application, the motion speed of the detection and transmission device is required to be matched with the line frequency of the linear array camera so as to acquire complete and clear linear array images of the target object to be detected.
In an embodiment of the present application, for further limitation and explanation, as shown in fig. 8, in step 201, a linear array image of a target object under a preset light source is acquired, which specifically includes:
401. When the first edge of the target object to be detected is monitored to reach the first edge of the field of view, the preset light source is controlled to be started, and the linear array camera is controlled to start to collect the linear array image.
402. When the second edge of the target object to be detected is detected to leave the second edge of the field of view, the preset light source is controlled to be turned off, and the linear array camera is controlled to stop acquiring the linear array image.
The first edge of the target object to be measured is used for representing the edge of the target object to be measured, which is closest to the field of view, and the first edge of the field of view is used for representing the edge of the field of view, which is closest to the target object to be measured; the second edge of the target object to be measured is used for representing the edge of the target object to be measured, which is farthest from the first edge of the target object to be measured, and the second edge of the field of view is used for representing the edge opposite to the first edge of the field of view. In order to make the imaging of the concave-convex defects clearer, the power of the preset light source can be properly increased. Specifically, when the edge of the target object to be detected, which is closest to the field of view (namely, the first edge of the target object to be detected), reaches the edge of the field of view, which is closest to the target object to be detected (namely, the first edge of the field of view), the sensor is triggered to control the preset light source to be started, and the linear camera is controlled to start to acquire images; in the process, a preset light source is always started, and the linear array camera continuously performs image acquisition; until the edge of the target object to be detected, which is farthest from the first edge of the target object to be detected (namely, the second edge of the target object to be detected), is away from the edge of the field of view, which is opposite to the first edge of the field of view (namely, the second edge of the field of view), at the moment, the preset light source is controlled to be turned off, the linear array camera is controlled to stop acquiring images, and the linear array image acquisition aiming at the target object to be detected is finished.
The application provides a defect detection method, firstly, collecting a linear array image of a target object to be detected under a preset light source; secondly, extracting a background gray value in the linear array image; and finally, generating a defect detection result of the target object to be detected according to the gray level difference value between the gray level value of each pixel point contained in the linear array image and the background gray level value. Compared with the prior art, the embodiment of the application has the advantages that the preset light source is arranged at the preset position, so that the field of view of the linear array camera is positioned at the middle position of the bright-dark transition zone generated by the preset light source, the occurrence of shielding condition is avoided, the imaging of concave-convex defects is more obvious, and the detection rate of the defects is improved; further, according to the gray level difference value between the gray level value of each pixel point contained in the linear array image and the background gray level value, a defect detection result is generated, automatic detection of the defects of the object to be detected is achieved, dependence on manual detection capability is avoided, the detection rate of the defects is further improved, and meanwhile damage to eyesight of detection staff is avoided.
According to an embodiment of the present application, there is provided a storage medium storing at least one executable instruction that can perform the defect detection method in any of the above-described method embodiments.
Based on such understanding, the technical solution of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.), and includes several instructions for causing a computer device (may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective implementation scenario of the present application.
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application, and the specific embodiment of the present application is not limited to the specific implementation of the terminal.
As shown in fig. 9, the electronic device may include: a processor 502, a communication interface (Communications Interface) 504, a memory 506, and a communication bus 508.
Wherein: processor 502, communication interface 504, and memory 506 communicate with each other via communication bus 508.
A communication interface 504 for communicating with network elements of other devices, such as clients or other servers.
The processor 502 is configured to execute the program 510, and may specifically perform relevant steps in the above-described defect detection method embodiment.
In particular, program 510 may include program code including computer-operating instructions.
The processor 502 may be a central processing unit CPU, or an Application-specific integrated Circuit ASIC (Application SPECIFIC INTEGRATED Circuit), or one or more integrated circuits configured to implement embodiments of the present application. The one or more processors included in the computer device may be the same type of processor, such as one or more CPUs; but may also be different types of processors such as one or more CPUs and one or more ASICs.
A memory 506 for storing a program 510. Memory 506 may comprise high-speed RAM memory or may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 510 may be specifically operable to cause the processor 502 to:
acquiring a linear array image of a target object to be detected under a preset light source;
extracting a background gray value in the linear array image;
And generating a defect detection result of the target object to be detected according to the gray level difference value between the gray level value of each pixel point contained in the linear array image and the background gray level value.
The storage medium may also include an operating system, a network communication module. The operating system is a program that manages the physical device hardware and software resources for defect detection described above, supporting the execution of information handling programs and other software and/or programs. The network communication module is used for realizing communication among all components in the storage medium and communication with other hardware and software in the information processing entity equipment.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different manner from other embodiments, so that the same or similar parts between the embodiments are mutually referred to. For system embodiments, the description is relatively simple as it essentially corresponds to method embodiments, and reference should be made to the description of method embodiments for relevant points.
The method and system of the present application may be implemented in a number of ways. For example, the methods and systems of the present application may be implemented by software, hardware, firmware, or any combination of software, hardware, firmware. The above-described sequence of steps for the method is for illustration only, and the steps of the method of the present application are not limited to the sequence specifically described above unless specifically stated otherwise. Furthermore, in some embodiments, the present application may also be embodied as programs recorded in a recording medium, the programs including machine-readable instructions for implementing the methods according to the present application. Thus, the present application also covers a recording medium storing a program for executing the method according to the present application.
It will be appreciated by those skilled in the art that the modules or steps of the application described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may alternatively be implemented in program code executable by computing devices, so that they may be stored in a memory device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps within them may be fabricated into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
The above description is only of the preferred embodiments of the present application and is not intended to limit the present application, but various modifications and variations can be made to the present application by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.
Claims (9)
1. A defect detection system, comprising: presetting a light source, a linear array camera, a lens, a detection and transmission device and a control and processing module;
the preset light source is used for turning on or off according to the position of a target object to be detected so as to illuminate the part of the target object to be detected, which moves to the view field of the linear array camera; arranging the preset light source at a preset position so that the field of view of the linear array camera is positioned in the middle of a light-dark transition zone generated by the preset light source, wherein the preset light source comprises a light homogenizing plate, the cross section of the light homogenizing plate is an isosceles right triangle so that the field of view of the linear array camera is complete, the preset position is above the center of a detected area, and the preset light source is a single light source;
the linear array camera and the lens are arranged right above the center of the detected area, the included angle between the lens and the z axis is zero, and the linear array camera and the lens are used for collecting linear array images of the part of the target object to be detected, which moves to the field of view of the linear array camera;
When the defect detection is carried out on the target object to be detected, the target object to be detected is placed on the detection conveying device, and the detection conveying device moves linearly at a constant speed along the x-axis direction, so that the target object to be detected placed on the detection conveying device passes through the view field of the linear array camera at a constant speed;
The control processing module is used for extracting a background gray value in the linear array image; and generating a defect detection result of the target object to be detected according to the gray level difference value between the gray level value of each pixel point contained in the linear array image and the background gray level value.
2. The system of claim 1, wherein the predetermined light source comprises a plurality of light emitting units and a light homogenizing plate;
The light emitting units are arranged in a straight line at equal intervals;
the light homogenizing plate is used for adjusting the light rays emitted by the light emitting units so that the light rays emitted by the preset light source uniformly irradiate on the target object to be detected.
3. The system of claim 1, further comprising a sensor;
The sensor is used for controlling the preset light source to be started and controlling the linear array camera to start collecting a linear array image when the first edge of the target object to be detected reaches the first edge of the visual field, wherein the first edge of the target object to be detected is used for representing the edge of the target object to be detected, which is closest to the visual field, and the first edge of the visual field is used for representing the edge of the visual field, which is closest to the target object to be detected;
The sensor is further configured to control the preset light source to be turned off and control the line camera to stop collecting the line image when it is detected that the second edge of the target object to be measured leaves the second edge of the field of view, the second edge of the target object to be measured is used for representing an edge of the target object to be measured, which is farthest from the first edge of the target object to be measured, and the second edge of the field of view is used for representing an edge opposite to the first edge of the field of view.
4. A defect detection method, characterized by using the system of claim 1, in particular for:
Acquiring a linear array image of a target object to be detected under a preset light source, wherein the preset light source is used for turning on or off according to the position of the target object to be detected so as to illuminate a part of the target object to be detected, which moves to a field of view of the linear array camera, and the preset light source is arranged at a preset position so that the field of view of the linear array camera is positioned at the middle position of a light-dark transition zone generated by the preset light source, the preset light source comprises a light homogenizing plate, the cross section of the light homogenizing plate is isosceles right triangle so that the field of view of the linear array camera is complete, and the preset light source is a single light source;
extracting a background gray value in the linear array image;
And generating a defect detection result of the target object to be detected according to the gray level difference value between the gray level value of each pixel point contained in the linear array image and the background gray level value.
5. The method according to claim 4, wherein the generating the defect detection result of the target object according to the gray-scale difference between the gray-scale value of each pixel point included in the line array image and the background gray-scale value specifically includes:
calculating gray level difference values between gray level values of the pixel points contained in the linear array image and the background gray level values;
screening out pixel points with gray difference values exceeding a preset gray difference value threshold, and marking the pixel points, wherein the marks carry positive marks or negative marks of the gray difference values of the pixel points;
If the pixel point carrying the positive mark and the pixel point carrying the negative mark exist in the preset distance range at the same time, a detection result of the concave-convex defects of the target object to be detected is generated.
6. The method of claim 4, wherein the acquiring the linear image of the target object under the preset light source is preceded by:
Arranging the preset light source at a preset position so that the field of view of the linear array camera is positioned at the middle position of a light-dark transition zone generated by the preset light source, wherein the preset position is above the center of a detected area;
And placing the target object to be detected on a detection conveying device, wherein the detection conveying device moves linearly at a uniform speed along the x-axis direction, so that the target object to be detected passes through the field of view of the linear array camera at a uniform speed, and the target object to be detected is an electronic equipment cover plate.
7. The method according to claim 4, wherein the acquiring the linear array image of the target object under the preset light source specifically includes:
When the first edge of the target object to be detected reaches the first edge of the view field, controlling the preset light source to be started, and controlling the linear array camera to start to collect a linear array image, wherein the first edge of the target object to be detected is used for representing the edge of the target object to be detected, which is closest to the view field, and the first edge of the view field is used for representing the edge of the view field, which is closest to the target object to be detected;
When the second edge of the target object to be detected leaves the second edge of the field of view, the preset light source is controlled to be turned off, the linear array camera is controlled to stop collecting the linear array image, the second edge of the target object to be detected is used for representing the edge of the target object to be detected, which is farthest from the first edge of the target object to be detected, and the second edge of the field of view is used for representing the edge opposite to the first edge of the field of view.
8. A storage medium having stored therein at least one executable instruction for causing a processor to perform operations corresponding to the defect detection method of any one of claims 4-7.
9. An electronic device, comprising: the device comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete communication with each other through the communication bus;
the memory is configured to store at least one executable instruction, where the executable instruction causes the processor to perform operations corresponding to the defect detection method according to any one of claims 4-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310957604.4A CN117058078B (en) | 2023-08-01 | 2023-08-01 | Defect detection system and method, storage medium and electronic device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310957604.4A CN117058078B (en) | 2023-08-01 | 2023-08-01 | Defect detection system and method, storage medium and electronic device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117058078A CN117058078A (en) | 2023-11-14 |
CN117058078B true CN117058078B (en) | 2024-06-14 |
Family
ID=88659999
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310957604.4A Active CN117058078B (en) | 2023-08-01 | 2023-08-01 | Defect detection system and method, storage medium and electronic device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117058078B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119540149A (en) * | 2024-10-24 | 2025-02-28 | 苏州市东拓新能源有限公司 | Pit defect detection method, system, equipment, storage medium and product |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113252568A (en) * | 2021-06-10 | 2021-08-13 | 菲特(天津)检测技术有限公司 | Lens surface defect detection method, system, product and terminal based on machine vision |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110687119A (en) * | 2018-07-04 | 2020-01-14 | 东腾投资集团有限公司 | Defect detection method, system and device and computer readable storage medium |
CN113984791B (en) * | 2021-12-28 | 2022-04-08 | 蓝思科技股份有限公司 | Defect detection method, defect detection device, optical imaging system, optical imaging equipment and storage medium |
-
2023
- 2023-08-01 CN CN202310957604.4A patent/CN117058078B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113252568A (en) * | 2021-06-10 | 2021-08-13 | 菲特(天津)检测技术有限公司 | Lens surface defect detection method, system, product and terminal based on machine vision |
Non-Patent Citations (1)
Title |
---|
基于机器视觉的手机玻璃盖板缺陷在线检测系统研究;周士巧;《硕士电子期刊》;20230715;正文第1-72页 * |
Also Published As
Publication number | Publication date |
---|---|
CN117058078A (en) | 2023-11-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US12313561B2 (en) | Stroboscopic stepped illumination defect detection system | |
CN110018167B (en) | Method and system for rapidly detecting appearance defects of curved screen | |
CN117058078B (en) | Defect detection system and method, storage medium and electronic device | |
CN113418933B (en) | Flying shooting visual imaging detection system and method for detecting large-size object | |
CN111982921A (en) | Hole defect detection method and device, conveying platform and storage medium | |
JP2021022369A (en) | System and method for automated surface evaluation | |
CN116745696A (en) | Shooting condition setting system, shooting condition setting method, and program | |
CN109886914A (en) | Paper sheet defect detection method based on local luminance invariance priori | |
CN114119418B (en) | Illumination control method and apparatus, image processing system, and readable storage medium | |
CN110210401B (en) | Intelligent target detection method under weak light | |
CN115615327A (en) | Visual positioning system and visual positioning method | |
CN112040138B (en) | Stereoscopic light source system, image pickup method, image pickup device, storage medium, and electronic apparatus | |
CN109785290A (en) | Normalized steel plate defect detection method is shone based on local light | |
KR20230014519A (en) | Apparatus for outer inspection of inspecting object using line scan camera and method thereof | |
CN204064254U (en) | A kind of element pin detection device based on machine vision | |
CN109671075B (en) | Defect detection method, device, equipment and storage medium | |
CN112763502B (en) | Cambered surface gloss uniformity detection method | |
CN115471457A (en) | High-accuracy detection method and system based on electronic paper surface defects | |
Nguyen et al. | Detection of weak micro-scratches on aspherical lenses using a Gabor neural network and<? TeX\break?> transfer learning | |
CN115471459A (en) | Electronic paper surface defect detection method and system based on deep learning | |
KR102399373B1 (en) | Representative color determination method, inspecting apparatus, inspecting method and program | |
Lingyu et al. | Defect detection method of LCD Complex display screen combining feature matching and color correction | |
Yakimov | Preprocessing digital images for quickly and reliably detecting road signs | |
CN109472235B (en) | Attitude determination method, attitude determination device and computer-readable storage medium | |
Yan et al. | Zero-Shot Defect Feature Optimizer: an efficient zero-shot optimization method for defect detection |
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 |