A product image defect detection method, system, device and medium

By performing polynomial fitting and difference processing on point cloud images, the problem of slow product inspection speed was solved, and fast and accurate defect detection was achieved.

CN115526885BActive Publication Date: 2026-04-17HANGZHOU ANMAISHENG INTELLIGENT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HANGZHOU ANMAISHENG INTELLIGENT TECH CO LTD
Filing Date
2022-10-24
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing technologies suffer from slow product detection speed, long detection time, and low detection efficiency, mainly because they require comparing various product features with multiple thresholds.

Method used

By acquiring point cloud images from image acquisition devices, the point cloud contour lines are fitted using a polynomial fitting method, and differential processing is performed. Based on the differential processing results, it is determined whether the product contains defects.

Benefits of technology

It improves the speed of product testing, reduces testing time, increases testing efficiency, and avoids comparing various product features with multiple thresholds.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115526885B_ABST
    Figure CN115526885B_ABST
Patent Text Reader

Abstract

The application discloses a product image defect detection method, system, device and medium, mainly applied to the product detection field, and the method comprises the steps of obtaining a point cloud image corresponding to a product to be detected, obtaining a point cloud contour line according to point cloud information corresponding to the point cloud image, fitting the point cloud contour line according to a polynomial fitting mode to obtain a corresponding fitting contour line, performing differential processing on the two contour lines, and judging whether the product contains defects according to the differential processing result. Through the above method, whether the product contains defects can be reflected by a differential processing result, comparison of features of the product with various thresholds set respectively is avoided, the product detection speed is effectively improved, the product detection time is reduced, and the detection efficiency is improved. The product image defect detection system, device and medium provided by the application correspond to the above method and have the same beneficial effects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of product testing, and in particular to a method, system, apparatus and medium for detecting defects in product images. Background Technology

[0002] In many product manufacturing and application fields, quality inspection is required to check for defects and ensure the product is up to standard. Currently, defect detection is generally achieved through computer image processing technology. This technology determines whether a product is defective by analyzing the shape and surface of an image for any abnormalities.

[0003] The above-mentioned method for product image inspection specifically extracts features such as shape or surface color from the image and compares these features with multiple set thresholds to determine whether the product is qualified. However, by comparing the feature values ​​corresponding to each feature of the product with multiple thresholds set by the inspector, the product inspection speed is slow, the inspection time is long, and the inspection efficiency is low.

[0004] Therefore, how to design a method that can improve the speed and efficiency of product quality testing is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] The purpose of this application is to provide a product image defect detection method, system, device, and medium to solve the problem that when inspecting a product, it is necessary to compare the values ​​corresponding to various features of the product with multiple set thresholds, which leads to slow product detection speed, long detection time, and low detection efficiency.

[0006] To address the aforementioned technical problems, this application provides a product image defect detection method, comprising:

[0007] Acquire point cloud images of the product to be inspected from image acquisition equipment;

[0008] Obtain the point cloud outline corresponding to the point cloud image based on the point cloud information corresponding to the point cloud image;

[0009] The fitted contour line is obtained by fitting the point cloud contour line using a polynomial fitting method.

[0010] The fitted contour line and the point cloud contour line are subjected to difference processing;

[0011] The results of differential processing are used to determine whether the product contains defects.

[0012] Preferably, the fitted contour line is obtained by fitting the point cloud contour line using a polynomial fitting method, including:

[0013] Obtain the point cloud height data corresponding to both ends of the point cloud outline;

[0014] The fitted straight line is obtained by using point cloud height data and a first-order polynomial fitting formula.

[0015] The point cloud contour line and the fitted straight line are differentially processed, and the effective data is obtained by the relationship between the differential value after differential processing and the preset threshold.

[0016] The fitted contour line is obtained by using effective data and a quadratic polynomial fitting formula.

[0017] Preferably, the point cloud height data consists of two sets: a first point cloud height data set and a second point cloud height data set. Obtaining the point cloud height data corresponding to both ends of the point cloud contour line includes:

[0018] Differentiate the point cloud contour and obtain the coordinates of the point with the largest derivative value in the result;

[0019] The point cloud outline is divided into a front part and a back part based on the coordinate points;

[0020] Obtain the first preset number of point cloud height data from the previous part;

[0021] Obtain the second preset number of second point cloud height data from the latter part.

