A system for detecting cosmetic defects in a fresnel lens

By controlling the backlight and camera position in combination with image enhancement and grayscale threshold segmentation techniques, the problem of separating texture and defects in Fresnel lens appearance inspection has been solved, achieving more accurate defect identification and product screening.

CN116087233BActive Publication Date: 2025-10-17GOERTEK INC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310027631.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-09
Publication Date
2025-10-17
Estimated Expiration
2043-01-09

AI Technical Summary

Technical Problem

In existing technologies, the detection of appearance defects using Fresnel lenses suffers from problems such as uneven background imaging brightness, inconsistent hard threshold selection, and difficulty in separating textures from defects, resulting in insufficient detection accuracy.

Method used

An imaging device and an appearance defect detection device are used to obtain a clear image to be tested by controlling the position of the backlight source and the camera. Image enhancement processing, grayscale threshold segmentation and morphological processing technology are then used to extract and identify the defective area of ​​the Fresnel lens.

Benefits of technology

The accuracy of Fresnel lens defect detection has been improved, which can effectively identify and intercept defective products and improve shipment quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116087233B_ABST
    Figure CN116087233B_ABST
Patent Text Reader

Abstract

The present disclosure provides a Fresnel lens appearance defect detection system, comprising an imaging device, an appearance defect detection device and a tool for fixing a Fresnel lens to be detected, the imaging device comprises a control module, a camera and a backlight source, the control module is configured to control the backlight source to move to a position opposite to a to-be-detected area of the Fresnel lens, and control the camera to take a picture of the to-be-detected area to obtain a to-be-detected image; the appearance defect detection device is configured to detect the appearance defect of the to-be-detected area of the Fresnel lens according to the to-be-detected image; wherein the tool is arranged between the backlight source and the camera, and the tool is arranged in such a manner that when the Fresnel lens is fixed on the tool, the smooth surface of the Fresnel lens faces the camera.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of Fresnel lens defect detection, and more particularly, to a Fresnel lens appearance defect detection system. BACKGROUND

[0002] Fresnel lens, also known as thread lens, is usually a thin sheet made of polyolefin material by injection molding, and some are made of glass. One side of the lens surface is smooth, and the other side is engraved with concentric circles from small to large. The texture is designed according to the interference and scattering of light, as well as the relative sensitivity and receiving angle requirements. In machine vision imaging, Fresnel lens has the following visual imaging characteristics: approximately concentric circular texture, narrow circular ring near the center and high background brightness, wide circular ring away from the center and low background brightness, and the ring center and the lens geometric center are not coincident. Due to the characteristics of light weight and short focal length, Fresnel lens is widely used in virtual reality head-mounted devices.

[0003] In the production process of Fresnel lens, due to the limitation of processing technology level and environmental conditions, the appearance of Fresnel lens may have the following defects: scratch, impurity dirt, internal foreign matter, bubble, film, demolding, white line, film shortage, pressure injury, edge collapse, film crack, tooth injury, and material sticking.

[0004] In the prior art, the lens appearance defect detection and recognition are usually carried out by filtering to eliminate the background texture, extracting defects by hard threshold, and calculating defect characteristic values for judgment. However, this detection method has the following problems: the imaging brightness of Fresnel lens background is uneven, the hard threshold selection needs to balance the gray difference between the center area and the boundary area, resulting in inconsistent extraction ability between the center and the boundary; the width, spacing and gray level of the texture of Fresnel lens are inconsistent, the large-scale convolution kernel is used for filtering, and the small defects of Fresnel lens are filtered out; the defects overlapping with the texture of Fresnel lens are difficult to separate from the texture, and are often identified as part of the texture, or the texture part is misidentified as part of the defect. SUMMARY

[0005] An object of the present disclosure is to provide a new technical solution that can at least solve one of the above problems.

[0006] According to a first aspect of the present disclosure, a system for detecting appearance defects of a Fresnel lens is provided, comprising an imaging device, an appearance defect detection device, and a tool for fixing the Fresnel lens to be detected, the imaging device comprising a control module, a camera, and a backlight source, the control module being configured to control the backlight source to move to a position opposite to a region to be detected of the Fresnel lens, and to control the camera to capture an image of the region to be detected, obtaining a to-be-detected image; the appearance defect detection device being configured to detect appearance defects of the region to be detected of the Fresnel lens according to the to-be-detected image.

[0007] The tool is arranged between the backlight source and the camera, and the tool is arranged in such a manner that, when the Fresnel lens is fixed on the tool, the smooth surface of the Fresnel lens faces the camera.

[0008] Optionally, the control module is further configured to determine a capturing position at which the region to be detected is clearly imaged according to the focal length of the camera and the position of the Fresnel lens, and to control the camera to move to the capturing position to capture the region to be detected, obtaining the to-be-detected image.

[0009] Optionally, when the thickness of the Fresnel lens is greater than the depth of field of the camera, the control module is further configured to determine a plurality of capturing positions at which the region to be detected is clearly imaged according to the depth of field and the thickness, and to control the camera to move to each of the capturing positions to capture the region to be detected, obtaining a plurality of to-be-detected images.

[0010] Optionally, the position opposite to the region to be detected is a position at which a first straight line and a second straight line intersect, wherein the first straight line is perpendicular to the center line of the Fresnel lens, and the second straight line is a straight line passing through the center of the backlight source and the region to be detected.

[0011] Optionally, the appearance defect detection device is configured to extract a grid region in which a defect is suspected to exist in the to-be-detected image, and to obtain the orientation of the grid region relative to the center point of the Fresnel lens in the to-be-detected image; according to the orientation, to extract the contour of a first defect located between the textures of the Fresnel lens in the grid region, and / or the contour of a second defect overlapping the textures of the Fresnel lens in the grid region; and to obtain a defect detection result of the Fresnel lens according to the extracted contours.

