A defect detection method, device, equipment and storage medium

By forming a light source pattern on the product surface and analyzing the corresponding image features, the problem of insufficient accuracy of defect detection in complex backgrounds in the prior art is solved, and a more efficient defect detection effect is achieved.

CN118408940BActive Publication Date: 2025-04-01SUZHOU INS IMAGE SOFTWARE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410512901.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-26
Publication Date
2025-04-01
Estimated Expiration
2044-04-26

AI Technical Summary

Technical Problem

The prior art is difficult to accurately detect defects on product surfaces under complex backgrounds, single brightness images cannot clearly present different flaws, and the interference of optical imaging systems is large.

Method used

By controlling the preset projection light source to emit light sources, form a light source pattern, and trigger the line scan camera to take a picture to obtain the original image. Then, the fusion process, comparison process and extraction process are performed based on the brightness information of the image, target images of different dimensions are generated, and the changes in the same characteristics in the image are analyzed for defect detection.

Benefits of technology

It effectively improves the accuracy of defect detection, can clearly present defect characteristics on the product surface under complex backgrounds, and reduces interference from the optical imaging system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118408940B_ABST
    Figure CN118408940B_ABST
Patent Text Reader

Abstract

The present invention discloses a defect detection method, device, equipment and storage medium. The method comprises: in response to a defect detection request for a target object, controlling a preset projection light source to emit a light source to form a light source pattern on the target object, and triggering a preset line scan camera to take a picture to obtain an original image; according to the brightness information of the original image, the original image is subjected to fusion processing, comparison processing and extraction processing; according to the processing result, target images of different dimensions are generated, and by analyzing the changes of the same features in different target images, the target object is subjected to defect detection. The technical solution of the present invention can emit a light source on the target object to obtain different original images, and comprehensively analyze and process the original images to discover the defect features on the surface of the target object, thereby improving the accuracy of defect detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of industrial machine vision, and in particular to a defect detection method, device, equipment and storage medium. Background Art

[0002] Product surface defect detection is one of the most important tasks in the field of industrial machine vision. It often uses an optical imaging system to photograph the product to obtain a digital image, and then analyzes and processes it to detect defects on the product surface. However, a single brightness image is difficult to clearly present different defects, especially when the background of the product itself is complex, which will also cause great interference to the imaging and extraction of defects.

[0003] Therefore, how to emit light on the target object to obtain different original images, and comprehensively analyze and process the original images to discover the defect characteristics of the target object surface, thereby improving the accuracy of defect detection, is a problem that needs to be solved urgently. Summary of the invention

[0004] The present invention provides a defect detection method, device, equipment and storage medium to improve the accuracy of defect detection.

[0005] According to one aspect of the present invention, there is provided a defect detection method, comprising:

[0006] In response to a defect detection request for a target object, a preset projection light source is controlled to emit light to form a light source pattern on the target object, and a preset line scan camera is triggered to take a picture to obtain an original image;

[0007] According to the brightness information of the original image, the original image is subjected to fusion processing, comparison processing and extraction processing;

[0008] According to the processing results, target images of different dimensions are generated, and defects of the target object are detected by analyzing the changes of the same features in different target images.

[0009] According to another aspect of the present invention, there is provided a defect detection device, comprising:

[0010] An obtaining module is used to control a preset projection light source to emit light in response to a defect detection request for a target object, so as to form a light source pattern on the target object, and trigger a preset line scan camera to take a picture, so as to obtain an original image;

[0011] A processing module, used for performing fusion processing, comparison processing and extraction processing on the original image according to the brightness information of the original image;

[0012] The detection module is used to generate target images of different dimensions according to the processing results, and to perform defect detection on the target object by analyzing the changes of the same features in different target images.

[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0014] at least one processor; and

[0015] a memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the defect detection method described in any embodiment of the present invention.

