CN102547059A - Trap printing method and system based on boundary - Google Patents

Trap printing method and system based on boundary Download PDF

Info

Publication number
CN102547059A
CN102547059A CN2010106069905A CN201010606990A CN102547059A CN 102547059 A CN102547059 A CN 102547059A CN 2010106069905 A CN2010106069905 A CN 2010106069905A CN 201010606990 A CN201010606990 A CN 201010606990A CN 102547059 A CN102547059 A CN 102547059A
Authority
CN
China
Prior art keywords
border
seal
sunken
pixel point
coefficient
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.)
Pending
Application number
CN2010106069905A
Other languages
Chinese (zh)
Inventor
张宏志
袁梦尤
李平立
杨文鲜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Peking University
Founder International Beijing Co Ltd
Original Assignee
Peking University
Founder International Beijing Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Peking University, Founder International Beijing Co Ltd filed Critical Peking University
Priority to CN2010106069905A priority Critical patent/CN102547059A/en
Publication of CN102547059A publication Critical patent/CN102547059A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Analysis (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Editing Of Facsimile Originals (AREA)

Abstract

The invention relates to a trap printing method and system based on a boundary and belongs to the technical field of trap printing. The trap printing method comprises the following steps of: firstly, extracting the boundary of an image to be subjected to the trap printing; determining the distance and direction from each pixel point within a pre-set width range T1 at two sides of the boundary to the boundary which is closest to the pixel point; and then, determining trap printing attributes of the boundary and color channels at two sides of the boundary; and then, determining the gradient amplitude and direction of the pixel point needing to be subjected to the trap printing; determining weight coefficients of the adjacent pixel points in a trap printing template according to the gradient amplitude and direction of a central pixel point; and finally, carrying out the trap printing on the pixel point needing to be subjected to the trap printing through the trap printing template. According to the invention, structural information of an original image can be maintained as much as possible and the trap printing quality of the image is improved.

Description

A kind of trapping method and system based on the border
Technical field
The invention belongs to the sunken seal technical field in the image processing, be specifically related to a kind of trapping method and system based on the border.
Background technology
Sunken seal also makes mending-leakage white, be called again scalable, mainly be for remedy because of the printing register trouble cause two leakages between the adjacent different colours white.The trapping method that exists at present mainly contains two types: based on the sunken seal method (like the Photoshop image trapping) of neighborhood with based on the sunken seal method on border.
Trapping method based on neighborhood is that the neighborhood analysis is carried out in the full figure pointwise, calculates its sunken seal value according to the colouring information in this vertex neighborhood.This trapping method is too responsive, and a lot of trickle parts in natural image inside are all changed, and is actually unwanted, and is big to the destruction of image.In general only hope natural image and background bulk pure color intersection are fallen into seal and to falling into seal between the remarkable stable color block in natural image inside, promptly fall into seal based on image boundary.
Based on the border that the sunken seal method on border is at first extracted image, each border of traversing graph picture according to the brightness of boundaries on either side and the sunken seal attribute of CMYK information and foundation certain principle this border of judgement and each passage of both sides thereof, falls into seal more then.Fall into seal when handling, the technology that adopts at present is that the traversal boundary vicinity satisfies the point that falls into the seal condition, and recurrence is sought recently with the border homonymy and fallen into the point of seal or with the point of border heteropleural, fallen into seal in its eight neighborhood.This method is not considered the structural information of original image, and bigger to the image information destruction of boundaries on either side, it is more stiff, not attractive in appearance to fall into the seal result simultaneously.
Summary of the invention
To the defective that exists in the prior art, technical problem to be solved by this invention provides a kind of trapping method and system based on the border.These method and system can keep the structural information of original image as much as possible, improve the sunken seal quality of image.
For solving the problems of the technologies described above, the technical scheme that the present invention adopts is following:
A kind of trapping method based on the border may further comprise the steps:
(1) extracts the border of treating in the sunken watermark image;
(2) confirm boundaries on either side setting width T 1Distance and direction between the border that each pixel in the scope arrives and this pixel is nearest;
(3) confirm the sunken seal attribute of border and each Color Channel of boundaries on either side, said sunken seal attribute comprise whether fall into seal and sunken India side to;
(4) confirm to fall into the gradient magnitude and the direction of the pixel of seal;
The weights coefficient of (5) confirming to fall into neighborhood territory pixel point in the die plate according to the gradient magnitude and the direction of central pixel point;
(6) utilize sunken die plate that the pixel that needs fall into seal is fallen into seal.
Aforesaid trapping method based on the border, it is following to extract the method for treating the border in the sunken watermark image described in the step (1):
Extract the crosspoint between border and the border;
The trend difference between the border is in twos being calculated through in all borders in current crosspoint in the traversal crosspoint, connects two minimum borders of trend difference.
Trapping method based on the border as implied above, wherein, trend difference adopts following formula to calculate:
P 1 [ j ] = Σ i = 0 length 1 Dir j × w i length 1 ( j = 0,1,2,3 )
P 2 [ j ] = Σ i = 0 length 2 Dir j × w i length 2 ( j = 0,1,2,3 )
Sum = Σ j = 0 4 ( | P 1 [ j ] - P 2 [ j ] | )
Similar=Sum+(length-min(length1,length2))×w length
Wherein, Similar representes the trend difference between border 1 and the border 2, P 1[j], P 2[j] representes the trend on border 1 and border 2 respectively;
Figure BSA00000399238400024
When current direction is j, Dir jBe 1; Otherwise, get 0;
w iExpression is relevant to the weights of current point apart from intersection, 0<w i≤1; w LengthExpression is relevant to the weights that length is set, 0≤w Length≤1; The length that the participation that length representes to be provided with is calculated; Length1 representes border 1 actual length of participating in calculating; Length2 representes border 2 actual length of participating in calculating, if the length that boundary length is calculated less than the participation that is provided with, actual length of participating in calculating is boundary length.
Aforesaid trapping method based on the border, Color Channel is the CMYK passage described in the step (3), definite method of said sunken seal attribute is following:
Confirm the sunken seal attribute on border;
Confirm the sunken seal attribute of each passage of boundaries on either side pixel CMYK;
If in the CMYK passage of boundaries on either side, do not fall into India side to opposite passage, then this border need not fall into seal; Otherwise, need fall into seal with the preset India side that falls on border to consistent passage, its sunken India side is to falling into India side to identical with presetting of this passage.
Aforesaid trapping method based on the border, wherein, definite method of the sunken seal attribute on border is following:
Width T is set in the computation bound both sides respectively 2The average brightness of all pixels in the scope;
If the difference of boundaries on either side average brightness surpasses setting threshold M, then preset this border need fall into seal, and the preset India side that falls into is to be to fall into from the low side of the high side direction average brightness of average brightness to print.
Aforesaid trapping method based on the border, wherein, definite method of the sunken seal attribute of passage is following:
Width T is set in the computation bound both sides respectively 2The mean value of the color ink amount of all each passages of pixel in the scope;
If the difference of the mean value of the color ink amount of boundaries on either side passage surpasses setting threshold M, then preset this passage need fall into seal, and the preset India side that falls into is to be to fall into from the low side of the high side direction color ink amount mean value of color ink amount mean value to print.
Aforesaid trapping method based on the border wherein, is set width T 2=Max (5 pixels, trap width), said threshold value M=5.
Aforesaid trapping method based on the border; Also comprise the step that confirm to fall into the seal masking-out before in step (4), said sunken seal masking-out be used in reference to be shown in lateral extent border, the area of trap side of entering set in the width T3 scope pixel with fall into seal and need be fallen into by the pixel in the side's of enteringing side trap width scope and print processing.Said setting width T 3It is 1 or 2 pixel width.
Aforesaid trapping method based on the border, definite method of gradient magnitude described in the step (4) and direction is following:
Confirm that at first the area of trap side of entering side falls into the gradient magnitude and the direction of the outer pixel of seal masking-out, confirm to fall into the gradient magnitude and the direction of printing masking-out interior pixel point based on the gradient magnitude and the direction of the outer pixel of the sunken seal of the area of trap side of entering side masking-out then.
The gradient magnitude of said sunken seal masking-out interior pixel point and the computational methods of direction are following:
At first confirm the weights coefficient of neighborhood territory pixel point in the gradient template;
1. confirm distance coefficient: neighborhood territory pixel point is more little with the central pixel point distance, and its weights coefficient is big more;
2. confirm direction coefficient: the vertical direction of neighborhood territory pixel point gradient direction approaches central pixel point more, and its weights coefficient is big more;
3. distance coefficient * the direction coefficient of weights coefficient=this neighborhood territory pixel point of neighborhood territory pixel point;
The compute gradient template gradient magnitude weighted sum of caving in seal entering side or closing on neighborhood territory pixel point on each gradient direction of entering side's side then, and write down the maximum weighted gradient in the neighborhood territory pixel point on each direction;
The gradient direction that the gradient magnitude weighted sum is maximum is as the gradient direction of central pixel point, and the maximum weighted gradient of this direction is as the gradient magnitude of central pixel point.
Aforesaid trapping method based on the border, the definite method that falls into the weights coefficient of neighborhood territory pixel point in the die plate described in the step (5) is following:
Confirm the amplitude coefficient of neighborhood territory pixel point: the gradient magnitude of central pixel point is big more, and the amplitude coefficient of neighborhood territory pixel point is more little; Wherein, 0≤amplitude coefficient≤1;
Confirm the direction coefficient of neighborhood territory pixel point: the vertical direction of the gradient direction of central pixel point approaches the neighborhood territory pixel point more, and the direction coefficient of this neighborhood territory pixel point is big more; Wherein, 0≤direction coefficient≤1;
Amplitude coefficient * the direction coefficient of weights coefficient=this neighborhood territory pixel point of neighborhood territory pixel point.
Aforesaid trapping method based on the border, wherein, if the gradient magnitude of central pixel point less than setting threshold MIN, then the amplitude coefficient with neighborhood territory pixel point is made as 1; If greater than setting threshold MAX, then the amplitude coefficient with neighborhood territory pixel point is made as 0; If between MIN to MAX, then five equilibrium successively decreases.
Aforesaid trapping method based on the border, the process of the sunken seal described in the step (6) is following:
All pixels to falling in the seal masking-out carry out weighted average with the color value that falls into all neighborhood territory pixel points in the die plate, obtain falling into the sunken seal value of central pixel point in the die plate;
Keep each sunken seal result, the sunken seal result that sunken seal was next time handled with last time is basis, and this process of iteration constantly is until the iterations that surpasses setting.
Aforesaid trapping method based on the border, the process of the sunken seal described in the step (6) is following:
To all pixels that fall in the seal masking-out, the color value that falls into the side's of enteringing side in the die plate or close on the neighborhood territory pixel point of the side's of enteringing side is carried out weighted average, obtain the sunken seal value of the interior central pixel point of sunken die plate;
Keep each sunken seal result, the sunken seal result that sunken seal was next time handled with last time is basis, and this process of iteration constantly is until the iterations that surpasses setting.
Aforesaid trapping method based on the border, wherein, iterations is greater than 2~3 times of the trap width value, but should be less than 30 times.
Aforesaid trapping method based on the border; Wherein, For falling into the cave in pixel of seal entering side side of seal masking-out; According to pixel to its distance and the gradient magnitude on contiguous border set the attenuation coefficient of this pixel, to the result of iteration each time of these pixels in the sunken seal process, remake behind the attenuation coefficient in addition and be the sunken seal value before the next iteration.
Said attenuation coefficient S adopts following formula to calculate:
S = ( 1 - Mag - MIN MAX - MIN ) × D
Wherein, Mag is the gradient magnitude of pixel; D is a distance coefficient, 0≤D≤1.
A kind of sunken seal system based on the border comprises being used for extracting the Boundary Extraction device of waiting to fall into the watermark image border;
Be used for confirming boundaries on either side set in the width T1 scope each pixel to and the nearest border of this pixel between distance and the distance and the direction of direction confirm device;
Be used for confirming that the sunken seal attribute of border and each Color Channel of boundaries on either side confirms device, said sunken seal attribute comprise whether fall into seal and sunken India side to;
Be used for confirming that needs fall into the gradient magnitude of the pixel that prints and the gradient of direction is confirmed device;
Be used for confirming device according to the gradient magnitude and the definite weights coefficient that falls into die plate weights coefficient of direction of pixel;
Be used to utilize sunken die plate that the pixel that needs fall into seal is fallen into the sunken printing device that prints.
Aforesaid sunken seal system based on the border also comprises and confirms that the masking-out that falls into the seal masking-out confirms device; Said sunken seal masking-out is used in reference to and is shown in lateral extent border, the area of trap side of entering setting width T 3Pixel in the scope need be fallen into the seal processing with sunken seal by the pixel in entering side's side trap width scope.
The method of the invention and system when confirming to fall into the weights coefficient of die plate, have introduced the gradient analysis of pixel, therefore can keep the structural information of original image as much as possible, have improved the sunken seal quality of image.Through utilizing the pixel color value that falls into the side's of an enteringing side in the die plate or an adjacent side to carry out weighted average, obtain the mode of the sunken seal value of the interior central pixel point of sunken die plate simultaneously, also realized the effect of sunken India and China branch with enterings side.
Description of drawings
Fig. 1 is based on the structured flowchart of the sunken seal system on border in the embodiment;
Fig. 2 is based on the flow chart of the trapping method on border in the embodiment;
Fig. 3 is the flow chart of waiting to fall into the boundary extraction method in the watermark image in the embodiment;
Fig. 4 is a flow chart of confirming the sunken seal attribution method of a boundary pixel point in the embodiment;
Fig. 5 is pixel and frontier distance and a direction sketch map in the embodiment;
Fig. 6 falls into seal masking-out sketch map in the embodiment;
Fig. 7 is a gradient template sketch map in the embodiment;
Fig. 8 falls into the die plate sketch map in the embodiment.
Embodiment
Describe the present invention below in conjunction with embodiment and accompanying drawing.
Fig. 1 shows in this execution mode the structure based on the sunken seal system on border.As shown in Figure 1; This system comprises Boundary Extraction device 11, and the distance and the direction that are connected with Boundary Extraction device 11 are confirmed device 12, confirms that with distance and direction the sunken seal attribute that device 12 is connected confirms device 13; With fall into the seal attribute and confirm that the masking-out that device 13 is connected confirms device 14; Confirm that with masking-out the gradient that device 14 is connected confirms device 15, confirm that with gradient the weights coefficient that device 15 is connected confirms device 16, and confirm the sunken printing device 17 that device 16 is connected with the weights coefficient.
Boundary Extraction device 11 is used for extracting the border of waiting to fall into watermark image.
Distance and direction confirm that device 12 is used for confirming boundaries on either side setting width T 1Distance and direction between the border that each pixel in the scope arrives and this pixel is nearest.
Fall into the seal attribute and confirm that device 13 is used for confirming the sunken seal attribute of border and each Color Channel of boundaries on either side, said sunken seal attribute comprise whether fall into seal and sunken India side to.
Masking-out confirms that device 14 is used for confirming to fall into the seal masking-out.
Gradient confirms that device 15 is used for confirming that needs fall into the gradient magnitude and the direction of the pixel of seal.
The weights coefficient confirms that device 16 is used for the weights coefficient of confirming to fall into die plate according to the gradient magnitude and the direction of pixel.
Falling into printing device 17 is used to utilize sunken die plate that the pixel that needs fall into seal is fallen into seal.
Fig. 2 shows and adopts system shown in Figure 1 image to be fallen into the method flow of seal.As shown in Figure 2, this method may further comprise the steps:
(1) Boundary Extraction device 11 extracts and waits to fall into the border in the watermark image.
In this step, adopt existing boundary extraction algorithm to extract when waiting to fall into the border of watermark image, possibly exist a border to be divided into the situation on many borders, so present embodiment adopts following method extraction to wait to fall into the border in the watermark image.As shown in Figure 3, this method comprises the steps:
1. extract the crosspoint between border and the border.
2. travel through the crosspoint.
3. calculating the trend difference between the border in twos through in all borders in current crosspoint.
Said trend difference is meant the trend based on the border, keeps the connection or the fractionation on two borders according to preset rules, with two borders keeping connecting as a BORDER PROCESSING.In this execution mode, the trend difference between two borders (border 1 and border 2) is calculated through following formula:
P 1 [ j ] = Σ i = 0 length 1 Dir j × w i length 1 ( j = 0,1,2,3 )
P 2 [ j ] = Σ i = 0 length 2 Dir j × w i length 2 ( j = 0,1,2,3 )
Sum = Σ j = 0 4 ( | P 1 [ j ] - P 2 [ j ] | )
Similar=Sum+(length-min(length1,length2))×w length
Wherein, Similar representes the trend difference between border 1 and the border 2.P 1[j], P 2[j] representes the trend (promptly the four directions is to probability) on border 1 and border 2 respectively.
When current direction is j, Dir jBe 1; Otherwise, get 0.
w iExpression is relevant to the weights of current point apart from intersection, 0<w i≤1.w LengthExpression is relevant to the weights that length is set, 0≤w Length≤1; The length that the participation that length representes to be provided with is calculated, 5 pixel width≤length≤15 pixel width; Length1 representes border 1 actual length of participating in calculating; Length2 representes border 2 actual length of participating in calculating.The physical length on border may be less than the participation computational length that is provided with, if the length that the physical length on border is calculated less than the participation that is provided with, actual length of participating in calculating is the physical length on border.
4. connect two minimum borders of trend difference.
5. judging whether the crosspoint travels through finishes; In this way, then finish; As not, then go to step 2..
(2) distance and direction are confirmed device 12 definite boundaries on either side setting width T 1Distance and direction between the border that each pixel in the scope arrives and this pixel is nearest.Said direction is used for the position that the remarked pixel point is positioned at the border.
The direction on border is to point to terminal point by the starting point on border.Can be based on the discriminating direction pixel on border on the left side or the right side on border, can be provided with pixel in the left side on border for negative, the right side is for just.Said setting width T 1Set according to concrete applicable cases, should be greater than the trap width of setting.
As shown in Figure 5, each grid is represented a pixel, lines 51 expression borders, boundary direction from the bottom to top, the numeral pixel in the grid to the distance on the nearest border 51 of this pixel.Pixel on the border 51 left direction for negative; Right direction is for just; Can judge left side or the right side of pixel at an easy rate according to direction like this, for follow-up judgement pixel is to fall into seal entering side's pixel or fall into seal by entering side's pixel foundation to be provided on the border.
(3) fall into the seal attribute and confirm that device 13 confirms the sunken seal attribute of borders and each Color Channel of boundaries on either side, said sunken seal attribute comprise whether fall into seal and sunken India side to.
Fig. 4 shows the method flow of the sunken seal attribute of confirming a border and each Color Channel of boundaries on either side.In the present embodiment, Color Channel is the CMYK passage.Wherein, boundaries on either side is set width T 2Pixel in the scope can judge according to the distance of pixel to this border.This method comprises the steps:
Confirm the sunken seal attribute on border:
1. width T is set in the computation bound both sides respectively 2The average brightness of all pixels in the scope;
Whether the difference of 2. judging the boundaries on either side average brightness surpasses setting threshold M; In this way, then preset this border need fall into seal, and the preset India side that falls into is to be to fall into from the low side of the high side direction average brightness of average brightness to print; Otherwise this border need not to fall into seal.Said setting range T=Max (5 pixels, trap width), i.e. T 2Get the greater (trap width is set according to practical application request) of 5 pixels and trap width.In this execution mode, threshold value M gets 5.
Confirm the sunken seal attribute of each passage of boundaries on either side CMYK:
1. width T is set in the computation bound both sides respectively 2The mean value of the color ink amount of all each passages of pixel in the scope;
2. whether the difference of mean value of judging the color ink amount of boundaries on either side passage surpasses setting threshold M; In this way, then preset this passage need fall into seal, and the preset India side that falls into is to be to fall into from the low side of the high side direction color ink amount mean value of color ink amount mean value to print; Otherwise this passage need not to fall into seal.
If in the CMYK passage of boundaries on either side, do not fall into India side to opposite passage, then this border need not fall into seal; Otherwise, need fall into seal with the preset India side that falls on border to consistent passage, its sunken India side is to falling into India side to identical with presetting of this passage.
(4) masking-out is confirmed device 14 definite seal masking-outs that fall into.Said sunken seal masking-out is used in reference to and is shown in lateral extent border, the area of trap side of entering setting width T 3Pixel in the scope need be fallen into the seal processing with sunken seal by the pixel in entering side's side trap width scope.Fall into the seal masking-out and represented to fall into the position of printing the pixel of handling, comprise the partial pixel point that falls into seal entering side side and fall into all pixels that print by in entering side's side trap width scope.Said setting width T 3Be preferably 1 or 2 pixel width.
As shown in Figure 6, border 61 left field 62 are for falling into seal entering side, and right side area 63 is to fall into seal by entering side, fall into India side to the 61 left sides sensing right side from the border.Trap width is made as 5 pixel width, and then falling into the seal masking-out is the oblique line bar institute region covered among Fig. 6, and promptly the pixel in 5 the pixel width ranges of pixel and 61 right sides, border in two the pixel width ranges in 61 left sides, border need fall into seal.
Fall into and comprise in the seal masking-out that the purpose that falls into seal entering side 1 or 2 pixel width is for the influence to trapping effect such as the noise spot that overcomes the image boundary place, assorted point.Certainly, if picture quality is better, need not then to comprise that the pixel of 1 or 2 the pixel width range that falls into seal entering side (is promptly set width T 3Be 0), directly begun to fall into seal by entering side from falling into seal.
(5) 15 calculating of gradient calculation device need to fall into the gradient magnitude and the direction of the pixel (promptly falling into the pixel in the seal masking-out) of seal.
The main purpose of introducing gradient analysis is the tendency information that keeps original image.The concrete computational methods of gradient are following:
At first adopt CMYK image complex gradient computing formula to calculate gradient magnitude and direction that the area of trap side of entering side falls into the outer pixel of seal masking-out, gradient magnitude and the direction calculating according to the outer pixel of the sunken seal of the area of trap side of entering side masking-out falls into the gradient magnitude and the direction of seal masking-out interior pixel point then.
The gradient magnitude of sunken seal masking-out interior pixel point and the computational methods of direction are following:
For each pixel that falls in the seal masking-out, gradient magnitude and the direction of utilizing gradient template to cave in the seal side of enteringing or close on the neighborhood territory pixel point of entering side's side calculate the gradient information of this pixel (being the interior central pixel point of gradient template).As shown in Figure 7, said gradient template is n * n matrix, and except that the matrix central element, other elements all have the weights coefficient, and the weights coefficient is centrosymmetric.During concrete the application, the corresponding pixel (being called central pixel point) of central element, this pixel is a pixel of waiting to ask gradient magnitude and direction, other elements are one by one to the pixel (being called the neighborhood territory pixel point) in should the central pixel point neighborhood.The gradient magnitude of gradient template central pixel point and direction are confirmed based on the sunken seal entering side of gradient template or the gradient magnitude and the direction of closing on the neighborhood territory pixel point of entering side's side.For example, in Fig. 7, suppose that the left side is to fall into seal entering side, the right side is to fall into seal by entering side, and then the gradient magnitude of central pixel point and direction are confirmed based on the gradient magnitude and the direction of its left side 2 row neighborhood territory pixel points.The size of gradient template can be 3 * 3~7 * 7, is preferably 5 * 5.
At first confirm the weights coefficient of neighborhood territory pixel point in the gradient template.
To each the neighborhood territory pixel point in the gradient template, based on its gradient direction and with the distance of central pixel point, set the weights coefficient of this neighborhood territory pixel point.
1. confirm distance coefficient: neighborhood territory pixel point is more little with the central pixel point distance, and its weights coefficient is big more; 0.6≤distance coefficient≤1.
2. confirm direction coefficient: the vertical direction of neighborhood territory pixel point gradient direction approaches central pixel point more, and its weights coefficient is big more; 0.5≤direction coefficient≤1.
3. distance coefficient * the direction coefficient of weights coefficient=this neighborhood territory pixel point of neighborhood territory pixel point.
Utilize gradient template to confirm to fall into the gradient magnitude and the direction of seal masking-out interior pixel point then.
The gradient magnitude weighted sum (being the gradient magnitude weighted sum of the identical neighborhood territory pixel point of compute gradient direction) that the compute gradient template is caved in seal entering side or closed on neighborhood territory pixel point on each gradient direction of entering side's side, and write down the maximum weighted gradient in the neighborhood territory pixel point on each direction.The gradient direction that the gradient magnitude weighted sum is maximum is as the gradient direction of central pixel point, and the maximum weighted gradient on this direction is as the gradient magnitude of central pixel point.
(6) the weights coefficient is confirmed the weights coefficient that device 16 confirms to fall into die plate according to the gradient magnitude and the direction of pixel.
Said sunken die plate is identical with the form of gradient template, and for n * n matrix, except that the matrix central element, other elements all have the weights coefficient, and the weights coefficient is centrosymmetric.The corresponding pixel (being called central pixel point) of central element, this pixel is the pixel of waiting to fall into seal, its sunken seal value is by the color value and the decision of weights coefficient of the pixel in its neighborhood.Other elements are one by one to the pixel (being called the neighborhood territory pixel point) in should the central pixel point neighborhood.In this execution mode, sunken die plate is of a size of 3 * 3.
The weights coefficient that falls into die plate was both relevant with the amplitude of gradient, relevant with the direction of gradient again, also received the influence of gradient direction angle precision simultaneously.Gradient is big more, and key diagram picture the detailed information here is abundant more.In this execution mode, the definite method that falls into die plate weights coefficient is following:
1. confirm the amplitude coefficient of neighborhood territory pixel point.The gradient magnitude of central pixel point is big more, and the weights coefficient of other neighborhood points is more little.Wherein, 0≤amplitude coefficient≤1.
If the gradient magnitude of central pixel point is not more than setting threshold MIN, then the amplitude coefficient with neighborhood territory pixel point is made as 1; If be not less than setting threshold MAX, then the amplitude coefficient with neighborhood territory pixel point is made as 0; If between MIN to MAX, then five equilibrium successively decreases; Wherein, 0<MIN≤5,8≤MAX≤20.
For example: suppose that MIN gets 5, MAX gets 10; Amplitude is smaller or equal to 5, and amplitude coefficient is made as 1; Amplitude is 6, and amplitude coefficient is made as 0.8; Amplitude is 7, and amplitude coefficient is made as 0.6; Amplitude is 8, and amplitude coefficient is made as 0.4; Amplitude is 9, and amplitude coefficient is made as 0.2; Amplitude is more than or equal to 10, and amplitude coefficient is made as 0.
2. confirm the direction coefficient of neighborhood territory pixel point.The vertical direction of the gradient direction of central pixel point approaches the neighborhood territory pixel point more, and then the weights coefficient of this neighborhood territory pixel point is big more.Wherein, 0≤direction coefficient≤1.
For example: the angular range of gradient direction and neighborhood territory pixel point of supposing central pixel point between [0,90] degree, the gradient direction of central pixel point and the angle of neighborhood territory pixel point [0,18) spend between, then this neighborhood territory pixel point direction coefficient is made as 0.2; [18,36) degree between, direction coefficient is made as 0.4; [36,54) degree between, direction coefficient is made as 0.6; [54,72) degree between, direction coefficient is made as 0.8; Between [72,90] degree, direction coefficient is made as 1.
3. amplitude coefficient * the direction coefficient of weights coefficient=this neighborhood territory pixel point of neighborhood territory pixel point, the weights coefficient that promptly falls into each neighborhood territory pixel point of die plate equals the amplitude coefficient of this neighborhood territory pixel point and the product of direction coefficient.Owing to the weights coefficient that falls in the die plate is centrosymmetric, behind half weights coefficient, just can obtain the weights coefficient in the whole sunken die plate in therefore definite sunken die plate.
(7) falling into printing device 17 utilizes sunken die plate that the pixel (promptly falling into the interior pixel of seal masking-out) that needs fall into seal is fallen into seal.
All pixels to falling in the seal masking-out carry out weighted average with the color value that falls into all neighborhood territory pixel points in the die plate, obtain falling into the sunken seal value of central pixel point in the die plate.
For the pixel color value that obtains to fall into the trapping effect that India and China divide, utilize to fall into the side's of enteringing side in the die plate or close on the side's of enteringing side carries out weighted average, obtain the sunken seal value of the interior central pixel point of sunken die plate.As shown in Figure 8, utilize color value that falls into 82 3 neighborhood territory pixel points of die plate 81 left field and the sunken seal value that the weights coefficient is confirmed central pixel point.
Keep each sunken seal result, the sunken seal result that sunken seal was next time handled with last time is basis, and this process of iteration constantly is until the iterations that surpasses setting.Iterations confirms based on the image effect that falls into behind the seal, generally greater than 2 to 3 times of trap width value, but should be less than 30 times.
When having set sunken seal masking-out, owing to considered the pixel in the sunken seal side of the entering side certain limit, therefore also can damage image, can overcome this defective through the pixel adding gradient range attenuation of the seal side of enteringing side that masking-out is caved in.Promptly cave in and print the pixel of entering side's side for sunken seal masking-out; Based on pixel to its distance on contiguous border and the attenuation coefficient of this pixel of gradient magnitude setting; To falling into the result of iteration each time of these pixels in the seal process, remake behind the attenuation coefficient in addition and be the sunken seal value before the next iteration.
Gradient magnitude is big more, and then attenuation coefficient is more little, and the sunken seal result of this pixel approaches original image more; Distance is far away more, and attenuation coefficient is more little, and the sunken seal result of this pixel approaches original image more.
In this execution mode, the computing formula of attenuation coefficient S is following:
S = ( 1 - Mag - MIN MAX - MIN ) × D
Wherein, MIN and MAX are the bound of the gradient magnitude of above-mentioned setting; Mag is the gradient magnitude of this pixel; D is a distance coefficient, 0≤D≤1.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, belong within the scope of claim of the present invention and equivalent technology thereof if of the present invention these are revised with modification, then the present invention also is intended to comprise these changes and modification interior.

Claims (20)

1. trapping method based on the border may further comprise the steps:
(1) extracts the border of treating in the sunken watermark image;
(2) confirm boundaries on either side setting width T 1Distance and direction between the border that each pixel in the scope arrives and this pixel is nearest;
(3) confirm the sunken seal attribute of border and each Color Channel of boundaries on either side, said sunken seal attribute comprise whether fall into seal and sunken India side to;
(4) confirm to fall into the gradient magnitude and the direction of the pixel of seal;
The weights coefficient of (5) confirming to fall into neighborhood territory pixel point in the die plate according to the gradient magnitude and the direction of central pixel point;
(6) utilize sunken die plate that the pixel that needs fall into seal is fallen into seal.
2. the trapping method based on the border as claimed in claim 1 is characterized in that: it is following to extract the method for treating the border in the sunken watermark image described in the step (1):
Extract the crosspoint between border and the border;
The trend difference between the border is in twos being calculated through in all borders in current crosspoint in the traversal crosspoint, connects two minimum borders of trend difference.
3. the trapping method based on the border shown in claim 2 is characterized in that: said trend difference adopts following formula to calculate:
P 1 [ j ] = Σ i = 0 length 1 Dir j × w i length 1 ( j = 0,1,2,3 )
P 2 [ j ] = Σ i = 0 length 2 Dir j × w i length 2 ( j = 0,1,2,3 )
Sum = Σ j = 0 4 ( | P 1 [ j ] - P 2 [ j ] | )
Similar=Sum+(length-min(length1,length2))×w length
Wherein, Similar representes the trend difference between border 1 and the border 2, P 1[j], P 2[j] representes the trend on border 1 and border 2 respectively;
Figure FSA00000399238300021
When current direction is j, Dir jBe 1; Otherwise, get 0;
w iExpression is relevant to the weights of current point apart from intersection, 0<w i≤1; w LengthExpression is relevant to the weights that length is set, 0≤w Length≤1; The length that the participation that length representes to be provided with is calculated; Length1 representes border 1 actual length of participating in calculating; Length2 representes border 2 actual length of participating in calculating, if the length that boundary length is calculated less than the participation that is provided with, actual length of participating in calculating is boundary length.
4. the trapping method based on the border as claimed in claim 1 is characterized in that: Color Channel is the CMYK passage described in the step (3), and definite method of said sunken seal attribute is following:
Confirm the sunken seal attribute on border;
Confirm the sunken seal attribute of each passage of boundaries on either side CMYK;
If in the CMYK passage of boundaries on either side, do not fall into India side to opposite passage, then this border need not fall into seal; Otherwise, need fall into seal with the preset India side that falls on border to consistent passage, its sunken India side is to falling into India side to identical with presetting of this passage.
5. the trapping method based on the border as claimed in claim 4 is characterized in that: definite method of the sunken seal attribute on said border is following:
Width T is set in the computation bound both sides respectively 2The average brightness of all pixels in the scope;
If the difference of boundaries on either side average brightness surpasses setting threshold M, then preset this border need fall into seal, and the preset India side that falls into is to be to fall into from the low side of the high side direction average brightness of average brightness to print.
6. the trapping method based on the border as claimed in claim 4 is characterized in that: definite method of the sunken seal attribute of said passage is following:
Width T is set in the computation bound both sides respectively 2The mean value of the color ink amount of all each passages of pixel in the scope;
If the difference of the mean value of the color ink amount of boundaries on either side passage surpasses setting threshold M, then preset this passage need fall into seal, and the preset India side that falls into is to be to fall into from the low side of the high side direction color ink amount mean value of color ink amount mean value to print.
7. like claim 5 or 6 described trapping methods, it is characterized in that: said setting width T based on the border 2=Max (5 pixels, trap width), said threshold value M=5.
8. like each described trapping method in the claim 1~7 based on the border; It is characterized in that: said method also comprises the step of confirming to fall into the seal masking-out before in step (4), and said sunken seal masking-out is used in reference to and is shown in lateral extent border, the area of trap side of entering setting width T 3Pixel in the scope need be fallen into the seal processing with sunken seal by the pixel in entering side's side trap width scope.
9. the trapping method based on the border as claimed in claim 8 is characterized in that: said setting width is T 3It is 1 or 2 pixel width.
10. the trapping method based on the border as claimed in claim 8 is characterized in that: definite method of gradient magnitude described in the step (4) and direction is following:
Confirm that at first the area of trap side of entering side falls into the gradient magnitude and the direction of the outer pixel of seal masking-out, confirm to fall into the gradient magnitude and the direction of printing masking-out interior pixel point based on the gradient magnitude and the direction of the outer pixel of the sunken seal of the area of trap side of entering side masking-out then.
11. the trapping method based on the border as claimed in claim 10 is characterized in that: the gradient magnitude of said sunken seal masking-out interior pixel point and definite method of direction are following:
At first confirm the weights coefficient of neighborhood territory pixel point in the gradient template;
1. confirm distance coefficient: neighborhood territory pixel point is more little with the central pixel point distance, and its weights coefficient is big more;
2. confirm direction coefficient: the vertical direction of neighborhood territory pixel point gradient direction approaches central pixel point more, and its weights coefficient is big more;
3. distance coefficient * the direction coefficient of weights coefficient=this neighborhood territory pixel point of neighborhood territory pixel point;
The compute gradient template gradient magnitude weighted sum of caving in seal entering side or closing on neighborhood territory pixel point on each gradient direction of entering side's side then, and write down the maximum weighted gradient in the neighborhood territory pixel point on each direction;
The gradient direction that the gradient magnitude weighted sum is maximum is as the gradient direction of central pixel point, and the maximum weighted gradient of this direction is as the gradient magnitude of central pixel point.
12. the trapping method based on the border as claimed in claim 8 is characterized in that: the definite method that falls into the weights coefficient of neighborhood territory pixel point in the die plate described in the step (5) is following:
Confirm the amplitude coefficient of neighborhood territory pixel point: the gradient magnitude of central pixel point is big more, and the amplitude coefficient of neighborhood territory pixel point is more little; Wherein, 0≤amplitude coefficient≤1;
Confirm the direction coefficient of neighborhood territory pixel point: the vertical direction of the gradient direction of central pixel point approaches the neighborhood territory pixel point more, and the direction coefficient of this neighborhood territory pixel point is big more; Wherein, 0≤direction coefficient≤1;
Amplitude coefficient * the direction coefficient of weights coefficient=this neighborhood territory pixel point of neighborhood territory pixel point.
13. the trapping method based on the border as claimed in claim 12 is characterized in that: if the gradient magnitude of said central pixel point is not more than setting threshold MIN, then the amplitude coefficient with neighborhood territory pixel point is made as 1; If be not less than setting threshold MAX, then the amplitude coefficient with neighborhood territory pixel point is made as 0; If between MIN to MAX, then five equilibrium successively decreases.
14. the trapping method based on the border as claimed in claim 13 is characterized in that: the process of the sunken seal described in the step (6) is following:
All pixels to falling in the seal masking-out carry out weighted average with the color value that falls into all neighborhood territory pixel points in the die plate, obtain falling into the sunken seal value of central pixel point in the die plate;
Keep each sunken seal result, the sunken seal result that sunken seal was next time handled with last time is basis, and this process of iteration constantly is until the iterations that surpasses setting.
15. the trapping method based on the border as claimed in claim 13 is characterized in that: the process of the sunken seal described in the step (6) is following:
To all pixels that fall in the seal masking-out, the color value that falls into the side's of enteringing side in the die plate or close on the neighborhood territory pixel point of the side's of enteringing side is carried out weighted average, obtain the sunken seal value of the interior central pixel point of sunken die plate;
Keep each sunken seal result, the sunken seal result that sunken seal was next time handled with last time is basis, and this process of iteration constantly is until the iterations that surpasses setting.
16. like claim 14 or 15 described trapping methods based on the border, it is characterized in that: said iterations is greater than 2~3 times of the trap width value, but should be less than 30 times.
17. the trapping method based on the border as claimed in claim 15; It is characterized in that: cave in for sunken seal masking-out and print the pixel of entering side's side; According to pixel to its distance on contiguous border and the attenuation coefficient of this pixel of gradient magnitude setting; To falling into the result of iteration each time of these pixels in the seal process, remake behind the attenuation coefficient in addition and be the sunken seal value before the next iteration.
18. the trapping method based on the border as claimed in claim 17 is characterized in that: said attenuation coefficient S adopts following formula to calculate:
S = ( 1 - Mag - MIN MAX - MIN ) × D
Wherein, Mag is the gradient magnitude of pixel; D is a distance coefficient, 0≤D≤1.
19. the sunken seal system based on the border comprises being used for extracting the Boundary Extraction device (11) of waiting to fall into the watermark image border;
Be used for confirming boundaries on either side setting width T 1Each pixel in the scope to and the nearest border of this pixel between distance and the distance and the direction of direction confirm device (12);
Be used for confirming that the sunken seal attribute of border and each Color Channel of boundaries on either side confirms device (13), said sunken seal attribute comprise whether fall into seal and sunken India side to;
Be used for confirming that needs fall into the gradient magnitude of the pixel that prints and the gradient of direction is confirmed device (15);
Be used for confirming device (16) according to the gradient magnitude and the definite weights coefficient that falls into die plate weights coefficient of direction of pixel;
Be used to utilize sunken die plate that the pixel that needs fall into seal is fallen into the sunken printing device (17) that prints.
20. the sunken seal system based on the border as claimed in claim 19 is characterized in that: said system also comprises and confirms that the masking-out that falls into the seal masking-out confirms device (14); Said sunken seal masking-out is used in reference to and is shown in lateral extent border, the area of trap side of entering setting width T 3Pixel in the scope need be fallen into the seal processing with sunken seal by the pixel in entering side's side trap width scope.
CN2010106069905A 2010-12-16 2010-12-16 Trap printing method and system based on boundary Pending CN102547059A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010106069905A CN102547059A (en) 2010-12-16 2010-12-16 Trap printing method and system based on boundary

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010106069905A CN102547059A (en) 2010-12-16 2010-12-16 Trap printing method and system based on boundary

Publications (1)

Publication Number Publication Date
CN102547059A true CN102547059A (en) 2012-07-04

Family

ID=46352936

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010106069905A Pending CN102547059A (en) 2010-12-16 2010-12-16 Trap printing method and system based on boundary

Country Status (1)

Country Link
CN (1) CN102547059A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116452827A (en) * 2023-06-16 2023-07-18 青岛奥维特智能科技有限公司 Method and system for detecting quality of ink printing surface based on computer vision

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010055130A1 (en) * 2000-03-09 2001-12-27 Wim Geurts Apparatus, product, and method of trapping using a distance buffer
EP2014081A2 (en) * 2006-04-28 2009-01-14 Kyocera Mita Corporation Trapping method for digital color printing
CN101610343A (en) * 2008-06-16 2009-12-23 北京大学 A kind of method and system of automatic trapping
CN101686309A (en) * 2008-09-28 2010-03-31 北大方正集团有限公司 Method and device of generating trapping by image path

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010055130A1 (en) * 2000-03-09 2001-12-27 Wim Geurts Apparatus, product, and method of trapping using a distance buffer
EP2014081A2 (en) * 2006-04-28 2009-01-14 Kyocera Mita Corporation Trapping method for digital color printing
CN101610343A (en) * 2008-06-16 2009-12-23 北京大学 A kind of method and system of automatic trapping
CN101686309A (en) * 2008-09-28 2010-03-31 北大方正集团有限公司 Method and device of generating trapping by image path

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116452827A (en) * 2023-06-16 2023-07-18 青岛奥维特智能科技有限公司 Method and system for detecting quality of ink printing surface based on computer vision
CN116452827B (en) * 2023-06-16 2023-08-15 青岛奥维特智能科技有限公司 Method and system for detecting quality of ink printing surface based on computer vision

Similar Documents

Publication Publication Date Title
CN103500322B (en) Automatic lane line identification method based on low latitude Aerial Images
CN109447994A (en) In conjunction with the remote sensing image segmentation method of complete residual error and Fusion Features
CN110807496B (en) Dense target detection method
CN102509099B (en) Detection method for image salient region
CN104077447B (en) Urban three-dimensional space vector modeling method based on paper plane data
CN103186894B (en) A kind of multi-focus image fusing method of self-adaptation piecemeal
CN105608708A (en) Block plane fitting-based image binaryzation method and device
CN101968924A (en) High-resolution image-based real-time traffic flow detection method
CN104766078A (en) Slant angle detecting method and slant angle detecting device of target image
CN109408985A (en) The accurate recognition methods in bridge steel structure crack based on computer vision
CN109753949A (en) A kind of more form method for traffic sign detection based on deep learning
CN101373515B (en) Method and system for detecting road area
CN103679205A (en) Preceding car detection method based on shadow hypothesis and layered HOG (histogram of oriented gradient) symmetric characteristic verification
CN106355607A (en) Wide-baseline color image template matching method
CN110334719A (en) The method and system of object image are built in a kind of extraction remote sensing image
CN107895370A (en) A kind of saddle point extracting method based on contour
CN111882620A (en) Road drivable area segmentation method based on multi-scale information
CN104835142B (en) A kind of vehicle queue length detection method based on textural characteristics
CN113298024A (en) Unmanned aerial vehicle ground small target identification method based on lightweight neural network
CN103514460A (en) Video monitoring multi-view-angle vehicle detecting method and device
US5850475A (en) Method and apparatus for dividing image area
CN111161545A (en) Intersection region traffic parameter statistical method based on video
CN102547059A (en) Trap printing method and system based on boundary
CN108287845A (en) A kind of Automatic extraction method for road information and device and hybrid navigation system
CN104077788B (en) Moving object detection method fusing color and texture information for performing block background modeling

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
AD01 Patent right deemed abandoned

Effective date of abandoning: 20120704

C20 Patent right or utility model deemed to be abandoned or is abandoned