Smooth object surface defect detection method, device, equipment and medium

By collecting images taken under striped light sources, calculating image intensity changes and extracting brightness changes, combining diffusion and reflection components, the missed detection problem of surface defect detection of smooth objects in the prior art is solved, and the accuracy of multiple types of defects is achieved Detection and cost reduction.

CN113344865BActive Publication Date: 2024-12-13SHENZHEN ZHONGKE PRECISION TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202110560706.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-21
Publication Date
2024-12-13
Estimated Expiration
2041-05-21

AI Technical Summary

Technical Problem

Existing machine vision defect detection technology has problems of missed detection and high cost when detecting surface defects of smooth objects. Traditional 2D image processing cannot cover all defect types, and deep learning methods have high requirements for data annotation and hardware performance.

Method used

By collecting two or more original images taken under the irradiation of the striped light source, the image intensity changes are calculated, the brightness changes of the different images are extracted, and the surface defect judgment is normalized, combined with diffuse and reflection components.

Benefits of technology

Effectively extract many types of defects on the surface of smooth objects, such as scratches, concave and dullness, reduce detection costs and improve detection accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113344865B_ABST
    Figure CN113344865B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, equipment and medium for detecting surface defects of smooth objects. The method comprises collecting two or more original images taken on the surface of the object to be detected, wherein the original images are obtained under the illumination of a stripe light source with alternating light and dark and having one or more directions relative to the object to be detected; calculating the image intensity change between each of the original images, and obtaining a difference image with difference characteristics according to the image intensity change; extracting the brightness change of the pixels of the difference image in the local area, and normalizing to the grayscale image interval according to the brightness change of the difference image to obtain a shape image; and judging the surface defects of the object to be detected according to the shape image. Through the present invention, the light and shadow changes of the smooth surface texture of the object to be detected can be reconstructed to achieve the purpose of extracting defect characteristics.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of automated detection technology, and in particular to a method and method, device and equipment for detecting surface defects of smooth objects. Background Art

[0002] Defect detection based on machine vision has been developing rapidly in recent years. On the one hand, it benefits from various industrial fields: such as Mini / Macro LED in the semiconductor industry, consumer soft-pack batteries in the new energy industry, appearance defect detection of power batteries, and metal surface defect detection in precision machining, as well as defect detection in the screen display industry, which have actively promoted the continuous iteration and strengthening of AOI technology; secondly, the cost of the labor market has increased year by year in recent years, and the demand for automation of the back-end detection of product production has become increasingly strong. Various manufacturers are actively promoting the automation process of back-end defect detection; defect detection automation is also an effective means to collect product defect data and improve product process technology.

[0003] At present, mainstream machine vision defect detection uses 2D images and traditional image processing algorithms to enhance defects and then achieve the purpose of defect extraction. However, due to the extremely large number of traditional defect detection types, traditional defect detection methods cannot cover all defect types, and the imaging of a single defect can also be different. A single algorithm parameter setting often results in missed detections, which is also a common problem of current 2D defect detection.

[0004] With the popularization of CNN technology, deep learning techniques are being used more and more widely in defect detection. However, due to the high requirements for data sample labeling and hardware performance, it is also a relatively costly method. Summary of the invention

[0005] In view of the above technical problems, the present invention provides a method, device, equipment and medium for detecting defects on the surface of a smooth object, so as to provide a technical solution for reconstructing the light and shadow changes of the smooth surface texture of the object to be inspected to achieve the purpose of extracting defect features.

