Laser cutting path planning method with burr paper supplement for ancient book repair

Through the combination of visual imaging system and laser cutting equipment, the precise identification of damaged pages of ancient books and the burrs cutting of paper edges is achieved, which solves the problem of time-consuming and labor-intensive repair of ancient books in the existing technology and the inability to meet the burrs needs of laser cutting, and achieves efficient and accurate repair and cutting effects of ancient books.

CN119839469APending Publication Date: 2025-04-18HEFEI INST OF TECH INNOVATION ENG CHINESE ACAD OF SCI +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510183407.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-19
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

The prior art is difficult to achieve accurate identification of damaged pages of ancient books and fast and precise cutting of burr-fit paper required for repairing damaged pages of ancient books. Traditional manual repair is time-consuming and labor-intensive, and the existing laser cutting methods cannot meet the burr-fit paper edges in the "Ancient Book Repair Specifications and Requirements".

Method used

The visual imaging system is combined with laser cutting equipment, and the calibration of the image coordinate system and the coordinate system of the motion mechanism is achieved to accurately identify the damaged areas of damaged pages of ancient books and plan the burrs cutting paths at the edges of paper filling. Specific steps include imaging, comparison processing, contour calculation, linear and arc segment fitting, burr cutting path generation, etc.

Benefits of technology

It realizes accurate identification of damaged pages of ancient books and fast and accurate cutting of paper filling. The generated burr cutting path can meet the burr requirements of paper filling in the "Ancient Book Repair Specifications and Requirements", and improves the repair efficiency and quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119839469A_ABST
    Figure CN119839469A_ABST
Patent Text Reader

Abstract

The invention discloses a laser cutting path planning method with deckle edge paper supplement for ancient book repair, which comprises the following steps: firstly, calibrating an image coordinate system of a visual imaging system and a coordinate system of a repair movement mechanism, then acquiring a background image and a target image by using the visual imaging system, comparing the background image with the target image, searching for a damaged area of a damaged book page, and finally, carrying out laser cutting on the damaged book page. The method comprises the following steps: cutting a damaged area, calculating contour coordinates of the damaged area, converting coordinates of a repairing movement mechanism, fitting the coordinates of the repairing movement mechanism into a plurality of straight line sections and arc sections, generating a G code instruction of a contour cutting path, finally fitting a burr cutting path, and generating a G code instruction of the burr cutting path. According to the invention, accurate identification of the damaged area of the damaged page of the ancient book and rapid and accurate cutting of the deckle-edged paper required during repairing can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of operation data processing for automated restoration of ancient books, and in particular to a laser cutting path planning method for rough-edged paper used for restoration of ancient books. Background Art

[0002] Chinese culture has a long history, and has produced a vast number of documents and classics. Due to the passage of time, poor preservation conditions, production materials and other reasons, ancient books often face serious problems such as damage and aging. In order to restore the original style of ancient books and extend their service life, damaged ancient books must be repaired. The traditional steps for repairing damaged pages of ancient books are to first compare the shape and size of the holes, gradually tear off a small piece of repair paper slightly larger than the hole from the repair paper, then apply glue, cover the hole with the repair paper, and press it flat. So far, the restoration of ancient books is still mainly done by restorers. On the one hand, traditional manual restoration has high requirements for restorers, and the restoration process is time-consuming and labor-intensive; on the other hand, there are more than 10 million damaged ancient books and documents in my country that need to be repaired, but there are only a few hundred practitioners with ancient book restoration qualifications. It may take a skilled ancient book restorer one or two months to repair a typical damaged ancient book, which is not enough for the huge and increasing number of damaged ancient books. At present, relevant research has introduced laser cutting technology into the field of ancient book restoration to achieve automated cutting of ancient book patch paper. However, the patch paper cut by this method cannot meet the requirements of the current "Standards and Requirements for the Restoration of Ancient Books" (GB / T 21712-2008) for the rough edges of the patch paper. The rough edges are usually caused by uneven force distribution when the restorer tears out the patch paper of the required shape and size during manual repair, which causes the paper fibers to break or be pulled apart from the middle, leaving small fibers on the edge. When repairing ancient books with patch paper with rough edges, the contact area can be increased, thereby enhancing the adhesion of the glue. In addition, the rough edges are conducive to the better integration of the patch paper into the original book pages, visually reducing the traces of repair, and can also act as a buffer to prevent further expansion of damage.

[0003] Although there are methods to use lasers for cutting patch paper in the restoration of ancient books, such methods have strict requirements on the working environment. Under different background and lighting conditions, the imaging parameters must be manually adjusted. Otherwise, the recognition of the damaged area will be poor, and the edges of the cut patch paper will be too neat to produce the desired rough edge effect on the edges of the patch paper. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a laser cutting path planning method for rough-edged patching paper used for ancient book repair, which can realize accurate identification of damaged areas of damaged pages of ancient books and rapid and accurate cutting of rough-edged patching paper required for repair.

[0005] The technical solution of the present invention is:

[0006] A laser cutting path planning method for rough-edged paper for ancient book restoration specifically comprises the following steps:

[0007] (1) Calibrate the image coordinate system of the visual imaging system and the coordinate system of the repair motion mechanism;

[0008] (2) Using the visual imaging system to image the empty detection platform for the first time, after obtaining the background image, under the same environmental conditions, the damaged pages of the ancient book are placed on the detection platform, and the visual imaging system performs a second imaging of the detection platform with the damaged pages of the ancient book placed thereon to obtain the target image. Then, the visual imaging system compares the background image and the target image, finds the damaged area of ​​the damaged pages of the ancient book, and calculates the contour coordinates of the damaged area;

[0009] (3) Convert the damaged area contour coordinates on the image coordinate system of the visual imaging system into the coordinates of the repair motion mechanism, fit the repair motion mechanism coordinates into multiple straight line segments and circular arc segments, and generate G code instructions for the contour cutting path;

[0010] (4) The burr cutting path of the patched paper edge is calculated by using the straight line equation corresponding to the fitted straight line segment and the normal line equation corresponding to the arc segment. The burr cutting path of each straight line segment is a burr cutting path composed of multiple vertical lines located inside the patched paper edge contour and perpendicular to the straight line segment. The burr cutting path of each arc segment is a burr cutting path composed of multiple normal lines located inside the patched paper edge contour and perpendicular to the arc segment. Finally, the G code command of the burr cutting path is generated through the burr cutting path.

[0011] The visual imaging system includes a camera with a lens facing the detection platform and a host computer connected to the camera. The camera is used to collect images of the area where the detection platform is located. The host computer performs image comparison, finds the damaged area of ​​the damaged book page, calculates the contour coordinates of the damaged area, and generates G code instructions for the contour cutting path and the G code instructions for the burr cutting path.

[0012] The repair motion mechanism is a two-axis motion mechanism of laser cutting equipment.

[0013] The specific steps of calibrating the image coordinate system of the visual imaging system and the coordinate system of the repair motion mechanism are as follows:

[0014] S11. Lay a piece of white paper on the detection platform, and use the repair motion mechanism to draw N straight line segments with different direction angles and lengths on the white paper, where N ≥ 9. Then use a camera to image the white paper. The coordinates of the endpoint of a straight line segment in the image coordinate system of the visual imaging system are (x′ i , y′ i), the corresponding coordinates of the end point of a straight line segment in the coordinate system of the repair motion mechanism are (x i ,y i ), set the transformation matrix H so that In order to find the optimal solution, the least squares method is used to minimize the objective function: (x i ,y i , 1) and (x′ i , y′ i , 1) are respectively (x i ,y i ) and (x′ i , y′ i )’s homogeneous coordinates;

