A kind of method and system of Modify rapidly trapping direction
Technical field
The present invention relates to image processing field, be specifically related to a kind of method and system of Modify rapidly trapping direction.
Background technology
Trapping also makes mending-leakage white, is also called scalable, mainly to cause the leakage between two adjacent different colours white because printing register trouble in order to make up.When people are in the face of printed matter, always sensation is dark from human eye close to, light away from human eye, therefore, when carrying out trapping process to original copy, always manage not allow the light color under dark color expose, and dark color above remains unchanged, to ensure not affect visual effect.Implement trapping process and also will follow certain principle, be generally expand lower look not expand colouring, expand light color and do not expand dark color, also have and expand plain net and the meaning that do not expand on the spot.Sometimes also can expand mutually, in particular cases then will carry out reverse trap, even also will add space to make up overprint error between two adjacent looks, to make printed matter attractive in appearance.After trapping completes, because user often will change trapping direction, existing amending method is mainly selected by the ground on the manual border, a border of user, and is switched in trapping look counter plate and changes trapping direction.But the method expends the long period, efficiency is low, and the present invention is just just to the defect existed in prior art, and the method and system in a kind of Modify rapidly trapping direction proposed, improve repeatedly the efficiency of trapping.
Summary of the invention
For the defect existed in prior art, the object of the present invention is to provide a kind of method and system of Modify rapidly trapping direction, improve the efficiency of trapping direction amendment.
For achieving the above object, the technical solution used in the present invention is as follows:
The method in Modify rapidly trapping direction, comprises the following steps:
(1) determine the initial trapping border and the terminal trapping border that need amendment trapping direction in image, obtain trapping border path according to initial trapping border and terminal trapping border; Described trapping border path refers to the shortest path be made up of the trapping border between initial trapping border and terminal trapping border;
(2) setting is with reference to trapping border, determines with reference to trapping look pair; Described reference trapping border refers to the trapping border comprised in the trapping border path of being specified by user; Described reference trapping look is to the color lump referred to reference to trapping boundaries on either side;
(3) determine the trapping direction with reference to trapping border, according to the trapping direction with reference to trapping border, other trapping border in trapping border path is carried out to the amendment in trapping direction.
Further, the method in a kind of Modify rapidly trapping direction as above, in step (1), obtain trapping border path by shortest-path method, concrete mode is:
Search all paths between initial trapping border and terminal trapping border, and the length on all trapping borders of record path process, obtain the length in path, the shortest path of length is trapping border path.
Further, the method in a kind of Modify rapidly trapping direction as above, in step (3), the described trapping direction with reference to trapping border is the reverse of former trapping direction or former trapping direction.
Further, the method in a kind of Modify rapidly trapping direction as above, in step (3), according to the trapping direction with reference to trapping border to the concrete mode that the amendment in trapping direction is carried out on other trapping border in trapping border path is:
A. search the trapping border be connected with reference trapping border in other trapping border, trapping is carried out according to the trapping direction with reference to trapping border in this trapping border;
B. search the border that the ink of trapping boundaries on either side color lump in other trapping border is all identical with the ink with reference to trapping look right, trapping is carried out according to the trapping direction with reference to trapping border in this trapping border;
C. the ink searching trapping boundaries on either side color lump in other trapping border with reference to the identical border of trapping look centering color lump ink, during trapping this identical ink color lump enter or by the same oil mass colour block of the relation of entering and reference trapping look centering enter or identical by the relation of entering;
D. the residue border in other trapping border is revised; Processing mode is: check whether the trapping direction with reference to trapping border is former trapping direction, if then remain not revising of border; The trapping direction then remaining border is if not the reverse of its former trapping direction.
Further again, the method in a kind of Modify rapidly trapping direction as above, if a certain trapping border in trapping border path does not need the amendment in trapping direction, in step (3) to other trapping border outside this trapping border in trapping border path, modify according to the trapping direction with reference to trapping border.
Further, the method in a kind of Modify rapidly trapping direction as above, in step a, trapping border is connected with reference trapping border and refers to that this trapping border is positioned on same curve with reference to trapping border.
The system in Modify rapidly trapping direction, comprising:
Trapping path chosen module: for determining the initial trapping border and the terminal trapping border that need amendment trapping direction in image, obtain trapping border path according to initial trapping border and terminal trapping border; Described trapping border path refers to the shortest path be made up of the trapping border between initial trapping border and terminal trapping border;
With reference to border setting module: for setting with reference to trapping border, determine with reference to trapping look pair; Described reference trapping border refers to the trapping border comprised in the trapping border path of being specified by user; Described reference trapping look is to the color lump referred to reference to trapping boundaries on either side;
Trapping module: for determining the trapping direction with reference to trapping border, and other trapping border in trapping border path is carried out to the amendment in trapping direction according to the trapping direction with reference to trapping border.
Further, the system in a kind of Modify rapidly trapping direction as above, described trapping module comprises:
The boundary trap that is connected unit: for searching the trapping border be connected with reference trapping border in trapping border path, trapping is carried out according to the trapping direction with reference to trapping border in the trapping border be connected;
Color lump is to ink identical boundary trap unit: the border that the ink for searching trapping boundaries on either side color lump in other trapping border is all identical with the ink with reference to trapping look right, and trapping is carried out according to the trapping direction with reference to trapping border in this trapping border;
Single ink identical boundary trap unit: for the ink of searching trapping boundaries on either side color lump in other trapping border with reference to the identical border of trapping look centering color lump ink, during trapping this identical ink color lump enter or by this same oil mass colour block of the relation of entering and reference trapping look centering enter or identical by the relation of entering;
Residue boundary trap unit: for revising the trapping direction remaining border in other trapping border; Alter mode is: check whether the trapping direction with reference to trapping border is former trapping direction, if then remain not revising of border; The trapping direction then remaining border is if not the reverse of its former trapping direction.
Beneficial effect of the present invention is: method and system of the present invention can realize the repeatedly automatic trapping direction on trapping border fast, is selected the method on trapping border by head and the tail, substantially increases trapping direction amendment efficiency.
Accompanying drawing explanation
Fig. 1 is the structured flowchart of the system in a kind of Modify rapidly trapping of the present invention direction;
Fig. 2 is the flow chart of the method in a kind of Modify rapidly trapping of the present invention direction;
Fig. 3 is the schematic diagram determining trapping border path in detailed description of the invention;
Fig. 4 determines the schematic diagram with reference to trapping border in detailed description of the invention;
Fig. 5 is trapping border and schematic diagram when being connected with reference to trapping border in detailed description of the invention;
Fig. 6 is two color lumps and the schematic diagram while of the two color lump ink homogeneous phases with reference to trapping look right that in detailed description of the invention, trapping look right;
Fig. 7 be a color lump that in detailed description of the invention, trapping look right identical with a color lump ink with reference to trapping look right time schematic diagram.
Detailed description of the invention
Below in conjunction with Figure of description and detailed description of the invention, the present invention is described in further detail.
Fig. 1 shows the structured flowchart of the system in a kind of Modify rapidly trapping of the present invention direction, and this system comprises trapping path chosen module 11, reference border setting module 12 and trapping module 13, wherein:
Mould 11 is selected for determining to need in image initial trapping border and the terminal trapping border in amendment trapping direction in trapping path, obtains trapping border path according to initial trapping border and terminal trapping border; Described trapping border path refers to the shortest path be made up of the trapping border between initial trapping border and terminal trapping border;
With reference to border setting module 12 for setting with reference to trapping border, determine with reference to trapping look pair; Described reference trapping border refers to the trapping border comprised in the trapping border path of being specified by user; Described reference trapping look is to the color lump referred to reference to trapping boundaries on either side;
Trapping module 13 for determining the trapping direction with reference to trapping border, and carries out the amendment in trapping direction according to the trapping direction with reference to trapping border to other trapping border in trapping border path; This trapping module comprises:
The boundary trap that is connected unit: for searching the trapping border be connected with reference trapping border in trapping border path, trapping is carried out according to the trapping direction with reference to trapping border in the trapping border be connected;
Color lump is to ink identical boundary trap unit: the border that the ink for searching trapping boundaries on either side color lump in other trapping border is all identical with the ink with reference to trapping look right, and trapping is carried out according to the trapping direction with reference to trapping border in this trapping border;
Single ink identical boundary trap unit: for the ink of searching trapping boundaries on either side color lump in other trapping border with reference to the identical border of trapping look centering color lump ink, during trapping this identical ink color lump enter or by this same oil mass colour block of the relation of entering and reference trapping look centering enter or identical by the relation of entering;
Residue boundary trap unit: for revising the trapping direction remaining border in other trapping border; Alter mode is: check whether the trapping direction with reference to trapping border is former trapping direction, if then remain not revising of border; The trapping direction then remaining border is if not the reverse of its former trapping direction.
Fig. 2 shows the flow chart of the method in a kind of Modify rapidly trapping of the present invention direction, and as can be seen from Figure, the method mainly comprises the following steps:
Step S21: obtain trapping border path according to initial trapping border and terminal trapping border;
Determine the initial trapping border and the terminal trapping border that need amendment trapping direction in image, obtain trapping border path according to initial trapping border and terminal trapping border; Described trapping border path refers to the shortest path be made up of the trapping border between initial trapping border and terminal trapping border.Obtain trapping border path by shortest-path method, concrete mode is:
Search all paths between initial trapping border and terminal trapping border, and the length on all trapping borders of record path process, obtain the length in path, the shortest path of length is trapping border path.
As shown in Figure 3, user chooses the trapping border 1 in figure as initial trapping border, trapping border 2 is as terminal trapping border, the path that trapping border between initial trapping border 1 and terminal trapping border 2 forms is by two, i.e. path 1-3-4-5-2 and path 1-6-2, although path 1-6-2 the number on border of process less, but 3,4,5 three, the trapping border path formed is less than the length on trapping border 6, so choose the path that trapping border 1,3,4,5,2 forms into boundary trap path.
Step S22: setting, with reference to trapping border, is determined with reference to trapping look pair;
Setting, with reference to trapping border, determines that described reference trapping border refers to the trapping border comprised in the trapping border path of being specified by user with reference to trapping look pair; Described reference trapping look is to the color lump referred to reference to trapping boundaries on either side.
Complete in the step s 21 trapping border path selected after, in trapping border path selected one wherein trapping border is as with reference to trapping border, the color lump with reference to trapping boundaries on either side be reference trapping look pair.As shown in Figure 4, trapping was there is between color lump C and color lump M, color lump M is for entering color lump, color lump C is for be entered color lump, namely former trapping direction color lump M enters color lump C, if choose the trapping border between C color lump and M block to be L as with reference to trapping border, then color lump C and color lump M is reference trapping look pair.
Step S23: the amendment according to the trapping direction with reference to trapping border, other trapping border in trapping border path being carried out to trapping direction.
Determine the trapping direction with reference to trapping border, according to the trapping direction with reference to trapping border, other trapping border in trapping border path is carried out to the amendment in trapping direction.Be the reverse of former trapping direction or former trapping direction with reference to the trapping direction on trapping border.When carrying out the amendment in other trapping boundary trap direction according to the trapping direction with reference to trapping border, if a certain trapping border in trapping border path does not need the amendment in trapping direction, in this step, user can only modify to other trapping border outside this trapping border in trapping border path as required.
As in Fig. 5, using color lump C1 and color lump M as reference trapping border, determine that its trapping direction is for enter C1 by M, the former trapping direction between color lump C1 and color lump M is that color lump C1 enters color lump, so the trapping direction on the reference trapping border of this step is the reverse of former trapping direction.According to the trapping direction with reference to trapping border to the concrete mode that the amendment in trapping direction is carried out on other trapping border in trapping border path be:
A. search the trapping border be connected with reference trapping border in other trapping border, trapping is carried out according to the trapping direction with reference to trapping border in this trapping border; Wherein, trapping border is connected with reference trapping border and refers to that this trapping border is positioned on same curve with reference to trapping border.
As the border between the color lump C2 in Fig. 5 and color lump Y1, and the border between color lump Y2 and color lump C3 is located on the same line with reference to trapping border, border then between color lump C2 and color lump Y1, and the border between color lump Y2 and color lump C3 is and the trapping border be connected with reference to trapping border, its trapping direction is consistent with the direction with reference to trapping border, namely color lump Y1 enters color lump C2, and color lump C3 enters color lump Y2.
B. search the border that the ink of trapping boundaries on either side color lump in other trapping border is all identical with the ink with reference to trapping look right, trapping is carried out according to the trapping direction with reference to trapping border in this trapping border;
If trapping look corresponding to trapping border is pair identical with the ink with reference to trapping look right, then the trapping that its trapping direction will be kept right with the trapping look that user selects is identical.As shown in Figure 6, with reference to trapping look to for look to M1 and look to C1, trapping direction is the reverse of former trapping direction, namely color lump M1 enters color lump C1, the right ink of trapping look corresponding to two trapping borders selected is identical, enter color lump C1 with reference to trapping look centering color lump M1, and the trapping direction of color lump C2 and color lump M2 needs and the trapping direction of color lump C1 and color lump M1 is consistent, namely color lump M2 enters color lump C1.
C. the ink searching trapping boundaries on either side color lump in other trapping border with reference to the identical border of trapping look centering color lump ink, during trapping this identical ink color lump enter or by the same oil mass colour block of the relation of entering and reference trapping look centering enter or identical by the relation of entering.
If trapping look corresponding to trapping border is identical with the ink with reference to trapping look right to there being a color lump, entering of same oil mass colour block then will be kept identical with by the relation of entering, as shown in Figure 7, there is the ink of a color lump identical with trapping look to (color lump M and color lump Y) to (color lump C and color lump M) with reference to trapping look, the trapping direction with reference to trapping look right is that color lump M enters color lump C, then color lump M also should enter color lump Y, and namely the color lump M of identical ink is and enters color lump.
D. the residue border in other trapping border is revised; Processing mode is: check whether the trapping direction with reference to trapping border is former trapping direction, if then remain not revising of border; The trapping direction then remaining border is if not the reverse of its former trapping direction;
If trapping look corresponding to trapping border pair with reference to trapping look to when there is not the above-mentioned three kinds of relations of a, b, c, if with reference to trapping look to being reversed, then other these type of trapping looks are to also oppositely necessary, if the trapping direction namely with reference to trapping border is the reverse of former trapping direction, other trapping border also should be the reverse of its former trapping direction.By this kind of trapping direction amending method, make to need the trapping border in amendment trapping direction consistent with the trapping direction on selected reference trapping border, make area of trap more smoothly coherent, trapping effect is better.
Obviously, those skilled in the art can carry out various change and modification to the present invention and not depart from the spirit and scope of the present invention.Like this, if these amendments of the present invention and modification belong within the scope of the claims in the present invention and equivalent technology thereof, then the present invention is also intended to comprise these change and modification.