Printer and printing method

By fixing the vision positioning component to the outside of the printer carriage on a UV flatbed printer, synchronous height adjustment and real-time image processing are achieved, solving the problems of low printing accuracy and efficiency in existing technologies and improving the stability and efficiency of the printer.

CN117656657BActive Publication Date: 2026-05-29SHENZHEN DINGLI DIGITAL TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN DINGLI DIGITAL TECH CO LTD
Filing Date
2023-11-29
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

The existing vision positioning devices of UV flatbed printers have difficulty ensuring the high synchronization of the printing head and the line scan camera when changing printing materials of different thicknesses, resulting in poor printing position accuracy and low efficiency.

Method used

The vision positioning component is fixedly installed on the outside of the printer carriage housing, so that its height is adjusted synchronously with the printer carriage, and images are acquired and processed in real time during the printing process, realizing simultaneous acquisition and printing.

Benefits of technology

The stability of the visual positioning component and the accuracy of image acquisition have been improved, resulting in enhanced print quality and increased printing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117656657B_ABST
    Figure CN117656657B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of printer and printing method, printer includes printer head and printing platform, printer head is set to the printing platform, and the printer head can reciprocate along the x-axis and y-axis direction of printing platform, when printer stops work, printer head is located at the preset starting point position of printing platform, printer head includes shell, controller, visual positioning component and printing nozzle, controller and printing nozzle are set to the inside of shell, printing nozzle is electrically connected with controller, printing nozzle is set to the bottom of shell and towards the printing platform, visual positioning component is set to the outside of printer head, and visual positioning component is located at the X-axis direction of printing nozzle and the side far from the preset starting point position.This printer of the present application has good printing quality, high printing precision, strong stability and high printing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of printer technology, and in particular to a printer and printing method. Background Technology

[0002] UV flatbed printing is a technology that uses ultraviolet (UV) curing technology to print images on a flat surface. UV flatbed printers are widely used in advertising, signage, and outdoor advertising, and can print on various materials such as wood, metal, glass, plastic, and ceramics. Some UV flatbed printers are equipped with automatic positioning systems that use photoelectric sensors and computer vision technology to automatically detect the material's position before printing.

[0003] Currently, there are two main methods for installing vision positioning devices on UV flatbed printers. The first method involves mounting a single-lens reflex (SLR) camera above the printing platform to capture images. However, images captured by the SLR are prone to distortion around the edges. Therefore, in actual production, the SLR camera needs repeated calibration and position adjustment. Furthermore, when changing to different thicknesses of printing materials, the printhead height needs to be adjusted, requiring repeated adjustments to the SLR height. This leads to inaccurate image matching, poor printing position accuracy, and low production efficiency. The second method involves mounting a line scan camera below the UV flatbed printer's crossbeam. Line scan cameras are generally quite long, and after a period of use, they gradually accumulate deformation, affecting printing accuracy. Additionally, the images generated by the line scan camera are relatively large, resulting in long processing times. Moreover, when changing to different thicknesses of printing materials, the printhead height and line scan camera height need to be adjusted, making it difficult to ensure synchronization between the two heights.

[0004] UV flatbed printers that use the above two methods to install visual positioning devices need to scan all the images of the printing material first, then perform image recognition and matching, and finally reset the print head position before printing can begin, which is inefficient.

[0005] Therefore, there is an urgent need to improve the structure and printing method of UV flatbed printers. Summary of the Invention

[0006] The main objective of this invention is to provide a printer and printing method to solve the problems of poor printing quality and low printing efficiency in existing printers.

[0007] To achieve the above objectives, the present invention provides a printer, comprising a printer carriage and a printing platform. The printer carriage is disposed above the printing platform and is reciprocating along the x-axis and y-axis of the printing platform. When the printer stops working, the printer carriage returns to a preset starting position on the printing platform. The printer carriage includes a housing, a controller, a vision positioning component, and a print head. The controller and the print head are disposed inside the housing, and the print head is electrically connected to the controller. The print head is disposed at the bottom of the housing and faces the printing platform. The vision positioning component is disposed outside the housing and is located on the side of the print head in the x-axis direction that is farther from the preset starting position.

[0008] Furthermore, the visual positioning component includes a camera component and a camera carrier mechanism. The camera carrier mechanism includes a carrier platform and a fixing component. The camera component is disposed above the carrier platform. The carrier platform is mounted on the fixing component. The fixing component is fixedly connected to the housing. The carrier platform is arranged parallel to the printing platform. The camera component is electrically connected to the controller.

[0009] Furthermore, a sliding assembly is provided on the outer side of the housing sidewall. The fixing assembly includes a first fixing panel, a second fixing panel, and two oppositely arranged extension panels. The first fixing panel and the second fixing panel are opposite to each other. The first side of the first fixing panel is in close contact with the outer side of the housing. The two extension panels are spaced apart. One end of each extension panel is connected to the second side of the first fixing panel, and both extension panels are perpendicular to the second side of the first fixing panel. The second side of the first fixing panel is opposite to the first side of the first fixing panel. The other end of each extension panel is connected to the second fixing panel.

[0010] Furthermore, it also includes a light source assembly. The extended panel includes an L-shaped extended base plate, which includes a first horizontal portion and a first vertical portion. The bottom surface of the first horizontal portion is located on the upper surface of the sliding assembly, and the first vertical portion is located on the outer side of the sliding assembly. The light source assembly is connected to the outer side of the first vertical portion and is located between the camera assembly and the printing platform.

