JP5679284B2 - Pixel number conversion method, program for executing the same, and pixel number conversion device - Google Patents

Pixel number conversion method, program for executing the same, and pixel number conversion device Download PDF

Info

Publication number
JP5679284B2
JP5679284B2 JP2010240490A JP2010240490A JP5679284B2 JP 5679284 B2 JP5679284 B2 JP 5679284B2 JP 2010240490 A JP2010240490 A JP 2010240490A JP 2010240490 A JP2010240490 A JP 2010240490A JP 5679284 B2 JP5679284 B2 JP 5679284B2
Authority
JP
Japan
Prior art keywords
pixel
conversion
image
scanning direction
line
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.)
Active
Application number
JP2010240490A
Other languages
Japanese (ja)
Other versions
JP2012095079A (en
Inventor
憲 金松
憲 金松
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Engineering Ltd
Original Assignee
NEC Engineering Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by NEC Engineering Ltd filed Critical NEC Engineering Ltd
Priority to JP2010240490A priority Critical patent/JP5679284B2/en
Publication of JP2012095079A publication Critical patent/JP2012095079A/en
Application granted granted Critical
Publication of JP5679284B2 publication Critical patent/JP5679284B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Processing (AREA)
  • Editing Of Facsimile Originals (AREA)

Description

本発明は、ファクシミリ画像や新聞紙面画像等の2値線画画像の画素数を変換して解像度変換や画像の拡大・縮小を行う画素数変換方法等に関する。   The present invention relates to a pixel number conversion method for converting the number of pixels of a binary line drawing image such as a facsimile image or a newspaper page image to perform resolution conversion and image enlargement / reduction.

近年、メディアデバイスの多様化、及びCTPや輪転機等の印刷機材の機能向上に伴い、文章画像や新聞画像等の2値線画画像の解像度の増減、画像の拡大・縮小(画素数変換)のニーズが高まっている。   In recent years, with the diversification of media devices and the improvement of functions of printing equipment such as CTP and rotary press, the resolution of binary line drawing images such as text images and newspaper images has been increased and reduced (number of pixels conversion). Needs are growing.

画素数変換処理の第1の従来技術は、テキスト画像を扱うのに適した変換技術であり、単純間引き処理、論理和法及び最近傍法による画素毎に補間処理を用いて画素数を変換する方法がある。これらの変換処理では、変換倍率が整数倍でない場合、小数点以下の演算結果を切り捨て又は切り上げることによって、変換後の画素値(濃度値)が整数化される(例えば、非特許文献1を参照)。   The first prior art of pixel number conversion processing is a conversion technology suitable for handling text images, and the number of pixels is converted using interpolation processing for each pixel by simple thinning processing, logical sum method, and nearest neighbor method. There is a way. In these conversion processes, when the conversion magnification is not an integer multiple, the converted pixel value (density value) is converted into an integer by rounding down or rounding up the calculation result after the decimal point (see, for example, Non-Patent Document 1). .

また、第2の従来技術は、二値擬似濃淡画像を扱うのに適した変換技術であり、9分割法、投影法、距離反比例法等の補間処理を用いて画素数を変換する方法がある(例えば、非特許文献1を参照)。   The second prior art is a conversion technique suitable for handling a binary pseudo gray image, and there is a method for converting the number of pixels using an interpolation process such as a nine-division method, a projection method, or an inverse distance method. (For example, refer nonpatent literature 1).

さらに、第3の従来技術として、特許文献1には、変換倍率に基づいて、補間ビット(変換時に補間するビット)、間引きビット(変換時に減少させるビット)を求めて補間ラインイメージテーブルを作成し、これを用いて原画像(入力した2値画像)から変換画像(出力する画像)への変換処理を行った後、変換画像内の縦線及び横線の線幅を細め線幅又は太め線幅の何れかに統一して線幅を補正する画素数変換方法が記載されている。以下、この方法について、解像度を上げる場合を例にとりながら簡単に説明する。   Furthermore, as a third prior art, in Patent Document 1, an interpolation line image table is created by obtaining interpolation bits (bits to be interpolated at the time of conversion) and thinning bits (bits to be reduced at the time of conversion) based on the conversion magnification. Using this, after performing the conversion process from the original image (input binary image) to the converted image (output image), the line widths of the vertical and horizontal lines in the converted image are narrowed or thickened. A pixel number conversion method for correcting the line width in a unified manner is described. Hereinafter, this method will be briefly described with an example of increasing the resolution.

先ず、図25に示すように、主走査方向の画像の最左端を0ビット目と置いた上で、画像の変換倍率に基づき、解像度変換前の画素111のビット位置112に対応する解像度変換後の画素113のビット位置114を求める。そして、解像度変換に際して補間を要するビット(補間ビット)115を求め、求めた補間ビット115と、補間が不要なビット116とを、予め準備したラインイメージバッファ(解像度変換後の主走査方向の画素数と同一ビットのバッファ)117に設定する。   First, as shown in FIG. 25, the leftmost end of the image in the main scanning direction is set as the 0th bit, and after resolution conversion corresponding to the bit position 112 of the pixel 111 before resolution conversion based on the conversion magnification of the image. The bit position 114 of the pixel 113 is obtained. Then, a bit (interpolation bit) 115 that requires interpolation for resolution conversion is obtained, and the obtained interpolation bit 115 and a bit 116 that does not require interpolation are prepared in advance as a line image buffer (number of pixels in the main scanning direction after resolution conversion). And the same bit buffer) 117.

次いで、補間ビット115の画素値を左隣に位置する画素の画素値に設定し(例えば、補間ビット115の左隣の画素の画素値が1(黒画素)であれば、補間ビット115の画素値を1に設定する)、画素の補間を行う。上記の処理を1ラインずつ順番に行って原画像の全体を変換画像に置き換え、解像度を上げる。   Next, the pixel value of the interpolation bit 115 is set to the pixel value of the pixel located on the left side (for example, if the pixel value of the pixel on the left side of the interpolation bit 115 is 1 (black pixel), the pixel of the interpolation bit 115 Set the value to 1) and perform pixel interpolation. The above processing is sequentially performed line by line to replace the entire original image with a converted image, thereby increasing the resolution.

その後、黒線の主走査方向の線幅(縦線の太さに相当)に関し、画像の変換倍率に基づいて細め線幅の大きさ及び太め線幅の大きさを求め、主走査方向における線幅補正テーブルを作成する。   Thereafter, regarding the line width of the black line in the main scanning direction (corresponding to the thickness of the vertical line), the thin line width and the thick line width are obtained based on the conversion magnification of the image, and the line in the main scanning direction is obtained. Create a width correction table.

この線幅補正テーブルの作成は、補正前の画像の主走査方向の線幅をx(xは整数)、変換倍率をkとすると、x×kの演算結果の小数点以下を切り捨てたものを細め線幅の大きさm0とし、x×kの演算結果の小数点以下を切り上げたものを太め線幅の大きさm1とするようにして行う。このため、例えば、454dpiから602dpiへの高解像度化(変換倍率k=1.32倍)の場合であれば、補正前の画像の線幅が「2」のときに、細め線幅m0=2となり、太め線幅m1=3となる。これを、補正前の画像の線幅x=1からx=n(nは、変換前の画像中に存在する主走査方向の線幅の最大画素数)までの全てについて順に求める。   The creation of this line width correction table is made by narrowing down the result of the calculation of x × k rounded down, assuming that the line width in the main scanning direction of the image before correction is x (x is an integer) and the conversion magnification is k. The line width is set to m0, and the result obtained by rounding up the decimal point of the x × k calculation result is set to a thick line width of m1. Therefore, for example, in the case of increasing the resolution from 454 dpi to 602 dpi (conversion magnification k = 1.32 times), when the line width of the image before correction is “2”, the thin line width m0 = 2 Thus, the thick line width m1 = 3. This is obtained sequentially for all the line widths x = 1 to x = n (n is the maximum number of pixels of the line width in the main scanning direction existing in the image before conversion) before correction.

また、主走査方向における線幅補正テーブルの作成が完了すると、黒線の副走査方向の線幅(横線の太さに相当)に関しても同様の処理を実行し、補正前の画像の副走査方向の線幅y(yは整数)に対する細め線幅の大きさp0と太め線幅の大きさp1とを求めて副走査方向における線幅補正テーブルを作成する。   When the creation of the line width correction table in the main scanning direction is completed, the same processing is performed for the line width of the black line in the sub scanning direction (corresponding to the thickness of the horizontal line), and the sub scanning direction of the image before correction is performed. A thin line width size p0 and a thick line width size p1 with respect to the line width y (y is an integer) are obtained to create a line width correction table in the sub-scanning direction.

そして、ラインイメージバッファ117を用いて解像度変換を行った後の画像を対象とし、上記の線幅補正テーブルを用いて線幅補正処理を行う。この際、細め線幅への補正が指定されていれば、解像度変換後の画像の線幅x、yをm0、p0に変換し、逆に、太め線幅への補正が指定されていれば、線幅x、yをm1、p1に変換する。これにより、縦線及び横線の太さを均一化し、線幅のばらつきや輪郭の崩れを解消する。   Then, the image after resolution conversion using the line image buffer 117 is targeted, and the line width correction processing is performed using the above-described line width correction table. At this time, if the correction to the thin line width is specified, the line widths x and y of the image after the resolution conversion are converted to m0 and p0, and conversely, if the correction to the thick line width is specified. The line widths x and y are converted into m1 and p1. Thereby, the thickness of the vertical line and the horizontal line is made uniform, and the variation in the line width and the collapse of the outline are eliminated.

特開2007−265055号公報JP 2007-265055 A

正嶋 博、他4名、「二値画像の各種拡大/縮小方式の性能評価及び処理速度改良方式」、情報処理学会論文誌 Sep.1985 Vol.26 No.5Hiroshi Masashima and 4 others, "Performance evaluation and processing speed improvement methods for various enlargement / reduction methods of binary images", IPSJ Transactions Sep.1985 Vol.26 No.5

第1の従来技術として挙げた論理和法や最近傍法では、線画の平滑な輪郭を保つことができるとともに、原画像の濃度と画素数変換後の画像の濃度との差分を少なく抑え、原画像の濃度に近い濃度の変換画像を得ることができる。   The logical sum method and nearest neighbor method mentioned as the first conventional technique can maintain a smooth outline of a line drawing, suppress the difference between the density of the original image and the density of the image after pixel number conversion, and reduce the original image. A converted image having a density close to that of the image can be obtained.

しかし、この方法では、図26(a)に示すように、原画像上で異なる場所に位置する2本の横線91、92(又は93、94)に着目した場合、これらは、原画像上では同じ線幅(太さ)であるにも拘わらず、図26(b)に示すように、変換画像では、異なる線幅(太さ)になって出力されることがある(横線91’が横線92’よりも細くなったり、横線93’が横線94’よりも太くなって出力される)。これは、横線91、92を構成する画素、又はその隣の画素の処理時に、周辺の画素の値の影響を受けることに起因するものであり、画素の位置が異なれば周りから受ける影響も異なり、結果的に、場所によって値が反転したり、しなかったりと区々になるためである。   However, in this method, as shown in FIG. 26 (a), when attention is paid to two horizontal lines 91 and 92 (or 93 and 94) located at different locations on the original image, these are indicated on the original image. In spite of the same line width (thickness), as shown in FIG. 26B, the converted image may be output with different line width (thickness) (the horizontal line 91 ′ is a horizontal line). The horizontal line 93 'is thinner than the horizontal line 94', and the horizontal line 93 'is thicker than the horizontal line 94'. This is because the pixels constituting the horizontal lines 91 and 92 or the adjacent pixels are affected by the value of the surrounding pixels. If the pixel positions are different, the influence from the surroundings is different. As a result, the value may or may not be reversed depending on the location.

また、第2の従来技術として挙げた9分割法、投影法、距離反比例法等では、第1の従来技術よりも原画像の濃度と画素数変換後の画像の濃度との差分を少なく抑えることが可能になるが、その反面、線画の輪郭部分にノイズ(意図せず画素値が反転する画素)が生じるという問題がある。これも第1の従来技術の場合と同様、周辺の画素の値の影響を受けることに起因するものであるが、第2の従来技術の場合、第1の従来技術に比べて周辺の画素値の影響を強く受けるため、同じ線の中で値が反転する部分と反転しない部分とが現れるようになり、線画の輪郭に凹凸が発生するようになる。その結果、輪郭の特性(平滑化)が破壊されて文字の形の崩れ等が生じ、画質の劣化を招く虞がある。   Further, in the 9-division method, the projection method, the inverse distance method, and the like cited as the second conventional technique, the difference between the density of the original image and the density of the image after the pixel number conversion is suppressed to be smaller than that of the first conventional technique. However, on the other hand, there is a problem that noise (a pixel whose pixel value is unintentionally inverted) occurs in the outline portion of the line drawing. This is also caused by the influence of the peripheral pixel values as in the case of the first prior art, but in the case of the second prior art, the peripheral pixel values are compared with those of the first prior art. In the same line, a portion where the value is inverted and a portion where the value is not inverted appear in the same line, and the contour of the line drawing appears uneven. As a result, the contour characteristics (smoothing) are destroyed, and the shape of the characters is lost, which may lead to degradation of image quality.

その一方で、第3の従来技術として挙げた特許文献1に記載の画素数変換方法では、解像度変換を行った後に線幅を統一化するため、第1の従来技術で生じる線幅のばらつき問題や、第2の従来技術で生じる輪郭部分のノイズ問題を解消することができる。   On the other hand, in the pixel number conversion method described in Patent Document 1 cited as the third conventional technique, the line width is unified after the resolution conversion, so the line width variation problem that occurs in the first conventional technique. In addition, it is possible to eliminate the noise problem of the contour portion that occurs in the second prior art.

しかし、この方法では、線画の字形に基づく横線と縦線の相関関係を考慮せず、主走査方向と副走査方向との処理を完全に独立させているため、図27に示すように、縦線の端部が横線に接する部分、又は、横線の端部が縦線に接する部分に凹凸が発生し、完全には文字の形の崩れを解消できないという問題がある。また、この方法では、線幅を細くした細め線幅か、線幅を太くした太め線幅の何れかに統一して出力するため、原画像の濃度と画素数変換後の画像の濃度との差分が大きくなり易いという問題もある。   However, in this method, since the correlation between the main scanning direction and the sub-scanning direction is completely independent without considering the correlation between the horizontal line and the vertical line based on the shape of the line drawing, as shown in FIG. There is a problem that irregularities occur in the portion where the end of the line is in contact with the horizontal line, or the portion where the end of the horizontal line is in contact with the vertical line, so that the collapse of the shape of the character cannot be completely eliminated. Also, in this method, since the output is unified to either a narrow line width with a thin line width or a thick line width with a thick line width, the density of the original image and the density of the image after conversion of the number of pixels are set. There is also a problem that the difference tends to increase.

そこで、本発明は、上記従来の技術における問題点に鑑みてなされたものであって、画素数変換に起因する文字の形の乱れを抑制し、高画質な変換画像を得ることが可能な画素数変換方法等を提供することを目的とする。   Accordingly, the present invention has been made in view of the above-described problems in the prior art, and is capable of suppressing the disorder of the shape of the character due to the pixel number conversion and obtaining a high-quality converted image. An object is to provide a number conversion method and the like.

上記目的を達成するため、本発明は、2値原画像の画素数を変換して2値変換画像を生成する画素数変換方法であって、変換倍率に基づいて、前記2値原画像の線画像の線幅に対応する前記2値変換画像上での変換線幅を指定する線幅変換テーブルを作成する第1のステップと、前記2値原画像を対象とし、主走査方向又は副走査方向の一方に延在する線画像の先端画素の座標を検出するとともに、該線画像の長さを検出する第2のステップと、前記検出した座標に対応する変換画像上での変換座標を算出するとともに、前記線幅変換テーブルを用いて前記検出した線画像の長さに対応する変換線幅を取得する第3のステップと、前記算出した座標を始点とし、主走査方向又は副走査方向の一方に延び、前記取得した変換線幅の長さを有する線画像を変換画像上に作成する第4のステップと、該第4のステップで作成した変換画像を主走査方向又は副走査方向の他方にスキャンし、該主走査方向又は副走査方向の他方に延びるとともに、黒画素及び白画素が混在する線画像を検出する第5のステップと、該第5のステップで検出した黒画素及び白画素が混在する線画像を対象とし、黒画素の数と白画素の数とを対比し、少ない側に属する画素の値を多い側の値に変換する第6のステップとを備え、前記第5のステップは、前記スキャンした注目画素及び該注目画素に隣接する周辺画素によって形成される画素パターンと、前記注目画素が前記黒画素及び白画素が混在する線画像の開始点であることを示す所定の端部パターン、及び/又は該線画像の開始点以外の部分であることを示す所定の連続部パターンとを比較し、前記画素パターンと前記端部パターン又は前記連続部パターンとが合致するか否かに応じて前記黒画素及び白画素が混在する線画像を検出することを特徴とする。 In order to achieve the above object , the present invention provides a pixel number conversion method for generating a binary converted image by converting the number of pixels of a binary original image, wherein the line of the binary original image is based on a conversion magnification. A first step of creating a line width conversion table for designating a conversion line width on the binary conversion image corresponding to the line width of the image; and a main scanning direction or a sub scanning direction for the binary original image And detecting the coordinates of the leading pixel of the line image extending to one side of the line image, calculating the conversion coordinates on the conversion image corresponding to the detected coordinates, and the second step of detecting the length of the line image And a third step of acquiring a conversion line width corresponding to the length of the detected line image using the line width conversion table, and using the calculated coordinates as a starting point and either the main scanning direction or the sub-scanning direction. And having the length of the acquired conversion line width A fourth step of creating an image on the converted image, and the converted image created in the fourth step is scanned in the other of the main scanning direction or the sub-scanning direction, and extends in the other of the main scanning direction or the sub-scanning direction. And a fifth step of detecting a line image in which black pixels and white pixels are mixed, and a line image in which black pixels and white pixels detected in the fifth step are mixed, and the number of black pixels and white pixels And a sixth step of converting the value of the pixel belonging to the smaller side to the value of the larger side, and the fifth step includes the scanned pixel of interest and a peripheral adjacent to the pixel of interest A pixel pattern formed by pixels, a predetermined end pattern indicating that the target pixel is a starting point of a line image in which the black pixels and white pixels are mixed, and / or a portion other than the starting point of the line image Indicates that Comparing the predetermined continuous portion pattern, that you detect a line image in which the black pixels and white pixels are mixed depending on whether said pixel pattern and said end pattern or the continuous part pattern matches Features.

