Chamfer defect detection method, device and equipment and storage medium

By preprocessing, correcting and screening the chamfer detection image, calculating the actual length of the chamfer to judge the defect, the problems of poor accuracy and low efficiency of traditional detection methods are solved, and efficient and accurate chamfer defect detection is achieved.

CN119648620APending Publication Date: 2025-03-18HUBEI UNIV OF TECH
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411556010.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-04
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

Traditional chamfer detection methods have poor accuracy, poor universality, high cost and high requirements for the eyesight and energy of inspectors, resulting in low detection efficiency and many errors.

Method used

By preprocessing the image of the detection device, the chamfer contour points and pixel coordinates are determined, the deviation fit is performed, the target chamfer end points are filtered, the actual length is calculated and compared with the preset length to judge the defect.

Benefits of technology

It improves the accuracy and efficiency of chamfer detection, reduces fatigue and subjective errors of manual detection, achieves fast and accurate defect judgment, and supports the quality control of industrial production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119648620A_ABST
    Figure CN119648620A_ABST
Patent Text Reader

Abstract

The invention discloses a chamfer defect detection method, device and equipment and a storage medium, and relates to the technical field of defect detection.The method comprises the steps that an obtained to-be-detected device image is preprocessed, and chamfer contour points and chamfer contour point pixel coordinates are determined in the preprocessed image; correcting the pixel coordinates of the chamfer contour points, and fitting a chamfer edge straight line by using the corrected pixel coordinates of the chamfer contour points; according to the chamfer edge straight line, screening the corrected chamfer contour point pixel coordinates, and determining a target chamfer end point; and calculating the actual chamfer length based on the target chamfer endpoint, and comparing the actual chamfer length with the preset chamfer length to judge whether the chamfer has defects or not. According to the method, the detection requirements of chamfers of different shapes and sizes can be met by preprocessing and correcting the images, fatigue and subjective judgment errors possibly existing in traditional manual detection are avoided through automatic image processing and data analysis processes, and the detection efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of defect detection, and more specifically, to a chamfer defect detection method, device, equipment and storage medium. Background Art

[0002] Chamfering is an important process in the workpiece manufacturing process, which can reduce stress concentration and improve the durability and aesthetics of the workpiece. However, if there are defects in the chamfer, such as inaccurate angles, inconsistent dimensions or rough surfaces, the overall performance and service life of the workpiece may be affected. Through chamfer inspection, these defects can be discovered and repaired in time to ensure that the workpiece meets the design requirements, thereby improving product quality.

[0003] In the traditional measurement field, chamfer parameters are usually measured by manual machines through random sampling. Depending on the importance of the measured device, general-purpose gauges such as vernier calipers and micrometers, or special-purpose gauges such as chamfering pallets and chamfering measuring instruments can be used for measurement. In this way, appropriate test results can be obtained according to the required chamfer detection accuracy, and the chamfer defects can be further judged.

[0004] However, generally speaking, when conducting inspections using traditional measurement methods, universal inspection tools are easy to operate and have lower costs, but have poor accuracy, while special inspection tools have higher accuracy, but have poor universality and high costs. Taking the chamfer measuring instrument as an example, chamfers of different models and specifications require different types of special inspection tools for measurement, which has limitations in practical applications. At the same time, it is impossible to conduct large-scale and large-scale measurements, and it places high demands on the inspectors’ vision, attention, and energy. Long-term human eye observation has a great impact on vision, and inspecting and judging defects through long-term human eye observation is prone to missed detection and wrong detection due to factors such as fatigue and light angle. Therefore, there is an urgent need for a chamfer defect detection method suitable for industrial production. Summary of the invention

[0005] In response to at least one defect or improvement need in the prior art, the present invention provides a chamfer defect detection method, device, equipment and storage medium, which are used to solve the problem that the detection tools in the prior art cannot perform large-scale and large-volume measurements during manual inspection, and that the inspectors have high requirements on their eyesight, concentration and energy. The problem that long-term observation by the human eye to inspect and judge defects is prone to missed detection and wrong detection due to factors such as fatigue and light angle.

[0006] To achieve the above object, according to a first aspect of the present invention, a chamfer defect detection method is provided, comprising:

[0007] Preprocessing the acquired image of the device to be inspected, and determining the chamfer contour points and the pixel coordinates of the chamfer contour points in the preprocessed image;

[0008] Correcting the pixel coordinates of the chamfer contour points, and fitting the chamfer edge straight line with the corrected pixel coordinates of the chamfer contour points;

[0009] The pixel coordinates of the corrected chamfer contour points are screened according to the chamfer edge straight line to determine the target chamfer endpoint;

[0010] The actual chamfer length is calculated based on the target chamfer endpoint and compared with the preset chamfer length to determine whether there is a defect in the chamfer.

[0011] In a possible implementation, the acquired image of the device to be inspected is preprocessed, and chamfer contour points and pixel coordinates of the chamfer contour points are determined in the preprocessed image, further comprising:

[0012] The image of the device to be inspected is set to be an image of the chamfer to be inspected of a preset size with the chamfer as the center;

[0013] The chamfered image to be detected is subjected to averaging, filtering and binarization processing to obtain a binarized chamfered image;