[0015] S12, the coordinates of the endpoint of the straight line segment in the repair motion mechanism (x i ,y i ,1) It is known that, through Hough line detection, the coordinates of the end points of the straight line segment corresponding to the image coordinate system of the visual imaging system are obtained, and the transformation matrix H is obtained by minimizing the objective function;

[0016] S13. Convert the image coordinate system of the visual imaging system into the restoration motion mechanism coordinate system through the transformation matrix H.

[0017] The specific steps of the visual imaging system performing a comparison process on the background image and the target image, finding the damaged area of ​​the damaged book page, and calculating the contour coordinates of the damaged area are as follows:

[0018] S21, downsampling: the background image I obtained by the visual imaging system back and the target image I obj All are converted into grayscale images, and then the resolution of the grayscale images is reduced by the average downsampling function. The average downsampling function is shown in the following formula (1):

[0019]

[0020] In formula (1), I′ represents the grayscale image after downsampling, I is the original grayscale image, k is the downsampling window size, I(i, j) represents the grayscale value of the pixel coordinates (i, j) in the original grayscale image, and I′(x′, y′) is the grayscale value of the pixel coordinates (x′, y′) in the downsampling grayscale image;

[0021] S22, Boolean operation: compare the downsampled background image I back and the target image I obj The difference between the two is used to segment the Boolean image containing only the paper area, and then the Boolean image is binarized according to the function of formula (2), so that the approximate area containing the paper appears white and the rest is black;

[0022]

[0023] In formula (2), I(x, y) represents the gray value of the pixel coordinates (x, y) in the Boolean image, P(x, y) is the gray value of the pixel coordinates (x, y) in the binarized image, and T is the set gray threshold;

[0024] S23, boundary search and screening: first, use the Canny algorithm to search for all boundaries in the binarized image, select the largest boundary as the approximate boundary of the paper, and calculate the minimum circumscribed rectangle of the approximate boundary to obtain the paper area to be detected; then use the Canny algorithm to search for all possible boundaries in the minimum circumscribed rectangle area, and among the possible boundaries searched, filter out noise boundaries that are too short and boundaries that are not in the paper area through a custom conditional screening function;

[0025] S24, Contour merging and filling: Calculate the minimum Euclidean distance between two contour point sets in the filtered boundary: d min =min i,j ||P i -Q j ||2, where P and Q represent two contour point sets, P i represents the point with sequence number i in the contour point set P, Q j Represents the point with sequence number j in the contour point set Q, d min Represents the minimum Euclidean distance between all pairs of points in two contour points, min i,j It means to find the i -Q j ||2The smallest combination of i and j, ||P i -Q j ||2 represents point P i and Q j The Euclidean distance is obtained by calculating the square root of the sum of the squares of the coordinate differences of the two points; then the minimum Euclidean distance d min Less than the set minimum distance error d ctr The contours of the merged contour are merged into one contour, and each point in the merged contour is filled with a filling width of d offset Not less than the set minimum distance error d ctr , and represent the filled contour in a new blank image; finally, the Canny algorithm is used to search for contours on the filled contour image again, and only the outermost contour is retained as the contour of the damaged area, that is, the contour of the patched paper, and the coordinates of the contour of the damaged area are calculated.

[0026] The damaged area contour coordinates on the image coordinate system of the visual imaging system are converted into the coordinates of the repair motion mechanism to obtain the contour coordinate set (P'1, P'2, ..., P' i , …P′ n ), where n represents the total number of damaged areas, P′ i ={(x i1 ′,y i1 ′),...,(x iN ′,y iN ′)}, N represents the contour P′ i The total number of mid-contour points.

[0027] The specific steps of fitting the coordinates of the repair motion mechanism into a plurality of straight line segments and arc segments and generating the G code instructions of the contour cutting path are as follows:

[0028] S32, from the contour P' in the coordinate system of the repair motion mechanism i Select a starting point from the starting point, and start from the starting point. Under the condition of satisfying the error constraint, search for the farthest straight line segment through the iterative search algorithm with a variable step size, and search for the farthest arc segment through the least squares method. Select the straight line segment or arc segment with a farther end point as the fitting method for the segment; when the end point of the fitted straight line segment or arc segment is not the contour P′ i The last point in the point set, the end point of this straight line segment or arc segment is regarded as the new starting point, and the above steps are repeated to continue to find the farthest straight line segment or arc segment; when the end point of the fitted straight line segment or arc segment is the contour P′ i When the last point in the point set is reached, the fitting process of this contour point set ends, and the contour information of the damaged area is converted into a closed figure composed of multiple straight line segments and arc segment primitives;

[0029] S33, the path obtained after fitting is composed of multiple straight line segments, multiple arc segments, or multiple straight line segments and multiple arc segments connected end to end in sequence. When the previous segment cutting instruction is completed and the end point of this segment cutting is reached, the next segment cutting starting point is also reached. Therefore, for the cutting path of each contour, the starting point of the first segment in the path needs to use G90 absolute motion to reach the starting point position, and the corresponding G1 linear motion instruction or G2 / G3 circular motion instruction is generated according to the type of each segment and the relevant information of the endpoint coordinates;

[0030] When the first segment of the contour cutting path is a straight line segment and the second segment is an arc segment, the starting coordinates of the first straight line segment are (x1, y1) and the end coordinates are (x2, y2). The end coordinates of the first straight line segment are also the starting coordinates of the second arc segment. The end coordinates of the second arc segment are (x3, y3) and the center of the circle is (x o ,y o ), the radius is r o, then first generate G90Xx1Yy1 to control the repair motion mechanism to reach the starting point of the first straight line segment, and then use the S command to control the laser of the laser cutting equipment to turn on, and then generate G1Xx2Yy2 to control the laser to reach the end point of the first straight line segment to complete the straight line segment cutting task; then generate the corresponding G code with the coordinates of the starting point, end point, and center of the second arc segment. The steps are as follows: first calculate the vector V1 from the starting point of the arc segment to the center of the circle and the vector V2 from the end point of the arc segment to the center of the circle, and then determine the direction of the arc according to the relationship between V1 and V2. When the angle between V1 and V2 is less than 180 degrees and is a positive number, it is counterclockwise; when the angle between V1 and V2 is a negative number or greater than 180 degrees, it is clockwise; then generate the G code for the corresponding arc segment according to the coordinates of the center of the circle, the direction of the arc, and the radius of the arc. When it is a clockwise arc segment, generate G2Xx o Yy o R o , when it is a counterclockwise arc segment, G3Xx is generated o Yy o R o ; Thus, the generation of cutting instructions for straight line segments and arc segments is completed, and the subsequent G code instructions for straight line segments and arc segments are obtained in sequence according to the above steps.

[0031] The steps of searching the farthest straight line segment by the iterative search algorithm with variable step size are as follows:

[0032] A1. First select the starting point P start , let the contour P′ i Search point P in the point set s =P start , set the initial search step t = 1, start searching, search for the straight line segment P start P s The length of s = t, and the straight line segment P start P s Meet the error requirements and record the P at this time s , then set the search step to 2t and continue searching. At this time, s = t + 2t, and the straight line segment P start P s Meet the error requirements and record the P at this time s , continue searching according to the above steps, and the step length of each search is twice the step length of the previous search;

[0033] A2. When the straight line segment P is found start P s If the error requirement is not met, a back-off search is performed, and the step length of the back-off search is half of the step length of the previous search. start P sIf the error requirement is still not met, set the step length of the back-search to half of the step length of the last back-search, and repeat the above steps until the straight line segment P start P s The error requirement is met, and the back-search step is not less than 1. When the back-search step is less than 1, the search ends and the straight line segment P is obtained. start P s ;

[0034] The straight line segment P start P s The steps to meet the error requirements are: Assume that the starting point P start and search point P s The point between is P i , click P i The corresponding bow height is d i , d i That is point P i To the straight line segment P start P s The perpendicular distance of line segment P i P i-1 Instead of the straight line segment P start P s The area enclosed by the projection of is Then each search point P s The straight line segment P obtained after the movement sTart P s The bow height error d e and area error It is expressed as the following formula (3):

[0035]

[0036] In the process of searching for the farthest straight line segment, the straight line segment obtained after each search point moves has a height error d e and area error Must satisfy d e <δ d and δ d is the maximum bow height error of the set straight line segment, is the maximum area error of the set straight line segment;

[0037] The steps of searching the farthest arc segment by the least square method are as follows:

[0038] b1. Initialize the search interval, let [P left , P right ]=[P start , P end ], initialize the search point P s =P left , search step length right-left is point P left and point P right The step length between [P start , P end ] is the interval formed by the starting point and end point of the contour point set. When the search starts, let the arc segment P start P s The length s = t, when P start P s Meet the error requirements and record the P at this time s , then let P left P confirmed for the last search s , recalculate the search step length t = (right-left) / 2, when P start P s Meet the error requirements and record the P at this time s , repeat the above steps and let P left P confirmed for the last search s Continue searching. When the search step length t is not an integer, round it forward. When the search step length is equal to 1, the search ends and the farthest arc segment is found.

[0039] B2, when arc segment P start P s If the error requirement is not met, a back-off search is performed, and P right P confirmed for the last search s , recalculate the backward search step t = (right-left) / 2, when P start P s Meet the error requirements and record the P at this time s , when arc segment P start P s Still does not meet the error requirements, repeat the above steps, let P right P confirmed for the last search s , recalculate the backward search step t and continue searching until the arc segment P start P s The error requirement is met. When right-left≤1 is found, the search ends and the arc segment P is obtained. start P s ;

[0040] The arc segment P start P s The steps to meet the error requirements are as follows: Assume that the arc fitting segment is P start P s , the radius of the fitted arc segment is r o , the coordinates of the center O are (x o ,y o), click P i The arc segment P start P s A point on the i ,y i ), The triangular area P i P i-1 The area of ​​O, θ i For OP i Connection and OP i-1 The angle between the connecting lines is the contour error and area error of the fitted arc segment. It is expressed as the following formula (4):