[0012] Optionally, the appearance defect detection device is further configured to: perform image enhancement processing on the to-be-tested image to obtain an enhanced image; extract a suspected defect from the enhanced image according to a preset first gray threshold; and perform grid segmentation on a region in which the suspected defect is located in the enhanced image to obtain the grid region.

[0013] Optionally, the appearance defect detection device is further configured to:

[0014] extract a first feature in the grid region according to a preset second gray threshold; construct a first rectangle tangent to a texture of the Fresnel lens in the grid region according to the orientation; perform morphological processing on the first feature according to the first rectangle to obtain an outline of the texture of the Fresnel lens in the grid region; remove the outline of the texture of the Fresnel lens in the grid region to obtain a corresponding to-be-searched defect region; and extract an outline of the first defect in the to-be-searched defect region.

[0015] Optionally, the appearance defect detection device is further configured to: calculate a mean value and a standard deviation of a gray value of the to-be-searched defect region in the to-be-tested image; determine a third gray threshold corresponding to the to-be-searched defect region according to the mean value and the standard deviation; and extract the outline of the first defect from the to-be-searched defect region of the to-be-tested image according to the third gray threshold.

[0016] Optionally, the appearance defect detection device is further configured to: extract a second feature in the grid region according to a preset fourth gray threshold; construct a second rectangle perpendicular to the texture of the Fresnel lens in the grid region according to the orientation; and perform morphological processing on the second feature according to the second rectangle to obtain an outline of the second defect in the grid region.

[0017] Optionally, the appearance defect detection device is further configured to: determine widths of two textures closest to a center point of the grid region in the to-be-tested image as a first width and a second width, respectively; determine a distance between the center point of the grid region and the closest texture in the to-be-tested image; obtain a target width according to the first width, the second width, and the distance; and construct the second rectangle according to the target width and the orientation.

[0018] Through the embodiment of the present disclosure, the control module controls the backlight source to move to a position opposite to the to-be-tested region of the Fresnel lens, and controls the camera to take a picture of the to-be-tested region to obtain a to-be-tested image; the appearance defect detection device detects the to-be-tested region of the Fresnel lens according to the to-be-tested image, which can make the detected defect detection result more accurate, and then can effectively identify and intercept defective products of the Fresnel lens according to the defect detection result, thereby improving the delivery quality of the Fresnel lens.

[0019] Other features of the present disclosure, and their advantages, will become apparent from the following detailed description of exemplary embodiments of the present disclosure, with reference to the drawings. BRIEF DESCRIPTION OF DRAWINGS

[0020] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0021] Figure 1 is a block diagram of an appearance defect detection system according to an embodiment of the present disclosure;

[0022] Figure 2a and Figure 2b is a schematic diagram of a setting position of a backlight source according to an embodiment of the present disclosure;

[0023] Figure 3 is a flowchart of an appearance defect detection method of a Fresnel lens according to an embodiment of the present disclosure;

[0024] Figure 4 is a schematic diagram of one example of a grid region according to an embodiment of the present disclosure;

[0025] Figure 5 is a schematic diagram of another example of a grid region according to an embodiment of the present disclosure;

[0026] Figure 6 is a flowchart of one example of an appearance defect detection method of a Fresnel lens according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0027] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. Note that the relative arrangement, numerical expressions, and numerical values of components and steps set forth in these embodiments are not limiting to the scope of the present disclosure unless otherwise specifically stated.

[0028] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way limiting to the scope of the present disclosure and its applications or uses.

[0029] Techniques, methods, and apparatus known to those of ordinary skill in the relevant art(s) can not be discussed in detail herein. However, where appropriate, the techniques, methods, and apparatus should be considered as being part of the description of the application.

[0030] In all of the examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not limiting. Thus, other examples of the exemplary embodiments can have different values.

[0031] It should be noted that like reference numerals and letters in the various figures indicate similar items, and thus, once any certain item is defined in one figure, it should not have to be discussed further in subsequent figures.

[0032] <SYSTEM>

[0033] Figure 1 is a block diagram of an appearance defect detection system that can be used to implement embodiments of the present disclosure.

[0034] As Figure 1 shown, the appearance defect detection system 1000 can include an imaging device 1100, an appearance defect detection device 1200, and a tool 1300 for fixing a Fresnel lens to be detected. The imaging device 1100 can include a control unit 1110, a camera 1120, and a backlight 1130.

[0035] The tool 1300 is disposed between the camera 1120 and the backlight 1130, and the tool 1300 is disposed in such a way that when the Fresnel lens to be detected is fixed on the tool 1300, the smooth surface of the Fresnel lens faces the camera 1120, and the surface of the Fresnel lens engraved with concentric circular stripes faces the backlight 1130.

[0036] Specifically, one surface of the Fresnel lens is a smooth surface, and the other surface is engraved with concentric circular textures from small to large. When the Fresnel lens to be detected is fixed on the tool 1300, a straight line perpendicular to the Fresnel lens can be a lens of the camera 1120. The straight line perpendicular to the Fresnel lens can be a straight line perpendicular to any texture plane of the Fresnel lens.

[0037] The control unit 1100 is configured to control the backlight 1130 to move to a position opposite to a to-be-detected area of the Fresnel lens to be detected, and control the camera 1120 to capture the to-be-detected area to obtain a to-be-detected image. When the backlight 1130 moves to the position opposite to the to-be-detected area of the Fresnel lens to be detected, a straight line passing through the backlight 1130 and perpendicular to the Fresnel lens does not intersect the to-be-detected area.