[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.

[0007] According to one aspect of the present invention, a method for detecting surface defects of a smooth object is proposed, the method comprising:

[0008] Collect two or more original images taken on the surface of the object to be inspected, wherein the original images are obtained under the illumination of a stripe light source with alternating light and dark and having one or more directions relative to the object to be inspected; calculate the image intensity change between each of the original images, and obtain a difference image with difference characteristics according to the image intensity change; extract the brightness change of the pixels of the difference image in the local area, and normalize it to the grayscale image interval according to the brightness change of the difference image to obtain a shape image; and judge the surface defects of the object to be inspected according to the shape image.

[0009] Furthermore, the original image is obtained under the illumination of a stripe light source that is longitudinal and transverse to the object to be detected, and there are at least two original images obtained under the illumination of a stripe light source that is longitudinal and transverse to the object to be detected.

[0010] Furthermore, the method of extracting the image intensity changes between the original images and obtaining a difference image with difference characteristics based on the image intensity changes includes: arranging the multiple original images in sequence; subtracting the pixel values ​​of the corresponding pixel positions between two adjacent original images to obtain a difference; and sorting the differences according to the corresponding positions to obtain a difference image.

[0011] Furthermore, subtracting the pixel values ​​of the corresponding pixel positions between two adjacent original images to obtain a difference includes: taking the pixel coordinates of the Nth original image, where N is a positive integer, taking the pixel coordinates of the N+1th original image, and calculating the absolute value of the pixel coordinates of the Nth original image minus the pixel coordinates of the N+1th original image, where the absolute value is the difference.

[0012] Furthermore, extracting the brightness change of the local pixel area of ​​the difference image includes: statistically calculating the brightness change intensity of the local pixel area of ​​the difference image by a statistical method of feature extraction to obtain the brightness change of the local pixel area of ​​the difference image.

[0013] Furthermore, after acquiring the original image, it also includes: extracting the diffuse component and the reflective component of the pixel value of each pixel point of the original image, and obtaining a diffuse image and a reflective image according to the diffuse component and the reflective component, respectively; comparing the reflective image of each original image with the diffuse image, respectively obtaining a gloss ratio image; and judging the surface defects of the inspected object according to the gloss ratio image and the shape image.

[0014] Furthermore, after obtaining the reflection component, the reflection component is amplified.

[0015] According to a second aspect of the present disclosure, there is provided a smooth object surface defect detection device, comprising: an acquisition module, for acquiring two or more original images taken on the surface of the inspected object, wherein the original images are obtained under the illumination of a stripe light source with alternating light and dark and having one or more directions relative to the inspected object; a calculation module, for calculating the image intensity variation between each of the original images, and obtaining a difference image with difference characteristics based on the image intensity variation; a statistical module, for extracting the brightness variation of pixels of the difference image in a local area, and normalizing to a grayscale image interval based on the brightness variation of the difference image to obtain a shape image; and a judgment module, for performing surface defect judgment of the inspected object based on the shape image.

[0016] According to a third aspect of the present disclosure, there is provided a smooth object surface defect detection device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions, the above-mentioned smooth object surface defect detection method.

[0017] According to a fourth aspect of the present disclosure, there is provided a computer-readable storage medium storing a computer program, wherein the computer program is executed by a processor to implement the above-mentioned method for detecting surface defects of smooth objects.

[0018] The technical solution disclosed in this disclosure has the following beneficial effects:

[0019] According to the above-mentioned smooth object surface defect detection method, device, equipment and medium, by collecting the original image of the object to be inspected under the irradiation of the stripe light source, the light and shadow changes of the smooth surface texture of the object to be inspected are reconstructed, and the image brightness changes of the local pixel area are extracted through the feature extraction algorithm to obtain a shape image (shape image), which not only highlights the changes in image intensity caused by the surface texture of defects in multiple original images, but also highlights the image intensity changes of defect features in the local area of ​​the image, which is convenient for extracting multiple types of defects such as scratches, bruises, bumps and dullness on the surface of the object to be inspected. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 A schematic diagram of the working process of a method for detecting defects on a smooth object surface provided in an embodiment of this specification;

[0021] Figure 2 is an example of a shape diagram of the present invention;

[0022] Figure 3 Direction examples of defects proposed for the present invention;

[0023] Figure 4A schematic diagram of the structure of a collection system for a smooth object surface defect detection method provided in an embodiment of this specification;

[0024] Figure 5 A schematic diagram of the workflow of a method for detecting defects on a smooth object surface provided in an embodiment of this specification;

[0025] Figure 6 A schematic diagram of a workflow for obtaining a gloss ratio image provided in an embodiment of this specification;

[0026] Figure 7 This is a schematic diagram of the structure of a smooth object surface defect detection device proposed by the present invention;

[0027] Figure 8 It is a smooth object surface defect detection device in the embodiment of this specification;

[0028] Fig. 9 It is a computer-readable storage medium used to implement a method for detecting surface defects of smooth objects in an embodiment of this specification. DETAILED DESCRIPTION

[0029] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.

[0030] In addition, the drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0031] like Figure 1 As shown, the present embodiment provides a method for detecting surface defects of a smooth object, including step S110~ S140:

