A watch surface production defect detection method, system, equipment and program product
The surface point cloud data of the watch is obtained through lidar, image processing and deep learning network detection are carried out, which solves the problems of low efficiency and low accuracy of traditional manual detection, and achieves rapid and intelligent detection of surface defects of watches.
Patent Information
- Application Number
- CN202410828632.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-25
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2044-06-25
AI Technical Summary
The traditional method of detecting defects on the surface of watches relies on manual observation of the naked eye, resulting in low detection accuracy and reliability, labor-intensive and low detection efficiency.
Lidar is used to obtain point cloud data on the watch surface, and after outlier point filtering, grayscale assignment, adaptive median filtering and binary processing, binary point cloud images are generated, and a preset defect detection network model is input for detection and defect marking is marked.
It realizes rapid and intelligent detection of watch surface defects, improves the accuracy and reliability of inspection, saves manpower, and improves detection efficiency and stability.
Smart Images

Figure CN118864356B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of machine vision detection, and specifically relates to a method, system, equipment and program product for detecting production defects on watch surfaces. Background Art
[0002] Watches are timekeeping tools that people often wear, and they can also serve as accessories. Watches need to undergo corresponding product quality inspections before leaving the factory to prevent defective products from entering the market. Product inspections before leaving the factory include surface defect inspections, such as cracks, scratches, abnormal depressions, abnormal protrusions, etc. The traditional method of inspecting watch surface production defects is achieved by manual visual observation by quality inspectors. The accuracy and reliability of the inspection are not high, and it is very labor-intensive and the inspection efficiency is also low. Summary of the invention
[0003] The purpose of the present invention is to provide a watch surface production defect detection method, system, equipment and program product to solve the above-mentioned problems existing in the prior art.
[0004] In order to achieve the above object, the present invention adopts the following technical solutions:
[0005] In a first aspect, a method for detecting production defects on a watch surface is provided, comprising:
[0006] Acquire a point cloud data set obtained after laser detection of the watch surface by a laser radar, wherein the point cloud data set includes point cloud data of a plurality of points, wherein the point cloud data includes three-dimensional coordinates of corresponding points, and the three-dimensional coordinates include two-dimensional plane coordinates and depth coordinates;
[0007] Based on the three-dimensional coordinates of each point in the point cloud data set, outlier filtering is performed on the point cloud data set to obtain a denoised point cloud data set;
[0008] A plane point cloud image of the watch surface is constructed according to the two-dimensional plane coordinates of each point in the denoised point cloud data set, and a grayscale value is assigned to each point in the plane point cloud image according to the depth coordinates of each point in the denoised point cloud data set to obtain a grayscale point cloud image of the watch surface;
[0009] Performing adaptive median filtering on each point in the grayscale point cloud image according to the two-dimensional plane coordinates and grayscale values of each point to obtain a filtered grayscale point cloud image;
[0010] Perform threshold segmentation and binarization processing on each point in the filtered grayscale point cloud image to obtain a binary point cloud image;
[0011] Input the binary point cloud image into a preset defect detection network model to perform defect detection and obtain the corresponding defect detection result;
[0012] When it is determined that there are defects on the watch surface based on the defect detection results, the binary point cloud image is annotated with defect marks and then output.
[0013] In a possible design, the outlier filtering process is performed on the point cloud data set based on the three-dimensional coordinates of each point in the point cloud data set to obtain a denoised point cloud data set, including:
[0014] Based on the three-dimensional coordinates of each point in the point cloud dataset, traverse and calculate a random point P i (x i ,y i , z i ) to any other point P j (x j ,y j , z j ) is the distance L,
[0015] According to a random point P i (x i ,y i , z i ) to the remaining points L m , calculate the distance average Q, Among them, m represents the distance number, and n is the total number of the remaining points;
[0016] According to a random point P i (x i ,y i , z i ) to the remaining points and the average distance Q, calculate the distance standard deviation S,
[0017] When the distance standard deviation S is within the set threshold range [QS×α, Q+S×α], the random point P i (x i ,y i , z i ) is retained, otherwise, the random point P i (x i ,y i , z i ) is removed from the point cloud dataset, and α is the set standard deviation coefficient.
[0018] In a possible design, constructing a plane point cloud image of the watch surface according to the two-dimensional plane coordinates of each point in the denoised point cloud data set includes:
[0019] Construct a blank image, and construct a plane coordinate system of the blank image with a certain point on the blank image as the origin;
[0020] According to the plane coordinate system of the blank image and the two-dimensional plane coordinates of each point in the denoised point cloud data set, each point is marked on the blank image to obtain a plane point cloud image of the watch surface.
[0021] In a possible design, the grayscale assignment of each point in the plane point cloud image according to the depth coordinate of each point in the denoised point cloud data set includes:
[0022] According to the depth coordinates of each point in the denoised point cloud data set, the depth D of each point is determined k , k represents the number of the corresponding points, and according to the depth D of each point k Determine the maximum depth Z max and the minimum depth Z min ;
[0023] Set the maximum depth Z max , minimum depth Z min And the depth D of each point k Substitute the coordinates into the grayscale assignment formula H k =255×(D k -Z min ) / (Z max -Z min ) to calculate the gray value H of each point k .
[0024] In a possible design, the step of performing adaptive median filtering on each point in the grayscale point cloud image according to the two-dimensional plane coordinates and grayscale values of each point includes:
[0025] Each point is taken as the center point, and several points with the closest plane distance in the neighborhood of the center point are selected as the neighborhood points of the center point according to the two-dimensional plane coordinates of each point;
[0026] Calculate the standard deviation of the grayscale values of the center point and all its neighboring points based on the grayscale values of each point;
[0027] When the gray value standard deviation is greater than the standard deviation threshold, the number of neighboring points of the center point is reduced by the set reduction amount, and the gray value standard deviation is recalculated until the number of neighboring points of the center point is reduced to the set lower limit, and the median gray value of the center point and all its neighboring points is determined at this time, and the median gray value is used as the gray value of the center point;
[0028] When the gray value standard deviation is less than or equal to the standard deviation threshold, the median gray value of the center point and all its neighboring points is determined, and the median gray value is used as the gray value of the center point.
[0029] In a possible design, performing threshold segmentation and binarization on each point in the filtered grayscale point cloud image to obtain a binary point cloud image includes:
[0030] The grayscale threshold of all points in the filtered grayscale point cloud image is calculated using the Otsu method;
[0031] Points with grayscale values greater than the grayscale threshold are segmented into the first type of points, and points with grayscale values less than or equal to the grayscale threshold are segmented into the second type of points. The grayscale values of the first type of points are transformed into the first grayscale values, and the grayscale values of the second type of points are transformed into the second grayscale values to obtain a binary point cloud image.
[0032] In a possible design, before inputting the binary point cloud image into a preset defect detection network model for defect detection, the method further includes:
[0033] A ResNet network model is constructed, and a training set is used to train the ResNet network model to obtain a trained defect detection network model, wherein the training set includes a number of negative samples of binary point cloud images marked with defect labels and a number of positive samples of binary point cloud images marked with non-defect labels.
[0034] In a second aspect, a watch surface production defect detection system is provided, including a point cloud acquisition unit, a point cloud denoising unit, an image construction unit, an image filtering unit, a binary segmentation unit, a defect detection unit and a defect annotation unit, wherein:
[0035] A point cloud acquisition unit, used to acquire a point cloud data set obtained after laser detection of the watch surface by a laser radar, wherein the point cloud data set includes point cloud data of a plurality of points, wherein the point cloud data includes three-dimensional coordinates of corresponding points, and the three-dimensional coordinates include two-dimensional plane coordinates and depth coordinates;
[0036] A point cloud denoising unit is used to perform outlier filtering on the point cloud data set based on the three-dimensional coordinates of each point in the point cloud data set to obtain a denoised point cloud data set;
[0037] An image construction unit, used to construct a plane point cloud image of the watch surface according to the two-dimensional plane coordinates of each point in the denoised point cloud data set, and to assign grayscale values to each point in the plane point cloud image according to the depth coordinates of each point in the denoised point cloud data set, so as to obtain a grayscale point cloud image of the watch surface;
[0038] An image filtering unit, used for performing adaptive median filtering on each point in the grayscale point cloud image according to the two-dimensional plane coordinates and grayscale values of each point to obtain a filtered grayscale point cloud image;
[0039] A binary segmentation unit is used to perform threshold segmentation and binarization processing on each point in the filtered grayscale point cloud image to obtain a binary point cloud image;
[0040] A defect detection unit is used to input the binary point cloud image into a preset defect detection network model to perform defect detection and obtain corresponding defect detection results;
[0041] The defect marking unit is used to mark the binary point cloud image with a defect mark and then output it when it is determined that there are defects on the watch surface according to the defect detection result.
[0042] In a third aspect, a watch surface production defect detection device is provided, comprising:
[0043] A memory for storing instructions;
[0044] A processor is used to read the instructions stored in the memory and execute any one of the methods described in the first aspect according to the instructions.
[0045] In a fourth aspect, a computer-readable storage medium is provided, wherein instructions are stored on the computer-readable storage medium, and when the instructions are executed on a computer, the computer executes any one of the methods described in the first aspect. In addition, a computer program product is provided, and when the computer program product is executed on a computer, the computer executes any one of the methods described in the first aspect.
[0046] Beneficial effect: The present invention collects laser radar point cloud data of the watch surface, performs denoising processing and constructs a gray point cloud image based on depth information to obtain a gray point cloud image, then performs adaptive median filtering processing and corresponding binary segmentation processing on each point of the gray point cloud image to obtain a binary point cloud image, and then inputs the binary point cloud image into the defect detection network model for defect detection, and finally, when it is determined that there are defects on the watch surface according to the defect detection results of the model, the binary point cloud image is marked with a defect mark and then output, which can realize rapid and intelligent detection of production defects on the watch surface. The present invention replaces the traditional manual detection method with the corresponding laser radar point cloud image processing and analysis process, which can more accurately and reliably detect production defects on the watch surface, and can effectively improve the detection efficiency and stability of defects on the watch surface, assist quality inspectors to realize rapid detection of watches before leaving the factory, and save manpower. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0048] Figure 1 This is a schematic diagram of the steps of the method in Example 1 of the present invention;
[0049] Figure 2 This is a schematic diagram of the structure of the system in Example 2 of the present invention;
[0050] Figure 3 This is a schematic diagram of the structure of the device in Example 3 of the present invention. DETAILED DESCRIPTION
[0051] It should be noted that the description of these embodiments is used to help understand the present invention, but does not constitute a limitation of the present invention. The specific structures and functional details disclosed herein are only used to describe the exemplary embodiments of the present invention. However, the present invention can be embodied in many alternative forms, and it should not be understood that the present invention is limited to the embodiments set forth herein.
[0052] It should be understood that, unless otherwise clearly specified and limited, the term "connection" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the embodiments can be understood according to specific circumstances.
[0053] In the following description, certain details are provided to facilitate a complete understanding of the example embodiments. However, it will be appreciated by those of ordinary skill in the art that the example embodiments may be implemented without these certain details. For example, devices may be shown in block diagrams to avoid obscuring the examples with unnecessary details. In other embodiments, well-known processes, structures, and techniques may not be shown in unnecessary detail to avoid obscuring the embodiments.
[0054] Embodiment 1:
[0055] This embodiment provides a method for detecting production defects on a watch surface, which can be applied to corresponding detection terminals, such as Figure 1 As shown, the method comprises the following steps:
[0056] S1. Obtain a point cloud data set obtained after laser detection of the watch surface by a laser radar, wherein the point cloud data set contains point cloud data of several points, wherein the point cloud data includes three-dimensional coordinates of corresponding points, and the three-dimensional coordinates include two-dimensional plane coordinates and depth coordinates.
[0057] In specific implementation, a laser radar can be set at the watch detection end, and the laser radar is used to perform laser detection on the surface of the watch to be inspected to obtain a corresponding laser radar point cloud data set, and then the collected point cloud data set is transmitted to the detection terminal for subsequent point cloud data processing. The point cloud data set contains point cloud data of several points, and the point cloud data includes the three-dimensional coordinates (x, y, z) of the corresponding points, and the three-dimensional coordinates (x, y, z) include two-dimensional plane coordinates (x, y) and depth coordinates z.
[0058] S2. Perform outlier filtering on the point cloud dataset based on the three-dimensional coordinates of each point in the point cloud dataset to obtain a denoised point cloud dataset.
[0059] In the specific implementation, the detection terminal traverses and calculates a random point P based on the three-dimensional coordinates of each point in the point cloud data set. i (x i ,y i , z i ) to any other point P j (x j ,y j , z j ) is the distance L,
[0060]
[0061] According to a random point P i (x i ,y i , z i ) to the remaining points L m , calculate the distance average Q, Among them, m represents the distance number, and n is the total number of the remaining points;
[0062] According to a random point P i (x i ,y i , z i ) to the remaining points and the average distance Q, calculate the distance standard deviation S,
[0063] When the distance standard deviation S is within the set threshold range [QS×α, Q+S×α], the random point P i (x i ,y i , z i ) is retained, otherwise, the random point P i (x i ,y i , z i ) is removed from the point cloud dataset to obtain the denoised point cloud dataset, and α is the set standard deviation coefficient.
[0064] S3. Construct a plane point cloud image of the watch surface according to the two-dimensional plane coordinates of each point in the denoised point cloud dataset, and assign grayscale values to each point in the plane point cloud image according to the depth coordinates of each point in the denoised point cloud dataset to obtain a grayscale point cloud image of the watch surface.
[0065] In specific implementation, the detection terminal first constructs a blank image, and constructs a plane coordinate system of the blank image with a certain point on the blank image as the origin. Then, based on the plane coordinate system of the blank image and the two-dimensional plane coordinates (x, y) of each point in the denoised point cloud data set, each point is marked on the blank image to obtain a plane point cloud image of the watch surface. Next, the depth D of each point is determined based on the depth coordinate z of each point in the denoised point cloud data set. k , k represents the number of the corresponding points, and according to the depth D of each point k Determine the maximum depth Z max and the minimum depth Z min Finally, the maximum depth Z max , minimum depth Z min And the depth D of each point k Substitute the coordinates into the grayscale assignment formula H k =255×(D k -Z min ) / (Z max -Z min ) to calculate the gray value H of each point k , based on the gray value H of each point k Get the grayscale point cloud image of the watch surface.
[0066] S4. Perform adaptive median filtering on each point in the grayscale point cloud image according to the two-dimensional plane coordinates and grayscale value of each point to obtain a filtered grayscale point cloud image.
[0067] In specific implementation, the detection terminal takes each point as the center point, selects several points with the closest plane distance in the neighborhood of the center point as the neighborhood points of the center point according to the two-dimensional plane coordinates of each point, and then calculates the standard deviation of the grayscale value of the center point and all its neighborhood points according to the grayscale value of each point:
[0068] When the gray value standard deviation is greater than the standard deviation threshold, the number of neighboring points of the center point is reduced by the set reduction amount, and the gray value standard deviation is recalculated until the number of neighboring points of the center point is reduced to the set lower limit, and the median gray value of the center point and all its neighboring points is determined at this time, and the median gray value is used as the gray value of the center point;
[0069] When the gray value standard deviation is less than or equal to the standard deviation threshold, the median gray value of the center point and all its neighboring points is determined, and the median gray value is used as the gray value of the center point.
[0070] After the grayscale value of each point after filtering is obtained through adaptive median filtering, a filtered grayscale point cloud image is obtained based on the grayscale value of each point after filtering.
[0071] S5. Perform threshold segmentation and binarization processing on each point in the filtered grayscale point cloud image to obtain a binary point cloud image.
[0072] In specific implementation, the detection terminal uses the Otsu method to calculate the grayscale threshold of all points in the filtered grayscale point cloud image. Then, points with grayscale values greater than the grayscale threshold are segmented into the first type of points, and points with grayscale values less than or equal to the grayscale threshold are segmented into the second type of points. The grayscale values of the first type of points are transformed into the first grayscale value, and the grayscale values of the second type of points are transformed into the second grayscale value to obtain a binary point cloud image. The first grayscale value and the second grayscale value can be set to different grayscale values within the range of (0, 255) so that they can be distinguished by the naked eye when displayed.
[0073] S6. Input the binary point cloud image into a preset defect detection network model to perform defect detection and obtain corresponding defect detection results.
[0074] In specific implementation, the detection terminal can pre-build a ResNet network model, and use a training set to train the ResNet network model to obtain a trained defect detection network model, wherein the training set includes a number of negative samples of binary point cloud images annotated with defect labels and a number of positive samples of binary point cloud images annotated with non-defect labels. Then, after obtaining a binary point cloud image in the aforementioned step, the binary point cloud image is input into the defect detection network model for binary classification defect detection to obtain a corresponding defect detection result, which includes a defect label or a non-defect label.
[0075] S7. When it is determined that there are defects on the watch surface according to the defect detection result, the binary point cloud image is marked with a defect mark and then output.
[0076] In specific implementation, when the detection terminal determines that there are defects on the surface of the watch based on the defect detection results, the defect mark is marked on the binary point cloud image, and then output and display it so that the quality inspectors can intuitively see the defect detection results and conduct targeted verification.
[0077] The method of this embodiment replaces the traditional manual detection method with the corresponding lidar point cloud image processing and analysis process, which can realize fast and intelligent detection of production defects on the watch surface, so as to detect production defects on the watch surface more accurately and reliably, and can effectively improve the detection efficiency and stability of watch surface defects, assist quality inspectors to realize fast detection of watches before leaving the factory, and save manpower.
[0078] Embodiment 2:
[0079] This embodiment provides a watch surface production defect detection system, such as Figure 2 As shown, it includes a point cloud acquisition unit, a point cloud denoising unit, an image construction unit, an image filtering unit, a binary segmentation unit, a defect detection unit and a defect marking unit, wherein:
[0080] A point cloud acquisition unit, used to acquire a point cloud data set obtained after laser detection of the watch surface by a laser radar, wherein the point cloud data set includes point cloud data of a plurality of points, wherein the point cloud data includes three-dimensional coordinates of corresponding points, and the three-dimensional coordinates include two-dimensional plane coordinates and depth coordinates;
[0081] A point cloud denoising unit is used to perform outlier filtering on the point cloud data set based on the three-dimensional coordinates of each point in the point cloud data set to obtain a denoised point cloud data set;
[0082] An image construction unit, used to construct a plane point cloud image of the watch surface according to the two-dimensional plane coordinates of each point in the denoised point cloud data set, and to assign grayscale values to each point in the plane point cloud image according to the depth coordinates of each point in the denoised point cloud data set, so as to obtain a grayscale point cloud image of the watch surface;
[0083] An image filtering unit, used for performing adaptive median filtering on each point in the grayscale point cloud image according to the two-dimensional plane coordinates and grayscale values of each point to obtain a filtered grayscale point cloud image;
[0084] A binary segmentation unit is used to perform threshold segmentation and binarization processing on each point in the filtered grayscale point cloud image to obtain a binary point cloud image;
[0085] A defect detection unit is used to input the binary point cloud image into a preset defect detection network model to perform defect detection and obtain corresponding defect detection results;
[0086] The defect marking unit is used to mark the binary point cloud image with a defect mark and then output it when it is determined that there are defects on the watch surface according to the defect detection result.
[0087] Embodiment 3:
[0088] This embodiment provides a watch surface production defect detection device, such as Figure 3 As shown, at the hardware level, it includes:
[0089] Data interface, used to establish data connection between the processor and the lidar;
[0090] A memory for storing instructions;
[0091] The processor is used to read the instructions stored in the memory and execute the watch surface production defect detection method in Example 1 according to the instructions.
[0092] Optionally, the device further includes an internal bus, through which the processor, the memory and the data interface can be interconnected, and the internal bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc.
[0093] The memory may include, but is not limited to, random access memory (RAM), read only memory (ROM), flash memory, first input first output (FIFO) and / or first in last out (FILO) memory, etc. The processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0094] Embodiment 4:
[0095] This embodiment provides a computer-readable storage medium, on which instructions are stored, and when the instructions are executed on a computer, the computer executes the watch surface production defect detection method in Embodiment 1. The computer-readable storage medium refers to a carrier for storing data, which may include but is not limited to a floppy disk, an optical disk, a hard disk, a flash memory, a USB flash drive, and / or a memory stick, etc., and the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
[0096] This embodiment also provides a computer program product, which, when running on a computer, executes the watch surface production defect detection method in Embodiment 1. The computer may be a general-purpose computer, a special-purpose computer, a computer network or other programmable device.
[0097] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for detecting production defects on a watch surface, characterized in that: include: Acquire a point cloud data set obtained after laser detection of the watch surface by a laser radar, wherein the point cloud data set includes point cloud data of a plurality of points, wherein the point cloud data includes three-dimensional coordinates of corresponding points, and the three-dimensional coordinates include two-dimensional plane coordinates and depth coordinates; Based on the three-dimensional coordinates of each point in the point cloud data set, the point cloud data set is filtered for outliers to obtain a denoised point cloud data set, including: Based on the three-dimensional coordinates of each point in the point cloud dataset, traverse and calculate a random point P i (x i ,y i , z i ) to any other point P j (x j ,y j , z j ) is the distance L, According to a random point P i (x i ,y i , z i ) to the remaining points L m , calculate the distance average Q, Among them, m represents the distance number, and n is the total number of the remaining points; According to a random point P i (x i ,y i , z i ) to the remaining points and the average distance Q, calculate the distance standard deviation S, When the distance standard deviation S is within the set threshold range [QS×α, Q+S×α], the random point P i (x i ,y i , z i ) is retained, otherwise, the random point P i (x i ,y i , z i ) is removed from the point cloud dataset, and α is the set standard deviation coefficient; A plane point cloud image of the watch surface is constructed according to the two-dimensional plane coordinates of each point in the denoised point cloud data set, and a grayscale value is assigned to each point in the plane point cloud image according to the depth coordinates of each point in the denoised point cloud data set to obtain a grayscale point cloud image of the watch surface; Performing adaptive median filtering on each point in the grayscale point cloud image according to the two-dimensional plane coordinates and grayscale values of each point to obtain a filtered grayscale point cloud image; Perform threshold segmentation and binarization processing on each point in the filtered grayscale point cloud image to obtain a binary point cloud image; Input the binary point cloud image into a preset defect detection network model to perform defect detection and obtain the corresponding defect detection result; When it is determined that there are defects on the watch surface based on the defect detection results, the binary point cloud image is annotated with defect marks and then output.
2. A watch surface production defect detection method according to claim 1, characterized in that: The step of constructing a plane point cloud image of the watch surface according to the two-dimensional plane coordinates of each point in the denoised point cloud data set includes: Construct a blank image, and construct a plane coordinate system of the blank image with a certain point on the blank image as the origin; According to the plane coordinate system of the blank image and the two-dimensional plane coordinates of each point in the denoised point cloud data set, each point is marked on the blank image to obtain a plane point cloud image of the watch surface.
3. A watch surface production defect detection method according to claim 1, characterized in that: The grayscale assignment of each point in the plane point cloud image according to the depth coordinates of each point in the denoised point cloud data set includes: According to the depth coordinates of each point in the denoised point cloud data set, the depth D of each point is determined k , k represents the number of the corresponding points, and according to the depth D of each point k Determine the maximum depth Z max and the minimum depth Z min ; Set the maximum depth Z max , minimum depth Z min And the depth D of each point k Substitute the coordinates into the grayscale assignment formula H k =255×(D k -Z min ) / (Z max -Z min ) to calculate the gray value H of each point k .
4. A watch surface production defect detection method according to claim 1, characterized in that: The step of performing adaptive median filtering on each point in the grayscale point cloud image according to the two-dimensional plane coordinates and grayscale values of each point includes: Each point is taken as the center point, and several points with the closest plane distance in the neighborhood of the center point are selected as the neighborhood points of the center point according to the two-dimensional plane coordinates of each point; Calculate the standard deviation of the grayscale values of the center point and all its neighboring points based on the grayscale values of each point; When the gray value standard deviation is greater than the standard deviation threshold, the number of neighboring points of the center point is reduced by the set reduction amount, and the gray value standard deviation is recalculated until the number of neighboring points of the center point is reduced to the set lower limit, and the median gray value of the center point and all its neighboring points is determined at this time, and the median gray value is used as the gray value of the center point; When the gray value standard deviation is less than or equal to the standard deviation threshold, the median gray value of the center point and all its neighboring points is determined, and the median gray value is used as the gray value of the center point.
5. A method for detecting production defects on a watch surface according to claim 1, characterized in that: The step of performing threshold segmentation and binarization on each point in the filtered grayscale point cloud image to obtain a binary point cloud image includes: The grayscale threshold of all points in the filtered grayscale point cloud image is calculated using the Otsu method; Points with grayscale values greater than the grayscale threshold are segmented into the first type of points, and points with grayscale values less than or equal to the grayscale threshold are segmented into the second type of points. The grayscale values of the first type of points are transformed into the first grayscale values, and the grayscale values of the second type of points are transformed into the second grayscale values to obtain a binary point cloud image.
6. A method for detecting production defects on a watch surface according to claim 1, characterized in that: Before inputting the binary point cloud image into a preset defect detection network model for defect detection, the method further includes: A ResNet network model is constructed, and a training set is used to train the ResNet network model to obtain a trained defect detection network model, wherein the training set includes a number of negative samples of binary point cloud images marked with defect labels and a number of positive samples of binary point cloud images marked with non-defect labels.
7. A watch surface production defect detection system, characterized in that: It includes a point cloud acquisition unit, a point cloud denoising unit, an image construction unit, an image filtering unit, a binary segmentation unit, a defect detection unit and a defect marking unit, wherein: A point cloud acquisition unit, used to acquire a point cloud data set obtained after laser detection of the watch surface by a laser radar, wherein the point cloud data set includes point cloud data of a plurality of points, wherein the point cloud data includes three-dimensional coordinates of corresponding points, and the three-dimensional coordinates include two-dimensional plane coordinates and depth coordinates; The point cloud denoising unit is used to perform outlier filtering on the point cloud data set based on the three-dimensional coordinates of each point in the point cloud data set to obtain a denoised point cloud data set, including: Based on the three-dimensional coordinates of each point in the point cloud dataset, traverse and calculate a random point P i (x i ,y i , z i ) to any other point P j (x j ,y j , z j ) is the distance L, According to a random point P i (x i ,y i , z i ) to the remaining points L m , calculate the distance average Q, Among them, m represents the distance number, and n is the total number of the remaining points; According to a random point P i (x i ,y i , z i ) to the remaining points and the average distance Q, calculate the distance standard deviation S, When the distance standard deviation S is within the set threshold range [QS×α, Q+S×α], the random point P i (x i ,y i , z i ) is retained, otherwise, the random point P i (x i ,y i , z i ) is removed from the point cloud dataset, and α is the set standard deviation coefficient; An image construction unit, used to construct a plane point cloud image of the watch surface according to the two-dimensional plane coordinates of each point in the denoised point cloud data set, and to assign grayscale values to each point in the plane point cloud image according to the depth coordinates of each point in the denoised point cloud data set, so as to obtain a grayscale point cloud image of the watch surface; An image filtering unit, used for performing adaptive median filtering on each point in the grayscale point cloud image according to the two-dimensional plane coordinates and grayscale values of each point to obtain a filtered grayscale point cloud image; A binary segmentation unit is used to perform threshold segmentation and binarization processing on each point in the filtered grayscale point cloud image to obtain a binary point cloud image; A defect detection unit is used to input the binary point cloud image into a preset defect detection network model to perform defect detection and obtain corresponding defect detection results; The defect marking unit is used to mark the binary point cloud image with a defect mark and then output it when it is determined that there are defects on the watch surface according to the defect detection result.
8. A watch surface production defect detection device, characterized in that: include: A memory for storing instructions; A processor is used to read the instructions stored in the memory and execute the watch surface production defect detection method described in any one of claims 1-6 according to the instructions.
9. A computer program product, characterized in that When the computer program product is run on a computer, the watch surface production defect detection method described in any one of claims 1 to 6 is executed.
Citation Information
Patent Citations
Height histogram segmentation-based method for identifying depth defect of refractory brick
CN108596873A
3D curved surface glass surface flatness defect detection method based on linear scan laser
CN108682012A