[0041]

[0042] In formula (4), δ c is the maximum contour error of the set curve segment, It is the maximum area error of the set curve segment.

[0043] The specific steps of calculating the burr cutting path of the edge of the patched paper by using the straight line equation corresponding to the fitted straight line segment and the normal line equation corresponding to the arc segment, and finally generating the G code instruction of the burr cutting path by using the burr cutting path are as follows:

[0044] S41. For the fitted straight line segment, set the straight line segment equation to y=kx+b, and the starting point coordinates to (a, ak+b). Then the vertical line equation at the starting point is Take the starting point (a, ak+b) as the starting point, and intercept a straight cutting line on the perpendicular equation of the starting point. The length of the straight cutting line is the filling width d offset Subtract the set minimum distance error d ctr , and make the end point of the intercepted straight cutting line fall into the closed figure of the patched paper, at this time, the starting point and end point coordinates of the straight cutting line, i.e., the burr cutting line, are obtained; according to this step, the distance d is set for each straight line segment id Perform a straight cutting line interception to obtain the starting point and end point coordinates of a burr cutting line; process the fitted straight line segment according to the above steps to obtain multiple burr cutting lines perpendicular to the straight line segment;

[0045] S42. For the fitted arc segment, calculate the normal equation of the starting point on the arc segment. Since the center and radius of the arc segment are known, the actual normal equation is the equation of the line from the center to the point on the arc segment, and intercept a straight cutting line on the normal line. The length of the straight cutting line is the filling width d. offset Subtract the set minimum distance error d ctr, and make the end point of the intercepted straight cutting line fall into the closed figure of the paper patching, at this time, the starting point and end point coordinates of the straight cutting line, i.e. the burr cutting line, are obtained; on the arc segment, set the distance d every other segment lt Perform a straight cutting line interception to obtain the starting point and end point coordinates of a burr cutting line, until it exceeds the range of the arc segment, then stop intercepting the burr cutting line, thus obtaining multiple burr cutting lines of the curve segment;

[0046] S43. After the burr cutting line of the straight or curved segment is determined, the starting points and end points of adjacent burr cutting lines are arranged in a zigzag pattern, i.e., starting point-end point-end point, starting point-end point, and the directions are alternated in sequence, and a corresponding G1 linear motion command is generated. The on and off state of the laser of the laser cutting equipment is determined according to whether the types of the current point and the next point are the same. When the type of the current point of the burr cutting line is the starting point, and the type of the next point is the end point, that is, the cutting operation of the burr cutting line is performed, the laser is turned on; when the type of the current point of the burr cutting line is the starting point, and the type of the next point is also the starting point, indicating that no actual cutting occurs between the two points, the laser is turned off; according to the switching state of the laser, the corresponding laser control instruction is generated.

[0047] After the burr cutting line is determined, the burr cutting line is further processed by adding random disturbance. The specific steps are as follows:

[0048] C1. Select the starting point of the burr cutting line as the path starting point, and use the burr cutting line as the baseline;

[0049] C2. Define a recursive processing function that accepts two endpoints as input and outputs a new path list with random perturbations added;

[0050] C3. Set the recursive termination condition and the maximum number of recursions, and stop further subdivision when the limit is reached;

[0051] C4. In the recursive processing function, the midpoint between the two input endpoints is calculated, and the direction vector of the line connecting the two endpoints is determined, and the unit vector of the perpendicular direction is calculated according to the direction vector;

[0052] C5. Add random perturbations to the midpoint within the preset maximum offset range according to the unit vector in the vertical direction;

[0053] C6, split the baseline path into two segments along the midpoint, and call the recursive processing function again to add random perturbations to the two ends;

[0054] C7. Repeat step C6, call the recursive processing function to add random perturbations to all path points on the rough edge cutting line, connect all new path points offset by random perturbations in sequence, replace the original baseline, and form a new rough edge cutting line.

[0055] Advantages of the present invention:

[0056] (1) The present invention sets up a visual imaging system, and based on the detection method of background segmentation, by segmenting the damaged pages of ancient books in the image, determines the detection paper area, can cope with the influence of different work surfaces and ambient light on imaging parameters, and can improve the robustness of the damaged area algorithm detection;