[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the defect detection method described in any embodiment of the present invention when executed.

[0018] The technical solution of the embodiment of the present invention, in response to a defect detection request for a target object, controls a preset projection light source to emit light to form a light source pattern on the target object, and triggers a preset line scan camera to take a picture to obtain an original image; according to the brightness information of the original image, the original image is fused, compared and extracted; according to the processing results, target images of different dimensions are generated, and by analyzing the changes in the same features in different target images, the target object is subjected to defect detection. By emitting a light source on the target object to obtain different original images, and performing a comprehensive analysis and processing on the original images to discover the defect features on the surface of the target object, the accuracy of defect detection can be effectively improved.

[0019] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0021] Figure 1 is a flow chart of a defect detection method provided by Embodiment 1 of the present invention;

[0022] Figure 2A is a flow chart of target image determination provided by Embodiment 2 of the present invention;

[0023] Figure 2B is a structural diagram of a defect detection system provided by Embodiment 2 of the present invention;

[0024] Figure 3 is a structural block diagram of a defect detection device provided by Embodiment 3 of the present invention;

[0025] Figure 4 It is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION

[0026] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0027] It should be noted that the terms "first", "second", "target", "candidate", "alternative", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0028] Embodiment 1

[0029] Figure 1This is a flow chart of a defect detection method provided in the first embodiment of the present invention; this embodiment is applicable to the situation where the industrial computer in the defect detection system enables the light source to image on the target object and performs different processing to obtain images of different dimensions to perform comprehensive defect detection. The method can be executed by a defect detection device, which can be implemented in the form of hardware and / or software. The defect detection device can be configured in an electronic device, such as a defect detection system, and executed by the industrial computer in the defect detection system, wherein the defect detection system may include at least: an industrial computer, a projection light source, and a preset line scan camera. Figure 1 As shown, the defect detection method includes:

[0030] S101 . In response to a defect detection request for a target object, control a preset projection light source to emit light to form a light source pattern on the target object, and trigger a preset line scan camera to take a picture to obtain an original image.

[0031] Among them, the target object refers to the product for defect detection, and the types and forms of defects on the surface of the target object are diverse, such as surface dirt, surface scratches, pits and protrusions. A defect detection request refers to a request to detect and identify the types and forms of defects on the surface of the target object. The preset projection light source refers to a light source preset in the defect detection system that can produce sinusoidal projection. The preset projection light source can be, for example, a planar sinusoidal projection light source. The light source pattern can be, for example, a sinusoidal fringe pattern. The preset line scan camera refers to a camera preset in the defect detection system for taking pictures of the surface of the target object. The original image can refer to an image obtained after performing sinusoidal projection on the target object from different directions and taking pictures. The original image contains the light source pattern on the target object. The number of original images is at least two, for example, it can be eight.

[0032] Optionally, in response to a defect detection request for a target object, the industrial computer can control a preset projection light source to project sinusoidal stripe light from a preset direction, and the stripe light in each direction presents a phase difference of one quarter of a cycle to form a light source pattern on the target object. Specifically, four groups of sinusoidal stripe light can be projected from two preset horizontal directions (i.e., X direction) and vertical directions (i.e., Y direction), and the stripe light in each direction presents a phase difference of one quarter of a cycle to form a light source pattern on the target object. Then, eight original images can be obtained by taking pictures.

[0033] Optionally, the target light board corresponding to the projection light source can be controlled based on a preset sinusoidal projection scheme, so that the target light board emits light and forms a light source pattern on the target object. Specifically, the sinusoidal projection scheme can be a sinusoidal scheme based on current control or a sinusoidal scheme based on time control. The sinusoidal scheme based on current control refers to a scheme that controls the brightness and switch of different areas of the target light board by preset different current values ​​to form a light source pattern. The sinusoidal scheme based on time control refers to a scheme that controls the on-time of the lamp beads of the target light board by preset different on-time values ​​to form a light source pattern.

