Numerical control equipment control method and system based on image recognition

By collecting data in real time on the smart pen and optimizing the pressure threshold, turning on the camera, identifying the writing trajectory and using algorithms to optimize the processing path, the problem that CNC equipment in the existing technology is difficult to adapt to complex processing needs, and a more efficient and accurate processing path is achieved Generate and execute.

CN119065316APending Publication Date: 2024-12-03SUXIANG HUIXIN TECHNOLOGY (SHANGHAI) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411171100.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

The existing CNC equipment control methods based on image recognition are difficult to adapt to the complex processing needs of real-time dynamic input, and the generation of processing paths is not accurate and efficient enough.

Method used

By installing sensors on the smart pen to collect pressure and angle data, optimize the pressure threshold in real time, turn on the camera, identify the coded and record writing trajectory on the writing paper, obtain the trajectory coordinates and endpoints, and use greedy algorithms and dynamic programming algorithms to optimize the processing path. CNC equipment is the best Optimize the path for processing.

Benefits of technology

It improves the flexibility and accuracy of trajectory collection, enhances the accuracy of trajectory extraction, improves processing efficiency, and reduces costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119065316A_ABST
    Figure CN119065316A_ABST
Patent Text Reader

Abstract

The invention discloses a numerical control equipment control method and system based on image recognition, and relates to the technical field of equipment control, and the method comprises the steps: installing a sensor on an intelligent pen, collecting pressure data and angle data, optimizing a pressure threshold value in real time, and starting a camera according to the pressure threshold value; identifying a coding record writing track on the writing paper through a camera, and obtaining track coordinates and end points; an optimal machining path is determined according to the track end points, and the numerical control equipment conducts machining according to the optimal machining path; and the numerical control equipment displays the machining track in real time and records the optimal machining path. The pressure threshold value is adjusted by collecting data in real time, the camera is started to obtain the writing track, the flexibility and accuracy of track collection are effectively improved, track coordinates and end points are determined through identification codes, the track extraction accuracy is enhanced, meanwhile, the optimal processing track is obtained through track coordinate and end point optimization, and the processing precision is improved. The machining efficiency is improved, and the cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of equipment control, and in particular to a numerical control equipment control method and system based on image recognition. Background Art

[0002] In recent years, with the continuous advancement of intelligent and automated technologies, CNC equipment has been widely used in the manufacturing and processing industries. Traditional CNC equipment control mostly relies on preset paths and programs. Although this method can meet processing requirements, it often requires the use of professional industrial drawing software to draw the workpieces, and the modification process is relatively cumbersome. Therefore, image recognition technology has begun to be introduced into the field of CNC equipment control. Through image recognition technology, CNC equipment can identify the shape of the workpiece, thereby reducing manual workload, but there are still many problems. Existing technologies usually rely on preset programs and static image acquisition, which is difficult to adapt to the complex processing requirements of real-time dynamic input, and are not accurate and efficient enough in generating processing paths. Summary of the invention

[0003] In view of the problems existing in the above-mentioned existing numerical control equipment control method and system based on image recognition, the present invention is proposed.

[0004] Therefore, the problem to be solved by the present invention is that the existing technology usually relies on preset programs and static image acquisition, which is difficult to adapt to the complex processing requirements of real-time dynamic input, and is not accurate and efficient enough in generating processing paths.

[0005] In order to solve the above technical problems, the present invention provides the following technical solutions: a CNC equipment control method based on image recognition, which includes installing a sensor on the smart pen to collect pressure data and angle data to optimize the pressure threshold in real time, and turning on the camera according to the pressure threshold; using the camera to recognize the code on the writing paper to record the writing trajectory, and obtain the trajectory coordinates and endpoints; determining the optimal processing path according to the trajectory endpoints, and the CNC equipment works according to the optimal processing path; the CNC equipment displays the processing trajectory in real time, and records the optimal processing path.