[0038] When the backlight 1130 moves to the position opposite to the to-be-detected area of the Fresnel lens to be detected, the light emitted by the backlight 1130 irradiates the to-be-detected area of the Fresnel lens, and can produce diffuse reflection in the to-be-detected area, so that when the camera 1120 photographs the to-be-detected area, clear imaging of the to-be-detected area can be obtained.

[0039] In one embodiment of the present disclosure, the position opposite to the to-be-detected area of the Fresnel lens to be detected is a position where a first straight line intersects with a second straight line, where the first straight line is perpendicular to the center line of the Fresnel lens, and the second straight line is a straight line passing through the backlight 1130 and the center of the to-be-detected area. The straight line perpendicular to the center line of the Fresnel lens can be a straight line perpendicular to the Fresnel lens and passing through the center of the Fresnel lens, and the circle of the concentric circular stripe engraved on the Fresnel lens is the center of the Fresnel lens.

[0040] Specifically, in the case where the Fresnel lens is arranged in parallel to the horizontal plane and the surface of the Fresnel lens engraved with the concentric circular stripe faces downward, when the first straight line intersects with the second straight line, the backlight is located directly below the center of the target area, where the target area is symmetric to the to-be-detected area with respect to the center of the Fresnel lens.

[0041] In the present embodiment, the second straight line can be a straight line passing through any position of the backlight 1130 and the center of the to-be-detected area. For example, the second straight line can be a straight line passing through the center of the backlight 1130 and the center of the to-be-detected area. Specifically, as shown in Figure 2a .

[0042] In one example, as shown in Figure 2b , the Fresnel lens can be divided into a plurality of to-be-detected areas, including an A area, a B area, a C area, and a D area. In the case where the to-be-detected area of the Fresnel lens is the A area, the backlight 1130 can be moved to position ④; in the case where the to-be-detected area of the Fresnel lens is the B area, the backlight 1130 can be moved to position ③; in the case where the to-be-detected area of the Fresnel lens is the C area, the backlight 1130 can be moved to position ②; and in the case where the to-be-detected area of the Fresnel lens is the D area, the backlight 1130 can be moved to position ①.

[0043] In the present embodiment, the backlight 1130 is controlled to move 4 times, so that all the imaging obtained can cover the entire lens area of the Fresnel lens, to detect the appearance defects of the entire lens area of the Fresnel lens.

[0044] In one embodiment of the present disclosure, the control module 1110 can also be configured to determine a shooting position for clear imaging of the to-be-tested region according to the focal length of the camera and the position of the Fresnel lens, and control the camera 1120 to move to the shooting position to shoot the to-be-tested region and obtain a to-be-tested image.

[0045] In this embodiment, when the camera 1120 moves to the shooting position, the Fresnel lens can be located on the focal plane of the camera 1120, so that the to-be-tested region of the Fresnel lens can be clearly imaged in the camera 1120 to obtain a clear to-be-tested image, so that the appearance defects of the to-be-tested region can be detected according to the to-be-tested image.

[0046] In the case where the thickness of the Fresnel lens is less than or equal to the depth of field of the camera, the camera shoots the Fresnel lens once, and all the textures of the Fresnel lens can be clearly presented in the to-be-tested image. In the case where the thickness of the Fresnel lens is greater than the depth of field of the camera, the control module 1110 is further configured to determine a plurality of shooting positions for clear imaging of the to-be-tested region according to the depth of field and the thickness, and control the camera 1120 to move to each shooting position to shoot the to-be-tested region and obtain a plurality of to-be-tested images. In this way, the to-be-tested image obtained at each shooting position can clearly present part of the textures in the to-be-tested region, and the textures clearly presented in these to-be-tested images are all the textures in the to-be-tested region. In this way, the appearance defects of the to-be-tested region can be completely detected according to the to-be-tested images obtained at all the shooting positions.

[0047] By adjusting the shooting position of the camera, the various depth ranges of the Fresnel lens can be focused, and the to-be-tested image can be obtained by shooting the Fresnel lens at each shooting position, so that the outer surface and the interior of the Fresnel lens can be clearly imaged to detect the defects of the outer surface and the defects in the interior of the Fresnel lens. The defects of the outer surface can include scratches, impurities, dirt, demolding, pressure marks, and sticking materials, and the defects in the interior can include internal foreign matters and bubbles.

[0048] The appearance defect detection device 1200 is configured to detect the appearance defects of the to-be-tested region of the Fresnel lens according to the to-be-tested image.

[0049] According to the embodiments of the present disclosure, the control module controls the backlight source to move to a position opposite to the to-be-tested region of the Fresnel lens, and controls the camera to shoot the to-be-tested region and obtain a to-be-tested image, and the appearance defect detection device detects the appearance defects of the to-be-tested region of the Fresnel lens according to the to-be-tested image, so that the detected defect detection result is more accurate, and the defective products of the Fresnel lens can be effectively identified and intercepted according to the defect detection result, and the delivery quality of the Fresnel lens is improved.

[0050] In one embodiment of the present disclosure, the appearance defect detection device 1200 can be configured to perform appearance defect detection on the Fresnel lens to be detected by performing steps S1000-S4000 as shown in FIG. 10. Figure 3

[0051] In step S1000, an image to be detected is obtained by photographing the Fresnel lens to be detected.

[0052] In one embodiment, the image to be detected can be obtained by the imaging device 1100 as shown in FIG. 11 and provided to the appearance defect detection device 1200. Figure 1

[0053] In one embodiment, the image to be detected can be an image obtained by photographing the region to be detected of the Fresnel lens by the camera at any photographing position.