[0014] The chamfer contour points are determined from the binary chamfered image according to a preset corner point detection algorithm, and the pixel coordinates of the chamfer contour points are recorded.

[0015] In a possible implementation, the pixel coordinates of the chamfer contour points are corrected, and the chamfer edge straight line is fitted with the corrected pixel coordinates of the chamfer contour points, further comprising:

[0016] Selecting a reference contour point from the chamfer contour points, and performing a correction process on the pixel coordinates of the chamfer contour points based on the pixel coordinates of the reference contour point;

[0017] The first center point and the second center point are respectively determined from the corrected reference contour points to obtain a first chamfer edge straight line and a second chamfer edge straight line by fitting.

[0018] In a possible implementation, a reference contour point is selected from the chamfer contour points, and the pixel coordinates of the chamfer contour points are corrected based on the pixel coordinates of the reference contour points, further comprising:

[0019] dividing the chamfer contour point into a first chamfer contour point and a second chamfer contour point;

[0020] Selecting a first reference contour point and a second reference contour point from the first chamfer contour point and the second chamfer contour point, respectively;

[0021] If the difference between the ordinate of the first chamfer contour point and the ordinate of the first reference contour point is greater than a first preset threshold, modifying the ordinate of the first chamfer contour point to the ordinate of the first reference contour point;

[0022] If the difference between the abscissa of the second chamfer contour point and the abscissa of the second reference contour point is greater than a second preset threshold, the abscissa of the second chamfer contour point is modified to the abscissa of the second reference contour point.

[0023] In a possible implementation, the pixel coordinates of the corrected chamfer contour points are screened according to the chamfer edge straight line to determine the target chamfer endpoint, and further includes:

[0024] The first chamfer edge straight line and the second chamfer edge straight line divide the chamfer plane into four plane areas;

[0025] Selecting a chamfer contour point with the smallest ordinate from the first plane region as a first target chamfer endpoint;

[0026] A chamfer contour point with the smallest abscissa is selected from the second plane region as the second target chamfer endpoint.

[0027] In a possible implementation, the actual chamfer length is calculated based on the target chamfer endpoint, and compared with the preset chamfer length to determine whether the chamfer has a defect, and further includes:

[0028] If there is no chamfer contour point in the first plane area, a fixed pixel point is selected in the first plane area as a first target chamfer endpoint;

[0029] If there is no chamfer contour point in the second plane area, a fixed pixel point is selected in the second plane area as a second target chamfer endpoint;

[0030] Calculate the actual chamfer length based on the first target chamfer endpoint and the second target chamfer endpoint;

[0031] Compare the actual chamfer length with the preset chamfer length to determine whether the chamfer has defects.

[0032] In a possible implementation, the actual chamfer length is calculated based on the target chamfer endpoint, and compared with the preset chamfer length to determine whether the chamfer has a defect, and further includes:

[0033] Determine the radius parameter of the preset range according to the preset chamfer length and the camera calibration ratio;

[0034] If there is no chamfer contour point within the preset range of the first target chamfer endpoint, or there is no chamfer contour point within the preset range of the second target chamfer endpoint, the actual chamfer length is calculated according to the first target chamfer endpoint and the second target chamfer endpoint;

[0035] Compare the actual chamfer length with the preset chamfer length to determine whether the chamfer has defects.

[0036] According to a second aspect of the present invention, there is also provided a chamfer defect detection device, comprising:

[0037] A preprocessing module, which is configured to preprocess the acquired image of the device to be inspected, and determine the chamfer contour points and the pixel coordinates of the chamfer contour points in the preprocessed image;

[0038] A correction fitting module, which is configured to correct the pixel coordinates of the chamfer contour points and fit the chamfer edge straight line with the corrected pixel coordinates of the chamfer contour points;

[0039] A screening module is configured to screen the pixel coordinates of the corrected chamfer contour points according to the chamfer edge straight line to determine the target chamfer endpoint;

[0040] The judging module is configured to calculate the actual chamfer length based on the target chamfer endpoint, and compare it with the preset chamfer length to judge whether the chamfer has defects.

[0041] According to the third aspect of the present invention, there is also provided a chamfer defect detection device, which includes at least one processing unit and at least one storage unit, wherein the storage unit stores a computer program, and when the computer program is executed by the processing unit, the processing unit executes the steps of any one of the above-mentioned chamfer defect detection methods.

[0042] According to a fourth aspect of the present invention, there is also provided a storage medium storing a computer program executable by an access authentication device, wherein when the computer program runs on the access authentication device, the access authentication device executes any of the steps of the chamfer defect detection method described above.

[0043] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects compared with the prior art:

[0044] A chamfer defect detection method provided by the present invention can effectively reduce noise and interference by preprocessing the image of the device to be inspected, so that the determination of the chamfer contour points and their pixel coordinates is more accurate; correcting the pixel coordinates of the chamfer contour points can further reduce the errors that may be generated during image acquisition and processing, thereby improving the fitting accuracy of the chamfer edge straight line, so that only pixel points related to the target chamfer are used for subsequent calculations, reducing unnecessary data processing and further improving the detection speed; based on the precise chamfer edge straight line, the pixel coordinates of the chamfer contour points after correction are screened, so that the target chamfer endpoint can be accurately determined, providing a reliable basis for calculating the actual length of the chamfer; avoiding fatigue and subjective judgment errors that may exist in traditional manual inspection, and improving the detection efficiency; comparing the calculated actual chamfer length with the preset length, the method can quickly determine whether the chamfer has defects, providing strong support for quality control in the production process. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0046] Figure 1 A schematic diagram of a flow chart of an embodiment of a chamfer defect detection method provided by the present invention;