[0006] As a preferred solution of the numerical control device control method based on image recognition described in the present invention, wherein: the sensor is installed on the smart pen to collect pressure data and angle data to optimize the pressure threshold in real time, and the camera is turned on according to the pressure threshold. It means that a pressure sensor and an inertial measurement sensor are installed on the smart pen to collect pressure data and tilt angle data in real time during the use of the smart pen, and the initial pressure threshold of the smart pen is set to P, and the initial pressure threshold P is adjusted based on the pressure data and tilt angle data collected in real time:

[0007]

[0008] Where P th(t) is the pressure threshold for real-time adjustment at time t, θ(t) and F(t) are the tilt angle and pressure at time t, respectively. max and θ min are the maximum and minimum values ​​of the tilt angle data collected in real time, F max and F min They are the maximum and minimum values ​​of the pressure data collected in real time;

[0009] During use, the smart pen collects pressure data in real time and compares the real-time pressure data with the real-time pressure threshold. When the real-time pressure data is greater than or equal to the real-time pressure threshold, the smart pen determines that writing behavior has occurred and turns on the camera to record the writing behavior.

[0010] As a preferred solution of the numerical control device control method based on image recognition described in the present invention, wherein: the step of recognizing the writing trajectory recorded by the code on the writing paper through the camera and obtaining the trajectory coordinates and endpoints means that the writing paper is printed with codes and squares, the codes and squares correspond to each other, the smart pen obtains the code occupation image of the writing area through the camera, uses Gaussian blur to denoise the image, and converts the denoised image into a black and white image;

[0011] Define the grid coordinates on the writing paper. The smart pen uses the YOLO algorithm to identify the code occupancy in the black and white image, record all occupied codes in the grid, and determine the occupied code coordinates based on the grid coordinates.

[0012] Each time the smart pen turns on and off the camera is regarded as a writing action, and continuous frame images of each writing action are obtained. The occupied coded coordinates of each frame in the continuous frame images are identified, and the occupied coded coordinates are sorted according to the continuous frame order. The repeated occupied coded coordinates are deleted to form the writing trajectory coordinates of the writing action. The writing trajectory coordinates are connected to form a writing trajectory of the writing action, and the starting point and end point of the writing trajectory are extracted as endpoints, and the endpoint coordinates of each writing trajectory are recorded.

[0013] As a preferred solution of the numerical control device control method based on image recognition described in the present invention, wherein: the determination of the optimal processing path according to the trajectory endpoints refers to the intelligent pen obtaining the writing trajectory coordinates and the endpoint coordinates and uploading them to the numerical control device and computer software, the numerical control device displays the writing trajectories of all writing actions to the writing personnel, and allows the staff to use the computer software to export the writing trajectories into JPG, JPEG, GIF, PNG, BMP, SVG, DXF, WEBP image files and G-code codes to transmit to the numerical control device, the writing personnel selects a non-writing trajectory, and the numerical control device deletes the non-writing trajectory to form a streamlined writing trajectory;

[0014] Determine the coordinates of the center point based on the coordinates of all the writing trajectory endpoints, and calculate the probability density f(x hk ):

[0015]

[0016] where x hk is the coordinate of the kth endpoint of the hth writing trajectory, x o is the coordinate of the center point, σ is the variance of the distance from all the writing trajectory endpoints to the center point coordinate;

[0017] The endpoint of the writing trajectory with the largest probability density is selected as the starting point of the path. The CNC equipment preliminarily connects the simplified writing trajectory according to the coordinates of the starting point of the path to form an initial path. The initial path is optimized using a greedy algorithm and a dynamic programming algorithm to form an optimized path 1 and an optimized path 2 respectively. The path coordinates of each time point of the optimized path 1 and the optimized path 2 are calculated according to the processing speed.

[0018] The CNC equipment starts path planning again from the starting point of the path, determines the end point of the current writing trajectory according to the starting point of the path, and calculates the prior probability S of the next writing trajectory j. ij :

[0019]

[0020] Where Z is the normalization constant, L j is the length of writing track j, ρ ij is the angle between the current writing track i and the next writing track j;

[0021] Calculate the conditional probability D according to the end point of the current writing trajectory:

[0022]

[0023] Where ω is the variance of the path coordinate distance between the optimized path 1 and the optimized path 2 at the same time, X1 is the path coordinate of the optimized path 1 at the end point of the current writing trajectory, and X2 is the path coordinate of the optimized path 2 at the end point of the current writing trajectory;

[0024] By the prior probability S ij And conditional probability D calculate marginal probability Q:

[0025]

[0026] Where n is the total number of writing trajectories;

[0027] Comprehensive prior probability S ij , conditional probability D and marginal probability Q, use the Bayesian formula to calculate the probability M of selecting the next trajectory j from the current trajectory i;

[0028] Select the next trajectory j with the highest probability, extract all endpoint coordinates in the next trajectory j, calculate the distance between all endpoint coordinates and the end point coordinates of the current trajectory i, and select the endpoint coordinate with the smallest distance as the starting point coordinate of the next trajectory j;

[0029] Iterate the next trajectory selection and define the starting point and end point of the trajectory until all writing trajectories are traversed and stop, browse the iteration records to connect all writing trajectories to form the optimal processing path.

[0030] As a preferred solution of the CNC equipment control method based on image recognition described in the present invention, wherein: the CNC equipment works according to the optimal processing path, that is, the CNC equipment copies the processing path according to the original proportion of the writing trajectory, and the CNC equipment performs processing operations along the optimal processing path.

[0031] As a preferred solution of the CNC equipment control method based on image recognition described in the present invention, wherein: the CNC equipment displays the processing trajectory in real time, which means that the CNC equipment collects the processing trajectory image in real time during the processing operation, and superimposes and displays it with the optimal processing path, and simultaneously obtains the complete writing trajectory and compares it with the processing trajectory.

[0032] As a preferred solution of the CNC equipment control method based on image recognition described in the present invention, wherein: the recording of the optimal processing path refers to that the CNC equipment stores the optimal processing path in real time in the database after obtaining the optimal processing path, and classifies the optimal processing path according to the timestamp and names it according to the timestamp, and the database synchronously uploads the optimal processing path as a template to the cloud.

[0033] Another object of the present invention is to provide a numerical control equipment control system based on image recognition, which comprises:

[0034] A data collection module is used to adjust the pressure threshold of the smart pen in real time and activate the camera to collect writing trajectory information according to the pressure threshold;

[0035] A track recognition module, used to recognize the writing track according to the collected writing track information, and extract the coordinates and endpoints of the writing track;

[0036] The path planning module is used to optimize the optimal processing path according to the writing trajectory coordinates and endpoints, and perform processing operations;

[0037] The display storage module is used to display the processing operation process and store the optimal processing path.

[0038] A computer device comprises: a memory and a processor; the memory stores a computer program, and the processor implements the steps of the above-mentioned numerical control device control method based on image recognition when executing the computer program.

[0039] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the above-mentioned numerical control device control method based on image recognition.

[0040] The beneficial effects of the present invention are as follows: the present invention adjusts the pressure threshold to turn on the camera to obtain the writing trajectory through real-time data collection, thereby effectively improving the flexibility and accuracy of trajectory collection, and determines the trajectory coordinates and endpoints through identification coding, thereby enhancing the accuracy of trajectory extraction, and at the same time obtains the optimal processing trajectory through trajectory coordinates and endpoint optimization, thereby improving processing efficiency and reducing costs. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0042] Figure 1 It is a flowchart of a CNC equipment control method based on image recognition.

[0043] Figure 2 Schematic diagram of the process of transmitting the writing trajectory to the CNC equipment.

[0044] Figure 3 It is a structural diagram of the CNC equipment control system based on image recognition. DETAILED DESCRIPTION

[0045] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings.

[0046] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0047] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor is it a separate or selective embodiment that is mutually exclusive with other embodiments.

[0048] Example 1

[0049] Reference Figure 1 and Figure 2 , which is the first embodiment of the present invention, and which provides a numerical control device control method based on image recognition. The numerical control device control method based on image recognition includes:

[0050] S1. Install a sensor on the smart pen to collect pressure data and angle data to optimize the pressure threshold in real time, and turn on the camera according to the pressure threshold;