[0054] In step S2000, a grid region suspected of having a defect is extracted from the image to be detected, and an orientation of the grid region relative to a center point of the Fresnel lens in the image to be detected is obtained.

[0055] In one embodiment, the grid region extracted can be one or multiple, which is not limited herein.

[0056] In one embodiment of the present disclosure, the step of extracting the grid region suspected of having a defect from the image to be detected can include steps S2100-S2300 as shown below.

[0057] In step S2100, an image enhancement process is performed on the image to be detected to obtain an enhanced image.

[0058] For the camera, the imaging of the texture in the camera is different from the distance between the camera, which is manifested as the texture of the Fresnel lens close to the focal plane of the camera has clear texture boundary, narrow texture width, and high contrast between the texture gray scale and the background in the image to be detected, and the texture of the Fresnel lens far away from the focal plane of the camera has blurred texture boundary, wide texture width, and low contrast between the texture gray scale and the background in the image to be detected. Therefore, in order to ensure accurate extraction of the texture, the image enhancement process needs to be performed on the image to be detected.

[0059] In one embodiment, the method of image enhancement is to transform the gray scale of the image to be detected into a gray scale interval [GrayMin, GrayMax], and then to obtain the enhanced image by using two mean filters with different sizes to do difference. For the image to be detected obtained by the camera at different photographing positions, different gray scale intervals [GrayMin, GrayMax] can be set for the gray scale normalization transformation process.

[0060] ​​The texture edges in the enhanced image are clear, the gray scale of the texture and the defects is less than 10, and the gray scale of the background is greater than 230, so that the contrast of the texture and the defects can be enhanced.

[0061] In step S2200, the suspected defects are extracted from the enhanced image according to the gray scale gradient map and the preset first gray scale threshold.

[0062] The first gray scale threshold can be set according to the application scenario or specific requirements in advance. For example, the first gray scale threshold can be 30.

[0063] According to the gray scale gradient map and the preset first gray scale threshold, as many suspected defects as possible can be extracted from the enhanced image, so that the extracted suspected defects can include all defects in the clear area of the image to be tested.

[0064] In an embodiment, in order to improve the defect extraction efficiency, the enhanced image can be subjected to Gaussian difference filtering to obtain a gray scale gradient map of the enhanced image, and then the positions with obvious gradient changes in the lens area of the gray scale gradient map are found. According to the first gray scale threshold, the region in the enhanced image corresponding to the position with obvious gradient changes is subjected to threshold segmentation to obtain suspected defects with a gray scale value less than or equal to the first gray scale threshold.

[0065] In step S2300, the region where the suspected defects are located in the enhanced image is subjected to grid segmentation to obtain a grid region.

[0066] In an embodiment of the present disclosure, the region where each suspected defect is located in the enhanced image is subjected to grid segmentation, and at least one grid region corresponding to each suspected defect can be obtained. In the case of a small suspected defect, one grid region centered on the suspected defect can be generated; in the case of a large suspected defect, the suspected defect can be segmented into multiple grid regions.

[0067] In this embodiment, each grid region needs to meet the following requirements:

[0068] 1. The curvature of the texture in the grid region is not more than 10 degrees, so as to ensure that the texture in the grid region is approximately straight;

[0069] 2. The size of the grid region away from the center of the Fresnel lens is large, and the size of the grid region close to the center of the Fresnel lens is small, so as to reduce the number of obtained grid regions.

[0070] In an embodiment of the present disclosure, before step S2200 is performed, the appearance defect detection device 1200 can further perform the following steps: performing inflation processing on the suspected defects; and merging the suspected defects at least partially overlapped after inflation.

[0071] The at least two suspected defects at least partially overlapped after the expansion are adjacent, and in order to avoid that the at least two grid regions obtained by respectively performing grid division on regions where the adjacent suspected defects are located contain the same defect, which affects the detection result of the defect, the at least two suspected defects at least partially overlapped after the expansion, i.e., the adjacent suspected defects, can be merged, and then the region where the merged suspected defects are located is subjected to grid division.

[0072] In another embodiment of the present disclosure, the extracting the grid region where the suspected defect in the to-be-tested image exists can further include: determining a mean value and a standard deviation of the grayscale of the to-be-tested image; determining a fifth grayscale threshold value according to the mean value and the standard deviation; extracting the suspected defect from the to-be-tested image according to the fifth grayscale threshold value; and performing grid division on a region where the suspected defect in the to-be-tested image is located to obtain the grid region.

[0073] In the embodiment, the mean value of the grayscale of the to-be-tested image can be an average value of the grayscale values of all pixels in the to-be-tested image, and the standard deviation of the grayscale of the to-be-tested image can be a standard deviation of the grayscale values of all pixels in the to-be-tested image.

[0074] In one embodiment, the fifth grayscale threshold value can be obtained according to the following formula:

[0075] MaxThred1 = mean1 * Delta1

[0076]

[0077]

[0078] Wherein, MaxThred1 represents the fifth grayscale threshold value, mean1 represents the mean value of the grayscale of the to-be-tested image, and dev1 represents the standard deviation of the grayscale of the to-be-tested image.

[0079] The grid division on the region where the suspected defect in the to-be-tested image is located to obtain the grid region can refer to the foregoing step S2300, and details are not described herein.

[0080] In one embodiment of the present disclosure, in the to-be-tested image, a polar coordinate system with a center point of the Fresnel lens as a pole point can be constructed in advance, and the orientation of the grid region relative to the center point of the Fresnel lens in the to-be-tested image can be represented by a polar angle coordinate of the grid region in the polar coordinate system.