[0047] Figure 2 An image schematic diagram of an embodiment of collecting an original image of glass chamfer provided by the present invention;

[0048] Figure 3 The present invention provides Figure 1 A schematic flow chart of an embodiment of step S101;

[0049] Figure 4 An image schematic diagram of an embodiment of a chamfer image to be detected including a chamfer provided by the present invention;

[0050] Figure 5 An image schematic diagram of an embodiment of a binary chamfered image provided by the present invention;

[0051] Figure 6 An image schematic diagram of an embodiment of a chamfer image to be detected including chamfer contour points provided by the present invention;

[0052] Figure 7 An image schematic diagram of an embodiment of a chamfered image to be detected including a chamfered edge straight line provided by the present invention;

[0053] Figure 8 A schematic structural diagram of an embodiment of a chamfer defect detection device provided by the present invention;

[0054] Fig. 9 A schematic structural diagram of a chamfer defect detection device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0055] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0056] The terms "first", "second", "third", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0057] The present invention provides a chamfer defect detection method, device, equipment and storage medium, which are described below respectively.

[0058] See also Figure 1 , Figure 1 The present invention provides a flow chart of an embodiment of a chamfer defect detection method. In a specific embodiment of the present invention, a chamfer defect detection method is disclosed, comprising:

[0059] S101, preprocessing the acquired image of the device to be inspected, and determining the chamfering contour points and the pixel coordinates of the chamfering contour points in the preprocessed image;

[0060] S102, correcting the pixel coordinates of the chamfer contour points, and fitting the chamfer edge straight line with the corrected pixel coordinates of the chamfer contour points;

[0061] S103, screening the pixel coordinates of the corrected chamfer contour points according to the chamfer edge straight line to determine the target chamfer endpoint;

[0062] S104, calculating the actual chamfer length based on the target chamfer endpoint, and comparing it with the preset chamfer length to determine whether the chamfer has defects.

[0063] In the above embodiment, first, an image of the device to be inspected is acquired using a high-resolution image acquisition device. Subsequently, the image is preprocessed, which may include but is not limited to denoising, contrast enhancement, grayscale, and other operations to improve image quality and facilitate subsequent processing. In the preprocessed image, an edge detection algorithm (such as Canny edge detection) is used to identify the contour of the chamfer, and the pixel coordinates of these contour points are accurately determined.

[0064] See also Figure 2 , Figure 2The image schematic diagram of an embodiment of collecting the original image of glass chamfer provided by the present invention is as a preferred embodiment. In the present invention, a CCD (Charge Coupled Device, CCD for short) camera is selected to collect the image of the glass product to perform defect detection on the chamfer of the glass product. The CCD camera is located directly above the detection station, and the strip light source is placed directly below the glass to be tested. During the detection process, the camera is stationary, and the glass is driven by the platform to reciprocate and finally form an image. The collected image of the device to be tested is shown in FIG. Figure 2 shown.

[0065] Due to factors such as lens distortion and perspective changes that may exist during image acquisition, the pixel coordinates of the identified chamfer contour points may have deviations. Therefore, these coordinates need to be corrected to eliminate these deviations. After correction, the least squares method or other fitting algorithms are used to fit the straight line of the chamfer edge with the corrected pixel coordinates of the chamfer contour points.

[0066] According to the fitted chamfer edge straight line, the pixel coordinates of the corrected chamfer contour points are screened. The principle of screening is to select the contour points closest to the two ends of the straight line as the target chamfer endpoints, which usually involves calculating the distance from each contour point to the straight line and selecting the two points with the smallest distance.

[0067] Based on the selected target chamfer endpoints, the actual length of the chamfer is calculated using the Euclidean distance formula or other distance calculation methods, and then the calculated actual length is compared with the preset chamfer length. If the difference between the actual length and the preset length exceeds the set threshold, it is determined that the chamfer has a defect.

[0068] Compared with the prior art, the chamfer defect detection method provided in this embodiment can effectively reduce noise and interference by preprocessing the image of the device to be inspected, so that the determination of the chamfer contour points and their pixel coordinates is more accurate; correcting the pixel coordinates of the chamfer contour points can further reduce the errors that may be generated during image acquisition and processing, thereby improving the fitting accuracy of the chamfer edge straight line, so that only pixel points related to the target chamfer are used for subsequent calculations, reducing unnecessary data processing and further improving the detection speed; based on the precise chamfer edge straight line, the pixel coordinates of the chamfer contour points after correction are screened, so that the target chamfer endpoint can be accurately determined, providing a reliable basis for calculating the actual length of the chamfer; avoiding fatigue and subjective judgment errors that may exist in traditional manual inspection, and improving the detection efficiency; comparing the calculated actual chamfer length with the preset length, this method can quickly determine whether the chamfer has defects, providing strong support for quality control in the production process.

