Summary of the invention
The embodiment of the present invention be designed to provide a kind of image processing method, image processing apparatus, electronic equipment and
Computer readable storage medium, and then overcome one caused by the limitation and defect due to the relevant technologies at least to a certain extent
A or multiple problems.
According to a first aspect of the embodiments of the present invention, a kind of image processing method is provided, including:By the ash of original image
Degree image is divided into multiple blocks;Printed page analysis is carried out with the class of each block of determination to each block in the multiple block
Type;Type based on each block fill each block the foreground layer of foreground layer, mask layer and background layer to each block,
Mask layer and background layer carry out compression processing and obtain compression image.
In some embodiments of the invention, aforementioned schemes are based on, version is carried out to each block in the multiple block
Surface analysis with the type of each block of determination, including:The pixel average for determining each block in the multiple block, is based on
The pixel average determines the pixel variance yields of each block;Each block is divided by the pixel variance yields based on each block
Pure color type block, double-colored type block and polychrome type block.
In some embodiments of the invention, aforementioned schemes are based on, based on the pixel variance yields of each block by each area
Block is divided into pure color type block, double-colored type block and polychrome type block, including:Judge whether the pixel variance yields of the block is small
In first variance threshold value;If it is determined that being less than the first variance threshold value, then the block is determined as pure color type block;If it is determined that
Not less than the first variance threshold value, then judge whether the pixel variance yields of the block is less than second variance threshold value, described
Two variance threshold values are greater than the first variance threshold value;If it is determined that being less than the second variance threshold value, then the block is determined as
Double-colored type block;If it is determined that being not less than the second variance threshold value, then the block is determined as polychrome type block.
In some embodiments of the invention, aforementioned schemes are based on, described image processing method further includes:Judge described pure
Whether the pixel average of colour pattern block is greater than predetermined threshold;If it is determined that being greater than the predetermined threshold, then by pure color type area
Block is determined as pure color-prospect type block;If it is determined that being not more than the predetermined threshold, then the pure color type block is determined as pure
Color-background type block.
In some embodiments of the invention, aforementioned schemes are based on, described image processing method further includes:Judge described more
Whether the pixel average of colour pattern block is greater than the predetermined threshold;If it is determined that being greater than the predetermined threshold, then by the polychrome
Type block is determined as polychrome-prospect type block;If it is determined that being not more than the predetermined threshold, then the polychrome type block is determined as
Polychrome-background type block.
In some embodiments of the invention, aforementioned schemes are based on, the type based on each block fills each block
Foreground layer, mask layer and background layer, including:When the block is pure color-prospect type block, the pixel of the block is put down
Foreground layer of the color filling that mean value represents to the block;White is filled into the mask layer of the block, and pure by upper one
Background layer of the color filling of color-background type block background layer to the block.
In some embodiments of the invention, aforementioned schemes are based on, the type based on each block fills each block
Foreground layer, mask layer and background layer, including:
When the block is polychrome-prospect type block, the original color value of the block is filled into the block
Foreground layer;White is filled into the mask layer of the block, and by the color filling of the background layer of upper one pure color-background type block
To the background layer of the block.
In some embodiments of the invention, aforementioned schemes are based on, the type based on each block fills each block
Foreground layer, mask layer and background layer, including:When the block is double-colored type block, institute is determined according to the predetermined threshold
State the foreground color and background color of block;The foreground color is filled into the foreground layer of the block, and by the background
Background layer of the color filling to the block;Judge whether the pixel value of the pixel of the block is greater than the predetermined threshold;
If it is determined that being greater than the predetermined threshold, then white is filled at the pixel;If it is determined that being not more than the predetermined threshold, then exist
Black is filled at the pixel.
In some embodiments of the invention, aforementioned schemes are based on, the type based on each block fills each block
Foreground layer, mask layer and background layer, including:When the block is polychrome-background type block, by upper one pure color-prospect type
Foreground layer of the color filling of the foreground layer of block to the block;By filled black to the mask layer of the block, and by institute
The primitive color for stating block is filled into the background layer of the block.
In some embodiments of the invention, aforementioned schemes are based on, the type based on each block fills each block
Foreground layer, mask layer and background layer, including:When the block is pure color-background type block, the pixel of the block is put down
Background layer of the color filling representated by mean value to the block;By filled black to the mask layer of the block, and by upper one
Foreground layer of the color filling of pure color-prospect type block foreground layer to the block.
In some embodiments of the invention, aforementioned schemes are based on, described image processing method further includes:To each block
Foreground layer and background layer carry out diminution processing.
In some embodiments of the invention, aforementioned schemes are based on, the size of each block is 8*8 pixel, 4*4 picture
One of element and 2*2 pixel are a variety of.
According to a second aspect of the embodiments of the present invention, a kind of image processing apparatus is provided, including:Division unit is used for
The gray level image of original image is divided into multiple blocks;Type determining units, for each area in the multiple block
Block carries out printed page analysis with the type of each block of determination;Fills unit fills each area for the type based on each block
Foreground layer, mask layer and the background layer of block;Compression unit, for foreground layer, mask layer and the background layer to each block
It carries out compression processing and obtains compression image.
According to a third aspect of the embodiments of the present invention, a kind of electronic equipment is provided, including:Processor;And memory,
It is stored with computer-readable instruction on the memory, is realized when the computer-readable instruction is executed by the processor as above
State image processing method described in first aspect.
According to a fourth aspect of the embodiments of the present invention, a kind of computer readable storage medium is provided, meter is stored thereon with
Calculation machine program realizes the image processing method as described in above-mentioned first aspect when the computer program is executed by processor.
In the technical solution provided by some embodiments of the present invention, on the one hand, draw the gray level image of original image
Multiple blocks are layered, to the progress printed page analysis of each block with the type of each block of determination, the type fill area based on block
Foreground layer, mask layer and the background layer of block, can obtain blocking image, so as to realize image pixel value in flakes
Filling;On the other hand, compression processing is carried out to the foreground layer, mask layer and background layer of each block and obtains compression image, by
It is all filled to be pure color in most of block, therefore the group/cording quantity of compression image can be significantly reduced, so as in fidelity
While further increase the compression ratio of image, can be improved the efficiency of transmission of image in a network.
It should be understood that above general description and following detailed description be only it is exemplary and explanatory, not
It can the limitation present invention.
Specific embodiment
Example embodiment is described more fully with reference to the drawings.However, example embodiment can be real in a variety of forms
It applies, and is not understood as limited to embodiment set forth herein;On the contrary, thesing embodiments are provided so that the present invention will be comprehensively and complete
It is whole, and the design of example embodiment is comprehensively communicated to those skilled in the art.Identical appended drawing reference indicates in figure
Same or similar part, thus repetition thereof will be omitted.
In addition, described feature, structure or characteristic can be incorporated in one or more implementations in any suitable manner
In example.In the following description, many details are provided to provide and fully understand to the embodiment of the present invention.However,
It will be appreciated by persons skilled in the art that technical solution of the present invention can be practiced without one or more in specific detail,
Or it can be using other methods, constituent element, device, step etc..In other cases, it is not shown in detail or describes known side
Method, device, realization or operation are to avoid fuzzy each aspect of the present invention.
Block diagram shown in the drawings is only functional entity, not necessarily must be corresponding with physically separate entity.
I.e., it is possible to realize these functional entitys using software form, or realized in one or more hardware modules or integrated circuit
These functional entitys, or these functional entitys are realized in heterogeneous networks and/or processor device and/or microcontroller device.
Flow chart shown in the drawings is merely illustrative, it is not necessary to including all content and operation/step,
It is not required to execute by described sequence.For example, some operation/steps can also decompose, and some operation/steps can close
And or part merge, therefore the sequence actually executed is possible to change according to the actual situation.
Fig. 1 shows the flow diagram of image processing method according to some embodiments of the present invention.
Shown in referring to Fig.1, in step s 110, the gray level image of original image is divided into multiple blocks.
In the exemplary embodiment, when original image is color image, gray processing processing is carried out to original image, obtains original
The gray level image of beginning image.For example, the picture of color image can be calculated using mean value method when original image is color image
The R (Red, red) of vegetarian refreshments, G (Green, green), B (blue, blue) three components average value, using the average value as the pixel
Gray value.It should be noted that can also using other modes to original image carry out gray processing processing, the present invention to this not
Carry out particular determination.
Further, the gray level image of the original image after gray processing is divided into multiple blocks, for example, can be with 8*8
Gray level image is divided into multiple blocks for unit by pixel.In addition it is also possible to which gray level image is drawn with 4*4 pixel or 2*2 pixel
It is divided into multiple blocks, this is same within the scope of the present invention.
In the step s 120, printed page analysis is carried out with the class of each block of determination to each block in the multiple block
Type.
In the exemplary embodiment, to the block of gray level image carry out printed page analysis by each block be divided into pure color type block,
Double-colored type block and polychrome type block, the polychrome type block indicate the block with three kinds and three kinds or more colors.For example,
It can determine the pixel average of each block in multiple blocks of gray level image, each area is calculated based on the pixel average
The pixel variance yields of block;Based on the pixel variance yields of each block by each block be divided into pure color type block, double-colored type block with
And polychrome type block.
Further, it can also judge whether the pixel average of pure color type block is greater than predetermined threshold;If it is determined that being greater than
Pure color type block is then determined as pure color-prospect type block by predetermined threshold;If it is determined that being not more than predetermined threshold, then by pure color type
Block is determined as pure color-background type block.
Further, it is also possible to judge whether the pixel average of polychrome type block is greater than predetermined threshold;If it is determined that being greater than predetermined
Polychrome type block is then determined as polychrome-prospect type block by threshold value;If it is determined that being not more than predetermined threshold, then by polychrome type block
It is determined as polychrome-background type block.
It should be noted that in this exemplary embodiment, predetermined threshold can be each pixel of the gray level image of each block
Average gray, or other threshold values appropriate of foreground and background can be divided the image into.
In step s 130, the type based on each block fills the foreground layer, mask layer and background layer of each block.
In the exemplary embodiment, the pixel color that pixel average is greater than to the block of predetermined threshold is filled into foreground layer;
The pixel color that pixel average is less than the block of predetermined threshold is filled into background layer.Exposure mask (Mask) layer remains block institute
The feature of the original image of category, when the pixel for indicating on block is shown, the color of prospect of the application layer respective pixel into
The color of row filling display or background layer respective pixel is filled display.
In the exemplary embodiment, when block is pure color-prospect type block, by the face of the pixel average representative of the block
Color is filled into the foreground layer of the block, and white is filled into the mask layer of the block, and by the back of upper one pure color-background type block
Background layer of the color filling of background layer to the block.
When block is polychrome-prospect type block, the original color value of the block is filled into the foreground layer of the block;It will
White is filled into the mask layer of the block, and by the color filling of the background layer of upper one pure color-background type block to the block
Background layer.
When block is double-colored type block, the foreground color and background color of the block are determined according to above-mentioned predetermined threshold;
Foreground color is filled into the foreground layer of the block, and background color is filled into the background layer of the block;Judge the block
Whether the pixel value of pixel is greater than above-mentioned predetermined threshold;If it is determined that being greater than predetermined threshold, then white is filled at the pixel;
If judgement is not more than above-mentioned predetermined threshold, black is filled at the pixel.
Block be polychrome-background type block when, by the color filling of the foreground layer of upper one pure color-prospect type block arrive this
The foreground layer of block;By the mask layer of filled black to the block, and the primitive color of the block is filled into the back of the block
Background layer.
When block is pure color-background type block, color filling representated by the pixel average by the block to the area
The background layer of block;It is filled out by the mask layer of filled black to the block, and by the color of the foreground layer of upper one pure color-prospect type block
It is charged to the foreground layer of the block.
In step S140, compression processing is carried out to the foreground layer, mask layer and background layer of each block and is compressed
Image.
In the exemplary embodiment, JPEG (Joint Photographic Experts Group, joint image can be used
Panel of expert), the compression methods such as JPEG200 or PNG (Portable Network Graphics, portable network figure)
The foreground layer and background layer of each block are compressed, using JBIG (Joint Bi-level Image Experts
Group combines bianry image expert group) or the compression methods such as JBIG2 compression processing is carried out to the mask layer of each block.
It should be noted that above-mentioned carry out the compression method of compression processing only to foreground layer, background layer and mask layer
For for example, can also be compressed using other compression methods appropriate to foreground layer, background layer and mask layer, this hair
Bright comparison is without particular determination.
The image processing method according to shown in Fig. 1, on the one hand, the gray level image of original image is divided into the multiple areas of floor
Block, to the progress printed page analysis of each block with the type of each block of determination, the foreground layer of the type filling block based on block,
Mask layer and background layer can obtain blocking image, so as to realize the filling in flakes of image pixel value;Another party
Face carries out compression processing to the foreground layer, mask layer and background layer of each block and obtains compression image, due to most of block
It is all filled to be pure color, therefore the group/cording quantity of compression image can be significantly reduced, so as to further while fidelity
The compression ratio for improving image, can be improved the efficiency of transmission of image in a network.
In addition, in some embodiments, can also before the compression process, the foreground layer and background layer of each block into
Row diminution processing.Since most of block is filled with pure color, foreground layer and background layer are carried out at diminution appropriate
Reason, will not influence the display effect of original image, and can effectively reduce the size of color image.Since mask layer needs to the greatest extent
Most original and most image detail tables may be retained, diminution processing is not carried out to mask layer.
Fig. 2 shows the schematic diagrames of the layering of image processing method according to some embodiments of the present invention.
Referring to shown in Fig. 2, layered shaping can be carried out to the image comprising text and figure, obtain the prospect of the image
Layer, mask layer and background layer.In this exemplary embodiment, pixel average is greater than to the pixel color of the block of predetermined threshold
It is filled into foreground layer;The pixel color that pixel average is less than the block of predetermined threshold is filled into background layer;Mask layer indicates
In the pixel display on block, the color of prospect of the application layer respective pixel or the color of background layer respective pixel.
In Fig. 2, the black picture element in mask layer indicates the color in pixel display using background layer respective pixel
Filling;White pixel in mask layer indicates the color filling of the prospect of the application layer respective pixel in pixel display.For example, covering
The color of " ABCD " in the black box among film layer be white, then display when prospect of the application layer respective pixel color filling
" ABCD " in mask layer in black box uses the color filling black box of background layer respective pixel.Mask layer bottom it is black
Color frame uses for example colored totem culture of the color of background layer respective pixel in display.
Fig. 3 shows the schematic process flow diagram of the image procossing of other embodiments according to the present invention.
Referring to shown in Fig. 3, in step s310, gray processing processing is carried out to original color image, obtains original color figure
The gray level image of picture.
In step s 320, gray level image is split, obtains multiple blocks.It can be right as unit of 8*8 pixel
Gray level image is split, and can also be split as unit of 4*4 or 2*2 pixel to gray level image.
In step S330, printed page analysis is carried out to block, each block is divided into pure color-prospect type block, ninsolid color
That is polychrome-prospect type block, prospect+background type, that is, double-colored type block, ninsolid color-background type block and pure color-background type area
Block.It can be according to the pixel average of each block, pixel variance yields and corresponding average value threshold value, variance threshold values to block
Classify.Average value threshold value indicates the threshold value that distinguishes to foreground and background, variance threshold values indicate to monochromatic, double-colored and
The threshold value that polychrome distinguishes.
In step S340, the type based on each block fills the foreground layer, mask layer and background layer of each block.
For prospect+background type, that is, double-colored type block, the foreground color and background color of the block are determined according to predetermined threshold, such as greatly
It is foreground color in the color of predetermined threshold, the color less than predetermined threshold is background color, and foreground color is filled into the area
The foreground layer of block, background color are filled into the background layer of the block.In mask layer, filled at pixel corresponding with foreground color
White fills black at pixel corresponding with background color.
In step S350, foreground layer and background layer to each block carry out diminution processing.By reducing by block
Foreground layer and background layer carry out diminution processing, the storage size of compression image can be effectively reduced, to improve figure
As efficiency of transmission in a network.
In step S360, using compression methods such as JPEG, JPEG200 or PNG to the foreground layer of each block and
Background layer is compressed, and carries out compression processing using mask layer of the compression methods such as JBIG or JBIG2 to each block.
Fig. 4 shows the flow diagram for carrying out printed page analysis to block according to some embodiments of the present invention.
Referring to shown in Fig. 4, in step S410, the grayscale image of original image is split, obtains multiple blocks.
In step S415, the pixel average of each block is calculated, the picture of each block is determined based on pixel average
Plain variance yields, judges whether the pixel variance yields of block is less than first variance threshold value;If it is determined that being less than first variance threshold value, then will
The block is determined as pure color type block, then advancees to step S445;If it is determined that being not less than first variance threshold value, then carry out to step
Rapid S420.
In the step s 420, judge whether the pixel variance yields of block is less than second variance threshold value, if it is determined that less than second
Variance threshold values are then carried out to step S425;If it is determined that being not less than second variance threshold value, then value step S430 is carried out, wherein second
Variance threshold values are greater than first variance threshold value, and first variance threshold value is indicated to the monochromatic and double-colored threshold value distinguished, second variance
Threshold value indicates the threshold value distinguished to double-colored and polychrome.
In step S425, the block that pixel variance to less than second variance threshold value are greater than first variance threshold value is determined as
Double-colored type block, that is, prospect+background type block.
In step S430, determine whether the pixel average of block is greater than predetermined threshold, if it is determined that it is greater than predetermined threshold,
It then carries out to step S435;If it is determined that being not more than predetermined threshold, then carry out to step S440.
In step S435, block is determined as ninsolid color i.e. polychrome-prospect type block.
In step S440, block is determined as ninsolid color-background type block.
In step S445, determine whether the pixel average of block is greater than predetermined threshold, if it is determined that it is greater than predetermined threshold,
It then carries out to step S450;If it is determined that being not more than predetermined threshold, then carry out to step S455.
In step S450, block is determined as pure color-prospect type block.
In step S455, block is determined as pure color-background type block.
Fig. 5 shows the schematic diagram being filled according to some embodiments of the present invention to pure color-prospect type block.
Referring to Figure 5, when block is pure color-prospect type block, the pixel average of the block is calculated, by what is obtained
The average value of gray-scale pixels changes into value of color, which is filled into the foreground layer of the block;White 1 is filled into the area
The mask layer of block, and by the background layer of the color filling of the background layer of upper one pure color-background type block to the block.
Fig. 6 shows the schematic diagram being filled according to some embodiments of the present invention to ninsolid color-prospect type block.
Referring to shown in Fig. 6, when block is polychrome-prospect type block, the original color value of the block is filled into the area
The foreground layer of block;By white i.e. 1 mask layer for being filled into the block, and by the face of the background layer of upper one pure color-background type block
Color is filled into the background layer of the block.
Fig. 7 shows the schematic diagram being filled according to some embodiments of the present invention to foreground-background type block.
Referring to shown in Fig. 7, when block is double-colored type block, that is, prospect+background type block, being determined according to predetermined threshold should
The foreground color and background color of block are for example, be determined as foreground color for the color that pixel value is greater than predetermined threshold, by pixel
Value is determined as background color no more than the color of predetermined threshold;Foreground color is filled into the foreground layer of the block, and by background
Background layer of the color filling to the block.
Further, judge whether the pixel value of the pixel of block is greater than the predetermined threshold;If it is determined that predetermined greater than this
Threshold value then fills white at the pixel;If judgement is not more than the predetermined threshold, black is filled at the pixel.It should
Predetermined threshold can be the pixel average of the double-colored type block, or other that can distinguish foreground and background are appropriate
Threshold value.
Fig. 8 is shown to be shown what ninsolid color i.e. polychrome-background type block was filled according to some embodiments of the present invention
It is intended to.
Referring to shown in Fig. 8, when block is polychrome-background type block, by the foreground layer of upper one pure color-prospect type block
Foreground layer of the color filling to the block;Black i.e. 0 is filled into the mask layer of the block, and the primitive color of the block is filled out
It is charged to the background layer of the block.
Fig. 9 shows the schematic diagram being filled according to some embodiments of the present invention to pure color-background type block.
Referring to shown in Fig. 9, when the block is pure color-background type block, the pixel average of the block is calculated, will
To the average value of gray-scale pixels change into value of color, which is filled into the background layer of the block;Filled black is arrived
The mask layer of the block, and by the foreground layer of the color filling of the foreground layer of upper one pure color-prospect type block to the block.
In addition, in an embodiment of the present invention, additionally providing a kind of image processing apparatus.Referring to Fig.1 shown in 0, the image
Processing unit 1000 may include:Division unit 1010, type determining units 1020, fills unit 1030 and compression unit
1040.Wherein, division unit 1010 is used to the gray level image of original image being divided into multiple blocks;Type determining units 1020
For carrying out printed page analysis to each block in the multiple block with the type of each block of determination;Fills unit 1030 is used
The foreground layer, mask layer and background layer of each block are filled in the type based on each block;Compression unit 1040 for pair
Foreground layer, mask layer and the background layer of each block carry out compression processing and obtain compression image.
In some embodiments of the invention, aforementioned schemes are based on, type determining units 1020 include:Pixel variance yields is true
Order member is determined each for determining the pixel average of each block in the multiple block based on the pixel average
The pixel variance yields of a block;Each block is divided into pure color type for the pixel variance yields based on each block by taxon
Block, double-colored type block and polychrome type block.
In some embodiments of the invention, aforementioned schemes are based on, the taxon is configured as:Judge the block
Pixel variance yields whether be less than first variance threshold value;If it is determined that being less than the first variance threshold value, then the block is determined
For pure color type block;If it is determined that being not less than the first variance threshold value, then judge whether the pixel variance yields of the block is less than
Second variance threshold value, the second variance threshold value are greater than the first variance threshold value;If it is determined that it is less than the second variance threshold value,
The block is then determined as double-colored type block;If it is determined that being not less than the second variance threshold value, then the block is determined as
Polychrome type block.
In some embodiments of the invention, aforementioned schemes are based on, described image processing unit 1000 further includes:First sentences
Disconnected unit, for judging whether the pixel average of the pure color type block is greater than predetermined threshold;First determination unit is used for
When determining to be greater than the predetermined threshold, then the pure color type block is determined as pure color-prospect type block;Second determination unit,
For when determining no more than the predetermined threshold, then the pure color type block being determined as pure color-background type block.
In some embodiments of the invention, aforementioned schemes are based on, described image processing unit 1000 further includes:Second sentences
Disconnected unit, for judging whether the pixel average of the polychrome type block is greater than the predetermined threshold;Third determination unit is used
In when determining to be greater than the predetermined threshold, then the polychrome type block is determined as polychrome-prospect type block;4th judgement is single
Member, for when determining no more than the predetermined threshold, then the polychrome type block being determined as polychrome-background type block.
In some embodiments of the invention, aforementioned schemes are based on, fills unit 1030 is configured as:It is in the block
When pure color-prospect type block, by the foreground layer of the color filling of the pixel average representative of the block to the block;It will be white
Color is filled into the mask layer of the block, and by the color filling of the background layer of upper one pure color-background type block to the block
Background layer.
In some embodiments of the invention, aforementioned schemes are based on, fills unit 1030 is configured as:It is in the block
When polychrome-prospect type block, the original color value of the block is filled into the foreground layer of the block;White is filled into institute
State the mask layer of block, and by the background layer of the color filling of the background layer of upper one pure color-background type block to the block.
In some embodiments of the invention, aforementioned schemes are based on, fills unit 1030 is configured as:It is in the block
When double-colored type block, the foreground color and background color of the block are determined according to the predetermined threshold;By the foreground color
It is filled into the foreground layer of the block, and the background color is filled into the background layer of the block;Judge the block
Whether the pixel value of pixel is greater than the predetermined threshold;If it is determined that being greater than the predetermined threshold, then filled out at the pixel
Fill white;If it is determined that being not more than the predetermined threshold, then black is filled at the pixel.
In some embodiments of the invention, aforementioned schemes are based on, fills unit 1030 is configured as:It is in the block
When polychrome-background type block, by the foreground layer of the color filling of the foreground layer of upper one pure color-prospect type block to the block;
By filled black to the mask layer of the block, and the primitive color of the block is filled into the background layer of the block.
In some embodiments of the invention, aforementioned schemes are based on, fills unit 1030 is configured as:It is in the block
When pure color-background type block, by color filling representated by the pixel average of the block to the background layer of the block;It will
Filled black to the block mask layer, and by the color filling of the foreground layer of upper one pure color-prospect type block to the area
The foreground layer of block.
In some embodiments of the invention, aforementioned schemes are based on, described image processing unit 1000 further includes:Scaling is single
Member, for each block foreground layer and background layer carry out diminution processing.
In some embodiments of the invention, aforementioned schemes are based on, the size of each block is 8*8 pixel, 4*4 picture
One of element and 2*2 pixel are a variety of.
Each functional module and above-mentioned image procossing due to the image processing apparatus 1000 of example embodiments of the present invention
The step of example embodiment of method, is corresponding, therefore details are not described herein.
In an exemplary embodiment of the present invention, a kind of electronic equipment that can be realized the above method is additionally provided.
Below with reference to Figure 11, it illustrates the computer systems for the electronic equipment for being suitable for being used to realize the embodiment of the present invention
1100 structural schematic diagram.The computer system 1100 of electronic equipment shown in Figure 11 is only an example, should not be to the present invention
The function and use scope of embodiment bring any restrictions.
As shown in figure 11, computer system 1100 include central processing unit (CPU) 1101, can according to be stored in only
It reads the program in memory (ROM) 1102 or is loaded into random access storage device (RAM) 1103 from storage section 1108
Program and execute various movements appropriate and processing.In RAM 1103, be also stored with various programs needed for system operatio and
Data.CPU 1101, ROM 1102 and RAM 1103 are connected with each other by bus 1104.Input/output (I/O) interface 1105
It is also connected to bus 1104.
I/O interface 1105 is connected to lower component:Importation 1106 including keyboard, mouse etc.;Including such as cathode
The output par, c 1107 of ray tube (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section including hard disk etc.
1108;And the communications portion 1109 of the network interface card including LAN card, modem etc..Communications portion 1109 passes through
Communication process is executed by the network of such as internet.Driver 1110 is also connected to I/O interface 1105 as needed.It is detachable to be situated between
Matter 1111, such as disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 1110, so as to
In being mounted into storage section 1108 as needed from the computer program read thereon.
Particularly, according to an embodiment of the invention, may be implemented as computer above with reference to the process of flow chart description
Software program.For example, the embodiment of the present invention includes a kind of computer program product comprising be carried on computer-readable medium
On computer program, which includes the program code for method shown in execution flow chart.In such reality
It applies in example, which can be downloaded and installed from network by communications portion 1109, and/or from detachable media
1111 are mounted.When the computer program is executed by central processing unit (CPU) 1101, executes in the system of the application and limit
Above-mentioned function.
It should be noted that computer-readable medium shown in the present invention can be computer-readable signal media or meter
Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not
Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter
The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to:Electrical connection with one or more conducting wires, just
Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage
Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device,
Or above-mentioned any appropriate combination.In the present invention, computer readable storage medium can be it is any include or storage journey
The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this
In invention, computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal,
Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited
In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can
Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for
By the use of instruction execution system, device or device or program in connection.Include on computer-readable medium
Program code can transmit with any suitable medium, including but not limited to:Wirelessly, electric wire, optical cable, RF etc. or above-mentioned
Any appropriate combination.
Flow chart and block diagram in attached drawing are illustrated according to the system of various embodiments of the invention, method and computer journey
The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation
A part of one module, program segment or code of table, a part of above-mentioned module, program segment or code include one or more
Executable instruction for implementing the specified logical function.It should also be noted that in some implementations as replacements, institute in box
The function of mark can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are practical
On can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it wants
It is noted that the combination of each box in block diagram or flow chart and the box in block diagram or flow chart, can use and execute rule
The dedicated hardware based systems of fixed functions or operations is realized, or can use the group of specialized hardware and computer instruction
It closes to realize.
Being described in unit involved in the embodiment of the present invention can be realized by way of software, can also be by hard
The mode of part realizes that described unit also can be set in the processor.Wherein, the title of these units is in certain situation
Under do not constitute restriction to the unit itself.
As on the other hand, present invention also provides a kind of computer-readable medium, which be can be
Included in electronic equipment described in above-described embodiment;It is also possible to individualism, and without in the supplying electronic equipment.
Above-mentioned computer-readable medium carries one or more program, when the electronics is set by one for said one or multiple programs
When standby execution, so that the electronic equipment realizes such as above-mentioned image processing method as described in the examples.
For example, the electronic equipment may be implemented as shown in Figure 1:Step S110, by the gray level image of original image
It is divided into multiple blocks;Step S120 carries out printed page analysis to each block in the multiple block with each block of determination
Type;Step S130, the type based on each block fill the foreground layer, mask layer and background layer of each block;Step
S140 carries out compression processing to the foreground layer, mask layer and background layer of each block and obtains compression image.
It should be noted that although being referred to several modules for acting the device executed in the above detailed description
Or unit, but this division is not enforceable.In fact, embodiment according to the present invention, above-described two
Or more the feature and function of module or unit can be embodied in a module or unit.Conversely, above-described
One module or the feature and function of unit can be to be embodied by multiple modules or unit with further division.
Through the above description of the embodiments, those skilled in the art is it can be readily appreciated that example described herein is implemented
Mode can also be realized by software realization in such a way that software is in conjunction with necessary hardware.Therefore, according to the present invention
The technical solution of embodiment can be embodied in the form of software products, which can store non-volatile at one
Property storage medium (can be CD-ROM, USB flash disk, mobile hard disk etc.) in or network on, including some instructions are so that a calculating
Equipment (can be personal computer, server, touch control terminal or network equipment etc.) executes embodiment according to the present invention
Method.
Those skilled in the art after considering the specification and implementing the invention disclosed here, will readily occur to of the invention its
Its embodiment.This application is intended to cover any variations, uses, or adaptations of the invention, these modifications, purposes or
Person's adaptive change follows general principle of the invention and including the undocumented common knowledge in the art of the present invention
Or conventional techniques.The description and examples are only to be considered as illustrative, and true scope and spirit of the invention are by following
Claim is pointed out.
It should be understood that the present invention is not limited to the precise structure already described above and shown in the accompanying drawings, and
And various modifications and changes may be made without departing from the scope thereof.The scope of the present invention is limited only by the attached claims.