Diamond cutting camera auto focus method

By using a dot calibration plate and an autofocus algorithm in diamond cutting equipment, automatic camera focusing was achieved, solving the problems of accuracy and consistency in manual focusing and improving processing accuracy and efficiency.

CN122372837APending Publication Date: 2026-07-10INNOVISION INTELLIGENT TECH (HANGZHOU) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
INNOVISION INTELLIGENT TECH (HANGZHOU) CO LTD
Filing Date
2026-04-10
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

In existing diamond cutting equipment, camera focusing relies on manual adjustment, which makes it difficult to guarantee focusing accuracy and consistency, affecting processing precision and efficiency.

Method used

Using a dot calibration plate and an autofocus algorithm, the camera moves along the Z-axis to acquire images. Combining coarse positioning and fine search stages, the optimal focus position is automatically determined, and the sharpness score is calculated using ROI and the Brenner evaluation function.

Benefits of technology

It improves focusing accuracy and stability, enhances adaptability to scale changes, and significantly increases focusing speed and system response efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122372837A_ABST
    Figure CN122372837A_ABST
Patent Text Reader

Abstract

The application discloses a diamond cutting camera automatic focusing method and relates to the technical field of numerical control machining, which comprises the following steps: placing a round dot calibration board on a rotary table, controlling a camera to move downwards along a Z axis to collect calibration board images at different positions; performing scaling and denoising processing on each image, detecting a circular spot in a layered concentric identification area, and selecting a nearest spot from an image center to determine an ROI; in a coarse positioning stage, a first step is used to obtain a sequence of sharpness scores and determine a focal point candidate interval, and in a fine search stage, a second step is used to score each point in the candidate interval and determine a position with the maximum score as a focusing position. Through two-stage search and adaptive selection of the ROI based on the layered identification area, the focusing process is quickly converged, and the focusing accuracy and stability are improved; through image scaling and ROI local sharpness evaluation, the calculation amount is reduced, the focusing speed and system response efficiency are improved, and the accuracy and comparability of the sharpness evaluation under different imaging scales are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of CNC machining technology, specifically to an automatic focusing method for a diamond cutting camera. Background Technology

[0002] In high-precision CNC machining scenarios such as diamond cutting, the camera is often placed above the turntable along with the laser cutting head for alignment, monitoring, and visual assistance during the cutting process. After the laser cutting head has focused, to ensure the accuracy of the cutting position and machining trajectory, the camera focus and laser focus must be precisely aligned to ensure that the area of ​​sharp image from the camera matches the actual focal plane of the laser machining process.

[0003] In existing diamond cutting equipment, the camera is mostly fixedly mounted within the system, making it difficult to adjust the focus by adjusting the camera's focus ring. Actual focusing typically relies on manual control of the camera's vertical movement along the Z-axis, with the optimal focus position determined by visually observing the sharpness of the image on a calibrated pattern or target area. This method heavily depends on the operator's experience and subjective judgment, and is easily affected by lighting conditions, visual fatigue, and observation habits, leading to difficulties in ensuring the accuracy and consistency of the focus position. This, in turn, affects the alignment of the camera's focus with the laser's focus, failing to meet the high precision, high stability, and high efficiency requirements of diamond cutting. Furthermore, the manual, gradual movement and repeated observation of the focusing process is time-consuming and inefficient, hindering improvements in equipment cycle time and processing continuity. Summary of the Invention

[0004] Based on the shortcomings of the prior art described above, the purpose of this invention is to provide an autofocus method for a diamond-cutting camera to solve the aforementioned technical problems.

[0005] To achieve the above objectives, the present invention provides the following technical solution: an autofocus method for a diamond-cut camera, comprising: Place the dot calibration plate on the turntable and control the camera to move from top to bottom along the Z-axis to acquire images of the calibration plate at different Z-axis positions; For each image, determine the region of interest (ROI) and calculate the corresponding sharpness score; In the coarse positioning stage, the first moving step L1 is used to gradually move down from the upper limit Z1 of the Z axis, and the candidate interval where the focus is located is determined based on the rising or falling trend of the sharpness score of adjacent positions. During the fine search phase, images are acquired point by point within the candidate interval with a second moving step L2 and a sharpness score is calculated. The Z-axis position with the highest sharpness score is taken as the focus position. The focus position is fed back to the control system and the camera is moved to the focus position. The ROI is determined by detecting circular spots in the image and selecting the spot closest to the center of the image.