[0069] See also Figure 3 , Figure 3The present invention provides Figure 1 In some embodiments of the present invention, the acquired image of the device to be inspected is preprocessed, and the chamfer contour points and the pixel coordinates of the chamfer contour points are determined in the preprocessed image, and the process further includes:

[0070] S301, setting the image of the device to be inspected to a chamfer image to be inspected of a preset size with the chamfer as the center;

[0071] S302, performing averaging, filtering and binarization on the chamfer image to be detected to obtain a binarized chamfer image;

[0072] S303 , determining chamfer contour points from the binary chamfered image according to a preset corner point detection algorithm, and recording the pixel coordinates of the chamfer contour points.

[0073] In the above embodiment, first, a top view of a whole piece of glass is collected, and its four chamfers need to be located separately. With the chamfer area as the center, the image portion containing the chamfer features is extracted from the original image of the device to be detected using image cropping technology. Subsequently, according to a preset size standard (such as a specific pixel width and height), the portion of the image is adjusted to a chamfer image of uniform size to be detected by scaling or padding, etc., to ensure the consistency and efficiency of subsequent processing, while also reducing unnecessary computational burden.

[0074] See also Figure 4 , Figure 4 The image schematic diagram of an embodiment of the chamfered image to be detected including chamfers provided by the present invention is as a preferred embodiment. The preset size of the chamfered image to be detected requires the image size to be 256*256 and the chamfer is the center of the image. It can be understood that it does not mean that the present invention is only applicable to images of this size. Chamfers of any size can be detected by appropriate adjustment. After splitting and positioning, four images including chamfers should be obtained. Each image (such as Figure 4 As shown in the figure, chamfer defect detection is performed on both images, and the detection method of each image is the same. The present invention describes the chamfer defect detection method proposed by the present invention based on one of the chamfer images to be detected that contains a chamfer.

[0075] See also Figure 5 , Figure 5This is an image schematic diagram of an embodiment of the binary chamfered image provided by the present invention. The chamfered image to be detected is averaged, that is, the average value of each pixel in the image and its surrounding pixel values ​​is calculated to reduce random noise in the image and make the image smoother. Appropriate filtering algorithms (such as Gaussian filtering, median filtering, etc.) are used to further remove high-frequency noise and details in the image, while retaining key edge information, laying a good foundation for subsequent contour detection. The filtered image is converted into a binary image, that is, each pixel in the image only retains black and white colors. By setting a suitable threshold, the chamfered area is clearly distinguished from the background, which is convenient for subsequent contour extraction, and finally the following is obtained. Figure 5 The binarized chamfered image shown.

[0076] It should be noted that the preprocessing method proposed in the present invention may also include other conventional preprocessing methods for image processing, and the present invention does not impose any further limitation on this.

[0077] See also Figure 6 , Figure 6 The image schematic diagram of an embodiment of the chamfered image to be detected including chamfered contour points provided by the present invention, wherein an efficient corner detection algorithm (such as Harris corner detection, Shi-Tomasi corner detection or a more advanced deep learning model, etc.) is selected to process the binary chamfered image, and these algorithms are used to automatically identify the corner features in the image, i.e., the turning points of the chamfered contour. According to the output results of the corner detection algorithm, the corner points belonging to the chamfered contour are screened out, and the screening can be based on chamfered features such as shape, size, and direction to improve the accuracy of recognition. For each determined chamfered contour point, its pixel coordinates in the image are recorded for subsequent tasks such as size measurement, shape analysis or defect detection.

[0078] It should be noted that if there are a preset number of directional grayscale changes drastically in the eight directions around a pixel point, it can be judged as a corner point. In actual operation, the number of generated corner points can be controlled by adjusting the preset number, thereby adjusting the accuracy of the final detection result.

[0079] In some embodiments of the present invention, the pixel coordinates of the chamfer contour points are corrected, and the chamfer edge straight line is fitted with the corrected pixel coordinates of the chamfer contour points, further comprising:

[0080] Selecting a reference contour point from the chamfer contour points, and performing a correction process on the pixel coordinates of the chamfer contour points based on the pixel coordinates of the reference contour point;

[0081] The first center point and the second center point are respectively determined from the corrected reference contour points to obtain a first chamfer edge straight line and a second chamfer edge straight line by fitting.

[0082] In the above embodiment, the selected reference contour points need to be determined by selecting two straight lines that constitute the two sides of the chamfer according to the chamfering situation of the glass, and all the chamfer contour points are divided into two sets of chamfer contour points according to the straight lines they are located on, so as to perform subsequent processing separately. The reference points should represent the key features of the chamfer contour as much as possible, such as corners, turning points or stable points on the edges. The basis for selecting the reference points can be their position stability, the uniformity of pixel values ​​or their geometric importance relative to the entire contour. Generally, the reference contour points can also be selected at preset intervals on the chamfer straight line, such as selecting the third or fourth chamfer contour point as the reference contour point starting from the corner. The correction process makes the contour point coordinates actually measured closer to their theoretical values, thereby reducing errors.

[0083] Based on the corrected chamfer contour points, two sets of key points are determined for fitting the first chamfer edge straight line and the second chamfer edge straight line, and the first center point (which may be located on one side of the chamfer) and the second center point (located on the other side) of each chamfer area are identified or calculated, and the line connecting these two center points is the desired straight line. It should be noted that the center point can be determined by geometric calculation (such as the midpoint formula) or a more advanced fitting algorithm (such as the least squares method).

[0084] See also Figure 7 , Figure 7 The image schematic diagram of an embodiment of the chamfered image to be detected including the chamfered edge straight line provided by the present invention, using the determined pixel coordinates of the first center point and the second center point, respectively fitting the first chamfered edge straight line and the second chamfered edge straight line through a straight line fitting algorithm (such as Hough transform, least squares straight line fitting, etc.) as shown in FIG. Figure 7 These two straight lines not only describe the precise boundary of the chamfer, but also provide important basis for subsequent dimension measurement and shape analysis.

[0085] In some embodiments of the present invention, selecting a reference contour point from the chamfer contour points, and performing a deflection correction process on the pixel coordinates of the chamfer contour point based on the pixel coordinates of the reference contour point, further includes:

[0086] dividing the chamfer contour point into a first chamfer contour point and a second chamfer contour point;

[0087] Selecting a first reference contour point and a second reference contour point from the first chamfer contour point and the second chamfer contour point, respectively;

[0088] If the difference between the ordinate of the first chamfer contour point and the ordinate of the first reference contour point is greater than a first preset threshold, modifying the ordinate of the first chamfer contour point to the ordinate of the first reference contour point;

[0089] If the difference between the abscissa of the second chamfer contour point and the abscissa of the second reference contour point is greater than a second preset threshold, the abscissa of the second chamfer contour point is modified to the abscissa of the second reference contour point.

[0090] In the above embodiment, the chamfering contour points are divided into horizontal and vertical directions based on the chamfering, wherein the first chamfering contour point is the chamfering contour point in the horizontal direction, and the second chamfering contour point is the chamfering contour point in the vertical direction. According to the above description, the first reference contour point is selected from the first chamfering contour point, and the second reference contour point is selected from the second chamfering contour point.

[0091] For the first chamfer contour point, the difference between the ordinate of each first chamfer contour point and the ordinate of the first reference contour point is compared. If the difference between the ordinate of a first chamfer contour point and the reference point exceeds a first preset threshold (this threshold is usually set in advance based on factors such as image resolution and contour accuracy requirements), it is considered that the ordinate of the point has a significant error and needs to be modified to the ordinate of the first reference contour point to achieve correction.

[0092] Similarly, compare the difference between the horizontal coordinate of each second chamfer contour point and the horizontal coordinate of the second reference contour point. If the difference between the horizontal coordinate of a second chamfer contour point and the reference point exceeds a second preset threshold (this threshold may be different from the first threshold, depending on the specific requirements of the image and contour), the horizontal coordinate of the point is modified to the horizontal coordinate of the second reference contour point.

[0093] It can be understood that the first preset threshold and the second preset threshold can be set separately according to actual needs. They can be set to the same value or different values, and the present invention does not impose further limitations on this.

[0094] Through such a processing flow, the pixel coordinates of the chamfered contour points can be effectively corrected to improve the accuracy and consistency of the contour. This is not only suitable for simple contour processing tasks, but can also be extended to more complex image processing scenarios, providing a reliable foundation for subsequent image analysis, recognition or reconstruction tasks.

[0095] In some embodiments of the present invention, the pixel coordinates of the corrected chamfer contour points are screened according to the chamfer edge straight line to determine the target chamfer endpoint, and the method further includes:

[0096] The first chamfer edge straight line and the second chamfer edge straight line divide the chamfer plane into four plane areas;

[0097] Selecting a chamfer contour point with the smallest ordinate from the first plane region as a first target chamfer endpoint;

[0098] A chamfer contour point with the smallest abscissa is selected from the second plane region as the second target chamfer endpoint.

[0099] In the above embodiment, before determining the target chamfer endpoint, it is necessary to perform contour fitting offset on the first chamfer edge straight line and the second chamfer edge straight line. Specifically, it is necessary to perform fitting according to the theoretical length of the chamfer and the set reference offset value, select the pixel value of the offset reference offset value, offset the Y straight line generated from top to bottom in the previous step to the right by the pixel value of the reference offset value, and offset the X straight line generated from left to right upward by the pixel value of the reference offset value.

[0100] According to the positions of the first chamfer edge straight line (horizontally chamfer edge straight line) and the second chamfer edge straight line (vertically chamfer edge straight line), the plane where the chamfer is located is divided into four clear areas. The first chamfer edge straight line and the second chamfer edge straight line represent the two main boundaries of the chamfer profile. The four areas are defined by these two straight lines and their extensions, and each area contains a portion of the points of the chamfer profile.

[0101] Among the four divided areas, the area above the horizontal chamfered edge line and to the right of the vertical chamfered edge line is defined as the first plane area, and the area below the horizontal chamfered edge line and to the left of the vertical chamfered edge line is defined as the second plane area.

[0102] In the first plane area, all the corrected chamfer contour points are traversed and the point with the smallest ordinate is found. This point is identified as the first target chamfer endpoint because it is closest to the start or end position of the chamfer in the vertical direction, which is of great significance for subsequent dimensional measurement, position positioning and other tasks.

[0103] Similar to determining the first target chamfer endpoint, in the second plane area, find the chamfer contour point with the smallest horizontal coordinate and use it as the second target chamfer endpoint. This point is representative in the horizontal direction and is crucial for understanding the chamfer width, tilt angle and other features.

[0104] In some embodiments of the present invention, the actual chamfer length is calculated based on the target chamfer endpoint, and compared with the preset chamfer length to determine whether the chamfer has a defect, further comprising:

[0105] If there is no chamfer contour point in the first plane area, a fixed pixel point is selected in the first plane area as a first target chamfer endpoint;

[0106] If there is no chamfer contour point in the second plane area, a fixed pixel point is selected in the second plane area as a second target chamfer endpoint;

[0107] Calculate the actual chamfer length based on the first target chamfer endpoint and the second target chamfer endpoint;

[0108] Compare the actual chamfer length with the preset chamfer length to determine whether the chamfer has defects.

[0109] In the above embodiment, a fixed pixel point is selected in the first plane area as the first target chamfer endpoint. This fixed point can be selected based on a certain rule (such as a geometric center, a boundary point, etc.), or a preset reference point. Similarly, a fixed pixel point needs to be selected in the second plane area as the second target chamfer endpoint.

[0110] It should be noted that when there is no chamfer contour point in the first plane area or there is no chamfer contour point in the second plane area, it means that all chamfer contour points in the area are excluded when determining the target chamfer endpoint, which means that the chamfer is abnormal and the chamfer length detection cannot be completed at this time. In order to output the result, a pixel point at a fixed position is set as the target chamfer endpoint. The pixel point at this fixed position is absolutely far away from the chamfered pixel point. The chamfer length data obtained in this way must be wrong, which can confirm that the chamfer has defects.

[0111] The pixel distance between the first target chamfer endpoint and the second target chamfer endpoint is calculated as the actual chamfer length. For the generated glass products, there are certain production requirements. Therefore, the chamfer length is fixed during production and can be used as the preset chamfer length to determine whether the chamfer has defects. If the difference between the actual chamfer length and the preset chamfer length exceeds the preset length threshold, the chamfer is considered to have defects.

[0112] In some embodiments of the present invention, the actual chamfer length is calculated based on the target chamfer endpoint, and compared with the preset chamfer length to determine whether the chamfer has a defect, further comprising:

[0113] Determine the radius parameter of the preset range according to the preset chamfer length and the camera calibration ratio;

[0114] If there is no chamfer contour point within the preset range of the first target chamfer endpoint, or there is no chamfer contour point within the preset range of the second target chamfer endpoint, the actual chamfer length is calculated according to the first target chamfer endpoint and the second target chamfer endpoint;

[0115] Compare the actual chamfer length with the preset chamfer length to determine whether the chamfer has defects.

[0116] In the above embodiment, a circle is drawn with the target chamfer endpoint as the center and the radius parameter as the radius, and the first preset range of the first target chamfer endpoint and the second preset range of the second target chamfer endpoint are determined respectively. It should be noted that the radius parameter of the preset range is related to the preset chamfer length and the camera calibration ratio. Specifically, when the camera calibration ratio is the same 0.1, the actual chamfer length is L, and the radius parameter is R, then R = L*10+50.

[0117] The first target chamfer endpoint selected is detected. If there is no second corner point within the first preset range around the first target chamfer endpoint (not necessarily the second target chamfer endpoint), or there is no second corner point within the second preset range around the second target chamfer endpoint (not necessarily the first target chamfer endpoint), it means that the chamfer is defective. Therefore, after calculating the actual length of the chamfer between the first target chamfer endpoint and the second target chamfer endpoint, the actual length of the chamfer is corrected using a preset formula.

[0118] Similarly, the actual chamfer length is compared with the preset chamfer length to determine whether the chamfer has defects, which is not further elaborated in this solution.

[0119] In order to better implement the chamfer defect detection method in the embodiment of the present invention, based on the chamfer defect detection method, correspondingly, please refer to Figure 8 , Figure 8 This is a schematic structural diagram of an embodiment of a chamfer defect detection device provided by the present invention. The embodiment of the present invention provides a chamfer defect detection device 800, comprising:

[0120] A preprocessing module 810 is configured to preprocess the acquired image of the device to be inspected, and determine chamfer contour points and chamfer contour point pixel coordinates in the preprocessed image;

[0121] A correction fitting module 820 is configured to correct the chamfer contour point pixel coordinates and fit the chamfer edge straight line with the corrected chamfer contour point pixel coordinates;

[0122] A screening module 830 is configured to screen the pixel coordinates of the corrected chamfer contour points according to the chamfer edge straight line to determine the target chamfer endpoint;

[0123] The judgment module 840 is configured to calculate the actual chamfer length based on the target chamfer endpoint, and compare it with the preset chamfer length to determine whether the chamfer has defects.

[0124] It should be noted here that: the device 800 provided in the above embodiment can implement the technical solutions described in the above method embodiments. The specific implementation principles of the above modules or units can refer to the corresponding contents in the above method embodiments, which will not be repeated here.

[0125] See also Fig. 9 , Fig. 9 A schematic diagram of the structure of a chamfer defect detection device provided by an embodiment of the present invention. Based on the above chamfer defect detection method, the present invention also provides a chamfer defect detection device, which can be a computing device such as a mobile terminal, a desktop computer, a notebook, a PDA, and a server. The chamfer defect detection device 900 includes a processor 910, a memory 920, and a display 930. Fig. 9 Only some components of the synchronous tracking flying welding equipment for real-time measurement of battery height are shown, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead.

[0126] In some embodiments, the memory 920 may be an internal storage unit of the chamfer defect detection device 900, such as a hard disk or memory of the chamfer defect detection device 900. In other embodiments, the memory 920 may also be an external storage device of the chamfer defect detection device 900, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the chamfer defect detection device 900. Further, the memory 920 may also include both an internal storage unit and an external storage device of the chamfer defect detection device 900. The memory 920 is used to store application software and various data installed in the chamfer defect detection device 900, such as program codes for installing the chamfer defect detection device 900. The memory 920 may also be used to temporarily store data that has been output or is to be output. In one embodiment, a chamfer defect detection program 940 is stored on the memory 920, and the chamfer defect detection program 940 can be executed by the processor 910, thereby realizing the chamfer defect detection method of each embodiment of the present application.

[0127] In some embodiments, the processor 910 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run program codes or process data stored in the memory 920, such as executing a chamfer defect detection method.

[0128] In some embodiments, the display 930 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 930 is used to display information on the chamfer defect detection device 900 and to display a visual user interface. The components 910-930 of the chamfer defect detection device 900 communicate with each other via a system bus.

[0129] In one embodiment, when the processor 910 executes the chamfer defect detection program 940 in the memory 920 , the steps in the above chamfer defect detection method are implemented.

[0130] This embodiment further provides a computer-readable storage medium on which a chamfer defect detection program is stored. When the chamfer defect detection program is executed by a processor, the following steps are implemented:

[0131] Preprocessing the acquired image of the device to be inspected, and determining the chamfer contour points and the pixel coordinates of the chamfer contour points in the preprocessed image;

[0132] Correcting the pixel coordinates of the chamfer contour points, and fitting the chamfer edge straight line with the corrected pixel coordinates of the chamfer contour points;

[0133] The pixel coordinates of the corrected chamfer contour points are screened according to the chamfer edge straight line to determine the target chamfer endpoint;

[0134] The actual chamfer length is calculated based on the target chamfer endpoint and compared with the preset chamfer length to determine whether there is a defect in the chamfer.

[0135] In summary, the chamfer defect detection method provided by the present invention can effectively reduce noise and interference by preprocessing the image of the device to be inspected, so that the determination of the chamfer contour points and their pixel coordinates is more accurate; correcting the pixel coordinates of the chamfer contour points can further reduce the errors that may be caused by the image acquisition and processing process, thereby improving the fitting accuracy of the chamfer edge straight line, so that only the pixel points related to the target chamfer are used for subsequent calculations, reducing unnecessary data processing and further improving the detection speed; based on the precise chamfer edge straight line, the pixel coordinates of the chamfer contour points after correction are screened, so that the target chamfer endpoint can be accurately determined, providing a reliable basis for calculating the actual length of the chamfer; avoiding fatigue and subjective judgment errors that may exist in traditional manual inspection, and improving the detection efficiency; comparing the calculated actual chamfer length with the preset length, this method can quickly determine whether the chamfer has defects, providing strong support for quality control in the production process.

[0136] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of the above method are implemented. The computer-readable storage medium may include, but is not limited to, any type of disk, including a floppy disk, an optical disk, a DVD, a CD-ROM, a micro drive, and a magneto-optical disk, a ROM, a RAM, an EPROM, an EEPROM, a DRAM, a VRAM, a flash memory device, a magnetic card or an optical card, a nanosystem (including a molecular memory IC), or any type of medium or device suitable for storing instructions and / or data.

[0137] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0138] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0139] In the several embodiments provided in the present application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0140] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0141] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0142] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application is essentially 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, and the computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM), random access memory (RAM), mobile hard disk, disk or optical disk and other media that can store program code.

