Variable grid calibration structure and algorithm for automatic line drawing machine
By introducing variable grid calibration structure and corresponding algorithms into the line drawing machine, the problem of fixed grid calibration cannot be adjusted is solved, dynamic adjustment of grid spacing and fast and accurate camera calibration is realized, and the calibration accuracy of the line drawing machine is improved and efficiency.
Patent Information
- Application Number
- CN202411301774.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-09-18
AI Technical Summary
In existing line drawing machines, the fixed grid calibration structure cannot be adjusted, resulting in the accuracy of image calibration that cannot be adjusted according to specific needs, which limits the improvement of line drawing accuracy.
A variable grid calibration structure of an automatic liner is designed to adjust the grid spacing through sliding connections and spacing adjustment parts, and combine segmentation algorithms and triangulation technology to achieve fast and accurate calibration of the camera.
This structure and algorithm allow real-time adjustment of grid spacing according to actual needs, improve the accuracy of image calibration, simplify and accelerate the establishment of the corresponding relationship between the camera coordinate system and the real-world coordinate system, and improve the calibration accuracy and efficiency of the line drawing machine.
Smart Images

Figure CN119235089A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of line drawing machines, and in particular 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 can accurately draw various patterns, texts, logos, etc. on materials such as leather, textiles, rubber, plastic, and hard foam. Shoe manufacturers use this machine in shoe production lines to achieve process requirements such as line drawing, marking, and punching on soles, uppers, and other locations. The operation process of a line drawing machine is divided into two main parts: one is the control system, including computers, programs, software, etc.; the other is the mechanical part, including the body, workbench, motor, etc. Under the command of the control system, the mechanical part starts to operate, using tools such as steel knives, steel needles, and nozzles to complete actions such as line drawing or marking. The footwear manufacturing industry is an important application scenario for line drawing machines.
[0003] In the line drawing machine, the application is usually based on machine vision, which is used to shoot the actual leather shape, then identify the image and process it to draw the line automatically. Machine vision is a process that uses computers to simulate human vision and uses software algorithms to analyze and understand the images collected by the 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, there are two issues to consider. One is how to correspond objects in the camera coordinate system with objects in the real world coordinate system, and the other is how to correct various lens distortions. Therefore, calibration is mentioned. Through calibration, the connection between the image and the world is established and various image distortions are corrected. Camera calibration can establish the correspondence between points in a two-dimensional image and points in three-dimensional space. In actual shooting, camera distortion is the most common problem, such as radial distortion, tangential distortion, etc. Radial distortion includes pincushion distortion and barrel distortion, while 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 the image needs to be calibrated for distortion correction.
[0004] For the distortion problem mentioned above, in conventional technology, a grid plate is placed inside the line drawing machine. After shooting, image calibration is performed based on the background of the grid plate and using its grid nodes. Therefore, correction can be provided for the distortion problem mentioned above, and the distance of the grid becomes the key to precision adjustment. However, for the prior art, the plate used therein is fixedly set, and the spacing of the grid cannot be adjusted. Therefore, in subsequent use, the accuracy of its image calibration cannot be adjusted. Therefore, when improving the accuracy of line drawing, it is necessary to first deal with the accuracy problem of the captured image calibration. Summary of the invention
[0005] The purpose of the present invention is to provide a variable grid calibration structure and algorithm for an automatic line drawing machine. The structure is easy to install and has a simple structure. The grid spacing can be freely adjusted and remote control can be realized at the same time. The grid spacing can be adjusted in real time according to the actual required accuracy to improve the accuracy of image calibration. The calibration method based on this structure can quickly and accurately calibrate the camera under different accuracy requirements, and the correspondence between the camera coordinate system and the real-world coordinate system during camera calibration can be completed more simply, conveniently and time-savingly.
[0006] To achieve the above-mentioned purpose, the present invention provides the following technical solutions: a variable grid calibration structure for an automatic line marking machine, which comprises a fixed frame placed inside the automatic line marking machine, a plurality of fixed seats being slidably connected inside the fixed frame, a plurality of fixed seats being arranged along the four sides of the fixed frame, a connecting head being hung on each fixed seat, a silk thread being fixedly passed through two relatively arranged connecting heads, all the silk threads being crossed to form a plurality of grids, and a spacing adjustment member being arranged between the plurality 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 sliding groove is provided on the inner wall of the fixing frame, and the interior of the sliding groove is slidably connected to the fixing seat.
[0008] As a preferred solution of the present invention, a buckle groove is provided inside the fixing seat, and the buckle groove is hooked with the connecting head.
[0009] As a preferred solution of the present invention, the spacing adjustment member includes an adjustment rod hingedly connected to the side of the fixed seat, two adjustment rods are hingedly connected to a fixed block at the end away from the fixed seat, a connecting block is fixed to the top of the fixed block, a screw rod is threadedly connected to the inside of the connecting block, the screw rod is rotatably connected to the inside of the fixed frame, a groove is provided on the side of the fixed frame for the fixed block to move, the screw rod extends away from the connecting block end along the side of the fixed frame, and a pulley is fixed to the protruding end of the screw rod.
[0010] As a preferred solution of the present invention, all of the pulleys are connected to transmission belts, one of the pulleys is connected to 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, based on a variable grid calibration structure for the automatic line drawing machine, including the following contents: 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.
[0012] As a preferred solution of the present invention, the specific steps of step S1 include: S101, first select the area where the pixels meet the threshold condition from the input image, let GO be the input image, G T is a threshold image, and the gray value is calculated using the following formula: Where is the image grayscale offset value, which is applied to G T In the example, the threshold image is obtained by filtering the input image, and the grid is extracted and divided into row-wise curves C. R And the column direction curve C C ; S102, calculate C R and C C The pixel-level coordinate value of the identification point can be obtained by the intersection of .
[0013] As a preferred solution of the present invention, 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 is the x and y coordinates of the ith identification point, x j and j are the x and y coordinates of the jth pixel point surrounded by the identification point, and n is the number of pixels surrounded by the identification point. In this way, the accurate coordinates of each identification point can be calculated.
[0014] As a preferred solution of the present invention, 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: 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.
[0015] As a preferred solution of the present invention, the distance between the wire meshes is 10 mm to 50 mm.
[0016] The beneficial effects of the present invention are as follows: the structure is easy to install, has a simple structure, can freely adjust the grid spacing, and can realize remote control at the same time. The grid spacing can be adjusted in real time according to the actual required accuracy to improve the accuracy of image calibration, and the electrical device that controls the change of the grid spacing can be directly controlled and connected with the line drawing machine. Therefore, the calibration method based on the structure can achieve fast and accurate camera calibration under different accuracy requirements, and can complete the correspondence between the camera coordinate system and the real-world coordinate system during camera calibration in a simpler, more convenient and time-saving manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a structural schematic diagram of a variable grid calibration structure of an automatic line drawing machine provided by the present invention; Figure 2 The invention provides a variable grid calibration structure for an automatic line drawing machine. Figure 1 A magnified schematic diagram of point A; Figure 3 It is a schematic diagram of grid extraction of a variable grid calibration method for an automatic line drawing machine provided by the present invention; Figure 4 It is a schematic diagram of grid distortion of a variable grid calibration method for an automatic line drawing machine provided by the present invention; Figure 5 It is a schematic diagram of grid correction completion of a variable grid calibration structure of an automatic line drawing machine provided by the present invention.
[0018] In the figure: 1. fixed frame; 2. fixed seat; 3. connecting head; 4. wire; 5. slide groove; 6. buckle groove; 7. adjusting rod; 8. fixed block; 9. connecting block; 10. screw rod; 11. groove; 12. pulley; 13. transmission belt; 14. servo motor. DETAILED DESCRIPTION
[0019] In order to further understand the content, features and effects of the present invention, the following embodiments are given as examples and described in detail with reference to the accompanying drawings.
[0020] Please also refer to Figures 1 to 5 , the variable grid calibration structure and algorithm of the automatic line drawing machine according to the embodiment of the present invention will be described in detail below with reference to the accompanying drawings.
[0021] like Figure 1 As shown, the variable grid calibration structure of the automatic line marking machine includes a fixed frame 1 placed inside the automatic line marking machine, and is characterized in that a plurality of fixed seats 2 are slidably connected inside the fixed frame 1, and a plurality of fixed seats 2 are provided along the four sides of the fixed frame 1, and a connecting head 3 is hung on each fixed seat 2, and a silk thread 4 is fixedly passed through two relatively arranged connecting heads 3, and all the silk threads 4 are crossed to form a plurality of grids, and a spacing adjustment member is provided between the plurality of fixed seats 2 arranged on the same side for adjusting the spacing of the fixed seats 2.
[0022] A slide groove 5 is provided on the inner wall of the fixing frame 1 , and the fixing seat 2 is slidably connected inside the slide groove 5 .
[0023] A buckle groove 6 is provided inside the fixing seat 2 , and the buckle groove 6 is hooked with the connecting head 3 .
[0024] Furthermore, a connector 3 is fixed at both ends of the wire 4. The wire 4 is fixed at different heights on the connector 3. Specifically, no interference occurs when the wires 4 cross to form a grid. At the same time, the connector 3 and the wire 4 can be easily installed and disassembled inside the fixing seat 2.
[0025] The distance of the above-mentioned grid is further adjusted by a spacing adjustment piece, and the spacing adjustment piece includes an adjustment rod 7 hingedly connected to the side of the fixed seat 2, and the two adjustment rods 7 are hingedly connected to a fixed block 8 at the end away from the fixed seat 2, and a connecting block 9 is fixed on the top of the fixed block 8. The connecting block 9 is internally threaded with a screw rod 10, and 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, and 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.
[0026] 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 .
[0027] After the servo motor 14 is turned on, the servo motor 14 can drive the pulley 12 connected thereto to rotate, and then under the connection drive of the transmission belt 13, all the pulleys 12 start to rotate. As the pulley 12 rotates, the screw rod 10 fixedly connected thereto starts to rotate, and then the screw rod 10 is threadedly connected to the connecting block 9, so the connecting block 9 can move laterally along the groove 11. At this time, the connecting block 9 drives the fixed block 8 to move laterally. When the fixed block 8 moves laterally, in this embodiment, it is defined that when the servo motor 14 rotates forward, the moving direction of the fixed block 8 is In order to move toward the inside of the fixed frame 1, and then when the fixed block 8 moves toward the fixed frame 1, the adjusting rod 7 can be pushed forward, and the adjusting rod 7 away from the fixed block 8 end contacts the fixed seat 2, and the two fixed seats 2 connected to the fixed block 8 through the adjusting rod 7 move synchronously along the slide groove 5, thereby increasing the spacing of the fixed seats 2, thereby increasing the spacing of the wire 4 grid. When the servo motor 14 is reversed, the moving direction of the fixed block 8 is to move away from the inside of the fixed frame 1, and then the adjusting rod 7 rotates, the angle between the two adjusting rods 7 begins to decrease, and then the spacing between the two fixed seats 2 begins to decrease.
[0028] In this embodiment, a guide rod is further provided at the end of the fixing seat 2 close to the slide groove 5 , and the fixing seat 2 is slidably connected to the guide rod, and the guide rod is used to provide stability for the movement of the fixing seat 2 .
[0029] In this embodiment, based on the above-mentioned variable grid calibration structure of the automatic line drawing machine, the accuracy adjustment of the image calibration is performed, and the variable grid calibration algorithm of the automatic line drawing machine is used, including the following contents: including the following contents: 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.
[0030] The specific steps of step S1 include: S101, first select the area where the pixels meet the threshold condition from the input image, let G O is the input image, G T is a threshold image, and the gray value is calculated using the following formula: Where is the image grayscale offset value, which is applied to G T In the example, the threshold image is obtained by filtering the input image, and the grid is extracted and divided into row-wise curves C. R And the column direction curve C C ; S102, calculate C R and CC The pixel-level coordinate value of the identification point can be obtained by the intersection of .
[0031] In this embodiment, the above steps use a grid extraction algorithm, which is an image binarization algorithm using a dynamic threshold. It can adaptively set the threshold according to the information of the image grayscale histogram, thereby effectively binarizing the image.
[0032] 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 is the x and y coordinates of the ith identification point, x j and j are the x and y coordinates of the jth pixel point surrounded by the identification point, and n is the number of pixels surrounded by the identification point. In this way, the accurate coordinates of each identification point can be calculated.
[0033] 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: 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.
[0034] Among them, the specific matrix of affine transformation is as follows: Where (x, y) is the coordinate of the point in the original image, and (x`, y`) is the coordinate of the point after the 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 homogeneous coordinates to ensure that the affine transformation is reversible.
[0035] According to the matrix obtained by affine transformation, starting from the coordinates (x', y') of each pixel in the corrected image, the corresponding coordinates (x, y) on the known distorted image are calculated, so that the pixels correspond one to one, and the pixel values of the corrected image corresponding to the pixels of the distorted image are assigned to obtain the corrected image.
[0036] Among them, according to different precisions, the distance between the wire meshes in this solution is 10 mm to 50 mm.
[0037] Example Use the printer system to print a positive grid with 31 rows and 31 columns. The grid length is 25mm×25mm. The image is as follows: Figure 4 As shown in the figure, it can be seen that the image grid lines have different degrees of distortion due to various factors. Now, a correction experiment is carried out. A total of 900 distorted squares are triangulated with different numbers and different triangulation methods. The upper left corner of the image is taken as the origin, the width direction of the image from left to right is the X-axis, and the height direction from top to bottom is the Y-axis. The central coordinate point set P of the sub-pixel level identification point of the original distortion image is extracted. O After the image is corrected by the above method, the central coordinate point set P of the identification points of the correction image is extracted C , P O With P C The number of points is equal, that is, 31×31=961 points. The root mean square error RMSE is used to observe the correction accuracy of the control points. The formula is: Where X Po and Y Po is the coordinate in the input reference coordinate system, X Pc and Y Pc are the transformed coordinates.
[0038] According to the camera parameters, we can calculate 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 following conversion formula can be used to calculate the pixels occupied by the side length of a grid: Among them, round means rounding down. According to the grid side length, it can be calculated that the grid side length of 25mm is 93 pixels. In order to evaluate the impact of different partitioning methods on accuracy, five groups of experiments were designed with triangle side lengths of GridLt=25mm, 50mm, 75mm, 125mm, and 150mm. The grayscale interpolation method of each experiment was bilinear interpolation, and the entire image was corrected. Figure 5 This is the correction result when GridLt=25mm.
[0039] 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 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: The fixing frame (1) is internally slidably connected to a plurality of fixing seats (2), 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, and all the silk threads (4) are crossed 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 between the fixing seats (2).
2. The variable grid calibration structure and algorithm 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 and algorithm 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 and algorithm of an automatic line drawing machine according to claim 1, characterized in that: The spacing adjustment member comprises an adjustment rod (7) hingedly connected to the side of the fixing seat (2); the ends of the two adjustment rods (7) away from the fixing seat (2) are hingedly connected to a fixing block (8); a connecting block (9) is fixed to the top of the fixing 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 fixing frame (1); a groove (11) for the fixing block (8) to move is provided on the side of the fixing frame (1); the end of the screw rod away from the connecting block (9) extends along the side of the fixing frame (1); and a pulley (12) is fixed to the extended end of the screw rod (10).
5. The variable grid calibration structure and algorithm of an automatic line drawing machine according to claim 4, 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).
6. An automatic line drawing machine variable grid calibration algorithm, based on the automatic line drawing machine variable grid calibration structure according to 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.
7. The variable grid calibration algorithm for an automatic line drawing machine according to claim 6, characterized in that: The specific steps of step S1 include: S101, first select the area where the pixels meet the threshold condition from the input image, let G O is the input image, G T is a threshold image, and the gray value is calculated using the following formula: Where is the image grayscale offset value, which is applied to G T In the example, the threshold image is obtained by filtering the input image, and the grid is extracted and divided into row-wise curves C. R And the column direction curve C C ; S102, calculate C R and C C The pixel-level coordinate value of the identification point can be obtained by the intersection of .
8. The variable grid calibration algorithm for an automatic line drawing machine according to claim 7, 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 is the x and y coordinates of the ith identification point, x j and j are the x and y coordinates of the jth pixel point surrounded by the identification point, and n is the number of pixels surrounded by the identification point. In this way, the accurate coordinates of each identification point can be calculated.
9. The variable grid calibration algorithm for an automatic line drawing machine according to claim 6, 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: 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.
10. The variable grid calibration algorithm for an automatic line drawing machine according to claim 6, characterized in that: The distance between the wire meshes is 10 mm to 50 mm.
Citation Information
Patent Citations
System for fully automatically reconstructing foot-type three-dimensional surface from a plurality of images captured by a plurality of cameras simultaneously
CN102157013A
Near-infrared laser spot field-of-view parameter measurement device and method
CN103759634A
Correction method for fisheye image distortion
CN104537616A
Automatic line-drawing marking device based on visual identity and line-drawing marking method thereof
CN109998228A
Marking device for shoe production and using method thereof
CN113303562A