[0034] Optionally, a preset projection light source can be controlled to emit light according to a sinusoidal scheme based on current control to form a light source pattern on the target object. Specifically: the preset projection light source is controlled to emit light to form a light source pattern on the target object, including: determining the current control value of the lamp beads in the corresponding area of ​​the target light board according to the sinusoidal characteristics of the target light board corresponding to the projection light source; cyclically reading the current control value of the lamp beads in the corresponding area of ​​the target light board to control the switching and brightness of the lamp beads to form a light source pattern on the target object.

[0035] The sinusoidal characteristic refers to the size information of the sinusoidal light that can be emitted by the target light board, and the size information may be the length of the sinusoidal line of the sinusoidal curve, etc. The corresponding area of ​​the target light board may be the area of ​​a whole row or a whole column of lamp beads of the target light board.

[0036] Optionally, a sinusoidal current value may be calculated based on the sinusoidal characteristics of the target light board, and then one or more sets of current values ​​corresponding to the sinusoidal circuits may be pre-stored in an FPGA (Field Programmable Gate Array) for caching.

[0037] Optionally, the cycle opening time of each row / column of light boards is the same, so when the current time is detected to be the preset opening time, the corresponding current value can be cycled to control the switch and brightness of each row / column of lamp beads, so as to map the light board effect to a sine within one exposure time of the camera, and form a light source pattern on the target object. Among them, the current value of each row / column of light boards is different.

[0038] Optionally, according to a sinusoidal scheme based on time control, a preset projection light source can be controlled to emit light to form a light source pattern on the target object. Specifically: according to the sinusoidal characteristics of the target light board corresponding to the projection light source, the lamp bead turn-on time value that conforms to the sinusoidal law is determined; the turn-on time value of the lamp beads in the corresponding area of ​​the target light board is cyclically read to control the turn-on time of the lamp beads to form a light source pattern on the target object.

[0039] Optionally, the on-time value that conforms to the sine can be calculated based on the sine characteristics of the target light board, and one or more sets of on-time values ​​corresponding to the sine circuit can be pre-stored in the FPGA for caching. When the current value of each row / column of light boards is the same, the corresponding on-time value is read cyclically, and each column of lamp beads is turned off after reaching the corresponding on-time, so as to achieve the purpose of mapping the sine.

[0040] It should be noted that the above-mentioned sinusoidal scheme based on current control can make the lamp beads light up in sequence in a cycle, the overall service life of the target lamp board is longer, and it can maintain good sinusoidal properties under high frequency conditions. However, taking the cyclic lighting of 12 groups of lights as an example, the maximum luminous efficiency is only 1 / 12 of the sinusoidal scheme based on time control, and the luminous efficiency is relatively low.

[0041] It should be noted that the above-mentioned sinusoidal scheme based on time control can light up all the lamp groups at the same time with a high average brightness, so it can be used in defect detection application scenarios for products made of materials with high absorption and low reflection loss.

[0042] S102: performing fusion processing, comparison processing and extraction processing on the original image according to the brightness information of the original image.

[0043] The brightness information may include the brightness value of each pixel position in the original image. Fusion processing refers to the process of fusing the original images to obtain a standard image. Comparison processing refers to the process of determining a shape map by comparing the brightness deviation between the original images. Extraction processing refers to the process of extracting the specular reflection and diffuse reflection components in the original image based on a preset phase deflection synthesis algorithm to determine the corresponding image.

[0044] Optionally, the brightness information of each original image may be input into a preset fusion model, a comparison model, and an extraction model to obtain corresponding standard images, shape images, specular reflection images, and diffuse reflection images in the processing results, respectively.

[0045] Optionally, the original image is subjected to fusion processing, comparison processing and extraction processing according to the brightness information of the original image, including: according to the brightness information of the original image, the original image is subjected to fusion processing and comparison processing to respectively obtain a standard image and a shape map in the target image; based on a preset phase deflection synthesis algorithm, the original image is subjected to extraction processing according to the standard image to obtain a mirror reflection map and a diffuse reflection map in the target image.