[0143] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable memory, which can include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0144] The above is only an exemplary embodiment of the present disclosure, and the scope of the present disclosure cannot be limited thereto. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the specification and practicing the disclosure here, those skilled in the art will easily think of the implementation scheme of the present disclosure. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the technical field not recorded in the present disclosure. The description and examples are regarded as exemplary only, and the scope and spirit of the present disclosure are defined by the claims.

[0145] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0146] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A chamfer defect detection method, characterized in that: include: Preprocessing the acquired image of the device to be inspected, and determining the chamfer contour points and the pixel coordinates of the chamfer contour points in the preprocessed image; Correcting the pixel coordinates of the chamfer contour points, and fitting the chamfer edge straight line with the corrected pixel coordinates of the chamfer contour points; The pixel coordinates of the corrected chamfer contour points are screened according to the chamfer edge straight line to determine the target chamfer endpoint; The actual chamfer length is calculated based on the target chamfer endpoint, and compared with the preset chamfer length to determine whether the chamfer has defects.

2. The chamfer defect detection method according to claim 1, characterized in that: The method of preprocessing the acquired image of the device to be inspected and determining the chamfer contour points and the pixel coordinates of the chamfer contour points in the preprocessed image also includes: The image of the device to be inspected is set to be an image of the chamfer to be inspected of a preset size with the chamfer as the center; The chamfered image to be detected is subjected to averaging processing, filtering processing and binarization processing to obtain a binarized chamfered image; The chamfer contour points are determined from the binary chamfered image according to a preset corner point detection algorithm, and the pixel coordinates of the chamfer contour points are recorded.