[0032] In step 110, two or more original images taken on the surface of the detected object are collected, wherein the original images are obtained under the illumination of a stripe light source with alternating light and dark and having one or more directions relative to the detected object.

[0033] In the embodiment of the present application, when shooting the original image, in order to produce obvious shadow changes on the surface of the detected object in the original image, the stripe light source needs to emit strip-shaped high-frequency flashes from different directions on the surface of the detected object, and the stripe light source needs to be light and dark. One special case is that the stripe high-frequency flashes in different directions differ by half a period. The stripe light source can be a device that can emit stripe high-frequency flashes in different directions, or two devices that can emit unidirectional stripe flashes. When the stripe light source emits stripe high-frequency flashes to the detected object, an original image is obtained after being photographed by the acquisition camera.

[0034] In step 120, the image intensity variation between the original images is calculated, and a difference image having a difference feature is obtained according to the image intensity variation.

[0035] In the embodiment of the present application, in order to extract the image intensity changes between the original image sequences caused by the light and dark features of the defects, it is necessary to calculate the image intensity changes between the various original images, and then synthesize a difference image with difference features based on the calculation results.

[0036] In step 130, the brightness variation of the pixels of the difference image in the local area is extracted, and the brightness variation of the difference image is normalized to the grayscale image interval to obtain a shape image.

[0037] In the embodiment of the present application, the brightness change of the difference image is represented by a grayscale image to obtain a shape image, so that the defects are more obvious, the contrast is strong, and it is easier to apply the image detection algorithm.

[0038] In step 140, surface defect determination of the inspected object is performed based on the shape image.

[0039] After getting the shape image, such as Figure 2 A shape image 200 is provided, which has obvious defects and is easy to judge. On the one hand, the shape image 200 can be output to a display device for staff to judge; on the other hand, a preset value can be used, and when the image intensity change in a set area exceeds the preset value, the object under inspection can be judged as having defects.

[0040] In an optional embodiment, the original image is obtained under the illumination of a stripe light source that is longitudinal and transverse to the object to be detected, and there are at least two original images respectively obtained under the illumination of a stripe light source that is longitudinal and transverse to the object to be detected.

[0041] In the embodiment of the present application, when stripe light sources in the longitudinal and transverse directions are used, defects in the transverse direction can only produce shadow changes in the original image sequence when imaged under alternating light and dark stripes. For defects in the transverse direction imaged under the stripe light source in the longitudinal direction, shadows exist for a single original image, but shadow changes cannot be observed from multiple original images. Therefore, for defects in the transverse direction, shadows will be produced when imaged under the stripe light source in the transverse direction, and the shadow changes between the original image sequences are also very obvious. The same is true for defects in the longitudinal direction. The transverse defect refers to the projection of the geometric size of the defect in the transverse direction, which is much larger than the projection in the longitudinal direction. For example Figure 3 As shown, the longitudinal direction is represented by Y-Direction, the transverse direction is represented by X-Direction, and the defect is represented by Defect.

[0042] At the same time, in order to ensure that a certain position on the surface of the object to be tested can produce shadow changes, the original images of the object to be tested in the longitudinal and transverse directions are limited to at least two respectively. Of course, the specific number can be four, six or any other number greater than two.