[0022] Preferably, there are two fitted lines, namely a first fitted line and a second fitted line; the point cloud contour line and the fitted lines are subtracted, and valid data is obtained by comparing the subtracted value with a preset threshold, including:

[0023] Perform difference processing on the point cloud contour line and the first fitted straight line, and obtain the first coordinate of the first point whose difference value is greater than a preset threshold after difference processing;

[0024] Perform difference processing on the point cloud contour line and the second fitted straight line, and obtain the second coordinate of the first point whose difference value is greater than a preset threshold after difference processing;

[0025] The coordinates of the first and second coordinates, as well as the coordinates of each point between the first and second coordinates on the point cloud outline, are taken as valid data.

[0026] Preferably, determining whether a product contains defects based on the results of differential processing includes:

[0027] Obtain the difference values ​​from the difference processing results and calculate the mean difference value corresponding to each difference value;

[0028] Determine whether the mean difference is greater than the difference threshold;

[0029] If the value is greater than 1, then the product is determined to be defective.

[0030] If the value is not greater than the specified value, then the product is determined to be free of defects.

[0031] Preferably, obtaining the point cloud contour line corresponding to the point cloud image based on the point cloud information corresponding to the point cloud image includes:

[0032] Obtain a straight line perpendicular to the point cloud image;

[0033] Obtain the point cloud information of each point on the point cloud image corresponding to the straight line;

[0034] Obtain the point cloud outline based on the point cloud information.

[0035] Preferably, after acquiring the point cloud image of the product captured by the image acquisition device, and before acquiring the point cloud contour line corresponding to the point cloud image based on the point cloud information corresponding to the point cloud image, the process further includes:

[0036] The point cloud image is preprocessed to obtain an effective point cloud image; the preprocessing includes image enhancement and / or Gaussian filtering.

[0037] Based on the point cloud information corresponding to the point cloud image, the point cloud contour line corresponding to the point cloud image is obtained, including:

[0038] Based on the point cloud information corresponding to the valid point cloud image, obtain the point cloud contour line corresponding to the point cloud image.

[0039] To address the aforementioned technical problems, this application also provides a product image defect detection system, comprising:

[0040] The first acquisition module is used to acquire point cloud images of the product to be inspected, which are acquired by the image acquisition device.

[0041] The second acquisition module is used to acquire the point cloud outline corresponding to the point cloud image based on the point cloud information corresponding to the point cloud image.

[0042] The fitting module is used to fit the point cloud contour line using a polynomial fitting method to obtain the fitted contour line.

[0043] The processing module is used to perform difference processing between the fitted contour line and the point cloud contour line;

[0044] The discrimination module is used to determine whether a product contains defects based on the results of differential processing.

[0045] To address the aforementioned technical problems, this application also provides a product image defect detection device, including a memory for storing computer programs;

[0046] A processor is used to execute computer programs to implement the steps of the product image defect detection method described above.

[0047] To address the aforementioned technical problems, this application also provides a computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, it implements the steps of the product image defect detection method described above.

[0048] The product image defect detection method provided in this application includes: acquiring a point cloud image corresponding to the product to be detected; obtaining a point cloud contour line based on the point cloud information corresponding to the point cloud image; fitting the point cloud contour line using a polynomial fitting method to obtain a corresponding fitted contour line; performing differential processing on the two contour lines; and determining whether the product contains defects based on the result of the differential processing. This method can determine whether the product contains defects based solely on the result of a single differential processing step, avoiding comparisons between various product features and separately set thresholds, effectively improving the speed of product detection, reducing detection time, and increasing detection efficiency.

[0049] This application also provides a product image defect detection system, device, and medium, which corresponds to the above-mentioned product image defect detection method and therefore has the same beneficial effects. Attached Figure Description

[0050] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0051] Figure 1 A flowchart illustrating a product image defect detection method provided in this application embodiment;

[0052] Figure 2 A line graph perpendicular to a point cloud image is provided as an embodiment of this application;

[0053] Figure 3 A point cloud contour map provided in an embodiment of this application;

[0054] Figure 4 A schematic diagram of the first derivative of a point cloud contour line provided in an embodiment of this application;

[0055] Figure 5 This application provides a schematic diagram of obtaining point cloud height data from both ends of a point cloud outline.

[0056] Figure 6 A schematic diagram of two fitted lines provided for embodiments of this application;

[0057] Figure 7This is a schematic diagram illustrating the acquisition of effective data by fitting a straight line, as provided in an embodiment of this application.