[0011] The present invention also provides a printing method for the above-mentioned printer, comprising the following steps:

[0012] Acquire a first image; wherein the first image is acquired by the visual positioning component at a preset frequency during the movement of the printer carriage along the first direction of the X-axis of the printing platform and is stored in a memory; the printer carriage includes a visual positioning component and a print head, the visual positioning component and the print head move synchronously along the first direction, and at least one printing material is placed on the printing platform;

[0013] Determine whether the first image contains at least a portion of the image of the printing material;

[0014] If so, a second image is obtained, which is synthesized from a first image containing at least a portion of the printing material currently stored in the memory;

[0015] The second image is preprocessed to extract at least a portion of the image outline of the printing material;

[0016] Perform contour matching of at least a portion of the image contours in a preset image library;

[0017] Determine whether a matching image is contained in the preset image library;

[0018] If so, obtain the print dot matrix data of the matched image and determine the print start position;

[0019] When the print head moves along the first direction to the printing start position, the print head is controlled to start printing according to the printing dot matrix data.

[0020] Further, the step of preprocessing the second image to extract at least a portion of the image contour of the printing material includes:

[0021] Convert the second image to a grayscale image;

[0022] The grayscale image is denoised to obtain a denoised image;

[0023] The gradient of the grayscale values ​​of the pixels in the denoised image is calculated to obtain a gradient magnitude map;

[0024] Edge pixels are obtained from the gradient magnitude map, and the edge pixels are connected to form at least a portion of the image outline of the printing material.

[0025] Furthermore, each preset image in the preset image library is provided with at least one preset feature point, and the step of performing contour matching of the at least part of the image contour in the preset image library includes:

[0026] Identify whether the at least part of the image contour contains the image contour of the determined matching image;

[0027] If so, remove the image contour of the already determined matching image to obtain the image contour to be matched;

[0028] Identify whether the contour of the image to be matched contains at least one contour feature point, wherein the contour feature point is the same contour portion as at least one preset feature point;

[0029] If so, group all the contour feature points together, and group the contour feature points that are the same as the preset feature points of the same preset image together.

[0030] The matching coefficient is obtained by weighting each contour feature point in each group according to the preset weights.

[0031] Further, the step of determining whether a matching image is contained in the preset image library includes:

[0032] Determine whether the matching coefficient exceeds a preset threshold;

[0033] If so, it is determined that the preset image library contains a matching image, and the preset image corresponding to the group whose matching coefficient exceeds the preset threshold is taken as the matching image.

[0034] Furthermore, a grid array is set on the printing platform, and the step of determining the printing start point position includes:

[0035] The contour of the image to be matched is mapped onto the grid array to obtain the coordinate value array of the contour of the image to be matched on the grid array;

[0036] From the coordinate value array, select the point that is closest to the print head in the first direction as the printing start point position.

[0037] Furthermore, after the step of controlling the print head to start printing according to the print dot matrix data when the print head moves along the first direction to the printing start position, the method further includes:

[0038] Determine whether each of the printed materials has been printed completely;

[0039] If so, the first image containing only a portion of the image outline of the printed material that has been printed is deleted from the memory.

[0040] Furthermore, the printer includes a light source assembly, the color of which is adjustable, and the light source color includes at least two colors. The light source assembly is located above the printing platform. Before the step of acquiring the second image, the printer further includes:

[0041] The printer carriage is paused at its current position, and the color of the printing material is identified based on at least a portion of the printing material contained in the first image;

[0042] Based on the color of the printing material, the light source component is turned on, and at least one light source color is selected according to the preset light source setting rules;

[0043] A new first image is captured at the current location, and the previously captured first image is replaced with the newly captured first image.

[0044] The present invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of any of the above-described printing methods.

[0045] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the printing method described in any of the preceding claims.

[0046] The printer and printing method provided by this invention have the following beneficial effects:

[0047] By fixing the vision positioning component to the outside of the printer carriage housing, the height of the vision positioning component is adjusted synchronously with the height of the printer carriage. The vision positioning component and the printer carriage rise and fall together, eliminating the need for separate height adjustment of the vision positioning component and avoiding frequent adjustments. This improves the stability of the vision positioning component, enhances the accuracy of image acquisition, and improves the print quality. Simultaneously, it allows for the simultaneous acquisition, processing, and control of the printing material's image, significantly increasing printing efficiency. Attached Figure Description

[0048] Figure 1 This is a schematic diagram of the printer structure in one embodiment of the present invention;

[0049] Figure 2 This is a schematic diagram of the printer carriage structure in one embodiment of the present invention;

[0050] Figure 3 This is a partial structural schematic diagram of the printer carriage in one embodiment of the present invention;

[0051] Figure 4 This is a schematic diagram of the internal partial structure of the printer carriage in one embodiment of the present invention;

[0052] Figure 5 This is a flowchart illustrating a printing method according to an embodiment of the present invention;

[0053] Figure 6 This is a schematic block diagram of the structure of a computer device according to an embodiment of the present invention.

[0054] 1: Printer carriage; 2: Printing platform; 11: Housing; 12: Controller; 13: Vision positioning component; 14: Print nozzle; 131: Camera component; 132: Camera support mechanism; 1321: Support platform; 1322: Fixing component; 133: Camera adjustment bracket component; 15: Sliding component; 1331: Adjustment bracket; 91: First fixing panel; 92: Second fixing panel; 93: Extension panel; 16: Light source component; 931: L-shaped extension base plate; 931a: First horizontal part; 931b: First vertical part; 161: Light source fixing bracket; 162: Light source; 1611: L-shaped fixing bracket; 1612: First triangular fixing piece; 17: Carriage carriage structure reinforcing plate.

