CN101510296A - Method for implementing two-value words image minification - Google Patents
Method for implementing two-value words image minification Download PDFInfo
- Publication number
- CN101510296A CN101510296A CNA2009100812624A CN200910081262A CN101510296A CN 101510296 A CN101510296 A CN 101510296A CN A2009100812624 A CNA2009100812624 A CN A2009100812624A CN 200910081262 A CN200910081262 A CN 200910081262A CN 101510296 A CN101510296 A CN 101510296A
- Authority
- CN
- China
- Prior art keywords
- value
- pixel
- image
- line
- pixel value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 41
- 239000011159 matrix material Substances 0.000 claims description 4
- 230000009466 transformation Effects 0.000 abstract description 2
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000009792 diffusion process Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 239000000284 extract Substances 0.000 description 1
Images
Abstract
The invention discloses a method for realizing reduction of a binary text image, belonging to the field of image processing. The method comprises the steps as follows: firstly, according to transformation of coordinates, the position of an original image carrying out line drawing in the horizontal and vertical directions is calculated; and then an image after reduction is obtained after the line drawing in the horizontal and vertical directions of the original image is carried out. By the method, the small scale reduction of the binary text image can be realized, the image processing speed is improved and the occurrence of line break is effectively avoided.
Description
Technical field
The present invention relates to image processing field, relate in particular to a kind of method that realizes that the two-value character image dwindles.
Background technology
In the prior art image being dwindled common method is nearest-neighbor method.This method obtains the floating-point coordinate by reciprocal transformation, obtains an integer type coordinate after rounding, and the pixel value of this integer type coordinate pixel is exactly the pixel value of purpose pixel.Nearest-neighbor only is the pixel pixel value that extracts nearest integral point coordinate place, occurs the situation of broken string easily.
The common method that another kind of image dwindles is a method of interpolation.This method is according to the pixel value of the most contiguous on every side several pixels, by the pixel value of interpolation calculation impact point.Also disclose a kind of improved image as Chinese patent CN1622134 " a kind of realize dwindle image conversion method " and dwindled interpolation algorithm.But be the gray-scale value that is between the 0-255 by interpolation calculation institute value when being to use method of interpolation to handle bianry image, need convert thereof into the black and white binary map by binaryzation again.If the use error diffusion is carried out the binaryzation conversion and can be formed the burr effect, and the error-diffusion method travelling speed is slow; If use threshold value to carry out binaryzation, can not solve the problem of broken string or line.
Above-mentioned two kinds of common methods, the effect that realization two-value character image dwindles is all not good.
Summary of the invention
At existing problem in the prior art, the purpose of this invention is to provide a kind of efficiently, have a method that the realization two-value character image of preferable effect dwindles.
In order to realize the foregoing invention purpose, the technical solution used in the present invention is that a kind of method that realizes that the two-value character image dwindles may further comprise the steps:
Step 1 is calculated original two-value character image according to coordinate transform and is carried out the position that level and vertical direction are taken out line;
Step 2 is carried out level and vertical two-value character image after taking out line and obtaining dwindling to original two-value character image.
Further, in the step 1, the method for taking out the position of line according to coordinate transform calculating vertical direction specifically may further comprise the steps:
The horizontal ordinate x of the corresponding point of horizontal ordinate i+1 in original image that each horizontal ordinate i is adjacent with its horizontal direction in the image after determining to dwindle
iAnd x
I+1Difference, described i is a positive integer;
If described horizontal ordinate x
iAnd x
I+1Difference greater than 1, determine the x of original image
iRow and x
i+ 1 classifies the position that vertical direction is taken out line as.
The method of taking out the position of line according to coordinate transform calculated level direction specifically may further comprise the steps:
The ordinate j+1 that the perpendicular direction of each ordinate j is adjacent in the image after determining to dwindle is at the ordinate y of the corresponding point coordinate figure of original image
jAnd y
J+1Difference, described j is a positive integer;
If described ordinate y
jAnd y
J+1Difference greater than 1, determine the y of original image
jRow and y
jThe position that+1 behavior level direction is taken out line.
Further, in the step 1, the method for the coordinate figure of the corresponding pixel points of coordinate figure in original image of each pixel is in the image after determining to dwindle:
According to the coordinate figure that dwindles each pixel in the image of back (i, j) and level and vertical direction dwindle ratio k
x, k
y, determine its respective coordinates value in original image (x, y), wherein, x=[i/k
x], y=/k
y, being about to described respective coordinates value and rounding downwards, the coordinate figure after obtaining rounding is the coordinate figure of original image corresponding point.
Further, described level and vertical direction are dwindled ratio k
x, k
ySpan be (75%, 100%).
Further, in the step 2, original image is carried out level specifically may further comprise the steps with vertical method of taking out the image after line obtains dwindling:
At first original image is carried out vertical direction and take out line, take out and carry out horizontal direction on the image of line and take out line, the image after obtaining dwindling finishing vertical direction then.
Original image is carried out level specifically be may further comprise the steps with vertical method of taking out the image after line obtains dwindling:
At first original image is carried out horizontal direction and take out line, take out and carry out vertical direction on the image of line and take out line, the image after obtaining dwindling finishing horizontal direction then.
Further, original image being carried out vertical direction takes out line and is meant the two row pixels of taking out line position are merged into a row pixel that the pixel value of the pixel after wherein determining to merge specifically comprises:
A. select two adjacent on horizontal direction pixels;
Whether the pixel value of b. judging described two pixels is identical, if the pixel value of two pixels is identical, the pixel value of the pixel after then merging is this pixel value, and carry out and finish, otherwise, carry out next step;
Whether the pixel value of c. judging two pixels that described two pixel horizontal direction both sides are adjacent is identical, if two pixel pixel values are identical, the pixel value of the pixel after then merging is the inverse value of this pixel value, carries out and finishes, otherwise the pixel value of the pixel after the merging is a preferred value.
Original image is carried out horizontal direction takes out line and be meant the two row pixels of taking out line position are merged into the one-row pixels point, wherein determine to merge back pixel pixel value and specifically comprise:
A. select two adjacent on vertical direction pixels;
Whether the pixel value of b. judging described two pixels is identical, if the pixel value of two pixels is identical, the pixel value of the pixel after then merging is this pixel value, and carry out and finish, otherwise, carry out next step;
Whether the pixel value of c. judging two pixels that described two pixel vertical direction both sides are adjacent is identical, if the pixel value of two pixels is identical, the pixel value of the pixel after then merging is the inverse value of this pixel value, carries out and finishes, otherwise the pixel value of the pixel after the merging is a preferred value.
Further, described preferred value can be system default value, also can be user's setting value, and when adopting the black matrix wrongly written or mispronounced character, the preferred value of system default is a white; When adopting white gravoply, with black engraved characters, the preferred value of system default is a black.
Effect of the present invention is: when adopting method of the present invention that the two-value character image is dwindled, efficient height not only, and have preferable effect can realize that two-value character image small scale dwindles, improve the speed of Flame Image Process, and effectively avoid the generation of the situation of breaking.
Description of drawings
The method flow diagram of Fig. 1 for realizing that the two-value character image dwindles;
Fig. 2 is the pixel distribution schematic diagram when vertically taking out line.
Embodiment
Below in conjunction with specification drawings and specific embodiments, the present invention is described in detail.
Embodiment one
A kind ofly in the embodiment of the invention realize that method that the two-value character image dwindles as shown in Figure 1, specifically may further comprise the steps:
S11: calculate original two-value character image according to coordinate transform and carry out the position that level and vertical direction are taken out line;
In the present embodiment, the pixel setting coordinate of image the 1st row the 1st row is (1,1), coordinate (x, the y) pixel of the capable x row of expression original image y, coordinate (i, the pixel of the capable i row of image j after j) expression is dwindled.Described position of taking out line according to coordinate transform calculating vertical direction specifically comprises:
The horizontal ordinate x of the corresponding point of horizontal ordinate i+1 in original image of the horizontal ordinate i of each pixel and its horizontal direction adjacent pixels point in the image after determining to dwindle
iAnd x
I+1Difference;
Wherein, dwindle ratio kx, determine its corresponding abscissa value x in original image, wherein x=[i/k according to the abscissa value i and the horizontal direction of dwindling each pixel in the image of back
x], promptly to i/k
xRound downwards.Described horizontal direction is dwindled ratio k
xScope is (75%, 100%).In the present embodiment, k
xValue is 90%.
If described horizontal ordinate x
iAnd x
I+1Difference greater than 1, determine the x of original image
iRow and x
i+ 1 classifies the position that vertical direction is taken out line as.
In the present embodiment, x
I+1-x
i=[(i+1)/k
x]-[i/k
x].If x
i+ 1-x
i1, x then
iRow and x
i+ 1 classifies the position that vertical direction is taken out line as.If original image is of a size of 10 x 10, k
xAnd k
yValue is 90%, then as calculated, and x
8=8, x
9=10, x
9With x
8Difference be 2, greater than 1, classify the position that vertical direction is taken out line as so determine the 8th row and the 9th of original image.
Described position of taking out line according to coordinate transform calculated level direction specifically comprises:
Determine the ordinate y of the corresponding point coordinate figure of ordinate j+1 in original image of the perpendicular direction adjacent pixels point of ordinate j of each pixel in the image after dwindling
jAnd y
J+1Difference;
Wherein, dwindle ratio ky, determine its corresponding abscissa value y in original image, wherein according to the ordinate value j and the horizontal direction of dwindling each pixel in the image of back
Promptly to j/k
yRound downwards.Described vertical direction is dwindled ratio k
yScope is (75%, 100%).In the present embodiment, k
yValue is 90%.
If described ordinate y
jAnd y
J+1Difference greater than 1, determine the y of original image
jRow and y
jThe position that+1 behavior level direction is taken out line.
In the present embodiment,
If y
J+1-y
j1, the capable and y of yi then
jThe position that+1 behavior level direction is taken out line.If original image is of a size of 10 x 10, k
xAnd k
yValue is 90%, then as calculated, and y
8=8, y
9=10, y
9With y
8Difference be 2, greater than 1, so determine the eighth row of original image and the position that the 9th behavior level direction is taken out line.
S12: original two-value character image is carried out level and vertical two-value character image after taking out line and obtaining dwindling.
In the present embodiment, at first original image is carried out vertical direction and take out line, take out and carry out horizontal direction on the image of line and take out line, the image after obtaining dwindling finishing vertical direction then.
Describedly original image is carried out vertical direction take out line and be meant the two row pixels of taking out line position are merged into a row pixel.As shown in Figure 2, x among Fig. 2
iRow and x
i+ 1 classifies the position that vertical direction is taken out line as, and the pixel value of the pixel after determining to merge comprises following steps:
A. select adjacent on the horizontal direction two pixel A and B;
Whether the pixel value of b. judging described two pixel A and B is identical, if the pixel value of two pixels of A and B is identical, the pixel value of the pixel after then merging is this pixel value, and carry out and finish, otherwise, carry out next step;
Whether the pixel value of c. judging two pixel C that described two pixel horizontal direction both sides are adjacent and D is identical, if the pixel value of two pixels of C and D is identical, the pixel value of the pixel after then merging is the inverse value of this pixel value, carry out and finish, otherwise the pixel value of the pixel after the merging is a preferred value.The inverse value of pixel value 0 is 255 in the binary map, and the inverse value of pixel value 255 is 0.
Repeat above-mentioned steps, carry out the merging that all take out the line position pixel, promptly finish the vertical direction of original image and take out line.
Described preferred value can be system default value, also can user's setting value.When adopting the black matrix wrongly written or mispronounced character, the preferred value of system default is a white; When adopting white gravoply, with black engraved characters, the preferred value of system default is a black.
Take out on the basis of line finishing the original image vertical direction, original image is carried out horizontal direction take out line, the image that obtains is the image after dwindling.Described to original image carry out horizontal direction take out line be meant with take out line position two the row pixels merge into the one-row pixels point.The execution in step of pixel pixel value is the same after determining to merge, and specifically comprises:
A. select two adjacent on vertical direction pixels;
B. judge whether described two pixel pixel values are identical, if pixel value is identical, the pixel value of the pixel after then merging is this pixel value, carry out and finish, otherwise, carry out next step;
Whether the pixel value of c. judging two pixels that described two pixel vertical direction both sides are adjacent is identical, if pixel value is identical, the pixel value of the pixel after then merging is the inverse value of this pixel value, carries out and finishes, otherwise the pixel value of the pixel after the merging is a preferred value.The inverse value of pixel value 0 is 255 in the binary map, and the inverse value of pixel value 255 is 0.
Repeat above-mentioned steps, carry out the merging that all take out the line position pixel, promptly finish the horizontal direction of original image and take out line.
Described preferred value can be system default value, also can user's setting value.When adopting the black matrix wrongly written or mispronounced character, the preferred value of system default is a white; When adopting white gravoply, with black engraved characters, the preferred value of system default is a black.
In the present embodiment, also can at first carry out horizontal direction and take out line, take out and carry out vertical direction on the image of line and take out line, the image after obtaining dwindling finishing horizontal direction then original image.
Embodiment two
Other steps are identical with embodiment one, and be with embodiment one difference: original image is of a size of 20 x 20, k
xAnd k
yValue is 80%, then as calculated, and x
3=3, x
4=5; x
7=8, x
8=10; x
11=13, x
12=15; x
15=18, x
16=20; Therefore the 3rd and 4 row, the 8th and 9 of determining original image are listed as, the 13rd and 14 row and the 18th and 19 are classified the position that vertical direction is taken out line as, in like manner, determine the position that the 3rd and 4 row, the 8th and 9 row, the 13rd and 14 row and the 18th and 19 behavior level directions are taken out line.
Embodiment three
Other steps are identical with embodiment one, and be with embodiment one difference: original image is of a size of 100 x 100, k
xValue be 98% and the ky value be 99%, then as calculated, x
48=48, x
49=50; x
97=98, x
98=100, determine that therefore the 48th and 49 row, the 98th and 99 of original image are classified the position that vertical direction is taken out line as.Y as calculated in like manner
98=98, y
99=100, then determine the position that the 98th and 99 behavior level directions are taken out line.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.
Claims (10)
1, a kind of method that realizes that the two-value character image dwindles may further comprise the steps:
Step 1 is calculated original two-value character image according to coordinate transform and is carried out the position that level and vertical direction are taken out line;
Step 2 is carried out level and vertical two-value character image after taking out line and obtaining dwindling to original two-value character image.
2, a kind of method that realizes that the two-value character image dwindles as claimed in claim 1 is characterized in that, in the step 1, the method for taking out the position of line according to coordinate transform calculating vertical direction specifically may further comprise the steps:
The horizontal ordinate x of the corresponding point of horizontal ordinate i+1 in original image that each horizontal ordinate i is adjacent with its horizontal direction in the image after determining to dwindle
iAnd x
I+1Difference, described i is a positive integer;
If described horizontal ordinate x
iAnd x
I+1Difference greater than 1, determine the x of original image
iRow and x
I+1Classify vertical direction as and take out the position of line.
3, a kind of method that realizes that the two-value character image dwindles as claimed in claim 1 is characterized in that, in the step 1, the method for taking out the position of line according to coordinate transform calculated level direction specifically may further comprise the steps:
The ordinate y of the corresponding point coordinate figure of ordinate j+1 in original image that the perpendicular direction of each ordinate j is adjacent in the image after determining to dwindle
jAnd y
J+1Difference, described j is a positive integer;
If described ordinate y
jAnd y
J+1Difference greater than 1, determine the y of original image
jRow and y
J+1The behavior level direction is taken out the position of line.
4, as claim 2 or 3 described a kind of methods that realize that the two-value character image dwindles, it is characterized in that the method for the coordinate figure of the corresponding pixel points of coordinate figure in original image of each pixel is in the image after determining to dwindle:
According to the coordinate figure that dwindles each pixel in the image of back (i, j) and level and vertical direction dwindle ratio kx, ky, determine its respective coordinates value in original image (x, y), wherein, x=[i/k
x],
5, a kind of method that realizes that the two-value character image dwindles as claimed in claim 4 is characterized in that described level and vertical direction are dwindled ratio k
x, k
ySpan be (75%, 100%).
6, a kind of method that realizes that the two-value character image dwindles as claimed in claim 1 is characterized in that, in the step 2, original image is carried out level specifically may further comprise the steps with vertical method of taking out the image after line obtains dwindling:
At first original image is carried out vertical direction and take out line, take out and carry out horizontal direction on the image of line and take out line, the image after obtaining dwindling finishing vertical direction then.
7, a kind of method that realizes that the two-value character image dwindles as claimed in claim 1 is characterized in that, in the step 2, original image is carried out level specifically may further comprise the steps with vertical method of taking out the image after line obtains dwindling:
At first original image is carried out horizontal direction and take out line, take out and carry out vertical direction on the image of line and take out line, the image after obtaining dwindling finishing horizontal direction then.
8, as claim 6 or 7 described a kind of methods that realize that the two-value character image dwindles, it is characterized in that, original image is carried out vertical direction to be taken out line and is meant the two row pixels of taking out line position are merged into a row pixel that the pixel value of the pixel after wherein determining to merge specifically comprises:
A. select two adjacent on horizontal direction pixels;
Whether the pixel value of b. judging described two pixels is identical, if the pixel value of two pixels is identical, the pixel value of the pixel after then merging is this pixel value, and carry out and finish, otherwise, carry out next step;
Whether the pixel value of c. judging two pixels that described two pixel horizontal direction both sides are adjacent is identical, if two pixel pixel values are identical, the pixel value of the pixel after then merging is the inverse value of this pixel value, carries out and finishes, otherwise the pixel value of the pixel after the merging is a preferred value.
9, a kind of method that realizes that the two-value character image dwindles as claimed in claim 8, it is characterized in that, original image is carried out horizontal direction takes out line and be meant the two row pixels of taking out line position are merged into the one-row pixels point, wherein determine to merge back pixel pixel value and specifically comprise:
A. select two adjacent on vertical direction pixels;
Whether the pixel value of b. judging described two pixels is identical, if the pixel value of two pixels is identical, the pixel value of the pixel after then merging is this pixel value, and carry out and finish, otherwise, carry out next step;
Whether the pixel value of c. judging two pixels that described two pixel vertical direction both sides are adjacent is identical, if the pixel value of two pixels is identical, the pixel value of the pixel after then merging is the inverse value of this pixel value, carries out and finishes, otherwise the pixel value of the pixel after the merging is a preferred value.
10. a kind of method that realizes that the two-value character image dwindles as claimed in claim 9 is characterized in that described preferred value can be system default value, also can be user's setting value, and when adopting the black matrix wrongly written or mispronounced character, the preferred value of system default is a white; When adopting white gravoply, with black engraved characters, the preferred value of system default is a black.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2009100812624A CN101510296B (en) | 2009-03-31 | 2009-03-31 | Method for implementing two-value words image minification |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2009100812624A CN101510296B (en) | 2009-03-31 | 2009-03-31 | Method for implementing two-value words image minification |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101510296A true CN101510296A (en) | 2009-08-19 |
CN101510296B CN101510296B (en) | 2011-03-16 |
Family
ID=41002689
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2009100812624A Expired - Fee Related CN101510296B (en) | 2009-03-31 | 2009-03-31 | Method for implementing two-value words image minification |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101510296B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102081789A (en) * | 2009-12-01 | 2011-06-01 | 富士施乐株式会社 | Image processing apparatus and image processing method |
CN102162796A (en) * | 2010-02-24 | 2011-08-24 | 北京大学 | Method and system for detecting trapping image quality and trapping method effect |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101179671B (en) * | 2006-11-10 | 2010-09-22 | 上海奇码数字信息有限公司 | Image scaling device and image scaling method |
-
2009
- 2009-03-31 CN CN2009100812624A patent/CN101510296B/en not_active Expired - Fee Related
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102081789A (en) * | 2009-12-01 | 2011-06-01 | 富士施乐株式会社 | Image processing apparatus and image processing method |
CN102081789B (en) * | 2009-12-01 | 2014-12-24 | 富士施乐株式会社 | Image processing apparatus and image processing method |
CN102162796A (en) * | 2010-02-24 | 2011-08-24 | 北京大学 | Method and system for detecting trapping image quality and trapping method effect |
CN102162796B (en) * | 2010-02-24 | 2013-03-06 | 北京大学 | Method and system for detecting trapping image quality and trapping method effect |
Also Published As
Publication number | Publication date |
---|---|
CN101510296B (en) | 2011-03-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107704801B (en) | Curve lane line detection method based on segmented straight line and segmented Bezier curve | |
CN103531176B (en) | A kind of font display optimization method and system of Android terminal | |
US9584824B2 (en) | Method for motion vector estimation | |
CN104952077B (en) | A kind of bill images greasy dirt detection method and system | |
WO2018119909A1 (en) | Rgbw pixel rendering device and method | |
CN103402042B (en) | Based on the half tone image generation method of sectional type error diffusion | |
CN101908216B (en) | Method and device for realizing vector fonts | |
CN109919883B (en) | Traffic video data acquisition method based on gray level conversion | |
CN102831604A (en) | Two-dimensional Renyi entropic threshold segmentation method for grayscale images | |
CN102938062A (en) | Document image slant angle estimation method based on content | |
CN102509095A (en) | Number plate image preprocessing method | |
CN104537342A (en) | Quick lane line detection method combined with ridge boundary detection and Hough transformation | |
CN101510296B (en) | Method for implementing two-value words image minification | |
CN102496165A (en) | Method for comprehensively processing video based on motion detection and feature extraction | |
CN110532864B (en) | Soft pen calligraphy copy similarity evaluation method | |
CN110060260A (en) | A kind of image processing method and system | |
CN114897736A (en) | Cloud computing-based hidden image recovery method for big data processing | |
CN115909353A (en) | Image binarization processing method and device | |
CN101794566A (en) | Method and related device for determining font data of character to be displayed in mobile terminal | |
US8355580B2 (en) | Method and system for generating boundary in the process of rasterizing vector graphic as well as method for producing the system | |
CN102542528B (en) | Image conversion processing method and system | |
TW201430813A (en) | Method of dynamic charge sharing for a display device | |
CN103218793A (en) | Adaptive hierarchical linear graphics enhancement method based on field programmable gate array (FPGA) platform | |
CN107563314A (en) | A kind of method for detecting lane lines based on parallel coordinate system | |
CN104091166B (en) | Dynamic threshold method for lane line edge extraction |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20110316 |