[0058] Figure 8 A schematic diagram of a point cloud contour and a fitted contour of a product without defects, provided for an embodiment of this application.

[0059] Figure 9 A schematic diagram of a point cloud contour and a fitted contour of a defective product provided in an embodiment of this application;

[0060] Figure 10 A structural diagram of a product image defect detection system provided in an embodiment of this application;

[0061] Figure 11 This is a structural diagram of a product image defect detection device provided in an embodiment of this application. Detailed Implementation

[0062] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0063] The core of this application is to provide a method, system, device, and medium for detecting defects in product images.

[0064] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0065] This embodiment provides a product defect detection method, primarily applied in image acquisition equipment in industrial or manufacturing sectors. This method analyzes and processes images of different products to determine whether they contain defects. The image acquisition equipment used in this method can be a camera, such as a 3D camera, for capturing images. The camera includes a memory for storing data and results generated during processor processing; and a processor for performing relevant processing on the acquired images and determining whether the product contains defects. The model of the memory and processor is not limited; for example... Figure 1 As shown, the method includes the following steps:

[0066] S10: Acquire point cloud images of the product to be inspected from the image acquisition device.

[0067] The image acquisition device can be a camera, such as a 3D camera, which is generally used to acquire images of products produced in industrial or manufacturing processes. The product to be inspected is not specifically limited to any particular type; it is selected based on the user's needs. In this embodiment, the image acquired by the image acquisition device needs to be a point cloud image. A point cloud image refers to an image in which the coordinates of each point include not only the geometric coordinates of each point but also, possibly, the color information or reflection intensity information of the image at that coordinate. The reflection intensity information is used to reflect information such as the surface material and roughness of the product being acquired. The image acquisition device can be manually operated by the user to acquire images of the product, or the user can set the acquisition frequency of the image acquisition device to acquire product images periodically; the specific method is not limited here.

[0068] S11: Obtain the point cloud outline corresponding to the point cloud image based on the point cloud information corresponding to the point cloud image.

[0069] like Figure 2 and Figure 3 As shown, after obtaining the point cloud image, based on the point cloud information corresponding to each point in the point cloud image, this point cloud information includes the aforementioned position information and color information; the point cloud outline is generally a straight line passing through the point cloud image perpendicular to it, such as... Figure 2 The white line shown represents the height array formed by the height values ​​of each point in the point cloud image. This height array forms the point cloud outline. By processing this point cloud outline, it is possible to determine whether the product contains defects.

[0070] S12: The point cloud contour is fitted using a polynomial fitting method to obtain the fitted contour.

[0071] Polynomial fitting refers to fitting all observation points in a small region containing several analysis points using a polynomial expansion to obtain an objective analytical field of the observation data. Example: nth-degree polynomial formula:

[0072]

[0073] Among them are a0 to a n There are n+1 unknown fitting coefficients, which are determined by least squares fitting. Substituting the x-coordinates of the data in the point cloud contour into the above formula, the predicted y-coordinate corresponding to each x-coordinate is determined. The specific formula is as follows:

[0074]

[0075] For a certain point (x) i y i Using the above formula, we can calculate x. iCorresponding predicted ordinate Then use the sum of squares of the residuals to represent all and the actual ordinate y in the sample points i The difference ε, where m is the total number of data points, is given by the following formula:

[0076]

[0077] Furthermore, in this embodiment, the specific type of the nth-degree polynomial formula is not limited; as long as it can fit a fitted contour line based on the points on the point cloud contour line, the fitted contour line will differ from the actual point cloud contour line, that is, the difference between the points calculated in the above formula and the sample points. The difference between the fitted contour line and the point cloud contour line will be used to determine whether the product contains defects.

[0078] S13: Perform difference processing on the fitted contour line and the point cloud contour line.

[0079] The difference between the fitted contour line and the point cloud contour line is determined by performing a difference processing on the two contour lines. This difference processing involves subtracting the corresponding points between the two contour lines to obtain the difference value between each point. An average difference value can be obtained by averaging the differences of each point. The magnitude of the average difference value is used to determine whether the product contains defects. Alternatively, the difference values ​​of each point can be compared. If the difference values ​​of a preset number of points do not meet the requirements, the product is determined to contain defects.

[0080] S14: Determine whether the product contains defects based on the results of differential processing.