[0006] The present invention is further configured such that the dot calibration plate is a calibration plate having multiple circular marks, and the dot calibration plate is arranged on a turntable such that the camera's field of view covers at least one circular mark, for providing a target pattern for focus evaluation.

[0007] The present invention is further configured such that the coarse positioning stage includes: when the sharpness score at adjacent positions changes from a continuous increase to a decrease, determining the Z-axis range corresponding to a preset number of sampling positions on both sides of the peak position as the candidate interval.

[0008] The present invention is further configured such that the second moving step L2 is smaller than the first moving step L1, and the fine search stage covers all sampling positions in the candidate interval with step L2 to obtain a sharpness score sequence and selects the position corresponding to the maximum value as the focus position.

[0009] The present invention is further configured such that determining the ROI includes: scaling the acquired original image to a preset ratio and then performing denoising processing, and then performing circular spot detection on the denoised image to determine candidate spots.

[0010] The present invention is further configured such that circular spot detection is performed in layers within multiple concentric recognition regions, wherein the center of the recognition region is aligned with the center of the image, and the size of each recognition region increases sequentially.

[0011] The present invention is further configured such that the size of the recognition area is set to 1 / 8, 1 / 4, 1 / 2 and 1 times the minimum side length of the image, and circular spots are preferentially detected within the minimum recognition area. If no circular spots are detected, the recognition area is gradually expanded in the above order until the entire image is captured.

[0012] The present invention is further configured such that the ROI is obtained by determining the circumscribed rectangle of the circular spot closest to the center of the image, and the sharpness score is calculated only within the ROI, so as to keep the focus evaluation area corresponding to the same target spot at different Z-axis positions.

[0013] The present invention is further configured such that when no circular spot is detected within the entire image area, the image at that location is determined not to participate in the sharpness scoring, and the sharpness score at that location is skipped during the coarse localization or fine search stage.

[0014] The present invention is further configured such that the sharpness score is calculated using the Brenner evaluation function, specifically by subtracting the grayscale image at pixel intervals within the ROI and accumulating the results to obtain a sharpness value, and the larger the sharpness value, the sharper the image, thereby determining the Z-axis position with the highest sharpness score as the focus position.

[0015] This invention provides an autofocus method for a diamond-cutting camera. The method involves placing a dot calibration plate on a turntable and controlling the camera to move downwards along the Z-axis, acquiring images of the calibration plate at different Z-axis positions. For each image, a Region of Interest (ROI) is determined and its corresponding sharpness score is calculated. In a coarse positioning stage, the camera gradually moves downwards from the upper limit Z1 of the Z-axis with a first movement step L1, determining a candidate region for the focus point based on the rising or falling trend of sharpness scores at adjacent positions. In a fine search stage, images are acquired point-by-point within the candidate region with a second movement step L2, and sharpness scores are calculated. The Z-axis position with the highest sharpness score is selected as the focus position. The focus position is fed back to the control system, which then controls the camera to move to the focus position. The ROI is determined by detecting circular spots in the image and selecting the spot closest to the image center. The beneficial effects include: 1. Effectively improve focusing accuracy and stability: Through the dual-stage focusing mechanism of "coarse positioning + fine search", the general focus area is first quickly locked, and then a fine search is carried out with small steps. This effectively overcomes the problem that traditional single search strategies are easily affected by local extreme values, and ensures that the system can converge to the optimal focal plane stably and accurately. 2. Significantly Enhanced Adaptability to Scale Changes: By setting up layered recognition regions and dynamically adjusting the ROI, the inconsistency in sharpness evaluation caused by changes in the imaging field of view during Z-axis movement is resolved. This method can automatically adapt to different imaging scales, ensuring the consistency of the physical dimensions corresponding to the evaluation regions, thereby guaranteeing the accuracy and comparability of sharpness evaluation results.