そして、本発明によれば、線画像の先端画素の変換画像上での座標を算出するとともに、線幅変換テーブルを用いて変換線幅を取得し、その後、取得した変換線幅と、先端画素の変換画像上での座標とを用いて線単位で変換処理を行うため、画像上のどの位置であろうとも、原画像上の線幅に対応する変換線幅を一意に定めることができる。このため、変換によって線幅にばらつきが生じるのを回避することができ、文字の形状を維持しながら変換処理を行うことが可能になる。   And according to this invention, while calculating the coordinate on the conversion image of the front end pixel of a line image, a conversion line width is acquired using a line width conversion table, Then, the acquired conversion line width and front end pixel are acquired. Therefore, the conversion line width corresponding to the line width on the original image can be uniquely determined at any position on the image. For this reason, it is possible to avoid variations in line width due to conversion, and it is possible to perform conversion processing while maintaining the character shape.

これに加え、主走査方向又は副走査方向の一方の変換処理を行った後に、主走査方向又は副走査方向の他方を対象として、黒画素及び白画素が混在する線画像を検出し、少ない側に属する画素の値を多い側の値に変換するため、主走査方向又は副走査方向の一方の変換処理によって生じる、主走査方向又は副走査方向の他方側の凹凸を解消することができ、輪郭の乱れを補正することが可能になる。   In addition, after performing one conversion process in the main scanning direction or the sub-scanning direction, a line image in which black pixels and white pixels are mixed is detected for the other in the main scanning direction or the sub-scanning direction. In order to convert the value of the pixel belonging to 1 to the value on the larger side, the unevenness on the other side in the main scanning direction or the sub-scanning direction caused by one conversion process in the main scanning direction or the sub-scanning direction can be eliminated. It becomes possible to correct the disturbance.

上記画素数変換方法において、前記第6のステップで作成した変換画像を対象とし、主走査方向又は副走査方向の他方に延在する第2の線画像の先端画素の座標を検出するとともに、該第2の線画像の長さを検出する第7のステップと、前記検出した第2の線画像の先端画素の座標に対応する変換画像上での変換座標を算出するとともに、前記線幅変換テーブルを用いて前記検出した第2の線画像の長さに対応する変換線幅を取得する第8のステップと、該第8のステップで算出した座標を始点とし、主走査方向又は副走査方向の他方に延び、該第8のステップで取得した変換線幅の長さを有する線画像を変換画像上に作成する第9のステップと、該第9のステップで作成した変換画像を主走査方向又は副走査方向の一方にスキャンし、該主走査方向又は副走査方向の一方に延びるとともに、黒画素及び白画素が混在する線画像を検出する第10のステップと、該第10のステップで検出した黒画素及び白画素が混在する線画像を対象とし、黒画素の数と白画素の数とを対比し、少ない側に属する画素の値を多い側の値に変換する第11のステップとを備え、前記第10のステップは、前記スキャンした注目画素及び該注目画素に隣接する周辺画素によって形成される画素パターンと、所定の端部パターン及び/又は連続部パターンとを比較し、前記画素パターンと前記端部パターン又は前記連続部パターンとが合致するか否かに応じて前記黒画素及び白画素が混在する線画像を検出することができる。 In the pixel number conversion method, for the converted image created in the sixth step, the coordinates of the tip pixel of the second line image extending in the other of the main scanning direction or the sub-scanning direction are detected, A seventh step of detecting the length of the second line image; calculating a conversion coordinate on the conversion image corresponding to the coordinate of the tip pixel of the detected second line image; and the line width conversion table. And an eighth step of acquiring a conversion line width corresponding to the detected length of the second line image, and the coordinates calculated in the eighth step as a starting point, in the main scanning direction or the sub-scanning direction A ninth step of creating on the converted image a line image having the length of the converted line width acquired in the eighth step and the converted image generated in the ninth step in the main scanning direction or Scan in one direction in the sub-scanning direction A tenth step of detecting a line image in which black pixels and white pixels are mixed while extending in one of the scanning direction and the sub-scanning direction, and a line image in which black pixels and white pixels detected in the tenth step are mixed And an eleventh step of comparing the number of black pixels with the number of white pixels and converting the value of pixels belonging to the smaller side to the value of the larger side , the tenth step being the scanned A pixel pattern formed by a pixel of interest and peripheral pixels adjacent to the pixel of interest is compared with a predetermined end pattern and / or continuous pattern, and the pixel pattern and the end pattern or continuous pattern are line image in which the black pixels and white pixels are mixed depending on whether matching can you to detect.

上記構成によれば、縦線と横線の相関を確保しつつ、線幅のばらつきを補正することができる。これにより、縦線と横線の交差部に生じる凹凸問題を解消し、画素数変換に起因する字形の乱れを抑制することが可能になる。   According to the above configuration, it is possible to correct the variation in line width while ensuring the correlation between the vertical line and the horizontal line. Thereby, it is possible to eliminate the unevenness problem that occurs at the intersection of the vertical line and the horizontal line, and to suppress the distortion of the character shape due to the conversion of the number of pixels.

さらに、本発明は、2値原画像の画素数を変換して2値変換画像を生成する画素数変換方法コンピュータ装置に実行させるためのプログラムであって、上記何れかに記載の画素数変換方法をコンピュータ装置に実行させることを特徴とする。 Furthermore, the present invention is 2 NeHara a order of the program to execute the pixel number conversion method for generating a conversion to binary converted image the number of pixels of the image to the computer system, the number of pixels described above either A conversion method is executed by a computer device .

さらに、本発明は、2値原画像の画素数を変換して2値変換画像を生成する画素数変換装置であって、変換倍率に基づいて、前記2値原画像の線画像の線幅に対応する前記2値変換画像上での変換線幅を指定する線幅変換テーブルを作成する線幅変換テーブル作成部と、前記線幅変換テーブルを用いて前記2値原画像中に存在する線画像の線幅を変更し、前記2値変換画像を生成する変換処理部と、該変換処理部によって生成した画像に字形補正処理を施す字形補正部とを備え、前記変換処理部は、前記2値原画像を対象とし、主走査方向又は副走査方向の一方に延在する線画像の先端画素の座標を検出するとともに、該線画像の長さを検出する検出部と、該検出部によって検出した座標に対応する変換画像上での変換座標を算出する変換先端座標算出部と、前記線幅変換テーブルを用いて前記検出部によって検出した線画像の長さに対応する変換線幅を取得する線幅取得部と、前記先端座標算出部によって算出した座標を始点とし、主走査方向又は副走査方向の一方に延び、前記線幅取得部によって取得した変換線幅の長さを有する線画像を変換画像上に作成する線単位変換部とを備え、前記字形補正部は、前記変換処理部で作成した変換画像を主走査方向又は副走査方向の他方にスキャンし、該主走査方向又は副走査方向の他方に延びるとともに、黒画素及び白画素が混在する線画像を検出する凹凸線画検出部と、該凹凸線画検出部で検出した線画像を対象とし、黒画素の数と白画素の数とを対比し、少ない側に属する画素の値を多い側の値に変換する補正部とを備え、前記凹凸線画検出部は、前記スキャンした注目画素及び該注目画素に隣接する周辺画素によって形成される画素パターンと、前記注目画素が前記黒画素及び白画素が混在する線画像の開始点であることを示す所定の端部パターン、及び/又は該線画像の開始点以外の部分であることを示す所定の連続部パターンとを比較し、前記画素パターンと前記端部パターン又は前記連続部パターンとが合致するか否かに応じて前記黒画素及び白画素が混在する線画像を検出することを特徴とする。 Furthermore, the present invention is a pixel number conversion device that generates a binary converted image by converting the number of pixels of a binary original image, and based on the conversion magnification, the line width of the line image of the binary original image is set. A line width conversion table creating unit for creating a line width conversion table for designating a conversion line width on the corresponding binary converted image, and a line image existing in the binary original image using the line width conversion table A conversion processing unit that changes the line width of the image and generates the binary conversion image; and a character shape correction unit that performs a character shape correction process on the image generated by the conversion processing unit, the conversion processing unit including the binary Detecting the coordinates of the leading pixel of the line image extending in one of the main scanning direction or the sub-scanning direction for the original image, and detecting the length of the line image, and detecting by the detecting unit Conversion destination to calculate the conversion coordinates on the conversion image corresponding to the coordinates A coordinate calculation unit, a line width acquisition unit that acquires a conversion line width corresponding to the length of the line image detected by the detection unit using the line width conversion table, and the coordinates calculated by the tip coordinate calculation unit And a line unit conversion unit that extends in one of the main scanning direction or the sub-scanning direction and that creates a line image having a length of the conversion line width acquired by the line width acquisition unit on the converted image, the character shape correction The line scans the converted image created by the conversion processing unit in the other of the main scanning direction or the sub-scanning direction, extends to the other of the main scanning direction or the sub-scanning direction, and is a line image in which black pixels and white pixels are mixed. For the line image detected by the concavo-convex line image detection unit and the line image detected by the concavo-convex line image detection unit, the number of black pixels and the number of white pixels are compared, and the value of the pixel belonging to the smaller side is set to the value of the larger side. and a correcting unit for converting the concave The line drawing detection unit indicates a pixel pattern formed by the scanned pixel of interest and peripheral pixels adjacent to the pixel of interest, and the pixel of interest is a starting point of a line image in which the black pixels and white pixels are mixed. A predetermined end pattern and / or a predetermined continuous pattern indicating a part other than the start point of the line image are compared, and the pixel pattern matches the end pattern or the continuous pattern. the black pixels and white pixels, characterized that you detect line images mixed depending on whether.

以上のように、本発明によれば、画素数変換に起因する文字の形の乱れを抑制し、高画質な変換画像を得ることが可能になる。   As described above, according to the present invention, it is possible to suppress the disorder of the character shape caused by the pixel number conversion and obtain a high-quality converted image.

本発明にかかる画素数変換装置の一実施の形態を示すブロック図である。1 is a block diagram showing an embodiment of a pixel number conversion apparatus according to the present invention. (a)は、原画像の主走査及び副走査方向の画素数を示し、(b)は、変換画像の主走査及び副走査方向の画素数を示す図である。(A) shows the number of pixels in the main scanning and sub-scanning directions of the original image, and (b) shows the number of pixels in the main scanning and sub-scanning directions of the converted image. 主走査方向の線幅変換テーブルを示す図である。It is a figure which shows the line | wire width conversion table of the main scanning direction. 主走査方向の画素数変換処理を示す図である。It is a figure which shows the pixel number conversion process of the main scanning direction. 副走査方向の画素数変換処理を示す図である。It is a figure which shows the pixel number conversion process of a subscanning direction. 副走査方向の字形補正時の凹凸縦線の上端部を検出するための照合パターンを示す図である。It is a figure which shows the collation pattern for detecting the upper end part of the uneven | corrugated vertical line at the time of the character correction of a subscanning direction. 副走査方向の字形補正時の凹凸縦線の上端部以外の部分を検出するための照合パターンを示す図である。It is a figure which shows the collation pattern for detecting parts other than the upper end part of the uneven | corrugated vertical line at the time of the character correction of a subscanning direction. 副走査方向の字形補正処理を示す図である。It is a figure which shows the character shape correction | amendment process of a subscanning direction. 主走査方向の字形補正時の凹凸横線を検出するための照合パターンを示す図である。It is a figure which shows the collation pattern for detecting the uneven | corrugated horizontal line at the time of character shape correction | amendment of the main scanning direction. 主走査方向の字形補正処理を示す図である。It is a figure which shows the shape correction process of the main scanning direction. 図1の画素数変換装置の全体動作を示すメインフローチャートである。3 is a main flowchart showing an overall operation of the pixel number conversion apparatus of FIG. 1. 主走査方向の画素数変換処理を示すサブフローチャートである。It is a sub-flowchart which shows the pixel number conversion process of the main scanning direction. 副走査方向の字形補正処理を示す図である。It is a figure which shows the character shape correction | amendment process of a subscanning direction. 副走査方向の字形補正処理を示すサブフローチャートである。It is a sub flowchart which shows the character shape correction | amendment process of a subscanning direction. 副走査方向の字形補正処理を説明するための図である。It is a figure for demonstrating the character shape correction process of a subscanning direction. 図14のステップS23の照合処理を説明するための図である。It is a figure for demonstrating the collation process of step S23 of FIG. 図14のステップS28、S30の照合処理を説明するための図である。It is a figure for demonstrating the collation process of step S28, S30 of FIG. 図14のステップS32の照合処理を説明するための図である。It is a figure for demonstrating the collation process of step S32 of FIG. 副走査方向の字形補正処理を説明するための図である。It is a figure for demonstrating the character shape correction process of a subscanning direction. 副走査方向の字形補正処理を説明するための図である。It is a figure for demonstrating the character shape correction process of a subscanning direction. 副走査方向の画素数変換処理を示すサブフローチャートである。It is a sub flowchart which shows the pixel number conversion process of a subscanning direction. 主走査方向の字形補正処理を示すサブフローチャートである。It is a sub-flowchart which shows the shape correction process of the main scanning direction. 図1の画素数変換装置によって処理した画像の一例を示す図である。It is a figure which shows an example of the image processed by the pixel number converter of FIG. 線幅のばらつきを解消した状態の一例を示す図である。It is a figure which shows an example of the state which eliminated the dispersion | variation in line | wire width. 従来の画素数変換方法の一例を示す図である。It is a figure which shows an example of the conventional pixel number conversion method. 原画像上で同一の太さを有する2本の線が、変換画像上で異なる太さになって出力される状態の一例を示す図である。It is a figure which shows an example of the state from which two lines which have the same thickness on an original image become different thickness on a conversion image, and are output. 縦線と横線の交差部に生じる凹凸の一例を示す図である。It is a figure which shows an example of the unevenness | corrugation which arises in the intersection of a vertical line and a horizontal line.

次に、発明を実施するための形態について、図面を参照しながら詳細に説明する。以下においては、文字色を黒とし、背景色を白としたテキスト画像を例にとって説明する。   Next, modes for carrying out the invention will be described in detail with reference to the drawings. In the following description, a text image in which the character color is black and the background color is white will be described as an example.

図1は、本発明にかかる画素数変換装置(以下、「変換装置」という)の一実施の形態を示すブロック図であり、この変換装置1は、大別して、メモリ2と、線幅変換テーブルを作成する線幅変換テーブル作成部3と、入力した2値画像(原画像)に対して画素数変換処理を施す画素数変換処理部4と、画素数変換された変換画像に対して字形補正処理を施す字形補正処理部5とから構成される。   FIG. 1 is a block diagram showing an embodiment of a pixel number conversion apparatus (hereinafter referred to as “conversion apparatus”) according to the present invention. This conversion apparatus 1 is roughly divided into a memory 2 and a line width conversion table. A line width conversion table creation unit 3 for creating a pixel number, a pixel number conversion processing unit 4 for performing a pixel number conversion process on the input binary image (original image), and a character shape correction for the converted image after the pixel number conversion It is comprised from the character shape correction | amendment process part 5 which performs a process.

尚、上記各種の処理部3〜5は、必ずしもハードウェアによって構成する必要はなく、その一部又は全部をソフトウェア(プログラム)によって構成してもよい。   The various processing units 3 to 5 are not necessarily configured by hardware, and a part or all of the processing units 3 to 5 may be configured by software (program).

メモリ2は、変換装置1で処理すべき画像データを記憶したり、上記の処理部3〜5で処理された処理値や画像データを記憶するための記憶媒体である。メモリ2には、変換装置1で処理すべき画像データとして、各画素のデータ値が2値階調値(例えば、黒画素の場合に階調値=1、白画素の場合に階調値=0)で表された2値画像データが入力される。   The memory 2 is a storage medium for storing image data to be processed by the conversion apparatus 1 and storing processing values and image data processed by the processing units 3 to 5. In the memory 2, as image data to be processed by the conversion apparatus 1, the data value of each pixel is a binary gradation value (for example, gradation value = 1 for a black pixel, gradation value = for a white pixel = Binary image data represented by 0) is input.