3. The chamfer defect detection method according to claim 1, characterized in that: The correcting the pixel coordinates of the chamfer contour points and fitting the chamfer edge straight line with the corrected pixel coordinates of the chamfer contour points also includes: Selecting a reference contour point from the chamfer contour points, and performing a deflection correction process on the pixel coordinates of the chamfer contour point based on the pixel coordinates of the reference contour point; The first center point and the second center point are respectively determined from the corrected reference contour points to obtain a first chamfer edge straight line and a second chamfer edge straight line by fitting.

4. The chamfer defect detection method according to claim 3, characterized in that: The selecting of a reference contour point from the chamfer contour points and performing a deflection correction process on the pixel coordinates of the chamfer contour point based on the pixel coordinates of the reference contour point also includes: dividing the chamfer contour point into a first chamfer contour point and a second chamfer contour point; selecting a first reference contour point and a second reference contour point from the first chamfer contour points and the second chamfer contour points respectively; If the difference between the ordinate of the first chamfer contour point and the ordinate of the first reference contour point is greater than a first preset threshold, modifying the ordinate of the first chamfer contour point to be the ordinate of the first reference contour point; If the difference between the abscissa of the second chamfer contour point and the abscissa of the second reference contour point is greater than a second preset threshold, the abscissa of the second chamfer contour point is modified to be the abscissa of the second reference contour point.

