CN112884656B - Printing and imposition method and system for packing box plane expansion diagram image - Google Patents
Printing and imposition method and system for packing box plane expansion diagram image Download PDFInfo
- Publication number
- CN112884656B CN112884656B CN202110407809.6A CN202110407809A CN112884656B CN 112884656 B CN112884656 B CN 112884656B CN 202110407809 A CN202110407809 A CN 202110407809A CN 112884656 B CN112884656 B CN 112884656B
- Authority
- CN
- China
- Prior art keywords
- imposition
- target
- chromosome
- image
- graph
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/103—Formatting, i.e. changing of presentation of documents
- G06F40/109—Font handling; Temporal or kinetic typography
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/12—Computing arrangements based on biological models using genetic models
- G06N3/126—Evolutionary algorithms, e.g. genetic algorithms or genetic programming
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Health & Medical Sciences (AREA)
- Theoretical Computer Science (AREA)
- Biophysics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Computational Linguistics (AREA)
- General Physics & Mathematics (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Evolutionary Biology (AREA)
- Artificial Intelligence (AREA)
- General Engineering & Computer Science (AREA)
- Bioinformatics & Computational Biology (AREA)
- General Health & Medical Sciences (AREA)
- Evolutionary Computation (AREA)
- Data Mining & Analysis (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Biomedical Technology (AREA)
- Genetics & Genomics (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Physiology (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Editing Of Facsimile Originals (AREA)
Abstract
The invention provides a printing and imposition method and a system for a packing box plane development diagram image, which are based on a pre-established outer contour diagram library of a packing box plane development diagram and can execute the following steps: selecting an outer contour graph of a packing box plane expansion diagram image required to be designed in each customer order to be printed and impossed from the outer contour graph library; amplifying each selected outline graph to obtain the corresponding graph to be imposition; performing graphic makeup on all the graphs to be subjected to makeup based on a critical polygon algorithm and a genetic algorithm to obtain target graphic makeup; inputting a packing box plane expansion image in each designed customer order to be printed and impossed; and pasting the planar development image of each packing box to be impossed to the corresponding position on the target graphic imposition to obtain the printing imposition. The method is used for realizing printing imposition optimization of the image of the plane development drawing of the packing box.
Description
Technical Field
The invention relates to the field of computer printing, in particular to a printing and imposition method and a system for a packing box plane expansion diagram image, which are mainly used for printing and imposition of the packing box plane expansion diagram image.
Background
In the printing workshop, the mode of combining and making up is often adopted to make up the packing carton plane expansion drawing image to make full use of paper, reduce cost saves the resource, brings more profits for the enterprise, can also protect the environment simultaneously.
At present, during actual production, a company designer often designs a packing box plane development image according to a client requirement and submits the designed packing box plane development image to an imposition engineer, and then the imposition engineer performs imposition on a canvas with a given size in a manual mode on the packing box plane development image needing to be subjected to imposition. Firstly, a company designer designs a packing box plane expansion diagram image, and then a makeup engineer performs makeup splicing on the packing box plane expansion diagram image which needs makeup splicing, which belongs to single-thread operation and influences the production efficiency. Moreover, the manual mode is used for splicing and makeup, so that the makeup speed is relatively low, and mistakes are easy to make.
In addition, in the current era of the advanced development of the internet, the order quantity of the plane development image of the packaging box is larger and larger, the quantity of the plane development image of the packaging box corresponding to the combination and the imposition of each time is larger and larger, the imposition combination modes are more and more, and the manual way is continuously adopted for the combination and the imposition, so that the mental fatigue of imposition personnel is easily caused, the imposition speed is influenced, the production efficiency is restricted, errors are more easily caused, and a better imposition combination is difficult to be quickly found out from numerous imposition combinations.
Disclosure of Invention
Aiming at the defects in the prior art, the invention provides a printing and imposition method and a system for a plane development figure image of a packing box, which are used for solving the technical problems and realizing the printing and imposition optimization of the plane development figure image of the packing box.
In a first aspect, the present invention provides a printing and imposition method for a packing box planar expansion diagram image, the printing and imposition method based on a pre-established outline graphic library of the packing box planar expansion diagram, comprising the steps of:
q1: selecting an outer contour graph of a packing box plane expansion diagram image required to be designed in each customer order to be printed and impossed from the outer contour graph library;
q2: amplifying each selected outline graph to obtain the corresponding graph to be imposition; the size of each graph to be impossed is equal to the size of the packing box plane expansion graph image required to be designed in the corresponding customer order after bleeding with preset width is added;
q3: performing graphic makeup on all the graphs to be subjected to makeup based on a critical polygon algorithm and a genetic algorithm to obtain target graphic makeup;
q4: inputting a packing box plane expansion image in each designed customer order to be printed and impossed;
q5: pasting each packing box plane expansion image to be imposition to a corresponding position on a target graphic imposition to obtain a printing imposition; and the packing box plane development image to be impossed is the input designed packing box plane development image.
Further, step Q3 includes:
step Q31, P ═ PtI t 1,2, …, m is the set of the numbers of all the patterns to be imposition obtained in the step Q2, and the obtained numbers of all the patterns to be imposition are used for constructing an initial generation population POP1 ═ { CHR [i1,2, …, n }, wherein: CHRiIs the ith chromosome in the primary population, n is the total number of chromosomes in the primary population, ptFor the number of the t-th graphic to be imposition obtained in step Q2, each chromosome CHRiThe number of genes in the set is equal to the set P ═ PtThe number of elements in 1,2, …, m is equal; chromosome CHRiEach gene in (a) is represented by the set P ═ { P ═ PtOne element of 1,2, …, m and a randomly generated figure rotation angle corresponding to the element; chromosome CHRiEach gene in (1) corresponds to P ═ Pt1, | t ═ 1,2, …, m }; chromosome CHRiThe gene sequence on the gene sequence corresponds to the makeup sequence of each pattern to be made up participating in makeup; chromosome CHRiThe rotation angle of the graph in each gene is the rotation angle of the graph to be imposred corresponding to the number in each gene during imposition;
step Q32: according to each chromosome in the current latest generation population, all the patterns to be imposred are imposed according to the imposition sequence and the pattern rotation angle of the patterns to be imposed described by the chromosome, so as to obtain the pattern imposition corresponding to each chromosome in the current latest generation population;
step Q33, calculating the fitness of each chromosome in the current latest generation population, wherein the calculation expression of the fitness is 1 x (k)i-1)+Si(ii)/S, wherein: s is the area of the imposition area, k, on a single imposition canvasiRepresenting the total number, k, of all the graphic impositions obtained by imposition of all the graphics to be imposed according to the ith chromosome in the current latest generation populationiK is not less than 1i∈N;SiRepresenting the area of the minimum circumscribed rectangle of all the patterns to be imposred on the final pattern imposition obtained by imposition of all the patterns to be imposed according to the ith chromosome in the current latest generation population, wherein i is 1,2, …, n;
step Q34, selecting the chromosome with the minimum fitness in the current latest generation population to obtain and store a target chromosome;
step Q35, constructing a next generation population by using the current latest generation population, and then turning to step Q32 to continue execution until iteration is finished; wherein the next generation population comprises chromosomes with the minimum fitness in the current latest generation population;
step Q36, after the iteration is finished, selecting the target chromosome with the minimum fitness from the stored target chromosomes to obtain the optimal chromosome;
and step Q37, obtaining all the graphic impositions corresponding to the current latest optimal chromosome, and collecting to form the target graphic imposition.
Further, the implementation method of the step Q2 is as follows: for each selected outline graph, the following steps are respectively executed:
acquiring the length L and the width W of the minimum circumscribed rectangle of the target outline graph; the target outer contour graph is the currently selected outer contour graph;
amplifying the target outer contour graph by (2r + L)/L times along the length direction of the minimum external rectangle of the target outer contour graph, and amplifying the target outer contour graph by (2r + W)/W times along the width direction of the minimum external rectangle of the target outer contour graph to finally obtain a graph to be imposition corresponding to the target outer contour graph;
wherein r is a preset width threshold of the image bleeding part.
Further, the implementation method of the step Q5 is as follows:
traversing the plane development image of each corresponding packing box to be impossed according to the imposition sequence of the graph to be imposed described by the optimal chromosome;
respectively executing the following steps to each traversed packing box plane expansion image to be impossed:
adding an image bleeding part in the peripheral circumference direction of the target image to be imposition; the target image to be imposition is a planar development image of the packaging box to be imposition traversed currently;
acquiring a minimum external rectangular frame of the image bleeding part, and recording the minimum external rectangular frame as a first rectangular frame;
acquiring a minimum circumscribed rectangle of a target image to be imposition, and recording the minimum circumscribed rectangle as a target circumscribed rectangle;
acquiring the relative position relation between the target circumscribed rectangle and the first rectangular frame;
acquiring a graph rotation angle of the graph to be imposition corresponding to the target image to be imposition from the optimal chromosome, and recording the graph rotation angle as a target rotation angle;
rotating the target image to be imposition according to the target rotation angle to obtain a rotated image to be imposition;
on the target graphic imposition, acquiring a minimum external rectangular frame of a graphic to be imposed, which corresponds to a target image to be imposed, and marking the minimum external rectangular frame as a target rectangular frame;
and correspondingly pasting the rotated image to be imposition onto the target rectangular frame according to the relative position relation.
Further, the implementation method of the step Q32 is as follows:
traversing each chromosome in the current latest generation population, and respectively executing the following steps for each traversed chromosome:
q321, correspondingly rotating each pattern to be imposred according to the pattern rotation angle of each pattern to be imposed described by the currently traversed chromosome to obtain the rotated patterns of each pattern to be imposed, and recording the rotated patterns as imposition rotation patterns;
q322, obtaining and storing a critical polygon NFP between every two obtained imposition rotation graphs;
q323, obtaining and storing the internal critical polygon of each obtained makeup rotating graph in the makeup area of the makeup canvas relative to the boundary graph of the makeup area;
q324, typesetting the first imposition rotation graph to be typeset to the lower left corner of the pre-built imposition area of an imposition canvas according to the corresponding internal critical polygon of the first imposition rotation graph according to the imposition sequence of the graph to be imposed described by the currently traversed chromosome;
q325, reading the imposition rotation graph of the next imposition to be imposed, and: extracting the internal critical polygon corresponding to the read imposition rotation graph from the stored internal critical polygons, and recording the internal critical polygon as a target internal critical polygon; extracting the read critical polygons NFP of the imposition rotation graphics relative to each imposition rotation graphics already typeset in the imposition area of the current imposition canvas from the stored critical polygons NFP and solving a union set, wherein the union set is marked as a target union set; then acquiring the intersection of the target internal critical polygon and the target union set; then, go to step Q326;
q326, judging whether the intersection set obtained in the step Q325 is empty: if not, continue to execute step Q327; if so, marking the corresponding imposition rotation graph and the imposition sequencing position where the corresponding imposition rotation graph is located, and continuing to execute the step Q325 until all the imposition rotation graphs to be typeset are read, then newly building another imposition canvas, rearranging the marked imposition rotation graphs according to the imposition sequence of the graphs to be imposed described by the currently traversed chromosome to obtain a new imposition rotation graph sequence, then typesetting the first imposition rotation graph in the imposition rotation graph sequence to the lower left corner of the imposition area of the newly built imposition canvas according to the corresponding internal critical polygon of the first imposition rotation graph according to the new imposition rotation graph sequence, and then continuing to execute the step Q325;
the intersection obtained in the step Q327 and the step Q325 is the boundary of the area for placing the imposition rotation figure to be imposed next, and the area surrounded by the boundary is marked as a target placeable area; then step Q328 is performed;
and step Q328, preferentially typesetting the next imposition rotation graph to be typeset to the lower part and the left side of the inner part of the target placeable area, and then turning to the step Q325 to continue executing until all the imposition rotation graphs are typeset on the imposition canvas.
Further, the printing imposition method also comprises the following steps:
a button for stopping the continuous graphic imposition of the graphic to be imposed is arranged;
establishing a hyperlink for each obtained target chromosome in real time; when the established hyperlink is clicked, correspondingly displaying the graphic imposition corresponding to the clicked hyperlink;
a graphic imposition selection unit for a user to manually select an optimal chromosome is provided;
after the user selects the optimal chromosome through the graphic imposition selection unit, automatically executing a step Q37;
the printing imposition method also comprises the following steps:
and performing makeup optimization adjustment on the target graphic makeup obtained based on the optimal chromosome selected by the graphic makeup selection unit in a manual mode.
In a second aspect, the present invention provides a printing imposition system for a packing box plane expansion diagram image, the printing imposition system based on a pre-established outline graphic library of a packing box plane expansion diagram, specifically comprising:
the figure reading unit is used for selecting an outer contour figure of a packing box plane expansion diagram image required to be designed in each customer order to be printed and impossed from the outer contour figure library;
the figure preprocessing unit is used for amplifying each selected outline figure to obtain the corresponding figure to be imposition; the size of each graph to be impossed is equal to the size of the packing box plane expansion graph image required to be designed in the corresponding customer order after bleeding with preset width is added;
the graphic imposition unit is used for performing graphic imposition on all the graphics to be imposed based on a critical polygon algorithm and a genetic algorithm to obtain target graphic imposition;
the image input unit is used for inputting the designed packing box plane expansion image in each customer order to be printed and imposition;
the mapping unit is used for mapping each packing box plane expansion image to be subjected to makeup to a corresponding position on a target graphic makeup to obtain a printing makeup; and the packing box plane development image to be impossed is the input designed packing box plane development image.
Further, the graphic imposition unit includes:
a first module for noting P ═ Pt1,2, …, m is the collection of the serial numbers of all the patterns to be imposition obtained by the pattern preprocessing unit, and the obtained serial numbers of all the patterns to be imposition are used for constructing an initial generation population POP1 ═ { CHR {i1,2, …, n }, wherein: CHRiIs the ith chromosome in the primary population, n is the total number of chromosomes in the primary population, ptFor the number of the t-th graphic to be imposition obtained by the graphic preprocessing unit, each chromosome CHRiThe number of genes in the set is equal to the set P ═ PtThe number of elements in 1,2, …, m is equal; chromosome CHRiEach gene in (a) is represented by the set P ═ { P ═ PtOne element of 1,2, …, m and a randomly generated figure rotation angle corresponding to the element; chromosome CHRiEach gene in (1) corresponds to P ═ Pt1, | t ═ 1,2, …, m }; chromosome CHRiThe gene sequence on the gene sequence corresponds to the makeup sequence of each pattern to be made up participating in makeup; chromosome CHRiThe rotation angle of the graph in each gene is the rotation angle of the graph to be imposred corresponding to the number in each gene during imposition;
the second module is used for splicing all the patterns to be spliced according to each chromosome in the current latest generation of population and the splicing sequence and the pattern rotation angle of the patterns to be spliced described by the chromosomes respectively to obtain the pattern splicing corresponding to each chromosome in the current latest generation of population;
a third module, configured to calculate a fitness of each chromosome in the current latest generation population, where a calculation expression of the fitness is 1 × (k)i-1)+Si(ii)/S, wherein: s is the area of the imposition area, k, on a single imposition canvasiRepresenting the total number, k, of all the graphic impositions obtained by imposition of all the graphics to be imposed according to the ith chromosome in the current latest generation populationiK is not less than 1i∈N;SiRepresenting the area of the minimum circumscribed rectangle of all the patterns to be imposred on the final pattern imposition obtained by imposition of all the patterns to be imposed according to the ith chromosome in the current latest generation population, wherein i is 1,2, …, n;
the fourth module is used for selecting the chromosome with the minimum fitness in the current latest generation population to obtain and store a target chromosome;
a fifth module, configured to construct a next-generation population using the current latest-generation population, and then call the second module until iteration is completed; wherein the next generation population comprises chromosomes with the minimum fitness in the current latest generation population;
the sixth module is used for selecting the target chromosome with the minimum fitness from the stored target chromosomes to obtain the optimal chromosome after the iteration is finished;
and the seventh module is used for acquiring all the graphic impositions corresponding to the current latest optimal chromosome and collecting to form the target graphic imposition.
Further, the mapping unit includes:
the traversing module is used for traversing the plane development image of each corresponding packing box to be impossed according to the imposition sequence of the graph to be imposed described by the optimal chromosome;
the decision module is used for calling the following images of the planar development graph of each traversed packing box to be impossed respectively:
an eighth module for adding an image bleeding part in a peripheral circumferential direction of the target image to be imposition; the target image to be imposition is a planar development image of the packaging box to be imposition traversed currently;
a ninth module, configured to obtain a minimum circumscribed rectangular frame of the bleeding part of the image, and record the minimum circumscribed rectangular frame as a first rectangular frame;
the tenth module is used for acquiring the minimum circumscribed rectangle of the target image to be imposted and recording the minimum circumscribed rectangle as a target circumscribed rectangle;
the eleventh module is used for acquiring the relative position relation between the target circumscribed rectangle and the first rectangular frame;
a twelfth module, configured to obtain, from the optimal chromosome, a figure rotation angle of the to-be-imposition figure corresponding to the target to-be-imposition image, and record the figure rotation angle as a target rotation angle;
a thirteenth module, configured to rotate the target image to be imposition according to the target rotation angle to obtain a rotated image to be imposition;
a fourteenth module, configured to obtain, on target graphic imposition, a minimum circumscribed rectangular frame of a graphic to be imposed, which corresponds to a target image to be imposed, and mark the minimum circumscribed rectangular frame as a target rectangular frame;
and the fifteenth module is used for correspondingly pasting the rotated image to be imposition to the target rectangular frame according to the relative position relationship.
Further, the printing imposition system further comprises:
the termination button is used for terminating the imposition of the graph to be imposed;
a target chromosome hyperlink unit for establishing a hyperlink for each obtained target chromosome in real time;
the display unit is used for correspondingly displaying the graphic imposition corresponding to the clicked hyperlink when the established hyperlink is clicked;
the image imposition selection unit is used for manually selecting the optimal chromosome for image imposition by a user and submitting the manually selected optimal chromosome to the seventh module;
and the makeup optimization fine-tuning unit is used for carrying out makeup optimization adjustment on the target graphic makeup obtained based on the optimal chromosome selected by the graphic makeup selection unit in a manual mode.
The beneficial effect of the invention is that,
(1) the invention is beneficial to realizing the parallel operation of graphic makeup and image design by using the outer contour graphic library, is further beneficial to breaking the design of the plane expansion diagram image of the packing box mentioned in the background technology and the single-thread operation of makeup, is further beneficial to improving the production efficiency, and realizes the printing makeup optimization of the plane expansion diagram image of the packing box.
(2) The method can perform graphic makeup on the graphic to be makeup based on the critical polygon algorithm and the genetic algorithm, avoids the use of a manual makeup mode, is beneficial to automatically and quickly finding out the optimized makeup combination from numerous makeup combinations for makeup, overcomes the difficulty that manual makeup is difficult to quickly find out the better makeup combination from numerous makeup combinations, solves the problems of easy error and low speed of manual makeup to a certain extent, and further realizes the printing makeup optimization of the image of the plane development drawing of the packing box.
(3) The invention carries out graphic makeup on the graphic to be makeup based on the critical polygon algorithm and the genetic algorithm, and concretely comprises the following steps of utilizing an expression 1 x (k)i-1)+SiThe method comprises the steps of calculating the fitness of each chromosome in each generation of population, obtaining the chromosome with the minimum fitness in each generation of population as a target chromosome, then selecting one target chromosome with the minimum fitness from all the obtained target chromosomes as an optimal chromosome, and finally collecting all single graphic impositions corresponding to the optimal chromosome to form a target graphic imposition for a chartlet of a subsequent step.
(4) The invention is provided with a button for stopping the continuous graphic makeup of the graphic to be made up, the graphic to be made up can be stopped at any time according to the actual situation without finishing the makeup process of the graphic to be made up, the target chromosome corresponding to the graphic makeup meeting the actual requirement can be manually selected by the graphic makeup selection unit after the makeup of the graphic to be made up is stopped, and the target graphic makeup obtained based on the optimal chromosome selected by the graphic makeup selection unit can be subjected to makeup optimization adjustment in a manual mode when the makeup needs to be finely adjusted, thereby not only being beneficial to ensuring the utilization rate of printing paper, but also being beneficial to increasing the makeup flexibility, being beneficial to accelerating the makeup speed to a certain extent and improving the production efficiency.
In addition, the invention has reliable design principle, simple structure and very wide application prospect.
Drawings
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present invention, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without creative efforts.
FIG. 1 is a schematic flow diagram of a method of one embodiment of the invention.
FIG. 2 is a schematic structural diagram of an embodiment of an image to be imposition and bleeding according to the present invention.
FIG. 3 is a schematic view showing a state where initial joints of two exemplary imposition rotation patterns are connected.
FIG. 4 is a diagram of a state in which one illustrative imposition rotation pattern has been translated through one revolution around another illustrative imposition rotation pattern in the present invention.
FIG. 5 is a diagram illustrating a translation state of an exemplary imposition rotation figure in a translation of one turn as a whole along a boundary of an exemplary imposition area in the present invention.
FIG. 6 is a schematic block diagram of a system of one embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present invention, the technical solution in the embodiment of the present invention will be clearly and completely described below with reference to the drawings in the embodiment of the present invention, and it is obvious that the described embodiment is only a part of the embodiment of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a schematic flow chart of a printing imposition method of a package flat development view image based on a pre-established outline graphic library of a package flat development view according to an embodiment of the present invention.
The outer contour graphic library stores the pre-established outer contour graphics of various packing box plane expansion diagrams. The types of the outer contour graphics in the outer contour graphics library can be managed according to actual conditions, for example, when the design style of the plane development diagram of the newly added packing box is adopted, the outer contour graphics of the plane development diagram of the packing box corresponding to the design style of the plane development diagram of the newly added packing box can be supplemented into the outer contour graphics library; for example, when the design style of the packing box planar expansion diagram is not used any more, the outer contour graph of the packing box planar expansion diagram corresponding to the design style of the packing box planar expansion diagram which is not used any more can be deleted from the outer contour graph library.
As shown in fig. 1, the printing imposition method 100 includes:
step 101: and selecting the outer contour graphics of the packing box plane expansion diagram image required to be designed in each customer order to be subjected to printing and imposition from the outer contour graphics library.
The customer order comprises a packing box plane expansion diagram design style required by a customer, and the packing box plane expansion diagram design style corresponds to an outer contour diagram of a packing box plane expansion diagram image required by the customer.
Step 102: and amplifying each selected outline graph to obtain the corresponding graph to be imposition.
The size of each graph to be impossed is equal to the size of the packing box plane expansion diagram image required to be designed in the corresponding customer order after bleeding with the preset width is added.
And the packing box plane expansion diagram image required to be designed in the customer order corresponding to the graph to be impossed is the packing box plane expansion diagram image required to be designed in the customer order corresponding to the outer contour graph corresponding to the graph to be impossed.
In the present embodiment, bleeding of the image is added in the peripheral circumferential direction of the image. For example, there is a customer order 1 in the customer orders to be printed and imposition, the packing box plane development image required to be designed in the customer order 1 is an image a to be imposed, taking the image a to be imposed as an example: reference numeral 200 in fig. 2 denotes the image a to be imposition (which is just one example, and on which a pattern is not drawn in fig. 2); reference numeral 300 in fig. 2 denotes a bleed (i.e., a bleeding portion or an image bleeding portion) of the width r added in the peripheral direction of the image a to be imposition. And (4) amplifying the outer contour graph of the packing box plane expansion diagram image required to be designed in the customer order 1 selected from the outer contour graph library in the step (101) to obtain a graph to be impossed, wherein the size of the graph to be impossed is equal to the size of the outer contour graph corresponding to the outer contour of the image obtained by adding the bleeding to the image A to be impossed.
Each of the patterns to be imposition obtained in step 102 is provided with a number functioning as a unique identifier.
Step 103: and performing graphic makeup on all the graphics to be subjected to makeup based on a critical polygon algorithm and a genetic algorithm to obtain target graphic makeup.
Step 104: the developed image of the packing box plane in each customer order designed to be printed and imposition is input.
Step 105: pasting each packing box plane expansion image to be imposition to a corresponding position on a target graphic imposition to obtain a printing imposition; and the packing box plane development image to be impossed is the input designed packing box plane development image.
Optionally, as an exemplary embodiment of the present invention, the implementation method of step 102 above is: for each selected outline graph, the following steps are respectively executed:
acquiring the length L and the width W of the minimum circumscribed rectangle of the target outline graph; the target outer contour graph is the currently selected outer contour graph;
amplifying the target outer contour graph by (2r + L)/L times along the length direction of the minimum external rectangle of the target outer contour graph, and amplifying the target outer contour graph by (2r + W)/W times along the width direction of the minimum external rectangle of the target outer contour graph to finally obtain a graph to be imposition corresponding to the target outer contour graph;
wherein r is a preset width threshold of the image bleeding part.
As an exemplary embodiment of the present invention, the step 103 specifically includes:
step 1031, remembering P ═ PtI t 1,2, …, m is the set of the numbers of all the patterns to be imposition obtained in step 102, and the obtained numbers of all the patterns to be imposition are used to construct an initial generation population POP1 { CHR ═ CHRi1,2, …, n }, wherein: CHRiIs the ith chromosome in the primary population, n is the total number of chromosomes in the primary population, ptFor the number of the t-th graphic to be imposition obtained in step 102, each chromosome CHRiThe number of genes in the set is equal to the set P ═ PtThe number of elements in 1,2, …, m is equal; chromosome CHRiEach gene in (a) is represented by the set P ═ { P ═ PtOne element of 1,2, …, m and a randomly generated figure rotation angle corresponding to the element; chromosome CHRiEach gene in (1) corresponds to P ═ Pt1, | t ═ 1,2, …, m }; chromosome CHRiThe gene sequence on the gene sequence corresponds to the makeup sequence of each pattern to be made up participating in makeup; chromosome CHRiThe rotation angle of the graph in each gene is the rotation angle of the graph to be imposred corresponding to the number in each gene during imposition;
step 1032: according to each chromosome in the current latest generation population, all the patterns to be imposred are imposed according to the imposition sequence and the pattern rotation angle of the patterns to be imposed described by the chromosome, so as to obtain the pattern imposition corresponding to each chromosome in the current latest generation population;
step 1033, calculating the fitness of each chromosome in the current latest generation population, wherein the calculation expression of the fitness is 1 × (k)i-1)+Si(ii)/S, wherein: s is the area of the imposition area, k, on a single imposition canvasiRepresenting the total number, k, of all the graphic impositions obtained by imposition of all the graphics to be imposed according to the ith chromosome in the current latest generation populationiK is not less than 1i∈N;SiRepresenting the area of the minimum circumscribed rectangle of all the patterns to be imposred on the final pattern imposition obtained by imposition of all the patterns to be imposed according to the ith chromosome in the current latest generation population, wherein i is 1,2, …, n;
1034, selecting the chromosome with the minimum fitness in the current latest generation population to obtain a target chromosome and storing the target chromosome;
step 1035, constructing a next generation population by using the current latest generation population, and then turning to step 1032 to continue executing until iteration is finished; wherein the next generation population comprises chromosomes with the minimum fitness in the current latest generation population;
step 1036, after the iteration is finished, selecting a target chromosome with the minimum fitness from the stored target chromosomes to obtain an optimal chromosome;
and 1037, acquiring all the graphic impositions corresponding to the current latest optimal chromosome, and collecting to form the target graphic imposition.
Wherein each graphic imposition corresponds to one imposition canvas. As an exemplary embodiment of the present invention, the first generation population POP1 ═ { CHR ═ CHR is constructed in the above step 1031 by using the obtained numbers of all the patterns to be imposedi1,2, …, n }, and the realization method is as follows:
step 10311, set P ═ Pt1,2, …, m |All elements are randomly arranged to generate a numbering sequence, and each element in the numbering sequence is assigned a randomly generated pattern rotation angle, and each element in the numbering sequence and its assigned pattern rotation angle form a chromosome CHR1(ii) a Wherein, chromosome CHR1Each gene in the sequence is respectively composed of an element in the numbering sequence and a figure rotating angle corresponding to the element; chromosome CHR1Each gene in (a) corresponds to a different element in the numbered sequence; chromosome CHR1The gene sequence on the gene sequence corresponds to the makeup sequence of each pattern to be made up participating in makeup; chromosome CHR1The rotation angle of the graph in each gene is the rotation angle of the graph to be imposred corresponding to the number in each gene during imposition;
step 10312, cloning n-1 chromosome CHR according to population scale n1And one chromosome CHR is grown out per gram1Then, carrying out mutation on each cloned chromosome to generate a new variant chromosome;
step 10313, subjecting chromosome CHR1And all variant chromosomes produced by variation in step 10312, constitute the primary population POP 1.
As an exemplary embodiment of the present invention, an implementation method of step 10312 is:
step 103121, cloning a chromosome CHR1As cloned chromosome CHR1’;
Step 103122, initializing i to 1;
103123, generating a random number r between 0 and 11Judging the random number r1Whether or not it is less than a predetermined variation ratio sigma (where 0)<σ<1): if the determination result is negative, re-execute step 103123; if the determination result is yes, j is i +1, and at this time: if j is less than or equal to m, the cloned chromosome CHR obtained by the cloning is used1' position exchange of the ith gene and the jth gene in the gene sequence, followed by performing step 103124; if j>m, reporting an error and terminating the execution program; m is clone chromosome CHR1' the number of genes;
step 103124, generating another random number r between 0 and 12And judging the random number r2Whether or not the variation rate σ is smaller than the above: if the determination result is negative, the step 103124 is executed again; if the judgment result is the random number r2If the variation rate is less than the variation rate sigma, any angle is selected from the preset angle value range as a new pattern rotation angle, and the new pattern rotation angle is used for replacing the clone chromosome CHR after the position exchange1' by the angle of rotation of the pattern in the ith gene, and thereafter continuing to perform step 103125;
step 103125, increasing the current value of i by 1, and then judging whether i is less than or equal to m: if yes, go to step 103123; if the judgment result is negative, completing the one-time mutation to generate a mutated chromosome; then go to step 103121 to continue to execute the process until the number of generated variant chromosomes reaches n-1.
Wherein, the above-mentioned preset angle value range can be: four values of 0 °, 90 °, 180 ° and 270 °. The above-mentioned preset angle range can also be set by those skilled in the art according to actual conditions.
As an exemplary embodiment of the present invention, the implementation method of step 1032 above is: traversing each chromosome in the current latest generation population, and respectively executing the following steps for each traversed chromosome:
10321. correspondingly rotating each pattern to be imposition according to the pattern rotation angle of each pattern to be imposition described by the currently traversed chromosome to obtain the rotated patterns of each pattern to be imposition, and recording the rotated patterns as imposition rotation patterns;
10322. obtaining and storing a critical polygon NFP between every two obtained imposition rotation graphs;
10323. obtaining and storing internal critical polygons of the obtained makeup rotating graphs in a makeup area of the makeup canvas relative to boundary graphs of the makeup area;
10324. typesetting the first imposition rotation graph to be typeset to the lower left corner of the pre-built imposition area of one imposition canvas according to the corresponding internal critical polygon according to the imposition sequence of the graph to be imposed described by the currently traversed chromosome;
10325. reading the imposition rotation figure to be imposed next, and: extracting the internal critical polygon corresponding to the read imposition rotation graph from the stored internal critical polygons, and recording the internal critical polygon as a target internal critical polygon; extracting the read critical polygons NFP of the imposition rotation graphics relative to each imposition rotation graphics already typeset in the imposition area of the current imposition canvas from the stored critical polygons NFP and solving a union set, wherein the union set is marked as a target union set; then acquiring the intersection of the target internal critical polygon and the target union set; step 10326 is then performed;
10326. it is determined whether the newly obtained intersection is empty in step 10325: if not, proceed to step 10327; if yes, marking the corresponding imposition rotation graph and the imposition sequencing position where the corresponding imposition rotation graph is located, and continuing to execute the step 10325 until all the imposition rotation graphs to be typeset are read, then newly building another imposition canvas, rearranging the marked imposition rotation graphs according to the imposition sequence of the graphs to be imposed described by the currently traversed chromosome to obtain a new imposition rotation graph sequence, then typesetting the first imposition rotation graph in the imposition rotation graph sequence to the lower left corner of the imposition area of the newly built imposition canvas according to the new imposition rotation graph sequence and the corresponding internal critical polygon, and then continuing to execute the step 10325;
step 10327, the latest intersection obtained in step 10325 is the boundary of the area for placing the imposition rotation figure to be imposed next, and the area surrounded by the boundary is marked as a target placeable area; then step 10328 is performed;
at step 10328, the imposition rotation graphics to be laid out next are laid out preferentially to the left side below the inside of the target placeable area (i.e. to the left side below the target placeable area), and then the process goes to step 10325 to continue execution until all the imposition rotation graphics are laid out on the imposition canvas.
As an exemplary embodiment of the present invention, the method for constructing the next generation population by using the current latest generation population in step 1035 includes:
selecting the chromosome with the minimum fitness in the current latest generation population and reserving the chromosome to the next generation;
performing single-point cross variation on other chromosomes except the chromosome with the minimum fitness in the current latest generation population to generate n-1 sub-generation chromosomes;
and constructing a next generation population containing n chromosomes by using the chromosomes reserved to the next generation and the n-1 generation chromosomes generated.
As an exemplary embodiment of the present invention, the implementation method of the above step 105 is:
traversing the plane development image of each corresponding packing box to be impossed according to the imposition sequence of the graph to be imposed described by the optimal chromosome;
respectively executing the following steps to each traversed packing box plane expansion image to be impossed:
adding an image bleeding part in the peripheral circumference direction of the target image to be imposition; the target image to be imposition is a planar development image of the packaging box to be imposition traversed currently;
acquiring a minimum external rectangular frame of the image bleeding part, and recording the minimum external rectangular frame as a first rectangular frame;
acquiring a minimum circumscribed rectangle of a target image to be imposition, and recording the minimum circumscribed rectangle as a target circumscribed rectangle;
acquiring the relative position relation between the target circumscribed rectangle and the first rectangular frame;
acquiring a graph rotation angle of the graph to be imposition corresponding to the target image to be imposition from the optimal chromosome, and recording the graph rotation angle as a target rotation angle;
rotating the target image to be imposition according to the target rotation angle to obtain a rotated image to be imposition;
on the target graphic imposition, acquiring a minimum external rectangular frame of a graphic to be imposed, which corresponds to a target image to be imposed, and marking the minimum external rectangular frame as a target rectangular frame;
and correspondingly pasting the rotated image to be imposition onto the target rectangular frame according to the relative position relation.
In the invention, a reference point and an initial joint are predefined on each pattern to be imposition, and each imposition rotation pattern is correspondingly provided with the corresponding reference point and initial joint.
In step 10321, each time the internal critical polygon of the imposition rotation graphic corresponding to the boundary graphic of the imposition area inside the imposition area of the imposition canvas is obtained, the internal critical polygon of the imposition rotation graphic which has been obtained the internal critical polygon before is not repeatedly obtained.
The critical Polygon NFP in the present invention is a critical Polygon obtained by using the NFP (No Fit Polygon) method. For example, in fig. 3, the graph B and the graph C are an imposition rotation graph B and an imposition rotation graph C with two critical polygons NFP to be obtained, and the imposition rotation graph B and the imposition rotation graph C have reference points and initial joints, respectively, as shown in fig. 3. In fig. 3, the initial joint of the imposition rotation figure B and imposition rotation figure C are connected, reference numeral 500 denotes a reference point on the imposition rotation figure B, and reference numeral 400 denotes a reference point on the imposition rotation figure C. By adopting the NFP method, the imposition rotation figure C is translated for a circle around the imposition rotation figure B from the state shown in FIG. 3, and as shown in FIG. 4, a figure 600 formed by a reference point 400 on the imposition rotation figure C is a critical polygon of the imposition rotation figure C relative to the imposition rotation figure B. The critical polygon of the imposition rotation figure B relative to the imposition rotation figure C and the critical polygons between any other relevant imposition rotation figures can be obtained with reference to the obtaining manner of the figure 600.
Wherein, the internal critical polygon is obtained by IFP (inner Fit polygon) method. Specifically, the imposition rotation figure of the internal critical polygon of the boundary figure of the corresponding imposition area to be obtained is placed in the corresponding imposition area, the whole imposition area is translated for a circle along the boundary figure of the imposition area in the corresponding imposition area, and the figure formed by the reference point on the figure is the internal critical polygon of the imposition rotation figure relative to the boundary figure of the corresponding imposition area. For example, combining the imposition rotation figure B and imposition rotation figure C, as shown in fig. 5, reference numeral 700 is an imposition area of an imposition canvas used for current imposition, and the method for acquiring the internal critical polygon of the imposition rotation figure C relative to the boundary figure of the imposition area 700 is as follows: the imposition rotation figure C is placed in the imposition area 700, and then the imposition rotation figure C is translated for a circle along the boundary of the imposition area 700 in the imposition area 700 to obtain a figure 800 formed by a reference point on the imposition rotation figure C in the translation process, namely an internal critical polygon (namely the figure 800) of the imposition rotation figure C relative to the boundary figure of the imposition area 700. Wherein the imposition rotation figure C is translated by one turn along the boundary of the imposition area 700 as a whole. The imposition rotation figure C shown by the dotted line in fig. 5 is a schematic position track of the imposition rotation figure C in the translation process.
As an exemplary embodiment of the present invention, the printing imposition method 100 further comprises the steps of:
a button for stopping the continuous graphic imposition of the graphic to be imposed is arranged;
establishing a hyperlink for each obtained target chromosome in real time; when the established hyperlink is clicked, correspondingly displaying the graphic makeup corresponding to the clicked hyperlink;
the printing imposition method 100 further comprises the steps of:
a graphic imposition selection unit for a user to manually select an optimal chromosome is provided;
after the user selects the optimal chromosome via the graphical imposition selection unit, step 1037 is automatically performed.
The printing imposition method 100 further comprises the steps of:
and performing makeup optimization adjustment on the target graphic makeup obtained based on the optimal chromosome selected by the graphic makeup selection unit in a manual mode.
Specifically, the method comprises the following steps: clicking the established hyperlink to correspondingly display the graphic makeup corresponding to the clicked hyperlink; by pressing the button, the printing imposition method 100 can automatically terminate the continuous graphic imposition of the graphic to be imposed. In the execution process of the printing imposition method 100, each time a target chromosome and a corresponding graphic imposition thereof are obtained, a corresponding hyperlink is established for the obtained target chromosome in real time. In the process of imposition by the user using the printing imposition method 100: the graphic makeup corresponding to each target chromosome can be checked by clicking the established hyperlink in real time; when judging (judging according to experience) that the makeup meeting the actual printing requirement exists in the current obtained graphic makeup, the printing makeup method 100 can stop the graphic makeup of the graphic to be subjected to the makeup by pressing the button; after the button pair is pressed, a target chromosome corresponding to the graphic imposition which is judged to meet the actual requirement according to experience is manually selected by the graphic imposition selection unit, wherein the target chromosome is the optimal chromosome selected by the user through the graphic imposition selection unit; after the worker selects the optimal chromosome through the graphic imposition selection unit, the method automatically goes to step 1037 to continue to execute downwards, and after the corresponding target graphic imposition (hereinafter referred to as "first target graphic imposition") is obtained in step 1037, the worker can select whether to adopt a manual mode to carry out imposition optimization adjustment on the imposition items on the first target graphic imposition, if no adjustment is needed, the first target graphic imposition can be directly submitted for subsequent image mapping, and if fine adjustment is needed, the adjusted first target graphic imposition can be submitted for subsequent image mapping. The method and the device have the advantages that the makeup process of the pattern to be made up is not required to be executed, the pattern makeup of the pattern to be made up can be stopped at any time according to actual conditions, the utilization rate of printing paper is favorably ensured, the flexibility of makeup is favorably improved, the time consumed by makeup is favorably shortened, and the working efficiency of workers is favorably improved.
In addition, as another exemplary embodiment of the present invention, the printing imposition method 100 may further include the steps of: a step for managing outline graphics in the outline graphics library is provided.
And managing the outer contour graphics in the outer contour graphics library, wherein the managing comprises adding, viewing, modifying and deleting the outer contour graphics in the outer contour graphics library.
FIG. 6 is a diagram of an embodiment of the printing and imposition system for a flat developed view image of a packing box according to the present invention, which is based on a pre-established outline graphic library of the flat developed view image of the packing box.
Referring to fig. 6, the printing imposition system 900 specifically includes:
a graphic reading unit 901, configured to select an outer contour graphic of a packing box plane expansion diagram image required to be designed in each customer order to be subjected to printing and imposition from the outer contour graphic library;
a graphic preprocessing unit 902, configured to amplify each selected outline graphic to obtain a corresponding graphic to be imposition; the size of each graph to be impossed is equal to the size of the packing box plane expansion graph image required to be designed in the corresponding customer order after bleeding with preset width is added;
the graphic imposition unit 903 is used for performing graphic imposition on all the graphics to be imposed based on a critical polygon algorithm and a genetic algorithm to obtain target graphic imposition;
an image input unit 904 for inputting the designed packing box plane development image in each customer order to be printed and imposition;
the mapping unit 905 is used for mapping each packing box plane expansion image to be subjected to makeup to a corresponding position on a target graphic makeup to obtain a printing makeup; and the packing box plane development image to be impossed is the input designed packing box plane development image.
As an exemplary embodiment of the present invention, the graphic imposition unit 903 includes:
a first module for noting P ═ Pt1,2, …, m as graphics preprocessingThe unit 902 obtains the number set of all the patterns to be imposition, and constructs the initial generation population POP1 ═ CHR by using the obtained number set of all the patterns to be impositioni1,2, …, n }, wherein: CHRiIs the ith chromosome in the primary population, n is the total number of chromosomes in the primary population, ptFor the number of the t-th graphic to be imposition obtained by the graphic preprocessing unit 902, each chromosome CHRiThe number of genes in the set is equal to the set P ═ PtThe number of elements in 1,2, …, m is equal; chromosome CHRiEach gene in (a) is represented by the set P ═ { P ═ PtOne element of 1,2, …, m and a randomly generated figure rotation angle corresponding to the element; chromosome CHRiEach gene in (1) corresponds to P ═ Pt1, | t ═ 1,2, …, m }; chromosome CHRiThe gene sequence on the gene sequence corresponds to the makeup sequence of each pattern to be made up participating in makeup; chromosome CHRiThe rotation angle of the graph in each gene is the rotation angle of the graph to be imposred corresponding to the number in each gene during imposition;
the second module is used for splicing all the patterns to be spliced according to each chromosome in the current latest generation of population and the splicing sequence and the pattern rotation angle of the patterns to be spliced described by the chromosomes respectively to obtain the pattern splicing corresponding to each chromosome in the current latest generation of population;
a third module, configured to calculate a fitness of each chromosome in the current latest generation population, where a calculation expression of the fitness is 1 × (k)i-1)+Si(ii)/S, wherein: s is the area of the imposition area, k, on a single imposition canvasiRepresenting the total number, k, of all the graphic impositions obtained by imposition of all the graphics to be imposed according to the ith chromosome in the current latest generation populationiK is not less than 1i∈N;SiA minimum circumscribed rectangle representing all the patterns to be imposred on the final pattern imposition obtained by imposition of all the patterns to be imposed according to the ith chromosome in the current latest generation populationI ═ 1,2, …, n;
the fourth module is used for selecting the chromosome with the minimum fitness in the current latest generation population to obtain and store a target chromosome;
a fifth module, configured to construct a next-generation population using the current latest-generation population, and then call the second module until iteration is completed; wherein the next generation population comprises chromosomes with the minimum fitness in the current latest generation population;
the sixth module is used for selecting the target chromosome with the minimum fitness from the stored target chromosomes to obtain the optimal chromosome after the iteration is finished;
and the seventh module is used for acquiring all the graphic impositions corresponding to the current latest optimal chromosome and collecting to form the target graphic imposition.
As an exemplary embodiment of the present invention, the mapping unit 905 includes:
the traversing module is used for traversing the plane development image of each corresponding packing box to be impossed according to the imposition sequence of the graph to be imposed described by the optimal chromosome;
the decision module is used for calling the following images of the planar development graph of each traversed packing box to be impossed respectively:
an eighth module for adding an image bleeding part in a peripheral circumferential direction of the target image to be imposition; the target image to be imposition is a planar development image of the packaging box to be imposition traversed currently;
a ninth module, configured to obtain a minimum circumscribed rectangular frame of the bleeding part of the image, and record the minimum circumscribed rectangular frame as a first rectangular frame;
the tenth module is used for acquiring the minimum circumscribed rectangle of the target image to be imposted and recording the minimum circumscribed rectangle as a target circumscribed rectangle;
the eleventh module is used for acquiring the relative position relation between the target circumscribed rectangle and the first rectangular frame;
a twelfth module, configured to obtain, from the optimal chromosome, a figure rotation angle of the to-be-imposition figure corresponding to the target to-be-imposition image, and record the figure rotation angle as a target rotation angle;
a thirteenth module, configured to rotate the target image to be imposition according to the target rotation angle to obtain a rotated image to be imposition;
a fourteenth module, configured to obtain, on target graphic imposition, a minimum circumscribed rectangular frame of a graphic to be imposed, which corresponds to a target image to be imposed, and mark the minimum circumscribed rectangular frame as a target rectangular frame;
and the fifteenth module is used for correspondingly pasting the rotated image to be imposition to the target rectangular frame according to the relative position relationship.
As an exemplary embodiment of the present invention, the printing imposition system 900 further comprises:
the termination button is used for terminating the imposition of the graph to be imposed;
a target chromosome hyperlink unit for establishing a hyperlink for each obtained target chromosome in real time;
the display unit is used for correspondingly displaying the graphic imposition corresponding to the clicked hyperlink when the established hyperlink is clicked;
the image imposition selection unit is used for manually selecting the optimal chromosome for image imposition by a user and submitting the manually selected optimal chromosome to the seventh module;
and the makeup optimization fine-tuning unit is used for carrying out makeup optimization adjustment on the target graphic makeup obtained based on the optimal chromosome selected by the graphic makeup selection unit in a manual mode.
As an exemplary embodiment of the present invention, the printing imposition system 900 further comprises:
and the outer contour graphic library management unit is used for managing the outer contour graphics in the outer contour graphic library, and comprises the steps of adding, modifying, checking and deleting the outer contour graphics in the outer contour graphic library.
The same and similar parts in the various embodiments in this specification may be referred to each other.
The invention breaks through the design of the plane development image of the packing box and the single-thread operation of the makeup in the background technology, overcomes the difficulty that the manual makeup is difficult to quickly find out a proper makeup combination from a plurality of makeup combinations, solves the problems of easy error and low speed of the manual makeup, and realizes the printing makeup optimization of the plane development image of the packing box.
Although the present invention has been described in detail by referring to the drawings in connection with the preferred embodiments, the present invention is not limited thereto. Various equivalent modifications or substitutions can be made on the embodiments of the present invention by those skilled in the art without departing from the spirit and scope of the present invention, and these modifications or substitutions are within the scope of the present invention/any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (6)
1. A printing and imposition method for a packing box plane expansion diagram image is characterized in that the printing and imposition method is based on a pre-established outer contour diagram library of a packing box plane expansion diagram, and comprises the following steps:
q1: selecting an outer contour graph of a packing box plane expansion diagram image required to be designed in each customer order to be printed and impossed from the outer contour graph library;
q2: amplifying each selected outline graph to obtain the corresponding graph to be imposition; the size of each graph to be impossed is equal to the size of the packing box plane expansion graph image required to be designed in the corresponding customer order after bleeding with preset width is added;
q3: performing graphic makeup on all the graphs to be subjected to makeup based on a critical polygon algorithm and a genetic algorithm to obtain target graphic makeup;
q4: inputting a packing box plane expansion image in each designed customer order to be printed and impossed;
q5: pasting each packing box plane expansion image to be imposition to a corresponding position on a target graphic imposition to obtain a printing imposition; the packing box plane development image to be impossed is the input designed packing box plane development image;
step Q3 includes:
step Q31, P ═ PtI t ═ 1, 2., m } is the set of the numbers of all the patterns to be imposition obtained in the step Q2, and the obtained numbers of all the patterns to be imposition are used for constructing an initial generation group POP1 ═ { CHR ═ CHRi1, 2., n }, wherein: CHRiIs the ith chromosome in the primary population, n is the total number of chromosomes in the primary population, ptFor the number of the t-th graphic to be imposition obtained in step Q2, each chromosome CHRiThe number of genes in the set is equal to the set P ═ PtThe number of elements in 1, 2.·, m } is equal; chromosome CHRiEach gene in (a) is represented by the set P ═ { P ═ PtOne element of 1,2,. and m } and a randomly generated figure rotation angle corresponding to the element; chromosome CHRiEach gene in (1) corresponds to P ═ Pt1,2,. m } a different one of the elements; chromosome CHRiThe gene sequence on the gene sequence corresponds to the makeup sequence of each pattern to be made up participating in makeup; chromosome CHRiThe rotation angle of the graph in each gene is the rotation angle of the graph to be imposred corresponding to the number in each gene during imposition;
step Q32: according to each chromosome in the current latest generation population, all the patterns to be imposred are imposed according to the imposition sequence and the pattern rotation angle of the patterns to be imposed described by the chromosome, so as to obtain the pattern imposition corresponding to each chromosome in the current latest generation population;
step Q33, calculating the fitness of each chromosome in the current latest generation population, wherein the calculation expression of the fitness is 1 x (k)i-1)+Si(ii)/S, wherein: s is the area of the imposition area, k, on a single imposition canvasiRepresenting all the graphic impositions obtained by imposition of all the graphics to be imposed according to the ith chromosome in the current latest generation populationTotal number, kiK is not less than 1i∈N;SiRepresenting the area of a minimum circumscribed rectangle of all the patterns to be pieced on the final pattern makeup obtained by piecing all the patterns to be pieced according to the ith chromosome in the current latest generation population, wherein i is 1, 2.
Step Q34, selecting the chromosome with the minimum fitness in the current latest generation population to obtain and store a target chromosome;
step Q35, constructing a next generation population by using the current latest generation population, and then turning to step Q32 to continue execution until iteration is finished; wherein the next generation population comprises chromosomes with the minimum fitness in the current latest generation population;
step Q36, after the iteration is finished, selecting the target chromosome with the minimum fitness from the stored target chromosomes to obtain the optimal chromosome;
step Q37, obtaining each graphic imposition corresponding to the current latest optimal chromosome, and collecting to form a target graphic imposition;
the implementation method of the step Q5 is as follows:
traversing the plane development image of each corresponding packing box to be impossed according to the imposition sequence of the graph to be imposed described by the optimal chromosome;
respectively executing the following steps to each traversed packing box plane expansion image to be impossed:
adding an image bleeding part in the peripheral circumference direction of the target image to be imposition; the target image to be imposition is a planar development image of the packaging box to be imposition traversed currently;
acquiring a minimum external rectangular frame of the image bleeding part, and recording the minimum external rectangular frame as a first rectangular frame;
acquiring a minimum circumscribed rectangle of a target image to be imposition, and recording the minimum circumscribed rectangle as a target circumscribed rectangle;
acquiring the relative position relation between the target circumscribed rectangle and the first rectangular frame;
acquiring a graph rotation angle of the graph to be imposition corresponding to the target image to be imposition from the optimal chromosome, and recording the graph rotation angle as a target rotation angle;
rotating the target image to be imposition according to the target rotation angle to obtain a rotated image to be imposition;
on the target graphic imposition, acquiring a minimum external rectangular frame of a graphic to be imposed, which corresponds to a target image to be imposed, and marking the minimum external rectangular frame as a target rectangular frame;
and correspondingly pasting the rotated image to be imposition onto the target rectangular frame according to the relative position relation.
2. The method for printing and imposition of an image of a plane development of a packaging box according to claim 1, wherein the step Q2 is carried out by: for each selected outline graph, the following steps are respectively executed:
acquiring the length L and the width W of the minimum circumscribed rectangle of the target outline graph; the target outer contour graph is the currently selected outer contour graph;
amplifying the target outer contour graph by (2r + L)/L times along the length direction of the minimum external rectangle of the target outer contour graph, and amplifying the target outer contour graph by (2r + W)/W times along the width direction of the minimum external rectangle of the target outer contour graph to finally obtain a graph to be imposition corresponding to the target outer contour graph;
wherein r is a preset width threshold of the image bleeding part.
3. The method for printing and imposition of an image of a plane development of a packaging box according to claim 1, wherein the step Q32 is carried out by:
traversing each chromosome in the current latest generation population, and respectively executing the following steps for each traversed chromosome:
q321, correspondingly rotating each pattern to be imposred according to the pattern rotation angle of each pattern to be imposed described by the currently traversed chromosome to obtain the rotated patterns of each pattern to be imposed, and recording the rotated patterns as imposition rotation patterns;
q322, obtaining and storing a critical polygon NFP between every two obtained imposition rotation graphs;
q323, obtaining and storing the internal critical polygon of each obtained makeup rotating graph in the makeup area of the makeup canvas relative to the boundary graph of the makeup area;
q324, typesetting the first imposition rotation graph to be typeset to the lower left corner of the pre-built imposition area of an imposition canvas according to the corresponding internal critical polygon of the first imposition rotation graph according to the imposition sequence of the graph to be imposed described by the currently traversed chromosome;
q325, reading the imposition rotation graph of the next imposition to be imposed, and: extracting the internal critical polygon corresponding to the read imposition rotation graph from the stored internal critical polygons, and recording the internal critical polygon as a target internal critical polygon; extracting the read critical polygons NFP of the imposition rotation graphics relative to each imposition rotation graphics already typeset in the imposition area of the current imposition canvas from the stored critical polygons NFP and solving a union set, wherein the union set is marked as a target union set; then acquiring the intersection of the target internal critical polygon and the target union set; then, go to step Q326;
q326, judging whether the intersection set obtained in the step Q325 is empty: if not, continue to execute step Q327; if so, marking the corresponding imposition rotation graph and the imposition sequencing position where the corresponding imposition rotation graph is located, and continuing to execute the step Q325 until all the imposition rotation graphs to be typeset are read, then newly building another imposition canvas, rearranging the marked imposition rotation graphs according to the imposition sequence of the graphs to be imposed described by the currently traversed chromosome to obtain a new imposition rotation graph sequence, then typesetting the first imposition rotation graph in the imposition rotation graph sequence to the lower left corner of the imposition area of the newly built imposition canvas according to the corresponding internal critical polygon of the first imposition rotation graph according to the new imposition rotation graph sequence, and then continuing to execute the step Q325;
the intersection obtained in the step Q327 and the step Q325 is the boundary of the area for placing the imposition rotation figure to be imposed next, and the area surrounded by the boundary is marked as a target placeable area; then step Q328 is performed;
and step Q328, preferentially typesetting the next imposition rotation graph to be typeset to the lower part and the left side of the inner part of the target placeable area, and then turning to the step Q325 to continue executing until all the imposition rotation graphs are typeset on the imposition canvas.
4. A printing imposition method of a flat development figure image of a packaging box according to any one of claims 1 to 3 characterized by further comprising the steps of:
a button for stopping the continuous graphic imposition of the graphic to be imposed is arranged;
establishing a hyperlink for each obtained target chromosome in real time; when the established hyperlink is clicked, correspondingly displaying the graphic imposition corresponding to the clicked hyperlink;
a graphic imposition selection unit for a user to manually select an optimal chromosome is provided;
after the user selects the optimal chromosome through the graphic imposition selection unit, automatically executing a step Q37;
the printing imposition method also comprises the following steps:
and performing makeup optimization adjustment on the target graphic makeup obtained based on the optimal chromosome selected by the graphic makeup selection unit in a manual mode.
5. The printing and imposition system for the packing box plane expansion diagram image is characterized by comprising an outer contour graphic library based on a pre-established packing box plane expansion diagram, and the printing and imposition system specifically comprises the following components:
the figure reading unit is used for selecting an outer contour figure of a packing box plane expansion diagram image required to be designed in each customer order to be printed and impossed from the outer contour figure library;
the figure preprocessing unit is used for amplifying each selected outline figure to obtain the corresponding figure to be imposition; the size of each graph to be impossed is equal to the size of the packing box plane expansion graph image required to be designed in the corresponding customer order after bleeding with preset width is added;
the graphic imposition unit is used for performing graphic imposition on all the graphics to be imposed based on a critical polygon algorithm and a genetic algorithm to obtain target graphic imposition;
the image input unit is used for inputting the designed packing box plane expansion image in each customer order to be printed and imposition;
the mapping unit is used for mapping each packing box plane expansion image to be subjected to makeup to a corresponding position on a target graphic makeup to obtain a printing makeup; the packing box plane development image to be impossed is the input designed packing box plane development image;
the graphic imposition unit includes:
a first module for noting P ═ PtI t 1,2, i, m is a set of the numbers of all the patterns to be imposted obtained by the pattern preprocessing unit, and the obtained numbers of all the patterns to be imposed are used for constructing an initial generation population POP1 { CHR ═ CHRi1, 2., n }, wherein: CHRiIs the ith chromosome in the primary population, n is the total number of chromosomes in the primary population, ptFor the number of the t-th graphic to be imposition obtained by the graphic preprocessing unit, each chromosome CHRiThe number of genes in the set is equal to the set P ═ PtThe number of elements in 1, 2.·, m } is equal; chromosome CHRiEach gene in (a) is represented by the set P ═ { P ═ PtOne element of 1,2,. and m } and a randomly generated figure rotation angle corresponding to the element; chromosome CHRiEach gene in (1) corresponds to P ═ Pt1,2,. m } a different one of the elements; chromosome CHRiThe gene sequence on the gene sequence corresponds to the makeup sequence of each pattern to be made up participating in makeup; chromosome CHRiThe rotation angle of the graph in each gene is the rotation angle of the graph to be imposred corresponding to the number in each gene during imposition;
the second module is used for splicing all the patterns to be spliced according to each chromosome in the current latest generation of population and the splicing sequence and the pattern rotation angle of the patterns to be spliced described by the chromosomes respectively to obtain the pattern splicing corresponding to each chromosome in the current latest generation of population;
a third module, configured to calculate a fitness of each chromosome in the current latest generation population, where a calculation expression of the fitness is 1 × (k)i-1)+Si(ii)/S, wherein: s is the area of the imposition area, k, on a single imposition canvasiRepresenting the total number, k, of all the graphic impositions obtained by imposition of all the graphics to be imposed according to the ith chromosome in the current latest generation populationiK is not less than 1i∈N;SiRepresenting the area of a minimum circumscribed rectangle of all the patterns to be pieced on the final pattern makeup obtained by piecing all the patterns to be pieced according to the ith chromosome in the current latest generation population, wherein i is 1, 2.
The fourth module is used for selecting the chromosome with the minimum fitness in the current latest generation population to obtain and store a target chromosome;
a fifth module, configured to construct a next-generation population using the current latest-generation population, and then call the second module until iteration is completed; wherein the next generation population comprises chromosomes with the minimum fitness in the current latest generation population;
the sixth module is used for selecting the target chromosome with the minimum fitness from the stored target chromosomes to obtain the optimal chromosome after the iteration is finished;
the seventh module is used for acquiring all the graphic impositions corresponding to the current latest optimal chromosome and converging the graphic impositions to form a target graphic imposition;
the mapping unit comprises:
the traversing module is used for traversing the plane development image of each corresponding packing box to be impossed according to the imposition sequence of the graph to be imposed described by the optimal chromosome;
the decision module is used for calling the following images of the planar development graph of each traversed packing box to be impossed respectively:
an eighth module for adding an image bleeding part in a peripheral circumferential direction of the target image to be imposition; the target image to be imposition is a planar development image of the packaging box to be imposition traversed currently;
a ninth module, configured to obtain a minimum circumscribed rectangular frame of the bleeding part of the image, and record the minimum circumscribed rectangular frame as a first rectangular frame;
the tenth module is used for acquiring the minimum circumscribed rectangle of the target image to be imposted and recording the minimum circumscribed rectangle as a target circumscribed rectangle;
the eleventh module is used for acquiring the relative position relation between the target circumscribed rectangle and the first rectangular frame;
a twelfth module, configured to obtain, from the optimal chromosome, a figure rotation angle of the to-be-imposition figure corresponding to the target to-be-imposition image, and record the figure rotation angle as a target rotation angle;
a thirteenth module, configured to rotate the target image to be imposition according to the target rotation angle to obtain a rotated image to be imposition;
a fourteenth module, configured to obtain, on target graphic imposition, a minimum circumscribed rectangular frame of a graphic to be imposed, which corresponds to a target image to be imposed, and mark the minimum circumscribed rectangular frame as a target rectangular frame;
and the fifteenth module is used for correspondingly pasting the rotated image to be imposition to the target rectangular frame according to the relative position relationship.
6. A printing imposition system for a flat development image of a packaging box according to claim 5 characterized in that it further comprises:
the termination button is used for terminating the imposition of the graph to be imposed;
a target chromosome hyperlink unit for establishing a hyperlink for each obtained target chromosome in real time;
the display unit is used for correspondingly displaying the graphic imposition corresponding to the clicked hyperlink when the established hyperlink is clicked;
the image imposition selection unit is used for manually selecting the optimal chromosome for image imposition by a user and submitting the manually selected optimal chromosome to the seventh module;
and the makeup optimization fine-tuning unit is used for carrying out makeup optimization adjustment on the target graphic makeup obtained based on the optimal chromosome selected by the graphic makeup selection unit in a manual mode.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110407809.6A CN112884656B (en) | 2021-04-15 | 2021-04-15 | Printing and imposition method and system for packing box plane expansion diagram image |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110407809.6A CN112884656B (en) | 2021-04-15 | 2021-04-15 | Printing and imposition method and system for packing box plane expansion diagram image |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112884656A CN112884656A (en) | 2021-06-01 |
CN112884656B true CN112884656B (en) | 2021-11-23 |
Family
ID=76040623
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110407809.6A Active CN112884656B (en) | 2021-04-15 | 2021-04-15 | Printing and imposition method and system for packing box plane expansion diagram image |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112884656B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113776437B (en) * | 2021-08-17 | 2022-06-07 | 北京科技大学 | High-precision medium plate width measuring method based on machine vision |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101140568A (en) * | 2007-10-24 | 2008-03-12 | 北大方正集团有限公司 | Automatic keyline layout method and apparatus |
CN101554785A (en) * | 2008-04-11 | 2009-10-14 | 北京方正国际软件***有限公司 | Method and system for packaging layout bleeding limit |
CN101645096A (en) * | 2008-08-07 | 2010-02-10 | 北京大学 | Imposition method |
CN101930615A (en) * | 2009-06-19 | 2010-12-29 | 北京大学 | Method and system for regulating bleeding line of pasteup object |
CN102795373A (en) * | 2011-05-25 | 2012-11-28 | 乐天包装(北京)有限公司 | Box blank assemblies for making packaging box, die pressing plate and method for making box blank |
KR102162088B1 (en) * | 2019-12-06 | 2020-10-06 | 이정석 | Method for auto nest building to using genetic algorithm smart auto nesting of programs |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080266606A1 (en) * | 2007-04-24 | 2008-10-30 | Huenemann Geoffrey W | Optimized print layout |
CN101844464B (en) * | 2010-04-30 | 2012-07-04 | 西安环球印务股份有限公司 | Medicine package typesetting system and typesetting method |
CN104778300A (en) * | 2015-02-10 | 2015-07-15 | 陕西学前师范学院 | Three-dimensional design method of packaging paper box |
-
2021
- 2021-04-15 CN CN202110407809.6A patent/CN112884656B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101140568A (en) * | 2007-10-24 | 2008-03-12 | 北大方正集团有限公司 | Automatic keyline layout method and apparatus |
CN101554785A (en) * | 2008-04-11 | 2009-10-14 | 北京方正国际软件***有限公司 | Method and system for packaging layout bleeding limit |
CN101645096A (en) * | 2008-08-07 | 2010-02-10 | 北京大学 | Imposition method |
CN101930615A (en) * | 2009-06-19 | 2010-12-29 | 北京大学 | Method and system for regulating bleeding line of pasteup object |
CN102795373A (en) * | 2011-05-25 | 2012-11-28 | 乐天包装(北京)有限公司 | Box blank assemblies for making packaging box, die pressing plate and method for making box blank |
KR102162088B1 (en) * | 2019-12-06 | 2020-10-06 | 이정석 | Method for auto nest building to using genetic algorithm smart auto nesting of programs |
Non-Patent Citations (3)
Title |
---|
Algorithms for 2D nesting problem based on the no-fit polygon;D. Domovic 等;《2014 37th International Convention on Information and Communication Technology, Electronics and Microelectronics (MIPRO)》;20140724;1094-1099 * |
基于Android的纸盒智能排版及快速报价***;罗文 等;《计算机应用与软件》;20190531;第36卷(第5期);25-29 * |
基于NFP算法下印前拼版设计及成本控制研究;张晓艳 等;《安阳工学院学报》;20130731;第12卷(第4期);8-11 * |
Also Published As
Publication number | Publication date |
---|---|
CN112884656A (en) | 2021-06-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP3787743B2 (en) | Mesh generator for numerical analysis | |
JP6439358B2 (en) | Method, apparatus, user computer and cloud computer for CAD | |
RU2430421C2 (en) | Applying effects to merged text path | |
CN111340054A (en) | Data labeling method and device and data processing equipment | |
US20100030538A1 (en) | Method and aids for modelling 3d objects | |
CN109101410B (en) | Risk drive testing method and device and computer readable storage medium | |
CN112884656B (en) | Printing and imposition method and system for packing box plane expansion diagram image | |
JP3968056B2 (en) | Shape creation apparatus, control method for operating computer apparatus as shape creation apparatus, and computer-executable program for causing computer apparatus to execute control method | |
CN109359208A (en) | A kind of distributed method and system of precisely lossless mark image instance | |
US11967010B2 (en) | Digital artboard angular snapping guides | |
JP4994199B2 (en) | Machine learning apparatus and machine learning method | |
JP6028703B2 (en) | Graph generation apparatus, graph generation method, and graph generation program | |
JP3931701B2 (en) | Image generating apparatus and program | |
CN112437919A (en) | Steady graph layout determination | |
JP3786412B2 (en) | Fillet creation method and 3D CAD program | |
JP2009301410A (en) | Design support system and computer program | |
CN111429541B (en) | Graphic erasing method and device | |
JPH09172453A (en) | Circulating job control method and device therefor | |
KR100886657B1 (en) | System and Method for making Basic Document of Dimensional Accuracy Check Sheet for Block in Ship Production | |
JPH06168223A (en) | Pipe network analyzing device, data display device for the same and graphic generating method | |
JPH06259507A (en) | Graphic dividing device | |
JP4549805B2 (en) | Design data generation system, design data generation method, design data generation program | |
JP2005332183A (en) | Device and method for mesh correction, and program | |
CN117830803A (en) | Image labeling method, device, electronic equipment and storage medium | |
JP3358433B2 (en) | Interactive drawing recognition processing method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |