A method for displaying image outer contour suitable for laser processing
By using oblique projection technology to display the outer contour of the marking part in a laser marking machine, the problem of inconsistency between the actual marking bitmap and the projected display bitmap is solved, the positioning accuracy and work efficiency are improved, and a clearer and more stable visual effect is provided.
Patent Information
- Application Number
- CN202410760994.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-13
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2044-06-13
AI Technical Summary
In the prior art, the actual marking bitmap of the laser marking machine is inconsistent with the bitmap displayed on the projection, resulting in low positioning accuracy and inconvenient operation.
Using an image outer contour display method suitable for laser processing, the marking parts are projected obliquely by a projector in the laser marking device, and the outer contour of the marking parts is extracted and displayed, simplifying the positioning work of the operator.
It improves the display accuracy of marking bitmaps, simplifies the positioning of operators, avoids the problems of high-frequency flickering and discontinuity, provides a clearer and stable visual effect, and reduces the risk of eye fatigue.
Smart Images

Figure CN118710561B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of laser processing, and in particular to an image outer contour display method suitable for laser processing. Background Art
[0002] In the field of clothing, laser marking machines are widely used due to their high precision and high efficiency. In order to ensure the quality of marking, graphic alignment technology is essential. In the existing technology, there are several positioning solutions:
[0003] (1) Using red light preview positioning, that is, using the galvanometer of the laser marking machine itself for preview positioning, such as the multi-angle visual positioning laser marking machine and laser marking method provided in the patent document with announcement number CN106964904B, which adopts this type of solution; however, in this solution, when the galvanometer lens increases, the swing speed of the galvanometer will slow down, and it will not be possible to display a coherent pattern, and marking and positioning cannot be performed at the same time, and the red light preview will stop during the marking process;
[0004] (2) An external red light emitter is used for specific location positioning, that is, the rays emitted by low-power visible laser are used for positioning; however, in actual production, this type of visible laser is harmful to human eyes, and long-term exposure to this type of laser will cause certain damage; and this positioning method can only use the straight line intersection method to locate a specific position, and its positioning accuracy is relatively poor. In addition, each time the pattern is changed, the light source needs to be manually moved to achieve positioning, and the stability and ease of use are not good enough;
[0005] (3) Use an external galvanometer lens for external scanning preview positioning, that is, use a small galvanometer lens to position the actual marking pattern; in this solution, on the one hand, the galvanometer lens has an upper limit on its swing speed, and it cannot realize the red light preview of complex patterns; on the other hand, it is troublesome to adjust the position. The small galvanometer lens only has a red light emitter, which cannot leave marks on the material, so the actual measurement is more troublesome; in addition, there is also the problem of swing frequency, the contour display will flicker, and the operator will easily get tired of the eyes when seeing the red light for a long time;
[0006] (4) Positioning by external projection, that is, positioning the marking pattern by connecting an external projector. The problem with this solution is that, due to the problem of the projection installation position, even with the distortion correction of the projector itself, it is impossible to display the projected pattern at the center of the marking area, which ultimately leads to inconsistency between the projected pattern and the actual pattern, and it is impossible to achieve accurate positioning; and because the actual pattern has a gradient color, the edge may be fuzzy and may not be clearly seen in actual use, making it difficult for operators to operate and align the marking object when placing it.
[0007] Therefore, there is an urgent need to provide an image contour display method suitable for laser processing to solve the problem of inconsistency between the bitmap actually marked by the ultra-large format marking machine and the bitmap displayed by projection. Summary of the invention
[0008] In view of the problems existing in the prior art, the present invention provides an image outline display method suitable for laser processing, which solves the inconsistency problem between the bitmap actually marked by an ultra-large-format marking machine and the bitmap displayed by projection, and improves the display accuracy of the marking bitmap.
[0009] The technical solution of the present invention is achieved in this way:
[0010] A method for displaying the outer contour of an image suitable for laser processing is applied to a laser marking device, wherein the laser marking device comprises a horizontally arranged operating table, a laser generating device, and a projector; the laser generating device is located directly above the operating table and is used to perform laser marking on a marking object placed on the operating table; the projector is arranged at the side of the laser generating device and performs oblique projection on the operating table; since the output end of the laser generating device is located directly above the operating table, in order to avoid interference, the projector is arranged at the side for oblique projection;
[0011] The method comprises photographing the marking part to obtain a marking image, and projecting the marking image through the projector to obtain a projection image;
[0012] The steps include:
[0013] S1, image preprocessing: grayscale processing is performed on the marking image to obtain a marking bitmap;
[0014] S2, binarization processing: setting a binarization threshold, reading the position grayscale of the marking bitmap, and binarizing the marking bitmap to obtain a binary image; that is, the value of each numerical bit of the binary image is 0 or 1;
[0015] S3, image smoothing: performing Gaussian optimization on the binary image to remove jagged edges;
[0016] S4, contour extraction: extracting the contour of the marked part from the binary image;
[0017] S5, vectorization processing: vectorization processing is performed on the outline; vectorization processing is a process of converting a bitmap (dot matrix image) into a vector image (vector image), which can improve the quality and operability of the image;
[0018] S6. Contour simplification: The contour includes an inner contour and an outer contour. The inner contour is removed and the outer contour is retained. Since the extracted target has various types of shape and color features, the contour extraction process may produce a multiple line structure composed of inner contours and outer contours. In the laser marking operation, in order to simplify the positioning process and ensure that the operator can easily determine the correct placement of the marked object, only the outermost contour needs to be retained for marking;
[0019] S7, contour cleaning: removing impurity points on the contour;
[0020] S8, contour drawing: drawing the contour on the marking bitmap; that is, drawing the contour of the marking part in the marking bitmap;
[0021] S9, projection correction: performing projection correction on the projection image;
[0022] S10, projection execution: projecting the marking bitmap onto the surface of the marking part and displaying the projection image.
[0023] By extracting the outline of the marked part and displaying it by projection, the operator's positioning work is greatly simplified and the overall work efficiency is improved. Compared with the traditional laser or red light marking method, the outline displayed by projection avoids the problems of high-frequency flickering and discontinuous outline, providing a clearer and more stable visual effect. In addition, the outline displayed by projection is gentler on the operator's eyes, reducing the potential risk of injury and effectively reducing eye fatigue during long-term work.
[0024] The oblique projection can not only provide the same clear outline display as the traditional orthographic projection, but also flexibly adjust the projection angle according to the operator's perspective and the specific location of the marking object, thereby optimizing the visual effect and reducing the impact of shadows or occlusions. On this basis, adding contour projection is conducive to increasing the operator's depth perception of the marking position and solving the technical problem of blurred edges of the projection image in the existing technology.
[0025] As a further optimization of the above solution, in step S8, the outline is highlighted.
[0026] There are many specific operation types, such as brightness adjustment, contrast adjustment, color saturation adjustment, etc., to highlight the display effect of the outline part.
[0027] As a further optimization of the above solution, step S9 includes the following specific steps:
[0028] S9-1, using the distortion correction function of the projector itself to make preliminary adjustments to the projected image, including adjusting the canvas display and distortion parameters of the projector itself, so that the projected image is as close to normal as possible;
[0029] S9-2, adjusting the scaling ratio of the projection image so that the size of the marking part and the projection image are consistent;
[0030] S9-3, performing correction processing on the projected image, including offset correction and geometric correction.
[0031] Geometric correction includes trapezoidal correction, barrel correction, parallelogram correction, etc. For example, the original image shape of a square or circle is likely to become a trapezoid, parallelogram, or ellipse after oblique projection. Geometric correction is used to optimize the display of the corner areas of the image.
[0032] As a further optimization of the above scheme, the correction process is a linearization correction, comprising the following steps:
[0033] A1. Generate a rectangular coordinate system including an x-axis and a y-axis, wherein a plurality of line segments with equal spacing and perpendicular to the x-axis are arranged along the x-axis, and a plurality of line segments with equal spacing and perpendicular to the y-axis are arranged along the y-axis;
[0034] A2. Placing a test piece on the operating table, and the laser generating device marks the rectangular coordinate system on the test piece to obtain a first coordinate system; and the projector projects the rectangular coordinate system on the test piece to obtain a second coordinate system;
[0035] A3. Measure and adjust the coordinate offset of the origin of the second coordinate system relative to the origin of the first coordinate system so that the origins of the second coordinate system and the first coordinate system coincide with each other;
[0036] A4. Measure and adjust the distance offset and angle offset of the line segment of the second coordinate system compared with the line segment of the first coordinate system, so that the second coordinate system coincides with the first coordinate system.
[0037] The first coordinate system is used as a reference, and the offset of the projected image is measured by the second coordinate system, and finally the projection image is calibrated according to the offset.
[0038] As a further optimization of the above solution, the correction process is grid correction, including the following steps:
[0039] B1. Generate a rectangular coordinate system including an x-axis and a y-axis, wherein a plurality of line segments with equal spacing and perpendicular to the x-axis are arranged along the x-axis, and a plurality of line segments with equal spacing and perpendicular to the y-axis are arranged along the y-axis; the x-axis, the y-axis and the line segments intersect with each other to form a grid diagram with an odd number of rows and columns, and the intersection positions are nodes of the grid diagram;
[0040] B2. placing a test piece on the operating table, and marking the grid pattern on the test piece with the laser generating device to obtain a first grid pattern; and projecting the grid pattern on the test piece with the projector to obtain a second grid pattern;
[0041] B3, measuring and adjusting the coordinate offset of the central node of the second grid map relative to the central node of the first grid map, so that the central nodes of the second grid map and the first grid map overlap;
[0042] B4. For nodes other than the central node, measure and adjust the coordinate offsets of the nodes of the second grid map compared to the nodes of the first grid map, so that the second grid map overlaps with the first grid map.
[0043] Compared with linear correction, grid correction can realize the offset correction of each node of the projected image in the area covered by the grid map, with higher accuracy and better correction effect.
[0044] As a further optimization of the above solution, in step S10, the marking bitmap is converted into a vector point set, and then projected onto the surface of the marking part according to the vector point set to display the projection image.
[0045] As a further optimization of the above solution, the average of the grayscale values of all pixels in the marking bitmap is the binarization threshold.
[0046] According to the binarization threshold, the grayscale value of the pixel bit can be converted to 0 or 1; if the grayscale value is greater than / equal to the binarization threshold, it is converted to 1, otherwise, it is converted to 0.
[0047] Compared with the prior art, the present invention achieves the following beneficial effects:
[0048] The present invention provides an image outer contour display method suitable for laser processing. By extracting the contour of the marked part and projecting the marked part and the contour using a projector located obliquely above the operating table, the positioning work of the operator is greatly simplified, and the positioning accuracy and overall work efficiency are improved. Compared with the traditional laser or red light marking method, the contour displayed by projection avoids the problems of high-frequency flickering and contour discontinuity, providing a clearer and more stable visual effect. At the same time, the contour displayed by projection is gentler on the operator's eyes, reducing the potential risk of injury and effectively reducing eye fatigue during long-term work. The correction process effectively solves the technical problems of deformation and offset of the projected image during oblique projection. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 is a schematic flow chart of a method for displaying an image outline provided by an embodiment of the present invention;
[0050] Figure 2 is a schematic structural diagram of a laser marking device provided in an embodiment of the present invention;
[0051] Figure 3 is a schematic diagram of a coordinate system provided by an embodiment of the present invention;
[0052] Figure 4 is a schematic diagram of a grid map provided by an embodiment of the present invention;
[0053] Figure 5 A marking image provided by an embodiment of the present invention;
[0054] Figure 6 for Figure 5 Marking bitmap after grayscale processing;
[0055] Figure 7 for Figure 6 Binary image of ;
[0056] Figure 8 for Figure 7 's outline map;
[0057] Fig. 9 for Figure 8 Optimized contour map;
[0058] Fig.10 A marking bitmap after drawing the outline provided by an embodiment of the present invention;
[0059] Reference numerals:
[0060] 1. Operation table; 2. Laser generating device; 3. Projector;
[0061] 4. Marking parts; 5. x-axis; 6. y-axis;
[0062] 7. Line segment; 8. Origin; 9. Central node. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical solution and advantages of the present invention more clear, the technical solution in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present invention, not all 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.
[0064] Example 1
[0065] like Figures 1 to 3As shown, this embodiment provides an image outer contour display method suitable for laser processing, which is applied to a laser marking device, wherein the laser marking device comprises a horizontally arranged operating table 1, a laser generating device 2, and a projector 3; the laser generating device 2 is located directly above the operating table 1, and is used to perform laser marking on a marking piece 4 placed on the operating table 1; the projector 3 is arranged at the side of the laser generating device 2, and performs oblique projection on the operating table 1; since the output end of the laser generating device 2 is located directly above the operating table 1, in order to avoid interference, the projector 3 is arranged at the side for oblique projection;
[0066] The method includes photographing the marking part 4 to obtain a marking image, and projecting the marking image through the projector 3 to obtain a projection image; in this embodiment, the marking image is as follows Figure 5 shown.
[0067] The steps include:
[0068] S1. Image preprocessing: grayscale the marking image to obtain a marking bitmap, such as Figure 6 As shown;
[0069] S2, Binarization: Set the binarization threshold, read the position grayscale of the marking bitmap, and perform binarization on the marking bitmap to obtain a binary image, such as Figure 7 As shown; that is, the value of each numerical bit of the binary image is 0 or 1; in this embodiment, the average value of the grayscale values of all pixel bits in the marking bitmap is the binarization threshold.
[0070] According to the binarization threshold, the grayscale value of the pixel bit can be converted to 0 or 1; if the grayscale value is greater than / equal to the binarization threshold, it is converted to 1, otherwise, it is converted to 0.
[0071] S3, image smoothing: Gaussian optimization is performed on the binary image to remove jagged edges;
[0072] S4, contour extraction: In the binary image, extract the contour of the marked part 4, such as Figure 8 As shown;
[0073] S5. Vectorization: vectorize the outline; vectorization is the process of converting a bitmap (dot matrix image) into a vector image (vector image), which can improve the quality and operability of the image;
[0074] S6, contour simplification: The contour includes inner contour and outer contour. The inner contour is removed and the outermost outer contour is retained, such as Fig. 9As shown in the figure, due to the various types of shape and color features of the extracted target, the process of extracting the contour may produce a multiple line structure composed of inner and outer contours. In the laser marking operation, in order to simplify the positioning process and ensure that the operator can easily determine the correct placement of the marking object, only the outermost contour needs to be retained for marking;
[0075] S7, contour purification: remove impurity points on the contour;
[0076] S8, Contour drawing: Draw the contour on the marking bitmap, such as Fig.10 As shown; that is, the outline of the marking part 4 in the marking bitmap is drawn; at the same time, the outline is highlighted. In this embodiment, the color of the outline is set to a highly saturated red and then projected.
[0077] S9, projection correction: projection correction is performed on the projected image, including the following specific steps:
[0078] S9-1, using the distortion correction function of the projector 3 to make preliminary adjustments to the projected image, including adjusting the canvas display and distortion parameters of the projector 3, so that the projected image is as close to normal as possible;
[0079] S9-2, adjusting the scale of the projected image so that the size of the marking part 4 and the projected image are consistent;
[0080] S9-3, correcting the projected image, including offset correction and geometric correction. In this embodiment, linear correction is adopted, including the following steps:
[0081] A1. Generate a rectangular coordinate system including an x-axis 5 and a y-axis 6, wherein a plurality of line segments 7 with equal spacing and perpendicular to the x-axis 5 are arranged along the x-axis 5, and a plurality of line segments 7 with equal spacing and perpendicular to the y-axis 6 are arranged along the y-axis 6;
[0082] A2. Place the test piece on the operating table 1. The laser generating device 2 marks a rectangular coordinate system on the test piece to obtain a first coordinate system. The projector 3 projects the rectangular coordinate system on the test piece to obtain a second coordinate system.
[0083] A3, measuring and adjusting the coordinate offset of the origin 8 of the second coordinate system relative to the origin 8 of the first coordinate system, so that the origin 8 of the second coordinate system coincides with the origin 8 of the first coordinate system;
[0084] A4. Measure and adjust the distance offset and angle offset of the line segment 7 of the second coordinate system compared with the line segment 7 of the first coordinate system, so that the second coordinate system coincides with the first coordinate system.
[0085] The first coordinate system is used as a reference, and the offset of the projected image is measured by the second coordinate system, and finally the projection image is calibrated according to the offset.
[0086] S10, projection execution: converting the marking bitmap into a vector point set, and then projecting the vector point set onto the surface of the marking part 4 to display the projection image.
[0087] By extracting the outline of the marking part 4 and displaying it by projection, the positioning work of the operator is greatly simplified and the overall work efficiency is improved. Compared with the traditional laser or red light marking method, the outline displayed by projection avoids the problems of high-frequency flickering and discontinuous outline, and provides a clearer and more stable visual effect. In addition, the outline displayed by projection is gentler on the operator's eyes, reducing the potential risk of injury and effectively reducing eye fatigue during long-term work.
[0088] The oblique projection can not only provide the same clear outline display as the traditional orthographic projection, but also flexibly adjust the projection angle according to the operator's viewing angle and the specific position of the marking object 4, thereby optimizing the visual effect and reducing the impact of shadows or occlusions. On this basis, adding the outline projection is conducive to increasing the operator's depth perception of the marking position and solving the technical problem of blurred edges of the projection image in the prior art.
[0089] Example 2
[0090] Features not explained in this embodiment are explained in Example 1. The difference between this embodiment and Example 1 is that:
[0091] like Figure 4 As shown, in step S9-3, grid correction processing is adopted, including the following steps:
[0092] B1. Generate a rectangular coordinate system including an x-axis 5 and a y-axis 6, wherein a plurality of line segments 7 with equal spacing and perpendicular to the x-axis 5 are arranged along the x-axis 5, and a plurality of line segments 7 with equal spacing and perpendicular to the y-axis 6 are arranged along the y-axis 6; the x-axis 5, the y-axis 6 and the line segments 7 intersect with each other to form a grid diagram with an odd number of rows and columns, and the intersection positions are nodes of the grid diagram;
[0093] B2. Place the test piece on the operating table 1, and the laser generating device 2 marks a grid pattern on the test piece to obtain a first grid pattern; the projector 3 projects the grid pattern on the test piece to obtain a second grid pattern;
[0094] B3, measuring and adjusting the coordinate offset of the central node 9 of the second grid diagram relative to the central node 9 of the first grid diagram, so that the central nodes 9 of the second grid diagram overlap with the central nodes 9 of the first grid diagram;
[0095] B4. For nodes other than the central node 9, measure and adjust the coordinate offsets of the nodes of the second grid map compared with the nodes of the first grid map, so that the second grid map overlaps with the first grid map.
[0096] Compared with linear correction, grid correction can realize the offset correction of each node of the projected image in the area covered by the grid map, with higher accuracy and better correction effect.
[0097] According to the disclosure and teaching of the above description, those skilled in the art to which the present invention belongs may also make changes and modifications to the above embodiments. Therefore, the present invention is not limited to the specific embodiments disclosed and described above, and some modifications and changes to the present invention should also fall within the scope of protection of the claims of the present invention. In addition, although some specific terms are used in this specification, these terms are only for the convenience of description and do not constitute any limitation to the present invention.
Claims
1. A method for displaying the outer contour of an image suitable for laser processing, applied to a laser marking device, wherein the laser marking device comprises a horizontally arranged operating table, a laser generating device, and a projector; the laser generating device is located directly above the operating table and is used to perform laser marking on a marking object placed on the operating table; The projector is arranged at the side of the laser generating device to perform oblique projection on the operating table; The method comprises photographing the marking part to obtain a marking image, and projecting the marking image through the projector to obtain a projection image; It is characterized in that The steps include: S1, image preprocessing: grayscale processing is performed on the marking image to obtain a marking bitmap; S2, binarization processing: setting a binarization threshold, reading the position grayscale of the marking bitmap, and binarizing the marking bitmap to obtain a binary image; S3, image smoothing: performing Gaussian optimization on the binary image to remove jagged edges; S4, contour extraction: extracting the contour of the marked part from the binary image; S5, vectorization processing: performing vectorization processing on the outline; S6, contour simplification: the contour includes an inner contour and an outer contour, the inner contour is removed, and the outermost layer of the outer contour is retained; S7, contour cleaning: removing impurity points on the contour; S8, contour drawing: drawing the contour on the marking bitmap; S9, projection correction: performing projection correction on the projected image, including the following specific steps: S9-1, using the distortion correction function of the projector itself to make preliminary adjustments to the projected image; S9-2, adjusting the scaling ratio of the projection image so that the size of the marking part and the projection image are consistent; S9-3, performing correction processing on the projected image, including offset correction and geometric correction; The correction process is a linearization correction, comprising the following steps: A1. Generate a rectangular coordinate system including an x-axis and a y-axis, wherein a plurality of line segments with equal spacing and perpendicular to the x-axis are arranged along the x-axis, and a plurality of line segments with equal spacing and perpendicular to the y-axis are arranged along the y-axis; A2. Placing a test piece on the operating table, and the laser generating device marks the rectangular coordinate system on the test piece to obtain a first coordinate system; and the projector projects the rectangular coordinate system on the test piece to obtain a second coordinate system; A3. Measure and adjust the coordinate offset of the origin of the second coordinate system relative to the origin of the first coordinate system so that the origins of the second coordinate system and the first coordinate system coincide with each other; A4. Measure and adjust the distance offset and angle offset of the line segment of the second coordinate system compared with the line segment of the first coordinate system, so that the second coordinate system coincides with the first coordinate system; Or the correction process is grid correction, comprising the following steps: B1. Generate a rectangular coordinate system including an x-axis and a y-axis, wherein a plurality of line segments with equal spacing and perpendicular to the x-axis are arranged along the x-axis, and a plurality of line segments with equal spacing and perpendicular to the y-axis are arranged along the y-axis; the x-axis, the y-axis and the line segments intersect with each other to form a grid diagram with an odd number of rows and columns, and the intersection positions are nodes of the grid diagram; B2. placing a test piece on the operating table, and marking the grid pattern on the test piece with the laser generating device to obtain a first grid pattern; and projecting the grid pattern on the test piece with the projector to obtain a second grid pattern; B3, measuring and adjusting the coordinate offset of the central node of the second grid map relative to the central node of the first grid map, so that the central nodes of the second grid map and the first grid map overlap; B4. For nodes other than the central node, measuring and adjusting the coordinate offsets of the nodes of the second grid map compared with the nodes of the first grid map, so that the second grid map overlaps with the first grid map; S10, projection execution: projecting the marking bitmap onto the surface of the marking part and displaying the projection image; The contour is used to assist an operator in positioning the marking part on an operating table.
2. The image outer contour display method suitable for laser processing according to claim 1, characterized in that: In step S8, the outline is highlighted.
3. The image outer contour display method suitable for laser processing according to claim 1, characterized in that: In step S10, the marking bitmap is converted into a vector point set, and then projected onto the surface of the marking part according to the vector point set to display the projection image.
4. The image outer contour display method suitable for laser processing according to claim 1, characterized in that: The average value of the grayscale values of all pixels in the marking bitmap is the binarization threshold.
Citation Information
Patent Citations
A multi-angle visual positioning laser marking machine and its laser marking method
CN106964904B
Optical projection laser marking method and laser marking system
CN105128539A
Laser coloring method based on image color recognition and image transformation
CN113996956A