[0081] The result of the differential processing in this step, as described in the previous step, may be the result of comparing the mean difference value corresponding to the difference value of each point with a preset threshold, or it may be the result of whether there is a preset number of points whose difference value does not meet the requirements. If the mean difference value is less than the preset threshold or the number of points whose difference value does not meet the requirements is not greater than the preset number, then the product is not defective and can be used in compliance with the requirements; if the mean difference value is greater than the preset threshold or the number of points whose difference value does not meet the requirements is greater than the preset number, then the product is defective.

[0082] The product defect detection method provided in the above embodiments can reflect whether the product contains defects through a single differential processing result, avoiding comparison of various product features with separately set thresholds, effectively improving the speed of product detection, reducing product detection time, and improving detection efficiency.

[0083] The above embodiments do not specify how to obtain the fitted contour line through polynomial fitting and point cloud contour lines. As a preferred embodiment, this embodiment specifies that the fitted contour line is obtained by fitting the point cloud contour line through polynomial fitting, including: obtaining the point cloud height data corresponding to both ends of the point cloud contour line; obtaining the fitted straight line by using the point cloud height data and a first-order polynomial fitting formula; performing difference processing on the point cloud contour line and the fitted straight line, and obtaining effective data by using the relationship between the difference value after difference processing and a preset threshold; and obtaining the fitted contour line by using the effective data and a second-order polynomial fitting formula.

[0084] First, obtain the point cloud height data corresponding to the point cloud contour line. Then, obtain the fitted line by fitting this data with a first-order polynomial fitting formula, where the first-order polynomial fitting formula is:

[0085]

[0086] In the above embodiment, n is set to 1 in the nth-degree polynomial fitting formula, thereby transforming the data into a fitted straight line using the formula. The points corresponding to the fitted straight line and the point cloud contour line are then subjected to difference processing. By comparing the obtained difference value with a preset threshold, the coordinates of points that meet the requirements are obtained. These coordinates are set as valid data. The fitted contour line is then obtained using the valid data and the quadratic polynomial fitting formula, where the quadratic polynomial fitting formula is:

[0087]

[0088] By setting n to 2 in the nth-degree polynomial fitting formula in the above embodiment, the effective data can be transformed into a parabola, i.e., a fitted contour line; where in the above formula... x corresponds to the x-coordinate of a specific sample point and its corresponding predicted y-coordinate, which corresponds to the n-polynomial fitting formula in the above embodiment.

[0089] This embodiment specifies how to obtain the fitted contour line through polynomial fitting and data on the point cloud contour line, which is simpler and more convenient than other methods.

[0090] Based on the above embodiments, this embodiment limits the acquisition of point cloud height arrays to two sets, namely, first point cloud height data and second point cloud height data; and limits the acquisition of point cloud height data corresponding to both ends of the point cloud contour line to include: taking the derivative of the point cloud contour line and obtaining the coordinate point with the largest derivative value in the derivative result; dividing the point cloud contour line into a front part and a back part according to the coordinate point; obtaining a first preset number of first point cloud height data from the front part; and obtaining a second preset number of second point cloud height data from the back part.

[0091] In the above steps, the coordinates of the point cloud contour line with the largest derivative value are first obtained by taking the derivative of the contour line. These coordinates are generally located at the intersection of the line perpendicular to the point cloud image and the contour line, as mentioned in the previous embodiment, where the abrupt change is greatest. The contour line is then divided into two parts, a first part and a second part, using this point. A first preset number of data points are selected from the first part as the first point cloud height data, and a second preset number of data points are selected from the second part as the second point cloud height data. For example: Figure 4 and Figure 5 As shown, if the maximum coordinate point obtained is num1 and the length of the point cloud contour line is len, then the first preset number of data from 0 to num1-1 is extracted from the front end of the point cloud contour line as the first point cloud height data, and the second preset number of data from len-num2-1 to len-1 is extracted from the back end of the point cloud contour line as the second point cloud height data, where num2 is the data length, and the first preset number and the second preset number can be equal.

[0092] This embodiment provides a method for extracting data from both ends of a point cloud contour line as point cloud height data, making the obtained point cloud height data more accurate and convenient.

