A kind of image processing method, Apparatus and system
Technical field
The invention belongs to technical field of image processing, be specifically related to the finding method and the device of color block zone boundary in a kind of image, and shop fixtures on this basis, trapping method and system.
Background technology
There is the method for seeking transparent, the translucent and zone of opacity in the picture of publishing picture in the prior art, and do not have the method for seeking white portion in the picture of publishing picture.Therefore, when shop fixtures, can not ignore the white portion in the image, cause the shop fixtures effect bad; Do not let look between the white portion when automatic trapping in common color lump and the image, cause register trouble.Said shop fixtures is meant layer overlay background color under all nontransparent color lumps, and effect can be better in the time of like this on being printed onto some transparent material, and transparent part need not shop fixtures, and the client need see the product of package interior.Saidly let look be meant when a color lump to constitute by a dark colored inks and a plurality of light China ink and dark colored inks and light black difference in brightness when very big; Cause significantly " color limit " for fear of cause the light color China ink to expose owing to the register trouble meeting at the color lump edge; Need be with contracting in the light China ink, Here it is lets look.As shown in Figure 1, Fig. 1 a is the original image before not dealing with, and its Smalt frame inside is divided into nontransparent image, and place, four angles is white portion, and the centre is the pink colour border circular areas, and the purple piece is common color lump.Adopt existing method that Fig. 1 a is carried out effect behind the shop fixtures shown in Fig. 1 b, wherein white portion has also been carried out shop fixtures.Adopt existing method that Fig. 1 a is fallen into effect behind the seal shown in Fig. 1 c, wherein yellow circle is lived part to let look.
The main flow process that conventional images is sought the limit algorithm is: at first round the pixel matrix of width of cloth image, according to the transparence value of pixel pixel is classified; Travel through all pixels then, seek the border (comprising translucent and opaque two-part border) of the picture of publishing picture.Because this method do not seek out the border of white portion, thereby can't ignore the white in the image when causing shop fixtures, not let look between white when falling into seal in the image and the common color lump, effect is relatively poor.
Summary of the invention
To the defective that exists in the prior art, technical problem to be solved by this invention provides the finding method and the device on white portion border in a kind of image, and a kind of effect better image shop fixtures, trapping method and system are provided on this basis.
For solving the problems of the technologies described above, the technical scheme that the present invention adopts is following:
The finding method of color block zone boundary in a kind of image may further comprise the steps:
(1) rounds the pixel matrix of width of cloth image, pixel is classified according to the transparence value and the color value of pixel;
(2) seek out boundary closed curve between the inhomogeneity pixel;
(3) said boundary closed curve is divided into groups; The one or more boundary closed curves that belong to a similar pixel connected region are one group; Constitute a polygon, find out every group of outmost boundary closed curve, said polygon just is the zone boundary of color block.
The finding method in color block zone in the aforesaid image, preferred, pixel described in the step (1) is divided into and is following five types: transparent fully, translucent and be white, translucent and be non-white, opaque and be white, opaque and be non-white.
The finding method in color block zone in the aforesaid image, preferred, said sorting technique is following:
Get all channel informations in color of image space, each pixel all has alpha, C, M, Y, five values of information of K;
If it is the alpha value of a pixel is 0, then transparent for fully;
If the alpha value between 1 to 254 and the CMYK value be 0, then be translucent and for white;
If the alpha value between 1 to 254 and the CMYK value have at least one not to be 0, then be translucent and for non-white;
If the alpha value be 255 and the CMYK value be 0, then be opaque and for white;
If the alpha value be 255 and the CMYK value have at least one not to be 0, then be opaque and for non-white.
The finding method in color block zone in the aforesaid image; Preferably; Behind the boundary closed curve of seeking out between the inhomogeneity pixel, comprise that also with said boundary closed curve girth be foundation in the step (2), deletion is less than the step of the boundary closed curve of setting girth.
The finding method in color block zone in the aforesaid image, said be provided with girth on be limited to 60 pixels, be limited to 5 pixels down; Preferably, said setting girth is 3.0 * 10
-5* ImageSize, the size of said ImageSize presentation video.
A kind of image shop fixtures method may further comprise the steps:
(1) the employing said method is sought the color block zone in the picture of publishing picture;
(2) in said opaque white color piece zone, fill white, in other color block zones, fill corresponding color;
(3) all colours piece is related with said image;
(4) traversal all colours piece if this color block is the opaque white color piece zone in the image, does not then carry out shop fixtures to this region unit, otherwise this color block is carried out shop fixtures.
Like above-mentioned image shop fixtures method, preferred, in the step (3), the mode through the ID of this image of record on color block realizes the related of color block and image.
A kind of image trapping method may further comprise the steps:
(1) the employing said method is sought the color block zone in the picture of publishing picture;
(2) in said opaque white color piece zone, fill white, in other color block zones, fill corresponding color;
(3) all colours piece is related with said image;
(4) traversal all colours piece is judged the sunken India side formula between the color block in twos; If one of them color block is the opaque white color piece, then continue to judge whether another color block and opaque white color piece belong to same image, in this way, color fading and trapping does not take place then, otherwise color fading and trapping takes place; If one of them color block is not the opaque white color piece, then carry out common sunken seal.
Like above-mentioned image trapping method, preferred, in the step (3), the mode through the ID of this image of record on color block realizes the related of color block and image.
The device for searching of color block zone boundary in a kind of image comprises the pixel matrix that is used to round width of cloth image, the taxon of pixel being classified according to the transparence value and the color value of pixel;
Be used to seek out the first searching unit of boundary closed curve between the inhomogeneity pixel;
Be used for the boundary closed curve is divided into groups, the one or more boundary closed curves that belong to a similar pixel connected region are one group, find out the second searching unit of outermost boundary closed curve.
The device for searching of color block zone boundary in the aforesaid image comprises that also with boundary closed curve girth be foundation, and deletion is less than the delete cells of the boundary closed curve of setting girth.
A kind of image shop fixtures system comprises above-mentioned device for searching;
Be used in opaque white color piece zone, filling white, in other color block zones, fill the filling device of respective color;
Be used for all colours piece is carried out related associated apparatus with this image;
Be used to travel through all colours piece,, then this color block do not carried out shop fixtures, otherwise this color block is carried out the shop fixtures device of shop fixtures if this color block is the opaque white color piece zone in the image.
A kind of image trapping system comprises above-mentioned device for searching;
Be used in opaque white color piece zone, filling white, in other color block zones, fill the filling device of respective color;
Be used for all colours piece is carried out related associated apparatus with this image;
Be used to travel through all colours piece, judge the sunken printing device of the sunken India side formula between the color block in twos; If one of them color block is the opaque white color piece, then continue to judge whether another color block and opaque white color piece belong to same image, in this way, color fading and trapping does not take place then, otherwise color fading and trapping takes place; If one of them color block is not the opaque white color piece, then carry out common sunken seal.
The method of the invention, Apparatus and system; The extra white portion border of seeking in the picture of publishing picture, the sometimes white portion in the image slightly when making shop fixtures, generation color fading and trapping when making white in common color lump and the image meet; The interference of the medium and small white portion of rejection image simultaneously, trapping effect is better.
Description of drawings
Fig. 1 a is the original image before not dealing with in the prior art, and Fig. 1 b adopts existing method that Fig. 1 a is carried out the effect sketch map behind the shop fixtures, and Fig. 1 c adopts existing method that Fig. 1 a is fallen into the effect sketch map after printing;
Fig. 2 is the structured flowchart of white blocks zone boundary device for searching in the image in the execution mode 1;
Fig. 3 is the flow chart of white blocks zone boundary finding method in the image in the execution mode 1;
Fig. 4 a is the original image before not dealing with in the execution mode 1, and Fig. 4 b adopts existing method that image is sought the sketch map as a result on limit, and Fig. 4 c adopts the said method of this execution mode image to be sought the sketch map as a result on limit;
Fig. 5 is the structured flowchart of image shop fixtures system in the execution mode 2;
Fig. 6 is the flow chart of image shop fixtures method in the execution mode 2;
Fig. 7 is the structured flowchart of image trapping system in the execution mode 3;
Fig. 8 is the flow chart of image trapping method in the execution mode 3.
Embodiment
Be described in detail below in conjunction with the accompanying drawing specific embodiments of the invention.
Execution mode 1
This execution mode has been put down in writing the device for searching and the method for color block zone boundary in a kind of image.As shown in Figure 2, this device 1 comprises taxon 11, the first searching unit 12, delete cells 13 and the second searching unit 14.
Taxon 11 is used to round the pixel matrix of width of cloth image, according to the transparence value and the color value of pixel pixel is classified.The first searching unit 12 is used to seek out the closed curve of demarcating between the inhomogeneity pixel.It is foundation that delete cells 13 is used for boundary closed curve girth, and deletion is less than the boundary closed curve of regions.The second searching unit 14 is used for the boundary closed curve is divided into groups, and the one or more boundary closed curves that belong to a similar pixel connected region are one group, finds out outermost boundary closed curve, constitutes a polygon.
As shown in Figure 3, the method that adopts said apparatus to seek white blocks zone boundary in the image may further comprise the steps:
(1) taxon 11 rounds the pixel matrix of width of cloth image, according to the transparence value and the color value of pixel pixel is classified.
In this execution mode, pixel is divided into and is following five types: transparent fully, translucent and for white, translucent and be non-white, opaque and for white, opaque and be non-white.Accordingly, this execution mode can be found out the border in above-mentioned five types of color block zone.
Get all channel informations in color of image space, each pixel all has five values of information such as alpha, C, M, Y, K, and all values is value between 0 to 255 all.If it is the alpha value of a pixel is 0, then transparent for fully.If the alpha value between 1 to 254 and the CMYK value be 0, then be translucent and for white.If the alpha value between 1 to 254 and the CMYK value have at least one not to be 0, then be translucent and for non-white.If the alpha value be 255 and the CMYK value be 0, then be opaque and for white.If alpha value be 255 and the CMYK value have at least one not to be 0, then be opaque and be non-white.
The boundary closed curve between the inhomogeneity pixel is sought out in (2) first searching unit 12.Delete cells 13 is a foundation with boundary closed curve girth, and deletion is less than the boundary closed curve of setting girth.
Be provided with girth on be limited to 60 pixels, be limited to down 5 pixels.Preferably, setting girth is 3.0 * 10
-5* ImageSize.Wherein, the size of ImageSize presentation video.
(3) second searching unit 14 pairs of boundary closed curve divides into groups; The one or more boundary closed curves that belong to a similar pixel connected region are one group; Constitute a polygon, corresponding color block is found out outmost boundary closed curve; Be polygonal outer closed curve, all the other curves all are included in this curve.Said polygon just is the zone boundary of color block.
As shown in Figure 4, Fig. 4 a is an original image, and Fig. 4 b is result's signal of adopting existing method that image is sought the limit, and Fig. 4 c adopts method shown in this execution mode image to be sought result's signal on limit.
Execution mode 2
This execution mode has been put down in writing a kind of image shop fixtures system and method.As shown in Figure 5, this system comprises device for searching 1, filling device 2, associated apparatus 3 and shop fixtures device 4.
Device for searching 1 adopts the device for searching described in the execution mode 1, is used for seeking the zone boundary of publishing picture as color block.Filling device 2 is used in opaque white color piece zone, filling white, in other color block zones, fills corresponding color.Associated apparatus 3 is used for carrying out related with this image all colours piece.Shop fixtures device 4 is used to travel through all colours piece, if this color block is the opaque white color zone in the image, then this color block is not carried out shop fixtures, otherwise this color block is carried out shop fixtures.
As shown in Figure 6, adopt said system that the method that image carries out shop fixtures may further comprise the steps:
(1) device for searching 1 adopts method described in the execution mode 1 to seek the zone boundary of color block in the picture of publishing picture.
Pixel is that the zone boundary of opaque white color is the zone boundary of opaque white color piece in the image.
(2) filling device 2 is filled white in opaque white color piece zone, in other color block zones, fills corresponding color.
(3) associated apparatus 3 carries out related with this image all colours piece.Can realize association through the mode of the ID of this image of record on color block.
(4) traversal all colours piece if this color block is the opaque white color zone in the image, does not then carry out shop fixtures to this color block, otherwise this color block is carried out shop fixtures.
Execution mode 3
This execution mode has been put down in writing a kind of image trapping system and method.As shown in Figure 7, this system comprises device for searching 1, filling device 2, associated apparatus 3 and sunken printing device 5.
Device for searching 1, filling device 2, associated apparatus 3 are identical with the function of device for searching 1 described in the execution mode 2, filling device 2, associated apparatus 3.Fall into printing device 5 and be used to travel through all colours piece, judge the sunken India side formula between the region unit in twos; If one of them color block is the opaque white color piece, then continues to judge whether another color block and this opaque white color piece belong to same image, in this way, color fading and trapping do not take place then, otherwise color fading and trapping takes place; If one of them color block is not the opaque white color piece, then carry out common sunken seal.
As shown in Figure 8, adopt system shown in Figure 7 that the method that image falls into seal may further comprise the steps:
(1) device for searching 1 adopts method described in the execution mode 1 to seek the zone boundary of color block in the picture of publishing picture.
(2) filling device 2 is filled white in opaque white color piece zone, in other color block zones, fills corresponding color.
(3) associated apparatus 3 carries out related with this image all colours piece.
(4) fall into printing device 5 traversal all colours pieces, judge the sunken India side formula between the color block in twos; If one of them color block is the opaque white color piece, then continues to judge whether another color block and this opaque white color piece belong to same image, in this way, color fading and trapping do not take place then, otherwise color fading and trapping takes place; If one of them color block is not the opaque white color piece, then carry out common sunken seal.
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.