[0081] In one example, the obtained grid region can be a region as shown in Figure 4 and Figure 5 .

[0082] Step S3000, according to the orientation, extracting the contour of the first defect located between the textures of the Fresnel lens in the grid region, and / or the contour of the second defect overlapping the textures of the Fresnel lens in the grid region.

[0083] In the embodiment, all the grid regions obtained through step S2000 can be traversed, and step S3000 can be executed for the currently traversed grid region. The contour of the first defect located between the textures of the Fresnel lens in the grid region can be as shown in FIG. 3B, and the contour of the second defect overlapping the textures of the Fresnel lens in the grid region can be as shown in FIG. 3C. Figure 4 Figure 5

[0084] In one embodiment of the present disclosure, according to the orientation, extracting the contour of the first defect located between the textures of the Fresnel lens in the grid region can include steps S3100-S3500 as shown below:

[0085] Step S3100, extracting the first feature in the grid region according to a preset second gray scale threshold.

[0086] The second gray scale threshold can be set in advance according to application scenarios or specific requirements, for example, the second gray scale threshold can be 20.

[0087] Specifically, the features with a gray scale value less than or equal to the second gray scale threshold in the grid region can be extracted as the first features. In the example as shown in FIG. 3D, the first features can be black features including the first defect and the texture. Figure 4

[0088] Step S3200, constructing a first rectangle tangent to the textures of the Fresnel lens in the grid region according to the orientation of the grid region relative to the center point of the Fresnel lens in the image to be measured.

[0089] In the embodiment, the long side of the first rectangle can be tangent to the texture in the grid region. Since the texture in the grid region is a part of a circle with the center point of the Fresnel lens as the center, according to the orientation of the center point of the grid region relative to the center point of the Fresnel lens in the image to be measured, the attitude of the long side of the first rectangle to be constructed in the grid region can be determined.

[0090] Specifically, in the case where the orientation of the grid region relative to the center point of the Fresnel lens in the image to be measured is represented by the polar coordinates of the center point of the grid region in a polar coordinate system, the angle between the long side of the first rectangle to be constructed and the polar axis of the polar coordinate system can be obtained according to the polar angle coordinate a of the center point of the grid region in the polar coordinate system.

[0091] ​​​In one embodiment of the present disclosure, the first rectangle tangent to the texture in the grid region can be constructed according to an included angle between a long side of the first rectangle to be constructed and a polar axis of the polar coordinate system, and the first rectangle can be constructed with a width of a first preset width and a length of a set proportion of a width of the grid region.

[0092] The first preset width can be set in advance according to an application scenario or specific requirements. For example, the first preset width can be 0.5 pixels. The set proportion can be set in advance according to an application scenario or specific requirements. For example, the set proportion can be 1 / 3.

[0093] In this way, the first rectangle with the width of the first preset width and the length of the set proportion of the width of the grid region and the included angle between the long side and the polar axis of the polar coordinate system equal to the polar angle coordinate of the center point of the grid region in the polar coordinate system can be constructed, and the first rectangle is tangent to the texture in the grid region, as shown in Figure 4 .

[0094] In step S3300, the first rectangle is used to perform morphological processing on the black feature to obtain the contour of the texture of the Fresnel lens in the grid region.

[0095] In this embodiment, the first feature obtained through step S3100 can be morphologically processed by using the first rectangle as an opening morphological kernel, specifically a texture profiling kernel, to erode the defects in the grid region and obtain the contour of the texture of the Fresnel lens in the grid region.

[0096] In step S3400, the contour of the texture of the Fresnel lens in the grid region is removed to obtain the corresponding defect search region.

[0097] In this embodiment, the contour of the texture obtained through step S3300 can be removed from the grid region to obtain the defect search region, which can include the region in the grid region other than the texture.

[0098] In step S3500, the contour of the first defect in the defect search region is extracted.

[0099] In one embodiment of the present disclosure, the contour of the first defect in the defect search region can include: extracting a feature with a gray value less than or equal to a preset sixth gray threshold from the defect search region as the contour of the first defect.

[0100] The sixth gray threshold can be set in advance according to an application scenario or specific requirements. For example, the sixth gray threshold can be 10.

[0101] In another embodiment of the present disclosure, since the enhanced image improves the contrast between the texture and the background, defects with less contrast with the background can not be detected due to the distortion of the enhanced image. Therefore, in order to avoid the influence of the distortion of the enhanced image on the defect detection capability, the step of extracting the contour of the first defect in the defect search area can include steps S3510-S3530 as follows:

[0102] In step S3510, the mean and the standard deviation of the gray scale of the defect search area in the image to be measured are calculated.

[0103] In this embodiment, the mean and the standard deviation of the gray scale of all pixel points in the defect search area of the image to be measured can be calculated.

[0104] In step S3520, a third gray scale threshold corresponding to the defect search area is determined according to the mean and the standard deviation.

[0105] In one embodiment, the third gray scale threshold can be obtained according to the following formula:

[0106] MaxThred2 = mean2 * Delta2

[0107]

[0108]

[0109] Where MaxThred2 represents the third gray scale threshold, mean2 represents the mean of the gray scale of all pixel points in the defect search area of the image to be measured, and dev2 represents the standard deviation of the gray scale of all pixel points in the defect search area of the image to be measured.

[0110] In step S3530, the contour of the first defect is extracted from the defect search area of the image to be measured according to the third gray scale threshold.

[0111] In this embodiment, the features with a gray scale value less than or equal to the third gray scale threshold can be extracted from the defect search area of the image to be measured as the contour of the first defect.

[0112] Through this embodiment, the detection capability of the first defect in the Fresnel lens can be improved.