[0043] To further explain the above embodiment, Figure 4 As shown, a schematic diagram of a collection system is provided, which is applied to the collection scene of the original image, wherein the light source module 41 (i.e., stripe light source) and the collection camera 42 satisfy the reflection principle, that is, the angle between the light source module and the virtual normal direction 44 of the surface of the object to be inspected 43 is equal to the angle between the collection camera and the virtual normal direction 44 of the surface of the object to be inspected. Here, since the object to be inspected 43 is an object with a smooth surface, the installation position of the light source module 41 and the collection camera 42 satisfies the reflection principle, that is, it is more conducive to the generation of shadows in the defect area. The light source module 41 emits stripe light in the longitudinal and transverse directions alternately, and synchronously triggers the collection camera 42 to shoot, and obtains one original image in the longitudinal and transverse directions, and then the object to be inspected 43 moves along a fixed direction, which can be transverse, and the light source module 41 emits stripe light in the longitudinal and transverse directions alternately, and then triggers the collection camera 42 to shoot synchronously, and then obtains one original image in the longitudinal and transverse directions, and so on, the original images imaged in the longitudinal and transverse directions of the object to be inspected 43 are limited to at least two respectively. The original image obtained by the above acquisition system meets the requirement of producing obvious shadow changes on the surface of the object to be inspected, so that a more ideal shadow change effect can be obtained after subtracting it, making it easier to perform defect detection on the object to be inspected.

[0044] In an optional embodiment, if Figure 5 As shown, in step S510, it is assumed that there are four original images in one direction, which are represented by X1, X2, X3, and X4 respectively, and the image intensity changes between the original images in the same direction are extracted. According to the image intensity changes, a difference image with difference characteristics is obtained, including: arranging the multiple original images in sequence; subtracting the pixel values ​​of the corresponding pixel positions between two adjacent original images to obtain a difference; in step S520, the difference values ​​are sorted according to the corresponding positions to obtain a difference image.

[0045] In an embodiment of the present application, a difference is calculated for the original image obtained in step S110, specifically, a difference is calculated between two adjacent images in the original image sequence to highlight the change of shadows between the original images. Since the positions of the stripe light sources are different when the original images are collected, the shadows of the defects of the inspected object cast by the stripe light sources are also different. After a difference is calculated between two adjacent images in the original image sequence, the change of shadows between the original images can be highlighted.

[0046] In an optional embodiment, continue to refer to Figure 5 In step S520, the pixel values ​​of the corresponding pixel positions between two adjacent original images are subtracted to obtain a difference, including: taking the pixel coordinates of the Nth original image, N is a positive integer, taking the pixel coordinates of the N+1th original image, and calculating the absolute value of the pixel coordinates of the Nth original image minus the pixel coordinates of the N+1th original image, and the absolute value is the difference.

[0047] In the embodiment of the present application, the formula for calculating the difference of the original image may be:

[0048] Sub(x,y)=|x1(x,y)-x2(x,y)|

[0049] Or, Sub(x,y)=x1(x,y)-x2(x,y)

[0050] Among them, (x, y) is the pixel coordinate.

[0051] Of course, there are many other formulas for calculating the difference of the original image, and this disclosure does not limit this.

[0052] In an optional embodiment, continue to refer to Figure 5In step S530, the extracting of the brightness change of the local pixel area of ​​the difference image includes: statistically calculating the brightness change intensity of the local pixel area of ​​the difference image by a statistical method of feature extraction to obtain the brightness change of the local pixel area of ​​the difference image. Then in step S550, all brightness changes are normalized to a grayscale image, and in step S560, a shape image is obtained.

[0053] In an embodiment of the present application, the image brightness changes in the local pixel areas are then extracted for all the difference images, and the intensity of the brightness changes in the local pixel areas of the difference images are statistically calculated by the statistical method of feature extraction. Specifically, the brightness change variance within the neighborhood ROI of a single pixel can be set through the ExtractionFeatureSize parameter, and then normalized to the grayscale image interval to obtain different shape images; in this way, the image intensity changes caused by the surface texture of the defects in the original image sequence are highlighted, and the image intensity changes of the defect features in the local image are highlighted, so that subtle surface texture defects can be extracted.