[0057] (2) When detecting the paper area, the present invention determines the approximate outline of the damaged pages of the ancient book, which can provide a basis for the subsequent accurate extraction of the paper position. The maximum outline found not only represents the outline boundary of the paper, but also provides key reference information for further processing. By filtering out noise boundaries that are too short and boundaries that are not in the paper area through a custom conditional screening function, noise or insignificant small outlines can be effectively removed to ensure that only meaningful features are retained;

[0058] (3) The present invention fills the outline of the damaged area. The filled outline of the damaged area is slightly larger than the actual area of ​​the damaged area in the damaged page of the ancient book. This part is the outline edge of the repair paper, thereby realizing the cutting and formation of the subsequent repair paper rough edge;

[0059] (4) The present invention cuts a burr cutting line at the edge of the patched paper, so that dense and fine feathers are formed at the edge of the patched paper, which has the effect of replacing the burr. A recursive processing function is introduced and random perturbations are added, so that the generated burr cutting line path presents subtle and irregular changes, which can not only more accurately control the direction of the path change, but also effectively simulate the effect of manual tearing. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 It is a flow chart of the present invention.

[0061] Figure 2 It is an image of the damaged area of ​​the damaged page of the ancient book of the present invention after the boundaries are merged and before filling.

[0062] Figure 3 It is an image after the damaged area of ​​the damaged page of the ancient book of the present invention is filled.

[0063] Figure 4 It is a schematic diagram of searching for the farthest straight line segment according to the present invention.

[0064] Figure 5 It is a structural schematic diagram of determining whether the error requirement is met when searching for the farthest straight line segment in the present invention.

[0065] Figure 6 It is a schematic diagram of searching for the farthest arc segment according to the present invention.

[0066] Figure 7It is a structural schematic diagram of determining whether the error requirement is met when searching for the farthest arc segment in the present invention.

[0067] Figure 8 It is a schematic diagram of the burr cutting line on the straight line segment of the present invention.

[0068] Fig. 9 It is a schematic diagram of the burr cutting line on the arc segment of the present invention.

[0069] Fig.10 It is a schematic diagram before and after adding random disturbance to the burr cutting line of the present invention.

[0070] Fig.11 It is a schematic diagram of the path of the damaged area contour and the rough edge cutting line of the paper repairing method of the present invention.

[0071] Fig.12 yes Fig.11 Enlarged view of part A in .

[0072] Fig.13 yes Fig.11 Enlarged view of part B in . DETAILED DESCRIPTION

[0073] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0074] A laser cutting path planning method for rough-edged paper for ancient book restoration specifically comprises the following steps:

[0075] (1) The visual imaging system includes a camera with a lens facing the detection platform and a host computer connected to the camera. The repair motion mechanism is a two-axis motion mechanism of the laser cutting equipment. The image coordinate system of the visual imaging system and the coordinate system of the repair motion mechanism are calibrated. The specific steps are as follows:

[0076] S11. Lay a piece of white paper on the detection platform, and use the repair motion mechanism to draw N straight line segments with different direction angles and lengths on the white paper, where N ≥ 9. Then use a camera to image the white paper. The coordinates of the endpoint of a straight line segment in the image coordinate system of the visual imaging system are (x′ i , y′ i ), the corresponding coordinates of the end point of a straight line segment in the coordinate system of the repair motion mechanism are (x i ,y i ), set the transformation matrix H so that In order to find the optimal solution, the least squares method is used to minimize the objective function: (x i ,y i , 1) and (x′ i , y′ i , 1) are respectively (x i ,y i ) and (x′ i , y′ t )’s homogeneous coordinates;

[0077] S12, the coordinates of the endpoint of the straight line segment in the repair motion mechanism (x i ,y i ,1) It is known that, through Hough line detection, the coordinates of the end points of the straight line segment corresponding to the image coordinate system of the visual imaging system are obtained, and the transformation matrix H is obtained by minimizing the objective function;

[0078] S13, converting the image coordinate system of the visual imaging system into the restoration motion mechanism coordinate system through the transformation matrix H;

[0079] (2) Use the camera to image the empty detection platform for the first time to obtain the background image. Then, under the same environmental conditions, place the damaged pages of the ancient book on the detection platform. The camera images the detection platform with the damaged pages of the ancient book for the second time to obtain the target image. Then, the host computer compares the background image and the target image, finds the damaged area of ​​the damaged pages, and calculates the contour coordinates of the damaged area. The specific steps are as follows:

[0080] S21, downsampling: the background image I obtained by the visual imaging system back and the target image I obj All are converted into grayscale images, and then the resolution of the grayscale images is reduced by the average downsampling function. The average downsampling function is shown in the following formula (1):

[0081]

[0082] In formula (1), I′ represents the grayscale image after downsampling, I is the original grayscale image, k is the downsampling window size, I(i, j) represents the grayscale value of the pixel coordinates (i, j) in the original grayscale image, and I′(x′, y′) is the grayscale value of the pixel coordinates (x′, y′) in the downsampling grayscale image;

[0083] Downsampling simplifies image data, making subsequent processing more efficient. It generates a low-resolution version of the image by dividing the original image into multiple small grids and replacing the entire grid with the average brightness in the grid.

[0084] S22, Boolean operation: compare the downsampled background image I back and the target image I objThe difference between the two is used to segment the Boolean image containing only the paper area, and then the Boolean image is binarized according to the function of formula (2), so that the approximate area containing the paper appears white and the rest is black;

[0085]

[0086] In formula (2), I(x, y) represents the gray value of the pixel coordinates (x, y) in the Boolean image, P(x, y) is the gray value of the pixel coordinates (x, y) in the binarized image, and T is the set gray threshold;

[0087] The binarization operation helps to preliminarily determine the position of the paper. By setting the grayscale threshold, the paper and other background elements can be effectively segmented. For the pixels whose changes exceed the grayscale threshold, they are retained as the foreground, thus constructing a new image containing only the paper information.

[0088] S23, boundary search and screening: First, use the Canny algorithm to search for all boundaries in the binarized image, select the largest boundary as the approximate boundary of the paper, and calculate the minimum circumscribed rectangle of the approximate boundary to obtain the paper area that needs to be detected; then use the Canny algorithm to search for all possible boundaries in the minimum circumscribed rectangle area, and among the possible boundaries searched, use a custom conditional screening function to filter out noise boundaries that are too short and boundaries that are not in the paper area, effectively remove noise or insignificant small contours, and ensure that only meaningful damaged area features are retained;

[0089] S24, Contour merging and filling: Calculate the minimum Euclidean distance between two contour point sets in the filtered boundary: d min =min i,j ||P i -Q j ||2, where P and Q represent two contour point sets, P i represents the point with sequence number i in the contour point set P, Q j Represents the point with sequence number j in the contour point set Q, d min Represents the minimum Euclidean distance between all pairs of points in two contour points, min i,j It means to find the one that can make ||P i -Q j ||2The smallest combination of i and j, ||P i -Q j ||2 represents point P i And Q j The Euclidean distance is obtained by calculating the square root of the sum of the squares of the coordinate differences of the two points; then the minimum Euclidean distance d min Less than the set minimum distance error d ctrThe contours of Figure 2 ), fill each point in the merged contour with a filling width of d offset Not less than the set minimum distance error d ctr , and the filled contour is represented in the new blank image (see Figure 3 ); finally, the Canny algorithm is used to search for the contour of the filled contour image again, and only the outermost contour is retained as the contour of the damaged area, that is, the contour of the patched paper, and the coordinates of the contour of the damaged area are calculated;