[0046] It should be noted that if the original image is a plurality of groups of images obtained by projecting from different directions, an average brightness image can be obtained for each group of original images, and a standard image can be obtained based on the average brightness image corresponding to each group of original images. Further, based on a preset phase deflection synthesis algorithm, the original image can be extracted and processed according to the standard image to obtain the mirror reflection image and diffuse reflection image in the target image; if the original image is a group of images obtained by projecting from a single direction, the average brightness image obtained for each group of original images can be directly used as the standard image, and based on a preset phase deflection synthesis algorithm, the original image can be extracted and processed according to the average brightness image to obtain the mirror reflection image and diffuse reflection image in the target image.

[0047] Optionally, average brightness images of corresponding directions can be obtained respectively according to the brightness information of the original images, and the average brightness images can be fused to obtain a standard image. Specifically, the original images can be fused according to the brightness information of the original images, including: grouping the original images according to the projection direction of the light source; for each group of original images, determining the average brightness value of the same image area in different original images according to the brightness information of the original images; generating a corresponding average brightness image according to the average brightness value of each image area in each group of original images, and fusing the average brightness images to obtain a standard image.

[0048] The projection direction of the light source may be a horizontal axis direction and / or a vertical axis direction.

[0049] Optionally, original images with the same projection direction may be divided into one group according to the projection direction of the light source. If the projection direction is the horizontal axis direction and the vertical axis direction, the corresponding original images may be in two groups with different directions.

[0050] It should be noted that, since each image in the original image contains stripe information and its brightness also shows light and dark changes, the present invention calculates the corresponding average brightness image of the projected light and dark stripe image (i.e., the original image), and can obtain image features that eliminate light and dark stripes.

[0051] For example, if the number of original images is four, the average brightness image can be calculated based on the following formula:

[0052]

[0053] Among them, I avg refers to the average brightness image, I i Refers to the original image.

[0054] Optionally, after determining the average brightness images corresponding to the original images of different groups, the average brightness images can be directly averaged to obtain a standard image; or, based on a preset fusion rule, the brightness values ​​of different image areas between the average brightness images can be compared and screened to obtain the final standard image.

[0055] Optionally, based on a preset phase deflection synthesis algorithm, the original image is extracted and processed according to a standard image to obtain a mirror reflection image and a diffuse reflection image in a target image, including: determining the brightness deviation between different original images according to the brightness information of the original image; based on a preset phase deflection synthesis algorithm, the original image is extracted and processed according to the brightness deviation and the standard image to obtain a mirror reflection image and a diffuse reflection image in the target image.

[0056] The preset phase deflection synthesis algorithm is an algorithm for extracting the diffuse reflection part and the specular reflection characteristic part of the product in the original image. If the number of original images is four, that is, four original images are obtained successively after projection, the brightness deviation may include a first deviation between the third original image and the first original image, and a second deviation between the fourth original image and the second original image.

[0057] For example, if the number of original images is four, based on the preset phase deflection synthesis algorithm, the relationship between each original image and its corresponding specular reflection component, diffuse reflection component and phase can be expressed as the following formula:

[0058] I1(x,y)=I'(x,y)+I"(x,y)cos(φ(x,y))

[0059] I2(x,y)=I'(x,y)+I"(x,y)cos(φ(x,y)+π / 2)

[0060] I3(x,y)=I'(x,y)+I"(x,y)cos(φ(x,y)+π)

[0061] I4(x,y)=I'(x,y)+I"(x,y)cos(φ(x,y)+3π / 2)

[0062] Among them, I1(x,y), I2(x,y), I3(x,y) and I4(x,y) are four original images obtained successively after projection, namely, the first original image, the second original image, the third original image and the fourth original image. I'(x,y) is the diffuse reflection component, I"(x,y) is the specular reflection component, and φ(x,y) is the phase.

[0063] Exemplarily, based on a preset phase deflection synthesis algorithm, according to a first deviation between the third original image and the first original image, and a second deviation between the fourth original image and the second original image, the following formula may be used to extract the specular reflection component of the original image:

[0064]

