A kind of image processing method, Apparatus and system
Technical field
The invention belongs to technical field of image processing, be specifically related to 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
In prior art, exist and find the method for transparent, the translucent and zone of opacity in picture of publishing picture, and do not have the method for finding white portion in the picture of publishing picture.Therefore, when shop fixtures, can not ignore the white portion in image, cause shop fixtures effect bad; Between white portion when automatic trapping in common color lump and image, do not allow look, cause register trouble.Described shop fixtures refers to layer overlay background color under all nontransparent color lumps, and in the time of like this on being printed onto some transparent material, effect can be better, and transparent part is without shop fixtures, and client need to see the product of package interior.Describedly allow look refer to by a dark colored inks and a plurality of light China ink, to be formed and dark colored inks and light black difference in brightness when very large when a color lump, for fear of cause light color China ink to expose at color lump edge due to register trouble meeting, cause significantly " color limit ", light China ink need to be inside contracted, Here it is allows look.As shown in Figure 1, Fig. 1 a is the original image before not dealing with, and wherein blue frame inside is divided into nontransparent image, and place, four angles is white portion, and centre is pink colour border circular areas, and purple piece is common color lump.Adopt existing method to carry out effect after shop fixtures as shown in Figure 1 b to Fig. 1 a, wherein white portion has also been carried out to shop fixtures.Adopt existing method to carry out effect after trapping as shown in Fig. 1 c to Fig. 1 a, wherein yellow is enclosed part and is not allowed look.
The main flow process that conventional images is sought limit algorithm is: first get the pixel matrix of entire image, according to the transparence value of pixel, pixel is classified; Then travel through all pixels, seek the border (comprising translucent and opaque two-part border) of the picture of publishing picture.Because the method is not found out the border of white portion, thereby cannot ignore the white in image while causing shop fixtures, not allow look between white during trapping in image and common color lump, effect is poor.
Summary of the invention
For the defect existing in prior art, technical problem to be solved by this invention is to provide finding method and the device on white portion border in a kind of image, and the good image shop fixtures of a kind of effect, trapping method and system are provided on this basis.
For solving the problems of the technologies described above, the technical solution used in the present invention is as follows:
An image shop fixtures method, comprises the following steps:
(1) get the pixel matrix of entire image, according to the transparence value of pixel and color value, pixel is classified; Described pixel is divided into following five classes: completely transparent, translucent and be white, translucent and be non-white, opaque and be white, opaque and be non-white;
(2) find out the boundary closed curve between inhomogeneity pixel;
(3) described 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, form a polygon, find out every group of outmost boundary closed curve, described polygon is just the zone boundary of color block;
(4) in described opaque white color piece region, fill white, in other color block regions, fill corresponding color;
(5) all colours piece is associated with described image;
(6) traversal all colours piece, if this color block is the opaque white color piece region in image, does not carry out shop fixtures to this region unit, otherwise this color block is carried out to shop fixtures.
Image shop fixtures method as above, preferred, described sorting technique is as follows:
Get all channel informations in color of image space, each pixel all has alpha, C, M, Y, five values of information of K;
If the alpha value of a pixel is 0, for completely transparent;
If alpha value between 1 to 254 and CMYK value be 0, be translucent and for white;
If alpha value between 1 to 254 and CMYK value have at least one not to be 0, be translucent and for non-white;
If alpha value be 255 and CMYK value be 0, be opaque and for white;
If alpha value be 255 and CMYK value have at least one not to be 0, be opaque and for non-white.
Image shop fixtures method as above, preferred, in step (2), after the boundary closed curve of finding out between inhomogeneity pixel, also comprise that take described boundary closed curve girth is foundation, deletes the step that is less than the boundary closed curve of setting girth.
Image shop fixtures method as above, described arrange girth on be limited to 60 pixels, under be limited to 5 pixels; Preferably, described setting girth is 3.0 * 10
-5* ImageSize, the size of described ImageSize presentation video.
Image shop fixtures method described above, preferred, in step (5), by record the mode of the ID of this image in color block, realize the associated of color block and image.
An image shop fixtures system, comprises for getting the pixel matrix of entire image, the taxon of pixel being classified according to the transparence value of pixel and color value; Described pixel is divided into following five classes: completely transparent, translucent and be white, translucent and be non-white, opaque and be white, opaque and be non-white;
For finding out first of the closed curve of demarcating between inhomogeneity pixel, find unit;
For 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 second of outermost boundary closed curve and find unit;
For fill white in opaque white color piece region, in other color block regions, fill the filling device of respective color;
For all colours piece is carried out to associated associated apparatus with this image;
Be used for traveling through all colours piece, if this color block is the opaque white color piece region in image, this color block do not carried out to shop fixtures, otherwise this color block is carried out to the shop fixtures device of shop fixtures.
Image shop fixtures system as above, the closed curve girth that also comprises demarcating is foundation, deletes the delete cells that is less than the boundary closed curve of setting girth.
The method of the invention, Apparatus and system, additionally seeking the white portion border of publishing picture in picture,, there is color fading and trapping in the sometimes white portion in image slightly while making shop fixtures when white in common color lump and image is met, the interference of the medium and small white portion of rejection image simultaneously, trapping effect is better.
Accompanying drawing explanation
Fig. 1 a is the original image before not dealing with in prior art, and Fig. 1 b adopts existing method to carry out the effect schematic diagram after shop fixtures to Fig. 1 a, and Fig. 1 c adopts existing method to carry out the effect schematic diagram after trapping to Fig. 1 a;
Fig. 2 is the structured flowchart of white blocks zone boundary device for searching in image in execution mode 1;
Fig. 3 is the flow chart of white blocks zone boundary finding method in image in execution mode 1;
Fig. 4 a is the original image before not dealing with in execution mode 1, and Fig. 4 b adopts existing method image to be sought to the result schematic diagram on limit, and Fig. 4 c adopts method described in present embodiment image to be sought to the result schematic diagram on limit;
Fig. 5 is the structured flowchart of image shop fixtures system in execution mode 2;
Fig. 6 is the flow chart of image shop fixtures method in execution mode 2.
Embodiment
Below in conjunction with accompanying drawing, the specific embodiment of the present invention is described in detail.
Execution mode 1
Present embodiment has been recorded 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 that taxon 11, first is found unit 12, delete cells 13 and second is found unit 14.
Taxon 11, for getting the pixel matrix of entire image, is classified to pixel according to the transparence value of pixel and color value.First finds unit 12 for finding out the closed curve of demarcating between inhomogeneity pixel.Delete cells 13 is foundation for take boundary closed curve girth, deletes the boundary closed curve that is less than setting regions.Second finds unit 14 for 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, find out outermost boundary closed curve, form a polygon.
As shown in Figure 3, the method that adopts said apparatus to find white blocks zone boundary in image comprises the following steps:
(1) taxon 11 is got the pixel matrix of entire image, according to the transparence value of pixel and color value, pixel is classified.
In present embodiment, pixel is divided into following five classes: completely transparent, translucent and for white, translucent and be non-white, opaque and for white, opaque and be non-white.Accordingly, present embodiment can be found out the border in above-mentioned five class color block regions.
All channel informations of getting 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 the alpha value of a pixel is 0, for completely transparent.If alpha value between 1 to 254 and CMYK value be 0, be translucent and for white.If alpha value between 1 to 254 and CMYK value have at least one not to be 0, be translucent and for non-white.If alpha value be 255 and CMYK value be 0, be opaque and for white.If alpha value be 255 and CMYK value have at least one not to be 0, be opaque and for non-white.
(2) first find unit 12 finds out the boundary closed curve between inhomogeneity pixel.It is foundation that delete cells 13 be take boundary closed curve girth, deletes and is less than the boundary closed curve of setting girth.
Arrange girth on be limited to 60 pixels, under be limited to 5 pixels.Preferably, setting girth is 3.0 * 10
-5* ImageSize.Wherein, the size of ImageSize presentation video.
(3) second find 14 pairs of unit boundary closed curve divides into groups, the one or more boundary closed curves that belong to a similar pixel connected region are one group, form a polygon, a corresponding color block, find out outmost boundary closed curve, be polygonal outer closed curve, all the other curves are all included in this curve.Described polygon is just the zone boundary of color block.
As shown in Figure 4, Fig. 4 a is original image, and Fig. 4 b adopts existing method image to be sought to the result signal on limit, and Fig. 4 c adopts method shown in present embodiment image to be sought to the result signal on limit.
Execution mode 2
Present embodiment has been recorded 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 execution mode 1, for finding the zone boundary of the picture color block of publishing picture.Filling device 2, for fill white in opaque white color piece region, is filled corresponding color in other color block regions.Associated apparatus 3 is for carrying out associated by all colours piece with this image.Shop fixtures device 4, for traveling through all colours piece, if this color block is the opaque white color region in image, does not carry out shop fixtures to this color block, otherwise this color block is carried out to shop fixtures.
As shown in Figure 6, the method that adopts said system to carry out shop fixtures to image comprises the following steps:
(1) device for searching 1 adopts method described in execution mode 1 to find 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 image.
(2) filling device 2 is filled white in opaque white color piece region, in other color block regions, fills corresponding color.
(3) associated apparatus 3 carries out associated by all colours piece with this image.Can realize association by record the mode of the ID of this image in color block.
(4) traversal all colours piece, if this color block is the opaque white color region in image, does not carry out shop fixtures to this color block, otherwise this color block is carried out to shop fixtures.
Obviously, those skilled in the art can carry out various changes and modification and not depart from the spirit and scope of the present invention the present invention.Like this, if within of the present invention these are revised and modification belongs to the scope of the claims in the present invention and equivalent technology thereof, the present invention is also intended to comprise these changes and modification interior.