[0090] When there are multiple contours with close positions, they may actually be different areas within the same contour. By calculating the minimum distance between these contours, the contours that are incorrectly segmented can be identified and merged to improve the accuracy of the final result.

[0091] (3) Convert the damaged area contour coordinates on the image coordinate system of the visual imaging system into the coordinates of the repair motion mechanism, fit the repair motion mechanism coordinates into multiple straight line segments and arc segments, and generate the G code instructions of the contour cutting path. The specific steps are as follows:

[0092] S31, using the transformation matrix H to convert the damaged area contour coordinates in the image coordinate system of the visual imaging system into the coordinates of the repair motion mechanism, to obtain a contour coordinate set (P′1, P′2, ..., P′ i , …P′ n ), where n represents the total number of damaged areas, P′ i ={(x i1 ′,y i1 ′),...,(x iN ′,y iN ′)}, N represents the contour P′ i The total number of mid-contour points;

[0093] S32, from the contour P' in the coordinate system of the repair motion mechanism i Select a starting point from the starting point, and start from the starting point. Under the condition of satisfying the error constraint, search for the farthest straight line segment through the iterative search algorithm with a variable step size, and search for the farthest arc segment through the least squares method. Select the straight line segment or arc segment with a farther end point as the fitting method for the segment; when the end point of the fitted straight line segment or arc segment is not the contour P′ i The last point in the point set, the end point of this straight line segment or arc segment is regarded as the new starting point, and the above steps are repeated to continue to find the farthest straight line segment or arc segment; when the end point of the fitted straight line segment or arc segment is the contour P′ i When the last point in the point set is reached, the fitting process of this contour point set ends, and the contour information of the damaged area is converted into a closed figure composed of multiple straight line segments and arc segment primitives;

[0094] See Figure 4 , the steps of searching the farthest straight line segment by the iterative search algorithm with variable step size are:

[0095] A1. First select the starting point P start , let the contour P′ i Search point P in the point set s =P start , set the initial search step t = 1, start searching, search for the straight line segment P start P s The length of s = t, and the straight line segment P starT P s Meet the error requirements and record the P at this time s , then set the search step to 2t and continue searching. At this time, s = t + 2t, and the straight line segment P start P s Meet the error requirements and record the P at this time s , continue searching according to the above steps, and the step length of each search is twice the step length of the previous search;

[0096] A2. When the straight line segment P is found start P s If the error requirement is not met, a back-off search is performed, and the step length of the back-off search is set to be half of the step length of the previous search. For example, if the step length of the previous search is 4t, the step length of the back-off search is 2t. At this time, s = t + 2t + 4t - 2t. When the straight line segment P start P s If the error requirement is still not met, set the step length of the back-search to half of the step length of the previous back-search, then s = t + 2t + 4t - 2t - t, and repeat the above steps until the straight line segment P start P s The error requirement is met, and the back-search step is not less than 1. When the back-search step is less than 1, the search ends and the straight line segment P is obtained. start P s ;

[0097] See Figure 5 , straight line segment P start P s The steps to meet the error requirements are: Assume that the starting point P start and search point P s The point between them is Pi, and the bow height corresponding to point Pi is d i , d i That is point P i To the straight line segment P start P s The perpendicular distance of line segment P i P i-1 Instead of the straight line segment P start Ps The area enclosed by the projection of is Then each search point P s The straight line segment P obtained after the movement start P s The bow height error de and area error It is expressed as the following formula (3):

[0098]

[0099] In the process of searching for the farthest straight line segment, the straight line segment obtained after each search point moves has a height error d e and area error All must satisfy de<δ d and δ d is the maximum bow height error of the set straight line segment, is the maximum area error of the set straight line segment;

[0100] See Figure 6 , the steps to search for the farthest arc segment using the least squares method are:

[0101] b1. Initialize the search interval, let [P left , P right ]=[P start , P end ], initialize the search point P s =P left , search step length right-left is point P left and point P right The step length between [P start , P end ] is the interval formed by the starting point and end point of the contour point set. When the search starts, let the arc segment P start P s The length s = t, when P start P s Meet the error requirements and record the P at this time s ,at this time end-start is point P start and point P end The step length between, then let P left P confirmed for the last search s , recalculate the search step length t = (right-left) / 2, when P start P s Meet the error requirements and record the P at this time s ,at this time end-s l It is the P confirmed in the last search.s and P end The step length between, repeat the above steps to make P left P confirmed for the last search s Continue searching. When the search step length t is not an integer, round it forward. When the search step length is equal to 1, the search ends and the farthest arc segment is found.

[0102] B2, when arc segment P start P s If the error requirement is not met, a back-off search is performed, and P right P confirmed for the last search s , recalculate the backward search step t = (right-left) / 2, when P start P s Meet the error requirements and record the P at this time s ,at this time When the arc segment P start P s Still does not meet the error requirements, repeat the above steps, let P right P confirmed for the last search s , recalculate the backward search step t and continue searching until the arc segment P start P s The error requirement is met. When right-left≤1 is found, the search ends and the arc segment P is obtained. start P s ;

[0103] See Figure 7 , arc segment P start P s The steps to meet the error requirements are as follows: Assume that the arc fitting segment is P start P s , the radius of the fitted arc segment is r o , the coordinates of the center O are (x o ,y o ), click P i The arc segment P start P s A point on the i ,y i ), The triangular area P i P i-1 The area of ​​O, θ i For OP i Connection and OP i-1 The angle between the connecting lines is the contour error and area error of the fitted arc segment. It is expressed as the following formula (4):

[0104]

[0105] In formula (4), δ c is the maximum contour error of the set curve segment, is the maximum area error of the set curve segment;

[0106] S33, the path obtained after fitting is composed of multiple straight line segments, multiple arc segments, or multiple straight line segments and multiple arc segments connected end to end in sequence. When the previous segment cutting instruction is completed and the end point of this segment cutting is reached, the next segment cutting starting point is also reached. Therefore, for the cutting path of each contour, the starting point of the first segment in the path needs to use G90 absolute motion to reach the starting point position, and the corresponding G1 linear motion instruction or G2 / G3 circular motion instruction is generated according to the type of each segment and the relevant information of the endpoint coordinates;

[0107] When the first segment of the contour cutting path is a straight line segment and the second segment is an arc segment, the starting coordinates of the first straight line segment are (x1, y1) and the end coordinates are (x2, y2). The end coordinates of the first straight line segment are also the starting coordinates of the second arc segment. The end coordinates of the second arc segment are (x3, y3) and the center of the circle is (x o ,y o ), the radius is r o , then first generate G90Xx1Yy1 to control the repair motion mechanism to reach the starting point of the first straight line segment, and then use the S command to control the laser of the laser cutting equipment to turn on, and then generate G1Xx2Yy2 to control the laser to reach the end point of the first straight line segment to complete the straight line segment cutting task; then generate the corresponding G code with the coordinates of the starting point, end point, and center of the second arc segment. The steps are as follows: first calculate the vector V1 from the starting point of the arc segment to the center of the circle and the vector V2 from the end point of the arc segment to the center of the circle, and then determine the direction of the arc according to the relationship between V1 and V2. When the angle between V1 and V2 is less than 180 degrees and is a positive number, it is counterclockwise; when the angle between V1 and V2 is a negative number or greater than 180 degrees, it is clockwise; then generate the G code for the corresponding arc segment according to the coordinates of the center of the circle, the direction of the arc, and the radius of the arc. When it is a clockwise arc segment, generate G2Xx o Yy o R o , when it is a counterclockwise arc segment, G3Xx is generated o Yy o R o ; Thus, the generation of cutting instructions for straight line segments and arc segments is completed, and the subsequent G code instructions for straight line segments and arc segments are obtained in sequence according to the above steps;