[0055] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0056] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0057] Reference Figure 1 and Figure 2 This invention provides a specific embodiment of a printer, comprising a printer carriage 1 and a printing platform 2. The printer carriage 1 is positioned above the printing platform 2 and can reciprocate along the x-axis and y-axis of the printing platform 2. When the printer stops working, the printer carriage 1 returns to a preset starting position on the printing platform 2. The printer carriage 1 includes a housing 11, a controller 12, a vision positioning component 13, and a print head 14. The controller 12 and the print head 14 are located inside the housing 11, and the print head 14 is electrically connected to the controller 12. The print head 14 is located at the bottom of the housing 11 and faces the printing platform 2. The vision positioning component 13 is located outside the printer carriage 1 and is positioned on the side of the print head 14 in the x-axis direction, farther from the preset starting position.

[0058] In this embodiment, the preset starting position is the initial position to which the printer resets when in standby mode. When the printer stops working, the printer carriage 1 resets to the preset starting position. During printing, the printer carriage 1 reciprocates along the x-axis and y-axis of the printing platform 2, thereby printing the printing material placed on the printing platform 2, wherein the x-axis and y-axis are perpendicular. The print head 14 is electrically connected to the controller 12, so that the controller 12 can send electrical signals to the print head 14 to control the print head 14 to print. Specifically, the print head 14 and the controller 12 can be electrically connected via a ribbon cable. The controller 12 is connected to a processor (not shown in the figure), which is generally a computer device used to execute the printer's printing method and send instructions to the controller 12 to control the printing process. The visual positioning component 13 communicates with the processor via a gigabit network to transmit acquired images and control signals.

[0059] By fixing the visual positioning component 13 to the outside of the housing 11 of the printer carriage 1, the height of the visual positioning component 13 is adjusted synchronously when the height of the printer carriage 1 is adjusted. The visual positioning component 13 and the printer carriage 1 rise and fall together, eliminating the need for separate height adjustment of the visual positioning component 13. This avoids frequent adjustments to the height of the visual positioning component 13, thereby improving its stability, image acquisition accuracy, print quality, and printing efficiency. The height adjustment device for the printer carriage 1 is not shown in the accompanying drawings and is prior art, not part of the inventive concept of this invention; therefore, it will not be described in detail here.

[0060] By positioning the visual positioning component 13 on the X-axis direction of the print head 14 and away from the preset starting position, when the printer starts working, the visual positioning component 13 and the print head 14 move simultaneously along the X-axis direction away from the preset starting position. The visual positioning component 13 will move to the area above the printing material placement position on the printing platform 2 before the print head 14. The visual positioning component 13 can collect image information of the printing material. The image information is sent by the controller to the processor for image processing. After processing, a matching image corresponding to the printing material is obtained. When the print head moves to the area above the printing material placement position, the printer can control the print head to print the printing material placed on the printing platform according to the matching image. Thus, the printer can simultaneously collect images of the printing material, process the images, and control the printing process, greatly improving printing efficiency.

[0061] Reference Figure 2 and Figure 3In one embodiment, based on the foregoing embodiments, the visual positioning component 13 of the printer of the present invention includes a camera component 131 and a camera carrier mechanism 132. The camera carrier mechanism 132 includes a carrier platform 1321 and a fixing component 1322. The camera component 131 is disposed above the carrier platform 1321. The carrier platform 1321 is mounted on the fixing component 1322. The fixing component 1322 is fixedly connected to the printer carriage 1. The carrier platform 1321 is arranged parallel to the printing platform 2. The camera component 131 is electrically connected to the controller 12.

[0062] In this embodiment, the camera in the camera assembly 131 is preferably an industrial CCD camera. Industrial CCD cameras are less prone to deformation, have a longer service life, and are more stable. They are used to acquire image information of the printing material for transmission to a computer connected to the printer for image processing. The light-incident surface of the camera assembly 131 faces the support platform 1321. The vision positioning component 13 is located on the outside of the printer carriage 1. Specifically, referring to... Figure 4 A front-end structural reinforcement plate 17 can be installed inside the housing 11. This front-end structural reinforcement plate 17 is fixedly connected to the bottom of the printer carriage 1 housing, providing excellent structural stability. Fasteners are used to securely connect the front-end structural reinforcement plate 17 to the vision positioning component 13, ensuring that the vision positioning component 13 is stably connected to the outside of the printer carriage 1. A fixing component 1322 connects the vision positioning component 13 to the printer carriage 1. The fixing component 1322 has a certain width, allowing for an appropriate distance between the vision positioning component 13 and the print head 14 inside the housing 11. This allows the vision positioning component 13 to first acquire image information of the printing material. During the print head's forward movement, time is allowed for image processing by the processor. When the print head moves above the printing material placement area, printing can begin without further waiting, significantly improving printing efficiency.