[0065] Wherein, I"(x, y) is the specular reflection component, I1(x, y), I2(x, y), I3(x, y) and I4(x, y) are four original images successively acquired after projection, namely, the first original image, the second original image, the third original image and the fourth original image.

[0066] Exemplarily, based on a preset phase deflection synthesis algorithm, according to the specular reflection component and the standard image, the diffuse reflection component of the original image can be extracted using the following formula:

[0067] I'(x,y)=I avg (x,y)-I"(x,y)

[0068] Among them, I'(x,y) is the diffuse reflection component, I avg (x,y) is the standard image. I"(x,y) is the specular reflection component.

[0069] Optionally, after determining the diffuse reflection component and the specular reflection component, corresponding diffuse reflection maps and specular reflection maps can be generated according to the values ​​of the components. Furthermore, the diffuse reflection map and the specular reflection map can be calculated based on preset calculation rules to obtain a gloss ratio map.

[0070] Optionally, the original image is compared and processed according to the brightness information of the original image, including: determining the brightness deviation between different original images according to the brightness information of the original image; determining the target phase map corresponding to the original image according to the brightness deviation based on a preset phase deflection synthesis algorithm, and comparing the target phase map with the preset standard phase map to determine the shape map.

[0071] Among them, shape maps can characterize the concave and convex features of products with highly reflective surfaces.

[0072] Exemplarily, based on a preset phase deflection synthesis algorithm, according to a first deviation between the third original image and the first original image, and a second deviation between the fourth original image and the second original image, a target phase map corresponding to the original image may be determined by the following formula:

[0073]

[0074] Among them, I1(x, y), I2(x, y), I3(x, y) and I4(x, y) are four original images acquired successively after projection, namely, the first original image, the second original image, the third original image and the fourth original image; φ(x, y) refers to the target phase map.

[0075] Optionally, if there are uneven features such as bumps and depressions on the surface of the product, the phase information of the target phase map will show an obvious mutation relative to the preset standard phase map. Therefore, after determining the target phase map, the target phase map can be compared with the preset standard phase map to determine whether the phases of the target phase map and the preset standard phase map show continuous changes. If so, the changing features can be enhanced to obtain a shape map that can show the bump and depression features.

[0076] S103, generating target images of different dimensions according to the processing results, and performing defect detection on the target object by analyzing the changes of the same features in different target images.

[0077] The target image includes at least one of a standard image, a specular reflection image, a diffuse reflection image, a gloss ratio image, and a shape image.

[0078] Optionally, after generating target images of different dimensions, the target images can be input into a pre-trained defect detection model to analyze the changes in the same features in different target images and output the defect detection results for the target objects. The defect category and number in each target image can also be identified and detected based on a preset image recognition algorithm, and the identification and detection results of different target images can be integrated to obtain the defect detection results for the target object.

[0079] The technical solution of the embodiment of the present invention, in response to a defect detection request for a target object, controls a preset projection light source to emit light to form a light source pattern on the target object, and triggers a preset line scan camera to take a picture to obtain an original image; according to the brightness information of the original image, the original image is fused, compared and extracted; according to the processing results, target images of different dimensions are generated, and by analyzing the changes in the same features in different target images, the target object is subjected to defect detection. By emitting a light source on the target object to obtain different original images, and performing a comprehensive analysis and processing on the original images to discover the defect features on the surface of the target object, the accuracy of defect detection can be effectively improved.

[0080] Embodiment 2

[0081] Figure 2A is a flow chart of a target image determination method provided by Embodiment 2 of the present invention; Figure 2BIt is a structural diagram of the defect detection system provided in the second embodiment of the present invention; based on the above embodiment, this embodiment provides a preferred example of performing different processing on the original image based on the phase deflection synthesis algorithm to obtain different target images.

[0082] like Figure 2A As shown, the method for determining the target image includes the following process:

[0083] Step F101: Acquire 8 original pictures, wherein these eight pictures have a certain sinusoidal stripe movement sequence rule.

[0084] Step F102: Based on the phase deflection synthesis algorithm, start processing to obtain different target images.