[0113] In one embodiment of the present disclosure, in the case where the grid area is located within the central texture ring of the Fresnel lens in the image to be measured, the grid area does not contain texture, and therefore the grid area located within the central texture ring of the Fresnel lens in the image to be measured can be taken as the defect search area, and the defects therein can be extracted according to the aforementioned steps S3510-S3530. Wherein, the central texture ring of the Fresnel lens is the closest texture ring to the center point of the Fresnel lens.

[0114] In one embodiment of the present disclosure, according to the orientation, extracting the profile of the second defect of which the texture of the Fresnel lens in the grid region overlaps can include steps S3600-S3800 as shown below:

[0115] Step S3600, extracting the second feature in the grid region according to a preset fourth gray scale threshold.

[0116] The fourth gray scale threshold can be preset according to application scenarios or specific requirements, for example, the fourth gray scale threshold can be 20.

[0117] Specifically, the features with a gray scale value less than or equal to the fourth gray scale threshold in the grid region can be extracted as the second feature. In the example as shown in FIG. 6B, the second feature can be a black feature including the second defect and the texture. Figure 5

[0118] Step S3700, constructing a second rectangle perpendicular to the texture of the Fresnel lens in the grid region according to the orientation.

[0119] In this embodiment, the long side of the second rectangle can be perpendicular to the texture in the grid region. Since the texture in the grid region is a part of a circle with the center point of the Fresnel lens as the center, according to the orientation of the center point of the grid region relative to the center point of the Fresnel lens in the image to be measured, the attitude of the long side of the second rectangle to be constructed in the grid region can be determined.

[0120] Specifically, in the case where the orientation of the grid region relative to the center point of the Fresnel lens in the image to be measured is represented by the polar coordinates of the center point of the grid region in the polar coordinate system, the angle between the long side of the second rectangle to be constructed and the polar axis of the polar coordinate system can be α+90° according to the polar angle coordinate α of the center point of the grid region in the polar coordinate system.

[0121] In one embodiment of the present disclosure, according to the orientation, constructing the second rectangle perpendicular to the texture of the Fresnel lens in the grid region can include steps S3710-S3740 as shown below:

[0122] Step S3710, determining the widths of the two textures closest to the center point of the grid region in the image to be measured as the first width and the second width respectively.

[0123] In this embodiment, the width of the texture closest to the center point of the grid region in the image to be measured can be taken as the first width, and the width of the texture second closest to the center point of the grid region in the image to be measured can be taken as the second width.

[0124] ​In one embodiment, the width of each texture in the image to be detected can be predetermined. Since the distance between the Fresnel lens and the camera and the position of the Fresnel lens are constant when the same area of different Fresnel lenses is detected for appearance defect, the width of the texture at the same position in different Fresnel lenses in the image to be detected is the same, and the width of each position texture can be predetermined according to the image obtained by photographing the Fresnel lens without defects; or the width of each position texture in the image of each Fresnel lens can be predetermined according to the images obtained by photographing a plurality of Fresnel lenses, and the median, mean or mean value after removing the maximum and minimum of the width of each position texture in the image of each Fresnel lens is taken as the width of each position texture.

[0125] Step S3720, determining the distance between the center point of the grid area and the nearest texture in the image to be detected.

[0126] Step S3730, obtaining the target width according to the first width, the second width and the distance.

[0127] In the embodiment, the target width can be determined according to the following formula:

[0128] H=a*h2+(1-a)*h1

[0129] Wherein, H represents the target width, h1 represents the first width, h2 represents the second width, and a represents the distance between the center point of the grid area and the nearest texture.

[0130] Step S3740, constructing a second rectangle according to the target width and the orientation.

[0131] In the embodiment, the second rectangle with the target width and the second preset width can be constructed according to the angle between the long side of the second rectangle to be constructed and the polar axis of the polar coordinate system, as shown in Figure 5

[0132] Wherein, the second preset width can be set in advance according to the application scenario or specific requirements. For example, the second preset width can be 0.5 pixels.

[0133] In this way, the second rectangle with the second preset width and the target width, the angle between the long side of the second rectangle and the polar axis of the polar coordinate system and the difference between the polar angle coordinate of the center point of the grid area in the polar coordinate system is 90°, which is perpendicular to the texture in the grid area.

[0134] Step S3800, morphologically processing the second feature according to the second rectangle to obtain the contour of the second defect in the grid area.

[0135] ​In the embodiment, the second rectangle can be used as an opening operation morphological kernel, specifically, a texture tangent kernel, to perform morphological processing on the second feature obtained through step S3600 to erode the texture in the grid region, to obtain the profile of the second defect of the Fresnel lens in the grid region.

[0136] In one embodiment of the present disclosure, the appearance defect detection apparatus 1200 can further perform the following steps: removing the profile of the texture in the profile of the second defect in the grid region; and performing interpolation processing on the profile of the second defect in the grid region, in a case where the number of the profile of the second defect in the grid region is greater than a preset value.

[0137] The preset value can be set in advance according to an application scenario or specific requirements. For example, the preset value can be 1.

[0138] In the embodiment, the profile of the texture obtained according to step S3400 and the profile of the second defect obtained through step S3800 can be used to remove the part of the profile of the second defect that coincides with the profile of the texture.

[0139] In a case where the profile of the second defect obtained through step S3800 penetrates at least one profile of the texture, the number of the profile of the second defect in the grid region increases after the profile of the texture in the profile of the second defect is removed. In a case where one profile of the second defect penetrates one profile of the texture, the profile of the second defect becomes two profiles of the second defect; in a case where one profile of the second defect penetrates two profiles of the texture, the profile of the second defect becomes three profiles of the second defect.