[0063] It is understood that, based on the innovative printer structure of this invention, existing printing methods can also be used. For example, after the image is fully acquired, it is compared to see if the image contains preset feature points that need to be printed onto the printing material. If the preset feature points are present, image matching is further performed based on these feature points. Based on the matched image data, the printing start point position is determined, and the print head is adjusted to move to the printing start point position. Simultaneously, image RIP (Raster Image Processing) is performed, and the print head is controlled to start printing based on the RIP data. Specifically, when using the printer of this invention, those skilled in the art can invoke different printing methods according to the specific usage scenario and printing requirements.

[0064] Furthermore, the end of the camera assembly furthest from the lens light-incident surface is connected to the camera adjustment bracket assembly 133. The camera adjustment bracket assembly 133 is used to adjust the horizontal and vertical physical position of the camera 211. Specifically, the position of the camera assembly 131 can be moved by moving the position of the camera adjustment bracket assembly 23. A through hole is provided on the support platform 1321 so that the camera assembly 131 can capture images of the printing material located on the printing platform 2. By further configuring the camera adjustment bracket assembly 133, the position of the camera assembly 131 can be finely adjusted to more accurately acquire image information of the printing material. In a specific embodiment, the camera adjustment bracket assembly 133 includes two equally spaced adjustment brackets 1331. Each adjustment bracket 1331 includes a first adjustment edge and a second adjustment edge that are perpendicular to each other. The first adjustment edge and the second adjustment edge are arranged in an L-shape. A first slot is provided on the first adjustment edge, and at least one second slot is provided on the second adjustment edge. The first slot is an elongated oval hole, through which a bolt can be passed to connect the adjusting bracket 1331 and the fixing component 1322, so that the adjusting bracket 1331 is fixed on the fixing component 1322. By adjusting the vertical position of the first slot, the vertical position of the camera component 131 can be adjusted. The second slot is also an elongated oval hole, through which a bolt can be passed to connect the adjusting bracket 1331 and the end of the camera component 131, so that the end of the camera component 131 is mounted on the adjusting bracket 1331. By adjusting the horizontal position of the end of the camera component 131 within the lateral range of the second slot, the horizontal position of the camera component 131 can be adjusted.

[0065] Reference Figures 1-3 In one embodiment, based on the foregoing embodiments, a sliding assembly 15 is provided on the outer side wall of the printer housing 11 of the present invention. The fixing assembly 1322 includes a first fixing panel 91, a second fixing panel 92, and two oppositely arranged extension panels 93. The first fixing panel 91 and the second fixing panel 92 are oppositely arranged. The first side of the first fixing panel 91 is in close contact with the outer side of the housing 11. The two extension panels 93 are spaced apart. One end of each extension panel 93 is connected to the second side of the first fixing panel 91, and both extension panels 93 are perpendicular to the second side of the first fixing panel 91. The second side of the first fixing panel 91 is opposite to the first side of the first fixing panel 91. The other end of each extension panel 93 is connected to the second fixing panel 92.

[0066] In this embodiment, since a sliding component 15 is typically provided in the printer to move the position of the printer head 1, the light-incident surface of the camera component 131 can be pulled to a position where it will not be blocked by the sliding component 15 by providing the extension panel 93. In one embodiment, the length of the extension panel 93 can be set according to the width of the sliding component 15; in another specific embodiment, the length of the extension panel 93 is variable, and the extension panel 93 can be composed of two parallel wooden boards, one of which can slide along the other, thereby adjusting the length of the extension panel 93. The length of the extension panel 93 is determined according to the length of the printing material to ensure that there is sufficient distance between the visual positioning component 13 and the print head 14 so that the processor can complete image processing and matching within the time corresponding to the distance the print head moves. The adjusting bracket 1331 is fixed to the upper end of the second fixed panel 93, and the supporting platform 1321 is fixed to the lower end of the second fixed panel 93. The height of the second fixed panel 93 can be set according to the height of the camera component 131, preferably slightly lower than, equal to, or slightly greater than the height of the camera component 131.

[0067] In one specific embodiment, the fixing component 1322 further includes two second triangular fixing members arranged at relatively intervals. The supporting platform 1321 is disposed at the bottom of the second fixing panel 93 and is perpendicular to the second fixing panel 93. The supporting platform 1321 is connected to the second fixing panel 93 through the two second triangular fixing members. By setting the second triangular fixing members, the structural stability of the supporting platform 1321 can be ensured to stably support the camera component 131.

[0068] Reference Figure 3 In one specific embodiment, based on the foregoing embodiment, a light source assembly 16 is further included. The extension panel 93 includes an L-shaped extension base plate 931, which includes a first horizontal portion 931a and a first vertical portion 931b. The bottom surface of the first horizontal portion 931a is located on the upper surface of the sliding assembly 15, and the first vertical portion 931b is located on the outer side of the sliding assembly 15. The light source assembly 16 is connected to the outer side of the first vertical portion 931b and is located between the camera assembly 131 and the printing platform 2.

[0069] In this embodiment, the light source color of the light source assembly 16 is adjustable, for example, it can be white light, red light, or blue light. The specific color can be selected according to the color of the printing material. For example, when capturing an image of black printing material, red light can be used because red light has a higher reflectivity to black objects. Choosing a suitable light source color helps improve the contrast and clarity of the captured image, thereby improving printing accuracy. The L-shaped extension base plate 93 matches the shape of the sliding assembly 15, thus fully utilizing the side space of the printer carriage to install the visual positioning assembly 13. It also makes the supporting platform 1321 more stable, preventing vibration when the carriage moves.