[0085] Step F103-1: determining the brightness average map of each group of original images, and further performing brightness average map fusion to obtain a standard map (i.e., a standard image);

[0086] Step F103-2: performing specular reflection image fusion according to the determined diffuse reflection component to obtain a specular reflection image;

[0087] Step F103-3: performing diffuse reflection image fusion according to the determined specular reflection component to obtain a diffuse reflection image;

[0088] Step F104-1: synthesizing a gloss ratio map based on the fused specular reflection map and diffuse reflection map;

[0089] Step F103-4: Calculate the shape diagram according to the XY phase diagram, that is, the target phase diagram obtained in the XY directions respectively;

[0090] Step F104-2: Based on the shape graph fusion, the change feature is represented by pixel 1 or pixel 0 to obtain the shape Figure 1 and shape Figure 2.

[0091] According to the obtained standard figure F105-1, specular reflection figure F105-2, gloss ratio figure F105-3, diffuse reflection figure F105-4, shape Figure 1 (F105-5) and shape diagram 2 (F105-6) to perform defect detection on the target object.

[0092] Preferably, see Figure 2B The defect detection system provided by the present invention may include an industrial computer, a planar array sinusoidal projection light source, a line scan camera, an encoder, and two attitude sensors. The attitude sensor includes an attitude sensor 1 and an attitude sensor 2, and the attitude sensor 1 is connected to an indication laser; the attitude sensor is used for the installation and calibration of the defect detection system, and can make the angle between the planar array sinusoidal projection light source and the line scan camera 90 degrees; the indication laser is used to determine that the camera field of view is at the center of the light source.

[0093] Optionally, the industrial computer can instruct the encoder to send the target object's movement information to the array sinusoidal projection light source in the form of pulses. After receiving the movement information, the array sinusoidal projection light source can generate light sources with different phases according to the trigger signal of the encoder, form a light source pattern on the target object, trigger the line scan camera to take pictures, and transmit the image data (original image) to the industrial computer. Furthermore, the industrial computer can execute the defect detection method described in the above embodiment of the present invention to process the input original image and obtain a defect detection result.

[0094] Optionally, the planar array sinusoidal projection light source of the present invention can adopt a master-slave design scheme. Specifically, the host adopts an STM32 single-chip microcomputer to realize the communication between the host computer, the attitude sensor and the light source module; the slave adopts FPGA+DAC (digital-to-analog converter)+cross-current control circuit to realize the light source module; the FPGA converts the digital information of the brightness of the light source into an analog signal through the DAC circuit, and then processes it through the analog signal amplification and filtering circuit, and gives the processed signal to the LED (light-emitting diode) constant current drive module to drive the LED light board; different sinusoidal phase image outputs can be achieved through LED driving; due to the adoption of the master-slave scheme, the present invention can achieve different numbers of slave module expansions.

[0095] The technical solution of the present invention can project positive phase-shifted stripes to the target object through a high-speed switching sinusoidal stripe light source. The phase-modulated stripe light will produce a certain phase change on the product surface according to the glossiness and concave-convexity of the product surface. Through the line scan camera, these stripe images can be captured at the same time, and the multi-dimensional information such as the specular reflection characteristics, diffuse reflection characteristics, and concave-convex shape characteristics of the product surface can be solved through the phase deflection algorithm. It has high detection sensitivity and accuracy for the gloss changes and concave-convex shape changes of the product.

[0096] The advantage of the present invention is that it can output various types of pictures at the same time, decompose the product surface, and present them from different dimensions. In addition, the same feature may have different manifestations in different pictures, so the same defect can be analyzed and located from different pictures. With the AI ​​multimodal detection algorithm, the accuracy of defect detection can be greatly improved.

[0097] Embodiment 3