[0051] Specifically, a sensor is installed on the smart pen to collect pressure data and angle data to optimize the pressure threshold in real time, and the camera is turned on according to the pressure threshold. The pressure sensor and the inertial measurement sensor are installed on the smart pen to collect the pressure data and the tilt angle data in real time during the use of the smart pen, and the initial pressure threshold of the smart pen is set to P. The initial pressure threshold P is adjusted based on the pressure data and the tilt angle data collected in real time:

[0052]

[0053] Where P th (t) is the pressure threshold for real-time adjustment at time t, θ(t) and F(t) are the tilt angle and pressure at time t, respectively. max and θ min are the maximum and minimum values ​​of the tilt angle data collected in real time, F max and F min They are the maximum and minimum values ​​of the pressure data collected in real time. The maximum and minimum values ​​of the tilt angle data and pressure data of the smart pen will change with the collected data during the real-time data collection process. Dimensionless standardization standardizes physical quantities of different units to the same range. When the angle and pressure change, the influence of the change amplitude of the two on the pressure threshold is nonlinear. The use of Euclidean distance can comprehensively consider the influence of changes in multiple variables on the results.

[0054] During use, the smart pen collects pressure data in real time and compares the real-time pressure data with the real-time pressure threshold. When the real-time pressure data is greater than or equal to the real-time pressure threshold, the smart pen determines that writing behavior has occurred and turns on the camera to record the writing behavior.

[0055] Dynamic adjustment of the pressure threshold can effectively solve the problem that the fixed threshold cannot adapt to the writing styles and different usage scenarios of different users. By adjusting the pressure threshold in real time, it can ensure that no matter how the user writes, the system can accurately judge and turn on the camera. Since the pressure threshold adjustment is based on the nonlinear relationship processing of multidimensional data, the system can more accurately balance the impact of different variables on writing judgment and avoid misjudgment. The combination of dimensionless and Euclidean distance greatly enhances the system's ability to process complex multidimensional data. By dimensionlessizing pressure and tilt angle and integrating the change amplitude of the two using Euclidean distance, the pressure threshold can be adjusted more scientifically and accurately, improving the accuracy and reliability of writing behavior judgment. The function of automatically turning on the camera significantly improves the user experience, allowing users to write and record naturally without additional operation. At the same time, since the system can intelligently adjust the pressure threshold in different writing scenarios, it ensures that the camera's activation conditions are more in line with actual needs and reduces misoperation and delays.

[0056] S2, using a camera to identify the coding on the writing paper to record the writing trajectory, and obtain the trajectory coordinates and endpoints;

[0057] Specifically, the writing track is recorded by recognizing the code on the writing paper through the camera, and the track coordinates and endpoints are obtained. The writing paper is printed with codes and squares, and the codes and squares correspond to each other. The smart pen obtains the code occupancy image of the writing area through the camera, uses Gaussian blur to denoise the image, and converts the denoised image into a black and white image;

[0058] Define the grid coordinates on the writing paper. The smart pen uses the YOLO algorithm to identify the code occupancy in the black and white image, record all occupied codes in the grid, and determine the occupied code coordinates based on the grid coordinates.

[0059] Each time the smart pen turns on and off the camera is regarded as a writing action, and continuous frame images of each writing action are obtained. The occupied coded coordinates of each frame in the continuous frame images are identified, and the occupied coded coordinates are sorted according to the continuous frame order. The repeated occupied coded coordinates are deleted to form the writing trajectory coordinates of the writing action. The writing trajectory coordinates are connected to form a writing trajectory of the writing action, and the starting point and end point of the writing trajectory are extracted as endpoints, and the endpoint coordinates of each writing trajectory are recorded.