[0070] Reference Figure 3 Furthermore, in one specific embodiment, based on the foregoing embodiments, the light source assembly 16 includes a light source fixing bracket 161 and a light source 162. The light source 162 is disposed at the bottom of the light source fixing bracket 161, which is mounted on the outside of the first vertical portion 931b and positioned below the support platform 1321. The light source fixing bracket 161 includes an L-shaped fixing bracket 1611 and two first triangular fixing members 1612. The L-shaped fixing bracket 1611 includes a second horizontal portion and a second vertical portion, which are connected by the first triangular fixing members 1612. The light source 162 is disposed at the bottom of the second horizontal portion. The first triangular fixing members 1612 ensure the structural stability of the light source fixing bracket 161. The light source 162 is fixed at the bottom of the second horizontal portion, which is located below the support platform 1321, thereby providing illumination for the camera assembly 131 above the support platform 1321 and improving the contrast and clarity of the captured image.

[0071] Reference Figure 3 In one specific embodiment, based on the foregoing embodiments, at least one cutout is provided on the second horizontal portion. This cutout is for light transmission so that the camera assembly 131 can capture images located on the printing platform 2. Since the main purpose of the pattern captured by the printer's visual positioning assembly 13 is to identify the outline of the printed object, the image captured by the camera through the cutout is sufficient to meet the usage requirements.

[0072] Reference Figure 5 The present invention illustrates a printing method for the aforementioned printer, comprising the following steps:

[0073] S1. Acquire a first image; wherein the first image is acquired by the visual positioning component at a preset frequency during the movement of the printer carriage along the X-axis of the printing platform in the first direction, and is stored in the memory; the printer carriage includes a visual positioning component and a print head, the visual positioning component and the print head move synchronously along the first direction, and at least one printing material is placed on the printing platform;

[0074] S2. Determine whether the first image contains at least a portion of the printed material;

[0075] S3. If so, then obtain a second image, which is synthesized from a first image containing at least a portion of the printing material currently stored in the memory;

[0076] S4. Preprocess the second image to extract at least a portion of the image outline of the printing material;

[0077] S5. Perform contour matching on the at least part of the image contour in a preset image library;

[0078] S6. Determine whether a matching image is contained in the preset image library;

[0079] S7. If yes, then obtain the print dot matrix data of the matching image and determine the print start position;

[0080] S8. When the print head moves along the first direction to the printing start position, control the print head to start printing according to the print dot matrix data.

[0081] Through the above steps S1 to S8, the present invention can simultaneously acquire images of the printing material, process the images, and control the printing process, thereby greatly improving printing efficiency.

[0082] Specifically, in step S1 above, since the visual positioning component is positioned on the X-axis direction of the print head and away from the preset starting position, when the printer starts working, the visual positioning component and the print head move simultaneously along the X-axis direction away from the preset starting position. For any position on the printing platform, the visual positioning component will move to that position before the print head, meaning the visual positioning component can capture the image of the position the print head has not yet reached. The first image is an image captured by the visual positioning component at a preset frequency. This first image may contain an image of the printing material or may only contain an image of the printing platform. The preset frequency can be specifically set according to the movement speed of the printer head, preferably to achieve a preset number of vertical stripe overlaps when two consecutive first images are stitched together. The preset number can be several to several hundred pixels. Each first image is stored sequentially in the memory. One printing material can be placed on the printing platform, or multiple printing materials can be placed without overlap. The horizontal and vertical positions and directions of the printing materials do not need to be specially adjusted.

[0083] In step S2 above, determining whether the first image contains at least a portion of the printing material includes: acquiring a comparison image consisting only of the printing platform captured by the visual positioning component; comparing the features of the first image and the comparison image, specifically, the features include at least one of brightness, grayscale, color, and contrast; if the features of the first image and the comparison image are different, then it is determined that the first image contains at least a portion of the printing material. Since the image color of the printing material and the color of the printing platform are inconsistent, feature comparison can quickly identify whether a portion of the printing material is captured in the first image. The aforementioned image of at least a portion of the printing material can be a partial image of the printing material or the entire printing material.

[0084] In step S3 above, if the memory does not contain a first image containing at least some of the printing material, then no synthesis is required; if the memory contains only one first image containing at least some of the printing material, then this first image is used as the second image; if the memory contains at least two first images containing at least some of the printing material, then the at least two first images are stitched together to form a single first image. Specifically, overlapping pixels can be cropped from two adjacent first images and then stitched together.

[0085] In step S4 above, the second image is preprocessed to extract at least a portion of the image contours contained in the second image for contour matching in subsequent steps.

[0086] In one specific embodiment, step S4, which preprocesses the second image to extract at least a portion of the image contour of the printing material, includes:

[0087] S401. Convert the second image into a grayscale image;

[0088] S402. Denoise the grayscale image to obtain a denoised image;

[0089] S403. Calculate the gradient of the gray values ​​of the pixels in the denoised image to obtain a gradient magnitude map;

[0090] S404. Obtain edge pixels from the gradient magnitude map, connect the edge pixels, and form at least a portion of the image outline of the printing material.

[0091] In this embodiment, in step S401 above, the color image can be converted to a grayscale image by weighted averaging of the RGB channels, for example, using the following formula: Gray = 0.2989*R + 0.5870*G + 0.1140*B. The coefficients in the formula are used to simulate the sensitivity of the human eye to different colors in order to better preserve the visual information of the image. Converting the second image to a grayscale image simplifies the subsequent calculation process because edge detection is more efficient on a grayscale image.