[0054] In an optional embodiment, if Figure 6 As shown, after the original image is acquired, steps S610 to S640 are also included:

[0055] In step S610, the diffuse component and the reflected component of the pixel value of each pixel point of the original image are extracted. Due to the relatively smooth surface, the reflected component is the dominant factor. According to the illumination theory, the image brightness at a symmetrical angle to the incident light will have a peak value, which can be approximately regarded as the reflected component. Other diffused light is weaker and can be approximately regarded as the diffuse component. Therefore, the dark channel and the bright channel of each pixel point in the longitudinal or transverse direction can be taken to obtain the pixel intensity values ​​of the diffuse component and the reflected component respectively. Specifically, for x1, x2, x3, and x4 representing different original images, the formula for calculating the dark channel of a single pixel can be:

[0056] Diffuse(x,y)=min(x1(x,y),x2(x,y),x3(x,y),x4(x,y)), where (x,y) is the pixel coordinate.

[0057] The formula for calculating the reflection component can be:

[0058] Specular(x,y)=max(x1(x,y),x2(x,y),x3(x,y),x4(x,y)), where (x,y) are pixel coordinates.

[0059] In an optional implementation, since the reflection component is taken from the brighter pixel value of each pixel, but due to the existence of defects, the brightness of some pixels has a weak pattern, it is necessary to perform gain processing on the brightness image, which meets the actual requirements of the project and improves the robustness of defect detection. The specific gain formula can be:

[0060] Specular(x,y)=Specular(x,y)+Specular(x,y) / gain_coef, where / gain_coef is the gain coefficient.

[0061] In step S620, a diffuse image and a reflected image are obtained according to the diffuse component and the reflected component. By combining the diffuse component and the reflected component obtained above, a diffuse image and a reflected image can be obtained respectively.

[0062] In step S630, the reflection image and the diffuse image of each original image are compared to obtain gloss ratio images, respectively, so as to highlight the related defects such as dark dust on the surface of the object to be tested.

[0063] In step S640, the surface defect of the inspected object is determined based on the gloss ratio image and the shape image.

[0064] In the embodiment of the present application, by combining the gloss ratio image with the shape image, dark dust and subtle surface texture defects on the surface of the object to be tested can be detected.

[0065] In an optional embodiment, if Figure 6 As shown, the smooth object surface defect detection device includes: an acquisition module 710, which is used to acquire two or more original images taken on the surface of the object to be detected, where the original images are obtained under the irradiation of a stripe light source with alternating light and dark and having one or more directions relative to the object to be detected; a calculation module 720, which is used to calculate the image intensity change between each original image, and obtain a difference image with difference characteristics according to the image intensity change; a statistical module 730, which is used to extract the brightness change of pixels in the difference image in a local area, and normalize it to a grayscale image interval according to the brightness change of the difference image to obtain a shape image; a judgment module 740, which makes a surface defect judgment on the object to be detected according to the shape image.

[0066] The embodiments of this specification provide a smooth object surface defect detection device, which collects the original image of the inspected object under the illumination of a stripe light source, reconstructs the light and shadow changes of the smooth surface texture of the inspected object, and extracts the image brightness changes in the local area of ​​the pixel through a feature extraction algorithm to obtain a shape image (shape image). It not only highlights the changes in image intensity caused by the surface texture of defects in multiple original images, but also highlights the changes in image intensity of defect features in the local area of ​​the image, which facilitates the extraction of various types of defects such as scratches, bruises, bumps and dullness on the surface of the inspected object.

[0067] The specific details of each module / unit in the above-mentioned device have been described in detail in the implementation method of the method part. The undisclosed details can be found in the implementation method of the method part, so they will not be repeated here.

[0068] Based on the same idea, the embodiment of this specification also provides a smooth object surface defect detection device, such as Figure 7 shown.

[0069] The smooth object surface defect detection device may be the terminal device or the server provided in the above embodiment.

