Variable grid calibration structure and algorithm for an automatic line drawing machine
The variable grid calibration structure and algorithm in paint machines allow for adjustable grid spacing and remote control, addressing the issue of fixed grid spacing in existing machines to enhance image calibration precision and camera calibration accuracy.
Patent Information
- Application Number
- CN202411301774.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2044-09-18
AI Technical Summary
In existing line drawing machines, the spacing of the grid plates is fixed, resulting in the accuracy of image calibration that cannot be adjusted, affecting the accuracy of line drawing.
A variable grid calibration structure of an automatic liner is designed to adjust the grid spacing through a servo motor drive screw, and combine the segmentation algorithm and sub-pixel-level refinement technology to realize real-time adjustment and accurate calibration of grid spacing.
It realizes the correspondence between the camera coordinate system and the real world coordinate system quickly and simply according to actual accuracy requirements, and improves the accuracy and efficiency of image calibration.
Smart Images

Figure CN119235089B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of line drawing machines, and particularly relates to a variable grid calibration structure and algorithm for an automatic line drawing machine. Background Art
[0002] A line drawing machine is a machine that precisely draws various patterns, texts, marks, etc. on materials such as leather, textiles, rubber, plastics, and rigid foams. Shoe manufacturers use this machine in the shoe production line to meet the process requirements of line drawing, marking, punching, etc. at positions such as the soles and uppers of shoes. The operation process of the line drawing machine is divided into two main parts: one is the control system, including a computer, programs, software, etc.; the other is the mechanical part, including a machine body, a workbench, a motor, etc. Under the command of the control system, the mechanical part starts to operate and uses tools such as steel knives, steel needles, nozzles, etc. to complete actions such as line drawing or marking. The footwear manufacturing industry is an important application scenario for line drawing machines.
[0003] In a line drawing machine, machine vision is usually applied to photograph the actual shape of the leather, and then the image is recognized and processed to automatically perform line drawing. Machine vision is a process of using a computer to simulate human vision and using software algorithms to analyze and understand the images captured by a camera for automatic recognition and judgment. The essence of machine vision is to obtain real information about the three-dimensional world through images. In this process, two problems need to be considered: one is how to correspond the objects in the camera coordinate system with the objects in the real-world coordinate system, and the other is how to correct various distortions of the lens. Therefore, when it comes to calibration, calibration is used to establish the connection between the image and the world and correct various distortions of the image. The calibration of the camera can establish the correspondence between the points in the two-dimensional image and the points in the three-dimensional space. In actual shooting, camera distortion is a very common problem, such as radial distortion, tangential distortion, etc. Radial distortion includes pincushion distortion and barrel distortion, and tangential distortion is generally caused by the lens not being completely parallel to the image. Differences in the shape or process of the lens may also cause image distortion, so it is necessary to perform distortion correction on the image through calibration.
[0004] Regarding the above distortion problems, in the conventional technology, a grid plate is placed inside the line drawing machine. After shooting, based on the background of the grid plate and using its grid nodes, image calibration is performed, so it can provide correction for the above distortion problems. The distance of the grid becomes the key to precision adjustment. However, for the existing technology, the used plate is fixedly set, and the spacing of the grid cannot be adjusted. Therefore, during subsequent use, the precision of image calibration cannot be adjusted. Furthermore, when improving the precision of line drawing, it is necessary to first address the precision problem of shooting image calibration. Summary of the Invention
[0005] The object of the present invention is to provide a variable grid calibration structure and algorithm for an automatic line drawing machine. The structure is convenient to install, simple in structure, can freely adjust the spacing of the grid, and at the same time realizes remote control, and can adjust the grid spacing in real time according to the actual required accuracy to improve the accuracy of image calibration. Moreover, the calibration method based on this structure can quickly and accurately calibrate the camera under different accuracy requirements, and can more simply and conveniently complete the correspondence between the camera coordinate system and the real world coordinate system during camera calibration, saving time.
[0006] To achieve the above object, the present invention provides the following technical solution: A variable grid calibration structure for an automatic line drawing machine, which includes a fixed frame placed inside the automatic line drawing machine. A number of fixed seats are slidably connected inside the fixed frame. A number of fixed seats are provided along the four sides of the fixed frame. A connecting head is hung on each fixed seat. A silk thread is fixedly penetrated between two oppositely arranged connecting heads. All the silk threads cross to form a number of grids. A spacing adjusting member is provided between a number of fixed seats arranged on the same side for adjusting the spacing of the fixed seats.
[0007] As a preferred solution of the present invention, a chute is provided on the inner wall of the fixed frame, and the fixed seat is slidably connected inside the chute.
[0008] As a preferred solution of the present invention, a buckle groove is provided inside the fixed seat, and the buckle groove is hung with the connecting head.
[0009] As a preferred solution of the present invention, the spacing adjusting member includes an adjusting rod hinged to the side of the fixed seat. The two adjusting rods are hinged to a fixed block at the end away from the fixed seat. A connecting block is fixed on the top of the fixed block. A lead screw is threadedly connected inside the connecting block. The lead screw is rotatably connected inside the fixed frame. A groove is provided on the side of the fixed frame for the fixed block to move. The end of the lead screw away from the connecting block extends along the side of the fixed frame, and a pulley is fixed at the extending end of the lead screw.
[0010] As a preferred solution of the present invention, all the pulleys are connected with a transmission belt, and one of the pulleys is connected with a servo motor, and the servo motor is installed on the side of the fixed frame.
[0011] The present invention also provides a variable grid calibration algorithm for an automatic line drawing machine, which is based on the variable grid calibration structure of the automatic line drawing machine and includes the following content:
[0012] S1. Use a segmentation algorithm to extract the pixel-level coordinate values of the grid identification points;
[0013] S2. Refine the identification points at the sub-pixel level to obtain the coordinates of the accurate sub-pixel level identification points;
[0014] S3. Calculate the DPI of the camera using the camera's pose, perform planar correction on the image using triangulation technology, and then complete grid calibration.
[0015] As a preferred solution of the present invention, the specific steps of step S1 include:
[0016] S101. First, select the area where the pixels in the input image meet the threshold condition. Let GO be the input image, and G T be the threshold image. The gray value calculation uses the following calculation formula:
[0017]
[0018] where is the image gray offset value, which is applied to G T The threshold image is obtained by filtering the input image. After extracting the grid, the grid is divided into row-direction curves C R and column-direction curves C C ;
[0019] S102. Calculate the intersection points of C R and C C to obtain the pixel-level coordinate values of the identification points.
[0020] As a preferred solution of the present invention, the specific steps of step S2 include:
[0021] The pixel-level coordinate values of the identification points take the average of the pixel coordinates of the pixels they enclose. The average calculation method is as follows:
[0022]
[0023]
[0024] where P Xi and P Yi are the x and y coordinates of the i-th identification point, x j and y j are the x and y coordinates of the j-th pixel point of the pixels enclosed by the identification point, and n is the number of pixels enclosed by the identification point. In this way, the accurate coordinates of each identification point can be calculated.
[0025] As a preferred solution of the present invention, the specific steps of step S3 include:
[0026] S301. For the distorted grid image, form several squares with several grid points, and each square is divided into two triangles;
[0027] S302. Correct the two triangles to two isosceles triangles through affine transformation, generate two triangular screenshot images, and add the gray values of the corresponding coordinate points of the two images using the following calculation formula to obtain a complete square screenshot:
[0028]
[0029] where G(x, y) is the gray value of the (x, y) point after the operation, and G1(x, y) and G2(x, y) are the gray values of the (x, y) point before the operation;
[0030] S303. For the gray values of unknown pixel positions, in order to perform image transformation while maintaining the image quality, use the bilinear interpolation algorithm in the transformed image to perform interpolation calculation on the image, so as to obtain the gray values of the corrected pixel points, and then combine the two isosceles triangles into a corrected square image.
[0031] As a preferred solution of the present invention, the distance of the wire mesh is 10 mm to 50 mm.
[0032] The beneficial effects of the present invention are as follows: This structure is convenient to install, has a simple structure, can freely adjust the grid spacing, and at the same time realizes remote control, and can adjust the grid spacing in real time according to the actual required accuracy to improve the accuracy of image calibration. Moreover, the electrical components that control the change of the grid spacing can be directly connected to the control of the line drawing machine. Furthermore, based on the calibration method of this structure, it can quickly and accurately calibrate the camera under different accuracy requirements, and can more simply and conveniently complete the correspondence between the camera coordinate system and the real world coordinate system when calibrating the camera, saving time. Description of the Drawings
[0033] Figure 1 is a schematic structural diagram of a variable grid calibration structure of an automatic line drawing machine provided by the present invention;
[0034] Figure 2 is an enlarged schematic view of part A of a variable grid calibration structure of an automatic line drawing machine provided by the present invention Figure 1 ;
[0035] Figure 3 is a grid extraction schematic diagram of a variable grid calibration method of an automatic line drawing machine provided by the present invention;
[0036] Figure 4 is a grid distortion schematic diagram of a variable grid calibration method of an automatic line drawing machine provided by the present invention;
[0037] Figure 5 is a schematic diagram of the completion of grid correction of a variable grid calibration structure of an automatic line drawing machine provided by the present invention.
[0038] In the figure: 1, fixed frame; 2, fixed seat; 3, connecting head; 4, silk thread; 5, chute; 6, buckling groove; 7, adjusting rod; 8, fixed block; 9, connecting block; 10, lead screw; 11, shaped groove; 12, belt pulley; 13, transmission belt; 14, servo motor. Specific implementation manner
[0039] In order to further understand the content, features and effects of the present invention, the following embodiments are exemplified and described in detail with reference to the accompanying drawings as follows.
[0040] Please refer to Figures 1 to 5 simultaneously. The variable grid calibration structure and algorithm of the automatic line drawing machine according to the embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0041] As Figure 1 shown, it is assumed that the variable grid calibration structure of the automatic line drawing machine includes a fixed frame 1 placed inside the automatic line drawing machine. It is characterized in that a plurality of fixed seats 2 are slidably connected inside the fixed frame 1. A plurality of fixed seats 2 are provided along the four side edges of the fixed frame 1. A connecting head 3 is hung on each fixed seat 2. A silk thread 4 is fixedly penetrated between two relatively arranged connecting heads 3. All the silk threads 4 intersect to form a plurality of grids. A distance adjusting member is provided between a plurality of fixed seats 2 arranged on the same side for adjusting the distance between the fixed seats 2.
[0042] Among them, a chute 5 is provided on the inner wall of the fixed frame 1, and the fixed seat 2 is slidably connected inside the chute 5.
[0043] A buckling groove 6 is provided inside the fixed seat 2, and the buckling groove 6 is hung with the connecting head 3.
[0044] Furthermore, a connecting head 3 is fixed at both ends of the silk thread 4. The fixing heights of the silk thread 4 on the connecting head 3 are different. Specifically, interference does not occur when the silk thread 4 intersects to form a grid. At the same time, the connecting head 3 and the silk thread 4 are convenient for installation and disassembly inside the fixed seat 2.
[0045] Furthermore, the distance between the above grids is adjusted by the distance adjusting member. The distance adjusting member includes an adjusting rod 7 hinged to the side of the fixed seat 2. The ends of the two adjusting rods 7 away from the fixed seat 2 are hinged to a fixed block 8. A connecting block 9 is fixed on the top of the fixed block 8. A lead screw 10 is threadedly connected inside the connecting block 9. The lead screw 10 is rotatably connected inside the fixed frame 1. A shaped groove 11 for the movement of the fixed block 8 is provided on the side of the fixed frame 1. The end of the lead screw away from the connecting block 9 extends along the side of the fixed frame 1. A belt pulley 12 is fixed at the extending end of the lead screw 10.
[0046] All the belt pulleys 12 are connected with a transmission belt 13. One of the belt pulleys 12 is connected with a servo motor 14, and the servo motor 14 is installed on the side of the fixed frame 1.
[0047] After the servo motor 14 is turned on, the servo motor 14 can drive the pulley 12 connected thereto to rotate. Then, under the connection drive of the transmission belt 13, all the pulleys 12 start to rotate. With the rotation of the pulley 12, the lead screw 10 fixedly connected thereto starts to rotate. Further, the lead screw 10 and the connecting block 9 are in threaded connection. Therefore, the connecting block 9 can move horizontally along the groove 11. At this time, the connecting block 9 drives the fixed block 8 to move horizontally. When the fixed block 8 moves horizontally, in this embodiment, it is defined that when the servo motor 14 rotates forward, the moving direction of the fixed block 8 is towards the inside of the fixed frame 1. Then, when the fixed block 8 moves towards the fixed frame 1, the adjusting rod 7 can be pushed forward. The end of the adjusting rod 7 away from the fixed block 8 abuts against the fixed seat 2. The two fixed seats 2 connected to the fixed block 8 through the adjusting rod 7 move synchronously along the sliding groove 5. Further, the distance between the fixed seats 2 is increased, thereby increasing the distance between the meshes of the silk thread 4. When the servo motor 14 rotates in the reverse direction, the moving direction of the fixed block 8 is away from the inside of the fixed frame 1. Then, the adjusting rod 7 rotates, and the included angle between the two adjusting rods 7 starts to decrease. Further, the distance between the two fixed seats 2 starts to decrease.
[0048] In this embodiment, a guide rod is also inserted through the end of the fixed seat 2 close to the sliding groove 5. The fixed seat 2 is slidably connected to the guide rod. The guide rod is used to provide the stability of the movement of the fixed seat 2.
[0049] In this embodiment, based on the above variable grid calibration structure of the automatic drawing machine, the accuracy adjustment of image calibration is performed. The variable grid calibration algorithm of the automatic drawing machine is used, including the following contents: including the following contents:
[0050] S1. Use the segmentation algorithm to extract the pixel-level coordinate values of the grid identification points;
[0051] S2. Refine the identification points at the sub-pixel level to obtain the coordinates of the accurate sub-pixel level identification points;
[0052] S3. Use the pose of the camera to calculate the DPI of the camera, and use the triangulation technology to perform plane correction on the image, and then complete the grid calibration.
[0053] The specific steps of step S1 include:
[0054] S101. First, select the area where the pixels in the input image meet the threshold conditions. Let G O be the input image, G T be the threshold image. The gray value calculation adopts the following calculation formula:
[0055]
[0056] where is the image gray offset value, which is applied to G T In, the threshold image is obtained by filtering the input image. After extracting the grid, the grid is divided into curve C in the row directionR and the column direction curve C C ;
[0057] S102. Calculate the intersection points of C R and C C to obtain the pixel-level coordinate values of the identification points.
[0058] In this embodiment, the grid extraction algorithm is adopted in the above steps. The grid extraction algorithm is an image binarization algorithm using a dynamic threshold, which can adaptively set the threshold according to the information of the image gray histogram, thereby effectively binarizing the image.
[0059] The specific steps of step S2 include:
[0060] The pixel-level coordinate value of the identification point takes the average value of the pixel coordinates of the pixels it encloses. The average value calculation method is as follows:
[0061]
[0062]
[0063] where P Xi and P Yi are the x and y coordinates of the i-th identification point, x j and y j are the x and y coordinates of the j-th pixel point of the pixels enclosed by the identification point, and n is the number of pixels enclosed by the identification point, so that the accurate coordinates of each identification point can be calculated.
[0064] The specific steps of step S3 include:
[0065] S301. For the distorted grid image, form several squares with several grid points, and each square is divided into two triangles;
[0066] S302. Correct the two triangles to two isosceles triangles through affine transformation to generate two triangular screenshot images. Add the gray values of the corresponding coordinate points of the two images using the following calculation formula to obtain a complete square screenshot:
[0067]
[0068] where G(x, y) is the gray value of the point (x, y) after the operation, and G1(x, y) and G2(x, y) are the gray values of the point (x, y) before the operation;
[0069] S303. For the gray values of unknown pixel positions, in order to perform image transformation while maintaining image quality, use the bilinear interpolation algorithm in the transformed image to perform interpolation calculation on the image, so as to obtain the gray values of the corrected pixel points, and then combine two isosceles triangles into a corrected square image.
[0070] Among them, the specific matrix of the affine transformation is as follows:
[0071]
[0072] Among them, (x, y) are the coordinates of the points in the original image, and (x`, y`) are the coordinates of the points after affine transformation. The elements (a, b, c, d, e, f) in the matrix control the scaling, rotation and translation of the affine transformation. The last row (0, 0, 1) is used to keep the matrix in homogeneous coordinates to ensure that the affine transformation is invertible.
[0073] According to the matrix obtained by the affine transformation, starting from the coordinates (x', y') of each pixel in the corrected image, calculate the corresponding coordinates (x, y) on the known distorted image, so that the pixels correspond one by one, and assign the pixel values of the pixels of the corresponding distorted image to the corrected image to obtain the corrected image.
[0074] Among them, according to different precisions, the distance of the wire grid in this scheme is 10mm to 50mm.
[0075] Embodiment
[0076] Use the printer system to print a positive grid of 31 rows and 31 columns, with a grid length of 25mm×25mm, and the imaging is as Figure 4 shown. It can be seen that due to various factors, the image grid lines have different degrees of distortion. Now perform a correction experiment on it. A total of 900 distorted squares are triangulated with different numbers and different triangulation methods for the experiment. Taking the upper left corner of the image as the origin, with the width direction of the image from left to right as the X axis and the height direction from top to bottom as the Y axis, extract the set of central coordinate points P of the sub-pixel level identification points of the original distorted image O , after correcting the image by the above method, extract the set of central coordinate points P of the identification points of the corrected image C , P O and P C have the same number, that is, 31×31 = 961 points. Observe the correction accuracy of the control points through the root mean square error RMSE. The formula is:
[0077]
[0078] Among them, X Po and Y Po are the coordinates in the input reference coordinate system, XPc and Y Pc are the transformed coordinates.
[0079] According to the camera parameters, it can be calculated that the camera DPI is 95, that is, each inch occupies 95 pixels. If the side length of a printed grid GridL is 25mm×25mm, the number of pixels occupied by the side length of a grid can be calculated using the following conversion formula:
[0080]
[0081] where round means rounding down. According to the side length of the grid, it can be calculated that the side length of a 25mm grid is 93 pixels. To evaluate the influence of different meshing methods on the accuracy, 5 groups of experiments were designed with the side lengths of the triangles being GridLt = 25mm, 50mm, 75mm, 125mm, and 150mm respectively. The gray interpolation method for each experiment is bilinear interpolation, and the entire image is corrected. Figure 5 is the correction result when GridLt = 25mm.
[0082] Although the embodiments of the present invention have been shown and described, it will be understood by those of ordinary skill in the art that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A variable grid calibration structure for an automatic line drawing machine, comprising a fixed frame (1) placed inside the automatic line drawing machine, characterized in that, A plurality of fixing seats (2) are slidably connected inside the fixing frame (1), and a plurality of fixing seats (2) are arranged along the four sides of the fixing frame (1). A connecting head (3) is hung on each fixing seat (2), and a silk thread (4) is fixedly passed through two connecting heads (3) arranged opposite to each other. All the silk threads (4) cross to form a plurality of grids. A spacing adjustment member is arranged between the plurality of fixing seats (2) arranged on the same side, and is used to adjust the spacing of the fixing seats (2). The spacing adjustment member comprises a hinged connection to the fixing seat ( 2) side adjustment rods (7), the ends of the two adjustment rods (7) away from the fixed seat (2) are hingedly connected to a fixed block (8), a connecting block (9) is fixed on the top of the fixed block (8), a screw rod (10) is internally threadedly connected to the connecting block (9), the screw rod (10) is rotatably connected to the inside of the fixed frame (1), a groove (11) for the fixed block (8) to move is provided on the side of the fixed frame (1), the end of the screw rod away from the connecting block (9) extends along the side of the fixed frame (1), and a pulley (12) is fixed to the extended end of the screw rod (10).
2. The variable grid calibration structure of an automatic line drawing machine according to claim 1, characterized in that, A sliding groove (5) is provided on the inner wall of the fixing frame (1), and the interior of the sliding groove (5) is slidably connected to the fixing seat (2).
3. The variable grid calibration structure of an automatic line drawing machine according to claim 1, characterized in that, A buckle groove (6) is provided inside the fixing seat (2), and the buckle groove (6) is hooked with the connecting head (3).
4. The variable grid calibration structure of an automatic line drawing machine according to claim 1, characterized in that, All the pulleys (12) are connected to a transmission belt (13), one of the pulleys (12) is connected to a servo motor (14), and the servo motor (14) is installed on the side of the fixed frame (1).
5. An automatic line drawing machine variable grid calibration algorithm, based on the automatic line drawing machine variable grid calibration structure described in claim 1, characterized in that, Includes the following: S1, using segmentation algorithm to extract pixel-level coordinate values of grid identification points; S2, performing sub-pixel refinement on the marker points to obtain accurate sub-pixel coordinates of the marker points; S3. Use the camera's position to calculate the camera's DPI, use triangulation technology to perform plane correction on the image, and then complete the grid calibration.
6. An automatic line drawing machine variable grid calibration algorithm according to claim 5, characterized in that, The specific steps of step S1 include: S101. First, select the region in the input image where the pixels meet the threshold condition, and let G O be the input image, and G T be the threshold image. The gray value is calculated using the following calculation formula: G O ≤G T -Offset where is the image gray-scale offset value, which is applied to G T In T , the threshold image is obtained by filtering the input image. After extracting the grid, the grid is divided into row-direction curves C R and column-direction curves C C ; S102. Calculate C R and C C The intersection point can obtain the pixel-level coordinate value of the identification point.
7. An automatic line drawing machine variable grid calibration algorithm according to claim 5, characterized in that, The specific steps of step S2 include: The pixel coordinate value of the identified point is the average of the pixel coordinate values of the pixels it surrounds. The average is calculated as follows: where P Xi and P Yi are the x and y coordinates of the i-th identification point, x j and y j are the x and y coordinates of the j-th pixel of the pixels enclosed by the identification point, and n is the number of pixels enclosed by the identification point, so that the accurate coordinates of each identification point can be calculated.
8. An automatic line drawing machine variable grid calibration algorithm according to claim 5, characterized in that, The specific steps of step S3 include: S301, using a plurality of grid points to form a plurality of squares on the distorted grid image, and each square is divided into two triangles; S302, correcting the two triangles to two isosceles triangles through affine transformation, generating two triangular screenshot images, and adding the grayscale values of the corresponding coordinate points of the two images using the following calculation formula to obtain a complete square screenshot: G(x,y)=G1(x,y)+G2(x,y) Where G(x,y) is the grayscale value of point (x,y) after operation, G1(x,y) and G2(x,y) are the grayscale values of point (x,y) before operation; S303. For the grayscale values of the unknown pixel positions, in order to transform the image while maintaining the image quality, a bilinear interpolation algorithm is used in the transformed image, and the image is interpolated using the algorithm to obtain the grayscale values of the corrected pixel points, and then the two isosceles triangles are combined into a corrected square image.
9. An automatic line drawing machine variable grid calibration algorithm according to claim 5, characterized in that The distance between the grids is 10 mm to 50 mm.
Citation Information
Patent Citations
Large-format image correction system based on plane grid method
CN117952871A
Foot type calibration template
CN201668042U
Paper core reel manipulator
CN213894302U