Disclosure of Invention
The embodiment of the invention provides a method, a device, equipment, a medium and flat-panel printing equipment for splicing and printing character images of a plurality of PCBs (printed Circuit boards), which are used for solving the problem that in the prior art, only one board card can be printed at a time, and the printing efficiency is low.
In a first aspect, an embodiment of the present invention provides a method for splicing and printing character images on multiple PCB boards, where the method includes:
acquiring the position information of each PCB positioned on a printing platform relative to the printing platform;
performing data processing on the character printing file corresponding to each PCB according to the position information to obtain a corresponding character image to be printed;
arranging all the character images to be printed according to the position information to obtain spliced images;
and printing corresponding characters on each PCB according to the splicing image.
Preferably, the acquiring the position information of each PCB board on the printing platform relative to the printing platform comprises:
acquiring a positioning mark on each PCB:
controlling a CCD camera to shoot the positioning mark;
and carrying out image analysis on the positioning marks shot by the CCD camera to obtain the position information of each PCB relative to the printing platform.
Preferably, the obtaining of the corresponding character image to be printed by performing data processing on the character printing file corresponding to each PCB according to the position information includes:
acquiring the actual coordinate value of the positioning mark on each PCB according to the position information;
acquiring a reference coordinate value of the positioning mark on each PCB;
acquiring a rotation angle and/or a scaling coefficient of a printing file corresponding to each PCB according to the actual coordinate value and the reference coordinate value;
and carrying out data processing on the character printing file according to the rotation angle and/or the scaling coefficient to obtain a corresponding character image to be printed.
Preferably, the obtaining of the corresponding character image to be printed by performing data processing on the character printing file according to the rotation angle and/or the scaling factor includes:
establishing an affine transformation matrix according to the rotation angle and/or the scaling coefficient;
performing data processing on the printing file according to the affine transformation matrix;
wherein the affine transformation matrix is:
{cos(θ)*α,sin(θ),0,-sin(θ),cos(θ)*β,0}
where θ is a rotation angle, α is a scaling factor of the coordinate data in the print file in the X direction, and β is a scaling factor of the coordinate data in the print file in the Y direction.
Preferably, the arranging all the character images to be printed according to the position information to obtain a stitched image includes:
acquiring the minimum circumscribed rectangle for arranging all the character images to be printed according to the position information
Obtaining a canvas with the same size as the minimum circumscribed rectangle;
and splicing all the character images to be printed on the canvas according to the position information in a preset sequence to obtain a spliced image.
Preferably, the printing of the corresponding character on each PCB board according to the stitched image comprises:
performing rasterization data processing on the spliced image to obtain printing data;
and printing corresponding characters on each PCB according to the printing data.
In a second aspect, an embodiment of the present invention provides a device for splicing and printing character images on multiple PCB boards, where the device includes:
the position information acquisition module is used for acquiring the position information of each PCB positioned on the printing platform relative to the printing platform;
the character image to be printed acquisition module is used for carrying out data processing on the character printing file corresponding to each PCB according to the position information to obtain a corresponding character image to be printed;
the spliced image acquisition module is used for arranging all the character images to be printed according to the position information to obtain spliced images;
and the printing module is used for printing corresponding characters on each PCB according to the splicing image.
In a third aspect, an embodiment of the present invention provides a multi-PCB character image stitching and printing apparatus, including: at least one processor, at least one memory, and computer program instructions stored in the memory, which when executed by the processor, implement the method of the first aspect of the embodiments described above.
In a fourth aspect, embodiments of the present invention provide a storage medium having stored thereon computer program instructions, which when executed by a processor, implement the method of the first aspect in the above embodiments.
In a fifth aspect, an embodiment of the present invention provides a flat panel printing apparatus, including: the printing device is respectively connected with the spray head and the shooting device and used for controlling the spray head to perform ink-jet printing on the plurality of PCB boards according to the position information of the plurality of PCB boards acquired by the shooting device on the printing platform, wherein the printing device is the PCB board printing control device in the second aspect of the above embodiment.
In summary, the method, the device, the equipment, the medium and the flat-panel printing equipment for splicing and printing the character images of the multiple PCBs provided by the embodiments of the present invention. Firstly, the method adjusts the character printing file corresponding to each PCB by acquiring the position information of each PCB on a printing platform, so that the character image to be printed on each PCB is matched with the size, the gradient and the position of the PCB, and the printing accuracy of the character image on the PCB is ensured; secondly, adjusting each character printing file according to the position information, and then splicing the character images to be printed obtained by adjustment into a large spliced image according to the position information, wherein splicing according to the position information ensures that the position of each character image to be printed in the spliced image corresponds to the positions of the corresponding PCB boards in all the PCB boards; finally, printing is carried out according to the spliced images, so that each character image to be printed can be accurately printed on the corresponding PCB; meanwhile, the character file to be printed is adjusted according to the position information to be matched with the PCB, so that the PCB is positioned more flexibly, the operation difficulty of positioning a plurality of PCBs is reduced, the positioning time is saved, the PCBs of the same specification or different specifications and sizes can be printed simultaneously, and the printing flexibility and the printing efficiency are improved.
Detailed Description
Features and exemplary embodiments of various aspects of the present invention will be described in detail below, and in order to make objects, technical solutions and advantages of the present invention more apparent, the present 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 of the invention and are not to be construed as limiting the invention. It will be apparent to one skilled in the art that the present invention may be practiced without some of these specific details. The following description of the embodiments is merely intended to provide a better understanding of the present invention by illustrating examples of the present invention.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Referring to fig. 1, an embodiment of the present invention provides a method for printing characters on PCB boards by splicing, where the method only needs to position a plurality of PCB boards on a printing platform once, and print a plurality of PCB boards once after positioning is completed, so as to save positioning time in a PCB printing process and improve printing efficiency, and after positioning is completed, a character printing file is rotated and/or zoomed according to a position of each PCB board, so as to ensure accuracy of character printing, reduce operation difficulty of placing a plurality of PCB boards, save accurate placing time, and make PCB boards more flexible to place. The method for splicing and printing the character images of the multiple PCBs specifically comprises the following steps:
s1, acquiring the position information of each PCB positioned on the printing platform relative to the printing platform;
the position information is coordinate information of a positioning Mark on each PCB, namely coordinate information of each Mark point (Mark point) relative to the printing platform, all coordinate systems are planar coordinate systems constructed on the basis of the printing platform, and a coordinate origin can be set according to requirements, for example, a geometric center of the surface of the printing platform is selected as the coordinate origin, or an initial printing position on the printing platform is selected as the coordinate origin, which can be determined according to actual printing requirements and calculation requirements. In order to accurately position the positions of the PCBs, at least 3 Mark points are arranged on each PCB, and the shape of all the Mark points on each PCB may be completely the same or not completely the same, as shown in fig. 2, all the Mark points on one PCB may be completely the same circle, airplane pattern, or the like, or a combination of incompletely the same circle, triangle, cross, or the like as the Mark points.
Referring to fig. 3, the step of obtaining Mark point coordinate information on each PCB specifically includes:
s11, acquiring a positioning mark on each PCB:
s12, controlling a CCD (charge coupled device) camera to shoot the positioning mark;
s13, carrying out image analysis on the positioning marks shot by the CCD camera to obtain the position information of each PCB relative to the printing platform.
Specifically, the shape of a Mark point on each PCB is obtained from a printed file of the PCB, the CCD camera is controlled to move after the shape of the Mark point is obtained, then the Mark point is found out and shot on a PCB by PCB, the position of the CCD is recorded in real time in the CCD moving and shooting process (the position of the CCD in the printing platform can be determined according to the moving distance of the CCD), the coordinate of the Mark point can be determined according to the shot Mark point image and the shooting visual angle analysis image of the CCD camera equipment, the position of the PCB can be positioned according to the Mark point coordinate), and simultaneously, the image analysis is carried out on the shot positioning Mark of each PCB after all the Mark points are shot, the real-time recorded CCD position is combined, and the coordinate position of each Mark point on each PCB is determined, so that the position information of each PCB relative to the printing platform is obtained. The print file of the PCB is a Gerber file corresponding to each PCB, and the Gerber file is a two-dimensional vector image file format, which is a standard format used for describing PCB images in printed circuit board industry software, such as: the method comprises the steps of obtaining a circuit layer, a solder resist layer, a character layer, a drilling layer and the like, but a digital printer cannot identify a two-dimensional vector image file format and can only identify a bitmap file format of a dot matrix, so that a Gerber file of a vector needs to be analyzed and converted into the bitmap file format of the dot matrix before printing, the content in the printed file is read line by calling a section of program code, the printed file is analyzed character by character according to a fixed format, image data can be obtained, the data obtained through analysis is drawn in an image file, and coordinate data of each image can be obtained in the image file. Meanwhile, in the embodiment, before the Mark point is shot, the shooting tool CCD camera is also calibrated, and because the installation heights of the shooting tools on different printing devices are different, the actual sizes represented by the unit pixels of the CCD camera are also different, so that the shooting tool needs to be calibrated in advance to ensure the accuracy of image printing.
S2, performing data processing on the character printing file corresponding to each PCB according to the position information to obtain a corresponding character image to be printed;
specifically, the print file subjected to file format analysis is rotated and scaled according to the Mark point coordinate position on each PCB, so that a character image to be printed matched with the PCB is obtained.
Referring to fig. 4, the step S2 specifically includes the following steps:
s21, acquiring the actual coordinate value of the positioning mark on each PCB according to the position information; the actual coordinate value is determined based on the planar coordinate system.
S22, acquiring the reference coordinate value of the positioning mark on each PCB; the reference coordinate value is also determined based on the planar coordinate system.
S23, acquiring the rotation angle and/or the scaling coefficient of the printed file corresponding to each PCB according to the actual coordinate value and the reference coordinate value;
and S24, performing data processing on the print file according to the rotation angle and/or the scaling coefficient to obtain a corresponding character image to be printed.
Specifically, the actual coordinate values of all Mark points on each PCB are obtained according to the coordinate information of all Mark points on each PCB, which is obtained by the CCD camera through shooting, and the reference coordinate values of all Mark points on each PCB are obtained from the parsed print file at the same time, the rotation angle and the zoom factor are obtained through calculation according to the actual coordinate values and the reference coordinate values of the Mark points, and the image in the parsed print file is rotated and zoomed according to the rotation angle and the zoom factor to obtain the image of the character to be printed, which is matched with the PCB, so that the accurate printing of the PCB with any placement position and any size can be realized, such as oblique placement, inverted placement and the like in fig. 5. The scaling and rotation of the character file to be printed are all performed by taking the geometric center of the image as the scaling and rotation center, one operation can be selected to be preferential when the two exist simultaneously, and any operation sequence cannot influence the final result. Meanwhile, when the reference coordinate value is printed for the first time, the printing trolley is manually moved to the printing platform and then is obtained by shooting a positioning point on the board card through a CCD camera arranged beside the spray head, and the position of the printing trolley is continuously adjusted during shooting so that the positioning point is positioned in the center of the FOV (field of view) of the CCD camera, so that the identification precision during automatic printing is improved, and the production efficiency is improved; meanwhile, when the positioning points are shot, not only the reference coordinate values of the positioning points need to be calculated and stored, but also the shape profiles of the positioning points need to be stored, so that preparation is made for automatically searching the positioning points for subsequent matching and calibration.
Wherein the rotation angle is obtained by the following method: the Mark points at least comprise 3 points, two Mark points are arbitrarily selected as calibration points, and the reference coordinate values of the arbitrary two calibration points are respectively set as (x)a1,ya1) And (x)a2,ya2) The first offset value is TA:
When there are many Mark points, the Mark points may be grouped to obtain a plurality of first offset values TAThen, the average value of the plurality of first offset values is obtained, so that the obtained offset value is more accurate.
Setting the actual coordinate values of any two calibration points as (x)b1,yb1) And (x)b2,yb2) The second offset value is TB:
When there are more Mark points, similarly, a plurality of second offset values T may be obtained by grouping the anchor pointsAAnd then averaging the plurality of second offset values, so that the calculated offset values are more accurate.
The rotation angle T is the difference between the first offset value and the second offset value, that is:
T=TA-TB
the scaling factor is obtained by the following method:
selecting any two Mark points on a PCB, calculating to obtain the actual distances of the two Mark points in the X direction and the Y direction according to the obtained actual coordinate values of the two Mark points, calculating to obtain the reference distances of the two Mark points in the X direction and the Y direction according to the reference coordinate values of the two Mark points,
the image X-direction scaling factor S in the parsed print fileXComprises the following steps:
SX=DX/dX
wherein D isXIs the actual distance of two Mark points in the X direction, dXThe reference distance of the two Mark points in the X direction is obtained;
image Y-direction scaling factor S in parsed print fileY:
SY=DY/dY
Wherein D isYIs the actual distance of two Mark points in the Y direction, dYIs the distance of two Mark points in the Y direction.
Referring to fig. 6, the step S24 specifically includes the following steps:
s241, establishing an affine transformation matrix according to the rotation angle and/or the scaling coefficient;
s242, carrying out data processing on the character printing file according to the affine transformation matrix;
wherein the affine transformation matrix is:
{cos(θ)*α,sin(θ),0,-sin(θ),cos(θ)*β,0}
in the above formula, θ is a rotation angle, α is a scaling factor of the coordinate data in the print file in the X direction, and β is a scaling factor of the coordinate data in the print file in the Y direction.
Setting original coordinate data of any image as (X, Y), and setting new coordinates of the image processed by the affine transformation matrix as (X ', Y');
wherein X ═ cos (θ) × α × + sin (θ) × Y;
Y`=-sin(θ)*X+cos(θ)*β。
in this embodiment, the character print file can be rapidly rotated and scaled in the process of converting the analyzed print file into the bitmap which can be printed by the printer, so that the characters can be accurately printed at the accurate position of the board card, and the character printing precision is improved.
S3, arranging all the character images to be printed according to the position information to obtain a spliced image;
specifically, the position of each PCB relative to the printing platform is located according to the actual coordinates of all Mark points on the PCB, then all canvases for arranging the character images to be printed are obtained according to the position of each PCB relative to the printing platform, and finally all the character images to be printed are arranged on the canvases according to the position of each PCB relative to the printing platform.
Referring to fig. 7, the specific method for acquiring the stitched image includes the following steps:
s31, acquiring the minimum circumscribed rectangle for arranging all the character images to be printed according to the position information;
s32, obtaining a canvas with the same size as the minimum circumscribed rectangle;
and S33, splicing all the character images to be printed on the canvas according to the position information in a preset sequence to obtain a spliced image.
Specifically, in this embodiment, the minimum circumscribed rectangle for arranging all the character images to be printed is obtained, the canvas with the same size as the minimum circumscribed rectangle is obtained in the image processing software, and all the character images to be printed are arranged on the canvas in the image processing software at a time according to the sequence of the position information, so as to be spliced into a large spliced image. The minimum external rectangle is adopted, so that the data processing time of the spliced image is saved, and the data processing efficiency is improved.
And S4, printing corresponding characters on each PCB according to the spliced images.
Specifically, the image processing software performs rasterization processing on the spliced image into a printing data file according to the printing requirement and the characteristic parameters of the printing equipment, ink-jet printing is directly performed according to the printing data during printing, and the printing of a plurality of PCB boards is completed at one time.
Referring to fig. 8, an embodiment of the present invention provides a device for splicing and printing character images on multiple PCBs, where the device includes:
the system comprises a position information acquisition module 10, a position information acquisition module and a printing platform control module, wherein the position information acquisition module is used for acquiring the position information of each PCB positioned on the printing platform relative to the printing platform;
a to-be-printed character image obtaining module 20, configured to perform data processing on the character print file corresponding to each PCB according to the position information to obtain a corresponding to-be-printed character image;
the stitched image obtaining module 30 is configured to arrange all the character images to be printed according to the position information to obtain a stitched image;
and the printing module 40 is used for printing corresponding characters on each PCB according to the splicing image.
Preferably, the location information acquiring module 10 includes:
a positioning mark obtaining unit, configured to obtain a positioning mark on each PCB:
the shooting unit is used for controlling the CCD camera to shoot the positioning mark;
and the position information acquisition unit is used for carrying out image analysis on the positioning marks shot by the CCD camera to obtain the position information of each PCB relative to the printing platform.
Preferably, the character image to be printed acquiring module 20 includes:
the actual coordinate acquisition unit is used for acquiring the actual coordinate value of the positioning mark on each PCB according to the position information;
a reference coordinate value obtaining unit for obtaining a reference coordinate value of the positioning mark on each of the PCBs;
the correction parameter acquisition unit is used for acquiring the rotation angle and/or the scaling coefficient of the printing file corresponding to each PCB according to the actual coordinate value and the reference coordinate value;
and the character image to be printed acquiring unit is used for carrying out data processing on the character printing file according to the rotation angle and/or the scaling coefficient to obtain a corresponding character image to be printed.
Preferably, the data processing of the character printing file by the rotation angle and/or the scaling factor to obtain a corresponding character image to be printed includes:
establishing an affine transformation matrix according to the rotation angle and/or the scaling coefficient;
performing data processing on the character printing file according to the affine transformation matrix;
wherein the affine transformation matrix is:
{cos(θ)*α,sin(θ),0,-sin(θ),cos(θ)*β,0}
wherein θ is a rotation angle, α is a scaling factor of the coordinate data in the character print file in the X direction, and β is a scaling factor of the coordinate data in the character print file in the Y direction.
Preferably, the stitched image acquisition module 30 includes:
the external image acquisition unit is used for acquiring the minimum external rectangle for arranging all the character images to be printed according to the position information;
the canvas acquisition unit is used for acquiring a canvas with the same size as the minimum circumscribed rectangle;
and the spliced image acquisition unit is used for splicing all the character images to be printed on the canvas in a preset sequence according to the position information to obtain a spliced image.
Preferably, the printing module 40 includes:
the printing data acquisition unit is used for carrying out rasterization data processing on the spliced image to obtain printing data;
and the printing unit is used for printing corresponding characters on each PCB according to the printing data.
An embodiment of the present invention further provides a flat panel printing apparatus, including: shower nozzle, print platform, printing device, camera device, printing device respectively with the shower nozzle the shooting device is connected for the basis is followed polylith PCB board that the shooting device acquireed is in place positional information control on the print platform the shower nozzle carries out the inkjet and prints on polylith PCB board, wherein, printing device is figure 8 polylith PCB board character image concatenation printing device.
In addition, the method for splicing and printing the character images of the multiple PCBs according to the embodiment of the present invention described with reference to fig. 1 may be implemented by a device for splicing and printing the character images of the multiple PCBs. Fig. 9 is a schematic diagram illustrating a hardware structure of a multi-PCB character image stitching printing device according to an embodiment of the present invention.
The multi-block PCB board character image stitching printing device may include a processor 401 and a memory 402 storing computer program instructions.
Specifically, the processor 401 may include a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or may be configured as one or more Integrated circuits implementing embodiments of the present invention.
Memory 402 may include mass storage for data or instructions. By way of example, and not limitation, memory 402 may include a Hard Disk Drive (HDD), floppy Disk Drive, flash memory, optical Disk, magneto-optical Disk, tape, or Universal Serial Bus (USB) Drive or a combination of two or more of these. Memory 402 may include removable or non-removable (or fixed) media, where appropriate. The memory 402 may be internal or external to the data processing apparatus, where appropriate. In a particular embodiment, the memory 402 is a non-volatile solid-state memory. In a particular embodiment, the memory 402 includes Read Only Memory (ROM). Where appropriate, the ROM may be mask-programmed ROM, Programmable ROM (PROM), Erasable PROM (EPROM), Electrically Erasable PROM (EEPROM), electrically rewritable ROM (EAROM), or flash memory or a combination of two or more of these.
The processor 401 reads and executes the computer program instructions stored in the memory 402 to implement any one of the multi-block PCB character image stitching and printing methods in the above embodiments.
In one example, the multi-PCB board character image stitching printing device may also include a communication interface 403 and a bus 410. As shown in fig. 9, the processor 401, the memory 402, and the communication interface 403 are connected via a bus 410 to complete communication therebetween.
The communication interface 403 is mainly used for implementing communication between modules, apparatuses, units and/or devices in the embodiments of the present invention.
Bus 410 includes hardware, software, or both that couple the components of a multi-block PCB board character image stitching printing device to one another. By way of example, and not limitation, a bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hypertransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an infiniband interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a video electronics standards association local (VLB) bus, or other suitable bus or a combination of two or more of these. Bus 410 may include one or more buses, where appropriate. Although specific buses have been described and shown in the embodiments of the invention, any suitable buses or interconnects are contemplated by the invention.
In addition, in combination with the method for splicing and printing the character images of the multiple PCBs in the above embodiment, an embodiment of the present invention may provide a computer-readable storage medium to implement the method. The computer readable storage medium having stored thereon computer program instructions; when executed by a processor, the computer program instructions implement any one of the methods for splicing and printing character images on the PCB board.
In summary, the method, the device, the equipment, the medium and the flat-panel printing equipment for splicing and printing the character images of the multiple PCBs provided by the embodiments of the present invention. Firstly, the method adjusts the character printing file corresponding to each PCB by acquiring the position information of each PCB on a printing platform, so that the character image to be printed on each PCB is matched with the size, the gradient and the position of the PCB, and the printing accuracy of the character image on the PCB is ensured; secondly, adjusting each character printing file according to the position information, and then splicing the character images to be printed obtained by adjustment into a large spliced image according to the position information, wherein splicing according to the position information ensures that the position of each character image to be printed in the spliced image corresponds to the positions of the corresponding PCB boards in all the PCB boards; finally, printing is carried out according to the spliced images, so that each character image to be printed can be accurately printed on the corresponding PCB; meanwhile, the character file to be printed is adjusted according to the position information to be matched with the PCB, so that the PCB is positioned more flexibly, the operation difficulty of positioning a plurality of PCBs is reduced, the positioning time is saved, the PCBs of the same specification or different specifications and sizes can be printed simultaneously, and the printing flexibility and the printing efficiency are improved.
It is to be understood that the invention is not limited to the specific arrangements and instrumentality described above and shown in the drawings. A detailed description of known methods is omitted herein for the sake of brevity. In the above embodiments, several specific steps are described and shown as examples. However, the method processes of the present invention are not limited to the specific steps described and illustrated, and those skilled in the art can make various changes, modifications and additions or change the order between the steps after comprehending the spirit of the present invention.
As described above, only the specific embodiments of the present invention are provided, and it can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the system, the module and the unit described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. It should be understood that the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the present invention, and these modifications or substitutions should be covered within the scope of the present invention.