[0108] (4) The burr cutting path of the patch paper edge is calculated by the straight line equation corresponding to the fitted straight line segment and the normal line equation corresponding to the arc segment. The burr cutting path of each straight line segment is a burr cutting path composed of multiple vertical lines located inside the contour of the patch paper edge and perpendicular to the straight line segment. The burr cutting path of each arc segment is a burr cutting path composed of multiple normal lines located inside the contour of the patch paper edge and perpendicular to the arc segment. Finally, the G code instruction of the burr cutting path is generated by the burr cutting path. The specific steps are as follows:

[0109] S41, see Figure 8 For the fitted straight line segment, set the straight line segment equation to y = kx + b, and the starting point coordinates to (a, ak + b), then the vertical line equation at the starting point is Take the starting point (a, ak+b) as the starting point, and intercept a straight cutting line on the perpendicular equation of the starting point. The length of the straight cutting line is the filling width d offset Subtract the set minimum distance error d ctr , and make the end point of the intercepted straight cutting line fall into the closed figure of the patched paper, at this time, the starting point and end point coordinates of the straight cutting line, i.e., the burr cutting line, are obtained; according to this step, the distance d is set for each straight line segment lt Perform a straight cutting line interception to obtain the starting point and end point coordinates of a burr cutting line; process the fitted straight line segment according to the above steps to obtain multiple burr cutting lines perpendicular to the straight line segment;

[0110] S42, see Fig. 9 For the fitted arc segment, calculate the normal equation of the starting point on the arc segment. Since the center and radius of the arc segment are known, the actual normal equation is the equation of the line from the center to the point on the arc segment, and intercept a straight cutting line on the normal line. The length of the straight cutting line is the filling width d offset Subtract the set minimum distance error d ctr , and make the end point of the intercepted straight cutting line fall into the closed figure of the paper patching, at this time, the starting point and end point coordinates of the straight cutting line, i.e. the burr cutting line, are obtained; on the arc segment, set the distance d every other segment lt Perform a straight cutting line interception to obtain the starting point and end point coordinates of a burr cutting line, until it exceeds the range of the arc segment, then stop intercepting the burr cutting line, thus obtaining multiple burr cutting lines of the curve segment;

[0111] See Fig.10 After the burr cutting line is determined, the burr cutting line is further processed and random disturbance is added. The specific steps are as follows:

[0112] C1. Select the starting point of the burr cutting line as the path starting point, and use the burr cutting line as the baseline M (dashed line);

[0113] C2. Define a recursive processing function that accepts two endpoints as input and outputs a new path list with random perturbations added;

[0114] C3. Set the recursive termination condition and the maximum number of recursions, and stop further subdivision when the limit is reached;

[0115] C4. In the recursive processing function, the midpoint between the two input endpoints is calculated, and the direction vector of the line connecting the two endpoints is determined, and the unit vector of the perpendicular direction is calculated according to the direction vector;

[0116] C5. Add random perturbations to the midpoint within the preset maximum offset range according to the unit vector in the vertical direction;

[0117] C6, split the baseline path into two segments along the midpoint, and call the recursive processing function again to add random perturbations to the two ends;

[0118] C7, repeat step C6, call the recursive processing function to add random perturbations to all path points on the burr cutting line, connect all new path points offset by adding random perturbations in sequence, replace the original baseline, and form a new burr cutting line L (solid line);

[0119] S43, see Figure 11-13 After the burr cutting line of the straight or curved segment is determined, the starting points and end points of adjacent burr cutting lines are arranged in a zigzag pattern, that is, the starting point-end point-end point-starting point-starting point-end point are alternately arranged in order, and the corresponding G1 linear motion command is generated. The on and off state of the laser of the laser cutting equipment is determined according to whether the types of the current point and the next point are the same. When the type of the current point of the burr cutting line is the starting point, and the type of the next point is the end point, that is, the cutting operation of the burr cutting line is performed, the laser is turned on; when the type of the current point of the burr cutting line is the starting point, and the type of the next point is also the starting point, indicating that no actual cutting occurs between the two points, the laser is turned off; according to the switching state of the laser, the corresponding laser control instruction is generated.

[0120] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A laser cutting path planning method for rough-edged paper for ancient book restoration, characterized in that: The specific steps include: (1) Calibrate the image coordinate system of the visual imaging system and the coordinate system of the repair motion mechanism; (2) Using the visual imaging system to image the empty detection platform for the first time, after obtaining the background image, under the same environmental conditions, the damaged pages of the ancient book are placed on the detection platform, and the visual imaging system performs a second imaging of the detection platform with the damaged pages of the ancient book placed thereon to obtain the target image. Then, the visual imaging system compares the background image and the target image, finds the damaged area of ​​the damaged pages of the ancient book, and calculates the contour coordinates of the damaged area; (3) Convert the damaged area contour coordinates on the image coordinate system of the visual imaging system into the coordinates of the repair motion mechanism, fit the repair motion mechanism coordinates into multiple straight line segments and circular arc segments, and generate G code instructions for the contour cutting path; (4) The burr cutting path of the patched paper edge is calculated by using the straight line equation corresponding to the fitted straight line segment and the normal line equation corresponding to the arc segment. The burr cutting path of each straight line segment is a burr cutting path composed of multiple vertical lines located inside the patched paper edge contour and perpendicular to the straight line segment. The burr cutting path of each arc segment is a burr cutting path composed of multiple normal lines located inside the patched paper edge contour and perpendicular to the arc segment. Finally, the G code command of the burr cutting path is generated through the burr cutting path.

2. The laser cutting path planning method for rough-edged patch paper for ancient book restoration according to claim 1 is characterized in that: The visual imaging system includes a camera with a lens facing the detection platform and a host computer connected to the camera. The camera is used to collect images of the area where the detection platform is located. The host computer performs image comparison, finds the damaged area of ​​the damaged book page, calculates the contour coordinates of the damaged area, and generates G code instructions for the contour cutting path and the G code instructions for the burr cutting path.

3. The laser cutting path planning method for rough-edged patch paper for ancient book restoration according to claim 2 is characterized in that: The repair motion mechanism is a two-axis motion mechanism of laser cutting equipment.