[0093] Based on the above embodiments, such as Figure 6 and Figure 7 As shown, there are two corresponding fitted lines and sets of point cloud height data, namely the first fitted line 30 and the second fitted line 31. The point cloud contour line and the fitted lines are subjected to differential processing. Valid data is obtained by comparing the differential value with a preset threshold. This includes: performing differential processing on the point cloud contour line and the first fitted line 30 to obtain the first coordinate 40 of the first point whose differential value is greater than the preset threshold; performing differential processing on the point cloud contour line and the second fitted line 31 to obtain the second coordinate 41 of the first point whose differential value is greater than the preset threshold; and using the coordinates of the first and second coordinates on the point cloud contour line, as well as the coordinates of all points between the first and second coordinates, as valid data.

[0094] By performing a difference operation on the first fitted line 30 and the second fitted line 31, the coordinates of the first point in the first fitted line 30 with a difference value greater than a preset threshold are obtained, as are the coordinates of the first point in the second fitted line 31 with a difference value greater than the preset threshold. Using these two points as the starting and ending points, all points between them are obtained as valid data. This valid data is used to obtain the fitted contour line using a quadratic polynomial fitting formula. The first and second fitted lines 30 are primarily used to select the starting and ending coordinates of the valid data based on the magnitude of the difference value and the preset threshold.

[0095] This embodiment enables the acquisition of more accurate effective data, thereby making the fitted contour line obtained through the effective data more accurate, and thus making the product detection more accurate.

[0096] Based on the above embodiments, the step of determining whether the product contains defects based on the result of the differential processing is further defined. This step includes: obtaining the differential value in the result of the differential processing, calculating the absolute value of the difference corresponding to the differential value, and then calculating the mean to obtain the mean difference; determining whether the mean difference is greater than the differential threshold; if it is greater, then the product is determined to contain defects; if it is not greater, then the product is determined not to contain defects.

[0097] In the above embodiment, the method of obtaining each difference value in the difference processing result, calculating the absolute value of the difference, and then calculating the mean difference based on the absolute value of the difference, is used to compare the mean difference with a difference threshold. If the mean difference is greater than the difference threshold, the product is considered defective; if the mean difference is not greater than the difference threshold, the product is considered defective. However, if each difference value is compared with a separately set threshold, and the product is judged based on the number of non-conforming difference values, the number of comparisons required is too large, and the time required is too long. Therefore, this embodiment uses the method of calculating the mean difference to save time. Example: Figure 8 and Figure 9 Example diagrams of fitted contour lines and point cloud contour lines for a product without defects are provided, as well as example diagrams of fitted contour lines and point cloud contour lines for a product with defects. It can be seen that the fitted contour line 51 for a product without defects has a good fit with the point cloud contour line 50, while the fitted contour line 52 for a product with defects has a poor fit with the point cloud contour line 50.

[0098] For example, if the difference mean of a product is 80, a value greater than 80 indicates the product is defective, while a value not greater than 80 indicates the product is not defective. Table 1 shows the difference mean for a product with defects and the difference mean for a product without defects.

[0099] Table 1

[0100] Product Type Defective products No defective products Difference Mean 121 32

[0101] This embodiment defines a method that calculates the mean difference value corresponding to the difference value. Only the mean difference value needs to be compared with the difference threshold once to determine whether the product contains defects. This avoids comparisons with multiple thresholds as in other methods, thus improving the product detection efficiency.

[0102] Based on the above embodiments, the method for obtaining the point cloud contour line is defined. Obtaining the point cloud contour line corresponding to the point cloud image according to the point cloud information corresponding to the point cloud image includes: obtaining a straight line perpendicular to the point cloud image; obtaining the point cloud information of each point on the point cloud image corresponding to the straight line; and obtaining the point cloud contour line according to the point cloud information.

[0103] Where the straight line perpendicular to the point cloud image is as follows: Figure 2 As shown, corresponding to the white line in the figure, the height value information of the points where the straight line intersects with the point cloud image is obtained, and these height values ​​are combined into a height array to obtain the point cloud outline.

[0104] The method for obtaining point cloud contour lines provided in this embodiment makes the obtained point cloud contour lines more accurate.

[0105] The above embodiments do not process the acquired point cloud images. As a preferred embodiment, this embodiment limits the process to include, before obtaining the point cloud contour line corresponding to the point cloud image based on the point cloud information corresponding to the point cloud image, the following steps are included: preprocessing the point cloud image to obtain a valid point cloud image; wherein the preprocessing is image enhancement and / or Gaussian filtering; obtaining the point cloud contour line corresponding to the point cloud image based on the point cloud information corresponding to the point cloud image includes: obtaining the point cloud contour line corresponding to the point cloud image based on the point cloud information corresponding to the valid point cloud image.