5. The chamfer defect detection method according to claim 3, characterized in that: The method further comprises: screening the pixel coordinates of the corrected chamfer contour points according to the chamfer edge straight line to determine the target chamfer endpoint; The first chamfer edge straight line and the second chamfer edge straight line divide the chamfering plane into four plane areas; Selecting a chamfer contour point with the smallest ordinate from the first plane region as a first target chamfer endpoint; A chamfer contour point with the smallest abscissa is selected from the second plane region as the second target chamfer endpoint.

6. The chamfer defect detection method according to claim 5, characterized in that: The actual chamfer length is calculated based on the target chamfer endpoint, and compared with the preset chamfer length to determine whether the chamfer has defects, and further includes: If there is no chamfer contour point in the first plane area, selecting a fixed pixel point in the first plane area as the first target chamfer endpoint; If there is no chamfer contour point in the second plane area, selecting a fixed pixel point in the second plane area as the second target chamfer endpoint; Calculate the actual chamfer length based on the first target chamfer endpoint and the second target chamfer endpoint; Whether the chamfer has defects is determined by comparing the actual chamfer length with the preset chamfer length.

7. The chamfer defect detection method according to claim 5, characterized in that: The actual chamfer length is calculated based on the target chamfer endpoint, and compared with the preset chamfer length to determine whether the chamfer has defects, and further includes: Determine the radius parameter of the preset range according to the preset chamfer length and the camera calibration ratio; If there is no chamfer contour point within the preset range of the first target chamfer endpoint, or if there is no chamfer contour point within the preset range of the second target chamfer endpoint, calculating the actual chamfer length according to the first target chamfer endpoint and the second target chamfer endpoint; Whether the chamfer has defects is determined by comparing the actual chamfer length with the preset chamfer length.

