Summary of the invention
The object of the present invention is to provide a kind of image processing system and the method that can use two kinds of conversion methods simultaneously, it can suitably convert the gray level image that has literal and pattern simultaneously to bianry image, to address the above problem.
According to a feature of the present invention, a kind of image processing method that is provided, be used for converting the gray level image in the image processing system (gray-level image) to a bianry image (binary-image), this gray level image includes a plurality of gray-scale pixels (gray-level pixel) of arranging according to matrix format, this bianry image then includes a plurality of binarized pixels (binary-pixel) with similar number and arranged mode, this image processing system includes a memory and is used for stored routine and this gray scale and bianry image, and one processor be used for carrying out the program of this store memory, this image processing method includes the following step:
(1) according to a predetermined boundary detection method detect this gray level image with find out have the border characteristics gray-scale pixels as boundary point, and select the gray-scale pixels adjacent as neighbor point with each boundary point according to a neighbor point determination methods; And
(2) each boundary point and the neighbor point with this gray level image converts corresponding binarized pixel to according to one first gray-scale pixels conversion regime, and converts the every other gray-scale pixels in this gray level image to corresponding binarized pixel to produce this bianry image according to one second gray-scale pixels conversion regime.
The present invention also provides a kind of image processing system, be used for converting a gray level image (gray-level-image) to a bianry image (binary image), this gray level image includes a plurality of gray-scale pixels (gray-level pixel) of arranging according to matrix format, and this bianry image includes a plurality of binarized pixels (binary pixel) with similar number and arranged mode, this image processing system comprises: be used for the storage device and the edge detector that is used to find out boundary point of memory image, wherein said storage device is used for storing this gray scale and bianry image; It is boundary point to find out the gray-scale pixels with border characteristics that described edge detector is used for detecting this gray level image, and this image processing system also comprises:
One neighbor point detector, be used for according to a neighbor point determination methods select in this gray level image with the adjoining gray-scale pixels of each boundary point as neighbor point; And
One pixel converters, be used for converting each boundary point and the neighbor point of this gray level image to corresponding binarized pixel according to one first gray-scale pixels conversion regime, and convert the every other gray-scale pixels in this gray level image to corresponding binarized pixel to produce this bianry image according to one second gray-scale pixels conversion regime.
The present invention also provides a kind of image processing method, be used for converting the gray level image in the image processing system (gray-level image) to a bianry image (binary-image), this gray level image includes a plurality of gray-scale pixels (gray-level pixel) of arranging according to matrix format, this bianry image then includes a plurality of binarized pixels (binary pixel) with similar number and arranged mode, this image processing system includes a memory and is used for stored routine and this gray scale and bianry image, and one processor be used for carrying out the program of being deposited in this memory, this image processing method includes the following step:
(1) each gray-scale pixels that detects this gray level image according to a boundary detection method of being scheduled to and a neighbor point determination methods, if this gray-scale pixels has the border characteristics and then is set at boundary point, if this gray-scale pixels does not have the border characteristics then according to this neighbor point determination methods, select the gray-scale pixels adjacent and be made as neighbor point with each boundary point; And
(2) each boundary point and the neighbor point with this gray level image converts corresponding binarized pixel to according to one first gray-scale pixels conversion regime, and converts the every other gray-scale pixels in this gray level image to corresponding binarized pixel to produce this bianry image according to one second gray-scale pixels conversion regime.
Embodiment
Consult Fig. 1, it is for the functional block diagram of image processing system 10 of the present invention.Image processing system 10 is to be used for a greyscale image transitions is become a bianry image, wherein, this gray level image includes a plurality of gray-scale pixels of arranging according to matrix format, and this bianry image includes a plurality of binarized pixels with similar number and arranged mode.Image converter system 10 includes a memory 12 and is used for storing this gray scale and bianry image, one border detector 14 is used for detecting this gray level image, with find out have the border characteristics gray-scale pixels as boundary point, one neighbor point detector 16 is used for according to a neighbor point determination methods, select in this gray level image with the adjoining gray-scale pixels of each boundary point as neighbor point, and one pixel converters 18 be used for converting each boundary point of this gray level image and neighbor point to corresponding binarized pixel according to a kind of two color range image quality conversion regimes, and be used for other all gray-scale pixels in this gray level image, according to a kind of halftoning image quality conversion regime, convert corresponding binarized pixel to, to produce this bianry image.
In fact the function that edge detector 14, neighbor point detector 16 and pixel converters 18 are performed can be finished with its corresponding hardware unit respectively, or is assembled in the processor (not shown) and realizes in the software mode.If handle with software mode, be stored in the memory 12 as long as will carry out this functional programs, carry out getting final product again by processor.And judge with edge detector 14 whether a gray-scale pixels is that the method with boundary point of boundary property has many prior aries seldom to give unnecessary details its detailed step at this for selecting for use.About judging that with neighbor point detector 16 whether a gray-scale pixels is that the method for a neighbor point then is that example illustrates with Fig. 2.
See also Fig. 2 A to Fig. 2 M, it all is the schematic diagram of the picture element matrix 20 of a gray level image, is used for illustrating each stage of judging neighbor point.For example, in Fig. 2 A, comprise the dark and shallow gray level image of ambient color of a central color, and this gray level image is made of a picture element matrix 20 that includes 10 * 10 gray-scale pixels.When neighbor point detector 16 when judging whether a gray-scale pixels is a neighbor point, can give earlier a corresponding border of each gray-scale pixels convergence parameter (edge-closeness parameter) in regular turn, when a certain pixel is judged as a boundary point, its border convergence parameter can be set to a predetermined maximum value (being " 2 " in the present embodiment), from boundary point its border convergence parameter of gray-scale pixels far away more then successively by subtracting, till " 0 ".If the border convergence parameter of a gray-scale pixels represents that then this gray-scale pixels is a neighbor point between maximum set value and 0.
When setting border convergence parameter, neighbor point detector 16 can be set the transition matrix of a fixed size earlier, handles each gray-scale pixels in regular turn with order right by a left side, from top to bottom then.3 * 2 matrixes of drawing with thick black line circle in Fig. 2 B to Fig. 2 K are a transition matrix 22, represent the gray-scale pixels of present present.See also Fig. 3, it is the schematic diagram of transition matrix 22.What transition matrix 22 included object pixel 24 expressions of drawing with twin coil is the gray-scale pixels that to be ready being set border convergence parameter at present, and four reference pixels 26 with the oblique line mark are used for being made for the reference that object pixel 24 is set.The judgement of boundary point be according to object pixel 24 with respect to all the other five pixels in this transition matrix 22, whether be that boundary point is judged.If the object pixel 24 in transition matrix 22 is judged as a boundary point by boundary point detector 14, then neighbor point detector 16 can be 2 with its border convergence parameter setting; If object pixel 24 in transition matrix 22 is not a boundary point, and the border convergence parameter of each reference pixel 26 all is not set, or is set to 0, and then boundary point detector 16 can be 0 with the border convergence parameter setting of object pixel 24; If object pixel 24 in transition matrix 22 is not a boundary point, the value of being set is not 0 and have in the reference pixel 26, and then object pixel 24 maximum set value that can be set in the reference pixel 26 subtracts one.
When transition matrix 22 be positioned at gray matrix 20 preceding two row, before processing two row gray-scale pixels the time, because boundary point detector 14 does not detect the existence of boundary point, and the border convergence parameter of each reference pixel 26 is not to be set, be to be set to 0, so these 20 gray-scale pixels all are set to 0.In the transition matrix 22 of Fig. 2 B to Fig. 2 E, because object pixel 24 is all a boundary point, so its border convergence parameter all is set to 2.In the transition matrix 22 of Fig. 2 F, because its object pixel 24 is not a boundary point, and to have three border convergence parameter to be 0, one in its four reference pixels 26 be 2, therefore the border convergence parameter of target picture at least 24 is set to maximum 2 and subtracts one, promptly is 1.In the transition matrix 22 of Fig. 2 G, target component 24 is not a boundary point, and the border convergence parameter of four reference pixels is all 2, so the border convergence parameter of target component 24 also is 1.In the transfer matrix 22 in Fig. 2 H and Fig. 2 I, because target component 24 is all boundary point, so its border convergence parameter is all 2.In the transition matrix 22 of Fig. 2 J, target component 22 is not a boundary point, and four reference pixels 24 are all 1, so object pixel 24 is 0.In the transition matrix 22 of Fig. 2 K, object pixel 24 is not a boundary point, and the maximum of the border convergence parameter of four reference pixels 24 is 2, so object pixel 24 is 1.Shown among Fig. 2 L is after neighbor point detector 16 has been set gray matrix 20 in regular turn, the border convergence parameter of each gray-scale pixels, and wherein convergence parameter in border is that 2 gray-scale pixels is a boundary point, between 0 and 2 then is neighbor point.
After the setting of finishing border convergence parameter, neighbor point detector 16 can be exported to pixel converters 18 to carry out the conversion of two color range image quality with boundary point and neighbor point, and with other neither boundary point also the gray-scale pixels of non-neighbor point export to pixel converters 18, to carry out halftoning image quality conversion.Desire to carry out the conversion of two color range image quality and just must set a gray threshold earlier, should be converted into white or black to determine a gray-scale pixels.When this gray threshold of decision, should it be fixed in the border and between the gray value of outer gray-scale pixels as much as possible, so that the gray-scale pixels on both sides is converted into different colors, and can produce the effect that the border is strengthened.In Fig. 2 M, what mark that the grid of English alphabet H represents is, accept the gray-scale pixels of halftoning image quality conversion, what mark that the grid of English alphabet L/W represents is the gray-scale pixels of accepting the conversion of two color range image quality and being converted into white, and what indicate that the grid of L/B then represents is the gray-scale pixels of accepting the conversion of two color range image quality and being converted into black.Just, be 0 pixel in Fig. 2 L intermediate value, its grid is designated as English alphabet H; On the border and the value on contiguous border be that 1 or 2 the original color of pixel is darker, its grid is designated as English alphabet L/B; Value is that 1 or 2 the original color of pixel is more shallow, and its grid is designated as English alphabet L/W.All gray-scale pixels just can be converted into binarized pixel through after the processing of pixel converters 18.What Fig. 2 N was represented promptly is through the image after the two-value image quality conversion process, by the part of wherein coming as can be seen on the border, the darker one side darker after processing (black) of script color, therefore the more shallow one side then more shallow (white) after processing of color seem especially in sharp contrast originally.And in the part on non-border, for example the central authorities of rectangle circle or periphery owing to be to accept the halftoning image quality to handle, therefore still can show the effect that color slowly changes in the former gray scale figure.
Transition matrix 22 in the above-described embodiments is set to 3 * 2 size, and is object pixel 24 with the gray-scale pixels in the middle of the secondary series of transition matrix 22.In fact, the position of the specification of transition matrix 22 and object pixel 24 is a variable element, can be considered as the capacity of memory 12 and the processing speed of image processing system 10 sets up on their own by the user.In addition, the number of the reference pixel 24 in the transition matrix 22 and position also are variable.Please refer to Fig. 4 and Fig. 5, Fig. 4 is another embodiment transition matrix 40 of the transition matrix 22 shown in Fig. 3, and Fig. 5 then is the image after utilizing two-value image quality that transition matrix shown in Figure 4 28 produced to handle.Transition matrix 28 and transition matrix 22 different be in, the former reference pixel 26 has only three, and the latter has set four reference pixels 26.Therefore, as seen from Figure 5, when usually changing gray matrix 20 with less reference image, the number of gray-scale pixels that is judged to be neighbor point by neighbor point detector 16 is less, promptly having less gray-scale pixels to accept two color range image quality handles, handle and there is more gray-scale pixels to accept the halftoning image quality, therefore the boundary effect of the bianry image that is produced is relatively not too obvious.When practical application, the user can decide the number and the position of its required reference pixel according to the individual to the requirement of boundary effect reinforcement degree.
Please refer to Fig. 6 and Fig. 7, it is the flow chart of image processing method 30 of the present invention, and image processing method 30 of the present invention includes the following step:
Step 32: beginning;
Step 33: the maximum of setting border convergence parameter;
Step 34: set the line number and the columns of transition matrix 22, and target setting pixel 24 and reference
Pixel 26 is at the relative position of transition matrix 22;
Step 35: a selected gray-scale pixels is that object pixel 24 is to carry out the setting of border convergence parameter;
Step 36: judge whether object pixel 24 is a boundary point; If then carry out step 37;
If not, then carry out step 38;
Step 37: the border convergence parameter of target setting pixel 24 is a maximum, skips to step 41;
Step 38: whether the border convergence parameter of judgement reference pixel 26 all is not set or set point is
0, if the border convergence parameter of reference pixel 26 in transition matrix 22 all not by
Set or set point is all 0, then carry out step 39; If at transition matrix 22
In the border convergence parameter of reference pixel 26 existing be set and set be not 0,
Then carry out step 40;
Step 39: the border convergence parameter of target setting pixel 24 is 0; Skip to step 41;
Step 40: the border convergence parameter of target setting pixel 24 is a border convergence in the reference pixel 26
The parameter maximum subtracts 1;
Whether step 41: judging has the gray-scale pixels that is not set as yet; If have, get back to step 35; If
Do not have, then carry out next step;
Step 42: the border convergence parameter of each gray-scale pixels is exported to pixel converters 18 to be converted to
Binarized pixel;
Step 43: whether the border convergence parameter of judging gray-scale pixels is 0; If then carry out step
44; If not, then carry out step 45;
Step 44: to border convergence parameter is that 0 gray-scale pixels is carried out the conversion of halftoning image quality; Skip to
Step 46;
Step 45: to border convergence parameter is not that 0 gray-scale pixels is carried out the conversion of two color range image quality;
Step 46: judge whether still have the gray-scale pixels that is not converted into binarized pixel as yet; If have, return
To step 42;
Step 47: finish.
In above-mentioned steps 33, what of neighbor point are the border convergence pre-set parameter size of boundary point can influence.When set point is big more, the gray-scale pixels number that then is defined as neighbor point is just many more, and the gray level image scope of promptly accepting two tone conversion methods is just big more, so boundary effect just is reinforced more.The user can consider the emphasize degree of desire to boundary member with regard to the content of its original image, to determine the size of this boundary point set point when this set point of decision.Point out at this, image processing method 30 of the present invention is used for judging that whether an object pixel 24 is after the boundary point, set its border convergence parameter value immediately, but after also can earlier the boundary point that has boundary characteristic in whole the image being found out, set its border convergence parameter value at each object pixel 24 again.
Compare with existing image processing apparatus, image processing apparatus 10 of the present invention is by the running of neighbor point detector 16, gray-scale pixels in each gray level image is formulated a border convergence parameter, to distinguish the gray-scale pixels of two classes, and impose different image transitions modes respectively at this two classes gray-scale pixels, so that this gray level image can produce best image quality when being converted to bianry image, and solved image fault or the fuzzy problem of literal that prior art uses single image transitions mode to handle picture and text and produced during the original copy deposited.In addition, provided by the present invention is that the image processing method 30 of bianry image can pass boundary point set point size with greyscale image transitions, and different original copys is produced different border stiffening effects, has more increased the elasticity in the use.
The above only is preferred embodiment of the present invention, and all various variations and modifications of doing according to claim of the present invention all should belong to the covering scope of patent of the present invention.