Summary of the invention
At the defective that exists in the prior art, the objective of the invention is to discern the picture material of input, accumulate the row of these characteristics as a result that can not change linked network for the error diffusion that meets on every side, be that pixels all in the delegation is stain entirely or is the row of white point, (in 256 grades gray level image, be exactly gray value be 0 or 255 row entirely) directly generate corresponding site for the pixel in this row, need not consider the influence of error diffusion; Pixel for other row carries out generating the site after the error diffusion, when can guarantee the linked network effect, accelerates linked network speed.
For reaching above purpose, the technical solution used in the present invention is:
A kind of method that can accelerate image screening speed may further comprise the steps:
(1) the pending image of input;
(2) content of recognition image and carry out initialization, since the first row deal with data, whether each pixel of comparison is the zero error point, if all pixels are the zero error point in the data line, promptly this row is full zero error row, then directly generates the site; Described zero error point is meant that this point is stain or white point, and in 256 grades of image gray, the stain corresponding gray is 0, and the white point corresponding gray is 255;
(3) if not every pixel all is the zero error point in the data line, promptly the full zero error row of these row right and wrong then generates corresponding site after the process error diffusion.
Further, has better invention effect for making the present invention, in the step (3), as long as identify a non-zero error point arranged in the delegation, can begin this row is carried out the error diffusion processing procedure, generate corresponding site then, not need to wait for last pixel that recognizes this row.
Further, for making the present invention have better invention effect, in order to guarantee that rounding error that non-full zero error row produces can not have influence on the result that full zero error row below this non-full zero error row generates the site in error diffusion process, in step (2) and the step (3), when if the pixel in the delegation is not zero error point entirely, handle the back through error diffusion and generate corresponding site, carry out the generation of site after the full zero error row of below this row first also will adopt error diffusion simultaneously, and can not adopt direct generation site.
Further, for making the present invention have better invention effect, in step (2) and the step (3), when if the capable full zero error row of N is arranged between last column of tight adjacent following first non-full zero error row/image of current non-full zero error row and its, wherein, N is a positive integer, can not influence the generation result of non-full zero error row site for the error accumulation value that guarantees to produce in the error diffusion process, if current line is first non-full zero error row, then carry out generating corresponding site after the error diffusion, simultaneously, the row below this non-full zero error row is carried out continuous error of calculation value; If current line is not first non-full zero error row, after calculating, the error accumulation value of then waiting for this row carries out again generating the site after the error diffusion, and simultaneously, the error amount that this row is gone below calculates continuously, finishes until processing.
Further again, in step (2) and the step (3), whether the error amount of discerning all pixels of full zero error row simultaneously is zero entirely, if the error amount of all pixels of full zero error row is zero, then stop error of calculation value, like this, the error accumulation value that is accumulated to following first non-full zero error row as can be known is 0 entirely, directly carries out error diffusion and get final product when running into first non-full zero error row.
Further again, in step (2) and the step (3), calculate the line number of the full zero error row that has carried out error diffusion simultaneously, after the line number of the full zero error row that has carried out error diffusion surpasses preset threshold, described threshold value is a positive integer, then suspend the calculating of error amount, the error accumulation value reservation that directly will currently calculate also is accumulated to first non-full zero error row that full zero error row occurs below, and during first non-full zero error row below running into full zero error row, continue to adopt error diffusion method to generate site and error of calculation value.
For realizing said method, the invention allows for a device that adopts hardware circuit to realize this method, this device 1 comprises gray value comparison circuit 2, identification circuit 3, gray value buffer 6, control circuit 9, directly generate site device 7, error diffusion device 8, multichannel selects 10 to form, wherein, be provided with error diffusion method in the control circuit 9 and select circuit.
In the said apparatus, whether described gray value comparison circuit 2 is used for the gray value of reference source pixel is 0 or 255, if the gray value of source pixel is 0 or 255, then determines it is the zero error point, if the gray value of source pixel is not 0 or 255, then determine it is not the zero error point; Whether described identification circuit 3 is used for discerning in the comparative result of data line all is the zero error point, if in the comparative result of data line all be the zero error point, can determine that then this row is full zero error row, otherwise, be judged to be non-full zero error row; Described gray value buffer 6 is used for buffer memory and compares, but does not also have the source pixel gray value of error diffusion; Error diffusion method in the described control circuit 9 selects circuit to be used for selecting different error diffusion methods to generate the site, is responsible for the operation control of site generating apparatus and result's selection; Described direct generation site device 7 usefulness generate the site value of full zero error row, the gray value that directly generates the source pixel of site device 7 identification inputs is 0 or 255, directly the corresponding site of output is worth then, directly generate site device 7 and when generating the site, do not consider the calculating of error and the diffusion of error, so directly generating site device 7 can be with parallel simultaneously its site value that generates of the gray value of multiple source pixel, therefore, in the course of work of reality, the speed that directly generates site device 7 can not be subjected to simply calculating desired influence circuit, and main speed bottle-neck is the highway width of data; Described error diffusion device 8 adopts the method for error diffusion to carry out error diffusion and generates the site value simultaneously; Multichannel selects the control of 10 controlled circuit 3 to select one to generate the result as final site value from the site value result of direct generation site device 7 and the generation of error diffusion device.
During this device work, gray value comparison circuit 2 is since the first row deal with data, relatively whether each pixel is the zero error point, then comparative result is sent to identification circuit 3, to compare simultaneously but also do not have the source pixel gray value of error diffusion to be stored in the gray value buffer 6, identification circuit 3 is according to the comparative result of gray value comparison circuit 2, whether the identification data line is the zero error point entirely, thereby identify full zero error row and non-full zero error row, the result that will discern sends to the error diffusion method selection circuit in the control circuit 9 then, error diffusion method in the control circuit 9 is selected the recognition result of circuit analysis identification circuit 3, if full zero error row, the source pixel gray value that then will be stored in the gray value buffer 6 directly generates the site by directly generating site device 7, and generates final site after multichannel selects 10 to select; If non-full zero error row, then will be stored in source pixel gray value in the gray value buffer 6 and carry out error diffusion by error diffusion device 8 and handle the back and generate corresponding site, and after multichannel selects 10 to select as final site.
Whether complete zero the time in the comparative result of described identification circuit 3 identification data lines, to have occurred one in the delegation be not the point of zero error point as long as identify, can determine the full zero error row of these row right and wrong, can send to recognition result control circuit 9 this moment, and need not wait identification circuit 3 to handle last pixel of delegation.
Further, for making the present invention have better invention effect, in order to guarantee that rounding error that non-full zero error row produces can not have influence on the result that full zero error row below this non-full zero error row generates the site in error diffusion process, after error diffusion method in the control circuit 9 is selected the recognition result of circuit analysis identification circuit 3, still select to be undertaken generating corresponding site after error diffusion is handled by error diffusion device 8 for first the full zero error row below the non-full zero error row.
Further, for making the present invention have better invention effect, when if the capable full zero error row of N is arranged between last column of tight adjacent following first non-full zero error row/image of current non-full zero error row and its, wherein, N is a positive integer, can not influence the generation result of the non-full zero error row site below the full zero error row for the error accumulation value that guarantees to produce in the error diffusion process, also be provided with an error amount comparison circuit 4 in this device 1, whether this error amount comparison circuit 4 is used for the error amount that relative error disperser 8 produces in error diffusion process be zero, when if the error amount of all pixels in the relatively back definite full zero error row of error amount comparison circuit 4 is zero, comparative result is sent to control circuit 9, after control circuit 9 is analyzed, then can close error diffusion device 8; When if the error amount of the relatively back definite full zero error row of error amount comparison circuit 4 is non-vanishing, comparative result is sent to control circuit 9, after control circuit 9 is analyzed, notice error diffusion device 8 is when generating non-full zero error row site by error diffusion, need to calculate continuously the error amount of each row of full zero error row, until handling all pixels.
Further again, for making the present invention have better invention effect, also be provided with complete zero row diffusion counter 11 and clock-signal generator 5 in the control circuit 9, complete zero row diffusion counter 11 is used for counting the line number of the full zero error row that has carried out error diffusion, after the line number of the full zero error row that has carried out error diffusion surpasses preset threshold, described threshold value is a positive integer, complete zero row diffusion counter 11 sends to clock-signal generator 5 with this information, 5 calculating that suspend error diffusion device 8 error amounts by time-out tranmitting data register signal to the mode of error diffusion device 8 of clock-signal generator, and keep the current error accumulation value that calculates, during first non-full zero error row below running into, error diffusion device 8 uses the error accumulation value when suspending to proceed the generation of site and the calculating of error amount.
Technical term described in the present invention, its implication is as follows:
Error amount is meant the difference between the final gray value of site corresponding gray that pixel generates and pixel, the final gray value of pixel be meant the gray value that pixel is original and the final error accumulated value addition that self obtains after the end value that obtains.
The error distribution value is in error diffusion algorithm, on each pixel around being assigned to after the error amount of a pixel can be broken according to certain ratio, with the former gray value addition of each pixel; Error amount is proportionally broken values to be allocated such as back, is called the error distribution value.
The error accumulation value, in error diffusion algorithm, can obtain on pixel from around the error distribution value of pixel, these apportioning costs can add up successively, the apportioning cost of front each row of data is accumulated to this point can obtain an error accumulation value, all apportioning costs can obtain a last value after being accumulated to this point, and this last value promptly is called the final error accumulated value.
The zero error point is meant that this point is stain or white point, in 256 grades of image gray, is that gray value is 0 or 255 pixel.Because in error diffusion, the error amount between they and the last site that generates is 0.
Full zero error row refers to that pixels all in the data line all is the row of zero error point.
Non-full zero error row refers to that not every pixel all is the row of zero error point in the data line.
Directly the site generates, be meant of the error accumulation of the error of the pixel of ignoring the front at this point, directly generate the site value of their correspondences with the gray value of pure white of importing or black color dot, the site that is called error free diffusion again generates, the row of its physical meaning above being not to this row and this row to the error free diffusion of next line, and the value that is meant these errors do not attend the meeting greatly will input pure white color dot become the black site or the black color dot of input can be become the stage of white site, just can not consider that error diffusion directly calculates the corresponding site value of each some this moment.
Effect of the present invention is: adopt method and apparatus of the present invention guaranteeing under the prerequisite that linked network result and prior art are consistent, feature of image at input, use the site generating algorithm of not having diffusion selectively, obviously shortened the time that linked network is handled.
Why the present invention can shorten the linked network processing time, and main cause has following three aspects:
(1) in the beginning part of image,, adopts the site generating algorithm of not having diffusion for full zero error row;
(2), be 0 the later full zero error row of full zero error row entirely for error amount, without the error of calculation and error amount at the mid portion of image;
(3) in the ending of image, for full zero error row,, also carry out error diffusion simultaneously with the site generating algorithm of not having diffusion, the site generating algorithm of not having diffusion can generate all remaining site values fast, at this moment just can shift to an earlier date the round-off error diffusion.
Embodiment
The invention will be further described below in conjunction with drawings and the specific embodiments:
Embodiment 1
As shown in Figure 1, a kind of method that can accelerate image screening speed comprises the steps:
A kind of method that can accelerate image screening speed may further comprise the steps:
(1) the pending image of input;
(2) content of recognition image and carry out initialization, since the first row deal with data, whether each pixel of comparison is the zero error point, if all pixels are the zero error point in the data line, promptly this row is full zero error row, then directly generates the site; Described zero error point is meant that this point is stain or white point, and in 256 grades of image gray, the stain corresponding gray is 0, and the white point corresponding gray is 255;
(3) if not every pixel all is the zero error point in the data line, the i.e. full zero error row of these row right and wrong, then through generating corresponding site after the error diffusion, in the present embodiment, as long as identify a non-zero error point is arranged in the delegation, just the full zero error row of these row right and wrong as can be known can begin this row is carried out the error diffusion processing procedure, generate corresponding site then, do not need to wait for last pixel that recognizes this row.
As shown in Figure 2, a kind of device that can accelerate image screening speed, this device 1 comprises gray value comparison circuit 2, identification circuit 3, gray value buffer 6, control circuit 9, directly generate site device 7, error diffusion device 8, multichannel selects 10 to form, wherein, be provided with error diffusion method in the control circuit 9 and select circuit.
During this device work, gray value comparison circuit 2 is since the first row deal with data, relatively whether each pixel is the zero error point, then comparative result is sent to identification circuit 3, to compare simultaneously but also do not have the source pixel gray value of error diffusion to be stored in the gray value buffer 6, identification circuit 3 is according to the comparative result of gray value comparison circuit 2, whether the identification data line is the zero error point entirely, thereby identify full zero error row and non-full zero error row, the result that will discern sends to the error diffusion method selection circuit in the control circuit 9 then, error diffusion method in the control circuit 9 is selected the recognition result of circuit analysis identification circuit 3, if full zero error row, the source pixel gray value that then will be stored in the gray value buffer 6 directly generates the site by directly generating site device 7, and generates final site after multichannel selects 10 to select; If non-full zero error row, then will be stored in source pixel gray value in the gray value buffer 6 and carry out error diffusion by error diffusion device 8 and handle the back and generate corresponding site, and after multichannel selects 10 to select as final site.
In said apparatus, whether complete zero the time in the comparative result of identification circuit 3 identification data lines, to have occurred one in the delegation be not the point of zero error point as long as identify, can determine the full zero error row of these row right and wrong, can send to recognition result control circuit 9 this moment, and need not wait identification circuit 3 to handle last pixel of delegation.
In said apparatus, when described direct generation site device 7 usefulness generated the site value of full zero error row, the gray value that directly generates the source pixel of site device 7 identification inputs was 0 or 255, and directly the corresponding site of output is worth then; Directly generate the gray value that site device 7 can receive the multiple source pixel simultaneously, if the data bandwidth of gray value is 32Bit, grey scale pixel value for 256 grades, once can import 4 pixels simultaneously, directly generating site device 7 can compare simultaneously to these 4 pixels, and simultaneously the site of correspondence is worth output according to result relatively.Like this, a direct generation site device 7 that has 32 bit data bandwidth can be handled 4 pixels in each cycle, and generate their site value.
In present embodiment, suppose and handle 256 grades of image gray as shown in table 1, its threshold value is 127, can handle the Error Calculation and the diffusion of a pixel within assumption error disperser 8 one-periods, supposes that the data input width of direct generation site device 7 is 32Bit (4 pixel grey scale/cycle), promptly the phase is handled 4 pixels weekly, adopt the Floyd-Steinberg error diffusion method, diffusion coefficient is 1/16,3/16,5/16 ,/7/16; The data width of identification circuit 3 is 32bit (4 pixel grey scale/cycle), be whether are zero error points to identification circuit 3 if once can compare 4 pixels, the data of delegation need relatively can be finished identification twice at most, when adopting apparatus and method of the present invention to handle image as shown in table 1, its concrete processing procedure is as shown in table 2;
Table 1 gradation of image value matrix is 5 * 15 (wherein, 0 expression gray value is that 0 pixel is a stain, and 255 expression gray values are that 255 pixel is a white point)
0 | 0 | 255 | 255 | 0 |
0 | 0 | 0 | 255 | 0 |
0 | 0 | 255 | 0 | 0 |
16 | 7 | 102 | 0 | 25 |
0 | 0 | 0 | 0 | 23 |
0 | 0 | 23 | 34 | 34 |
0 | 0 | 255 | 0 | 0 |
0 | 0 | 0 | 255 | 0 |
0 | 255 | 0 | 0 | 0 |
75 | 0 | 16 | 0 | 223 |
0 | 23 | 63 | 98 | 23 |
0 | 234 | 8 | 45 | 24 |
0 | 0 | 0 | 255 | 0 |
0 | 0 | 0 | 0 | 0 |
0 | 0 | 0 | 0 | 0 |
If all adopt the described image screening of error diffusion process realization table 1 described in the prior art, if each clock cycle can be handled a pixel and be generated a site value, then need 75 clock cycle at least, and adopt method and apparatus of the present invention only to need 51 clock cycle.
When realizing the linked network of the described image of table 1, as adopt method and apparatus of the present invention, its concrete handling process is as shown in table 2, wherein, in the table 2 " 0 " implication be: this behavior zero error row; The implication of " 1 " is: this behavior non-full zero error row, and as follows, i.e. table 3, in the table 4, table 5, the implication of " 0 " and " 1 " is identical with the implication in the table 2.
Table 2 adopts method and apparatus of the present invention to handle the process of image as shown in table 1
Periodicity | Gray value comparison circuit/identification circuit | Recognition result | Directly generate the site device | The error diffusion device |
1-2 | Relatively and discern first the row | 0 | Idle | Stop |
3-4 | Relatively and discern second the row | 0 | Generate the first row site | Stop |
5-6 | Relatively and discern the third line | 0 | Generate the second row site | Stop |
7 | Relatively and discern fourth line | 1 | Generate the third line site value | Stop |
8 | Idle | | Stop |
9 | Relatively and discern fifth line | 0 | Idle | Generate fourth line site value |
10 | 1 | Idle |
11-13 | Idle | | Idle |
14 | Relatively and discern the 6th the row | 1 | Idle | Generate fifth line site value |
15-18 | Idle | | Idle |
19-20 | Relatively and discern the 7th the row | 0 | Idle | Generate the 6th row site value |
21-23 | Idle | | Idle |
24-25 | Relatively and discern the 8th the row | 0 | Generate the 7th row site value | Stop |
26-27 | Relatively and discern the 9th the row | 0 | Generate the 8th row site value | Stop |
28 | Relatively and discern the tenth the row | 1 | Generate the 9th row site value | Stop |
29 | Idle | 0 | Stop |
30 | Relatively and discern the tenth delegation | 1 | Idle | Generate the tenth row site value |
31-34 | Idle | | Idle |
35 | Relatively and discern the 12 the row | 1 | Idle | Generate the tenth delegation site |
36-39 | Idle | | Idle | Value |
40-41 | Relatively and discern the tenth triplex row | 0 | Idle | Generate the 12 row site value |
42-44 | Idle | | |
45-46 | Relatively and discern Ariadne | 0 | Generate the tenth triplex row site value | Stop |
47-48 | Relatively and discern the tenth five-element | 0 | Generate Ariadne site value | Stop |
49-50 | Idle | | Generate the tenth five-element site value | Stop |
51 | Finish | | Stop | Stop |
By this enforcement as can be seen, adopting method and apparatus of the present invention, (is the 1st, 2 in the present embodiment for full zero error row, 3,7,8,9,13,14,15 row), generate corresponding site by direct generation site device 7, for non-full zero error row (is the 4th, 5,6 in the present embodiment, 10,11,12 row), generate corresponding site by error diffusion device 8, error diffusion device 8 promptly quits work after handling non-full zero error row, and processing speed improves greatly.
Embodiment 2
Present embodiment 2 difference from Example 1 are, present embodiment 2 has taken into full account the rounding error that produces in the error diffusion process generates the site result to full zero error row influence on the basis of embodiment 1, because, even add for full zero error row that usually the error accumulation value can not influence the result that the site generates yet, but, in fact, in error diffusion process, error distribution is arrived in each pixel, can since in the error diffusion process rounding error that produces make the final gray value of pixel of full zero error row surpass threshold value, like this, the site value that full zero error row generates can be affected, but this situation often occurs in the full zero error row the most adjacent with non-full zero error row.
In order to realize better linked network effect, the rounding error that assurance non-full zero error row produces in error diffusion process can not have influence on the result of the full zero error row generation site below this non-full zero error row, embodiment 2 has taken into full account the rounding error that produces in the error diffusion process generates the site result to full zero error row influence on the basis of embodiment 1, when promptly if delegation is full zero error row, whether the lastrow that also will consider this row is full zero error row, if not then adopting the generation of carrying out the site after the error diffusion, and can not adopt direct generation site, specifically: as shown in Figure 1, a kind of method that can accelerate image screening speed, on the basis of embodiment 1, in step (2) and the step (3), when if the pixel in the delegation is not zero error point entirely, handle the back through error diffusion and generate corresponding site, carry out the generation of site after the full zero error row of below this row first also will adopt error diffusion simultaneously, and can not adopt direct generation site; As shown in Figure 2, a kind of device that can accelerate image screening speed, wherein, after error diffusion method in the control circuit 9 is selected the recognition result of circuit analysis identification circuit 3, still select to be undertaken generating corresponding site after error diffusion is handled by error diffusion device 8 for first the full zero error row below the non-full zero error row.
In present embodiment 2, assumed conditions is identical with embodiment 1,256 grades of image gray as shown in table 1 are handled in i.e. supposition, its threshold value is 127, can handle the Error Calculation and the diffusion of a pixel within assumption error disperser 8 one-periods, the data input width of supposing direct generation site device 7 is 32Bit (4 pixel grey scale/cycle), promptly the phase is handled 4 pixels weekly, adopt the Floyd-Steinberg error diffusion method, diffusion coefficient is 1/16,3/16,5/16 ,/7/16; The data width of identification circuit 3 is 32bit (4 pixel grey scale/cycle), be whether are zero error points to identification circuit 3 if once can compare 4 pixels, the data of delegation need relatively can be finished identification twice at most, when adopting apparatus and method of the present invention to handle image as shown in table 1, its concrete processing procedure is as shown in table 3;
Table 3 adopts method and apparatus of the present invention to handle the process of image as shown in table 1
Periodicity | Gray value comparison circuit/identification circuit | Recognition result | Directly generate the site device | The error diffusion device |
1-2 | Relatively and discern first the row | 0 | Idle | Stop |
3-4 | Relatively and discern second the row | 0 | Generate the first row site | Stop |
5-6 | Relatively and discern the third line | 0 | Generate the second row site | Stop |
7 | Relatively and discern fourth line | 1 | Generate the third line site value | Stop |
8 | Idle | | Stop |
9 | Relatively and discern fifth line | 0 | Idle | Generate fourth line site value |
10 | 1 | Idle |
11-13 | Idle | | Idle |
14 | Relatively and discern the 6th the row | 1 | Idle | Generate fifth line site value |
15-18 | Idle | | Idle |
19-20 | Relatively and discern the 7th the row | 0 | Idle | Generate the 6th row site value |
21-23 | Idle | | Idle |
24-25 | Relatively and discern the 8th the row | 0 | Idle | Generate the 7th row site value |
26-28 | Idle | | Idle |
29-30 | Relatively and discern the 9th the row | 0 | Generate the 8th row site value | Stop |
31 | Relatively and discern the tenth the row | 1 | Generate the 9th row site value | Stop |
32 | Idle | | Stop |
33 | Relatively and discern the tenth delegation | 1 | Idle | Generate the tenth row site value |
34-37 | Idle | | Idle |
38 | Relatively and discern the 12 the row | 1 | Idle | Generate the tenth delegation's site value |
39-42 | Idle | | Idle |
43-44 | Relatively and discern the tenth triplex row | 0 | Idle | Generate the 12 row site value |
45-47 | Idle | | Idle | |
48-49 | Relatively and discern Ariadne | 0 | Idle | Generate the tenth triplex row site value |
50-52 | Idle | | Idle |
53-54 | Relatively and discern the tenth five-element | 0 | Generate Ariadne site value | Stop |
55-56 | Idle | | Generate the tenth five-element site value | Stop |
57 | Finish | | Stop | Stop |
By present embodiment as can be seen, in order to guarantee that rounding error that non-full zero error row produces can not have influence on the result that full zero error row below this non-full zero error row generates the site in error diffusion process, (be the 1st in the present embodiment for full zero error row in the present embodiment, 2,3,8,9,14,15 row), generate corresponding site by direct generation site device 7, for non-full zero error row (is the 4th, 5,6 in the present embodiment, 10,11,12 row), generate corresponding site by error diffusion device 8, simultaneously also generate corresponding site by error diffusion device 8 for first the full zero error row (being the 7th row and the 13rd row in the present embodiment) below the non-full zero error row, error diffusion device 8 quits work after handling first full zero error row below non-full zero error row and the non-full zero error row.
Embodiment 3
Present embodiment 3 difference from Example 2 are, present embodiment 3 has also taken into full account the influence of error accumulation value to non-full zero error row site generation result on the basis of embodiment 2, when if the capable full zero error row of N is arranged between last column of tight adjacent following first non-full zero error row/image of promptly current non-full zero error row and its, wherein, N is a positive integer, in present embodiment, have 3 capable full zero error row the (promptly the 7th between non-full zero error row the 6th row and the 10th row, 8,9 row), there is not continuous error of calculation value, therefore, the error amount that the 6th row produces can be to the 10th, 11, the site of 12 row generates the result and makes a difference, in order to realize better invention effect, present embodiment 3 has also taken into full account the influence of error accumulation value to non-full zero error row site generation result on the basis of embodiment 2, promptly in a kind of method that can accelerate image screening speed, in step (2) and the step (3), if current line is first non-full zero error row, then carry out generating corresponding site after the error diffusion, simultaneously, the row below this non-full zero error row is carried out continuous error of calculation value; If current line is not first non-full zero error row, after calculating, the error accumulation value of then waiting for this row carries out again generating the site after the error diffusion, and simultaneously, the error amount that this row is gone below calculates continuously, finishes until processing; In a kind of device that can accelerate image screening speed, also be provided with an error amount comparison circuit 4 in this device 1, whether this error amount comparison circuit 4 is used for the error amount that relative error disperser 8 produces in error diffusion process be zero, when if the error amount of all pixels in the relatively back definite full zero error row of error amount comparison circuit 4 is zero, comparative result is sent to control circuit 9, after control circuit 9 is analyzed, then can close error diffusion device 8; When if the error amount of the relatively back definite full zero error row of error amount comparison circuit 4 is non-vanishing, comparative result is sent to control circuit 9, after control circuit 9 is analyzed, notice error diffusion device 8 is when generating non-full zero error row site by error diffusion, need to calculate continuously the error amount of each row of full zero error row, until handling all pixels, in the present embodiment, full zero error row the (promptly the 7th, 8,9,13,14 row) error amount is all non-vanishing, needs error diffusion device 8 continuous error of calculation values.
Specifically, identical with the assumed conditions in embodiment 1 and 2,256 grades of image gray as shown in table 1 are handled in i.e. supposition, its threshold value is 127, can handle the Error Calculation and the diffusion of a pixel within assumption error disperser 8 one-periods, the data input width of supposing direct generation site device 7 is 32Bit (4 pixel grey scale/cycle), promptly the phase is handled 4 pixels weekly, adopt the Floyd-Steinberg error diffusion method, diffusion coefficient is 1/16,3/16,5/16,7/16; The data width of identification circuit 3 is 32Bit (4 pixel grey scale/cycle), be whether are zero error points to identification circuit 3 if once can compare 4 pixels, the data of delegation need relatively can be finished identification twice at most, when adopting apparatus and method of the present invention to handle image as shown in table 1, its concrete processing procedure is as shown in table 4.
Table 4 adopts method and apparatus of the present invention to handle the process of image as shown in table 1
Periodicity | Gray value comparison circuit/identification circuit | Recognition result | Directly generate the site device | The error diffusion device |
1-2 | Relatively and discern first the row | 0 | Idle | Stop |
3-4 | Relatively and discern second the row | 0 | Generate the first row site | Stop |
5-6 | Relatively and discern the third line | 0 | Generate the second row site | Stop |
7 | Relatively and discern fourth line | 1 | Generate the third line site value | Stop |
8 | Idle | | Stop |
9 | Relatively and discern fifth line | 0 | Idle | Generate fourth line site value |
10 | 1 | Idle |
11-13 | Idle | | Idle |
14 | Relatively and discern the 6th the row | 1 | Idle | Generate fifth line site value |
15-18 | Idle | | Idle |
19-20 | Relatively and discern the 7th the row | 0 | Idle | Generate the 6th row site value |
21-23 | Idle | | Idle |
24-25 | Relatively and discern the 8th the row | 0 | Idle | Generate the 7th row site value |
26-28 | Idle | | Idle |
29-30 | Relatively and discern the 9th the row | 0 | Generate the 8th row site value | Parallel diffusion |
31 | Relatively and discern the tenth the row | 1 | Generate the 9th row site value | Parallel diffusion |
32 | Idle | | | Parallel diffusion |
33-38 | Idle | | Idle | Parallel diffusion |
39 | Relatively and discern the tenth delegation | 1 | Idle | Generate the tenth row site value |
40-43 | Idle | | Idle |
44 | Relatively and discern the 12 the row | 1 | Idle | Generate the tenth delegation's site value |
45-48 | Idle | | Idle |
49-50 | Relatively and discern the tenth triplex row | 0 | Idle | Generate the 12 row site value |
51-53 | Idle | | Idle |
54-55 | Relatively and discern Ariadne | 0 | Idle | Generate the tenth triplex row site value |
56-58 | Idle | | Idle |
59-60 | Relatively and discern the tenth five-element | 0 | Generate Ariadne site value | Parallel diffusion |
61-62 | Idle | | Generate the tenth five-element site value | Parallel diffusion |
63 | Finish | | Stop | Stop |
As can be seen from the above-described embodiment, present embodiment 3 has considered that also the error accumulation value generates result's influence to non-full zero error row site, (be the 1st in the present embodiment promptly for full zero error row, 2,3,8,9,14,15 row), promptly generate corresponding site by direct generation site device 7, for non-full zero error row (is the 4th in the present embodiment, 5,6,10,11,12 row), generate corresponding site, also generate corresponding site by error diffusion device 8 for first the full zero error row (being the 7th and the 13rd row in the present embodiment) below the non-full zero error row by error diffusion device 8; Simultaneously, the 6th row and the 10th row are non-full zero error row, there are the full zero error row of 3 row the (promptly the 7th centre, 8,9 row), and the error amount of this full zero error row is all non-vanishing, therefore, the 6th worked error diffusion device 8 generates corresponding site, error diffusion device 8 calculates the error amount of the full zero error row of the 7th, 8,9 triplex rows continuously simultaneously, after the error accumulation value that the 10th row acceptance the 6th row produces, produces the site by error diffusion device 8, calculate simultaneously continuously the error amount that each row produces below this row, to the last i.e. the 15th row back end-of-job of delegation.
Embodiment 4
Present embodiment 4 difference from Example 3 are, present embodiment 4 can allow the computational process of error amount suspend according to user's different demands, because different users to final linked network after the result of image require difference, what have requires the image effect after the linked network fully consistent with original image, what have then needn't require so, the calculating of error amount then can influence final linked network effect, therefore, in order to satisfy the linked network requirement of different user, the user can the specification error value calculating when suspend, specifically: as shown in Figure 1, a kind of method that can accelerate image screening speed, on the basis of embodiment 3, in step (2) and the step (3), calculate the line number of the full zero error row that has carried out error diffusion simultaneously, after the line number of the full zero error row that has carried out error diffusion surpasses preset threshold, in the present embodiment 4, threshold value is 3, at this moment, suspend the calculating of error amount, directly the error accumulation value that will currently calculate keeps and is accumulated to first non-full zero error row that full zero error row occurs below, and during first non-full zero error row below running into full zero error row, continues to adopt error diffusion method generation site and error of calculation value; As shown in Figure 2, a kind of device that can accelerate image screening speed, wherein, also be provided with complete zero row diffusion counter 11 and clock-signal generator 5 in the control circuit 9, complete zero row diffusion counter 11 is used for counting the line number of the full zero error row that has carried out error diffusion, after the line number of the full zero error row that has carried out error diffusion surpasses preset threshold, complete zero row diffusion counter 11 sends to clock-signal generator 5 with this information, 5 calculating that suspend error diffusion device 8 error amounts by time-out tranmitting data register signal to the mode of error diffusion device 8 of clock-signal generator, and keep the current error accumulation value that calculates, and during first non-full zero error row below running into, error diffusion device 8 uses the error accumulation value that produces when suspending to proceed the generation of site and the calculating of error amount.
Specifically, in the present embodiment, suppose and handle 256 grades of image gray as shown in table 5 that its threshold value is 127, can handle the Error Calculation and the diffusion of a pixel within assumption error disperser 8 one-periods, the data input width of supposing direct generation site device 7 is 32Bit (4 pixel grey scale/cycle), and promptly the phase is handled 4 pixels weekly, adopts the Floyd-Steinberg error diffusion method, diffusion coefficient is 1/16,3/16,5/16 ,/7/16; The data width of identification circuit 3 is 32bit (4 pixel grey scale/cycle), be whether are zero error points to identification circuit 3 if once can compare 4 pixels, the data of delegation need relatively can be finished identification twice at most, when adopting apparatus and method of the present invention to handle image as shown in table 5, its concrete processing procedure is as shown in table 6.
Table 5 gradation of image value matrix is 5 * 17 (wherein, 0 expression gray value is that 0 pixel is a stain, and 255 expression gray values are that 255 pixel is a white point)
0 | 0 | 255 | 255 | 0 |
0 | 0 | 0 | 255 | 0 |
0 | 0 | 255 | 0 | 0 |
16 | 7 | 102 | 0 | 25 |
0 | 0 | 0 | 0 | 23 |
0 | 0 | 255 | 255 | 255 |
0 | 0 | 255 | 0 | 0 |
0 | 0 | 0 | 255 | 0 |
0 | 255 | 0 | 0 | 0 |
0 | 0 | 0 | 0 | 0 |
0 | 0 | 0 | 0 | 0 |
255 | 255 | 255 | 255 | 255 |
255 | 255 | 255 | 255 | 255 |
255 | 255 | 255 | 255 | 255 |
255 | 255 | 255 | 255 | 223 |
0 | 23 | 63 | 98 | 23 |
0 | 234 | 8 | 45 | 24 |
Table 6 adopts method and apparatus of the present invention to handle the process of image as shown in table 5
Periodicity | Gray value comparison circuit/identification circuit | Recognition result | Directly generate the site device | The error diffusion device |
1-2 | Relatively and discern first the row | 0 | Idle | Stop |
3-4 | Relatively and discern second the row | 0 | Generate the first row site | Stop |
5-6 | Relatively and discern the third line | 0 | Generate the second row site | Stop |
7 | Relatively and discern fourth line | 1 | Generate the third line site value | Stop |
8 | Idle | | Stop |
9 | Relatively and discern fifth line | 0 | Idle | Generate fourth line site value |
10 | 1 | Idle |
11-13 | Idle | | Idle |
14 | Relatively and discern the 6th the row | 0 | Idle | Generate fifth line site value |
15-18 | Idle | | Idle |
19-20 | Relatively and discern the 7th the row | 0 | Idle | Generate the 6th row site value |
21-23 | Idle | | Idle |
24-25 | Relatively and discern the 8th the row | 0 | Generate the 7th row site value | Parallel diffusion generates the 7th row accumulated value |
26-27 | Relatively and discern the 9th the row | 0 | Generate the 8th row site value |
28 | Relatively and discern the tenth the row | 0 | Generate the 9th row site value |
29 | Parallel diffusion generates the 8th row accumulated value |
30-31 | Relatively and discern the tenth delegation | 0 | Generate the tenth row site value |
32-33 | Relatively and discern the 12 the row | 0 | Generate the tenth delegation's site value |
34-35 | Relatively and discern the tenth triplex row | 0 | Generate the 12 row site value | Suspend |
36-37 | Relatively and discern Ariadne | 0 | Generate the tenth triplex row site value | Suspend |
38 | Relatively and discern the tenth five-element | 0 | Generate Ariadne site value | Suspend |
39 | 1 | Suspend |
40-41 | Relatively and discern the 16 the row | 1 | Idle | Generate the tenth five-element site value |
42-44 | Idle | | Idle | |
45 | Relatively and discern the 17 the row | 1 | Idle | Generate the 16 row site value |
46-49 | Idle | | Idle |
50 | Idle | | Idle | Generate the 17 row site value |
Find out by present embodiment 4, line number threshold value at the full zero error row of setting that has spread is 3 o'clock, and error diffusion device 8 only calculates the error accumulation value of eighth row when running into continuous a plurality of non-full zero error row, suspend then and calculate, the current error accumulation value that calculates is kept.When the 15th row, run into first non-full zero error row, at this moment, eighth row is produced the back suspend the error accumulation value calculating and remain and be accumulated to the approximation of the error accumulation values of 15 row as 14 row, the calculating of proceeding the generation of site and error amount is until the 17th row end-of-job.
Find out by the foregoing description 1-embodiment 4, adopt method and apparatus of the present invention can accelerate the linked network speed of image, can guarantee the linked network effect simultaneously.
Method of the present invention is not limited to the embodiment described in the embodiment, and those skilled in the art's technical scheme according to the present invention draws other execution mode, belongs to technological innovation scope of the present invention equally.