The graph separation that utilizes pixel intensity path frequency to carry out
Technical field
The present invention relates to a kind of determining method relevant for image output kenel, relate in particular to and a kind ofly utilize each adjacent two pixels are satisfied in the image path condition (path condition) result to carry out picture and text to separate (photo/text separation), the method for decision image output kenel.
Background technology
Image output, usually include: several situations that figure, literary composition and picture and text mix, if add the possibility of black and white/colour, then may making up of image output just becomes very complicated, how to allow image output device (as: ink-jet printer, laser printer ...) can take into account the speed of output and the quality of output, often the picture and text in the image effectively being separated is an optimal selection.
The image output speed is faster, output quality is better in order to allow, usually image output device all can be carried out so-called picture and text separable programming before carrying out actual output, the fundamental purpose of this program is the part branch of figure in the image and literary composition is come and exports in a different manner, make figure, literary composition can both obtain best image output quality separately, the use amount of saving consumptive material certainly also often is another emphasis of picture and text separable programming.
Figure and literary composition, maximum otherness just is in image output: whether pass through shadow tone program (halftoneprocess), because figure belongs to discontinuous image (non-continuous tone), so be fit to deal with the shadow tone program, but, therefore be not suitable for dealing with the shadow tone program because literary composition is to belong to continuous image (continuous tone).So when not passing through the picture and text separable programming in the image output, just can utilize the shadow tone program to handle and exported in the lump in figure and literary composition easily, Wen image output quality will greatly be affected thus, and see through when the shadow tone program is handled the part of literary composition and will slattern a large amount of consumptive materials.
Therefore, before carrying out image output, carry out the picture and text separable programming earlier and truly have its necessity.Past had occurred the technology that many picture and text separate, but its major technology means still are the individual characteristic value that each pixel had in the raw video is carried out statistical study, all do not take in for the characteristic relation that may be present between the neighbor to be had, therefore on the essence effect that picture and text separate, be easy to generate bigger error, the shortcoming that has it to use.
In addition, the picture and text separable programming that carries out at individual pixel in the above-mentioned prior art, often all must carry out once computing, judgement, record and statistics to each pixel, therefore also very bad on the efficient that the picture and text separable programming is carried out, particularly when raw video is big, if will influence overall operation efficient by the differentiation one by one to each pixel, this also is its another shortcoming of using.
Therefore, be necessary to propose a kind of error that on the picture and text separable programming is used, is difficult for taking place, can take into account the new solution of the execution operational paradigm of picture and text separable programming simultaneously, improve existing problem on the present graph separation.
Summary of the invention
Technical matters to be solved by this invention is to provide a kind of graph separation, utilize the path frequency (path frequency) of pixel intensity (pixel intensity) to carry out the picture and text separation, improve in the prior art and carry out the big and inefficient problem of computing, judgement, record and error that statistics produces at each pixel.
To achieve these goals, the invention provides a kind of graph separation that utilizes pixel intensity path frequency to carry out, this method comprises the following step:
Cutting apart a raw video is a plurality of n * n block of pixels;
Set many group path conditions according to a pixel intensity scope;
Add up the frequency that this path condition took place that adjacent two pixels are met in this block of pixels one by one, determine a picture and text state of this block of pixels; And
Add up the picture and text state of each block of pixels, determine an output kenel of this raw video.
The above-mentioned graph separation that utilizes pixel intensity path frequency to carry out, wherein this raw video is monochromatic image.
The above-mentioned graph separation that utilizes pixel intensity path frequency to carry out, wherein this raw video is a chromatic image.
The above-mentioned graph separation that utilizes pixel intensity path frequency to carry out, wherein the length and width n of this block of pixels can choose one of them wantonly in the combination of self-contained 8,16,32 and 64 group.
The above-mentioned graph separation that utilizes pixel intensity path frequency to carry out, wherein this pixel intensity scope comprises a white pixel brightness critical values, a colour element high brightness critical value, a colour element low-light level critical value and a black picture element brightness critical values at least.
The above-mentioned graph separation that utilizes pixel intensity path frequency to carry out, wherein this path condition comprise at least a white to color path condition, a white to the black path condition and a colour to the black path condition.
The above-mentioned graph separation that utilizes pixel intensity path frequency to carry out, wherein this adds up this path condition that adjacent two pixels are met in this block of pixels one by one, determines the step of a picture and text state of this block of pixels, also comprises the following step:
In regular turn this block of pixels is carried out X axis scanning;
Determine this pixel intensity scope of adjacent two pixels;
When arbitrary this path condition occurring meeting, add up to a frequency record that should path condition; And
According to this frequency record of this path condition respectively, determine the picture and text state of this block of pixels.
The above-mentioned graph separation that utilizes pixel intensity path frequency to carry out, this basis this frequency record of this path condition respectively wherein, determine the step of this picture and text state of this block of pixels, also comprise and set the step of a frequency threshold value with the picture and text state that determines this block of pixels.
The above-mentioned graph separation that utilizes pixel intensity path frequency to carry out, wherein this picture and text state can a self-contained black and white literal state, in group's combination of a black and white pattern state, a color graphics state, a black and white literal and color graphics state and a colored text and color graphics state optional one of them.
The above-mentioned graph separation that utilizes pixel intensity path frequency to carry out, wherein should add up the respectively picture and text state of this block of pixels, determine the step of an output kenel of this raw video, also comprise and set the step of a kenel threshold value with the output kenel that determines this raw video.
The above-mentioned graph separation that utilizes pixel intensity path frequency to carry out, wherein this output kenel comprises a shadow tone output type attitude and a non-shadow tone output kenel at least.
The technological means that the present invention taked, mainly be after utilization is divided into n * n block of pixels (pixel block) with raw video, pixel intensity (pixel intensity) path condition (path condition) that scope satisfied at each adjacent two pixels in the block of pixels carries out record, then according to the height statistics of the path frequency of occurrences, the picture and text state that decides block of pixels to have, and then determine the output kenel of whole raw video.
By the present invention, picture and text in the raw video can be separated, and the efficient and the quality of image output can both be improved more.Compared to prior art, the present invention is because considered the characteristic relation that neighbor had, therefore can reach and reduce the error that is produced in the picture and text separation, and, therefore can reach the purpose of enhancing overall operation efficiency because when the continuous adjacent pixel is the same paths condition, can't carry out any processing.
Describe the present invention below in conjunction with the drawings and specific embodiments, but not as a limitation of the invention.
Description of drawings
Fig. 1 is a method flow diagram of the present invention;
Fig. 2 is the picture and text state flow chart of decision block of pixels of the present invention;
Fig. 3 A to Fig. 3 E is a picture and text view of the present invention; And
Fig. 4 A to Fig. 4 E is the path synoptic diagram corresponding to Fig. 3 A to Fig. 3 E of the present invention.
Embodiment
The method that the present invention carries out the picture and text separation of raw video for a kind of occurrence frequency (frequency) that utilizes the path condition (path condition) that each pixel intensity in the image (pixel intensity) satisfied, the inventive method can see through hardware mode and be implemented, and the principle that it used will explain following.
The picture and text state that general image is had is nothing more than following several types is arranged: (1) black and white literal (as shown in Figure 3A), (2) black and white pattern (shown in Fig. 3 B), (3) color graphics (shown in Fig. 3 C), (4) black and white literal and color graphics (shown in Fig. 3 D) and (5) colored text and color graphics (shown in Fig. 3 E).
As for the pixel that constitutes these images, if distinguish, can be divided into following several situation basically again: (1) white pixel brightness (TH_White), (2) colour element high brightness (TH_Color_High), (3) colour element low-light level (TH_Color_Low) and (4) black picture element brightness (TH_Black) according to the pixel intensity scope that it had.
And carry out the scope of each pixel intensity when measuring when we are divided into one by one block of pixels (pixel block) with image, can find that then the brightness range of these neighbors also will inevitably meet: (1) white is colored to black path condition several situations such as (C_B_Path) to black path condition (W_B_Path) and (3) to color path condition (W_C_Path), (2) white.
Again owing to have the image of different picture and text states, the frequency of the path condition that it satisfied has certain systematicness, therefore can be used as the main foundation of output kenel decision, the frequency status of its path condition that satisfies of above-mentioned basically five kinds of picture and text states roughly can be summarized as follows:
(1) black and white literal: its W_C_Path frequency is near (≈) W_B_Path frequency, and relative low (the frequency threshold value of setting is low, and this frequency threshold value can set up on their own according to actual demand) of the frequency that occurs.(shown in Fig. 4 A)
(2) black and white pattern: its W_C_Path frequency is near (≈) W_B_Path frequency, but the relative height (the frequency threshold value height of setting) of the frequency that occurs.(shown in Fig. 4 B)
(3) color graphics: its W_C_Path frequency surpasses (>) W_B_Path frequency, and the relative height (the frequency threshold value height of setting) of the frequency of W_C_Path appearance, relative low (near 0) of frequency that W_B_Path occurs.(shown in Fig. 4 C)
(4) black and white literal and color graphics: its W_C_Path frequency surpasses (>) W_B_Path frequency, and the height (the frequency threshold value height of setting) that the frequency that W_C_Path occurs is relative, low (the frequency threshold value of setting is low, but not near 0) that the frequency that W_B_Path occurs is relative.(shown in Fig. 4 D)
(5) colored text and color graphics: its W_C_Path frequency surpasses (>) W_B_Path frequency, and relative low (the frequency threshold value of setting is low) of the frequency of W_C_Path appearance, relative low (near 0) of frequency that W_B_Path occurs.(shown in Fig. 4 E)
Therefore, the inventive method promptly is to utilize above-mentioned principle, frequency of occurrences height statistics by the path condition that pixel intensity satisfied of each adjacent two pixels in the image, deciding the due output kenel of image is shadow tone (halftone) output kenel or non-shadow tone (non-halftone) output kenel, and then reaches the purpose that the image picture and text separate.It is as follows that the part of entire method flow process will cooperate the part of Fig. 1 to be further described:
At first, step 100 in order to judge the cause of each pixel intensity in the raw video, must be cut into the block of pixels of n * n one by one with raw video earlier.Actual block of pixels size can be cut according to the operation efficiency of different hardware and demand, and is generally commonly used with 8 * 8,16 * 16,32 * 32 and 64 * 64 block of pixels again, but not with described herein exceeding.
Then, step 110, according to the pixel intensity scope that pixel had, as: white pixel brightness (TH_White), colour element high brightness (TH_Color_High), colour element low-light level (TH_Color_Low) and black picture element brightness (TH_Black), come the default possible path condition that need list among the frequency statistics result, include: white is to color path condition (W_C_Path), white to black path condition (W_B_Path) and colored to black path condition (C_B_Path).
Afterwards, step 120 begins to carry out the scanning of each pixel at each block of pixels, adds up the frequency that path condition took place that adjacent two pixels are met in each block of pixels one by one, and determines the picture and text state of block of pixels according to the frequency statistics result.This picture and text state comprises: black and white literal (as shown in Figure 3A), black and white pattern (shown in Fig. 3 B), color graphics (shown in Fig. 3 C), black and white literal and color graphics (shown in Fig. 3 D) and colored text and color graphics (shown in Fig. 3 E) several types, the differentiation of its decision also must be set (part that comprises the frequency threshold value) as previously mentioned in advance, in order to the picture and text state that can supply to differentiate block of pixels after producing statistics.
At last, step 130 according to after the picture and text state that each block of pixels had in the whole raw video is taken statistics, decides the output kenel of raw video again.Can decide the output kenel by making comparisons herein, so far finish the whole flow process of utilizing the graph separation that pixel intensity path frequency carries out with the type threshold value of setting.
Wherein, the thin portion flow process of relevant step 120 can cooperate the part with reference to figure 2 to be described as follows:
After step 110, the inventive method will be carried out the juggling flow process of carrying out the picture and text state at each block of pixels in step 120.At first, step 121 is carried out the scanning of X axis (row) in regular turn to block of pixels.Then, step 122 is judged the pixel intensity scope of adjacent two pixels in these row one by one.Step 123, does the brightness range that judges whether adjacent two pixels satisfy the path condition that sets in advance? if do not satisfy, enter step 126 and judge whether to finish the scanning of these row? if do not finish scanning, then forward step 124 to and read next pixel in regular turn and proceed to judge.If satisfy the path condition set in advance, then enter the frequency record that step 125 carries out the respective path condition and add up (promptly add up wherein numerical value).Before these row (be X axis scanning) are not finished (step 126), then get back to step 124 equally and read next pixel in regular turn and proceed judgement.
If when having finished the scanner uni of row (X axis) and judging (step 126), then enter the scanning that step 127 further judges whether to have finished whole block of pixels? if no, then come back to step 121 place, carry out the scanning of next column and judge; If instead when having finished the scanning of whole block of pixels, then enter step 128, according to the frequency record that each path condition had, and the frequency threshold value that sets decides this picture and text state that has of this block of pixels.In finishing all raw videos, after the juggling of each block of pixels, enter into step 130 place again.
Wherein, above-mentioned frequency threshold value of mentioning and kenel threshold value are the numerical value that can define arbitrarily voluntarily, can adjust at any time according to the demand in the practical application, so the inventive method are not done restriction in any use at this some.
As for above-described raw video, can be monochromatic image (monochrome image) or chromatic image (color image), we are with chromatic image as an example in above-mentioned preferred embodiment, but in fact only need relevant colored part in pixel intensity scope, path condition and the picture and text condition discrimination rule is removed, can in like manner be used in the usefulness of doing the picture and text separation in the monochromatic image.
Certainly; the present invention also can have other various embodiments; under the situation that does not deviate from spirit of the present invention and essence thereof; those of ordinary skill in the art work as can make various corresponding changes and distortion according to the present invention, but these corresponding changes and distortion all should belong to the protection domain of the appended claim of the present invention.