[0092] In step S402 above, the denoising process is used to reduce noise and details in the image, making edge detection more accurate. Denoising methods such as Gaussian filtering and median filtering can be used. Specifically, Gaussian filtering is achieved by replacing the value of each pixel in the grayscale image with a weighted average of the values ​​of its surrounding pixels. That is, Gaussian filtering performs a weighted average of the pixels around each pixel and uses this weighted average to replace the original pixel value, thereby reducing the impact of noise while preserving the overall structure and edge information of the grayscale image. Median filtering replaces each pixel in the grayscale image with the median value of its surrounding pixels. Those skilled in the art can select the denoising methods listed in this invention and those in the prior art according to specific needs and image characteristics to achieve the purpose of reducing the impact of noise and improving the accuracy of edge detection.

[0093] In step S403 above, the gradient calculation can be performed using operators such as Sobel, determining the gradient magnitude of the image by observing the grayscale changes of pixel values ​​in the denoised image. Specifically, the Sobel operator is an edge detection operator based on discrete differential operators. It performs horizontal and vertical convolution operations on the denoised image to obtain an approximate value of the grayscale gradient at each pixel. Then, by merging the grayscale gradient values ​​in the horizontal and vertical directions, the gradient magnitude and direction at each pixel can be calculated. Similarly, existing technologies also include Prewitt operators, Roberts operators, etc., which can also be used to detect image gradients, but these will not be elaborated upon in this invention. Those skilled in the art can select the edge detection operators listed in this invention and those in the prior art according to specific needs and image characteristics. By performing discrete convolution operations on the denoised image to obtain the grayscale gradient values ​​of each pixel, the location of the largest pixel value change in the image can be determined, thus obtaining a gradient magnitude map. The grayscale value at each pixel location in the gradient magnitude map represents the edge intensity at that location.

[0094] In step S404 above, the step of obtaining edge pixels from the gradient magnitude map includes performing non-maximum suppression processing on the gradient magnitude map, checking the gradient magnitude of each pixel, and comparing the grayscale gradient value of the pixel with the grayscale gradient values ​​of its two neighboring pixels along the gradient direction (i.e., the normal direction of the edge). If the grayscale gradient value of the pixel is not the largest along the gradient direction, then the value of this pixel is suppressed and made zero; otherwise, it is retained. This obtains accurate edge pixels. Connecting the edge pixels sequentially forms at least a portion of the image outline of the printing material.

[0095] In step S5 above, the preset image library stores preset images for printing. These preset images include images that match the printing material; matching means the image and the printing material have the same shape. Since the printing platform can hold one or more printing materials, and these materials can have the same or different shapes, the number of preset images can also be one or more.

[0096] In one specific embodiment, each preset image in the preset image library is provided with at least one preset feature point, and the step S5 of performing contour matching of the at least part of the image contour in the preset image library includes:

[0097] S501. Identify whether the at least part of the image contour contains the image contour of the determined matching image;

[0098] S502. If so, remove the image contour of the determined matching image to obtain the image contour to be matched.

[0099] S503. Identify whether the contour of the image to be matched contains at least one contour feature point, wherein the contour feature point is the same contour part as at least one preset feature point;

[0100] S504. If so, group all the contour feature points and group the contour feature points that are the same as the preset feature points of the same preset image.

[0101] S505. Perform weighted calculations based on the preset weights of each contour feature point in each group to obtain the matching coefficient.

[0102] In this embodiment, the preset feature points are representative contour parts in the preset image. By comparing with the preset feature points, an image matching the printing material is selected from the preset image library. The preset feature points can be manually set according to image features, or they can be automatically extracted by feature point extraction algorithms, such as SIFT, SURF, ORB, etc. The specific extraction steps of the algorithm are technologies already disclosed in the art, and will not be described in detail in this application.

[0103] In step S501 above, for image contours that have already been determined to match an image, contour matching is no longer required. The visual positioning device of this invention acquires multiple images during movement. For example, the first image captures the left half of a printing material. Contour matching has been completed using the image contour of this left half, and the corresponding printing dot matrix data has been sent to the print head. When the visual positioning device acquires the second image, it captures the right half of the printing material. The first and second images are combined into a second image. At this point, the image contour in the second image can be identified as the image contour of the already determined matching image, so further contour matching is unnecessary. Image contours of already determined matching images can be marked in the corresponding first image. In the second image, the presence of these marked points can be used to determine whether the image contour of the already determined matching image is included.

[0104] In step S502 above, since the printing materials of the present invention can be multiple, as the visual positioning device of the printer moves, new images of printing materials with undetermined matching images will be captured, namely the above-mentioned images to be matched, and contour matching needs to be performed on these images to be matched.

[0105] In step S503 above, a feature point matching algorithm can be used to identify whether the contour of the image to be matched contains at least one contour feature point. Specifically, the feature point matching algorithm can be selected from existing technologies such as brute-force matching, KD-tree-based matching algorithms, and nearest neighbor distance-based matching algorithms. The specific calculation process of these algorithms will not be elaborated in this application.

[0106] In step S504 above, since each preset image can have one or more preset feature points, multiple contour feature points may also be identified in the contour of the image to be matched. At this time, it is necessary to group the identified contour feature points. For example, four contour feature points a, b, c, and d are identified in the contour of the image to be matched. In the preset image library, preset image A has preset feature points a, b, c, and e, and preset image B has preset feature points a, d, and f. Then, the contour feature points a, b, c, and d are divided into two groups: (a, b, c) and (a, d).