[0060] The application of Gaussian blur technology significantly improves the recognition accuracy of the smart pen in complex environments, especially in the presence of uneven light, subtle textures on the paper surface, etc., it can effectively remove noise and ensure the accuracy and stability of code recognition. By applying the YOLO algorithm, the present invention can significantly improve the real-time and accuracy of writing trajectory recognition. The YOLO algorithm can quickly process each frame of image and accurately identify the position of the occupied code, avoiding the problems of slow recognition speed and high error in traditional algorithms. The algorithm ensures the integrity of the writing trajectory and provides reliable basic data for subsequent trajectory coordinate processing. The writing trajectory is generated by deleting repeated codes, effectively eliminating redundant data caused by repeated recognition, and ensuring the fluency and integrity of the writing trajectory. In actual writing, the same code may be recognized multiple times due to repetition or delay of strokes. By deleting the processing of repeated codes, the finally generated writing trajectory can be made more concise and accurate, avoiding the interference of repeated records. Extracting the starting point and end point of the writing trajectory can effectively record the complete path of each writing action and provide data support for subsequent trajectory analysis, which not only improves the automation level of the system, but also provides more accurate input data for subsequent path optimization and processing control.

[0061] S3, determining the optimal processing path according to the trajectory endpoints, and the CNC equipment works according to the optimal processing path;

[0062] Specifically, determining the optimal processing path according to the trajectory endpoints means that the smart pen obtains the writing trajectory coordinates and the endpoint coordinates and uploads them to the numerical control equipment and computer software, the numerical control equipment displays the writing trajectories of all writing actions to the writing personnel, and allows the staff to use the computer software to export the writing trajectories into JPG, JPEG, GIF, PNG, BMP, SVG, DXF, WEBP image files and G-code codes to transmit to the numerical control equipment, the writing personnel selects the non-writing trajectory, and the numerical control equipment deletes the non-writing trajectory to form a streamlined writing trajectory;

[0063] Determine the coordinates of the center point based on the coordinates of all the writing trajectory endpoints, and calculate the probability density f(x hk ):

[0064]

[0065] where x hk is the coordinate of the kth endpoint of the hth writing trajectory, x o is the coordinate of the center point, σ is the variance of the distance from all the writing trajectory endpoints to the center point coordinate;

[0066] The endpoint of the writing trajectory with the largest probability density is selected as the starting point of the path. The CNC equipment preliminarily connects the simplified writing trajectory according to the coordinates of the starting point of the path to form an initial path. The initial path is optimized using a greedy algorithm and a dynamic programming algorithm to form an optimized path 1 and an optimized path 2 respectively. The path coordinates of each time point of the optimized path 1 and the optimized path 2 are calculated according to the processing speed.

[0067] The CNC equipment starts path planning again from the starting point of the path, determines the end point of the current writing trajectory according to the starting point of the path, and calculates the prior probability S of the next writing trajectory j. ij :

[0068]

[0069] Where Z is the normalization constant, L j is the length of writing track j, ρ ij is the angle between the current writing track i and the next writing track j, which is determined by the angle between the line connecting the starting point and the end point of the current writing track and the line connecting the starting point and the end point of the next writing track;

[0070] Calculate the conditional probability D according to the end point of the current writing trajectory:

[0071]

[0072] where ω ω is the variance of the path coordinate distance between the optimized path 1 and the optimized path 2 at the same time, X1 is the path coordinate of the optimized path 1 at the end point of the current writing trajectory, and X2 is the path coordinate of the optimized path 2 at the end point of the current writing trajectory;

[0073] By the prior probability S ij And conditional probability D calculate marginal probability Q:

[0074]

[0075] Where n is the total number of writing trajectories;

[0076] Comprehensive prior probability S ij , conditional probability D and marginal probability Q, use the Bayesian formula to calculate the probability M of selecting the next trajectory j from the current trajectory i; expressed as:

[0077]

[0078] Select the next trajectory j with the highest probability, extract all endpoint coordinates in the next trajectory j, calculate the distance between all endpoint coordinates and the end point coordinates of the current trajectory i, and select the endpoint coordinate with the smallest distance as the starting point coordinate of the next trajectory j;

[0079] Iterate the next trajectory selection and define the starting point and end point of the trajectory until all writing trajectories are traversed and stop, browse the iteration records to connect all writing trajectories to form the optimal processing path.