線幅変換テーブル作成部3は、指定された変換解像度又は画像の拡大・縮小度に対応する変換倍率を求める変換倍率算出部3aと、変換倍率算出部3aで求めた変換倍率を用い、線幅変換テーブル3cを作成するテーブル作成部3bとを備える。   The line width conversion table creation unit 3 uses the conversion magnification calculation unit 3a for obtaining the conversion magnification corresponding to the designated conversion resolution or the enlargement / reduction degree of the image, and the conversion magnification obtained by the conversion magnification calculation unit 3a, And a table creation unit 3b for creating the conversion table 3c.

変換倍率算出部3aは、入力される2値画像(原画像)の主走査方向及び副走査方向の画素数と、出力する2値画像(画素数変換後の画像)の主走査方向及び副走査方向の画素数とに基づき、主走査方向及び副走査方向の各々の変換倍率を求める。   The conversion magnification calculation unit 3a includes the number of pixels in the main scanning direction and the sub-scanning direction of the input binary image (original image), and the main scanning direction and the sub-scanning of the output binary image (image after pixel number conversion). Based on the number of pixels in the direction, the respective conversion magnifications in the main scanning direction and the sub-scanning direction are obtained.

主走査方向の変換倍率rxは、図2に示すように、原画像30の主走査方向の画素数をL、画素数変換後の画像31の主走査方向の画素数をL’とした場合、下記の式1により求められ、また、副走査方向の変換倍率ryは、原画像30の副走査方向の画素数をH、画素数変換後の画像31の副走査方向の画素数をH’とした場合、下記の式2により求められる。   The conversion magnification rx in the main scanning direction is, as shown in FIG. 2, when the number of pixels in the main scanning direction of the original image 30 is L and the number of pixels in the main scanning direction of the image 31 after the pixel number conversion is L ′. The conversion magnification ry in the sub-scanning direction is obtained by the following formula 1, and the number of pixels in the sub-scanning direction of the original image 30 is H, and the number of pixels in the sub-scanning direction of the image 31 after the pixel number conversion is H ′. In this case, it is obtained by the following formula 2.

Figure 0005679284
Figure 0005679284

Figure 0005679284
Figure 0005679284

テーブル作成部3bは、変換倍率算出部3aによって求めた変換倍率rx、ryを用い、主走査方向及び副走査方向の各々について線幅変換テーブル3cを作成する。ここでは、先ず、主走査方向の線幅変換テーブル3cの作成方法について説明する。   The table creation unit 3b creates a line width conversion table 3c for each of the main scanning direction and the sub-scanning direction using the conversion magnifications rx and ry obtained by the conversion magnification calculation unit 3a. Here, a method of creating the line width conversion table 3c in the main scanning direction will be described first.

原画像の黒線の主走査方向の線幅をwxとすると、これを主走査方向の変換倍率rxに従って変換した場合の純変換線幅Wxは、下記の式3によって求められ、図3に示す通りになる。尚、図3は、600dpiの原画像を909dpiの画像に高解像度化(変換倍率rx=1.515)する場合を示したものである。   Assuming that the line width in the main scanning direction of the black line of the original image is wx, the pure conversion line width Wx when this is converted according to the conversion magnification rx in the main scanning direction is obtained by the following equation 3 and shown in FIG. It becomes street. FIG. 3 shows a case where the original resolution of 600 dpi is increased to a resolution of 909 dpi (conversion magnification rx = 1.515).

Figure 0005679284
Figure 0005679284

但し、純変換線幅Wxは、小数を含む数値となるため、以下の3つにモード分けしながら、正規化(整数化)する。   However, since the pure conversion line width Wx is a numerical value including a decimal, normalization (integerization) is performed while dividing the mode into the following three modes.

「モード1:太め処理」
このモードは、純変換線幅Wxの小数点以下を一律に切り上げて整数化し、それを太め線幅Whxとするものである。図3に示すように、太め線幅Whxは、例えば、原画像の主走査方向の黒線の線幅wx=1の場合、値が2となり、純変換線幅Wx(=1.51)よりも大きな値となる。このため、モード1で線幅変換すると、画像全体に占める黒画素の割合を増やすことになり、モード1で線幅変換した画像は、原画像よりも濃度の高い画像となる。
"Mode 1: thick processing"
In this mode, the fractional part of the pure conversion line width Wx is uniformly rounded up to an integer, which is set to a thick line width Whx. As shown in FIG. 3, the thick line width Whx is, for example, 2 when the black line width wx = 1 in the main scanning direction of the original image, and from the pure conversion line width Wx (= 1.51). Is also a large value. For this reason, when the line width conversion is performed in mode 1, the ratio of black pixels in the entire image is increased, and the image subjected to the line width conversion in mode 1 is an image having a higher density than the original image.

「モード2:細め処理」
このモードは、純変換線幅Wxの小数点以下を一律に切り捨てて整数化し、それを細め線幅Wtxとするものである。この細め線幅Wtxは、同じく線幅wx=1の場合に着目すると、値が1となり、純変換線幅Wx(=1.51)よりも小さな値となる。このため、モード2で線幅変換すると、画像全体に占める黒画素の割合を減らすことになり、モード2で線幅変換した画像は、原画像よりも濃度の低い画像となる。
"Mode 2: Thinning process"
In this mode, the fractional part of the pure conversion line width Wx is uniformly rounded down to an integer, which is used as a narrow line width Wtx. If the line width wx = 1 is also focused on, the thin line width Wtx is 1 and is smaller than the pure conversion line width Wx (= 1.51). Therefore, when line width conversion is performed in mode 2, the ratio of black pixels in the entire image is reduced, and the image subjected to line width conversion in mode 2 is an image having a lower density than the original image.

「モード3:最適線幅処理」
このモードは、純変換線幅Wxの小数点以下の数値に関し、所定の閾値tを境界として切り上げ、切り捨てを振り分け、これによって、純変換線幅Wxを整数化し、中間線幅Wmxを得るものである。この中間線幅Wmxは、純変換線幅Wxの小数点以下が閾値tよりも小さければ、純変換線幅Wxの小数点以下の数値を切り捨てて整数化したものとなり、純変換線幅Wxの小数点以下が閾値tよりも大きければ、純変換線幅Wxの小数点以下の数値を切り上げて整数化したものとなる。
“Mode 3: Optimal line width processing”
In this mode, with respect to the numerical value after the decimal point of the pure conversion line width Wx, rounding up is performed with a predetermined threshold t as a boundary, and rounding down is distributed, thereby converting the pure conversion line width Wx into an integer and obtaining the intermediate line width Wmx. . If the decimal point of the pure conversion line width Wx is smaller than the threshold value t, the intermediate line width Wmx is an integer obtained by rounding down the numerical value after the decimal point of the pure conversion line width Wx. Is larger than the threshold value t, the value after the decimal point of the pure conversion line width Wx is rounded up to an integer.

図3に示すように、例えば、原画像の主走査方向の線幅wx=1〜5の範囲に着目すると、中間線幅Wmxは、原画像の線幅wx=1、3、5のときに、太め線幅Whxと同一の値となり、原画像の線幅wx=2、4のときに、細め線幅Wtxと同一の値となる(但し、図3の「中間線幅Wmx」は、閾値tを0.5とした場合を示したものである)。   As shown in FIG. 3, for example, focusing on the range of the line width wx = 1 to 5 of the original image in the main scanning direction, the intermediate line width Wmx is when the line width wx = 1, 3, and 5 of the original image. , The same value as the thick line width Whx, and the same value as the thin line width Wtx when the line width wx = 2 and 4 of the original image (however, the “intermediate line width Wmx” in FIG. The case where t is 0.5 is shown).

すなわち、中間線幅Wmxは、太め線幅Whxと細め線幅Wtxを混在させた値となり、純変換線幅Wxとの誤差を相互に打ち消し合う特性を持った変換線幅となる(例えば、原画像の線幅wx=1に対して中間線幅Wmx=2(太め線幅Whxと同一値)とするときの純変換線幅Wxと中間線幅Wmxとの誤差分(2−1.51=+0.49)の一部を、原画像の線幅wx=2に対して中間線幅Wmx=3(細め線幅Wtxと同一値)とするときの純変換線幅Wxと中間線幅Wmxとの誤差分(3−3.03=−0.3)で打ち消す)。   That is, the intermediate line width Wmx is a value obtained by mixing the thick line width Whx and the thin line width Wtx, and is a conversion line width having a characteristic of mutually canceling errors from the pure conversion line width Wx (for example, the original line width Wmx). An error between the pure conversion line width Wx and the intermediate line width Wmx when the intermediate line width Wmx = 2 (the same value as the thick line width Whx) with respect to the image line width wx = 1 (2-1.51 = +0.49) is a pure conversion line width Wx and an intermediate line width Wmx when the intermediate line width Wmx = 3 (the same value as the thin line width Wtx) with respect to the line width wx = 2 of the original image. (Cancelled with an error of 3−3.03 = −0.3).

このため、モード3で線幅変換した画像は、モード1、2で線幅変換した画像に比べると、原画像の濃度に近い濃度を有する画像となる。尚、本発明者が実験を重ねた結果、閾値t=0.5のときに、画素数変換後の画像と原画像の画像との濃度差が最小になり、原画像の濃度に最も近い濃度の変換画像を得られることが判明している。   For this reason, the image subjected to line width conversion in mode 3 is an image having a density close to the density of the original image as compared to the image subjected to line width conversion in modes 1 and 2. As a result of repeated experiments by the present inventor, when the threshold value t = 0.5, the density difference between the image after pixel number conversion and the original image is minimized, and the density closest to the density of the original image It has been found that a converted image can be obtained.

そして、上記3つのモードからなる正規化処理を、原画像の線幅wx=1(原画像中に存在する主走査方向の黒線の最小の線幅画素数)からi(iは、原画像中に存在する主走査方向の黒線の線幅の最大画素数(図3の場合は600))までの全てについて行い、主走査方向の線幅変換テーブル3cを完成させる。   Then, the normalization processing consisting of the above three modes is performed from the line width wx = 1 of the original image (the minimum number of black line width pixels in the main scanning direction existing in the original image) to i (i is the original image). The process is performed up to the maximum number of pixels (600 in the case of FIG. 3) of the black line width in the main scanning direction existing therein to complete the line width conversion table 3c in the main scanning direction.

次に、副走査方向の線幅変換テーブルの作成方法を説明する。副走査方向の線幅変換テーブルの作成に際しては、上記の式2によって求めた副走査方向の変換倍率ryを用い、下記の式4により副走査方向の純変換線幅Wyを求める。   Next, a method for creating a line width conversion table in the sub-scanning direction will be described. In creating the line width conversion table in the sub-scanning direction, the sub-scanning direction pure conversion line width Wy is obtained by the following equation 4 using the sub-scanning direction conversion magnification ry obtained by the above equation 2.

Figure 0005679284
Figure 0005679284

そして、主走査方向の線幅変換テーブル3cの作成時と同様に、以下の3つにモード分けしながら、純変換線幅Wyを正規化(整数化)する。   Then, as in the creation of the line width conversion table 3c in the main scanning direction, the pure conversion line width Wy is normalized (integerized) while being divided into the following three modes.

「モード1:太め処理」
純変換線幅Wyの小数点以下を一律に切り上げて整数化し、それを太め線幅Whyとする。
"Mode 1: thick processing"
The pure conversion line width Wy is uniformly rounded up to an integer, and this is set as a thick line width Why.

「モード2:細め処理」
純変換線幅Wyの小数点以下を一律に切り捨てて整数化し、それを細め線幅Wtyとする。
"Mode 2: Thinning process"
The fractional part of the pure conversion line width Wy is uniformly rounded down to an integer, and this is used as the thin line width Wty.

「モード3:最適線幅処理」
純変換線幅Wyの小数点以下の数値に関し、所定の閾値tを境界として切り上げ、切り捨てを振り分ける。これによって、純変換線幅Wyを整数化し、中間線幅Wmyを得る。尚、副走査方向の場合も、閾値t=0.5とするのが最適値となる。
“Mode 3: Optimal line width processing”
With respect to the numerical value after the decimal point of the pure conversion line width Wy, the value is rounded up with a predetermined threshold value t as a boundary, and rounded down. As a result, the pure conversion line width Wy is converted to an integer to obtain an intermediate line width Wmy. Even in the sub-scanning direction, the optimum value is the threshold t = 0.5.

上記3つのモードからなる正規化処理を、原画像の線幅wy=1(原画像中に存在する最小の副走査方向の線幅画素数)からj(jは、原画像中に存在する最大の副走査方向の線幅画素数)までの全てについて行い、副走査方向の線幅変換テーブル3cを完成させる。   Normalization processing consisting of the above three modes is performed by changing the original image line width wy = 1 (minimum number of line width pixels in the sub-scanning direction existing in the original image) to j (j is the maximum existing in the original image). To the line width conversion table 3c in the sub-scanning direction is completed.

尚、図1においては、説明の便宜上、線幅変換テーブル3cを線幅変換テーブル作成部3内に記載しているが、線幅変換テーブル3cは、必ずしも線幅変換テーブル作成部3の内部に保持する必要はなく、メモリ2の空き領域を利用して保持するようにしてもよい。   In FIG. 1, for convenience of explanation, the line width conversion table 3 c is described in the line width conversion table creation unit 3, but the line width conversion table 3 c is not necessarily included in the line width conversion table creation unit 3. It is not necessary to hold, and you may make it hold | maintain using the free space of the memory 2. FIG.

図1の画素数変換処理部4は、主走査方向の画素数変換を行う主走査変換部11と、副走査方向の画素数変換を行う副走査変換部12とを備える。   The pixel number conversion processing unit 4 in FIG. 1 includes a main scanning conversion unit 11 that performs pixel number conversion in the main scanning direction and a sub-scanning conversion unit 12 that performs pixel number conversion in the sub-scanning direction.

主走査変換部11には、原画像に含まれる横線(主走査方向に延在する黒線画像)を検出する横線検出部11aと、横線検出部11aで検出した横線の先端座標Axを求める先端座標検出部11bと、横線検出部11aで検出した横線の長さDxを求める黒線長検出部11cと、先端座標検出部11bで求めた先端座標Axに対応する変換画像上の先端座標Ax’を求める変換先端座標算出部11dと、テーブル作成部3bで作成した主走査方向の線幅変換テーブル3cを用い、長さDxに対応する変換線幅Dx’を取得する線幅取得部11eと、変換先端座標算出部11dで求めた先端座標Ax’及び線幅取得部11eで取得した変換線幅Dx’を用い、線単位で画素数変換を行う線単位変換部11fとが設けられる。   The main scanning conversion unit 11 includes a horizontal line detection unit 11a that detects a horizontal line (a black line image extending in the main scanning direction) included in the original image, and a front end for obtaining the leading edge coordinate Ax of the horizontal line detected by the horizontal line detection unit 11a. The coordinate detection unit 11b, the black line length detection unit 11c for obtaining the length Dx of the horizontal line detected by the horizontal line detection unit 11a, and the tip coordinate Ax ′ on the converted image corresponding to the tip coordinate Ax obtained by the tip coordinate detection unit 11b A line width acquisition unit 11e that acquires a conversion line width Dx ′ corresponding to the length Dx using the conversion tip coordinate calculation unit 11d that calculates the line width conversion table 3c in the main scanning direction generated by the table generation unit 3b, A line unit conversion unit 11f that converts the number of pixels in units of lines using the tip coordinates Ax ′ obtained by the conversion tip coordinate calculation unit 11d and the conversion line width Dx ′ obtained by the line width acquisition unit 11e is provided.

横線検出部11aは、図4(a)に示すように、原画像40を主走査方向にスキャンし、原画像40中に存在する横線41を検出する。先端座標検出部11bは、横線検出部11aで検出した横線41の左端に位置する画素42(横線41の先端となる画素)の座標Axを求める。   As shown in FIG. 4A, the horizontal line detection unit 11a scans the original image 40 in the main scanning direction and detects a horizontal line 41 existing in the original image 40. The tip coordinate detection unit 11b obtains the coordinates Ax of the pixel 42 (the pixel that is the tip of the horizontal line 41) located at the left end of the horizontal line 41 detected by the horizontal line detection unit 11a.

黒線長検出部11cは、横線検出部11aで検出した横線41の主走査方向の長さDxを求める。変換先端座標算出部11dは、下記の式5を用い、先端画素42に関して、原画像40上の座標Axに対応する変換画像(主走査方向の画素数を変換した画像)43上の座標Ax’を求める(図4(b)参照)。   The black line length detection unit 11c obtains the length Dx in the main scanning direction of the horizontal line 41 detected by the horizontal line detection unit 11a. The converted leading edge coordinate calculation unit 11d uses the following equation 5 to calculate the coordinates Ax ′ on the converted image (the image obtained by converting the number of pixels in the main scanning direction) 43 corresponding to the coordinates Ax on the original image 40 with respect to the leading edge pixel 42. Is obtained (see FIG. 4B).

Figure 0005679284
Figure 0005679284

線幅取得部11eは、横線検出部11aで検出した横線41の長さDxを、図3に示す主走査方向の線幅変換テーブル3cの「原画像の黒線の主走査方向の線幅wx」に当てはめ、対応する変換線幅Dx’(太め線幅Whx、細め線幅Wtx又は中間線幅Wmx)を取得する。変換線幅Dx’として、太め線幅Whx、細め線幅Wtx、中間線幅Wmxの何れを取得するかは、その際に選択されているモードに従う。   The line width acquisition unit 11e determines the length Dx of the horizontal line 41 detected by the horizontal line detection unit 11a as “the line width wx of the black line of the original image in the main scanning direction” in the line width conversion table 3c in the main scanning direction shown in FIG. To obtain the corresponding conversion line width Dx ′ (thick line width Whx, thin line width Wtx, or intermediate line width Wmx). Which of the thick line width Whx, the thin line width Wtx, and the intermediate line width Wmx is acquired as the conversion line width Dx ′ depends on the mode selected at that time.