[0107] In step S505 above, each contour feature point in each preset image has a preset weight, which can be allocated according to the importance or reliability of each contour feature point. The preset weights of each group can be directly added together for weighted calculation to obtain the matching coefficient. For complex graphics, the similarity between the corresponding preset feature points and contour feature points in each group can be further calculated, multiplied by the weight, and then summed for weighted calculation to obtain the matching coefficient.

[0108] Specifically, step S6 above, determining whether a matching image is contained in the preset image library, includes:

[0109] S601. Determine whether the matching coefficient exceeds a preset threshold;

[0110] S602. If so, it is determined that the preset image library contains a matching image, and the preset image corresponding to the group whose matching coefficient exceeds the preset threshold is taken as the matching image.

[0111] In this embodiment, the aforementioned preset threshold is a manually pre-set value. If the matching coefficient exceeds the preset threshold, it is determined that a matching image is present in the preset image library. Further, if there are multiple matching coefficients exceeding the preset threshold, the preset image with the highest matching coefficient is selected as the matching image. If there are multiple matching coefficients exceeding the preset threshold, and multiple instances of the highest matching coefficient being equal, then one of the multiple preset images corresponding to the highest matching coefficient is selected as the matching image according to a preset selection rule. This preset selection rule can be random, sequential by number, or other manually pre-set rules.

[0112] In step S7 above, the acquisition of the printing dot matrix data of the matching image includes: preprocessing the matching image, wherein the preprocessing includes adjusting the size and rotation angle to adapt to the printing material; and converting the bitmap data of the matching image into printing dot matrix data that can be recognized by the printer.

[0113] In one specific embodiment, a grid array is set on the printing platform, and the step of determining the printing start point position includes:

[0114] S701. Map the contour of the image to be matched onto the grid array to obtain the coordinate value array of the contour of the image to be matched on the grid array;

[0115] S702. From the coordinate value array, select the point closest to the print head in the first direction as the printing start point position.

[0116] In this embodiment, the grid array can be arranged as a dot-matrix array on the printing platform. By identifying the point on the image contour to be matched that is closest to the print head in the first direction, and taking that point as the starting point for printing, the print head can begin printing according to the print dot matrix data as it moves to that position along the first direction.

[0117] In step S8 above, during the forward movement of the visual positioning component and the print head, the visual positioning component reaches above the printing material at the first time point, collects image information, and the processor immediately performs contour matching and other operations, and then sends the print dot matrix data to the print head. When the print head reaches the printing material at the second time point, printing begins immediately. At the second time point, the visual positioning component collects images along the forward path of the print head. Thus, the printer of the present invention can simultaneously collect images of the printing material, process the images, and control the printing process, greatly improving printing efficiency.

[0118] In yet another embodiment, after step S8, whereby the print head is controlled to start printing according to the print dot matrix data when it moves along the first direction to the printing start position, the method further includes:

[0119] S9. Determine whether each of the printed materials has been printed;

[0120] S10. If so, delete the first image in the memory that contains only at least a portion of the image outline of the printed material after printing.

[0121] In this embodiment, for printed materials that have already been printed, the first image containing only at least a portion of the image outline of the printed material is deleted. This reduces the amount of data processing involved in image synthesis, outline matching, etc., in the aforementioned steps, increases the speed of data processing, and further improves printing efficiency. For example, two printed materials, ① and ②, are provided on the printing platform. When printed material ① has been printed, the first image containing only at least a portion of the image outline of ① is deleted from the memory. If the first image contains a portion of the image outline of both ① and ②, it is not deleted.

[0122] In yet another embodiment, the printer includes a light source assembly, the light source color of which is adjustable, and the light source color includes at least two colors. The light source assembly is located above the printing platform. Before step S3 of acquiring the second image, the method further includes:

[0123] S11. Pause the printer head at the current position, and identify the color of the printing material based on the image of at least a portion of the printing material contained in the first image;

[0124] S12. Based on the color of the printing material, turn on the light source component and select at least one light source color according to the preset light source setting rules;

[0125] S13. At the current location, a new first image is captured, and the previously captured first image is replaced with the currently captured first image.

[0126] In this embodiment, the light source color of the light source component is adjustable, for example, it can be white light, red light, or blue light. The preset light source setting rules are manually pre-set, and the light source color is selected according to the color of the printing material. For example, when capturing an image of black printing material, red light can be used because red light has a higher reflectivity to black objects. Selecting an appropriate light source color helps improve the contrast and clarity of the captured image, thereby improving printing accuracy. When identifying the image color of the printing material, the printer head needs to be paused, the light source adjusted, and a new first image taken at the current position is taken, replacing the previous first image used to identify the image color of the printing material. This improves the image contrast and clarity, which is beneficial for contour extraction, and improves contour matching accuracy and printing accuracy.

[0127] Reference Figure 6 The present invention also provides a computer device, which may be a server, and its internal structure may be as follows: Figure 6As shown, the computer device includes a processor, memory, display screen, input device, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores the data corresponding to this embodiment. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements the above-described method.

[0128] Those skilled in the art will understand that Figure 6 The structures shown are merely block diagrams of some structures related to the present invention and do not constitute a limitation on the computer devices on which the present invention is applied.

[0129] An embodiment of the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method. It is understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.

[0130] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the present invention and embodiments can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM, etc.

