A watch processing laser engraving machine marking quality detection method and system
By employing a detection method combining a grazing angle light source and a polarizer, specular reflection interference is eliminated, local contrast is calculated and converted into depth values, thus solving the accuracy and consistency issues in marking quality inspection on highly reflective materials and achieving efficient and accurate detection results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- YICHUN CHITONGDA TECH CO LTD
- Filing Date
- 2025-11-18
- Publication Date
- 2026-05-15
AI Technical Summary
Existing laser engraving machine marking quality inspection systems are prone to spot saturation, false edges, and local distortion on highly reflective materials. They are difficult to accurately distinguish micron-level depth and grayscale differences, and lack adaptive characteristics, making them unsuitable for multi-material and multi-reflection scenarios.
By employing a combination of grazing angle light source and rotatable polarizer, four sets of complementary image pairs are captured to eliminate specular reflection interference, calculate local contrast and convert it into a marking depth value, and combine it with a preset threshold to judge the marking quality.
It achieves high-precision, non-contact marking quality inspection of highly reflective materials, accurately assesses engraving depth and uniformity, improves the objectivity and consistency of inspection, and is applicable to workpieces of various materials and shapes.
Smart Images

Figure CN121582172B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of quality inspection technology, and in particular to a method and system for quality inspection of marking on a laser engraving machine for watch processing. Background Technology
[0002] The increasing demand for precision and personalization in high-end watch manufacturing has made laser engraving a crucial method for marking microstructures, brand logos, and QR code traceability on watch cases, case backs, and internal components. Laser marking offers advantages such as non-contact operation, high precision, and strong programmability, enabling the formation of stable marks on various materials including metals, ceramics, and sapphire. However, in watch manufacturing, marking quality directly impacts appearance consistency, anti-counterfeiting reliability, and the feasibility of subsequent coating processes, thus placing higher demands on marking quality inspection. Existing laser marking quality inspection systems are mostly based on two-dimensional visual image recognition, relying on algorithms such as grayscale thresholding and edge detection to judge the marking results. However, in the high-precision field of watch manufacturing, this method reveals several technical shortcomings.
[0003] First, watch cases and back covers often use highly reflective materials such as stainless steel, titanium alloy, and ceramic mirrors, leading to severe reflection interference after laser marking. This can cause issues like light spot saturation, false edges, and local distortion in CCD imaging, affecting image segmentation and feature extraction accuracy. Second, watch marking depth is typically controlled at the micrometer level, resulting in minimal grayscale difference between shallowly engraved characters and the substrate. Traditional visual algorithms struggle to accurately distinguish boundary details, leading to insufficient detection sensitivity. Furthermore, existing detection systems often ignore the microscopic three-dimensional morphology of the marked area, relying solely on planar grayscale information to judge quality. This lack of quantitative analysis of etching depth, stroke width, and energy distribution results in frequent cases where the marking appears visually acceptable but fails to meet physical performance standards. Differences in light absorption between different materials also cause the same marking parameters to produce different effects on different surfaces. Traditional algorithms lack adaptive characteristics and cannot automatically adjust detection strategies to adapt to multi-material, multi-reflection scenarios. Summary of the Invention
[0004] Therefore, the present invention needs to provide a method and system for detecting the marking quality of a laser engraving machine in watch processing, in order to solve at least one of the above-mentioned technical problems.
[0005] To achieve the above objectives, a method for inspecting the marking quality of a laser engraving machine in watch processing includes the following steps:
[0006] Step S1: Using a light source with a grazing angle, four sets of image pairs are captured at the watch marking station using an inspection camera; specular reflection interference in the four sets of image pairs is removed to obtain the effective detection area;
[0007] Step S2: Identify the marking groove within the effective detection area, calculate the average gray value of the pixels in the central area inside the groove as the shadow brightness, and calculate the average gray value of the pixels in the adjacent base area as the reference brightness;
[0008] Step S3: Use the ratio of the difference between the reference brightness and the shadow brightness to the reference brightness as the local contrast; take the average of the local contrasts as the overall contrast.
[0009] Step S4: Convert the comprehensive contrast to a marking depth value according to the pre-established calibration relationship, and calculate the average depth and depth fluctuation of each point in the marking area; when the average depth reaches the preset minimum qualified depth requirement and the depth fluctuation does not exceed the preset uniformity limit, the marking quality is judged to be qualified.
[0010] This invention also provides a quality inspection system for marking laser engraving machines used in watchmaking, for performing the above-described quality inspection method for marking laser engraving machines used in watchmaking. The quality inspection system for marking laser engraving machines used in watchmaking includes:
[0011] The grazing polarization imaging module is used to capture four sets of image pairs at the watch marking station using a detection camera through a light source at a grazing angle; the specular reflection interference in the four sets of image pairs is removed to obtain the effective detection area;
[0012] The local brightness extraction module is used to identify the marking groove within the effective detection area, calculate the average gray value of the pixels in the central area inside the groove as the shadow brightness, and calculate the average gray value of the pixels in the adjacent base area as the reference brightness.
[0013] The multi-directional contrast calculation module is used to use the ratio of the difference between the reference brightness and the shadow brightness to the reference brightness as the local contrast; and to take the average of the local contrasts as the comprehensive contrast.
[0014] The quality judgment module is used to convert the comprehensive contrast into a marking depth value according to the pre-established calibration relationship, and to count the average depth and depth fluctuation of each point in the marking area. When the average depth reaches the preset minimum qualified depth requirement and the depth fluctuation does not exceed the preset uniformity limit, the marking quality is judged to be qualified.
[0015] This invention proposes a laser engraving quality inspection method and system that combines multi-directional light source illumination, polarized light control, and brightness comparison analysis to achieve high-precision, non-contact evaluation of the engraving depth and uniformity of the tested surface. The method sequentially illuminates the tested surface with light sources from four directions, and utilizes a rotatable polarizer to effectively eliminate specular reflection interference, making the acquired image brightness information more realistic and reliable. This overcomes the misjudgment problems caused by uneven illumination and highly reflective materials in traditional single-light source detection. In the image processing stage, by extracting shadow brightness and reference brightness and calculating the local contrast from each direction, a weighted average is obtained to obtain the comprehensive contrast. This not only reflects the depth variations of the engraved area but also demonstrates the overall optical uniformity. After depth mapping transformation, this brightness contrast parameter can intuitively reflect the actual geometric depth of the engraved layer, forming a quantifiable evaluation index.
[0016] By calculating the average and fluctuation of the depth, the system achieves a dual assessment of engraving consistency. This ensures that the inspection results consider both whether the overall engraving depth meets the process requirements and the uniformity between different locations. The system ultimately determines the engraving quality based on preset depth and fluctuation thresholds, eliminating the need for subjective manual evaluation and significantly improving the objectivity and consistency of the inspection. The system is simple and easy to implement in its structural design; the inspection camera, light source, and polarizer can all be standardized and adapted to various workpieces of different shapes and materials. For example, for highly reflective surfaces such as metal watch cases, precision parts, or nameplates, the system can complete the inspection and output results within seconds. Through this solution, companies can achieve automated and standardized quality control on the production line, significantly reducing human error and inspection time, ensuring the clarity, depth consistency, and aesthetic appeal of the engraved patterns, and improving the stability and traceability of overall product quality. Attached Figure Description
[0017] Other features, objects, and advantages of the invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:
[0018] Figure 1 This is a schematic diagram of the steps of a laser engraving machine marking quality inspection method for watch processing according to the present invention;
[0019] Figure 2 This is a flowchart illustrating a marking depth detection method according to an embodiment of the present invention;
[0020] Figure 3 This is a schematic diagram of the hardware structure of a marking depth detection system based on grazing polarization imaging according to an embodiment of the present invention.
[0021] Figure 4 This is a schematic diagram of a laser engraving machine marking quality inspection system for watch processing according to the present invention. Detailed Implementation
[0022] The technical method of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0023] Furthermore, the accompanying drawings are merely illustrative of the invention and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor methods and / or microcontroller methods.
[0024] It should be understood that although the terms "first," "second," etc., may be used herein to describe various units, these units should not be limited by these terms. These terms are used merely to distinguish one unit from another. For example, without departing from the scope of the exemplary embodiments, a first unit may be referred to as a second unit, and similarly, a second unit may be referred to as a first unit. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0025] To achieve the above objectives, please refer to Figures 1 to 4 This invention provides a method for inspecting the marking quality of a laser engraving machine in watch manufacturing, the method comprising the following steps:
[0026] Step S1: Using a light source with a grazing angle, four sets of image pairs are captured at the watch marking station using an inspection camera; specular reflection interference in the four sets of image pairs is removed to obtain the effective detection area;
[0027] Step S2: Identify the marking groove within the effective detection area, calculate the average gray value of the pixels in the central area inside the groove as the shadow brightness, and calculate the average gray value of the pixels in the adjacent base area as the reference brightness;
[0028] Step S3: Use the ratio of the difference between the reference brightness and the shadow brightness to the reference brightness as the local contrast; take the average of the local contrasts as the overall contrast.
[0029] Step S4: Convert the comprehensive contrast to a marking depth value according to the pre-established calibration relationship, and calculate the average depth and depth fluctuation of each point in the marking area; when the average depth reaches the preset minimum qualified depth requirement and the depth fluctuation does not exceed the preset uniformity limit, the marking quality is judged to be qualified.
[0030] See Figure 2 The laser engraving quality inspection method includes the following:
[0031] Four-directional image pairs are acquired and specular reflections are removed. The surface of the workpiece under test is sequentially illuminated by four light sources distributed at different locations, while a detection camera captures corresponding images. To avoid interference from specular reflections on the metal surface, a rotatable polarizer is used to adjust the polarization angle of the incident light, thereby filtering out the reflected components and obtaining a uniform and effective illuminated image.
[0032] The system extracts shadow brightness and reference brightness. After grayscale conversion and noise filtering, the system selects the average brightness of the carved area as the shadow brightness and the average brightness of the non-carved area as the reference brightness. The difference in brightness can intuitively reflect the changes in carving depth or surface smoothness.
[0033] Calculate the overall contrast ratio. The system subtracts the shadow brightness value from the reference brightness value to obtain the brightness difference value, and then divides the brightness difference value by the reference brightness value to obtain the local contrast ratio in each direction. Finally, the local contrast ratios in the four directions are averaged to obtain the overall contrast ratio, which is used to quantify the overall sharpness and uniformity of the engraved pattern.
[0034] The overall contrast is converted into a depth value, and the average and fluctuation of the depth are calculated. The conversion of depth values can be based on a pre-established luminance-depth calibration curve, thereby realizing the mapping of optical luminance signals to geometric depth quantities.
[0035] The system determines whether the depth and uniformity meet the standards. When the overall depth is within the preset threshold range and the depth fluctuation is less than the specified standard, the carving quality is deemed acceptable; otherwise, it is deemed unacceptable and a detection warning is output.
[0036] Through the above steps, the system can automatically complete the quantitative analysis of carving quality without contact, achieving a fast and reliable detection process.
[0037] Furthermore, step S1 includes the following steps:
[0038] Step S11: Set up grazing angle light sources at the four positions of the watch marking station, set the angle between each light and the normal of the watch case surface to 80 degrees, and install a rotatable linear polarizer in front of the lens of the inspection camera.
[0039] In one embodiment, grazing angle light sources are arranged at four points along the east, south, west, and north directions from the center of the watch case at the watch laser marking station. The light emitted by each light source forms an 80° angle with the normal direction of the watch case surface. This grazing angle allows minute surface irregularities to create noticeable differences in brightness, thereby enhancing the visibility of the groove edges. To eliminate the effects of reflected polarization from different directions, an electrically rotatable linear polarizer is installed in front of the lens of the inspection camera. This polarizer can rotate precisely within a range of 0° to 180° to match the polarization direction of the light sources from different directions.
[0040] For example, when the light source on the east side is lit, the polarizer is initially set to 0°, while when the light source on the south side is lit, it is set to 90°, so as to ensure that the light intensity distribution received by the camera mainly comes from surface diffuse reflection rather than specular reflection, thereby improving the contrast consistency of subsequent images.
[0041] Step S12: Light up the grazing angle light source in sequence. When the light source is lit, adjust the polarizer to a position parallel to the polarization direction of the light source and take the first image. Rotate the polarizer 90 degrees and take the second image to obtain four sets of image pairs.
[0042] In one embodiment, a control module sequentially illuminates four grazing angle light sources in different directions, keeping only one light source on at a time to avoid interference from multiple light sources. When a light source in a certain direction is illuminated, the polarizer is adjusted to a position parallel to the polarization direction of that light source. At this point, the camera is triggered to capture the first image to record the distribution of strong polarization reflection on the workpiece surface. Subsequently, the polarizer is rotated 90 degrees to make it perpendicular to the polarization direction of the light source, and the camera is triggered again to capture the second image to record the weak polarization diffuse reflection information. Through the above operations, a set of polarization-complementary image pairs can be obtained for each light source direction.
[0043] For example, when the light source on the east side is lit, the polarizer is first set to 0° to take the first image, and then rotated to 90° to take the second image; then the same process is repeated for the south, west and north directions in turn, so as to obtain four sets of image pairs, which represent the illumination response in the four directions respectively.
[0044] Step S13: Subtract the first and second images in the four image pairs pixel by pixel to obtain four difference images, and identify and mark the regions in each difference image whose pixel values exceed a preset threshold as specular reflection interference regions.
[0045] In one embodiment, pixel-by-pixel grayscale difference operations are performed on four image pairs. The first image and the second image at the same orientation are subtracted pixel by pixel to eliminate global brightness variations caused by differences in material reflectivity. In the resulting difference image, areas with grayscale values higher than the average brightness represent areas with strong polarization reflection, typically corresponding to specular reflection interference locations on the surface. Furthermore, the pixels in the difference image are thresholded to identify and mark areas with pixel values exceeding a preset threshold, thereby forming a specular reflection interference mask.
[0046] For example, if the average pixel value of the difference image is 15 and the variance is 5, the system can set the threshold to the average value plus twice the variance, i.e., 25. Areas with pixel values greater than 25 are marked as specular reflection interference areas.
[0047] Step S14: Remove the corresponding specular reflection interference area in the second image to obtain the effective detection area.
[0048] In one embodiment, a specular reflection interference mask is used to shield the corresponding interference area in the second image of each image pair. This involves setting the pixel grayscale value within the marked area to zero or making it invalid, thereby obtaining the effective detection area after removing the interference. In this case, the retained area mainly contains surface diffuse reflection light, which can accurately reflect the geometry of the marking groove.
[0049] For example, in a pair of images with a north-facing light source, if the specular reflection area occupies 15% of the entire image, then only the remaining 85% of the area is retained for groove recognition and brightness calculation.
[0050] See Figure 3 The detection system in this embodiment of the invention includes a detection camera, a rotatable polarizer, light sources 1 to 4, and a watch case to be tested. The detection camera is positioned at the top center of the system to acquire high-resolution images of the surface being tested. The rotatable polarizer is mounted in front of the camera lens, and its rotation angle can be precisely adjusted to control the polarization relationship between incident and reflected light, thereby effectively eliminating the influence of specular reflection. The four light sources 1 to 4 are evenly distributed at the four cardinal directions of the watch case to be tested, forming a symmetrical illumination layout. The luminous intensity and activation sequence of each light source can be independently controlled to acquire surface response images under four-directional illumination. The watch case to be tested is placed in the center of the detection platform, with its upper surface being the engraved area to be evaluated.
[0051] It should be noted that, Figure 2 The layout shown is for illustrative purposes only. In actual applications, the number and angle of the light sources can be adjusted according to the shape of the workpiece and the surface reflection characteristics to obtain the best detection effect.
[0052] Most importantly, the reason for setting the angle between the light source and the normal to the watch case surface in step S11 to approximately eighty degrees is as follows:
[0053] There is a geometric amplification relationship between the width of the shadow area and the depth of the groove. The closer the incident angle is to 90 degrees, the greater the magnification factor of the shadow width relative to the groove depth.
[0054] When the incident angle is set to 80 degrees, a groove with a depth of 10 micrometers will produce a shadow about 57 micrometers wide on the surface. This shadow width is much larger than the size of a single pixel of the camera, making the micrometer-level depth difference clearly identifiable.
[0055] If the incident angle is less than 75 degrees, the shadow width is reduced and the brightness difference between the groove and the substrate is not obvious; if the incident angle is greater than 85 degrees, the light is almost parallel to the surface, the illumination brightness of the substrate area is too low, resulting in a decrease in the overall image contrast.
[0056] Furthermore, step S12 includes the following steps:
[0057] Step S121: Send a lighting command to the first grazing angle light source and turn off the light sources in the other three directions at the same time;
[0058] In one embodiment, a lighting command is sent to the first grazing angle light source via a communication bus, and a shutdown command is sent to the other three light sources at the same time, so as to ensure that only one light source is in working state at any given time, thereby avoiding shadow interference or brightness superposition caused by cross illumination of multiple light sources.
[0059] For example, when the light source on the east side is selected, the system sends a high-level signal to the light source driver through the digital output port, while simultaneously detecting that the status feedback signals of the other three light sources are all in the off state. After confirming that everything is correct, the system proceeds to the subsequent shooting preparation stage.
[0060] Step S122: Control the polarizer to rotate to a position parallel to the polarization direction of the first directional light source, wait for the polarizer to stabilize, and then trigger the camera to take a picture to obtain the first image of the first directional light source.
[0061] In one embodiment, after the first azimuth light source is illuminated, a motor driven by a polarizer control module adjusts a rotatable linear polarizer to a position parallel to the polarization direction of the light source. This process typically relies on a stepper motor or servo motor to drive the polarizer holder to precisely rotate to the target angular position. Once the polarizer is in position and the angular feedback signal is stable, the detection camera is triggered to take its first picture, thereby obtaining the first image of the first azimuth. This image mainly contains strong polarization components in the parallel polarization direction, which can highlight the surface reflection characteristics.
[0062] For example, when the polarization direction of the light source on the east side is 0°, the polarizer is rotated to the 0° position. After the system detects that the polarizer angle is stable, it immediately triggers the camera to acquire an image. After the acquisition is completed, the system names the image "East Side Parallel Polarization Image" and stores it in the image buffer area.
[0063] Step S123: Control the polarizer to rotate 90 degrees to a position perpendicular to the polarization direction of the first directional light source. After the polarizer has stabilized, trigger the camera to take a picture and obtain the second image from the first directional light source.
[0064] In one embodiment, after acquiring the first image, the system controls the polarizer to continue rotating 90 degrees, making its polarization direction perpendicular to the polarization direction of the light source in that direction. At this time, the reflected light received by the camera is mainly the diffuse reflection component, while the specular reflection component is effectively suppressed, thereby more accurately reflecting the true grayscale distribution of the surface morphology. When the polarizer rotates to the target position and the angle stabilizes, the system triggers the camera again to take a picture, acquiring a second image of that direction.
[0065] For example, when the polarizer is at the 0° position in step S122, the system drives it to rotate to 90°. After the rotation is completed, it waits for a stable signal to return, then acquires the image again and stores it as an "east-side vertical polarization image". The two images acquired through this complementary polarization method can separate the specular reflection and diffuse reflection components.
[0066] Step S124: Repeat steps S121 to S123 for the light sources in the second, third, and fourth positions in sequence to obtain image pairs in the second, third, and fourth positions respectively.
[0067] In one embodiment, after completing image acquisition in the first orientation, the system sequentially selects grazing angle light sources in the second, third, and fourth orientations, repeating the entire process from steps S121 to S123. Light source illumination, polarizer rotation, dual image acquisition, and storage operations are performed independently for each orientation.
[0068] It should be noted that, in order to ensure the coordinate consistency between multi-angle images, the system does not move the camera or workpiece each time the light source orientation is switched. Instead, it achieves multi-angle imaging only by switching the light source and polarizer, thereby ensuring the accuracy of subsequent image fusion and differential calculation.
[0069] Most importantly, the physical principle behind using a polarizer to rotate and capture two images in step S12 is as follows:
[0070] When linearly polarized light emitted from a grazing angle light source illuminates the watch face, the reflected light from the face maintains the same polarization direction as the incident light. However, the diffuse reflection light generated by the rough surface formed by laser ablation in the marking area will cause the polarization direction to become random.
[0071] When the transmission direction of the polarizer is parallel to the polarization direction of the light source, a large amount of specular reflected light can pass through the polarizer and enter the camera, while only about half of the diffuse reflected light can pass through. In this case, the specular reflection component dominates in the first image taken.
[0072] When the polarizer is rotated 90 degrees, its transmission direction is perpendicular to the polarization direction of the light source. Almost no specular reflection light can pass through the polarizer, while about half of the diffuse reflection light can still pass through. At this time, the specular reflection component in the second image is greatly suppressed.
[0073] By subtracting the second image from the first image, the specular reflection component shows a large positive value after the subtraction, while the diffuse reflection component of the marking area is close to zero after the subtraction because the transmittance is similar in the two images. This achieves the physical separation of specular reflection and marking features.
[0074] Furthermore, step S13 includes:
[0075] Align the first and second images taken under the same light source, subtract the gray value of the second image from the gray value of the first image, and store the subtraction result in the corresponding position to form a difference image with the same size as the original image.
[0076] In one embodiment, geometric registration is performed on the two images to eliminate pixel misalignment caused by polarizer rotation, mechanical jitter, or minor lens shift. Registration can be performed using feature-point-based methods (such as SIFT / ORB to detect keypoints, perform RANSAC estimation of affine or homography matrices, and then perform image transformation), or phase correlation can be used for subpixel-level translation alignment. The registration transformation can be performed using bilinear or cubic interpolation resampling to maintain grayscale continuity.
[0077] After registration, the first image (parallel polarization or strong polarization component) is subtracted from the second image (vertical polarization or weak polarization component) pixel by pixel. The difference value is usually obtained in the order of "the gray value of the first image minus the gray value of the second image". The difference result is stored in a data matrix of the same size as the original image according to the corresponding position. The difference matrix can be stored in signed integer or floating point type to retain positive and negative information.
[0078] For example, if the first image and the second image are grayscale images I1 and I2 respectively, then the difference image D = I1 − I2; if there is a sub-pixel deviation between the two images after registration, phase correlation calibration is used and I2 is resampled by cubic interpolation to obtain a more accurate D.
[0079] Calculate the average value and the range of fluctuation of all pixel values in the difference image;
[0080] In one embodiment, after obtaining the difference image D, denoising is first performed on D to reduce the influence of isolated noise points on the statistics. Common denoising methods include median filtering or small-scale Gaussian filtering. Then, the arithmetic mean of the pixels in the difference image is calculated. and statistics for measuring volatility (e.g., standard deviation) or another “numerical fluctuation range” (which can be defined as the interquartile range (IQR) of pixel values or the difference between the maximum and minimum values, depending on the system’s robustness requirements).
[0081] In this embodiment, standard deviation is preferably used. As a measure of volatility, so that subsequent actions can be taken according to " "Set a threshold to balance robustness and sensitivity."
[0082] For example, if the difference image is calculated after denoising... Therefore, the candidate threshold for specular reflection determination will be 12 + 2 × 6 = 24.
[0083] The threshold for determining specular reflection is obtained by adding twice the range of numerical fluctuation to the average value.
[0084] Iterate through each pixel of the difference image again, record the pixel positions where the subtraction result is greater than the specular reflection judgment threshold, and connect them to form a specular reflection interference region.
[0085] In one embodiment, the threshold T is set as a linear combination of the average value and the range of numerical fluctuations, for example... (or adjusted according to the actual sample) , (Empirical coefficients) are used to traverse the difference image D pixel by pixel, and the pixel positions that satisfy D(x,y)>T are marked as candidate specular reflection pixels, forming an initial binary mask M0. In order to suppress misjudgment of isolated noise points, morphological processing is performed on M0 (first, small noise points are removed by opening operation, and small holes are filled by closing operation), and connected component analysis (usually 8-connected) is applied to count the number of pixels and shape features of each connected region.
[0086] For example, the minimum connected region area threshold is set to... (For example, if the image resolution is 2048×2048, it can be...) (Set to 20 pixels), the area is smaller than Connected components are removed to avoid noise interference. For the retained connected components, their bounding boxes can be further calculated and shape constraints (such as aspect ratio or perimeter / area ratio) can be applied to determine whether they conform to typical specular highlight patterns. Finally, the filtered connected components are merged into a specular reflection interference region mask M, which is saved together with the corresponding position in the original second image for subsequent removal.
[0087] Furthermore, step S2 includes the following steps:
[0088] Step S21: Perform edge detection on the effective detection area in the second image, identify the pixel positions where the gray value changes abruptly, and connect them to form the boundary line between the marking groove and the base;
[0089] In one embodiment, Canny edge detection or Sobel operator detection is used to identify pixels with abrupt grayscale changes by calculating the rate of change of grayscale gradient within the neighborhood of a pixel. The detected edge points are connected according to their adjacency to form a continuous boundary curve, which is used to represent the boundary between the marking groove and the substrate.
[0090] For example, for the laser-engraved area of a watch case, the system first determines the center area of the circular dial as the effective detection range, and then identifies the boundary between the groove contour and the smooth base in the image, thereby obtaining the complete boundary line contour.
[0091] Step S22: Calculate the average horizontal and vertical coordinates of all pixels within the marking groove to determine the geometric center position;
[0092] In one embodiment, within the identified marking groove area, the horizontal and vertical coordinates of all pixels in the area are extracted, and their arithmetic mean is calculated as the coordinate position of the geometric center of the groove. This center point can be regarded as the location of the illumination or deformation centroid of the marking area, and is used for subsequent area sampling and brightness analysis.
[0093] For example, for a rectangular laser-engraved groove, if the average x-coordinate of the pixels within the groove boundary is 125 and the average y-coordinate is 240, then the geometric center position is (125, 240).
[0094] Step S23: Determine a 3×3 square region centered at the geometric center.
[0095] For example, when the geometric center coordinates are (125, 240), the 3×3 region contains 9 pixels with coordinates in the range x∈[124, 126] and y∈[239, 241]. By limiting the region to a fixed size, the local stability and comparability of the analysis results can be guaranteed.
[0096] Furthermore, step S2 also includes the following steps:
[0097] Step S24: Read the grayscale values of the pixels in the square area and calculate the average grayscale value to obtain the shadow brightness;
[0098] In one embodiment, the grayscale values of nine pixels in the aforementioned square region are read, and the average of all grayscale values is calculated to obtain the shadow brightness parameter. This parameter reflects the average reflection intensity at the center of the groove and can be used to distinguish marking effects of different depths or different surface roughnesses.
[0099] For example, if the grayscale values of the 9 pixels are [58, 60, 62, 59, 61, 60, 57, 59, 60], then the shadow brightness is (58+60+62+59+61+60+57+59+60) / 9=59.6.
[0100] Step S25: Extend outwards by three pixels along the base boundary line, and select one pixel every thirty degrees within the extended range, selecting a total of twelve pixels around the boundary line.
[0101] In one embodiment, a sampling ring is formed by extending three pixels outward from the base boundary line along the normal direction, using the base boundary line as a reference. Within this ring, a sampling direction is selected every 30 degrees, with the center point of the boundary line as the center, and pixels within the extended range are captured along the direction, for a total of twelve pixels.
[0102] For example, for an approximately circular marking area, the sampling angles can be 0°, 30°, 60°, 90°, 120°, 150°, 180°, 210°, 240°, 270°, 300°, and 330° respectively.
[0103] Step S26: Calculate the average grayscale value of the twelve pixels as the reference brightness.
[0104] In one embodiment, the grayscale values of each of the twelve pixels are read, and their average value is calculated as a reference brightness value. This reference brightness is used to characterize the overall reflection intensity of the non-recessed area and serves as a reference standard for subsequent shadow brightness comparison calculations.
[0105] For example, when the gray values of the twelve sampling points are [180,182,185,179,181,183,184,180,182,181,183,182], the average value is 181.75, and 182 can be taken as the reference brightness.
[0106] Furthermore, after identifying the boundary line between the marking groove and the substrate in step S21, the process also includes:
[0107] Calculate the perimeter of the base boundary line, and then calculate the ratio of the perimeter to the area of the region enclosed by the boundary line to obtain the shape complexity coefficient.
[0108] In one embodiment, after obtaining the complete boundary pixel sequence through a contour extraction algorithm, the number of pixels in the boundary pixel sequence is obtained to calculate the perimeter, and then the number of pixels within the boundary is directly counted to obtain the area of the closed region.
[0109] In one embodiment, the shape complexity coefficient can be defined as the ratio of the square of the perimeter to the area, which can reflect the flatness of the groove shape.
[0110] For example, if the perimeter of a marking groove is 120 pixels and the enclosed area is 1000 square pixels, then its shape complexity coefficient is... A larger coefficient indicates a more convoluted boundary and a more complex shape.
[0111] When the shape complexity coefficient exceeds the preset complexity limit, the base boundary line is smoothed and the protrusions on the base boundary line with a distance of less than two pixels between adjacent pixels are removed.
[0112] In one embodiment, when the shape complexity coefficient exceeds a preset complexity upper limit, a boundary smoothing algorithm based on curve fitting or median filtering is used to detect the protrusion between adjacent pixels on the base boundary line. When the distance between adjacent pixels is less than two pixels, it is determined to be a local protrusion, and the boundary segment is reconnected by interpolation or straight line, thereby removing unreasonable small fluctuations.
[0113] For example, if there are multiple adjacent pixels protruding from the main outline by 1 pixel on the boundary line in a certain local area, then after smoothing, this part is replaced with a smooth curve, and the overall boundary is more regular.
[0114] Update the shape complexity coefficient based on the perimeter of the re-smoothed boundary line and the area of the enclosed region.
[0115] In one embodiment, after the boundary line is smoothed, the perimeter and the area of the enclosed region are recalculated based on the new boundary data, thereby updating the shape complexity coefficient. The process is the same as the initial calculation, using the ratio of boundary length to area.
[0116] For example, after smoothing, the perimeter of the boundary line of a groove is reduced from 120 pixels to 110 pixels, while the area remains approximately 1000 square pixels. The updated shape complexity coefficient is then: This indicates that the shape tends to be regular.
[0117] If the updated shape complexity coefficient still exceeds the preset complexity limit, the groove is marked as an abnormal groove and will not participate in subsequent shadow brightness and reference brightness calculations.
[0118] In one embodiment, if the updated shape complexity coefficient still exceeds a preset complexity upper limit, the groove will be automatically marked as an abnormal groove and will not participate in the subsequent calculation of shadow brightness and reference brightness. This step aims to prevent non-standard grooves caused by damage, ghosting, or engraving abnormalities from affecting the overall analysis results.
[0119] For example, if the preset complexity limit is 12, and the complexity coefficient of a certain groove is still 13.5 after smoothing, the system will mark the groove as an abnormal groove and skip the region in the subsequent brightness analysis stage.
[0120] Furthermore, step S3 includes the following steps:
[0121] Step S31: Subtract the shadow brightness value from the reference brightness value to obtain the brightness difference value;
[0122] In one embodiment, the obtained brightness difference value is used to reflect the degree of light and dark variation between the marking groove and the surrounding substrate, thereby reflecting the visual differences in engraving depth and surface roughness. The larger the obtained brightness difference value, the more significant the decrease in light reflection ability of the groove area relative to the substrate, that is, the stronger the engraving depth or light absorption effect.
[0123] For example, if the reference brightness is 180 grayscale value and the shadow brightness is 90 grayscale value, then the brightness difference is 90.
[0124] Step S32: Divide the brightness difference by the reference brightness value to obtain the local contrast of that location;
[0125] In one embodiment, to eliminate the absolute brightness shift caused by differences in light source intensity or reflectivity, and to make the result only related to the surface morphology, the local contrast ratio is calculated as (reference brightness - shadow brightness) / reference brightness. The local contrast ratio quantifies the relative brightness difference between the marking area and the background area, and is a key indicator for measuring the clarity and visual recognizability of the engraving.
[0126] For example, if the reference brightness is 180 and the shadow brightness is 90, then the local contrast ratio = (180 - 90) / 180 = 0.5, indicating that the groove is relatively deep and the visual layers are obvious.
[0127] Step S33: Repeat the calculation for the four directions in sequence to obtain the local contrast of the first direction, the local contrast of the second direction, the local contrast of the third direction, and the local contrast of the fourth direction respectively;
[0128] In one embodiment, to avoid the loss of local information caused by unidirectional illumination, the above calculation is repeated for the four directions in sequence to obtain the local contrast of the first direction, the local contrast of the second direction, the local contrast of the third direction, and the local contrast of the fourth direction, respectively.
[0129] For example, the local contrast ratios obtained in the four directions are 0.48, 0.51, 0.47, and 0.53, respectively, indicating that the overall groove reflection distribution is uniform and the engraving quality is stable.
[0130] Step S34: Add the local contrast values from the four directions together and divide by four to obtain the overall contrast value.
[0131] For example, if the local contrast ratios of the four directions are 0.48, 0.51, 0.47 and 0.53 respectively, the overall contrast ratio is 0.4975, which can be rounded to 0.50, indicating that the overall marking quality is good and the lighting effect is balanced.
[0132] It should be noted that the reason for averaging the local contrast from four directions in step S3 is as follows:
[0133] The groove cross-section formed by laser marking may have an asymmetrical V-shaped or U-shaped shape, and the inclination angles of the two side walls of the groove may differ.
[0134] When grazing light shines from a single direction, only one sidewall of the groove is illuminated, while the other sidewall is in shadow, causing the measured shadow width to be affected by the asymmetry of the groove shape.
[0135] By setting light sources at four positions—0°, 90°, 180°, and 270°—and illuminating different sidewalls of the groove at each position, four sets of independent shadow measurement results were obtained.
[0136] The sum of the four local contrast values and the average of the sums can offset the unidirectional measurement deviation caused by the asymmetry of the groove shape, so that the final comprehensive contrast can more accurately reflect the actual depth of the groove.
[0137] Experimental comparisons show that after using four-directional averaging, the fluctuation range of repeated measurements of the same groove is reduced from ±1.5 micrometers in single-directional measurement to ±0.5 micrometers.
[0138] Furthermore, step S4 includes the following steps:
[0139] Step S41: Read the pre-established calibration relationship, which includes the slope coefficient and intercept coefficient;
[0140] In one embodiment, a pre-established calibration relationship is read from non-volatile memory or a remote database. This calibration relationship includes at least the slope coefficient (k) and intercept coefficient (b) of a linear mapping, used to map the overall contrast value (C) obtained from the image to a physical depth value (D). This calibration relationship can be obtained by experimentally measuring and fitting a series of standard samples with known depths. The fitting method can employ least squares linear regression or weighted regression to obtain relatively stable k and b values.
[0141] For example, if k=1250μm and b=−10μm are obtained through calibration experiments (the units here are just examples), then the comprehensive contrast can be directly applied to the linear model for depth calculation.
[0142] Step S42: Multiply the overall contrast by the slope coefficient, add the intercept coefficient to the product, and obtain the marking depth number;
[0143] In one embodiment, the overall contrast ratio C is substituted into the calibration relationship for depth conversion. The calculation process is D = k·C + b, where k is the slope coefficient, b is the intercept coefficient, and D is the calculated marking depth. Numerical precision should be maintained during the calculation (e.g., using floating-point arithmetic), and the original input C and output D should be recorded for traceability.
[0144] For example, if the overall contrast ratio C = 0.50 and the calibration coefficients k = 1250 μm and b = −10 μm, then the calculated marking depth D = 1250 × 0.50 − 10 = 615 μm.
[0145] Step S43: Divide the marking area into several sampling points at equal intervals, and add up the marking depth values of all sampling points and divide by the total number of sampling points to obtain the average depth.
[0146] In one embodiment, the number and distribution of sampling points can be set according to the size of the marking area and the required resolution. For example, for a circular marking area with a diameter of 2mm, sampling can be performed radially at equal intervals starting from the center and arranged in a ring or grid pattern. The total number of sampling points can be set to N=49 (7×7 grid) or other suitable values. For each sampling point, the overall contrast is calculated using the image data corresponding to that point, and the marking depth of that point is obtained through calibration relationships. Then, the depth values of all sampling points are summed and divided by the total number of sampling points N to obtain the average depth. .
[0147] For example, if the depths measured at 9 equally spaced sampling points are [610, 615, 620, 612, 618, 617, 613, 616, 614] The average depth is approximately 615. m.
[0148] Step S44: Calculate the difference between the marking depth value of each sampling point and the average depth value, add up the squares of all the differences, divide by the total number of sampling points, and then take the square root of the result to obtain the depth fluctuation range;
[0149] In one embodiment, based on the depth of each sampling point and average depth Calculate the deviation of each sampling point from the average value. = - The unbiased or biased estimate of the variance is obtained by summing the squares of all deviations and dividing by the total number of sampling points N (the population standard deviation formula is used here). This value serves as a quantitative indicator of depth fluctuation amplitude, reflecting the spatial consistency of the marking depth.
[0150] For example, if the above 9 depth values lead to =81( The depth fluctuation amplitude .
[0151] Step S45: Compare the average depth with the preset minimum acceptable depth. When the average depth is greater than or equal to the preset minimum acceptable depth, record the depth judgment result as passed. Compare the depth fluctuation amplitude with the preset uniformity limit. When the depth fluctuation amplitude is less than or equal to the preset uniformity limit, record the uniformity judgment result as passed.
[0152] In one embodiment, the average depth is... With the preset minimum acceptable depth If a comparison is made, ≥ The depth determination result is recorded as "pass" if it is true, and "fail" otherwise; the depth fluctuation range is also recorded. With respect to the preset uniformity limit If a comparison is made, ≤ If the uniformity determination result is recorded as passed, then it is recorded as failed.
[0153] For example, if =600 and =5 And measured = , If both criteria are met, then both judgments are passed; if If uniformity is not met, the test result is considered unsuccessful.
[0154] It should be noted that, and The settings should be based on process requirements and experience values and can be configured in different grades according to product model and marking style; in addition, in practical applications, it is permissible to provide graded warnings (such as warning / retest / rejection) for depth or uniformity, rather than just binary pass / fail.
[0155] Step S46: When both the depth judgment result and the uniformity judgment result are passed, output a judgment that the marking quality is qualified; when the depth judgment result is failed or the uniformity judgment result is failed, output a judgment that the marking quality is unqualified.
[0156] In one embodiment, when both the depth and uniformity determination results are passed, the system outputs a "marking quality qualified" judgment and records all original values, judgment thresholds, and calibration coefficients in the inspection report for traceability; when either judgment is failed, the system outputs a "marking quality unqualified" judgment and writes the reason for the unqualified result (such as "insufficient depth" or "uniformity exceeding the limit" or both are abnormal) into the report, and can trigger subsequent processing measures (such as prompting remarking, adjusting laser parameters, or sending the workpiece to manual re-inspection).
[0157] For example, if the depth determination fails but the uniformity determination passes, the report can be marked as "Unqualified - Shallow depth", and it can be recommended to increase the laser energy or the number of repetitions to improve the depth.
[0158] See Figure 4 The present invention also provides a quality inspection system 100 for marking laser engraving machines in watch processing, used to perform the above-described quality inspection method for marking laser engraving machines in watch processing. The quality inspection system 100 for marking laser engraving machines in watch processing includes:
[0159] The grazing polarization imaging module 101 is used to capture four sets of image pairs at the watch marking station using a detection camera through a light source at a grazing angle; and to remove specular reflection interference from the four sets of image pairs to obtain the effective detection area.
[0160] The local brightness extraction module 102 is used to identify the marking groove within the effective detection area, calculate the average gray value of the pixels in the central area inside the groove as the shadow brightness, and calculate the average gray value of the pixels in the adjacent base area as the reference brightness.
[0161] The multi-directional contrast calculation module 103 is used to use the ratio of the difference between the reference brightness and the shadow brightness to the reference brightness as the local contrast; and to take the average of the local contrasts as the comprehensive contrast.
[0162] The quality judgment module 104 is used to convert the comprehensive contrast into a marking depth value according to the pre-established calibration relationship, and to statistically analyze the average depth and depth fluctuation of each point in the marking area. When the average depth reaches the preset minimum qualified depth requirement and the depth fluctuation does not exceed the preset uniformity limit, the marking quality is judged to be qualified.
[0163] Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of the equivalents of the application are intended to be included within the invention.
[0164] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features of the invention herein.
Claims
1. A method for inspecting the marking quality of a laser engraving machine in watch processing, characterized in that, Includes the following steps: Step S1: Using a light source with a grazing angle, four sets of image pairs are captured at the watch marking station using an inspection camera; By removing specular reflection interference from the four sets of images, the effective detection area is obtained. Step S2: Identify the marking groove within the effective detection area, calculate the average grayscale value of the pixels in the central region inside the groove as the shadow brightness, and calculate the average grayscale value of the pixels in the adjacent base region as the reference brightness; Step S2 includes: Step S21: Perform edge detection on the effective detection area in the second image, identify the pixel positions where the gray value changes abruptly, and connect them to form the boundary line between the marking groove and the base; Step S22: Calculate the average horizontal and vertical coordinates of all pixels within the marking groove to determine the geometric center position; Step S23: Determine the 3 points centered on the geometric center position. A square area of 3; Step S24: Read the grayscale values of the pixels in the square area and calculate the average grayscale value to obtain the shadow brightness; Step S25: Extend outwards by three pixels along the base boundary line, and select one pixel every thirty degrees within the extended range, selecting a total of twelve pixels around the boundary line. Step S26: Calculate the average grayscale value of the twelve pixels as the reference brightness; Step S3: Use the ratio of the difference between the reference brightness and the shadow brightness to the reference brightness as the local contrast; take the average of the local contrasts as the overall contrast. Step S4: Convert the comprehensive contrast to a marking depth value according to the pre-established calibration relationship, and calculate the average depth and depth fluctuation of each point in the marking area; when the average depth reaches the preset minimum qualified depth requirement and the depth fluctuation does not exceed the preset uniformity limit, the marking quality is judged to be qualified.
2. The method for inspecting the marking quality of a laser engraving machine in watch processing according to claim 1, characterized in that, Step S1 includes the following steps: Step S11: Set up grazing angle light sources at the four positions of the watch marking station, set the angle between each light and the normal of the watch case surface to 80 degrees, and install a rotatable linear polarizer in front of the lens of the inspection camera. Step S12: Light up the grazing angle light source in sequence. When the light source is lit, adjust the polarizer to a position parallel to the polarization direction of the light source and take the first image. Rotate the polarizer 90 degrees and take the second image to obtain four sets of image pairs. Step S13: Subtract the first and second images in the four image pairs pixel by pixel to obtain four difference images, and identify and mark the regions in each difference image whose pixel values exceed a preset threshold as specular reflection interference regions. Step S14: Remove the corresponding specular reflection interference area in the second image to obtain the effective detection area.
3. The method for inspecting the marking quality of a laser engraving machine in watch processing according to claim 2, characterized in that, Step S12 includes the following steps: Step S121: Send a lighting command to the first grazing angle light source and turn off the light sources in the other three directions at the same time; Step S122: Control the polarizer to rotate to a position parallel to the polarization direction of the first directional light source, wait for the polarizer to stabilize, and then trigger the camera to take a picture to obtain the first image of the first directional light source. Step S123: Control the polarizer to rotate 90 degrees to a position perpendicular to the polarization direction of the first directional light source. After the polarizer has stabilized, trigger the camera to take a picture and obtain the second image from the first directional light source. Step S124: Repeat steps S121 to S123 for the light sources in the second, third, and fourth positions in sequence to obtain image pairs in the second, third, and fourth positions respectively.
4. The method for inspecting the marking quality of a laser engraving machine in watch processing according to claim 3, characterized in that, Step S13 includes: Align the first and second images taken under the same light source, subtract the gray value of the second image from the gray value of the first image, and store the subtraction result in the corresponding position to form a difference image with the same size as the original image. Calculate the average value and the range of fluctuation of all pixel values in the difference image; The threshold for determining specular reflection is obtained by adding twice the range of numerical fluctuation to the average value. Iterate through each pixel of the difference image again, record the pixel positions where the subtraction result is greater than the specular reflection judgment threshold, and connect them to form a specular reflection interference region.
5. The method for inspecting the marking quality of a laser engraving machine in watch processing according to claim 4, characterized in that, After identifying the boundary line between the marking groove and the substrate in step S21, the following steps are also included: Calculate the perimeter of the base boundary line, and then calculate the ratio of the perimeter to the area of the region enclosed by the boundary line to obtain the shape complexity coefficient. When the shape complexity coefficient exceeds the preset complexity limit, the base boundary line is smoothed and the protrusions on the base boundary line with a distance of less than two pixels between adjacent pixels are removed. Update the shape complexity coefficient based on the perimeter of the re-smoothed boundary line and the area of the enclosed region. If the updated shape complexity coefficient still exceeds the preset complexity limit, the groove is marked as an abnormal groove and will not participate in subsequent shadow brightness and reference brightness calculations.
6. The method for detecting the marking quality of a laser engraving machine in watch processing according to claim 5, characterized in that, Step S3 includes the following steps: Step S31: Subtract the shadow brightness value from the reference brightness value to obtain the brightness difference value; Step S32: Divide the brightness difference by the reference brightness value to obtain the local contrast of that location; Step S33: Repeat the calculation for the four directions in sequence to obtain the local contrast of the first direction, the local contrast of the second direction, the local contrast of the third direction, and the local contrast of the fourth direction respectively; Step S34: Add the local contrast values from the four directions together and divide by four to obtain the overall contrast value.
7. The method for inspecting the marking quality of a laser engraving machine in watch processing according to claim 6, characterized in that, Step S4 includes the following steps: Step S41: Read the pre-established calibration relationship, which includes the slope coefficient and intercept coefficient; Step S42: Multiply the overall contrast by the slope coefficient, add the intercept coefficient to the product, and obtain the marking depth number; Step S43: Divide the marking area into several sampling points at equal intervals, and add up the marking depth values of all sampling points and divide by the total number of sampling points to obtain the average depth. Step S44: Calculate the difference between the marking depth value of each sampling point and the average depth value, add up the squares of all the differences, divide by the total number of sampling points, and then take the square root of the result to obtain the depth fluctuation range; Step S45: Compare the average depth with the preset minimum acceptable depth. When the average depth is greater than or equal to the preset minimum acceptable depth, record the depth judgment result as passed. Compare the depth fluctuation amplitude with the preset uniformity limit. When the depth fluctuation amplitude is less than or equal to the preset uniformity limit, record the uniformity judgment result as passed. Step S46: When both the depth judgment result and the uniformity judgment result are passed, output a judgment that the marking quality is qualified; when the depth judgment result is failed or the uniformity judgment result is failed, output a judgment that the marking quality is unqualified.
8. A quality inspection system for marking on a laser engraving machine used in watch processing, characterized in that, For performing the marking quality inspection method for a watchmaking laser engraving machine as described in claim 1, the watchmaking laser engraving machine marking quality inspection system comprises: The grazing polarization imaging module is used to capture four sets of image pairs at the watch marking station using a detection camera through a light source at a grazing angle; the specular reflection interference in the four sets of image pairs is removed to obtain the effective detection area; The local brightness extraction module is used to identify the marking groove within the effective detection area, calculate the average gray value of the pixels in the central area inside the groove as the shadow brightness, and calculate the average gray value of the pixels in the adjacent base area as the reference brightness. The multi-directional contrast calculation module is used to use the ratio of the difference between the reference brightness and the shadow brightness to the reference brightness as the local contrast; and to take the average of the local contrasts as the comprehensive contrast. The quality judgment module is used to convert the comprehensive contrast into a marking depth value according to the pre-established calibration relationship, and to count the average depth and depth fluctuation of each point in the marking area. When the average depth reaches the preset minimum qualified depth requirement and the depth fluctuation does not exceed the preset uniformity limit, the marking quality is judged to be qualified.