[0140] The interpolation processing is performed on the profile of the second defect in the grid region, and the gap between the plurality of profiles of the second defect in the grid region is interpolated to obtain one profile of the second defect.

[0141] Specifically, a circle with a target width as a diameter can be interpolated, and based on the circle, morphological closing operation processing is performed on the plurality of profiles of the second defect in the grid region, that is, the plurality of profiles of the second defect are combined into one profile of the second defect.

[0142] Step S4000: obtaining a defect detection result of the Fresnel lens according to the extracted profile.

[0143] The extracted profile in the embodiment can include the profile of the first defect and / or the profile of the second defect extracted through step S3000.

[0144] In one embodiment, the size, shape, area, position, and / or contrast of the extracted defect can be determined as the defect detection result of the Fresnel lens.

[0145] By the embodiment of the present disclosure, a grid region suspected to have defects in a to-be-detected image obtained by taking a photo of the Fresnel lens to be detected is extracted, and an orientation of the grid region relative to a center point of the Fresnel lens in the to-be-detected image is obtained; according to the orientation, an outline of a first defect located between textures of the Fresnel lens in the grid region is extracted, and / or an outline of a second defect overlapping the textures of the Fresnel lens in the grid region is extracted, and a defect detection result of the Fresnel lens is obtained according to the extracted defects. In this way, the appearance defects of the Fresnel lens can be automatically detected, and the obtained defect detection result is more accurate, and thus the defective products of the Fresnel lens can be effectively identified and intercepted according to the defect detection result, and the delivery quality of the Fresnel lens is improved.

[0146] In an embodiment of the present disclosure, the appearance defect detection device 1200 can further perform the following steps: determining whether the Fresnel lens is qualified according to the defect detection result.

[0147] In an example, the Fresnel lens can be scored according to the defect detection result by a preset scoring model, and whether the Fresnel lens is qualified is determined according to the obtained score.

[0148] In another example, the number and area of defects existing in the Fresnel lens can be determined according to the defect detection result, and the Fresnel lens can be determined to be qualified in a case where the number and area of defects do not exceed the corresponding qualified range; the Fresnel lens can be determined to be unqualified in a case where the number or area of defects exceeds the corresponding qualified range.

[0149] <Example>

[0150] In an example, the appearance defect detection device 1200 can detect the appearance defects of the Fresnel lens by performing steps S6001-S6021 as shown in Figure 6

[0151] Step S6001, obtaining a to-be-detected image obtained by taking a photo of the Fresnel lens to be detected.

[0152] Step S6002, performing image enhancement processing on the to-be-detected image to obtain an enhanced image.

[0153] Step S6003, extracting suspected defects from the enhanced image according to a gray gradient map and a preset first gray threshold.

[0154] Step S6004, performing grid segmentation on a region where the suspected defects in the enhanced image are located to obtain a grid region.

[0155] Step S6005, traversing all grid regions. ​

[0156] Step S6006, determine whether the current traversed grid region is located in the central texture ring of the Fresnel lens in the image to be measured, if not, execute step S6007 and step S6014; if yes, execute step S6021.

[0157] Step S6007, extract the first feature in the current traversed grid region according to the preset second gray threshold.

[0158] Step S6008, construct a first rectangle tangent to the texture of the Fresnel lens in the current traversed grid region according to the orientation of the current traversed grid region relative to the center point of the Fresnel lens in the image to be measured.

[0159] Step S6009, perform morphological processing on the black feature according to the first rectangle to obtain the contour of the texture of the Fresnel lens in the current traversed grid region.

[0160] Step S6010, remove the contour of the texture of the Fresnel lens in the current traversed grid region to obtain the corresponding defect search region.

[0161] Step S6011, calculate the mean and standard deviation of the gray value of the defect search region in the image to be measured.

[0162] Step S6012, determine the third gray threshold corresponding to the defect search region according to the mean and standard deviation.

[0163] Step S6013, extract the contour of the first defect from the defect search region of the image to be measured according to the third gray threshold.

[0164] Step S6014, extract the second feature in the current traversed grid region according to the preset fourth gray threshold.

[0165] Step S6015, determine the width of the two closest textures to the center point of the current traversed grid region in the image to be measured as the first width and the second width, respectively.

[0166] Step S6016, determine the distance between the center point of the current traversed grid region and the closest texture in the image to be measured.

[0167] Step S6017, obtain the target width according to the first width, the second width and the distance.

[0168] Step S6018, construct a second rectangle perpendicular to the texture of the Fresnel lens in the current traversed grid region according to the target width and the orientation.

[0169] Step S6019, perform morphological processing on the second feature according to the second rectangle to obtain the contour of the second defect in the current traversed grid region.

[0170] In step S6020, the current traversed grid region is taken as a defect region to be searched.

[0171] In step S6021, a defect detection result of the Fresnel lens is obtained according to the extracted contour.

[0172] The above embodiments mainly focus on the differences from other embodiments, but those skilled in the art should understand that the above embodiments can be used alone or in combination according to the needs.

[0173] Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other. Each of the embodiments mainly focuses on the differences from other embodiments, but those skilled in the art should understand that the above embodiments can be used alone or in combination according to the needs. In addition, for the device embodiments, since they are corresponding to the method embodiments, they are described more simply, and the related parts can be referred to the corresponding part of the method embodiments. The above described system embodiments are only schematic, and the modules described as separate components can be or can not be physically separated.

[0174] The present disclosure can be a system, a method, and / or a computer program product. The computer program product can include a computer readable storage medium (or media) having computer readable program instructions thereon for causing a processor to carry out aspects of the present disclosure.