4. The laser cutting path planning method for rough-edged patch paper for ancient book restoration according to claim 2 is characterized in that: The specific steps of calibrating the image coordinate system of the visual imaging system and the coordinate system of the repair motion mechanism are as follows: S11. Lay a piece of white paper on the detection platform, and use the repair motion mechanism to draw N straight line segments with different direction angles and lengths on the white paper, where N ≥ 9. Then use a camera to image the white paper. The coordinates of the endpoint of a straight line segment in the image coordinate system of the visual imaging system are (x i ′ ,y i ′ ), the corresponding coordinates of the end point of a straight line segment in the coordinate system of the repair motion mechanism are (x i ,y i ), set the transformation matrix H so that In order to find the optimal solution, the least squares method is used to minimize the objective function: (x i ,y i ,1) and (x i ′ ,y i ′ ,1) are respectively (x i ,y i ) and (x i ′ ,y i ′ )’s homogeneous coordinates; S12, the coordinates of the endpoint of the straight line segment in the repair motion mechanism (x i ,y i ,1) It is known that, through Hough line detection, the coordinates of the endpoints of the straight line segment corresponding to the image coordinate system of the visual imaging system are obtained, and the transformation matrix H is obtained by minimizing the objective function; S13. Convert the image coordinate system of the visual imaging system into the restoration motion mechanism coordinate system through the transformation matrix H.

5. The laser cutting path planning method for rough-edged patch paper for ancient book restoration according to claim 4 is characterized in that: The specific steps of the visual imaging system performing a comparison process on the background image and the target image, finding the damaged area of ​​the damaged book page, and calculating the coordinates of the contour of the damaged area are as follows: S21, downsampling: the background image I obtained by the visual imaging system back and the target image I obj All are converted into grayscale images, and then the resolution of the grayscale images is reduced by the average downsampling function. The average downsampling function is shown in the following formula (1): In formula (1), I ′ represents the grayscale image after downsampling, I is the original grayscale image, k is the downsampling window size, I(i,j) represents the grayscale value of the pixel coordinate (i,j) in the original grayscale image, I ′ (x ′ ,y ′ ) is the pixel coordinate in the grayscale image after downsampling (x ′ ,y ′ )’s grayscale value; S22, Boolean operation: compare the downsampled background image I back and the target image I obj The difference between the two is used to segment the Boolean image containing only the paper area, and then the Boolean image is binarized according to the function of formula (2), so that the approximate area containing the paper appears white and the rest is black; In formula (2), I(x, y) represents the gray value of the pixel coordinate (x, y) in the Boolean image, P(x, y) is the gray value of the pixel coordinate (x, y) in the binarized image, and T is the set gray threshold; S23, boundary search and screening: first, use the Canny algorithm to search for all boundaries in the binarized image, select the largest boundary as the approximate boundary of the paper, and calculate the minimum circumscribed rectangle of the approximate boundary to obtain the paper area to be detected; then use the Canny algorithm to search for all possible boundaries in the minimum circumscribed rectangle area, and among the possible boundaries searched, filter out noise boundaries that are too short and boundaries that are not in the paper area through a custom conditional screening function; S24, Contour merging and filling: Calculate the minimum Euclidean distance between two contour point sets in the filtered boundary: d min =min i,j ||P i -Q j ||2, where P and Q represent two contour point sets, P i represents the point with sequence number i in the contour point set P, Q j Represents the point with sequence number j in the contour point set Q, d min Represents the minimum Euclidean distance between all pairs of points in two contour points, min i,j It means to find the one that can make ||P i -Q j ||2The smallest combination of i and j, ||P i -Q j ||2 represents point P i and Q j The Euclidean distance is obtained by calculating the square root of the sum of the squares of the coordinate differences of the two points; then the minimum Euclidean distance d min Less than the set minimum distance error d ctr The contours of the merged contour are merged into one contour, and each point in the merged contour is filled with a filling width of d offset Not less than the set minimum distance error d ctr , and represent the filled contour in a new blank image; finally, the Canny algorithm is used to search for contours on the filled contour image again, and only the outermost contour is retained as the contour of the damaged area, that is, the contour of the patched paper, and the coordinates of the contour of the damaged area are calculated.

6. The laser cutting path planning method for rough-edged patch paper for ancient book restoration according to claim 5 is characterized in that: The damaged area contour coordinates on the image coordinate system of the visual imaging system are converted into the coordinates of the repair motion mechanism to obtain the contour coordinate set (P′1, P′2, …, P′ i ,…P′ n ), where n represents the total number of damaged areas, P′ i ={(x i1 ′,y i1 ′),…,(x iN ′,y iN ′)}, N represents the contour P′ i The total number of mid-contour points.

7. The laser cutting path planning method for rough-edged patch paper for ancient book restoration according to claim 6 is characterized in that: The specific steps of fitting the coordinates of the repair motion mechanism into a plurality of straight line segments and arc segments and generating the G code instructions of the contour cutting path are as follows: S32, from the contour P' in the coordinate system of the repair motion mechanism i Select a starting point from the starting point, and start from the starting point. Under the condition of meeting the error constraint, use the variable step size iterative search algorithm to search for the farthest straight line segment, and use the least squares method to search for the farthest arc segment. Compare the end points of the searched straight line segment and arc segment, and select the straight line segment or arc segment with a farther end point as the fitting method of the segment; when the end point of the fitted straight line segment or arc segment is not the contour P i ′ The last point in the point set is regarded as the end point of the straight line segment or arc segment as the new starting point, and the above steps are repeated to continue to find the farthest straight line segment or arc segment; when the end point of the fitted straight line segment or arc segment is the contour P i ′ When the last point in the point set is reached, the fitting process of this contour point set ends, and the contour information of the damaged area is converted into a closed figure composed of multiple straight line segments and arc segment primitives; S33, the path obtained after fitting is composed of multiple straight line segments, multiple arc segments, or multiple straight line segments and multiple arc segments connected end to end in sequence. When the previous segment cutting instruction is completed and the end point of this segment cutting is reached, the next segment cutting starting point is also reached. Therefore, for the cutting path of each contour, the starting point of the first segment in the path needs to use G90 absolute motion to reach the starting point position, and the corresponding G1 linear motion instruction or G2 / G3 circular motion instruction is generated according to the type of each segment and the relevant information of the endpoint coordinates; When the first segment of the contour cutting path is a straight line segment and the second segment is an arc segment, the starting coordinates of the first straight line segment are (x1, y1) and the end coordinates are (x2, y2). The end coordinates of the first straight line segment are also the starting coordinates of the second arc segment. The end coordinates of the second arc segment are (x3, y3) and the center of the circle is (x o ,y o ), the radius is r o , then first generate G90Xx1Yy1 to control the repair motion mechanism to reach the starting point of the first straight line segment, and then use the S command to control the laser of the laser cutting equipment to turn on, and then generate G1Xx2Yy2 to control the laser to reach the end point of the first straight line segment to complete the straight line segment cutting task; then generate the corresponding G code with the coordinates of the starting point, end point, and center of the second arc segment. The steps are as follows: first calculate the vector V1 from the starting point of the arc segment to the center of the circle and the vector V2 from the end point of the arc segment to the center of the circle, and then determine the direction of the arc according to the relationship between V1 and V2. When the angle between V1 and V2 is less than 180 degrees and is a positive number, it is counterclockwise; when the angle between V1 and V2 is a negative number or greater than 180 degrees, it is clockwise; then generate the G code for the corresponding arc segment according to the coordinates of the center of the circle, the direction of the arc, and the radius of the arc. When it is a clockwise arc segment, generate G2Xx o Yy o R o , when it is a counterclockwise arc segment, G3Xx is generated o Yy o R o ; Thus, the generation of cutting instructions for straight line segments and arc segments is completed, and the subsequent G code instructions for straight line segments and arc segments are obtained in sequence according to the above steps.