線単位変換部11fは、図4(b)に示すように、変換先端座標算出部11dにより求めた座標Ax’を始点として、線幅取得部11eで取得した変換線幅Dx’の長さを有する横線44を変換画像43上に作成する。   As shown in FIG. 4B, the line unit conversion unit 11f sets the length of the conversion line width Dx ′ acquired by the line width acquisition unit 11e from the coordinate Ax ′ obtained by the conversion tip coordinate calculation unit 11d. A horizontal line 44 is created on the converted image 43.

主走査変換部11では、横線検出部11a〜線単位変換部11fによる上記の処理を原画像40上に存在する全ての横線に対して行い、主走査方向の画素数変換処理を原画像40の全体に施す。尚、図4(a)の領域A、Bのように、原画像40の主走査方向の1ライン内に長さの短い複数の横線45、46が存在する場合は、各々を1つの主走査方向に伸びる横線と捉え、各横線45、46の先端座標Ax、長さDxを求めて変換処理を行う。   In the main scanning conversion unit 11, the above processing by the horizontal line detection unit 11 a to the line unit conversion unit 11 f is performed on all the horizontal lines existing on the original image 40, and the pixel number conversion processing in the main scanning direction is performed on the original image 40. Apply to the whole. If there are a plurality of short horizontal lines 45 and 46 within one line in the main scanning direction of the original image 40 as in the areas A and B of FIG. Considering the horizontal line extending in the direction, the tip coordinate Ax and the length Dx of each horizontal line 45, 46 are obtained and conversion processing is performed.

図1に戻り、副走査変換部12には、主走査方向の画素数変換を行った画像(厳密には、後述の副走査方向の字形補正処理を施した画像)に含まれる縦線(副走査方向に延在する黒線画像)を検出する縦線検出部12aと、縦線検出部12aで検出した縦線の先端座標Ayを求める先端座標検出部12bと、縦線検出部12aで検出した縦線の長さDyを求める黒線長検出部12cと、先端座標検出部12bで求めた先端座標Ayに対応する変換画像上の先端座標Ay’を求める変換先端座標算出部12dと、テーブル作成部3bで作成した副走査方向の線幅変換テーブル3cを用い、長さDyに対応する変換線幅Dy’を取得する線幅取得部12eと、変換先端座標算出部12dで求めた先端座標Ay’及び線幅取得部12eで取得した変換線幅Dy’を用い、線単位で画素数変換を行う線単位変換部12fとが設けられる。   Returning to FIG. 1, the sub-scanning conversion unit 12 includes a vertical line (sub-line) included in an image that has undergone pixel number conversion in the main scanning direction (strictly, an image that has been subjected to character correction processing in the sub-scanning direction described later). (A black line image extending in the scanning direction) for detecting a vertical line detection unit 12a for detecting a vertical line tip coordinate Ay detected by the vertical line detection unit 12a, and a vertical line detection unit 12a for detection. A black line length detection unit 12c that determines the length Dy of the vertical line, a conversion tip coordinate calculation unit 12d that calculates the tip coordinate Ay ′ on the converted image corresponding to the tip coordinate Ay obtained by the tip coordinate detection unit 12b, and a table Using the line width conversion table 3c in the sub-scanning direction created by the creation unit 3b, the line width acquisition unit 12e that acquires the conversion line width Dy ′ corresponding to the length Dy, and the tip coordinates obtained by the conversion tip coordinate calculation unit 12d Ay 'and the variable acquired by the line width acquisition unit 12e Using the line width Dy ', and the line unit conversion unit 12f for performing pixel number conversion is provided by line basis.

副走査方向の変換処理においても、主走査方向の変換処理の場合と同様、図5(a)、(b)に示すように、「主走査方向の変換画像43に含まれる縦線47の検出処理」、「検出した縦線47の先端(上端)となる画素48の座標Ay、縦線47の長さDyの検出処理」、「副走査方向の変換画像49上での先端座標Ay’の算出処理」、「長さDyを副走査方向の線幅変換テーブル3cと照会し、副走査方向の変換線幅Dy’を求める処理」、及び「先端座標Ay’を始点として、変換線幅Dy’の長さを有する縦線50を変換画像49上に作成する処理」を行う。尚、副走査方向の先端座標Ay’は、下記の式6により求められる。   Also in the conversion process in the sub-scanning direction, as in the case of the conversion process in the main scanning direction, as shown in FIGS. 5A and 5B, “detection of the vertical line 47 included in the converted image 43 in the main scanning direction”. "Processing", "Detection processing of the coordinate Ay of the pixel 48 that becomes the tip (upper end) of the detected vertical line 47, the length Dy of the vertical line 47", "the tip coordinate Ay 'on the converted image 49 in the sub-scanning direction" "Calculation process", "Process for obtaining the conversion line width Dy 'in the sub-scanning direction by querying the length Dy with the line width conversion table 3c in the sub-scanning direction", and "Conversion line width Dy starting from the tip coordinate Ay'. Processing for creating a vertical line 50 having a length of 'on the converted image 49 "is performed. Note that the front end coordinate Ay ′ in the sub-scanning direction can be obtained by the following Equation 6.

Figure 0005679284
Figure 0005679284

尚、図1においては、説明の便宜上、主走査方向用の変換処理部(主走査変換部11)と副走査方向用の変換処理部(副走査変換部12)とを完全に分けて記載したが、スキャン方向の違いを除けば、両者の機能は共通するため、例えば、先端座標検出部、黒線長検出部、変換先端座標算出部、線幅取得部及び線単位変換部を一本化し、主走査変換部11と副走査変換部12で共有することができる。   In FIG. 1, for convenience of explanation, the conversion processing unit for the main scanning direction (main scanning conversion unit 11) and the conversion processing unit for the sub scanning direction (sub scanning conversion unit 12) are completely separated. However, since the functions of both are common except for the difference in scanning direction, for example, the tip coordinate detection unit, black line length detection unit, conversion tip coordinate calculation unit, line width acquisition unit, and line unit conversion unit are unified. The main scanning conversion unit 11 and the sub-scanning conversion unit 12 can share the same.

図1の字形補正処理部5は、副走査方向の字形補正処理を行う副走査補正部21と、主走査方向の字形補正処理を行う主走査補正部22とを備える。   1 includes a sub-scanning correction unit 21 that performs character correction processing in the sub-scanning direction, and a main-scanning correction unit 22 that performs character correction processing in the main-scanning direction.

副走査補正部21には、画素数変換処理部4の主走査変換部11で生成された変換画像43(図4(b)参照)を対象とし、凹凸縦線(黒画素及び白画素が混在する縦線)を検出する凹凸縦線検出部21aと、凹凸縦線検出部21aで検出した凹凸縦線に含まれる白画素及び黒画素の各画素数を計数するカウンタ21bと、カウンタ21bの出力に基づき、凹凸縦線検出部21aで検出した凹凸縦線を補正する線形補正部21cとが設けられる。   The sub-scanning correction unit 21 targets the converted image 43 (see FIG. 4B) generated by the main scanning conversion unit 11 of the pixel number conversion processing unit 4, and includes uneven vertical lines (a mixture of black pixels and white pixels). Vertical line detection unit 21a that detects the vertical line), counter 21b that counts the number of white and black pixels included in the vertical line detected by the vertical line detection unit 21a, and the output of the counter 21b And a linear correction unit 21c that corrects the vertical line detected by the vertical line detection unit 21a.

凹凸縦線検出部21aは、主走査方向の画素数変換が行われた変換画像43を副走査方向に1画素単位でスキャンし、そのスキャンした画素(注目画素)及び周辺画素を、図6に示す「端部パターンA」及び「端部パターンB」並びに図7に示す「連続部パターンA」及び「連続部パターンB」と対比し、図8に示す黒画素及び白画素が混在する縦線52を検出する。   The concavo-convex vertical line detection unit 21a scans the converted image 43 that has been subjected to the pixel number conversion in the main scanning direction in units of one pixel in the sub-scanning direction, and shows the scanned pixel (target pixel) and peripheral pixels in FIG. In contrast to the “end pattern A” and “end pattern B” shown in FIG. 7 and the “continuous pattern A” and “continuous pattern B” shown in FIG. 7, the vertical lines in which black pixels and white pixels shown in FIG. 52 is detected.

ここで、図6(a)に示す「端部パターンA」は、白画素の注目画素51aと、注目画素51aの上隣に上置する白画素(注目画素51aに対して、凹凸縦線検出部21aによる副走査スキャンの進み方向と反対側に隣り合う白画素)51bと、注目画素51aの左隣に位置する黒画素(注目画素51aに対して、主走査変換部11による主走査変換時のスキャンの進み方向と反対側に隣り合う黒画素)51cとの3画素からなる照合用のパターンであり、縦線の上端部(開始点)を検出するにあたり、注目画素が白画素であったときに使用するものである。   Here, the “edge pattern A” shown in FIG. 6A includes a white pixel of interest pixel 51a and a white pixel placed above and adjacent to the pixel of interest 51a. During main scanning conversion by the main scanning conversion unit 11 for the white pixel 51b adjacent to the side opposite to the advancing direction of the sub-scanning scan by the unit 21a and the black pixel located to the left of the target pixel 51a (the target pixel 51a). This is a matching pattern consisting of three pixels with a black pixel 51c adjacent on the opposite side of the scan advance direction), and the pixel of interest was a white pixel when detecting the upper end (starting point) of the vertical line. It is what is sometimes used.

また、図6(b)に示す「端部パターンB」は、黒画素の注目画素51dと、注目画素51dの上隣に位置する白画素(注目画素51dに対して、凹凸縦線検出部21aによる副走査スキャンの進み方向と反対側に隣り合う白画素)51eと、注目画素51dの右隣に位置する白画素(注目画素51dに対して、主走査変換部11による主走査変換時のスキャンの進み方向に隣り合う白画素)51fとの3画素からなる照合用のパターンであり、縦線の上端部を検出するにあたり、注目画素が黒画素であったときに使用するものである。   In addition, the “edge pattern B” illustrated in FIG. 6B includes a black pixel of interest 51d and a white pixel (a pixel of interest 51d that is adjacent to the pixel of interest 51d). Scan at the time of main scanning conversion by the main scanning conversion unit 11 with respect to the white pixel (white pixel adjacent to the opposite side of the advance direction of the sub-scanning scan) 51e and the white pixel (rightward pixel 51d) of the target pixel 51d. (White pixel adjacent in the advancing direction) 51f) and a pattern for collation consisting of three pixels, which are used when the pixel of interest is a black pixel in detecting the upper end of the vertical line.

さらに、図7(a)に示す「連続部パターンA」は、白画素の注目画素51gと、注目画素51gの左隣に位置する黒画素51hとの2画素からなる照合用のパターンであり、縦線の上端部以外の部分を検出するにあたり、注目画素が白画素であったときに使用するものである。   Furthermore, the “continuous part pattern A” shown in FIG. 7A is a pattern for matching consisting of two pixels, a white pixel of interest 51g and a black pixel 51h located to the left of the pixel of interest 51g. When detecting a portion other than the upper end of the vertical line, it is used when the target pixel is a white pixel.

また、図7(b)に示す「連続部パターンB」は、黒画素の注目画素51iと、注目画素51iの右隣に位置する白画素51jとの2画素からなる照合用のパターンであり、縦線の上端部以外の部分を検出するにあたり、注目画素が黒画素であったときに使用するものである。   In addition, the “continuous portion pattern B” illustrated in FIG. 7B is a matching pattern including two pixels, a black pixel of interest 51i and a white pixel 51j located to the right of the pixel of interest 51i. When detecting a portion other than the upper end portion of the vertical line, it is used when the target pixel is a black pixel.

尚、黒画素及び白画素が混在する縦線の具体的な検出方法については、後に詳述する。   A specific method for detecting a vertical line in which black pixels and white pixels are mixed will be described in detail later.

図1に戻り、カウンタ21bは、凹凸縦線検出部21aの出力に基づき、縦線52内の黒画素の数と白画素の数との各々を計数する。図示を省略しているが、カウンタ21bには、黒画素用のカウンタと、白画素用のカウンタとが設けられる。   Returning to FIG. 1, the counter 21 b counts the number of black pixels and the number of white pixels in the vertical line 52 based on the output of the uneven vertical line detection unit 21 a. Although not shown, the counter 21b is provided with a counter for black pixels and a counter for white pixels.

線形補正部21cは、カウンタ21bの出力に基づき、縦線52内の黒画素数と白画素数を対比し、少ない側の画素種に属する画素の値を多い側の画素種の値に変換して出力する。例えば、図8(a)の縦線52のように、黒画素の数の方が多ければ、図8(b)に示すように、縦線52に含まれる全ての白画素を黒画素に変換し、縦線52の全体を黒画素に統一化する。逆に、白画素の数の方が多ければ、縦線に含まれる全ての黒画素を白画素に変換し、縦線の全体を白画素に統一化する。これらの処理により、縦線の凹凸を解消し、文字の縦輪郭(副走査方向の線形)を補正する。   Based on the output of the counter 21b, the linear correction unit 21c compares the number of black pixels and the number of white pixels in the vertical line 52, and converts the value of the pixel belonging to the smaller pixel type to the value of the larger pixel type. Output. For example, if the number of black pixels is larger as shown by the vertical line 52 in FIG. 8A, all white pixels included in the vertical line 52 are converted to black pixels as shown in FIG. 8B. Then, the entire vertical line 52 is unified into black pixels. Conversely, if the number of white pixels is larger, all black pixels included in the vertical line are converted into white pixels, and the entire vertical line is unified into white pixels. By these processes, the unevenness of the vertical line is eliminated, and the vertical outline of the character (linear in the sub-scanning direction) is corrected.

図1に戻り、主走査補正部22には、画素数変換処理部4の副走査変換部12で生成された変換画像49(図5(b)参照)を対象とし、凹凸横線(黒画素及び白画素が混在する横線)を検出する凹凸横線検出部22aと、凹凸横線検出部22aで検出した凹凸横線に含まれる白画素及び黒画素の各画素数を計数するカウンタ22bと、カウンタ22bの出力に基づき、凹凸横線検出部22aで検出した凹凸横線を補正する線形補正部22cとが設けられる。   Returning to FIG. 1, the main scanning correction unit 22 targets the converted image 49 (see FIG. 5B) generated by the sub-scanning conversion unit 12 of the pixel number conversion processing unit 4. An uneven horizontal line detection unit 22a that detects a horizontal line in which white pixels are mixed), a counter 22b that counts the number of white and black pixels included in the uneven horizontal line detected by the uneven horizontal line detection unit 22a, and an output of the counter 22b Is provided with a linear correction unit 22c for correcting the uneven horizontal line detected by the uneven horizontal line detection unit 22a.

凹凸横線検出部22aで用いる照合用のパターンは、図9に示すように、「端部パターンC」、「端部パターンD」、「連続部パターンC」及び「連続部パターンD」の4つのパターンからなる。   As shown in FIG. 9, the pattern for collation used in the uneven horizontal line detection unit 22a has four patterns of “end pattern C”, “end pattern D”, “continuous pattern C”, and “continuous pattern D”. Consists of patterns.

図9(a)の端部パターンCは、横線の左端部(開始点)を検出するにあたり、注目画素が白画素であったときに使用するものであり、図9(b)の端部パターンDは、横線の左端部を検出するにあたり、注目画素が黒画素であったときに使用するものである。また、図9(c)の連続部パターンCは、横線の左端部以外の部分を検出するにあたり、注目画素が白画素であったときに使用するものであり、図9(d)の連続部パターンDは、横線の左端部以外の部分を検出するにあたり、注目画素が黒画素であったときに使用するものである。   The end pattern C in FIG. 9A is used when the pixel of interest is a white pixel in detecting the left end (starting point) of the horizontal line, and the end pattern in FIG. 9B. D is used when the pixel of interest is a black pixel in detecting the left end of the horizontal line. 9C is used when a pixel of interest is a white pixel in detecting a portion other than the left end of the horizontal line, and the continuous portion pattern C of FIG. The pattern D is used when the pixel of interest is a black pixel in detecting a portion other than the left end portion of the horizontal line.

主走査方向の字形補正処理においても、副走査方向の補正処理の場合と同様、図10(a)、(b)に示すように、「変換画像49内の黒画素及び白画素が混在する凹凸横線49aの検出処理」、「凹凸横線49a内の白画素及び黒画素の各画素数の計数処理」、「凹凸横線49a内の画素の値を多い側の画素種の値に統一化する処理」を行う。   As in the case of the correction process in the sub-scanning direction, as shown in FIGS. 10A and 10B, in the main scanning direction character shape correction process, “the unevenness in which black pixels and white pixels in the converted image 49 are mixed. "Detection processing of horizontal line 49a", "Counting processing of the number of pixels of white and black pixels in uneven horizontal line 49a", "Process to unify the pixel values in uneven horizontal line 49a to the value of the pixel type on the larger side" I do.