[0080] Through the calculation of probability density, the system can ensure that the selected starting point not only conforms to the geometrically optimal distribution, but also has a high degree of controllability. This process greatly improves the overall optimization effect of the processing path, reduces the redundancy of the path and unnecessary processing paths, and the optimal selection of the starting point greatly improves the efficiency of the processing process, while reducing the waste of processing time and materials. The combination of greedy algorithm and dynamic programming algorithm provides flexibility and diversity for path optimization. The greedy algorithm can quickly generate a preliminary optimization path, and dynamic programming further refines the path on this basis, so that the final generated path can be generated quickly and can reach the global optimum. The combination of the two algorithms ensures the efficiency and accuracy of the processing path. Through the calculation of conditional probability D, the system can more comprehensively consider the overall consistency and change trend of the path, so that the path selection is not only based on static distance, but also takes into account The deviations that may occur in the path during the dynamic process can better adjust the processing path to make it smoother and more consistent at different time points, reducing the processing errors caused by path deviations. The application of the Bayesian formula in path selection ensures that the system can select the optimal connection order when facing multiple trajectories. This not only improves the intelligence of path planning, but also enables the system to dynamically adjust the order of trajectory connections under different circumstances. Through the iterative calculation of the Bayesian formula, the system can better cope with complex writing trajectories and improve the accuracy and efficiency of path planning. The generation of the optimal processing path greatly improves the automation degree and processing efficiency of the processing process. Through precise path planning, the system can reduce unnecessary processing operations, optimize processing time, and improve material utilization. At the same time, the path optimization also ensures the high accuracy of the processing process and reduces rework and material waste.

[0081] Furthermore, the CNC device works according to the optimal processing path, that is, the CNC device copies the processing path according to the original proportion of the writing trajectory, and the CNC device performs processing operations along the optimal processing path.

[0082] Processing under the control of CNC equipment can achieve highly precise processing effects and ensure that each processing line is executed along the optimal path, which not only improves the processing accuracy, but also minimizes material waste. In addition, CNC equipment can dynamically adjust laser parameters according to the characteristics of the material to ensure the quality and consistency of processing. Ultimately, material utilization is improved and production costs are reduced. Dynamic adjustment of processing parameters can ensure that the processing process is always in the best state under different material and workpiece conditions. For example, for thicker metal materials, the system can automatically adjust the laser power and processing speed to ensure processing depth and edge smoothness. For heat-sensitive materials, the system can adjust the processing speed to reduce thermal damage. Through such dynamic adjustment, processing efficiency and quality are comprehensively improved.

[0083] S4, CNC equipment displays the processing trajectory in real time and records the optimal processing path

[0084] Specifically, the CNC equipment displays the processing trajectory in real time, which means that the CNC equipment collects the processing trajectory image in real time during the processing operation, and superimposes and displays it with the optimal processing path, and compares the writing trajectory with the processing trajectory synchronously.

[0085] By collecting the processing trajectory images in real time, the system can make dynamic adjustments during the processing process to ensure that the processing path always conforms to the preset optimal path. If the system detects that the actual path of the laser head deviates from the preset path, the operator can make corrections immediately, thereby reducing processing errors and material waste. This function is particularly suitable for processing scenarios with extremely high precision requirements, such as precision manufacturing, mold processing and other fields. The overlay display function can greatly improve the operator's control accuracy over the processing process. By superimposing the optimal path with the actual path, the operator can see the possible deviations in the processing process in real time and take corrective measures in time. This function can not only improve the processing accuracy, but also avoid material waste and processing failures caused by path deviations. The overlay display technology improves the transparency and controllability of the processing process by providing visual feedback. The comparison of the writing trajectory and the processing trajectory provides a direct feedback mechanism to ensure that the trajectory input by the user can be accurately converted into the processing path. If there is a deviation in the processing process, the user can immediately find the problem and make adjustments, thereby avoiding production errors and rework.

[0086] Furthermore, the optimal processing path is recorded. The index control device stores it in the database in real time after obtaining the optimal processing path, and the optimal processing path is classified and named according to the timestamp. The database uploads the optimal processing path as a template to the cloud synchronously.