[0016] 3. Significantly improves focusing speed and system response efficiency: By adopting image scaling and ROI local evaluation strategies, the processing target is transformed from the entire high-resolution image into a small ROI, which significantly reduces the processing time of a single frame image and effectively improves the overall focusing speed of the system.

[0017] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings: Figure 1 A flowchart illustrating an autofocus method for a diamond-cut camera, as shown in an exemplary embodiment of the present invention; Figure 2 A schematic diagram illustrating the layered concentric identification region setting as an exemplary embodiment of the present invention; Figure 3 A schematic diagram illustrating the extraction of the nearest center circular spot and the determination of the ROI bounding rectangle is shown as an exemplary embodiment of the present invention; Figure 4 A schematic diagram illustrating the final ROI extraction result as an exemplary embodiment of the present invention; Figure 5 This is a schematic diagram illustrating the change in ROI sharpness score with Z-axis position, as shown in an exemplary embodiment of the present invention. Detailed Implementation

[0019] The embodiments of the present invention will be described below with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention and not for limiting the scope of protection of the present invention.

[0020] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Therefore, the drawings only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.

[0021] In the following description, numerous details are explored to provide a more thorough explanation of embodiments of the invention. However, it will be apparent to those skilled in the art that embodiments of the invention may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring embodiments of the invention.

[0022] An autofocus method for diamond-cut cameras, such as Figure 1 As shown, it includes: Place the dot calibration plate on the turntable and control the camera to move from top to bottom along the Z-axis to acquire images of the calibration plate at different Z-axis positions; For each image, determine the region of interest (ROI) and calculate the corresponding sharpness score; In the coarse positioning stage, the first moving step L1 is used to gradually move down from the upper limit Z1 of the Z axis, and the candidate interval where the focus is located is determined based on the rising or falling trend of the sharpness score of adjacent positions. In the fine search stage, images are collected point by point within the candidate interval at the second moving step L2, and the clarity score is calculated. The Z-axis position with the maximum clarity score is taken as the focus position. The focus position is fed back to the control system and the camera is controlled to move to the focus position. Among them, the ROI is determined by detecting circular spots in the image and selecting the spot closest to the center of the image.

[0023] Specifically, place the dot calibration plate on the turntable, control the camera to move from top to bottom, and collect calibration plate images at different Z-axis positions.

[0024] Coarse positioning stage: Based on the hill climbing method, initially determine the approximate interval where the focus is located. Determine the moving step L, starting from the Z-axis upper limit Z1 and gradually moving down. Every time it moves to a position zi, collect an image and calculate its clarity score si. Fine search stage: Set a smaller moving step L2 (L2 < L1). Within the interval determined by the coarse positioning, move the Z-axis at the step L2 and collect images at all positions within this interval. Calculate the clarity score corresponding to each image, and determine the Z-axis position corresponding to the highest score. This position is the focus position.

[0025] Feed the focus position back to the control system and move the camera to the focus position.

[0026] In the search stage, it is necessary to calculate the clarity score of the region of interest (ROI) in the image as the evaluation basis to ensure that the physical size corresponding to the evaluated region remains consistent during the Z-axis movement, and at the same time effectively improve the image processing speed.

[0027] ROI selection and clarity evaluation method are as follows: Scale the original image to 1 / 4 size (halve both the length and width), and perform denoising on the scaled image to improve the detection speed and avoid misidentifying non-spot regions as ROI.

[0028] In the denoised image, set multiple recognition regions with the same size in layers. The centers of each region are aligned with the center of the image, and their sizes are set to 1 / 8, 1 / 4, 1 / 2, and 1 times the minimum side length of the image, as Figure 2 shown.

[0029] First, detect circular spots in the smallest recognition region (1 / 8 side length), select the spot closest to the center of the image, and set an external rectangle based on this spot as the ROI, as Figure 3 shown; If no circular spots are detected at this level, the recognition area is gradually expanded (in turn, to 1 / 4, 1 / 2, and 1 times the side length). If no circular spots are detected across the entire image, the image quality is considered poor and it will not be included in the sharpness score.