8. The laser cutting path planning method for rough-edged patch paper for ancient book restoration according to claim 7, characterized in that: The steps of searching the farthest straight line segment by the iterative search algorithm with variable step size are as follows: A1. First select the starting point P statt , let the contour P i ′ Search point P in the point set s =P start , set the initial search step t = 1, start searching, search for the straight line segment P start P s The length of s = t, and the straight line segment P start P s Meet the error requirements and record the P at this time s , then set the search step to 2t and continue searching. At this time, s = t + 2t, and the straight line segment P start P s Meet the error requirements and record the P at this time s , continue searching according to the above steps, and the step length of each search is twice the step length of the previous search; A2. When the straight line segment P is found start P s If the error requirement is not met, a back-off search is performed, and the step length of the back-off search is half of the step length of the previous search. start P s If the error requirement is still not met, set the step length of the back-search to half of the step length of the last back-search, and repeat the above steps until the straight line segment P start P s The error requirement is met, and the back-search step is not less than 1. When the back-search step is less than 1, the search ends and the straight line segment P is obtained. start p s ; The straight line segment P start P s The steps to meet the error requirements are: Assume that the starting point P start and search point P s The point between is P i , click P i The corresponding bow height is d i , d i That is point P i To the straight line segment P start P s The perpendicular distance of line segment P i P i-1 Instead of the straight line segment P start P s The area enclosed by the projection of is Then each search point P s The straight line segment P obtained after the movement start P s The bow height error d e and area error It is expressed as the following formula (3): In the process of searching for the farthest straight line segment, the straight line segment obtained after each search point moves has a height error d e and area error Must satisfy d e <δ d and δ d is the maximum bow height error of the set straight line segment, is the maximum area error of the set straight line segment; The steps of searching the farthest arc segment by the least square method are as follows: B1. Initialize the search interval, let [P left ,P right ]=[P start ,P end ], initialize the search point P s =P left , search step length right-left is point P left and point P right The step length between [P start ,P end ] is the interval formed by the starting point and end point of the contour point set. When the search starts, let the arc segment P start P s The length s = t, when P start P s Meet the error requirements and record the P at this time s , then let P left P confirmed for the last search s , recalculate the search step length t = (right-left) / 2, when P start P s Meet the error requirements and record the P at this time s , repeat the above steps and let P left P confirmed for the last search s Continue searching. When the search step length t is not an integer, round it forward. When the search step length is equal to 1, the search ends and the farthest arc segment is found. B2, when arc segment P start P s If the error requirement is not met, a back-off search is performed, and P right P confirmed for the last search s , recalculate the backward search step t = (right-left) / 2, when P start P s Meet the error requirements and record the p at this time s , when the arc segment p start P s Still does not meet the error requirements, repeat the above steps, let P right p confirmed for the last search s , recalculate the backward search step t and continue searching until the arc segment P start P s The error requirement is met. When right-left≤1 is found, the search ends and the arc segment P is obtained. start P s ; The arc segment P start P s The steps to meet the error requirements are as follows: Assume that the arc fitting segment is P start P s , the radius of the fitted arc segment is r o , the coordinates of the center O are (x o ,y o ), click P i The arc segment P start P s A point on the i ,y i ), The triangular area P i P i-1 The area of ​​O, θ i For OP i Connection and OP i-1 The angle between the connecting lines is the contour error and area error of the fitted arc segment. It is expressed as the following formula (4): In formula (4), δ c is the maximum contour error of the set curve segment, It is the maximum area error of the set curve segment.

9. The laser cutting path planning method for rough-edged patch paper for ancient book restoration according to claim 7, characterized in that: The specific steps of calculating the burr cutting path of the edge of the patched paper by using the straight line equation corresponding to the fitted straight line segment and the normal line equation corresponding to the arc segment, and finally generating the G code instruction of the burr cutting path by using the burr cutting path are as follows: S41. For the fitted straight line segment, set the straight line segment equation to y=kx+b, and the starting point coordinates to (a,ak+b). Then the vertical line equation at the starting point is Take the starting point (a,ak+b) as the starting point, and intercept a straight cutting line on the perpendicular equation of the starting point. The length of the straight cutting line is the filling width d offset Subtract the set minimum distance error d ctr , and make the end point of the intercepted straight cutting line fall into the closed figure of the patched paper, at this time, the starting point and end point coordinates of the straight cutting line, i.e., the burr cutting line, are obtained; according to this step, the distance d is set for each straight line segment lt Perform a straight cutting line interception to obtain the starting point and end point coordinates of a burr cutting line; process the fitted straight line segment according to the above steps to obtain multiple burr cutting lines perpendicular to the straight line segment; S42. For the fitted arc segment, calculate the normal equation of the starting point on the arc segment. Since the center and radius of the arc segment are known, the actual normal equation is the equation of the line from the center to the point on the arc segment, and intercept a straight cutting line on the normal line. The length of the straight cutting line is the filling width d. offset Subtract the set minimum distance error d ctr , and make the end point of the intercepted straight cutting line fall into the closed figure of the paper patching, at this time, the starting point and end point coordinates of the straight cutting line, i.e. the burr cutting line, are obtained; on the arc segment, set the distance d every other segment lt Perform a straight cutting line interception to obtain the starting point and end point coordinates of a burr cutting line, until it exceeds the range of the arc segment, then stop intercepting the burr cutting line, thus obtaining multiple burr cutting lines of the curve segment; S43. After the burr cutting line of the straight or curved segment is determined, the starting points and end points of adjacent burr cutting lines are arranged in a zigzag pattern, i.e., the starting point-end point-end point-starting point-starting point-end point are alternately arranged in order, and the corresponding G1 linear motion command is generated. The on and off state of the laser of the laser cutting equipment is determined according to whether the types of the current point and the next point are the same. When the type of the current point of the burr cutting line is the starting point and the type of the next point is the end point, that is, the cutting operation of the burr cutting line is performed, the laser is turned on; when the type of the current point of the burr cutting line is the starting point and the type of the next point is also the starting point, indicating that no actual cutting occurs between the two points, the laser is turned off; according to the switching state of the laser, the corresponding laser control instruction is generated.

10. The laser cutting path planning method for rough-edged patch paper for ancient book restoration according to claim 9, characterized in that: After the burr cutting line is determined, the burr cutting line is further processed by adding random disturbance. The specific steps are as follows: C1. Select the starting point of the burr cutting line as the path starting point, and use the burr cutting line as the baseline; C2. Define a recursive processing function that accepts two endpoints as input and outputs a new path list with random perturbations added; C3. Set the recursive termination condition and the maximum number of recursions, and stop further subdivision when the limit is reached; C4. In the recursive processing function, the midpoint between the two input endpoints is calculated, and the direction vector of the line connecting the two endpoints is determined, and the unit vector of the perpendicular direction is calculated according to the direction vector; C5. Add random perturbations to the midpoint within the preset maximum offset range according to the unit vector in the vertical direction; C6, split the baseline path into two segments along the midpoint, and call the recursive processing function again to add random perturbations to the two ends; C7. Repeat step C6, call the recursive processing function to add random perturbations to all path points on the rough edge cutting line, connect all new path points offset by random perturbations in sequence, replace the original baseline, and form a new rough edge cutting line.

Citation Information

Cited By

  • Numerical control machining path cutting method, system and equipment and readable storage medium

    CN121232710A