[0098] Figure 3This is a structural block diagram of a defect detection device provided in the third embodiment of the present invention; this embodiment can be applied to the situation where the industrial computer in the defect detection system enables the light source to image on the target object and perform different processing to obtain images of different dimensions to perform comprehensive defect detection. The defect detection device provided in the embodiment of the present invention can execute the defect detection method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method; the defect detection device can be implemented in the form of hardware and / or software, and configured in a device with defect detection function, such as in a defect detection system, and is executed by the industrial computer in the defect detection system, wherein the defect detection system may include at least: an industrial computer, a projection light source and a preset line scan camera. Figure 3 As shown, the defect detection device specifically includes:

[0099] The obtaining module 301 is used to control a preset projection light source to emit light in response to a defect detection request for a target object to form a light source pattern on the target object, and trigger a preset line scan camera to take a picture to obtain an original image;

[0100] The processing module 302 is used to perform fusion processing, comparison processing and extraction processing on the original image according to the brightness information of the original image;

[0101] The detection module 303 is used to generate target images of different dimensions according to the processing results, and perform defect detection on the target object by analyzing the changes of the same features in different target images.

[0102] The technical solution of the embodiment of the present invention, in response to a defect detection request for a target object, controls a preset projection light source to emit light to form a light source pattern on the target object, and triggers a preset line scan camera to take a picture to obtain an original image; according to the brightness information of the original image, the original image is fused, compared and extracted; according to the processing results, target images of different dimensions are generated, and by analyzing the changes in the same features in different target images, the target object is subjected to defect detection. By emitting a light source on the target object to obtain different original images, and performing a comprehensive analysis and processing on the original images to discover the defect features on the surface of the target object, the accuracy of defect detection can be effectively improved.

[0103] Further, the module 301 is specifically used for:

[0104] According to the sinusoidal characteristics of the target light board corresponding to the projection light source, the current control value of the lamp beads in the corresponding area of ​​the target light board is determined;

[0105] The current control value of the lamp beads in the corresponding area of ​​the target light board is read cyclically to control the switching and brightness of the lamp beads to form a light source pattern on the target object.

[0106] Further, the module 301 is also used for:

[0107] According to the sinusoidal characteristics of the projection light source corresponding to the target light board, determine the lamp bead opening time value that conforms to the sinusoidal law;

[0108] The on-time value of the lamp beads in the corresponding area of ​​the target light board is read cyclically to control the on-time of the lamp beads and form a light source pattern on the target object.

[0109] Furthermore, the processing module 302 may include:

[0110] A processing unit, used for performing fusion processing and comparison processing on the original image according to the brightness information of the original image, so as to obtain a standard image and a shape image in the target image respectively;

[0111] The extraction unit is used to extract the original image based on a preset phase deflection synthesis algorithm and a standard image to obtain a specular reflection image and a diffuse reflection image in the target image.

[0112] Furthermore, the processing unit is specifically used for:

[0113] The original images are grouped according to the projection direction of the light source;

[0114] For each group of original images, the average brightness of the same image area in different original images is determined according to the brightness information of the original images;

[0115] According to the average brightness of each image area in each group of original images, a corresponding average brightness image is generated, and the average brightness image is fused to obtain a standard image.

[0116] Furthermore, the extraction unit is specifically used for:

[0117] Determine the brightness deviation between different original images according to the brightness information of the original images;

[0118] Based on the preset phase deflection synthesis algorithm, the original image is extracted and processed according to the brightness deviation and the standard image to obtain the specular reflection image and the diffuse reflection image in the target image.

[0119] Furthermore, the processing unit is also used for:

[0120] Determine the brightness deviation between different original images according to the brightness information of the original images;

[0121] Based on a preset phase deflection synthesis algorithm, the target phase map corresponding to the original image is determined according to the brightness deviation, and the target phase map is compared with the preset standard phase map to determine the shape map.

[0122] Embodiment 4

[0123] Figure 4is a schematic diagram of the structure of an electronic device provided by Embodiment 4 of the present invention; Figure 4 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0124] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0125] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0126] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a defect detection method.

[0127] In some embodiments, the defect detection method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the defect detection method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the defect detection method in any other appropriate manner (e.g., by means of firmware).