尚、図1においては、説明の便宜上、副走査方向用の補正処理部(副走査補正部21)と主走査方向用の補正処理部(主走査補正部22)とを完全に分けて記載したが、スキャン方向の違いを除けば、両者の機能は共通するため、例えば、カウンタ及び線形補正部を一本化し、副走査補正部21と主走査補正部22で共有することができる。   In FIG. 1, for the sake of convenience of explanation, the correction processing unit for the sub-scanning direction (sub-scanning correction unit 21) and the correction processing unit for the main-scanning direction (main scanning correction unit 22) are completely separated. However, since the functions of both are common except for the difference in the scanning direction, for example, the counter and the linear correction unit can be unified and shared by the sub-scanning correction unit 21 and the main scanning correction unit 22.

次に、上記構成を有する変換装置1の動作について、図1〜図24を参照しながら説明する。   Next, operation | movement of the converter 1 which has the said structure is demonstrated, referring FIGS.

画素数変換にあたっては、図11に示すように、線幅変換テーブル作成部3によって、入力した原画像の主走査及び副走査方向の画素数と、出力する変換画像の主走査及び副走査方向の画素数とに基づいて、主走査方向及び副走査方向の線幅変換テーブル3c(図3参照)を作成する(ステップS1)。次いで、変換モードを設定し、モード1(太め処理)、モード2(細め処理)、モード3(最適先幅処理)の何れで変換処理を実行するかを選択する(ステップS2)。   In the conversion of the number of pixels, as shown in FIG. 11, the line width conversion table creation unit 3 performs the number of pixels in the main scanning and sub-scanning directions of the input original image and the main image in the main scanning and sub-scanning directions of the converted image to be output. Based on the number of pixels, a line width conversion table 3c (see FIG. 3) in the main scanning direction and the sub-scanning direction is created (step S1). Next, the conversion mode is set, and it is selected whether to execute the conversion process in mode 1 (thickening process), mode 2 (thinning process), or mode 3 (optimum destination width process) (step S2).

ところで、2値画像を印刷する場合、製版過程を通じて2値画像(デジタル画像)を刷版に転写した後、インクを載せて紙面に像を印刷するが、印刷工程では、インクの滲み等によるドットゲイン現象(印刷紙面上の網点が刷版の網点よりも大きくなる現象)が必ず発生する。   By the way, when printing a binary image, the binary image (digital image) is transferred to the printing plate through the plate making process, and then the ink is printed on the paper surface. In the printing process, dots due to ink bleeding or the like are printed. A gain phenomenon (a phenomenon in which the halftone dot on the printing paper becomes larger than the halftone dot of the printing plate) always occurs.

ドットゲインの量は、インク量等だけでなく、画素数変換の有無によっても変動するため、印刷を前提とした画素数変換の場合、変換処理が与えるドットゲインへの影響を考慮する必要がある。他の条件(インクの特性や紙質等)を無視し、2値画像データ(印刷の対象となる画像)の特性のみを考慮した場合、印刷時に生じるドットゲイン量は2値画像の画素のサイズによって変動する。   The amount of dot gain varies not only with the amount of ink, etc., but also with the presence or absence of pixel number conversion, so in the case of pixel number conversion on the premise of printing, it is necessary to consider the effect on dot gain given by the conversion process . When other conditions (such as ink characteristics and paper quality) are ignored and only the characteristics of binary image data (images to be printed) are considered, the amount of dot gain generated during printing depends on the pixel size of the binary image. fluctuate.

例えば、テキスト画像の解像度変換の場合には(画像全体のサイズは維持しつつ、画素数のみを変える場合)、変換の前後で1画素のサイズが変わるため、印刷工程のドットゲイン量に影響を与えることになる。一例を挙げると、909dpi→1200dpiに高解像度化する場合、1画素のサイズは28μm×28μm→21μm×21μmに縮小され、解像度変換後の画像における1画素の面積は、原画像の1画素の面積の56%にまで減少する。   For example, in the case of resolution conversion of a text image (when only the number of pixels is changed while maintaining the size of the entire image), the size of one pixel changes before and after the conversion, which affects the dot gain amount in the printing process. Will give. For example, when the resolution is increased from 909 dpi to 1200 dpi, the size of one pixel is reduced from 28 μm × 28 μm to 21 μm × 21 μm, and the area of one pixel in the image after resolution conversion is the area of one pixel of the original image To 56%.

ドットゲイン量は、2値画像の1画素のサイズが大きくなるほど大きくなる傾向があるため、上記の例のように、解像度変換によって1画素のサイズが縮小化されると、解像度変換せずに印刷した場合に比べ、ドットゲイン量が小さくなってしまう。このため、2値画像の解像度を上げて印刷すると、印刷画像の見た目が薄くなり、画像の印象を変えてしまうという問題が生じる。   Since the dot gain amount tends to increase as the size of one pixel of the binary image increases, printing is performed without converting the resolution when the size of one pixel is reduced by resolution conversion as in the above example. Compared with the case, the dot gain amount becomes small. For this reason, when the resolution of the binary image is increased and printed, the appearance of the printed image becomes light, and there is a problem that the impression of the image is changed.

その一方で、画素数変換には、上述の解像度変換だけでなく、画像の拡大・縮小(1画素のサイズを維持したまま画素数を増減する処理)もあり、この処理では、1画素のサイズが変わらないため、解像度変換の場合のようなドットゲインの変動がない。すなわち、画素数変換処理の種類によっては、印刷時のドットゲインに影響を及ぼしたり、及ぼさなかったりと区々であるため、そのどちらでも適切な印刷画像を取得し得るようにすることが重要となる。   On the other hand, the pixel number conversion includes not only the above-described resolution conversion but also enlargement / reduction of the image (a process of increasing / decreasing the number of pixels while maintaining the size of one pixel). Therefore, there is no dot gain variation as in the case of resolution conversion. In other words, depending on the type of pixel number conversion processing, it may or may not affect the dot gain at the time of printing, so it is important to be able to acquire an appropriate print image in either case. Become.

そこで、変換処理が印刷時のドットゲイン量に与える影響を考慮し、ステップS2のモード選択は、以下のように行うことが好ましい。   Therefore, in consideration of the influence of the conversion process on the dot gain amount at the time of printing, the mode selection in step S2 is preferably performed as follows.

例えば、低解像度画像から高解像度画像に変換する場合(画像全体のサイズを変えないで、解像度を上げる場合)には、変換画像の1画素のサイズが、原画像の1画素のサイズに比べて小さくなり、変換画像を印刷した際に生じるドットゲイン量は、原画像の印刷時のドットゲイン量よりも小さくなる。   For example, when converting from a low-resolution image to a high-resolution image (when increasing the resolution without changing the overall image size), the size of one pixel of the converted image is larger than the size of one pixel of the original image. The dot gain amount that occurs when the converted image is printed becomes smaller than the dot gain amount when the original image is printed.

このため、解像度を上げる変換を行う場合には、モード1(太め処理)による変換を選択して、線幅を太くする画素数変換を実施し、画像全体の濃度が原画像のそれよりも高くなる変換画像を生成することが好ましい。この場合、変換画像(印刷の元となる画像)の濃度を意図的に上げた分、紙面に印刷される画像の濃度を押し上げることができ、画素数変換に起因するドットゲイン量の減少の影響を少なく抑えることが可能になる。すなわち、ドットゲイン量の減少による印刷画像の濃度の低下を、画素数変換時の太め処理による濃度の増大分で相殺することができ、印刷画像が薄く見えるのを抑制することが可能になる。   For this reason, when performing conversion to increase the resolution, the conversion in mode 1 (thickening process) is selected, and the number of pixels to increase the line width is converted, and the density of the entire image is higher than that of the original image. It is preferable to generate a converted image. In this case, the density of the image to be printed on the paper surface can be increased by the amount of increase in the density of the converted image (the image to be printed), and the influence of the decrease in the dot gain amount resulting from the pixel number conversion. Can be reduced. That is, the decrease in the density of the print image due to the decrease in the dot gain amount can be offset by the increase in the density due to the thickening process at the time of pixel number conversion, and the print image can be prevented from appearing thin.

また、高解像度画像から低解像度画像に変換する場合(画像全体のサイズを変えないで、解像度を下げる場合)には、変換画像の1画素のサイズが大きくなり、変換画像の印刷時に生じるドットゲイン量は、原画像のときのそれよりも大きくなる。このため、モード2(細め処理)による変換を選択して、線幅を細くする画素数変換を実施することが好ましい。この場合、ドットゲイン量の増加による印刷画像の濃度の増大を、画素数変換時の細め処理による濃度の低下分で相殺することができ、印刷画像が濃く見えるのを抑制することが可能になる。   Also, when converting from a high-resolution image to a low-resolution image (when reducing the resolution without changing the size of the entire image), the size of one pixel of the converted image becomes large, and dot gain generated when the converted image is printed The amount is larger than that of the original image. For this reason, it is preferable to select the conversion in mode 2 (thinning process) and implement the pixel number conversion to reduce the line width. In this case, the increase in the density of the print image due to the increase in the dot gain amount can be offset by the decrease in the density due to the thinning process when converting the number of pixels, and the print image can be prevented from appearing dark. .

さらに、解像度を変えないで画像全体のサイズを拡大・縮小する場合には、変換の前後で画像全体の画像数が増減するのみで、1画素のサイズ自体は変わらないため、ドットゲイン量の変動がない。このため、モード3(最適線幅処理)による変換を選択し、原画像の濃度を忠実に反映しつつ、線幅のばらつきを抑えた画素数変換を実施することが好ましい。   Furthermore, when the size of the entire image is enlarged or reduced without changing the resolution, the number of images of the entire image is only increased or decreased before and after conversion, and the size of one pixel itself does not change. There is no. For this reason, it is preferable to select the conversion in mode 3 (optimal line width processing), and to perform the pixel number conversion while suppressing the variation in line width while faithfully reflecting the density of the original image.

モード3による変換(閾値tを境界として小数点以下の切り上げ、切り下げを振り分ける変換)を選択した際に、閾値tを手動で変更し得るようにしておくと便利になる。すなわち、最適値であるt=0.5をデフォルト値として装置に設定し、ユーザが希望する場合に閾値tの値を増減し得るように構成するのが好ましい。これにより、例えば、変換画像の濃度を上げたいなど、画素変換時に意図的に濃度を変えたいといった要望にも応えることが可能になる。   It is convenient to be able to manually change the threshold value t when selecting the conversion by mode 3 (conversion in which rounding up / down of the decimal point is performed with the threshold value t as a boundary). That is, it is preferable to set the optimal value t = 0.5 in the apparatus as a default value so that the value of the threshold value t can be increased or decreased when the user desires. As a result, for example, it is possible to respond to a request to intentionally change the density at the time of pixel conversion, for example, to increase the density of the converted image.

尚、上記のモード選択は、ユーザの手動選択によって行ってもよいが、上述のように、変換の種類と適したモードとの間には規則性があるため、指定される変換の種類に応じて装置側で自動的にモードを選択するようにしてもよい。   The mode selection may be performed manually by the user. However, as described above, since there is regularity between the conversion type and the appropriate mode, depending on the specified conversion type. The mode may be automatically selected on the device side.

このように、変換線幅Dx’として、純変換線幅Wxの小数点以下を切り捨てて整数化した細め線幅Wtx、小数点以下を切り上げて整数化した太め線幅Whx、閾値tによって切り捨て、切り上げを振り分けた中間線幅Wmxの三種の線幅を準備し、変換条件に応じて選択し得るように構成したため、ドットゲイン量の変動を招く解像度変換と、ドットゲイン量の変動を招かない画像の拡大・縮小との何れを行う場合であっても、適切な濃度の印刷画像を得ることができ、画素数変換による印刷濃度への悪影響を抑制することが可能になる。   In this way, as the conversion line width Dx ′, the pure conversion line width Wx is rounded down by rounding down the rounded line width Wtx rounded down to the whole number by rounding down the decimal point, rounded down to the whole line by rounding up the decimal point to the whole number Wtx, and the threshold value t. Since the three line widths of the distributed intermediate line width Wmx are prepared and can be selected according to the conversion conditions, resolution conversion that causes fluctuations in the dot gain amount and enlargement of an image that does not cause fluctuations in the dot gain amount In any case where reduction is performed, a print image having an appropriate density can be obtained, and adverse effects on the print density due to pixel number conversion can be suppressed.

モード選択が終了すると、画素数変換処理部4の主走査変換部11(図1参照)により、主走査方向の画素数変換処理を行う(ステップS3)。主走査方向の画素数変換処理に際しては、図12に示すように、先ず、原画像40(図4(a)参照)をスキャンし(ステップS11)、原画像40の横線41(図4(a)参照)を検出する(ステップS12)。   When the mode selection is completed, the main scanning conversion unit 11 (see FIG. 1) of the pixel number conversion processing unit 4 performs a pixel number conversion process in the main scanning direction (step S3). In the process of converting the number of pixels in the main scanning direction, as shown in FIG. 12, first, the original image 40 (see FIG. 4A) is scanned (step S11), and the horizontal line 41 of the original image 40 (FIG. 4A). )) Is detected (step S12).

次いで、横線41の左端に位置する画素42の座標Axを検出するとともに、横線41の長さDxを検出する(ステップS13、S14)。次に、原画像40上の座標Axに対応する変換画像43(図4(b)参照)上の座標Ax’を算出する(ステップS15)。   Next, the coordinate Ax of the pixel 42 located at the left end of the horizontal line 41 is detected, and the length Dx of the horizontal line 41 is detected (steps S13 and S14). Next, the coordinate Ax ′ on the converted image 43 (see FIG. 4B) corresponding to the coordinate Ax on the original image 40 is calculated (step S15).

次いで、図11のステップS1で作成した主走査方向の線幅変換テーブル3c(図3参照)を用い、長さDxに対応する変換線幅Dx’を取得する(ステップS16)。このとき、変換線幅Dx’として、図3の「太め線幅Whx」、「細め線幅Wtx」、「中間線幅Wmx」の何れを取得するかは、図11のステップS2で選択したモードに従う。   Next, a conversion line width Dx ′ corresponding to the length Dx is obtained using the line width conversion table 3c (see FIG. 3) in the main scanning direction created in step S1 of FIG. 11 (step S16). At this time, which of “thick line width Whx”, “thin line width Wtx”, and “intermediate line width Wmx” in FIG. 3 is acquired as the conversion line width Dx ′ is the mode selected in step S2 in FIG. Follow.

次に、図12のステップS15で算出した座標Ax’を始点とし、ステップS16で取得した変換線幅Dx’の横線44(図4(b)参照)を変換画像43に書き込む(ステップS17)。その後、原画像40に残りの未スキャン横線が存在しなくなるまで、ステップS12〜S17の処理を繰り返し(ステップS18)、画像全体に対して処理を施す。   Next, the horizontal line 44 (see FIG. 4B) of the conversion line width Dx ′ acquired in step S16 is written in the converted image 43, starting from the coordinates Ax ′ calculated in step S15 of FIG. 12 (step S17). Thereafter, the processes in steps S12 to S17 are repeated until the remaining unscanned horizontal line does not exist in the original image 40 (step S18), and the entire image is processed.

上記の処理により、図13(a)、(b)に示すように、文字の横方向の輪郭線(主走査方向の線形)の凹凸をなくした状態の変換画像63を取得する。但し、原画像60上で横線の長さが違う部分(例えば、長さDx1の横線61と、長さDx2の横線62)では、図3の純変換線幅と変換線幅(図3のWhx、Wtx、Wmxの何れか)との誤差(丸め誤差)が異なる。この丸め誤差の違いは、図13(b)に示すように、横線を書き込む際の画素数の違いになって現れるため、変換画像63において、文字の縦方向の輪郭線(副走査方向の線形)に凹凸が生じる虞がある(主に、書き込んだ横線の末尾(右端)となる領域64に生じる)。   By the above processing, as shown in FIGS. 13A and 13B, a converted image 63 is obtained in a state in which the unevenness of the horizontal outline (linear in the main scanning direction) of the character is eliminated. However, in the portion where the length of the horizontal line is different on the original image 60 (for example, the horizontal line 61 of length Dx1 and the horizontal line 62 of length Dx2), the pure conversion line width and the conversion line width (Whx of FIG. 3) , Wtx, or Wmx) (rounding error) is different. This difference in rounding error appears as a difference in the number of pixels when writing a horizontal line as shown in FIG. 13B. Therefore, in the converted image 63, the outline of the character in the vertical direction (linear in the sub-scanning direction). May occur (mainly in the region 64 at the end (right end) of the written horizontal line).

そこで、図11に示すように、主走査方向の画素数変換処理に続いて、字形補正処理部5の副走査補正部21(図1参照)により、副走査方向の字形補正処理を行う(ステップS4)。副走査方向の字形補正処理にあたっては、図14に示すように、先ず、主走査方向の変換画像63(図13(b)参照)を副走査方向に1画素単位でスキャンし(ステップS21)、スキャンした画素(注目画素)が白画素であるか否かを判別する(ステップS22)。   Therefore, as shown in FIG. 11, following the pixel number conversion processing in the main scanning direction, the sub-scanning correction unit 21 (see FIG. 1) of the character-shaped correction processing unit 5 performs character correction processing in the sub-scanning direction (step). S4). In the character correction processing in the sub-scanning direction, as shown in FIG. 14, first, the converted image 63 (see FIG. 13B) in the main scanning direction is scanned in units of one pixel in the sub-scanning direction (step S21). It is determined whether or not the scanned pixel (target pixel) is a white pixel (step S22).