[0070] The smooth object surface defect detection device may have relatively large differences due to different configurations or performances, and may include one or more processors 801 and memory 802, and the memory 802 may store one or more storage applications or data. Among them, the memory 802 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) and / or a cache memory unit, and may further include a read-only storage unit. The application stored in the memory 802 may include one or more program modules (not shown in the figure), such program modules include but are not limited to: an operating system, one or more applications, other program modules and program data, each of these examples or some combination may include the implementation of a network environment. Furthermore, the processor 801 can be configured to communicate with the memory 802 to execute a series of computer executable instructions in the memory 802 on the smooth object surface defect detection device. The restorable face image privacy protection device may also include one or more power supplies 803, one or more wired or wireless network interfaces 804, one or more I / O interfaces (input and output interfaces) 805, one or more external devices 806 (such as keyboards, pointing devices, Bluetooth devices, etc.), and may also communicate with one or more devices that enable a user to interact with the device, and / or communicate with any device that enables the device to communicate with one or more other computing devices (such as routers, modems, etc.). Such communication may be performed through the I / O interface 805. In addition, the device may also communicate with one or more networks (such as a local area network (LAN)) through the wired or wireless interface 704.

[0071] Specifically in this embodiment, the smooth object surface defect detection device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions in the recoverable face image privacy protection device, and is configured to be executed by one or more processors. The one or more programs include the following computer executable instructions:

[0072] Collect two or more original images taken on the surface of the object to be inspected, wherein the original images are obtained under the illumination of a stripe light source with alternating light and dark and having one or more directions relative to the object to be inspected; calculate the image intensity change between each of the original images, and obtain a difference image with difference characteristics according to the image intensity change; extract the brightness change of the pixels of the difference image in the local area, and normalize it to the grayscale image interval according to the brightness change of the difference image to obtain a shape image; and judge the surface defects of the object to be inspected according to the shape image.

[0073] The original images are obtained under the illumination of stripe light sources that are longitudinal and transverse to the object to be detected. There are at least two original images obtained under the illumination of stripe light sources that are longitudinal and transverse to the object to be detected.

[0074] The step of extracting the image intensity changes between the original images and obtaining a difference image with difference characteristics according to the image intensity changes includes: arranging the multiple original images in sequence; subtracting the pixel values ​​of the corresponding pixel positions between two adjacent original images to obtain a difference; and sorting the difference values ​​according to the corresponding positions to obtain a difference image.

[0075] The subtracting the pixel values ​​of the corresponding pixel positions between two adjacent original images to obtain the difference includes: taking the pixel coordinates of the Nth original image, N is a positive integer, taking the pixel coordinates of the N+1th original image, and calculating the absolute value of the pixel coordinates of the Nth original image minus the pixel coordinates of the N+1th original image, where the absolute value is the difference.

[0076] The extracting the brightness change of the local pixel area of ​​the difference image includes: statistically calculating the brightness change intensity of the local pixel area of ​​the difference image by a statistical method of feature extraction to obtain the brightness change of the local pixel area of ​​the difference image.

[0077] After the original image is acquired, the method further includes: extracting the diffuse component and the reflective component of the pixel value of each pixel point of the original image, and obtaining a diffuse image and a reflective image according to the diffuse component and the reflective component, respectively; comparing the reflective image of each original image with the diffuse image, and obtaining a gloss ratio image, respectively; and judging the surface defects of the inspected object according to the gloss ratio image and the shape image.

[0078] After obtaining the reflection component, the reflection component is amplified.

[0079] Based on the same idea, the exemplary embodiments of the present disclosure also provide a computer-readable storage medium on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present disclosure can also be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present disclosure described in the above "Exemplary Method" section of the present specification.

[0080] refer to Figure 8As shown, a program product 900 for implementing the above method according to an exemplary embodiment of the present disclosure is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.

[0081] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable 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 above.

[0082] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0083] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0084] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0085] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the exemplary implementation of the present disclosure.

[0086] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiment of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0087] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the exemplary embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0088] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.