[0106] When using image acquisition devices such as cameras, the captured images are subject to a lot of external interference, resulting in blurry point cloud images that affect the judgment of whether a product contains defects. Therefore, preprocessing is performed on the acquired point cloud images. In addition to the image enhancement and Gaussian filtering processes mentioned above, this preprocessing can also include other processes, such as median filtering. The image enhancement process mentioned in this embodiment calculates the average value of pixels in a window area and sets the obtained average value as the pixel value of the anchor point, which is highly efficient and simple to operate. Gaussian filtering uses the distribution of a two-dimensional Gaussian function to smooth the image, ensuring the characteristics of the image's feature points and edges. Through preprocessing, the influence of noise and other factors on the acquired point cloud images is effectively reduced, thus effectively improving the accuracy of the point cloud images.

[0107] This embodiment limits the acquisition of point cloud images to preprocessing to make the acquired point cloud images more accurate, thereby making the judgment on whether the product contains defects more accurate.

[0108] The product image defect detection method has been described in detail in the above embodiments. This application also provides embodiments corresponding to the product image defect detection device. It should be noted that this application describes the embodiments of the device part from two perspectives: one is based on the functional module, and the other is based on the hardware.

[0109] From the perspective of functional modules, such as Figure 10 As shown, this application also provides an embodiment of a product image defect detection system; this embodiment defines the system as including:

[0110] The first acquisition module 60 is used to acquire point cloud images of the product to be inspected, which are acquired by the image acquisition device.

[0111] The second acquisition module 61 is used to acquire the point cloud outline corresponding to the point cloud image based on the point cloud information corresponding to the point cloud image.

[0112] The fitting module 62 is used to fit the point cloud contour line using a polynomial fitting method to obtain the fitted contour line.

[0113] Processing module 63 is used to perform difference processing on the fitted contour line and the point cloud contour line;

[0114] The discrimination module 64 is used to determine whether the product contains defects based on the result of differential processing.

[0115] Since the embodiments of the system part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the system part, and they will not be repeated here.

[0116] The product image defect detection system provided in this embodiment corresponds to the method described above, and therefore has the same beneficial effects as the method described above.

[0117] From a hardware perspective, this embodiment provides a product image defect detection device. Figure 11 A structural diagram of a product image defect detection device provided in another embodiment of this application is shown below. Figure 11 As shown, the product image defect detection device includes: a memory 20 for storing computer programs;

[0118] The processor 21 is used to execute a computer program to implement the steps of the product image defect detection method mentioned in the above embodiments.

[0119] The product image defect detection device provided in this embodiment may include, but is not limited to, smartphones, tablets, laptops, or desktop computers.

[0120] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one of the following hardware forms: Digital Signal Processor (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an Artificial Intelligence (AI) processor, which is used to handle computational operations related to machine learning.

[0121] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 20 is used to store at least the following computer program 201, which, after being loaded and executed by the processor 21, is capable of implementing the relevant steps of the product image defect detection method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, and the storage method may be temporary or permanent storage. The operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, the data included in the product image defect detection method.

[0122] In some embodiments, the product image defect detection device may further include a display screen 22, an input / output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.

[0123] Those skilled in the art will understand that Figure 11 The structure shown does not constitute a limitation on the product image defect detection device and may include more or fewer components than shown.

[0124] The product image defect detection device provided in this application includes a memory and a processor. When the processor executes the program stored in the memory, it can implement the following method: product image defect detection method.

[0125] The product image defect detection device provided in this embodiment corresponds to the above method, and therefore has the same beneficial effects as the above method.

[0126] Finally, this application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps described in the above method embodiments.

[0127] It is understood that if the methods in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0128] The computer-readable storage medium provided in this embodiment corresponds to the method described above, and therefore has the same beneficial effects as the method described above.

[0129] The product image defect detection method, system, apparatus, and medium provided in this application have been described in detail above. The various embodiments in the specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section. It should be noted that those skilled in the art can make several improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of the claims of this application.

[0130] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

Claims