例えば、図15(a)の画素71a、71b、71c、71dのように、注目画素が白画素の場合には(ステップS22:Y)、注目画素、その上隣の画素及び左隣の画素からなる3画素の値を、図6(a)に示す端部パターンAと照合し、両者が合致するか否かを判別する(ステップS23)。   For example, when the target pixel is a white pixel as in the pixels 71a, 71b, 71c, 71d in FIG. 15A (step S22: Y), the target pixel, the upper adjacent pixel, and the left adjacent pixel are used. These three pixel values are compared with the end pattern A shown in FIG. 6A to determine whether or not they match (step S23).

そして、図15(a)の白画素71aの場合、図16(a)に示すように、注目画素71aの上隣の画素72aが白画素で、注目画素71aの左隣の画素72bが白画素であるため、それらの画素71a〜72bの画素値が端部パターンAと合致しない(ステップS23:N)。この場合には、何らの処理も行わず、副走査方向スキャンの順に沿って次の画素をスキャンする(ステップS38)。また、図15(a)の白画素71b、71cのスキャン時も、注目画素及び周辺画素からなる3画素が端部パターンAと合致しないため、上記の場合と同様、何らの処理も行わず、副走査方向スキャンの順に沿って次の画素をスキャンする。   In the case of the white pixel 71a in FIG. 15A, as shown in FIG. 16A, the pixel 72a adjacent to the upper side of the target pixel 71a is a white pixel, and the pixel 72b adjacent to the left side of the target pixel 71a is a white pixel. Therefore, the pixel values of the pixels 71a to 72b do not match the end pattern A (step S23: N). In this case, no process is performed, and the next pixel is scanned in the order of scanning in the sub-scanning direction (step S38). Also, when scanning the white pixels 71b and 71c in FIG. 15A, the three pixels including the target pixel and the peripheral pixels do not match the edge pattern A, so that no processing is performed as in the above case, The next pixel is scanned in the order of scanning in the sub-scanning direction.

これに対し、図15(a)の白画素71dの場合、図16(b)に示すように、注目画素71dの上隣の画素73aが白画素で、注目画素71dの左隣の画素73bが黒画素であるため、それらの画素71d〜73bの画素値が端部パターンAと合致する(ステップS23:Y)。この場合は、副走査補正部21のカウンタ21b(図1参照)をリセットするとともに、白画素の数をカウントアップする(ステップS24、S25)。   On the other hand, in the case of the white pixel 71d in FIG. 15A, as shown in FIG. 16B, the pixel 73a adjacent to the upper side of the target pixel 71d is a white pixel, and the pixel 73b adjacent to the left side of the target pixel 71d is Since it is a black pixel, the pixel values of these pixels 71d to 73b match the end pattern A (step S23: Y). In this case, the counter 21b (see FIG. 1) of the sub-scanning correction unit 21 is reset and the number of white pixels is counted up (steps S24 and S25).

次いで、スキャンした画素の下隣に位置する画素(副走査方向の次の画素)をスキャンし(ステップS26)、その画素が白画素であるか否かを判別する(ステップS27)。その結果、図15(a)の画素71eのように、黒画素である場合には(ステップS27:N)、注目画素及びその右隣の画素からなる2画素の値を、図7(b)に示す連続部パターンBと照合する(ステップS28)。   Next, a pixel located next to the scanned pixel (next pixel in the sub-scanning direction) is scanned (step S26), and it is determined whether or not the pixel is a white pixel (step S27). As a result, when the pixel is a black pixel as in the pixel 71e in FIG. 15A (step S27: N), the values of two pixels including the target pixel and the pixel on the right side thereof are set as shown in FIG. (Step S28).