[0089] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A method for detecting surface defects of a smooth object, characterized in that: The method comprises: Collecting two or more original images taken on the surface of the object to be detected, wherein the original images are obtained under the illumination of a stripe light source with alternating light and dark and having one or more directions relative to the object to be detected; Calculating the image intensity variation between the original images, and obtaining a difference image with difference characteristics according to the image intensity variation; Extracting brightness changes of pixels of the difference image in a local area, obtaining a shape image according to the brightness changes of the difference image, and normalizing the shape image to a grayscale image interval; According to the shape image, judging the surface defects of the inspected object; And after acquiring the original image, it also includes: Extracting the diffuse component and the reflected component of the pixel value of each pixel point of the original image, gaining the reflected component, and obtaining a diffuse image and a reflected image according to the diffuse component and the reflected component respectively; Comparing the reflected image of each original image with the diffuse image to obtain gloss ratio images respectively; Surface defect judgment of the inspected object is performed based on the gloss ratio image and the shape image.

2. The method for detecting surface defects of a smooth object according to claim 1, characterized in that: The original images are obtained under the illumination of stripe light sources that are longitudinal and transverse to the object to be detected. There are at least two original images obtained under the illumination of stripe light sources that are longitudinal and transverse to the object to be detected.

3. The method for detecting surface defects of a smooth object according to claim 1, characterized in that: The step of extracting the image intensity changes between the original images and obtaining a difference image with difference characteristics according to the image intensity changes includes: Arranging the plurality of original images in sequence; Subtracting pixel values ​​at corresponding pixel positions between two adjacent original images to obtain a difference; The difference values ​​are sorted according to corresponding positions to obtain a difference image.

4. The method for detecting surface defects of a smooth object according to claim 3, characterized in that: Subtracting pixel values ​​at corresponding pixel positions between two adjacent original images to obtain a difference value includes: Take the pixel coordinates of the Nth original image, where N is a positive integer, take the pixel coordinates of the N+1th original image, and calculate the absolute value of the pixel coordinates of the Nth original image minus the pixel coordinates of the N+1th original image, where the absolute value is the difference.

5. The method for detecting surface defects of a smooth object according to claim 1, characterized in that: The extracting the brightness change of the local pixel area of ​​the difference image includes: statistically calculating the brightness change intensity of the local pixel area of ​​the difference image by a statistical method of feature extraction to obtain the brightness change of the local pixel area of ​​the difference image.

6. A smooth object surface defect detection device, characterized in that: include: An acquisition module, used to acquire two or more original images taken on the surface of the detected object, wherein the original images are obtained under the illumination of a stripe light source with alternating light and dark and having one or more directions relative to the detected object; A calculation module, used for calculating the image intensity change between the original images, and obtaining a difference image with difference characteristics according to the image intensity change; A statistical module, used for extracting brightness changes of pixels of the difference image in a local area, and normalizing the brightness changes of the difference image to a grayscale image interval to obtain a shape image; A judgment module, for judging surface defects of the inspected object according to the shape image; The device is also used for: After the original image is acquired, a diffuse component and a reflected component of a pixel value of each pixel point of the original image are extracted, the reflected component is amplified, and a diffuse image and a reflected image are obtained according to the diffuse component and the reflected component respectively; Comparing the reflected image of each original image with the diffuse image to obtain gloss ratio images respectively; Surface defect judgment of the inspected object is performed based on the gloss ratio image and the shape image.

7. A smooth object surface defect detection device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the storage medium communicate via the bus, and the processor executes the machine-readable instructions to perform the steps of the smooth object surface defect detection method as described in any one of claims 1 to 5.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for detecting defects on the surface of a smooth object as claimed in any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Surface detection method and device

    CN105548194A

  • Surface defect acquisition system, surface defect detection method and device and storage medium

    CN110243831A

  • Transparent flat plate defect and diopter change detection system and method

    CN111579564A

  • Highlight surface defect detection system

    CN206557123U

  • Defect inspection system and method

    US20160266046A1