[0087] Real-time storage of the optimal processing path can ensure that all data generated during the processing process is saved in a timely manner, avoiding data loss due to equipment failure or operational errors. This function improves the reliability of the system and ensures that even after a system interruption, the previously generated optimal processing path can be restored, reducing the time and cost of recalculating the path. Saving the optimal processing path as a template can greatly improve production efficiency, especially in mass production scenarios. The verified optimal path can be reused, avoiding the need to recalculate the path for each production. This not only reduces processing time, but also ensures the consistency and stability of the processing path.

[0088] Example 2

[0089] Reference Figure 3 , which is the second embodiment of the present invention, and which is different from the previous embodiment, provides a numerical control equipment control system based on image recognition, which includes:

[0090] A data collection module is used to adjust the pressure threshold of the smart pen in real time and activate the camera to collect writing trajectory information according to the pressure threshold;

[0091] A track recognition module, used to recognize the writing track according to the collected writing track information, and extract the coordinates and endpoints of the writing track;

[0092] The path planning module is used to optimize the optimal processing path according to the writing trajectory coordinates and endpoints, and perform processing operations;

[0093] The display storage module is used to display the processing operation process and store the optimal processing path.

[0094] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.

[0095] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.

[0096] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0097] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used to implement: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0098] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. CNC equipment control method based on image recognition, Features: include, Install sensors on the smart pen to collect pressure data and angle data to optimize the pressure threshold in real time and turn on the camera based on the pressure threshold; The camera recognizes the code on the writing paper to record the writing trajectory and obtains the trajectory coordinates and endpoints; The optimal processing path is determined according to the trajectory endpoints, and the CNC equipment works according to the optimal processing path; The CNC equipment displays the processing trajectory in real time and records the optimal processing path.

2. The method for controlling a numerical control device based on image recognition according to claim 1, Features: The step of installing a sensor on the smart pen to collect pressure data and angle data to optimize the pressure threshold in real time, and activating the camera according to the pressure threshold refers to installing a pressure sensor and an inertial measurement sensor on the smart pen to collect pressure data and tilt angle data in real time during the use of the smart pen, setting the initial pressure threshold of the smart pen to P, and adjusting the initial pressure threshold P based on the pressure data and tilt angle data collected in real time: Where P th (t) is the pressure threshold for real-time adjustment at time t, θ(t) and F(t) are the tilt angle and pressure at time t, respectively. max and θ min are the maximum and minimum values ​​of the tilt angle data collected in real time, F max and F min They are the maximum and minimum values ​​of the pressure data collected in real time; During use, the smart pen collects pressure data in real time and compares the real-time pressure data with the real-time pressure threshold. When the real-time pressure data is greater than or equal to the real-time pressure threshold, the smart pen determines that writing behavior has occurred and turns on the camera to record the writing behavior.

3. The method for controlling a numerical control device based on image recognition according to claim 2, Features: The method of recognizing the coding on the writing paper and recording the writing trajectory by using a camera, and obtaining the coordinates and endpoints of the trajectory means that the writing paper is printed with coding and squares, the coding and the squares correspond to each other, the smart pen obtains the coding occupation image of the writing area through the camera, uses Gaussian blur to denoise the image, and converts the denoised image into a black and white image; Define the grid coordinates on the writing paper. The smart pen uses the YOLO algorithm to identify the code occupancy in the black and white image, record all occupied codes in the grid, and determine the occupied code coordinates based on the grid coordinates. Each time the smart pen turns on and off the camera is regarded as a writing action, and continuous frame images of each writing action are obtained. The occupied coded coordinates of each frame in the continuous frame images are identified, and the occupied coded coordinates are sorted according to the continuous frame order. The repeated occupied coded coordinates are deleted to form the writing trajectory coordinates of the writing action. The writing trajectory coordinates are connected to form a writing trajectory of the writing action, and the starting point and end point of the writing trajectory are extracted as endpoints, and the endpoint coordinates of each writing trajectory are recorded.