[0175] The computer readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer readable storage medium can be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium include the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or punched tape, a magneto-optical or other optical medium, a machine readable

[0176] Computer readable program instructions described herein can be downloaded to respective computing / processing devices from a computer readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network and / or a wireless network. The network can comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and / or edge servers. A network adapter card or network interface in each computing / processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing / processing device.

[0177] Computer readable program instructions for carrying out operations of the present disclosure can be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as python, java, C++ or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer readable program instructions can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate arrays (FPGA), or programmable logic arrays (PLA) can execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present disclosure.

[0178] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process, such that the instructions which execute on the computer, other programmable data processing apparatus, or other device implement the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0179] These computer readable program instructions can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks. These computer readable program instructions can also be stored in a computer readable storage medium that can include a non-transitory computer readable storage medium that can be a computer- readable storage medium having no data, programs, program modules, e.g., instructions for operation, or digital content stored thereon or therein for a short time or not at all. The computer readable storage medium can also have instructions stored thereon or therein which may

[0180] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process, such that the instructions which execute on the computer, other programmable data processing apparatus, or other device implement the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0181] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process, such that the instructions which execute on the computer, other programmable data processing apparatus, or other device implement the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0182] Having described above several embodiments of the disclosure, any modifications and variations that fall within the scope of the described embodiments are also contemplated by the inventor(s). As such, the foregoing description is not intended to limit the scope of the disclosure, and it is recognized that modifications are contemplated which can provide one or more benefits and which are within the scope of the disclosure. The disclosure is defined by the appended claims.

Claims

1. A Fresnel lens appearance defect detection system, characterized in that: The system comprises an imaging device, an appearance defect detection device, and a fixture for fixing a Fresnel lens to be inspected. The imaging device comprises a control module, a camera, and a backlight source. The control module is configured to control the backlight source to move to a position relative to a test area of ​​the Fresnel lens, and to control the camera to photograph the test area to obtain a test image. The appearance defect detection device is configured to perform appearance defect detection on the test area of ​​the Fresnel lens based on the test image. The tooling is arranged between the backlight source and the camera, and the tooling is arranged in such a manner that when the Fresnel lens is fixed on the tooling, the smooth surface of the Fresnel lens faces the camera; The position relative to the area to be measured is the position where a first straight line intersects a second straight line, wherein the first straight line is perpendicular to the center line of the Fresnel lens, and the second straight line is a straight line passing through the backlight source and the center of the area to be measured.

2. The system according to claim 1, wherein: The control module is further configured to determine a shooting position at which the area to be measured is clearly imaged according to the focal length of the camera and the position of the Fresnel lens, and control the camera to move to the shooting position to shoot the area to be measured to obtain the image to be measured.

3. The system according to claim 2, characterized in that When the thickness of the Fresnel lens is greater than the depth of field of the camera, the control module is further configured to determine, based on the depth of field and the thickness, a plurality of shooting positions at which the area to be measured can be clearly imaged, and control the camera to move to each of the shooting positions to shoot the area to be measured, thereby obtaining a plurality of images to be measured.

4. The system according to claim 1, wherein: The appearance defect detection device is configured to extract a grid area suspected of having defects in the image to be tested, and obtain the orientation of the grid area relative to the center point of the Fresnel lens in the image to be tested; According to the orientation, the outline of a first defect located between the textures of the Fresnel lens in the grid area and / or the outline of a second defect overlapping with the texture of the Fresnel lens in the grid area are extracted; and a defect detection result of the Fresnel lens is obtained based on the extracted outlines.

5. The system according to claim 4, characterized in that The appearance defect detection device is further configured to: perform image enhancement processing on the image to be tested to obtain an enhanced image; and extract suspected defects from the enhanced image according to a preset first grayscale threshold; Performing grid segmentation on the area where the suspected defect is located in the enhanced image to obtain the grid area.

6. The system according to claim 5, characterized in that The appearance defect detection device is further configured to: A first feature in the grid area is extracted according to a preset second grayscale threshold; a first rectangle tangent to the texture of the Fresnel lens in the grid area is constructed according to the orientation; morphological processing is performed on the first feature according to the first rectangle to obtain an outline of the texture of the Fresnel lens in the grid area; the outline of the texture of the Fresnel lens in the grid area is removed to obtain a corresponding defect area to be searched; and the outline of the first defect in the defect area to be searched is extracted.

7. The system according to claim 6, characterized in that The appearance defect detection device is also configured to: calculate the mean and standard deviation of the grayscale of the defect area to be searched in the image to be tested; determine a third grayscale threshold corresponding to the defect area to be searched based on the mean and the standard deviation; and extract the outline of the first defect from the defect area to be searched in the image to be tested based on the third grayscale threshold.

8. The system according to claim 4, wherein: The appearance defect detection device is also configured to: extract a second feature in the grid area according to a preset fourth grayscale threshold; construct a second rectangle perpendicular to the texture of the Fresnel lens in the grid area according to the orientation; and perform morphological processing on the second feature according to the second rectangle to obtain the outline of the second defect in the grid area.

9. The system according to claim 8, characterized in that The appearance defect detection device is further configured to: determine the widths of two textures closest to the center point of the grid area in the image to be tested, as a first width and a second width, respectively; determine the distance between the center point of the grid area and the closest texture in the image to be tested; and obtain a target width based on the first width, the second width, and the distance; The second rectangle is constructed according to the target width and the orientation.

Citation Information

Patent Citations

  • Glass bottle defect detection apparatus and image splitting device

    CN103234979A

  • Method and device for detecting surface defects of optical element and electronic equipment

    CN114565552A