1. A product image defect detection method, characterized by, include: Acquire a point cloud image of the product to be inspected by an image acquisition device, wherein the point cloud image includes the geometric coordinates of each point and the color information or reflection intensity information corresponding to the geometric coordinates; Obtain the point cloud outline corresponding to the point cloud image based on the point cloud information corresponding to the point cloud image; The fitted contour line is obtained by fitting the point cloud contour line using a polynomial fitting method. The fitted contour line and the point cloud contour line are subjected to difference processing; The product is determined to be defective based on the result of the differential processing. The step of fitting the point cloud contour line using a polynomial fitting method to obtain the fitted contour line includes: The derivative of the point cloud contour is calculated, and the coordinates of the point with the largest derivative value are obtained from the derivative results. The point cloud outline is divided into a front part and a back part according to the coordinate points, and a first preset number of first point cloud height data is obtained from the front part, and a second preset number of second point cloud height data is obtained from the back part. The first and second fitted lines are obtained by using the first point cloud height data and the second point cloud height data with a first-order polynomial fitting formula. The point cloud contour line and the first fitted straight line are subjected to difference processing to obtain the first coordinate of the first point whose difference value is greater than a preset threshold after the difference processing; The point cloud contour line and the second fitted straight line are subjected to difference processing to obtain the second coordinates of the first point whose difference value after the difference processing is greater than the preset threshold; The coordinates of the first coordinate and the second coordinate, as well as the coordinates of each point between the first coordinate and the second coordinate on the point cloud contour line, are taken as valid data. The fitted contour line is obtained by using the effective data and a quadratic polynomial fitting formula.

2. The product image defect detection method according to claim 1, characterized by, The step of determining whether the product contains defects based on the result of the differential processing includes: Obtain the difference value from the result of the difference processing, and calculate the mean difference value corresponding to the difference value; Determine whether the mean difference is greater than the difference threshold; If the value is greater than 1, then the product is determined to be defective. If the value is not greater than the value, then the product is determined to be free of defects.

3. The method of product image defect detection according to claim 1, wherein, The step of obtaining the point cloud contour line corresponding to the point cloud image based on the point cloud information corresponding to the point cloud image includes: Obtain a straight line perpendicular to the point cloud image; Obtain the point cloud information corresponding to each point on the point cloud image for the straight line; The point cloud contour line is obtained based on the point cloud information.

4. The product image defect detection method according to claim 2, characterized in that, After acquiring the point cloud image of the product captured by the image acquisition device; Before obtaining the point cloud contour line corresponding to the point cloud image based on the point cloud information corresponding to the point cloud image, the method further includes: The point cloud image is preprocessed to obtain an effective point cloud image; wherein the preprocessing is image enhancement and / or Gaussian filtering. The step of obtaining the point cloud contour line corresponding to the point cloud image based on the point cloud information corresponding to the point cloud image includes: Based on the point cloud information corresponding to the valid point cloud image, obtain the point cloud contour line corresponding to the point cloud image.

5. A product image defect detection system, characterized by, include: The first acquisition module is used to acquire a point cloud image of the product to be inspected acquired by the image acquisition device, wherein the point cloud image includes the geometric coordinates of each point and the color information or reflection intensity information corresponding to the geometric coordinates; The second acquisition module is used to acquire the point cloud outline corresponding to the point cloud image based on the point cloud information corresponding to the point cloud image. The fitting module is used to differentiate the point cloud contour line and obtain the coordinate point with the largest derivative value in the differentiation result; The point cloud contour is divided into a front part and a rear part based on the coordinate points. A first preset number of first point cloud height data is obtained from the front part, and a second preset number of second point cloud height data is obtained from the rear part. A first and second fitting lines are obtained by fitting the first and second point cloud height data with a first-order polynomial fitting formula. The point cloud contour and the first fitting line are then subjected to a difference processing to obtain the first coordinate of the first point whose difference value is greater than a preset threshold. The point cloud contour and the second fitting line are then subjected to a difference processing to obtain the second coordinate of the first point whose difference value is greater than the preset threshold. The coordinates of the first and second coordinates, as well as the coordinates between the first and second coordinates on the point cloud contour, are used as valid data. A fitted contour is obtained by fitting the valid data with a second-order polynomial fitting formula. The processing module is used to perform difference processing on the fitted contour line and the point cloud contour line; The discrimination module is used to determine whether the product contains defects based on the result of the differential processing.

6. A product image defect detection apparatus characterized by comprising: Includes memory used to store computer programs; A processor, configured to implement the steps of the product image defect detection method as described in any one of claims 1 to 4 when executing the computer program.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the product image defect detection method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Welding defect detection method based on point cloud information

    CN114240944A