[0131] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, apparatus, article, or method. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.

[0132] The above description is only a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A printing method for a printer, characterized in that, Includes the following steps: Acquire a first image; wherein the first image is acquired by a visual positioning component at a preset frequency during the movement of the printer carriage along the first direction of the X-axis of the printing platform and is stored in a memory; the printer carriage includes a visual positioning component and a print head, the visual positioning component and the print head move synchronously along the first direction, and at least one printing material is placed on the printing platform; The feature of determining whether the first image contains at least a portion of the printing material; If so, a second image is obtained, which is synthesized from all the first images currently stored in the memory that contain at least some of the image features of the printing material; The second image is preprocessed to extract at least a portion of the image outline of the printing material; Perform contour matching of at least a portion of the image contours in a preset image library; Determine whether a matching image is contained in the preset image library; If so, obtain the print dot matrix data of the matched image and determine the print start position; When the print head moves along the first direction to the printing start position, the print head is controlled to start printing according to the print dot matrix data; Each preset image in the preset image library is provided with at least one preset feature point. The step of performing contour matching of the at least part of the image contours in the preset image library includes: Identify whether the at least part of the image contour contains the image contour of the determined matching image; If so, remove the image contour of the already determined matching image to obtain the image contour to be matched; Identify whether the contour of the image to be matched contains at least one contour feature point, wherein the contour feature point is the same contour portion as at least one preset feature point; If so, group all the contour feature points together, and group the contour feature points that are the same as the preset feature points of the same preset image together. The matching coefficient is obtained by weighting each contour feature point in each group according to the preset weights. The step of determining whether a matching image is present in the preset image library includes: Determine whether the matching coefficient exceeds a preset threshold; If so, it is determined that the preset image library contains a matching image, and the preset image corresponding to the group whose matching coefficient exceeds the preset threshold is taken as the matching image.

2. The printing method of the printer according to claim 1, characterized in that, The step of preprocessing the second image and extracting at least a portion of the image contour of the printing material includes: Convert the second image to a grayscale image; The grayscale image is denoised to obtain a denoised image; The gradient of the grayscale values ​​of the pixels in the denoised image is calculated to obtain a gradient magnitude map; Edge pixels are obtained from the gradient magnitude map, and the edge pixels are connected to form at least a portion of the image outline of the printing material.

3. The printing method of the printer according to claim 1, characterized in that, A grid array is set on the printing platform, and the step of determining the printing start position includes: The contour of the image to be matched is mapped onto the grid array to obtain the coordinate value array of the contour of the image to be matched on the grid array; From the coordinate value array, select the point that is closest to the print head in the first direction as the printing start point position.

4. The printing method of the printer according to claim 1, characterized in that, After the step of controlling the print head to start printing according to the print dot matrix data when the print head moves along the first direction to the print start position, the method further includes: Determine whether each of the printed materials has been printed completely; If so, the first image containing only a portion of the image outline of the printed material that has been printed is deleted from the memory.

5. The printing method of the printer according to claim 1, characterized in that, The printer includes a light source assembly, the color of which is adjustable, and the light source color includes at least two colors. The light source assembly is located above the printing platform. Before the step of acquiring the second image, the printer further includes: The printer carriage is paused at its current position, and the color of the printing material is identified based on at least a portion of the printing material contained in the first image; Based on the color of the printing material, the light source component is turned on, and at least one light source color is selected according to the preset light source setting rules; A new first image is captured at the current location, and the previously captured first image is replaced with the newly captured first image.

6. A printer, characterized in that, The printing method according to any one of claims 1-5 includes a printer carriage and a printing platform. The printer carriage is disposed above the printing platform and can reciprocate along the x-axis and y-axis of the printing platform. When the printer stops working, the printer carriage returns to a preset starting position on the printing platform. The printer carriage includes a housing, a controller, a vision positioning component, and a print head. The controller and the print head are disposed inside the housing. The print head is electrically connected to the controller and is disposed at the bottom of the housing facing the printing platform. The vision positioning component is disposed outside the printer carriage and is located on the side of the print head in the x-axis direction, farther from the preset starting position. The vision positioning component includes a camera component and a camera support mechanism. The camera support mechanism includes a support platform and a fixing component. The camera component is disposed above the support platform, and the support platform is mounted on the fixing component. The fixing component is fixedly connected to the printer carriage. The support platform is parallel to the printing platform. The camera component is electrically connected to the controller.

7. The printer according to claim 6, characterized in that, A sliding assembly is provided on the outer side of the housing sidewall. The fixing assembly includes a first fixing panel, a second fixing panel, and two oppositely arranged extension panels. The first fixing panel and the second fixing panel are opposite to each other. The first side of the first fixing panel is in close contact with the outer side of the housing. The two extension panels are spaced apart. One end of each extension panel is connected to the second side of the first fixing panel, and both extension panels are perpendicular to the second side of the first fixing panel. The second side of the first fixing panel is opposite to the first side of the first fixing panel. The other end of each extension panel is connected to the second fixing panel.

8. The printer as described in claim 7, characterized in that, It also includes a light source assembly. The extended panel includes an L-shaped extended base plate, which includes a first horizontal portion and a first vertical portion. The bottom surface of the first horizontal portion is located on the upper surface of the sliding assembly, and the first vertical portion is located on the outer side of the sliding assembly. The light source assembly is connected to the outer side of the first vertical portion and is located between the camera assembly and the printing platform.