画素71eの場合、図17(a)に示すように、注目画素71eの右隣に位置する画素74が白画素であるため、連続部パターンBと合致し(ステップS28:Y)、この場合は、黒画素の数をカウントアップする(ステップS29)。その後、さらに次の画素(図15(a)の画素71fをスキャンし(ステップS26)、ステップS27以降の処理を繰り返す。尚、画素71fにおいては、注目画素及び右隣の画素の並びが、画素71eと同一であるため、画素71eの場合と同様、黒画素数のカウントアップの対象となる。   In the case of the pixel 71e, as shown in FIG. 17A, since the pixel 74 located on the right side of the target pixel 71e is a white pixel, it matches the continuous pattern B (step S28: Y). Then, the number of black pixels is counted up (step S29). Thereafter, the next pixel (the pixel 71f in FIG. 15A is scanned (step S26), and the processing from step S27 onward is repeated. In the pixel 71f, the arrangement of the pixel of interest and the pixel on the right is the pixel. Since it is the same as 71e, the number of black pixels is counted up as in the case of the pixel 71e.

さらに処理が進み、図15(a)の画素71gをスキャンすると、それまでとは変わり、白画素を検出することになる(ステップS27:Y)。この場合は、注目画素及びその左隣の画素からなる2画素の値を、図7(a)に示す連続部パターンAと照合する(ステップS30)。そして、画素71gのように、注目画素及び左隣の画素の値が連続部パターンAと合致する場合には(図17(b)参照)、白画素数をカウントアップする(ステップS31)。   When the processing further proceeds and the pixel 71g in FIG. 15A is scanned, a white pixel is detected as before (step S27: Y). In this case, the values of the two pixels including the target pixel and the pixel adjacent to the left are collated with the continuous pattern A shown in FIG. 7A (step S30). Then, when the value of the target pixel and the adjacent pixel on the left side match the continuous part pattern A as in the pixel 71g (see FIG. 17B), the number of white pixels is counted up (step S31).

以後、上記と同様にして処理を進め、これにより、図15(a)の画素71h、71iが黒画素数のカウントアップの対象画素として検出されるとともに、画素71jが白画素数のカウントアップの対象画素として検出される(ステップS26〜S31)。   Thereafter, the processing proceeds in the same manner as described above. As a result, the pixels 71h and 71i in FIG. 15A are detected as target pixels for counting up the number of black pixels, and the pixel 71j is counted up for counting the number of white pixels. It is detected as a target pixel (steps S26 to S31).

そして、図15(a)の画素71jの次の画素71kまでスキャンが進むと、画素71kの場合、図17(c)に示すように、注目画素及び左隣の画素の値が連続部パターンAと合致しない(ステップS26、ステップS27:Y、ステップS30:N)。この場合は、画素71kを白画素数のカウントアップの対象とせず、ステップS35に処理を移行する。   Then, when the scan advances to the pixel 71k next to the pixel 71j in FIG. 15A, in the case of the pixel 71k, as shown in FIG. 17C, the values of the target pixel and the pixel on the left are the continuous portion pattern A. (Step S26, step S27: Y, step S30: N). In this case, the pixel 71k is not targeted for counting up the number of white pixels, and the process proceeds to step S35.

これらに対し、ステップS22の画素種判別において、例えば、図15(b)の画素81a、81bのように、注目画素が黒画素であった場合には(ステップS22:N)、図14に示すように、注目画素、その上隣の画素及び右隣の画素からなる3画素の値を、図6(b)に示す端部パターンBと照合し、両者が合致するか否かを判別する(ステップS32)。   On the other hand, in the pixel type determination in step S22, for example, when the target pixel is a black pixel, such as the pixels 81a and 81b in FIG. 15B (step S22: N), it is shown in FIG. As described above, the values of the three pixels including the target pixel, the upper adjacent pixel, and the right adjacent pixel are collated with the end pattern B shown in FIG. 6B to determine whether or not the two match. Step S32).

例えば、図15(b)の画素81aの場合には、図18(a)に示すように、注目画素、上隣の画素及び右隣の画素からなる3画素の値が、端部パターンBと合致しない(ステップS32:N)。この場合は、何らの処理も行わず、副走査方向スキャンの順に沿って次の画素をスキャンする(ステップS38)。   For example, in the case of the pixel 81a in FIG. 15B, as shown in FIG. 18A, the value of three pixels including the target pixel, the upper adjacent pixel, and the right adjacent pixel is the edge pattern B. Does not match (step S32: N). In this case, no process is performed, and the next pixel is scanned in the order of scanning in the sub-scanning direction (step S38).

一方、図15(b)の画素81bの場合には、図18(b)に示すように、注目画素、上隣の画素及び右隣の画素からなる3画素の値が、端部パターンBと合致する(ステップS32:Y)。この場合は、副走査補正部21のカウンタ21b(図1参照)をリセットするとともに、黒画素の数をカウントアップする(ステップS33、S34)。   On the other hand, in the case of the pixel 81b in FIG. 15B, as shown in FIG. 18B, the value of three pixels including the target pixel, the upper adjacent pixel, and the right adjacent pixel is the edge pattern B. (Step S32: Y). In this case, the counter 21b (see FIG. 1) of the sub-scanning correction unit 21 is reset and the number of black pixels is counted up (steps S33 and S34).

次いで、スキャンした画素の下隣に位置する画素(副走査方向の次の画素)をスキャンし(ステップS26)、以後、ステップS22の判別処理で注目画素が白画素であった場合と同様にして、黒画素数をカウントアップする画素、及び白画素数をカウントアップする画素を順次検出しつつ、黒画素及び白画素の各画素数を計数する(ステップS26〜S31)。   Next, the pixel located next to the scanned pixel (the next pixel in the sub-scanning direction) is scanned (step S26), and thereafter, in the same manner as when the target pixel is a white pixel in the discrimination process in step S22. Then, the number of black pixels and the number of white pixels are sequentially detected, and the number of black pixels and white pixels is counted (steps S26 to S31).

以上のステップS21〜S34の処理の結果、図19(a)に示すように、主走査方向の変換処理の際に書き込んだ横線の末尾となる領域64(図13(b)参照)に含まれる、2本の縦線83、84が、黒画素数及び白画素数のカウント対象の縦線として検出され、各々の縦線において、黒画素及び白画素の画素数が計数される。   As a result of the processing in steps S21 to S34 described above, as shown in FIG. 19A, it is included in the region 64 (see FIG. 13B) which is the end of the horizontal line written in the conversion processing in the main scanning direction. Two vertical lines 83 and 84 are detected as vertical lines for counting the number of black pixels and the number of white pixels, and the number of black pixels and white pixels is counted in each vertical line.

そして、上記の「カウント対象の縦線の検出」及び「黒画素及び白画素の計数処理」に続き、図14に示すように、カウンタ21bのカウント値に基づいて黒画素数及び白画素数がともに「1」以上であるか否かを判別する(ステップS35)。   Then, following the above “detection of vertical lines to be counted” and “counting processing of black pixels and white pixels”, as shown in FIG. 14, the numbers of black pixels and white pixels are determined based on the count value of the counter 21b. It is determined whether or not both are “1” or more (step S35).

例えば、図19(a)の縦線83のように、黒画素のみで構成され、白画素数が「0」(「1」未満)である場合には(ステップS35:N)、何らの処理も行わず、副走査方向スキャンの順に沿って次の画素をスキャンする(ステップS38)。   For example, as shown by the vertical line 83 in FIG. 19A, when only black pixels are included and the number of white pixels is “0” (less than “1”) (step S35: N), no processing is performed. The next pixel is scanned along the order of scanning in the sub-scanning direction (step S38).

これに対し、図19(a)の縦線84のように、黒画素及び白画素が混在し、黒画素数及び白画素数がともに「1」以上となる場合には(ステップS35:Y)、黒画素数と白画素数を比較する(ステップS36)。そして、縦線84のように、黒画素の方が多い場合には(ステップS36:Y)、縦線84内の白画素71d、71g、71jを黒画素に変換し、図19(b)に示すように、縦線84の全体を黒画素に統一する(ステップS37)。   On the other hand, when black pixels and white pixels are mixed and the number of black pixels and the number of white pixels are both “1” or more as indicated by the vertical line 84 in FIG. 19A (step S35: Y). The number of black pixels and the number of white pixels are compared (step S36). Then, when there are more black pixels like the vertical line 84 (step S36: Y), the white pixels 71d, 71g, 71j in the vertical line 84 are converted into black pixels, and FIG. As shown, the entire vertical line 84 is unified with black pixels (step S37).

上記の処理後、入力した主走査方向の変換画像63に残りの未スキャン画素が存在するか否かを判別し(ステップS38)、残りの画素があれば、未スキャン画素が存在しなくなるまでステップS21〜S38の処理を繰り返す。   After the above processing, it is determined whether or not there are any remaining unscanned pixels in the input converted image 63 in the main scanning direction (step S38), and if there are remaining pixels, step until no unscanned pixels exist. The processes of S21 to S38 are repeated.

尚、上記の説明では、図15及び図19のように、黒画素及び白画素が混在する縦線に関し、黒画素の方が多くなる画像を例示したが、図20(a)の縦線85のように、白画素の方が多くなる場合には、縦線85内の黒画素86a〜86cを白画素に変換し、縦線85の全体を白画素に統一する(図14のステップS39)。   In the above description, as shown in FIGS. 15 and 19, an image in which the number of black pixels is larger with respect to the vertical line in which black pixels and white pixels are mixed is illustrated, but the vertical line 85 in FIG. As shown in FIG. 14, when the number of white pixels increases, the black pixels 86a to 86c in the vertical line 85 are converted into white pixels, and the entire vertical line 85 is unified into white pixels (step S39 in FIG. 14). .

また、理論上、黒画素数と白画素数が同数になる場合もあり得るが、その場合は、黒画素又は白画素の何れかに統一するように、画素値を変換すればよい。   Theoretically, the number of black pixels and the number of white pixels may be the same, but in this case, the pixel values may be converted so as to be unified to either black pixels or white pixels.

上述のように、主走査方向の画素数変換を行った後に、黒画素及び白画素が混在する縦線を検出するとともに、黒画素及び白画素の画素数を比較して多い側の画素種に統一化するため、主走査方向の画素数変換によって生じる副走査方向側の凹凸を解消することができ、副走査方向側の輪郭の乱れを補正することが可能になる。   As described above, after converting the number of pixels in the main scanning direction, a vertical line in which black pixels and white pixels are mixed is detected, and the number of pixels of the black pixels and white pixels is compared and the pixel type on the larger side is detected. In order to unify, the unevenness on the sub-scanning direction side caused by the conversion of the number of pixels in the main scanning direction can be eliminated, and the disturbance of the contour on the sub-scanning direction side can be corrected.

図11に戻り、副走査方向の字形補正処理が終了すると、画素数変換処理部4の副走査変換部12(図1参照)により、副走査方向の画素数変換処理を行う(ステップS5)。副走査方向の画素数変換処理に際しては、図21に示すように、先ず、副走査方向の字形補正処理を施した補正画像55をスキャンし(ステップS51)、補正画像55の縦線を検出する(ステップS52)。   Returning to FIG. 11, when the character correction processing in the sub-scanning direction is completed, the sub-scanning conversion unit 12 (see FIG. 1) of the pixel number conversion processing unit 4 performs the pixel number conversion processing in the sub-scanning direction (step S5). In the pixel number conversion process in the sub-scanning direction, as shown in FIG. 21, first, the correction image 55 subjected to the character correction process in the sub-scanning direction is scanned (step S51), and the vertical line of the correction image 55 is detected. (Step S52).

次いで、縦線の上端に位置する画素の座標Ayを検出するとともに、縦線の長さDyを検出する(ステップS53、S54)。次に、補正画像55上の座標Ayに対応する変換画像49(図5(b)参照)上の座標Ay’を算出するとともに(ステップS55)、図11のステップS1で作成した副走査方向の線幅変換テーブル3c(図3参照)を用い、長さDyに対応する変換線幅Dy’を取得する(ステップS56)。   Next, the coordinate Ay of the pixel located at the upper end of the vertical line is detected, and the length Dy of the vertical line is detected (steps S53 and S54). Next, the coordinate Ay ′ on the converted image 49 (see FIG. 5B) corresponding to the coordinate Ay on the corrected image 55 is calculated (step S55), and the sub-scanning direction created in step S1 of FIG. Using the line width conversion table 3c (see FIG. 3), a conversion line width Dy ′ corresponding to the length Dy is acquired (step S56).

次いで、ステップS39で算出した座標Ay’を始点とし、ステップS46で取得した変換線幅Dy’の縦線50(図5(b)参照)を変換画像49に書き込む(ステップS57)。その後、補正画像55に残りの未スキャン横線が存在しなくなるまで、ステップS52〜S57の処理を繰り返し(ステップS58)、画像全体に対して処理を施す。   Next, using the coordinate Ay 'calculated in step S39 as a starting point, the vertical line 50 (see FIG. 5B) of the conversion line width Dy' acquired in step S46 is written in the converted image 49 (step S57). Thereafter, the processes in steps S52 to S57 are repeated until the remaining unscanned horizontal line does not exist in the corrected image 55 (step S58), and the entire image is processed.

上記の処理により、文字の縦方向の輪郭線(副走査方向の線形)の凹凸をなくした状態の変換画像を取得する。但し、今度は、副走査方向の画素数変換時に生じる丸め誤差の違いに起因し、変換後の画像において、文字の横方向の輪郭線(主走査方向の線形)に凹凸が生じる虞がある(主に、書き込んだ縦線の末尾(下端)となる部分に生じる)。このため、図11に示すように、副走査方向の画素数変換を行った画像を対象とし、主走査方向の字形補正処理を行う(ステップS6)。   By the above processing, a converted image in a state in which the unevenness of the vertical outline of the character (linear in the sub-scanning direction) is eliminated is acquired. However, this time, due to the difference in rounding error that occurs at the time of converting the number of pixels in the sub-scanning direction, there is a possibility that irregularities occur in the horizontal outline of the character (linear in the main scanning direction) in the converted image (main scanning direction). To the end (lower end) of the written vertical line. For this reason, as shown in FIG. 11, a character shape correction process in the main scanning direction is performed on an image that has been subjected to pixel number conversion in the sub-scanning direction (step S6).

主走査方向の字形補正処理は、字形補正処理部5の主走査補正部22によって行い、同処理にあたっては、図22に示すように、副走査方向の画素数変換を行った画像を主走査方向に1画素単位でスキャンし(ステップS61)、スキャンした画素(注目画素)が白画素であるか否かを判別する(ステップS62)。   The main scanning direction character shape correction process is performed by the main scanning correction unit 22 of the character shape correction processing unit 5, and in this process, as shown in FIG. In step S61, it is determined whether the scanned pixel (target pixel) is a white pixel (step S62).

判別の結果、注目画素が白画素であった場合には(ステップS62:Y)、注目画素、その左隣の画素及び上隣の画素からなる3画素の値を、図9(a)に示す端部パターンCと照合し、両者が合致するか否かを判別する(ステップS63)。そして、両者が合致した場合には、主走査補正部22のカウンタ22b(図1参照)をリセットするとともに、白画素数をカウントアップする(ステップS64、S65)。   As a result of the determination, if the target pixel is a white pixel (step S62: Y), the values of three pixels including the target pixel, the left adjacent pixel, and the upper adjacent pixel are shown in FIG. It is checked against the end pattern C to determine whether or not both match (step S63). If they match, the counter 22b (see FIG. 1) of the main scanning correction unit 22 is reset and the number of white pixels is counted up (steps S64 and S65).

次いで、スキャンした画素の右隣に位置する画素(主走査方向の次の画素)をスキャンし(ステップS66)、その画素が白画素であるか否かを判別する(ステップS67)。白画素であった場合には(ステップS67:Y)、その画素(注目画素)及び上隣の画素からなる2画素を、図9(c)に示す連続部パターンCと照合し(ステップS68)、両者が合致すれば、白画素の数をカウントアップする(ステップS69)。   Next, a pixel (next pixel in the main scanning direction) located to the right of the scanned pixel is scanned (step S66), and it is determined whether or not the pixel is a white pixel (step S67). If the pixel is a white pixel (step S67: Y), the two pixels including the pixel (target pixel) and the upper adjacent pixel are collated with the continuous pattern C shown in FIG. 9C (step S68). If they match, the number of white pixels is counted up (step S69).

一方、ステップ67において、右隣の画素が黒画素であった場合には(ステップS67:N)、その画素及び下隣の画素からなる2画素を、図9(d)に示す連続部パターンDと照合し(ステップS70)、両者が合致すれば、黒画素の数をカウントアップする(ステップS71)。   On the other hand, when the right adjacent pixel is a black pixel in step 67 (step S67: N), the continuous pixel pattern D shown in FIG. (Step S70), and if both match, the number of black pixels is counted up (step S71).

以後、連続部パターンC、Dの何れにも合致しない画素が現れるまで、ステップS66〜S71の処理を繰り返す。   Thereafter, the processes in steps S66 to S71 are repeated until a pixel that does not match any of the continuous portion patterns C and D appears.

これらに対し、ステップS62の画素種判別において、注目画素が黒画素であった場合には(ステップS62:N)、注目画素、その下隣の画素及び左隣の画素からなる3画素の値を、図9(b)に示す端部パターンDと照合する(ステップS72)。そして、両者が合致した場合には、カウンタ22bをリセットするとともに、黒画素数をカウントする(ステップS73、S74)。   On the other hand, if the pixel of interest is a black pixel in the pixel type determination in step S62 (step S62: N), the value of three pixels consisting of the pixel of interest, the pixel adjacent below and the pixel adjacent to the left is determined. 9 is collated with the end pattern D shown in FIG. 9B (step S72). If they match, the counter 22b is reset and the number of black pixels is counted (steps S73 and S74).

次いで、スキャンした画素の右隣に位置する画素をスキャンし(ステップS66)、以後、注目画素が白画素であった場合と同様にして、黒画素数をカウントアップする画素、及び白画素数をカウントアップする画素を順次検出しつつ、黒画素及び白画素の各画素数を計数する(ステップS66〜S71)。   Next, the pixel located immediately to the right of the scanned pixel is scanned (step S66), and thereafter the pixel for counting up the number of black pixels and the number of white pixels are counted in the same manner as when the target pixel is a white pixel. While sequentially detecting the pixels to be counted up, the number of black pixels and white pixels is counted (steps S66 to S71).

上記のようにして「カウント対象の横線の検出」及び「黒画素及び白画素の計数処理」を行った後は、黒画素数及び白画素数がともに「1」以上であるか否かを判別して、黒画素と白画素が混在する横線を検出する(ステップS75)。そして、検出した横線を対象として黒画素数と白画素数を対比し(ステップS76)、少ない側の画素種に属する画素の値を、多い側の画素の値に変換する(ステップS77、S78)。   After performing “detection of horizontal lines to be counted” and “counting process of black pixels and white pixels” as described above, it is determined whether or not the number of black pixels and the number of white pixels are both “1” or more. Then, a horizontal line in which black pixels and white pixels are mixed is detected (step S75). Then, the number of black pixels and the number of white pixels are compared for the detected horizontal line (step S76), and the value of the pixel belonging to the smaller pixel type is converted to the value of the larger pixel (steps S77 and S78). .

上記の処理後、入力した副走査方向の変換画像に残りの未スキャン画素が存在するか否かを判別し(ステップS79)、残りの画素があれば、未スキャン画素が存在しなくなるまでステップS61〜S79の処理を繰り返す。   After the above processing, it is determined whether or not there are remaining unscanned pixels in the input converted image in the sub-scanning direction (step S79). If there are remaining pixels, step S61 is performed until no unscanned pixels exist. The process of ~ S79 is repeated.

このように、副走査方向の画素数変換を行った後に、黒画素及び白画素が混在する横線を検出するとともに、黒画素及び白画素の画素数を比較して多い側の画素種に統一化するため、副走査方向の画素数変換によって生じる主走査方向側の凹凸を解消することができ、主走査方向側の輪郭の乱れを補正することが可能になる。   In this way, after the number of pixels in the sub-scanning direction is converted, a horizontal line in which black pixels and white pixels are mixed is detected, and the number of black and white pixels is compared and unified to a larger pixel type. Therefore, the unevenness on the main scanning direction side caused by the conversion of the number of pixels in the sub-scanning direction can be eliminated, and the disturbance of the contour on the main scanning direction side can be corrected.

また、本実施の形態では、主走査方向の変換処理を行うとともに、副走査方向の字形補正処理を行い、その後、これらの処理を済ませた画像を対象に副走査方向の変換処理を行って、最後に、主走査方向の字形補正処理を行うため、横線と縦線の相関を取りつつ、上下左右の輪郭の凹凸を解消することができる。このため、図23に示すように、横線と縦線の交差部に凹凸が生じるのを防止することができ、文字の形の乱れを回避することが可能になる。   Further, in the present embodiment, conversion processing in the main scanning direction is performed, and character shape correction processing in the sub scanning direction is performed.Subsequently, conversion processing in the sub scanning direction is performed on an image that has undergone these processes, Finally, since the shape correction processing in the main scanning direction is performed, the unevenness of the top, bottom, left, and right contours can be eliminated while correlating the horizontal and vertical lines. For this reason, as shown in FIG. 23, it is possible to prevent unevenness at the intersection of the horizontal line and the vertical line, and it is possible to avoid the disorder of the character shape.

さらに、本実施の形態では、図4及び図5に示す主走査方向及び副走査方向の変換処理にあたり、線幅変換テーブルを利用して線単位で変換処理を行うため、第1の従来技術で生じる線幅のばらつき(図26参照)や第2の従来技術で生じる輪郭のノイズを回避することが可能になる。   Furthermore, in the present embodiment, the conversion processing in the main scanning direction and the sub scanning direction shown in FIGS. 4 and 5 is performed on a line-by-line basis using the line width conversion table. It is possible to avoid the variation in the line width that occurs (see FIG. 26) and the contour noise that occurs in the second prior art.

すなわち、第1及び第2の従来技術では、補間処理を交えながら1画素ずつ順番に変換し、その過程で周辺の画素の値の影響を受け、結果的に線幅のばらつきや輪郭のノイズを招いているが、本実施の形態では、線幅変換テーブルを用いて変換線幅を取得するとともに、その変換線幅と、先端画素の変換座標とを用いて線単位で変換処理を行うため、周辺の画素の値の影響を受けることがなく、画像上のどの位置であろうとも、原画像上の線幅に対応する変換線幅が一意に定まる。   That is, in the first and second prior arts, each pixel is sequentially converted while interpolating, and in the process, it is affected by the values of surrounding pixels, resulting in line width variations and contour noise. In this embodiment, in the present embodiment, the conversion line width is acquired using the line width conversion table, and the conversion process is performed in units of lines using the conversion line width and the conversion coordinates of the tip pixel. The conversion line width corresponding to the line width on the original image is uniquely determined regardless of the position on the image without being affected by the values of surrounding pixels.

このため、図24(a)、(b)に示すように、異なる場所に位置する2本の横線101、102(又は縦線103、104)に関し、原画像上で同じ線幅(太さ)であれば、必ず両者の線幅を揃えて出力することができる(横線101’、102’(又は縦線103’、104’)を参照)。また、この場合、原画像上で直線状の線画であれば、変換後の線画も必ず直線状となるため、線画の輪郭(但し、横線であれば横方向の輪郭、縦線であれば縦方向の輪郭)に余分な凹凸が生じることがない。従って、画素数変換によって線幅にばらつきが生じたり、輪郭部分にノイズが発生するのを回避することができ、文字の形状を維持しながら変換処理を行うことが可能になる。   For this reason, as shown in FIGS. 24A and 24B, regarding the two horizontal lines 101 and 102 (or vertical lines 103 and 104) located at different locations, the same line width (thickness) on the original image. If so, the line widths of both can always be output (see horizontal lines 101 ′ and 102 ′ (or vertical lines 103 ′ and 104 ′)). In this case, if the line image is linear on the original image, the converted line image is always linear, so the outline of the line image (however, if it is a horizontal line, it is a horizontal outline, and if it is a vertical line, it is vertical. There is no extra unevenness in the direction profile. Accordingly, it is possible to avoid variations in line width due to pixel number conversion and noise in the outline portion, and conversion processing can be performed while maintaining the character shape.

以上、本発明の実施の形態を説明したが、本発明は、上記構成に限定されるものではなく、特許請求の範囲に記載された発明の範囲内で種々の変更が可能である。   The embodiment of the present invention has been described above, but the present invention is not limited to the above-described configuration, and various modifications can be made within the scope of the invention described in the claims.

例えば、上記実施の形態では、画素数変換の対象画像として、白画素群によって構成される背景上に黒画素群によって文字を形成する画像を例示したが、黒画素群によって構成される背景上に白画素群によって文字を形成する画像であっても、本発明を適用することが可能である。   For example, in the above-described embodiment, the image in which characters are formed by the black pixel group on the background configured by the white pixel group is illustrated as the target image for pixel number conversion. The present invention can also be applied to an image in which characters are formed by a white pixel group.

また、上記実施の形態では、線幅変換テーブル3cを生成するにあたり、変換線幅として、細め線幅、太め線幅及び中間線幅の三種の線幅を設けるが、これは、印刷時のドットゲイン量の変動を考慮したものであって、字形の乱れの抑制を直接の目的とするものではないため、必須のものではない。すなわち、原画像の黒像の線幅に対応する変換画像上での黒線の線幅(変換線幅)を指定するものであれば、如何なる線幅変換テーブルであってもよく、例えば、中間線幅のみの一種の線幅を有するものであってもよいし、或いは、特許文献1に記載の画素数変換方法と同様、細め線幅及び太め線幅の二種の線幅を有するものであってもよい。   In the above embodiment, when generating the line width conversion table 3c, three types of line widths, a thin line width, a thick line width, and an intermediate line width, are provided as conversion line widths. This is not essential because it takes into account fluctuations in the amount of gain and does not directly control the distortion of the character shape. That is, any line width conversion table may be used as long as it specifies the black line width (converted line width) on the converted image corresponding to the black image line width of the original image. It may have a kind of line width of only the line width, or it may have two kinds of line widths, a thin line width and a thick line width, as in the pixel number conversion method described in Patent Document 1. There may be.

さらに、上記実施の形態では、主走査方向の変換処理→副走査方向の字形補正処理→副走査方向の変換処理→主走査方向の字形補正処理の順序で処理を進めているが、副走査方向の変換処理→主走査方向の字形補正処理→主走査方向の変換処理→副走査方向の字形補正処理の順序で処理を進めてもよい。この場合、主走査方向の変換処理は、副走査方向の変換処理及び主走査方向の字形補正処理を施した画像を対象に行うことになる。   Further, in the above embodiment, the processing proceeds in the order of conversion processing in the main scanning direction → character shape correction processing in the sub scanning direction → conversion processing in the sub scanning direction → character shape correction processing in the main scanning direction. The processing may proceed in the order of: conversion processing in the main scanning direction → character shape correction processing in the main scanning direction → conversion processing in the main scanning direction → character shape correction processing in the sub scanning direction. In this case, the conversion process in the main scanning direction is performed on an image subjected to the conversion process in the sub-scanning direction and the character shape correction process in the main scanning direction.

1 画素数変換装置
2 メモリ
3 線幅変換テーブル作成部
3a 変換倍率算出部
3b テーブル作成部
3c 線幅変換テーブル
4 画素数変換処理部
5 字形補正処理部
11 主走査変換部
11a 横線検出部
11b 先端座標検出部
11c 黒線長検出部
11d 変換先端座標算出部
11e 線幅取得部
11f 線単位変換部
12 副走査変換部
12a 縦線検出部
12b 先端座標検出部
12c 黒線長検出部
12d 変換先端座標算出部
12e 線幅取得部
12f 線単位変換部
21 副走査補正部
21a 凹凸縦線検出部
21b カウンタ
21c 線形補正部
22 主走査補正部
22a 凹凸横線検出部
22b カウンタ
22c 線形補正部
30 原画像
31 変換画像
40 原画像
41 横線
42 先端画素
43 主走査方向の変換画像
44 横線
45、46 横線
47 縦線
48 先端画素
49 主走査及び副走査方向の変換画像
49a 凹凸横線
50 縦線
51(51a〜51j) 画素
52 縦線
55 副走査方向の字形補正処理画像
56 縦線
57 横線
60 原画像
61、62 横線
63 変換画像
64 領域
71(71a〜71k) 画素
72(72a、72b) 画素
73(73a、73b) 画素
74 画素
81(81a、81b) 画素
83、84 縦線
85 縦線
86(86a〜86c) 画素
101、102 原画像の横線
101’、102’ 変換後の横線
103、104 原画像の縦線
103’、104’ 変換後の縦線
DESCRIPTION OF SYMBOLS 1 Pixel number conversion apparatus 2 Memory 3 Line width conversion table preparation part 3a Conversion magnification calculation part 3b Table preparation part 3c Line width conversion table 4 Pixel number conversion process part 5 Character form correction process part 11 Main scanning conversion part 11a Horizontal line detection part 11b Tip Coordinate detection unit 11c Black line length detection unit 11d Conversion tip coordinate calculation unit 11e Line width acquisition unit 11f Line unit conversion unit 12 Sub-scanning conversion unit 12a Vertical line detection unit 12b Tip coordinate detection unit 12c Black line length detection unit 12d Conversion tip coordinate Calculation unit 12e Line width acquisition unit 12f Line unit conversion unit 21 Sub-scanning correction unit 21a Uneven vertical line detection unit 21b Counter 21c Linear correction unit 22 Main scanning correction unit 22a Uneven horizontal line detection unit 22b Counter 22c Linear correction unit 30 Original image 31 Conversion Image 40 Original image 41 Horizontal line 42 Tip pixel 43 Converted image 44 in the main scanning direction Horizontal line 45, 46 Horizontal line 47 Vertical line 48 Tip Pixel 49 Converted image 49a in main scanning and sub-scanning direction Uneven horizontal line 50 Vertical line 51 (51a to 51j) Pixel 52 Vertical line 55 Character correction processing image 56 in sub-scanning direction Vertical line 57 Horizontal line 60 Original image 61, 62 Horizontal line 63 Conversion Image 64 Area 71 (71a-71k) Pixel 72 (72a, 72b) Pixel 73 (73a, 73b) Pixel 74 Pixel 81 (81a, 81b) Pixel 83, 84 Vertical line 85 Vertical line 86 (86a-86c) Pixel 101, 102 Horizontal lines 101 ′ and 102 ′ of the original image Horizontal lines 103 and 104 after the conversion Vertical lines 103 ′ and 104 ′ of the original image Vertical lines after the conversion

Claims (5)

2値原画像の画素数を変換して2値変換画像を生成する画素数変換方法であって、
変換倍率に基づいて、前記2値原画像の線画像の線幅に対応する前記2値変換画像上での変換線幅を指定する線幅変換テーブルを作成する第1のステップと、
前記2値原画像を対象とし、主走査方向又は副走査方向の一方に延在する線画像の先端画素の座標を検出するとともに、該線画像の長さを検出する第2のステップと、
前記検出した座標に対応する変換画像上での変換座標を算出するとともに、前記線幅変換テーブルを用いて前記検出した線画像の長さに対応する変換線幅を取得する第3のステップと、
前記算出した座標を始点とし、主走査方向又は副走査方向の一方に延び、前記取得した変換線幅の長さを有する線画像を変換画像上に作成する第4のステップと、
該第4のステップで作成した変換画像を主走査方向又は副走査方向の他方にスキャンし、該主走査方向又は副走査方向の他方に延びるとともに、黒画素及び白画素が混在する線画像を検出する第5のステップと、
該第5のステップで検出した黒画素及び白画素が混在する線画像を対象とし、黒画素の数と白画素の数とを対比し、少ない側に属する画素の値を多い側の値に変換する第6のステップとを備え
前記第5のステップは、前記スキャンした注目画素及び該注目画素に隣接する周辺画素によって形成される画素パターンと、前記注目画素が前記黒画素及び白画素が混在する線画像の開始点であることを示す所定の端部パターン、及び/又は該線画像の開始点以外の部分であることを示す所定の連続部パターンとを比較し、前記画素パターンと前記端部パターン又は前記連続部パターンとが合致するか否かに応じて前記黒画素及び白画素が混在する線画像を検出することを特徴とする画素数変換方法。
A pixel number conversion method for generating a binary converted image by converting the number of pixels of a binary original image,
A first step of creating a line width conversion table for specifying a conversion line width on the binary conversion image corresponding to a line width of the line image of the binary original image based on a conversion magnification;
A second step of detecting the coordinates of the leading end pixel of the line image extending in one of the main scanning direction or the sub-scanning direction with respect to the binary original image, and detecting the length of the line image;
A third step of calculating conversion coordinates on the conversion image corresponding to the detected coordinates, and acquiring a conversion line width corresponding to the length of the detected line image using the line width conversion table;
A fourth step of creating, on the converted image, a line image having the calculated conversion line width and extending in one of the main scanning direction or the sub-scanning direction with the calculated coordinates as a starting point;
The converted image created in the fourth step is scanned in the other of the main scanning direction or the sub-scanning direction, and a line image extending in the other of the main scanning direction or the sub-scanning direction and mixed with black and white pixels is detected A fifth step to:
For the line image in which black pixels and white pixels detected in the fifth step are mixed, the number of black pixels is compared with the number of white pixels, and the value of the pixel belonging to the smaller side is converted to the value of the larger side. and a sixth step of,
In the fifth step, a pixel pattern formed by the scanned target pixel and peripheral pixels adjacent to the target pixel, and the target pixel is a starting point of a line image in which the black pixel and white pixel are mixed. The pixel pattern and the end pattern or the continuous part pattern are compared with a predetermined end pattern indicating the above and / or a predetermined continuous part pattern indicating a part other than the starting point of the line image. converting the number of pixels and wherein that you detect a line image in which the black pixels and white pixels are mixed depending on whether matching.
前記第6のステップで作成した変換画像を対象とし、主走査方向又は副走査方向の他方に延在する第2の線画像の先端画素の座標を検出するとともに、該第2の線画像の長さを検出する第7のステップと、
前記検出した第2の線画像の先端画素の座標に対応する変換画像上での変換座標を算出するとともに、前記線幅変換テーブルを用いて前記検出した第2の線画像の長さに対応する変換線幅を取得する第8のステップと、
該第8のステップで算出した座標を始点とし、主走査方向又は副走査方向の他方に延び、該第8のステップで取得した変換線幅の長さを有する線画像を変換画像上に作成する第9のステップと、
該第9のステップで作成した変換画像を主走査方向又は副走査方向の一方にスキャンし、該主走査方向又は副走査方向の一方に延びるとともに、黒画素及び白画素が混在する線画像を検出する第10のステップと、
該第10のステップで検出した黒画素及び白画素が混在する線画像を対象とし、黒画素の数と白画素の数とを対比し、少ない側に属する画素の値を多い側の値に変換する第11のステップとを備え
前記第10のステップは、前記スキャンした注目画素及び該注目画素に隣接する周辺画素によって形成される画素パターンと、所定の端部パターン及び/又は連続部パターンとを比較し、前記画素パターンと前記端部パターン又は前記連続部パターンとが合致するか否かに応じて前記黒画素及び白画素が混在する線画像を検出することを特徴とする請求項に記載の画素数変換方法。
Targeting the converted image created in the sixth step, the coordinates of the leading end pixel of the second line image extending in the other of the main scanning direction or the sub-scanning direction are detected, and the length of the second line image is detected. A seventh step of detecting the thickness;
The conversion coordinates on the conversion image corresponding to the coordinates of the leading end pixel of the detected second line image are calculated, and the length of the detected second line image is corresponded using the line width conversion table. An eighth step of obtaining a conversion line width;
A line image having the length of the converted line width obtained in the eighth step is created on the converted image, starting from the coordinates calculated in the eighth step and extending in the other of the main scanning direction or the sub-scanning direction. A ninth step;
The converted image created in the ninth step is scanned in either the main scanning direction or the sub-scanning direction, and a line image that extends in one of the main scanning direction or the sub-scanning direction and contains black pixels and white pixels is detected. A tenth step,
For the line image in which black pixels and white pixels detected in the tenth step are mixed, the number of black pixels is compared with the number of white pixels, and the value of the pixel belonging to the smaller side is converted to the value of the larger side. and a eleventh step of,
The tenth step compares a pixel pattern formed by the scanned target pixel and peripheral pixels adjacent to the target pixel with a predetermined end pattern and / or continuous pattern, and the pixel pattern and the pixel conversion method according to claim 1, wherein the black pixels and white pixels, characterized that you detect line images mixed depending on whether or not the end pattern or the continuous part pattern matching.
前記第5のステップ又は前記第10のステップは、In the fifth step or the tenth step,
前記スキャンの走査方向が副走査方向であり、前記注目画素が白画素である場合に、該注目画素と、該注目画素の上隣に位置する白画素と、該注目画素の左隣に位置する黒画素とからなる第1の端部パターン、及び/又は前記注目画素と、該注目画素の左隣に位置する黒画素とからなる第1の連続部パターンのうちいずれかのパターンと前記画素パターンとを比較し、When the scanning direction of the scan is a sub-scanning direction and the target pixel is a white pixel, the target pixel, a white pixel located above the target pixel, and a left side of the target pixel Any one of the first end pattern composed of black pixels and / or the pixel of interest and the first continuous portion pattern composed of the pixel of interest and the black pixel located on the left of the pixel of interest And compare
前記スキャンの走査方向が副走査方向であり、前記注目画素が黒画素である場合に、該注目画素と、該注目画素の上隣に位置する白画素と、該注目画素の右隣に位置する白画素とからなる第2の端部パターン、及び/又は前記注目画素と、該注目画素の右隣に位置する白画素とからなる第2の連続部パターンのうちいずれかのパターンと前記画素パターンとを比較し、When the scanning direction of the scan is the sub-scanning direction and the target pixel is a black pixel, the target pixel, a white pixel positioned above the target pixel, and a right side of the target pixel Any one of the second end pattern composed of white pixels and / or the second pixel of the second continuous pattern composed of the pixel of interest and a white pixel located right next to the pixel of interest and the pixel pattern And compare
前記スキャンの走査方向が主走査方向であり、前記注目画素が白画素である場合に、該注目画素と、該注目画素の左隣に位置する白画素と、該注目画素の上隣に位置する黒画素とからなる第3の端部パターン、及び/又は前記注目画素と、該注目画素の上隣に位置する黒画素とからなる第3の連続部パターンのうちいずれかのパターンと前記画素パターンとを比較し、When the scanning direction of the scan is the main scanning direction and the target pixel is a white pixel, the target pixel, a white pixel located to the left of the target pixel, and an upper side of the target pixel Any one of a third end pattern composed of black pixels and / or a third continuous portion pattern composed of the pixel of interest and a black pixel located adjacent to the pixel of interest and the pixel pattern And compare
前記スキャンの走査方向が主走査方向であり、前記注目画素が黒画素である場合に、該注目画素と、該注目画素の左隣に位置する白画素と、該注目画素の下隣に位置する白画素とからなる第4の端部パターン、及び/又は前記注目画素と、該注目画素の下隣に位置する白画素とからなる第4の連続部パターンのうちいずれかのパターンと前記画素パターンとを比較することを特徴とする請求項1又は2に記載の画素数変換方法。When the scanning direction of the scan is the main scanning direction and the target pixel is a black pixel, the target pixel, a white pixel located on the left side of the target pixel, and a lower side next to the target pixel Any one of a fourth end pattern composed of white pixels and / or a fourth continuous portion pattern composed of the target pixel and a white pixel located immediately below the target pixel and the pixel pattern The pixel number conversion method according to claim 1 or 2, characterized in that
2値原画像の画素数を変換して2値変換画像を生成する画素数変換方法コンピュータ装置に実行させるためのプログラムであって、
請求項1、2又は3に記載の画素数変換方法をコンピュータ装置に実行させることを特徴とするプログラム。
2 NeHara pixel number conversion method for generating a binary converted image by converting the number of pixels of the image to be because of a program is executed by a computer device,
A program for causing a computer device to execute the pixel number conversion method according to claim 1, 2 or 3.
2値原画像の画素数を変換して2値変換画像を生成する画素数変換装置であって、
変換倍率に基づいて、前記2値原画像の線画像の線幅に対応する前記2値変換画像上での変換線幅を指定する線幅変換テーブルを作成する線幅変換テーブル作成部と、
前記線幅変換テーブルを用いて前記2値原画像中に存在する線画像の線幅を変更し、前記2値変換画像を生成する変換処理部と、
該変換処理部によって生成した画像に字形補正処理を施す字形補正部とを備え、
前記変換処理部は、
前記2値原画像を対象とし、主走査方向又は副走査方向の一方に延在する線画像の先端画素の座標を検出するとともに、該線画像の長さを検出する検出部と、
該検出部によって検出した座標に対応する変換画像上での変換座標を算出する変換先端座標算出部と、
前記線幅変換テーブルを用いて前記検出部によって検出した線画像の長さに対応する変換線幅を取得する線幅取得部と、
前記先端座標算出部によって算出した座標を始点とし、主走査方向又は副走査方向の一方に延び、前記線幅取得部によって取得した変換線幅の長さを有する線画像を変換画像上に作成する線単位変換部とを備え、
前記字形補正部は、
前記変換処理部で作成した変換画像を主走査方向又は副走査方向の他方にスキャンし、該主走査方向又は副走査方向の他方に延びるとともに、黒画素及び白画素が混在する線画像を検出する凹凸線画検出部と、
該凹凸線画検出部で検出した線画像を対象とし、黒画素の数と白画素の数とを対比し、少ない側に属する画素の値を多い側の値に変換する補正部とを備え
前記凹凸線画検出部は、前記スキャンした注目画素及び該注目画素に隣接する周辺画素によって形成される画素パターンと、前記注目画素が前記黒画素及び白画素が混在する線画像の開始点であることを示す所定の端部パターン、及び/又は該線画像の開始点以外の部分であることを示す所定の連続部パターンとを比較し、前記画素パターンと前記端部パターン又は前記連続部パターンとが合致するか否かに応じて前記黒画素及び白画素が混在する線画像を検出することを特徴とする画素数変換装置。
A pixel number conversion device that converts the number of pixels of a binary original image to generate a binary converted image,
A line width conversion table creating unit for creating a line width conversion table for designating a conversion line width on the binary conversion image corresponding to the line width of the line image of the binary original image based on the conversion magnification;
A conversion processing unit that changes a line width of a line image existing in the binary original image using the line width conversion table, and generates the binary converted image;
A character shape correction unit that performs character shape correction processing on the image generated by the conversion processing unit,
The conversion processing unit
A detection unit for detecting the coordinates of the leading end pixel of the line image extending in one of the main scanning direction or the sub-scanning direction for the binary original image, and detecting the length of the line image;
A conversion tip coordinate calculation unit that calculates conversion coordinates on a conversion image corresponding to the coordinates detected by the detection unit;
A line width acquisition unit that acquires a conversion line width corresponding to the length of the line image detected by the detection unit using the line width conversion table;
A line image having the length of the conversion line width acquired by the line width acquisition unit and extending in one of the main scanning direction and the sub-scanning direction is created on the conversion image, starting from the coordinates calculated by the tip coordinate calculation unit. A line unit conversion unit,
The character shape correction unit is
The converted image created by the conversion processing unit is scanned in the other of the main scanning direction or the sub-scanning direction, and a line image in which black pixels and white pixels are mixed is detected while extending in the other of the main scanning direction or the sub-scanning direction. An uneven line image detection unit;
The line image detected by the concavo-convex line drawing detection unit, and a correction unit that compares the number of black pixels and the number of white pixels and converts the value of the pixels belonging to the smaller side to the value of the larger side ,
The concavo-convex line drawing detection unit is a pixel pattern formed by the scanned target pixel and peripheral pixels adjacent to the target pixel, and the target pixel is a starting point of a line image in which the black pixel and white pixel are mixed. The pixel pattern and the end pattern or the continuous part pattern are compared with a predetermined end pattern indicating the above and / or a predetermined continuous part pattern indicating a part other than the starting point of the line image. matching whether the pixel number conversion apparatus characterized that you detect a line image in which the black pixels and white pixels are mixed in accordance with the.
JP2010240490A 2010-10-27 2010-10-27 Pixel number conversion method, program for executing the same, and pixel number conversion device Active JP5679284B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010240490A JP5679284B2 (en) 2010-10-27 2010-10-27 Pixel number conversion method, program for executing the same, and pixel number conversion device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010240490A JP5679284B2 (en) 2010-10-27 2010-10-27 Pixel number conversion method, program for executing the same, and pixel number conversion device

Publications (2)

Publication Number Publication Date
JP2012095079A JP2012095079A (en) 2012-05-17
JP5679284B2 true JP5679284B2 (en) 2015-03-04

Family

ID=46387953

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010240490A Active JP5679284B2 (en) 2010-10-27 2010-10-27 Pixel number conversion method, program for executing the same, and pixel number conversion device

Country Status (1)

Country Link
JP (1) JP5679284B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105374056B (en) * 2014-08-29 2017-12-05 中国石油天然气股份有限公司 A kind of CGM forms map treating method and apparatus

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2748486B2 (en) * 1989-01-13 1998-05-06 松下電器産業株式会社 Character pattern scaling device
JPH08139915A (en) * 1994-11-15 1996-05-31 Hitachi Ltd Multi-color image magnification and reduction device
JP4507279B2 (en) * 2005-07-26 2010-07-21 富士ゼロックス株式会社 Image processing apparatus, image processing method, and program thereof
JP2007265055A (en) * 2006-03-29 2007-10-11 Nec Engineering Ltd Resolution conversion processing method of binary image

Also Published As

Publication number Publication date
JP2012095079A (en) 2012-05-17

Similar Documents

Publication Publication Date Title
JP2006191487A (en) Threshold matrix generation method and device, and recording medium
JP2007106097A (en) High-image-quality halftone process
JP6175914B2 (en) Printing apparatus, printing method, and image processing apparatus
US9036219B2 (en) Image processing device and image processing method for preventing image quality deterioration
JP5679284B2 (en) Pixel number conversion method, program for executing the same, and pixel number conversion device
JP4089862B2 (en) Image forming apparatus, image forming method, and recording medium
JP4392082B2 (en) Engraving style halftone image generation method and apparatus
JP4479663B2 (en) Image processing apparatus, image processing method, and image processing program for halftone processing using fixed cells
US6687021B1 (en) Method for digitally rasterizing half-tone images with rasters of any width and angle
JP5601577B2 (en) Pixel number conversion method, program for executing the same, and pixel number conversion device
TWI395466B (en) Method for auto-cropping image
JP4108517B2 (en) Halftoning processing method and halftoning processing system
JP4108262B2 (en) Image processing method and image processing apparatus
JP7242272B2 (en) Dither matrix generation device, generation method, image processing device using dither matrix, image processing method, and program
US20090074321A1 (en) Image processing apparatus and image processing method
JP4422128B2 (en) Method for correcting gradation of binary image
JP6388337B2 (en) Image conversion processing method, program for executing the same, and image conversion processing apparatus
JP3087845B2 (en) Digital image processing method for reading an original image with a scanner and enlarging and printing
JP4002032B2 (en) Facsimile apparatus and image adjustment method
JP2018148316A (en) Control unit for causing printing execution unit to execute printing
JP3951953B2 (en) Printing apparatus, image processing apparatus, printing method, image processing method, and program
JP4517288B2 (en) Image processing apparatus, image processing method, and program thereof
JP4743899B2 (en) Gradation correction processing method, program for executing the same, and gradation correction processing apparatus
JP6108218B2 (en) Image conversion processing method, program for executing the same, and image conversion processing apparatus
JP2022055982A (en) Reading device and image data processing method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130708

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140624

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140715

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140903

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20141209

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20141225

R150 Certificate of patent or registration of utility model

Ref document number: 5679284

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313114

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250