[0128] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0129] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0130] In the context of the present invention, a computer readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer readable storage medium may be a machine readable signal medium. A more specific example of a machine readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0131] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0132] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0133] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0134] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0135] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A defect detection method, characterized in that: include: In response to a defect detection request for a target object, a preset projection light source is controlled to emit light to form a light source pattern on the target object, and a preset line scan camera is triggered to take a picture to obtain an original image; According to the brightness information of the original image, the original image is subjected to fusion processing, comparison processing and extraction processing; Generate target images of different dimensions based on the processing results, and perform defect detection on the target object by analyzing the changes of the same features in different target images; The fusion processing, comparison processing and extraction processing of the original image according to the brightness information of the original image include: According to the brightness information of the original image, the original image is subjected to fusion processing and comparison processing to obtain the standard image and shape image in the target image respectively; Based on the preset phase deflection synthesis algorithm, the original image is extracted and processed according to the standard image to obtain the specular reflection image and the diffuse reflection image in the target image.

2. The method according to claim 1, characterized in that Controlling a preset projection light source to emit light to form a light source pattern on a target object, including: According to the sinusoidal characteristics of the target light board corresponding to the projection light source, the current control value of the lamp beads in the corresponding area of ​​the target light board is determined; The current control value of the lamp beads in the corresponding area of ​​the target light board is read cyclically to control the switching and brightness of the lamp beads to form a light source pattern on the target object.

3. The method according to claim 1, characterized in that: Controlling a preset projection light source to emit light to form a light source pattern on a target object, including: According to the sinusoidal characteristics of the projection light source corresponding to the target light board, determine the lamp bead opening time value that conforms to the sinusoidal law; The on-time value of the lamp beads in the corresponding area of ​​the target light board is read cyclically to control the on-time of the lamp beads and form a light source pattern on the target object.

4. The method according to claim 1, characterized in that: According to the brightness information of the original image, the original image is fused, including: The original images are grouped according to the projection direction of the light source; For each group of original images, the average brightness of the same image area in different original images is determined according to the brightness information of the original images; According to the average brightness of each image area in each group of original images, a corresponding average brightness image is generated, and the average brightness image is fused to obtain a standard image.

5. The method according to claim 1, characterized in that: Based on the preset phase deflection synthesis algorithm, the original image is extracted and processed according to the standard image to obtain the specular reflection image and diffuse reflection image in the target image, including: Determine the brightness deviation between different original images according to the brightness information of the original images; Based on the preset phase deflection synthesis algorithm, the original image is extracted and processed according to the brightness deviation and the standard image to obtain the specular reflection image and the diffuse reflection image in the target image.

6. The method according to claim 1, characterized in that According to the brightness information of the original image, the original image is compared and processed, including: Determine the brightness deviation between different original images according to the brightness information of the original images; Based on a preset phase deflection synthesis algorithm, the target phase map corresponding to the original image is determined according to the brightness deviation, and the target phase map is compared with the preset standard phase map to determine the shape map.

7. A defect detection device, characterized in that: include: An obtaining module is used to control a preset projection light source to emit light in response to a defect detection request for a target object, so as to form a light source pattern on the target object, and trigger a preset line scan camera to take a picture, so as to obtain an original image; A processing module, used for performing fusion processing, comparison processing and extraction processing on the original image according to the brightness information of the original image; The detection module is used to generate target images of different dimensions according to the processing results, and to detect defects of the target object by analyzing the changes of the same features in different target images; The processing module comprises: A processing unit, used for performing fusion processing and comparison processing on the original image according to the brightness information of the original image, so as to obtain a standard image and a shape image in the target image respectively; The extraction unit is used to extract the original image based on a preset phase deflection synthesis algorithm and a standard image to obtain a specular reflection image and a diffuse reflection image in the target image.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the defect detection method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the defect detection method according to any one of claims 1 to 6 when executed.

Citation Information

Patent Citations

  • Rapid defect detection method based on structured light projection

    CN115184362A

  • Workpiece defect detection method based on visual detection

    CN116797567A