4. The method for controlling a numerical control device based on image recognition according to claim 3, Features: Determining the optimal processing path according to the trajectory endpoints means that the smart pen obtains the writing trajectory coordinates and the endpoint coordinates and uploads them to the numerical control device and computer software, the numerical control device displays the writing trajectories of all writing actions to the writer, and allows the staff to use the computer software to export the writing trajectories into JPG, JPEG, GIF, PNG, BMP, SVG, DXF, WEBP image files and G-code codes to transmit to the numerical control device, the writer selects a non-writing trajectory, and the numerical control device deletes the non-writing trajectory to form a streamlined writing trajectory; Determine the coordinates of the center point based on the coordinates of all the writing trajectory endpoints, and calculate the probability density f(x hk ): where x hk is the coordinate of the kth endpoint of the hth writing trajectory, x o is the coordinate of the center point, σ is the variance of the distance from all the writing trajectory endpoints to the center point coordinate; The endpoint of the writing trajectory with the largest probability density is selected as the starting point of the path. The CNC equipment preliminarily connects the simplified writing trajectory according to the coordinates of the starting point of the path to form an initial path. The initial path is optimized using a greedy algorithm and a dynamic programming algorithm to form an optimized path 1 and an optimized path 2 respectively. The path coordinates of each time point of the optimized path 1 and the optimized path 2 are calculated according to the processing speed. The CNC equipment starts path planning again from the starting point of the path, determines the end point of the current writing trajectory according to the starting point of the path, and calculates the prior probability S of the next writing trajectory j. ij : Where Z is the normalization constant, L j is the length of writing track j, ρ ij is the angle between the current writing track i and the next writing track j, Calculate the conditional probability D according to the end point of the current writing trajectory: Where ω is the variance of the path coordinate distance between the optimized path 1 and the optimized path 2 at the same time, X 1 is the path coordinate of the optimized path 1 at the end point of the current writing trajectory, X 2 The path coordinates of the optimized path 2 at the end point of the current writing trajectory; By the prior probability S ij And conditional probability D calculate marginal probability Q: Where n is the total number of writing trajectories; Comprehensive prior probability S ij , conditional probability D and marginal probability Q, use the Bayesian formula to calculate the probability M of selecting the next trajectory j from the current trajectory i; Select the next trajectory j with the highest probability, extract all endpoint coordinates in the next trajectory j, calculate the distance between all endpoint coordinates and the end point coordinates of the current trajectory i, and select the endpoint coordinate with the smallest distance as the starting point coordinate of the next trajectory j; Iterate the next trajectory selection and define the starting point and end point of the trajectory until all writing trajectories are traversed and stop, browse the iteration records to connect all writing trajectories to form the optimal processing path.

5. The method for controlling a numerical control device based on image recognition according to claim 4, Features: The numerical control device works according to the optimal processing path, that is, the numerical control device copies the processing path according to the original proportion of the writing trajectory, and the numerical control device performs processing operations along the optimal processing path.

6. The method for controlling a numerical control device based on image recognition according to claim 5, Features: The CNC device displays the processing trajectory in real time, which means that the CNC device collects the processing trajectory image in real time during the processing operation, and superimposes and displays it with the optimal processing path, and simultaneously obtains the complete writing trajectory and compares it with the processing trajectory.

7. The method for controlling a numerical control device based on image recognition according to claim 6, Features: The recording of the optimal processing path index control device stores the optimal processing path in real time in the database after obtaining the optimal processing path, and classifies the optimal processing path according to the timestamp and names it according to the timestamp. The database synchronously uploads the optimal processing path as a template to the cloud.

8. A numerical control device control system based on image recognition according to the numerical control device control method based on image recognition as claimed in any one of claims 1 to 7, Features: include, A data collection module is used to adjust the pressure threshold of the smart pen in real time and activate the camera to collect writing trajectory information according to the pressure threshold; A track recognition module, used to recognize the writing track according to the collected writing track information, and extract the coordinates and endpoints of the writing track; The path planning module is used to optimize the optimal processing path according to the writing trajectory coordinates and endpoints, and perform processing operations; The display storage module is used to display the processing operation process and store the optimal processing path.

9. A computer device, include: A memory and a processor; the memory stores a computer program, wherein the processor implements the steps of the image recognition-based CNC equipment control method described in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium having a computer program stored thereon, Features: When the computer program is executed by a processor, the steps of the numerical control device control method based on image recognition described in any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Writing trace optimization system based on machine learning

    CN120747983A