[0030] Image sharpness is calculated based on the selected Region of Interest (ROI), using the Brenner evaluation function as the sharpness evaluation standard. The image with the highest score is determined to be the sharpest image. After the sharpness calculation for one region is completed, the sharpness of the next region is recalculated starting from the coarse localization. The final extracted ROI image is shown below. Figure 4 As shown, the changes in the sharpness index are as follows: Figure 5 As shown.

[0031] Brenner is a no-reference image sharpness evaluation method that assesses sharpness by calculating the gray-level difference between two adjacent pixels in an image. Its core formula is: Where: f(x,y) represents the gray value of the pixel (x,y) corresponding to image f, and D(f) is the image sharpness calculation result. The larger the value, the sharper the image.

[0032] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. An autofocus method for a diamond-cut camera, characterized in that, include: Place the dot calibration plate on the turntable and control the camera to move from top to bottom along the Z-axis to acquire images of the calibration plate at different Z-axis positions; For each image, determine the region of interest (ROI) and calculate the corresponding sharpness score; In the coarse positioning stage, the first moving step L1 is used to gradually move down from the upper limit Z1 of the Z axis, and the candidate interval where the focus is located is determined based on the rising or falling trend of the sharpness score of adjacent positions. During the fine search phase, images are acquired point by point within the candidate interval with a second moving step L2 and a sharpness score is calculated. The Z-axis position with the highest sharpness score is taken as the focus position. The focus position is fed back to the control system and the camera is moved to the focus position. The ROI is determined by detecting circular spots in the image and selecting the spot closest to the center of the image.

2. The method for autofocusing a diamond-cutting camera according to claim 1, characterized in that, The dot calibration plate is a calibration plate with multiple circular marks. The dot calibration plate is arranged on a turntable so that the camera's field of view covers at least one circular mark, which is used to provide a target pattern for focus evaluation.

3. The method for autofocusing a diamond-cutting camera according to claim 1, characterized in that, The coarse positioning stage includes: when the sharpness score at adjacent positions changes from a continuous increase to a decrease, determining the Z-axis range corresponding to the preset number of sampling positions on both sides of the peak position as the candidate interval.

4. The method for autofocusing a diamond-cutting camera according to claim 1, characterized in that, The second movement step L2 is smaller than the first movement step L1, and the fine search stage covers all sampling positions in the candidate interval with step L2 to obtain a sharpness score sequence and selects the position corresponding to the maximum value as the focus position.

5. The method for autofocusing a diamond-cut camera according to claim 1, characterized in that, Determining the ROI involves scaling the acquired original image to a preset ratio, denoising it, and then performing circular spot detection on the denoised image to identify candidate spots.

6. The method for autofocusing a diamond-cut camera according to claim 5, characterized in that, Circular spot detection is performed layer by layer in multiple concentric recognition regions, the center of which is aligned with the center of the image, and the size of each recognition region increases sequentially.

7. The method for autofocusing a diamond-cut camera according to claim 6, characterized in that, The size of the recognition area is set to 1 / 8, 1 / 4, 1 / 2 and 1 times the minimum side length of the image, and circular spots are detected first in the smallest recognition area. If no circular spots are detected, the recognition area is gradually expanded in the above order until the entire image is captured.

8. The method for autofocusing a diamond-cutting camera according to claim 1, characterized in that, The ROI is obtained by determining the bounding rectangle of the circular spot closest to the center of the image, and the sharpness score is calculated only within the ROI to ensure that the focus evaluation area corresponds to the same target spot at different Z-axis positions.

9. The method for autofocusing a diamond-cutting camera according to claim 1, characterized in that, If no circular spots are detected across the entire image, the image at that location is determined not to participate in the sharpness scoring, and the sharpness score for that location is skipped during the coarse localization or fine search phase.

10. The method for autofocusing a diamond-cutting camera according to claim 1, characterized in that, The sharpness score is calculated using the Brenner evaluation function. Specifically, the grayscale image is subtracted at pixel intervals within the ROI and the sharpness value is accumulated to obtain the sharpness value. The larger the sharpness value, the sharper the image. Thus, the Z-axis position with the highest sharpness score is determined as the focus position.