8. A chamfer defect detection device, characterized in that: include: A preprocessing module, which is configured to preprocess the acquired image of the device to be inspected, and determine the chamfer contour points and the pixel coordinates of the chamfer contour points in the preprocessed image; A correction fitting module, which is configured to correct the chamfer contour point pixel coordinates and fit the chamfer edge straight line with the corrected chamfer contour point pixel coordinates; A screening module is configured to screen the pixel coordinates of the corrected chamfer contour points according to the chamfer edge straight line to determine a target chamfer endpoint; The judging module is configured to calculate the actual chamfer length based on the target chamfer endpoint, and compare it with the preset chamfer length to judge whether the chamfer has defects.

9. A chamfer defect detection device, characterized in that: It comprises at least one processing unit and at least one storage unit, wherein the storage unit stores a computer program, and when the computer program is executed by the processing unit, the processing unit executes the steps of the chamfer defect detection method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: It stores a computer program executable by an access authentication device. When the computer program runs on the access authentication device, the access authentication device executes the steps of the chamfer defect detection method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Method for generating adaptive topological contour gradient structure of three-dimensional geometry

    CN120510328A

  • Line end defect detection method and device in line draft graph and storage medium

    CN121304581A

  • Line head defect detection method and device for line drawing and storage medium

    CN121304581B