JP2013034181A - Image processing apparatus and image processing method - Google Patents

Image processing apparatus and image processing method Download PDF

Info

Publication number
JP2013034181A
JP2013034181A JP2012132699A JP2012132699A JP2013034181A JP 2013034181 A JP2013034181 A JP 2013034181A JP 2012132699 A JP2012132699 A JP 2012132699A JP 2012132699 A JP2012132699 A JP 2012132699A JP 2013034181 A JP2013034181 A JP 2013034181A
Authority
JP
Japan
Prior art keywords
pixel
thinning
pixel value
edge direction
target pixel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2012132699A
Other languages
Japanese (ja)
Other versions
JP6003260B2 (en
Inventor
Koji Washio
宏司 鷲尾
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.)
Konica Minolta Business Technologies Inc
Original Assignee
Konica Minolta Business Technologies Inc
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 Konica Minolta Business Technologies Inc filed Critical Konica Minolta Business Technologies Inc
Priority to JP2012132699A priority Critical patent/JP6003260B2/en
Publication of JP2013034181A publication Critical patent/JP2013034181A/en
Application granted granted Critical
Publication of JP6003260B2 publication Critical patent/JP6003260B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration by the use of local operators
    • G06T5/70
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20004Adaptive image processing
    • G06T2207/20012Locally adaptive
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20172Image enhancement details
    • G06T2207/20192Edge enhancement; Edge preservation

Abstract

PROBLEM TO BE SOLVED: To prevent degradation of image quality due to isolation of a thinned pixel.SOLUTION: An image processing apparatus 1 comprises a blending processing unit 5 which determines a pixel value G of a target pixel of when a smoothing processing and a thinning processing are realized at the same time depending on a combination of whether the thinning processing is performed or not and whether the smoothing processing is performed or not on the target pixel, and a thinning adjustment unit 6 which determines whether a thinned pixel becomes isolated by change amounts dST in pixel value due to the thinning processing of the target pixel and the surrounding pixel, the thinning adjustment unit resetting the change amount dST in pixel value due to the thinning processing of the thinned pixel among the target pixel and the surrounding pixel adjacent to the target pixel in the edge direction or in an opposite-edge direction to a value of zero if the thinned pixel is determined to be isolated. The blending processing unit 5 uses the reset change amount dST in pixel value due to the thinning processing to determine the pixel value G of the target pixel.

Description

本発明は、画像処理装置及び画像処理方法に関する。   The present invention relates to an image processing apparatus and an image processing method.

画像処理の1つとして細線化処理が知られている。細線化処理は文字等のエッジを対象として画素値を減じることにより、文字等の鮮鋭性を向上させる。
エッジを対象とする画像処理にはスムージング処理もある。スムージング処理は文字等の斜線部分のエッジの画素値を増減して中間調とすることにより、斜線部分のエッジを視覚的に滑らかにすることができる。
Thinning processing is known as one of image processing. In the thinning process, the sharpness of a character or the like is improved by reducing the pixel value for the edge of the character or the like.
Image processing that targets edges also includes smoothing processing. In the smoothing process, the edge value of the shaded portion can be visually smoothed by increasing / decreasing the pixel value of the edge of the shaded portion of the character or the like to obtain a halftone.

細線化処理とスムージング処理は同じエッジを対象とするが、処理の目的が異なるため、2つの処理を同時に行うことは困難であった。例えば、文字の直線部分で細線化、斜線部分でスムージングが行われると、シャープで滑らかな文字が得られるが、直線部分と斜線部分の構造を検出し、検出された構造によって細線化処理とスムージング処理を切り替えるような方法(例えば、特許文献1参照)ではそのような文字の実現は難しい。これは、直線部分と斜線部分の双方に属する画素があるためであり、本来スムージングではなく細線化が適当であったのにスムージングによって画素値が増加される等、予期しない結果が生じる。   Although the thinning process and the smoothing process target the same edge, it is difficult to perform the two processes simultaneously because the purposes of the processes are different. For example, if thinning is applied to the straight line part of the character and smoothing is applied to the hatched part, a sharp and smooth character is obtained. However, the structure of the straight line part and the oblique line part is detected, and the thinning process and smoothing are performed according to the detected structure. Such a character is difficult to realize by a method of switching processing (see, for example, Patent Document 1). This is because there are pixels belonging to both the straight line portion and the shaded portion, and an unexpected result occurs, for example, a pixel value is increased by smoothing although thinning is appropriate instead of smoothing.

これに対し、出願人は細線化処理とスムージング処理を同時に実現する画像処理装置を開発している(例えば、特許文献2参照)。この画像処理装置によれば、スムージング処理と細線化処理の結果が、元の画素値からの変化量として保持される。保持された変化量が元の画素値に加算されたときの画素値が最大値を超えたり、負の値になったりする場合、その超えた分や不足する分が注目画素と所定の位置関係にある隣接画素の画素値によって調整される。細線化処理とスムージング処理の処理結果を、注目画素だけではなくその隣接画素との2画素分で調整することにより、2つの処理結果を無理なく消化できる。   On the other hand, the applicant has developed an image processing apparatus that simultaneously realizes a thinning process and a smoothing process (see, for example, Patent Document 2). According to this image processing apparatus, the result of the smoothing process and the thinning process is held as a change amount from the original pixel value. If the pixel value when the retained change amount is added to the original pixel value exceeds the maximum value or becomes a negative value, the excess or insufficiency is the predetermined positional relationship with the target pixel. It is adjusted according to the pixel value of the adjacent pixel. By adjusting the processing results of the thinning process and the smoothing process for not only the pixel of interest but also two adjacent pixels, the two processing results can be easily digested.

特開平7−334672号公報JP-A-7-334672 特許第4225337号公報Japanese Patent No. 4225337

もともと線幅の小さい細線が細線化処理された場合、細線の両側とも細線化されるため、細線がかすれたり消えたりする場合がある。例えば、2画素幅の細線の場合、細線化によって両側から画素値が減じられると、細線自体が消失してしまう。このような細線構造の消失を防ぐため、従来、細線化処理時には細線構造を判定し、細線化の対象から除外することが行われている。   Originally, when a thin line with a small line width is thinned, since both sides of the thin line are thinned, the thin line may fade or disappear. For example, in the case of a thin line with a width of 2 pixels, if the pixel value is reduced from both sides by thinning, the thin line itself disappears. In order to prevent the disappearance of such a thin line structure, conventionally, the thin line structure is determined during the thinning process and excluded from the thinning target.

しかしながら、このような細線構造の除外が意図しない結果を招くことがある。例えば、画像データが非可逆圧縮された場合、伸張によって完全に元の画像データが復元されるとは限らず、文字等は部分的に画質が劣化する場合がある。例えば、輪郭が滑らかに復元されず、細く尖ることがある。尖った部分は細線化処理時に細線構造と判定され、その部分だけが細線化が無効化される。同じ文字の中で細線化されない部分と細線化される部分があるため、文字の線幅がアンバランスになる。   However, the exclusion of such a thin line structure may cause unintended results. For example, when image data is irreversibly compressed, the original image data is not completely restored by decompression, and characters and the like may partially deteriorate in image quality. For example, the outline may not be restored smoothly and may be sharply pointed. A sharp portion is determined to be a thin line structure during thinning processing, and thinning is invalidated only for that portion. Since there are a portion that is not thinned and a portion that is thinned in the same character, the line width of the character is unbalanced.

また、水平に近い斜線は長い水平線が階段状に並ぶ構造を有するが、段差部分では一時的に線幅が大きくなるため、水平線は細線化の対象外であるのに段差部分のみ細線化されるという現象が生じる。細線化されない水平線の画素が多数あるのに対し細線化された段差部分はせいぜい1、2画素であるため、細線化された部分が孤立した状態となる。このような孤立した細線化部分を持つ画像に対し、細線化処理とスムージング処理が同時に行われると、当該細線化部分のみ過剰に画素値が減じられ、細線化もスムージングも実現できず、画質が劣化する。   In addition, the oblique lines close to the horizontal have a structure in which long horizontal lines are arranged in a staircase pattern. However, since the line width temporarily increases in the stepped portion, only the stepped portion is thinned although the horizontal line is not subject to thinning. The phenomenon that occurs. While there are many horizontal line pixels that are not thinned, the thinned stepped portion is 1 or 2 pixels at most, so the thinned portion is isolated. If the thinning process and the smoothing process are simultaneously performed on an image having such an isolated thinned portion, the pixel value is excessively reduced only in the thinned portion, and neither thinning nor smoothing can be realized, and the image quality is improved. to degrade.

本発明の課題は、細線化された画素の孤立による画質劣化を防ぐことである。   An object of the present invention is to prevent image quality deterioration due to isolation of thinned pixels.

請求項1に記載の発明によれば、
画像データに細線化処理を施す細線化処理部と、
画像データにスムージング処理を施すスムージング処理部と、
画像データの各画素についてエッジ方向を判定するエッジ方向判定部と、
注目画素、注目画素の周辺画素の各画素値、前記スムージング処理による画素値の変化量、前記細線化処理による画素値の変化量、注目画素について判定された前記エッジ方向を用い、前記注目画素における細線化の有無、スムージングの有無の組み合わせに応じて、前記スムージング処理と前記細線化処理が同時に実現されたときの前記注目画素の画素値を決定するブレンド処理部と、
前記注目画素及びその周辺画素の前記細線化処理による画素値の変化量により、細線化された画素が孤立するか否かを判定し、孤立すると判定された場合、注目画素又は注目画素のエッジ方向又は逆エッジ方向に隣接する周辺画素のうち、細線化された画素の前記細線化処理による画素値の変化量を0の値にリセットする細線化調整部と、を備え、
前記ブレンド処理部は、前記注目画素の画素値の決定に、リセットされた前記細線化処理による画素値の変化量を用いる画像処理装置が提供される。
According to the invention of claim 1,
A thinning processing unit for thinning the image data;
A smoothing processing unit for performing a smoothing process on the image data;
An edge direction determination unit that determines an edge direction for each pixel of the image data;
Using the pixel value of the target pixel, each pixel value of the peripheral pixel of the target pixel, the amount of change of the pixel value by the smoothing process, the amount of change of the pixel value by the thinning process, and the edge direction determined for the target pixel, The blending processing unit that determines the pixel value of the target pixel when the smoothing processing and the thinning processing are realized at the same time according to the combination of the presence or absence of thinning and the presence or absence of smoothing;
It is determined whether or not the thinned pixel is isolated based on the amount of change in the pixel value of the target pixel and its surrounding pixels by the thinning process. If it is determined that the pixel is isolated, the target pixel or the edge direction of the target pixel Or a thinning adjustment unit that resets a change amount of a pixel value due to the thinning process of a thinned pixel among neighboring pixels adjacent in the reverse edge direction to a value of 0,
The blend processing unit is provided with an image processing apparatus that uses a pixel value change amount by the thinning process that has been reset to determine a pixel value of the target pixel.

請求項2に記載の発明によれば、
前記細線化調整部は、細線化された画素が注目画素のエッジ方向又は逆エッジ方向に隣接する周辺画素である場合、注目画素が細線化されていることを条件に当該周辺画素の細線化処理による画素値の変化量を0の値にリセットする請求項1に記載の画像処理装置が提供される。
According to invention of Claim 2,
When the thinned pixel is a peripheral pixel adjacent in the edge direction or the reverse edge direction of the target pixel, the thinning adjustment unit thins the peripheral pixel on the condition that the target pixel is thinned. The image processing apparatus according to claim 1, wherein the change amount of the pixel value due to is reset to a value of 0.

請求項3に記載の発明によれば、
前記細線化調整部は、前記ブレンド処理部が前記注目画素の前記細線化処理による画素値の変化量及び前記スムージング処理による画素値の変化量によって、前記注目画素における細線化の有無、スムージングの有無の組み合わせを分類した後、前記リセットを行う請求項1又は2に記載の画像処理装置が提供される。
According to invention of Claim 3,
The thinning adjustment unit is configured so that the blending processing unit determines whether the pixel of interest has thinning or smoothing according to the amount of change in the pixel value of the pixel of interest by the thinning processing and the amount of change of the pixel value by the smoothing processing. The image processing apparatus according to claim 1, wherein the reset is performed after classifying the combinations.

請求項4に記載の発明によれば、
前記細線化調整部による前記リセットを実行するか否かを切り替える制御部を備える請求項1〜3の何れか一項に記載の画像処理装置が提供される。
According to invention of Claim 4,
The image processing apparatus as described in any one of Claims 1-3 provided with the control part which switches whether the said reset by the said thinning adjustment part is performed.

請求項5に記載の発明によれば、
画像データに細線化処理を施す工程と、
画像データにスムージング処理を施す工程と、
画像データの各画素についてエッジ方向を判定する工程と、
注目画素、注目画素の周辺画素の各画素値、前記スムージング処理による画素値の変化量、前記細線化処理による画素値の変化量、注目画素について判定された前記エッジ方向を用い、前記注目画素における細線化の有無、スムージングの有無の組み合わせに応じて、前記スムージング処理と前記細線化処理が同時に実現されたときの前記注目画素の画素値を決定する工程と、
前記注目画素及びその周辺画素の前記細線化処理による画素値の変化量により、細線化された画素が孤立するか否かを判定し、孤立すると判定された場合、注目画素又は注目画素のエッジ方向又は逆エッジ方向に隣接する周辺画素のうち、細線化された画素の前記細線化処理による画素値の変化量を0の値にリセットする工程と、を含み、
前記注目画素の画素値を決定する工程は、リセットされた前記細線化処理による画素値の変化量を用いて前記注目画素の画素値を決定する画像処理方法が提供される。
According to the invention of claim 5,
A process of thinning the image data;
Applying a smoothing process to the image data;
Determining an edge direction for each pixel of the image data;
Using the pixel value of the target pixel, each pixel value of the peripheral pixel of the target pixel, the amount of change of the pixel value by the smoothing process, the amount of change of the pixel value by the thinning process, and the edge direction determined for the target pixel, The step of determining the pixel value of the pixel of interest when the smoothing process and the thinning process are realized simultaneously according to the combination of the presence or absence of thinning and the presence or absence of smoothing;
It is determined whether or not the thinned pixel is isolated based on the amount of change in the pixel value of the target pixel and its surrounding pixels by the thinning process. If it is determined that the pixel is isolated, the target pixel or the edge direction of the target pixel Or resetting the amount of change in the pixel value due to the thinning process of the thinned pixel among neighboring pixels adjacent in the reverse edge direction to a value of 0,
The step of determining the pixel value of the pixel of interest is provided with an image processing method for determining the pixel value of the pixel of interest using the reset amount of the pixel value caused by the thinning process that has been reset.

本発明によれば、細線化処理とスムージング処理が同時に実現されたときの画素値の決定時、孤立する細線化された画素の細線化を無効化することができる。細線化の無効化により、当該細線化によって生じる画質の劣化を防ぐことができる。   According to the present invention, when the pixel value is determined when the thinning process and the smoothing process are realized simultaneously, it is possible to invalidate the thinning of the isolated thinned pixel. By disabling thinning, it is possible to prevent deterioration in image quality caused by the thinning.

本実施の形態に係る画像処理装置の構成図である。It is a block diagram of the image processing apparatus which concerns on this Embodiment. 7×7画素の領域を示す図である。It is a figure which shows the area | region of 7x7 pixel. スムージング処理部の構成図である。It is a block diagram of a smoothing process part. スムージングすべきエッジのパターン検出に用いられるテンプレートの一例である。It is an example of the template used for the pattern detection of the edge which should be smoothed. 細線化処理部の構成図である。It is a block diagram of a thinning process part. エッジ方向の判定例である。It is an example of determination of an edge direction. エッジ方向の判定例である。It is an example of determination of an edge direction. エッジ方向の判定例である。It is an example of determination of an edge direction. ブレンド処理部の構成図である。It is a block diagram of a blend process part. 分類部が行う処理のフローチャートである。It is a flowchart of the process which a classification | category part performs. ケース1の場合に画素値決定部が行う処理のフローチャートである。5 is a flowchart of processing performed by a pixel value determination unit in case 1; (a)、(b)はケース1の場合に想定される注目画素と周辺画素の位置関係を示す図である。(A), (b) is a figure which shows the positional relationship of the attention pixel assumed in the case of case 1 and a surrounding pixel. ケース2の場合に画素値決定部が行う処理のフローチャートである。10 is a flowchart of processing performed by a pixel value determination unit in case 2; (a)、(b)はケース2の場合に想定される注目画素と周辺画素の位置関係を示す図である。(A), (b) is a figure which shows the positional relationship of the attention pixel assumed in the case of case 2, and a surrounding pixel. ケース3の場合に画素値決定部が行う処理のフローチャートである。10 is a flowchart of processing performed by a pixel value determination unit in case 3; (a)、(b)はケース3の場合に想定される注目画素と周辺画素の位置関係を示す図である。(A), (b) is a figure which shows the positional relationship of the attention pixel and surrounding pixel assumed in the case of case 3. FIG. ケース4の場合に画素値決定部が行う処理のフローチャートである。10 is a flowchart of processing performed by a pixel value determination unit in case 4; (a)、(b)はケース4の場合に想定される注目画素と周辺画素の位置関係を示す図である。(A), (b) is a figure which shows the positional relationship of the attention pixel and surrounding pixel assumed in the case of case 4. FIG. (a)ブレンド処理部が行う処理のイメージ図である。(b)ブレンド処理部の処理結果を示す図である。(A) It is an image figure of the process which a blend process part performs. (B) It is a figure which shows the processing result of a blend process part. (a)元の画像を示す図である。(b)細線化処理とスムージング処理を同時に行ったときの目標画像を示す図である。(c)元の画像にスムージング処理のみ行った処理結果を示す図である。(d)元の画像に細線化処理のみ行った処理結果を示す図である。(e)画像の構造によってスムージング処理と細線化処理を切り替えた場合の処理結果を示す図である。(f)スムージング処理において画素値を小さく調整した場合の処理結果を示す図である。(A) It is a figure which shows the original image. (B) It is a figure which shows a target image when performing a thinning process and a smoothing process simultaneously. (C) It is a figure which shows the process result which performed only the smoothing process to the original image. (D) It is a figure which shows the process result which performed only the thinning process to the original image. (E) It is a figure which shows the process result at the time of switching a smoothing process and a thinning process according to the structure of an image. (F) It is a figure which shows the process result at the time of adjusting a pixel value small in a smoothing process. 細線化調整部が行う処理のフローチャートである。It is a flowchart of the process which a thinning adjustment part performs. (a)元の画像である。(b)元の画像のスムージング処理後の画像である。(c)元の画像の細線化処理後の画像である。(d)元の画像に対し細線化処理とスムージング処理が同時に実現された画像である。(e)孤立する細線化された画素の細線化を無効化した場合の細線化処理後の画像である。(f)細線化を無効化したうえで、元の画像に対し細線化処理とスムージング処理が同時に実現された画像である。(A) The original image. (B) An image after smoothing processing of the original image. (C) An image after thinning processing of the original image. (D) An image in which a thinning process and a smoothing process are simultaneously performed on the original image. (E) An image after thinning processing when thinning of isolated thinned pixels is invalidated. (F) An image in which thinning processing and smoothing processing are simultaneously performed on the original image after thinning is disabled.

以下、図面を参照して本発明の実施の形態について説明する。   Embodiments of the present invention will be described below with reference to the drawings.

図1は、本実施の形態に係る画像処理装置1の構成を示す。
画像処理装置1は、図1に示すようにスムージング処理部2、細線化処理部3、エッジ方向判定部4、ブレンド処理部5を備える。
画像処理装置1は副走査方向に0〜8ライン目までの合計9画素分のラインメモリーを備え、画像データは1クロック毎に主走査方向に1画素ずつシフトしながらこのラインメモリーに入力され保持される。画像データは8bitであり、画素値の値域が0〜255である。カラー画像の場合、Y(イエロー)、M(マジェンタ)、C(シアン)、K(黒)の4色からなる画像データが入力される。
FIG. 1 shows a configuration of an image processing apparatus 1 according to the present embodiment.
As shown in FIG. 1, the image processing apparatus 1 includes a smoothing processing unit 2, a thinning processing unit 3, an edge direction determination unit 4, and a blend processing unit 5.
The image processing apparatus 1 is provided with a line memory for a total of 9 pixels from the 0th line to the 8th line in the sub-scanning direction, and image data is input and held in this line memory while being shifted by one pixel in the main scanning direction every clock. Is done. The image data is 8 bits, and the range of pixel values is 0-255. In the case of a color image, image data composed of four colors Y (yellow), M (magenta), C (cyan), and K (black) is input.

スムージング処理部2は、画像データの各画素にスムージング処理を施す。スムージング処理はアンチエイリアス処理とも呼ばれる。
スムージング処理は7×7画素単位で行われる。スムージング処理部2は、ラインメモリーから7ライン分の画像データを7クロック分、つまり主走査方向に7画素分保持して7×7画素を得る。
The smoothing processing unit 2 performs a smoothing process on each pixel of the image data. The smoothing process is also called anti-aliasing.
The smoothing process is performed in units of 7 × 7 pixels. The smoothing processing unit 2 holds 7 lines of image data from the line memory for 7 clocks, that is, 7 pixels in the main scanning direction to obtain 7 × 7 pixels.

スムージング処理部2は3つ設けられ、上段のスムージング処理部2には0〜6ライン目、中段のスムージング処理部2には1〜7ライン目、下段のスムージング処理部2には2〜8ライン目の画像データがそれぞれ入力される。
図2は中段のスムージング処理部2に入力された7×7画素の領域を示す。図2において各画素には画素位置を示す識別番号01〜49が付されている。
Three smoothing processing units 2 are provided. The upper smoothing processing unit 2 has 0 to 6th lines, the middle smoothing processing unit 2 has 1st to 7th lines, and the lower smoothing processing unit 2 has 2 to 8th lines. The image data of the eyes are input respectively.
FIG. 2 shows an area of 7 × 7 pixels input to the smoothing processing unit 2 in the middle stage. In FIG. 2, identification numbers 01 to 49 indicating pixel positions are assigned to the respective pixels.

各スムージング処理部2は7×7画素の中心に位置する画素にスムージング処理を施し、スムージング処理による画素値の変化量dSMTを算出して出力する。つまり、1クロック毎に1×7画素の画素値が各スムージング処理部2に入力され、1×3画素(識別番号18、25、32の画素)の画素値の変化量dSMTが出力される。   Each smoothing processing unit 2 performs a smoothing process on a pixel located at the center of 7 × 7 pixels, and calculates and outputs a pixel value change amount dSMT by the smoothing process. That is, a pixel value of 1 × 7 pixels is input to each smoothing processing unit 2 every clock, and a change amount dSMT of a pixel value of 1 × 3 pixels (identification numbers 18, 25, and 32 pixels) is output.

各スムージング処理部2は、図3に示すように、エッジ判定部21、テンプレート判定部22、テンプレート選択部23、画素値算出部24を備える。
各スムージング処理部2は処理する画素の位置が異なるが、処理内容は同じであるので、識別番号25の注目画素をスムージング処理する中段のスムージング処理部2を代表としてスムージング処理を説明する。
As shown in FIG. 3, each smoothing processing unit 2 includes an edge determination unit 21, a template determination unit 22, a template selection unit 23, and a pixel value calculation unit 24.
Each smoothing processing unit 2 is different in the position of the pixel to be processed, but the processing content is the same. Therefore, the smoothing processing will be described with the smoothing processing unit 2 in the middle stage that performs the smoothing processing on the pixel of interest having the identification number 25 as a representative.

エッジ判定部21は、7×7画素に含まれるエッジの有無を判定する。スムージング処理によってスムージングされる対象、つまり画素値が変更される画素は、文字や線画のエッジだからである。
エッジ判定部21は隣接する2つの画素間で画素値の差分を算出し、差分が閾値th1以上であれば、2つの画素間にエッジが有ると判定する。差分が閾値th1未満であれば、エッジ判定部21は2つの画素間にエッジが無いと判定する。th1はエッジ判定用に予め定められた閾値である。差分は絶対値で算出され、差分が算出される2つの画素は所定の位置関係で隣接する画素である。
The edge determination unit 21 determines whether or not there is an edge included in the 7 × 7 pixel. This is because an object to be smoothed by the smoothing process, that is, a pixel whose pixel value is changed is an edge of a character or a line drawing.
The edge determination unit 21 calculates a difference in pixel value between two adjacent pixels, and determines that there is an edge between the two pixels if the difference is equal to or greater than a threshold th1. If the difference is less than the threshold th1, the edge determination unit 21 determines that there is no edge between the two pixels. th1 is a predetermined threshold for edge determination. The difference is calculated as an absolute value, and the two pixels for which the difference is calculated are adjacent pixels in a predetermined positional relationship.

下記は差分が算出される2つの画素A、Bの組み合わせであり、組み合わせは画素Aの識別番号−画素Bの識別番号で示される。
03−10、04−11、05−12、10−17、10−18、11−17、11−18、11−19、12−18、12−19、15−16、16−17、16−24、17−18、17−23、17−24、18−19、18−24、18−25、18−26、19−20、19−26、19−27、20−21、20−26、22−23、23−24、23−31、24−25、24−30、24−31、24−32、25−26、25−32、26−27、26−32、26−33、26−34、27−28、27−33、29−30、30−31、31−32、31−38、31−39、32−33、32−38、32−39、32−40、33−34、33−39、33−40、34−35、38−45、39−46、40−47
The following is a combination of two pixels A and B for which the difference is calculated, and the combination is indicated by the identification number of the pixel A−the identification number of the pixel B.
03-10, 04-11, 05-12, 10-17, 10-18, 11-17, 11-18, 11-19, 12-18, 12-19, 15-16, 16-17, 16- 24, 17-18, 17-23, 17-24, 18-19, 18-24, 18-25, 18-26, 19-20, 19-26, 19-27, 20-21, 20-26, 22-23, 23-24, 23-31, 24-25, 24-30, 24-31, 24-32, 25-26, 25-32, 26-27, 26-32, 26-33, 26- 34, 27-28, 27-33, 29-30, 30-31, 31-32, 31-38, 31-39, 32-33, 32-38, 32-39, 32-40, 33-34, 33-39, 33-40, 34-35, 38-45, 39-46, 40- 7

エッジ判定部21はエッジが有ると判定した場合はV[AB]=1を出力し、エッジが無いと判定した場合はV[AB]=0を出力する。V[AB]において、A、Bは差分の算出に用いられた2つの画素を示し、各画素A、Bの識別番号01〜49の値が入力される。例えば、識別番号03の画素Aと識別番号10の画素Bの差分より、画素Aと画素B間にエッジが有ると判定された場合、V[0310]=1が出力される。   The edge determination unit 21 outputs V [AB] = 1 when it is determined that there is an edge, and outputs V [AB] = 0 when it is determined that there is no edge. In V [AB], A and B indicate two pixels used for calculating the difference, and the values of the identification numbers 01 to 49 of the pixels A and B are input. For example, if it is determined that there is an edge between the pixel A and the pixel B from the difference between the pixel A with the identification number 03 and the pixel B with the identification number 10, V [0310] = 1 is output.

なお、画素A、Bの組み合わせは全部で56であり、演算回路としては1クロックで計56の減算結果が得られなければならないが、演算回路の最適化によって減算の数を減らすことができる。演算回路は1クロック毎に注目画素の演算結果を出力するが、1クロック毎に注目画素は1画素右へ移動していく。そのため、現クロックで減算された画素A、Bは次クロックで画素A−1、B−1になる。このとき、現クロックにおいて用いられた減算結果V[AB]は次クロックにおいてはV[(A−1)(B−1)]の値と同じになる。さらに1クロックが経過すると、この減算結果V[(A−1)(B−1)]はV[(A−2)(B−2)]と同じ値となる。このような特性を利用すれば、減算結果を6クロック分保持することによって同じラインの減算結果として保持された減算結果を流用することが可能である。   The number of combinations of pixels A and B is 56 in total, and the arithmetic circuit must obtain a total of 56 subtraction results in one clock. However, the number of subtractions can be reduced by optimizing the arithmetic circuit. The arithmetic circuit outputs the calculation result of the pixel of interest every clock, but the pixel of interest moves to the right by one pixel every clock. Therefore, the pixels A and B subtracted with the current clock become pixels A-1 and B-1 with the next clock. At this time, the subtraction result V [AB] used in the current clock becomes the same as the value of V [(A-1) (B-1)] in the next clock. When one clock elapses, the subtraction result V [(A-1) (B-1)] becomes the same value as V [(A-2) (B-2)]. By using such characteristics, it is possible to divert the subtraction result held as the subtraction result of the same line by holding the subtraction result for 6 clocks.

以下は、ある減算結果が次のクロック又はそれ以降のクロックで1つ左に記された減算結果として流用できることを示す。これによれば、1つの減算結果が6クロック分保持されることで最大6つの減算結果として流用することができる。このような流用を行う回路構成にすることにより、56回必要だった減算は実質17回にまで削減することが可能である。
V[0310]←V[0411]←V[0512]
V[1017]←V[1118]←V[1219]
V[1018]←V[1119]
V[1117]←V[1218]
V[1516]←V[1617]←V[1718]←V[1819]←V[1920]←V[2021]
V[1624]←V[1826]←V[1927]
V[1723]←V[1824]←V[2026]
V[1724]←V[1825]←V[1926]
V[2223]←V[2324]←V[2425]←V[2526]←V[2627]←V[2728]
V[2331]←V[2432]←V[2634]
V[2430]←V[2632]←V[2733]
V[2431]←V[2532]←V[2633]
V[2930]←V[3031]←V[3132] ←V[3233]←V[3334]←V[3435]
V[3138]←V[3239]←V[3340]
V[3139]←V[3240]
V[3238]←V[3339] V[3845]←V[3946]←V[4047]
The following shows that a certain subtraction result can be used as the subtraction result written to the left by the next clock or subsequent clocks. According to this, since one subtraction result is held for 6 clocks, it can be used as a maximum of 6 subtraction results. By adopting such a circuit configuration for diversion, the subtraction required 56 times can be reduced to substantially 17 times.
V [0310] ← V [0411] ← V [0512]
V [1017] ← V [1118] ← V [1219]
V [1018] ← V [1119]
V [1117] ← V [1218]
V [1516] ← V [1617] ← V [1718] ← V [1819] ← V [1920] ← V [2021]
V [1624] ← V [1826] ← V [1927]
V [1723] ← V [1824] ← V [2026]
V [1724] ← V [1825] ← V [1926]
V [2223] ← V [2324] ← V [2425] ← V [2526] ← V [2627] ← V [2728]
V [2331] ← V [2432] ← V [2634]
V [2430] ← V [2632] ← V [2733]
V [2431] ← V [2532] ← V [2633]
V [2930] ← V [3031] ← V [3132] ← V [3233] ← V [3334] ← V [3435]
V [3138] ← V [3239] ← V [3340]
V [3139] ← V [3240]
V [3238] ← V [3339] V [3845] ← V [3946] ← V [4047]

テンプレート判定部22は、エッジ判定部21から出力されたV[AB]とテンプレートを照合し、一致するテンプレートを判定する。テンプレートは、スムージングすべきエッジのパターンを検出できるように設計されている。
図4は一例としてのテンプレートである。図4において()内の数字は、各テンプレートに付された識別番号である。
The template determination unit 22 compares V [AB] output from the edge determination unit 21 with the template and determines a matching template. The template is designed so that a pattern of edges to be smoothed can be detected.
FIG. 4 is a template as an example. In FIG. 4, the numbers in parentheses are identification numbers assigned to the templates.

図4に示すように、テンプレート上の画素はa、b、cの3つに分類される。テンプレート判定部22は、テンプレート上で分類aに該当する画素間のV[AB]=0、分類bに該当する画素間のV[AB]=0、分類aに該当する画素と分類bに該当する画素間のV[AB]=1を満たすとき、当該テンプレートと一致したと判定する。分類cの画素はエッジの有無が問われない。テンプレートは1つだけでなく、複数一致する場合があり、テンプレート判定部22は全テンプレートと照合し、一致するテンプレートを全て検出する。   As shown in FIG. 4, the pixels on the template are classified into three, a, b, and c. The template determining unit 22 corresponds to V [AB] = 0 between pixels corresponding to the classification a on the template, V [AB] = 0 between pixels corresponding to the classification b, and corresponds to the pixels corresponding to the classification a and the classification b. When V [AB] = 1 between pixels to be matched is determined, it is determined that the template matches. The pixel of classification c does not matter whether there is an edge. There may be a case where a plurality of templates are matched instead of only one, and the template determination unit 22 compares all the templates and detects all the matching templates.

例えば、V[1824]=0、V[2632]=0、V[1826]=1、V[1819]=0、V[3132]=0の全てが満たされる場合、テンプレート判定部22は識別番号21のテンプレートに一致したと判定する。さらに、V [2324]=0、V[3031]=0、V[1920]=0、V [2627]=0の全てが満たされる場合、テンプレート判定部22は識別番号21だけでなく、識別番号213のテンプレートにも一致したと判定する。   For example, when all of V [1824] = 0, V [2632] = 0, V [1826] = 1, V [1819] = 0, and V [3132] = 0 are satisfied, the template determination unit 22 identifies the identification number. It is determined that the template matches the 21 template. Further, when all of V [2324] = 0, V [3031] = 0, V [1920] = 0, and V [2627] = 0 are satisfied, the template determination unit 22 not only has the identification number 21 but also the identification number. It is determined that the template 213 also matches.

テンプレート選択部23は、テンプレート判定部22のテンプレートの照合により、1又は複数一致したテンプレートの中から1つのテンプレートを選択する。図4に示すテンプレートには優先順位が定められている。この優先順位に従い、テンプレート選択部23は、一致したテンプレートのうち、最も優先順位の高いテンプレートを選択する。テンプレートの優先順位は、識別番号24、23、22、21、233、213、243、223、252、251、254、253、262、261、264、263の順に高い。   The template selection unit 23 selects one template from one or a plurality of matched templates by template matching of the template determination unit 22. Priorities are set for the templates shown in FIG. According to this priority order, the template selection unit 23 selects a template with the highest priority order from the matched templates. The priority order of the templates is higher in the order of identification numbers 24, 23, 22, 21, 233, 213, 243, 223, 252, 251, 254, 253, 262, 261, 264, 263.

画素値算出部24は、テンプレート選択部23により選択されたテンプレートに定められた分類a、bに該当する画素の画素値を用いて、スムージング処理による注目画素の画素値の変化量dSMTを算出し、出力する。   The pixel value calculation unit 24 uses the pixel values of the pixels corresponding to the classifications a and b defined in the template selected by the template selection unit 23 to calculate the change amount dSMT of the pixel of interest by the smoothing process. ,Output.

dSMTの算出式は以下の通りである。算出式において、Cは[]内の識別番号で示される各画素の画素値である。注目画素の画素値はC[25]で示される。
選択されたテンプレートの識別番号が21、22、23、24のとき、
dSMT=(C[18]+C[25]+C[32])/3−C[25]
選択されたテンプレートの識別番号が213、233のとき、
dSMT=(C[18]×2+C[25]+C[32]×2)/5−C[25]
選択されたテンプレートの識別番号が223、243のとき、
dSMT=(C[24]×2+C[25]+C[26]×2)/5−C[25]
The formula for calculating dSMT is as follows. In the calculation formula, C is the pixel value of each pixel indicated by the identification number in []. The pixel value of the target pixel is indicated by C [25].
When the identification number of the selected template is 21, 22, 23, 24,
dSMT = (C [18] + C [25] + C [32]) / 3-C [25]
When the identification number of the selected template is 213, 233,
dSMT = (C [18] × 2 + C [25] + C [32] × 2) / 5−C [25]
When the identification number of the selected template is 223, 243,
dSMT = (C [24] × 2 + C [25] + C [26] × 2) / 5−C [25]

選択されたテンプレートの識別番号が251、252のとき、
dSMT=(C[25]×4+C[32])/5−C[25]
選択されたテンプレートの識別番号が253、254のとき、
dSMT=(C[25]×4+C[18])/5−C[25]
選択されたテンプレートの識別番号が261、262のとき、
dSMT=(C[25]×4+C[26])/5−C[25]
選択されたテンプレートの識別番号が263、264のとき、
dSMT=(C[25]×4+C[24])/5−C[25]
When the identification number of the selected template is 251, 252,
dSMT = (C [25] × 4 + C [32]) / 5−C [25]
When the identification number of the selected template is 253, 254,
dSMT = (C [25] × 4 + C [18]) / 5−C [25]
When the identification number of the selected template is 261,262,
dSMT = (C [25] × 4 + C [26]) / 5−C [25]
When the identification number of the selected template is 263, 264,
dSMT = (C [25] × 4 + C [24]) / 5−C [25]

得られた変化量dSMTを注目画素の画素値に加えることにより、スムージング処理後の注目画素の画素値が得られる。このようなスムージング処理によれば、隣接する2画素間の画素値の差分が略同じ値か異なる値かによって、スムージングすべきエッジに該当する注目画素を検出できる。検出された注目画素の画素値は、注目画素とその周辺画素の画素値を重み付けした平均値に変換されるので、前景や背景の画素値が中間調を含むどのような値であってもスムージング処理することが可能である。   By adding the obtained change amount dSMT to the pixel value of the target pixel, the pixel value of the target pixel after the smoothing process is obtained. According to such smoothing processing, a pixel of interest corresponding to an edge to be smoothed can be detected based on whether the difference in pixel value between two adjacent pixels is substantially the same value or a different value. Since the detected pixel value of the target pixel is converted to an average value obtained by weighting the pixel values of the target pixel and its surrounding pixels, smoothing is possible regardless of the foreground and background pixel values including halftones. Can be processed.

細線化処理部3は、画像データの各画素に細線化処理を施す。
細線化処理は3×3画素単位で行われる。細線化処理部3は、ラインメモリーから3ライン分の画像データを3クロック分入力し、3×3画素を得る。細線化処理部3は3つ設けられ、上段の細線化処理部3には2〜4ライン目、中段の細線化処理部3には3〜5ライン目、下段の細線化処理部3には4〜6ライン目の画像データが入力される。各細線化処理部3は3×3画素の中心に位置する画素に細線化処理を施し、細線化処理による画素値の変化量dSTを算出して出力する。つまり、1クロック毎に1×3画素の画素値が各細線化処理部3に入力され、1×3画素(識別番号18、25、32の画素)の画素値の変化量dSTが出力される。
The thinning processing unit 3 performs thinning processing on each pixel of the image data.
The thinning process is performed in units of 3 × 3 pixels. The thinning processing unit 3 inputs 3 lines of image data for 3 clocks from the line memory to obtain 3 × 3 pixels. Three thinning processing units 3 are provided. The upper thinning processing unit 3 includes the second to fourth lines, the middle thinning processing unit 3 includes the third to fifth lines, and the lower thinning processing unit 3 includes the third thinning processing unit 3. The image data of the 4th to 6th lines are input. Each thinning processing unit 3 performs thinning processing on a pixel located at the center of 3 × 3 pixels, and calculates and outputs a pixel value change amount dST by the thinning processing. That is, a pixel value of 1 × 3 pixels is input to each thinning processing unit 3 every clock, and a change amount dST of a pixel value of 1 × 3 pixels (identification numbers 18, 25, and 32 pixels) is output. .

各細線化処理部3は、図5に示すように、エッジ強度算出部31、エッジ判定部32、細線化判定部33、画素値算出部34を備える。
各細線化処理部3は処理する画素の位置が異なるが、処理内容は同じであるので、識別番号25の注目画素を処理する中段の細線化処理部3を代表として細線化処理を説明する。
As shown in FIG. 5, each thinning processing unit 3 includes an edge strength calculation unit 31, an edge determination unit 32, a thinning determination unit 33, and a pixel value calculation unit 34.
Each thinning processing unit 3 is different in the position of the pixel to be processed, but the processing content is the same. Therefore, the thinning processing will be described with the thinning processing unit 3 in the middle stage that processes the pixel of interest having the identification number 25 as a representative.

エッジ強度算出部31は、注目画素におけるエッジ強度を求める。エッジ強度算出部31は、注目画素とその周辺画素との差E0〜E7を算出し、そのうちの最大値PEDを求める。E0〜E7の算出式は以下の通りである。Cは[]内の識別番号で示される各画素の画素値である。
E0=C[25]−C[17]
E1=C[25]−C[18]
E2=C[25]−C[19]
E3=C[25]−C[24]
E4=C[25]−C[26]
E5=C[25]−C[31]
E6=C[25]−C[32]
E7=C[25]−C[33]
The edge strength calculation unit 31 obtains the edge strength at the target pixel. The edge strength calculation unit 31 calculates differences E0 to E7 between the target pixel and its surrounding pixels, and obtains the maximum value PED among them. The calculation formulas for E0 to E7 are as follows. C is the pixel value of each pixel indicated by the identification number in [].
E0 = C [25] -C [17]
E1 = C [25] −C [18]
E2 = C [25] -C [19]
E3 = C [25] −C [24]
E4 = C [25] -C [26]
E5 = C [25] -C [31]
E6 = C [25] -C [32]
E7 = C [25] -C [33]

エッジ強度算出部31は、E0〜E7の符号を反転させ、そのうちの最大値REDを求める。細線化処理部3は、PED<REDであれば、PED=0、RED<PEDであれば、RED=0に修正する。
以上のようにして求めたE0〜E7、PED、REDがエッジ強度である。
The edge strength calculation unit 31 inverts the signs of E0 to E7 and obtains the maximum value RED among them. The thinning processing unit 3 corrects PED = 0 if PED <RED, and RED = 0 if RED <PED.
E0 to E7, PED, and RED obtained as described above are edge strengths.

エッジ判定部32は、カラー画像の場合、各色の画像データから求められたPED、REDによって、下記式によりTPED、TREDを求める。[]内のyはイエロー、mはマジェンタ、cはシアン、kは黒の色の画像データから求められたエッジ強度であることを示す。
TPED=
(PED[y]×Wy+PED[m] ×Wm+PED[c] ×Wc+ PED[k] ×Wk)
TRED=
(RED[y]×Wy+RED[m] ×Wm+RED[c] ×Wc+ RED[k] ×Wk)
上記式において、Wy、Wm、Wc、Wkは予め定められた係数であり、Wy+Wm+Wc+Wk≦255である。
モノクロ画像であれば、TPED=PED[k] ×Wk、TRED=RED[k] ×Wkである。
In the case of a color image, the edge determination unit 32 obtains TPED and TRED by the following formula using PED and RED obtained from the image data of each color. In [], y represents yellow, m represents magenta, c represents cyan, and k represents edge intensity obtained from image data of black color.
TPED =
(PED [y] × Wy + PED [m] × Wm + PED [c] × Wc + PED [k] × Wk)
TRED =
(RED [y] × Wy + RED [m] × Wm + RED [c] × Wc + RED [k] × Wk)
In the above equation, Wy, Wm, Wc, and Wk are predetermined coefficients, and Wy + Wm + Wc + Wk ≦ 255.
In the case of a monochrome image, TPED = PED [k] × Wk and TRED = RED [k] × Wk.

TPED、TREDは、各色のエッジ強度PED、REDを、比視感度に相当する係数Wy、Wm、Wc、Wkで重み付けし足し合わせた値であり、各色を重ね合わせたときの視覚的な濃度の指標となり得る。細線化の対象は前景のエッジであるので、エッジ判定部32は、TPED、TREDの大小関係を判定することによって注目画素とその周辺画素のどちらが前景でどちらが背景かを判定する。エッジ判定部32は、TPED>TREDであれば、注目画素が背景より濃度が高い前景のエッジであると判定し、ED=1を出力する。一方、TPED≦TREDであれば、エッジ判定部32は注目画素は前景のエッジではないと判定し、ED=0を出力する。   TPED and TRED are values obtained by weighting and adding edge strengths PED and RED of each color with coefficients Wy, Wm, Wc, and Wk corresponding to specific luminous sensitivity, and the visual density when each color is overlaid. Can be an indicator. Since the thinning target is the foreground edge, the edge determination unit 32 determines which of the target pixel and its surrounding pixels is the foreground and which is the background by determining the magnitude relationship between TPED and TRED. If TPED> TRED, the edge determination unit 32 determines that the pixel of interest is a foreground edge having a higher density than the background, and outputs ED = 1. On the other hand, if TPED ≦ TRED, the edge determination unit 32 determines that the pixel of interest is not a foreground edge, and outputs ED = 0.

細線化判定部33は、前景のエッジと判定された注目画素が細線化の対象となり得るか否かを判定する。エッジではあるが、細線化つまり画素値を減じるのに十分な画素値を注目画素が持たない場合、画素値を減じることによって画素値が非常に小さくなるか、或いは無くなって画像に途切れが生じるため、細線化の対象外とする必要がある。細線化判定部33は、注目画素の各色の画素値C[25]をそれぞれ閾値Th2と比較し、何れかの色において画素値C[25]が閾値Th2以上であれば、細線化に十分な画素値を持つと判定し、SS=1を出力する。一方、全ての色において注目画素の画素値C[25]が閾値Th2未満であれば、細線化判定部33は注目画素が細線化に十分な画素値を持たないので細線化の対象外であると判定し、SS=0を出力する。   The thinning determination unit 33 determines whether or not the target pixel determined to be the foreground edge can be a target for thinning. Although it is an edge, if the pixel of interest does not have a pixel value sufficient for thinning, that is, to reduce the pixel value, the pixel value becomes very small or disappears because the pixel value is reduced, and the image is interrupted. , It must be excluded from thinning. The thinning determination unit 33 compares the pixel value C [25] of each color of the target pixel with the threshold Th2, and if the pixel value C [25] is equal to or greater than the threshold Th2 in any color, the thinning determination unit 33 is sufficient for thinning. It determines with having a pixel value, and outputs SS = 1. On the other hand, if the pixel value C [25] of the pixel of interest is less than the threshold Th2 in all colors, the thinning determination unit 33 is not subject to thinning because the pixel of interest does not have a pixel value sufficient for thinning. And SS = 0 is output.

画素値算出部34は、細線化処理による注目画素の画素値の変化量dSTを算出して出力する。ED=1かつSS=1である場合、注目画素はエッジであり、細線化に十分な画素値を持つので、画素値算出部34は注目画素を細線化し、下記式によって画素値の変化量dSTを算出する。変化量dSTは色毎に求められたPED、REDを用いて、色毎に求められる。
dST=(PED−RED)×STVL
上記STVLは細線化の強度を調整する係数であり、色毎に予め定められている。STVLは0〜1の値域をとり得る。
The pixel value calculation unit 34 calculates and outputs the change amount dST of the pixel value of the target pixel due to the thinning process. When ED = 1 and SS = 1, since the target pixel is an edge and has a pixel value sufficient for thinning, the pixel value calculation unit 34 thins the target pixel and changes the pixel value change amount dST by the following equation. Is calculated. The change amount dST is obtained for each color using PED and RED obtained for each color.
dST = (PED-RED) × STVL
The STVL is a coefficient for adjusting the thinning intensity and is predetermined for each color. STVL can take a range of 0-1.

得られた変化量dSTを元の画素値に加えることによって細線化処理後の画素値が得られる。dSTの算出式から分かるように、細線化処理には、dSTが負の値となって注目画素の画素値が減じられ、文字通り細線化される場合だけでなく、dSTが正の値となって画素値が増加され、太線化される場合もある。   The pixel value after the thinning process is obtained by adding the obtained change amount dST to the original pixel value. As can be seen from the calculation formula of dST, in the thinning process, dST becomes a negative value and the pixel value of the pixel of interest is reduced to literally make the line thin, and dST becomes a positive value. In some cases, the pixel value is increased and thickened.

ED=1かつSS=1ではない場合、注目画素がエッジではない、或いはエッジであるが細線化に十分な画素値を持たないので、画素値算出部34は注目画素の細線化は行わず、画素値の変化量dST=0を出力する。   When ED = 1 and SS = 1 are not satisfied, the pixel of interest is not an edge, or is an edge but does not have a pixel value sufficient for thinning, so the pixel value calculation unit 34 does not thin the pixel of interest, A pixel value change amount dST = 0 is output.

エッジ方向判定部4は、画像データの各画素におけるエッジ方向を判定する。
エッジ方向の判定は5×5画素単位で行われる。エッジ方向判定部4は、ラインメモリーから2〜6ライン目の画像データを5クロック分入力し、ブレンド処理部5における注目画素を中心とする5×5画素を得る。エッジ方向判定部4は、入力された5×5画素の中心に位置する注目画素を対象としてエッジ方向posを判定し、出力する。つまり、1クロック毎に1×5画素の画素値がエッジ方向判定部4に入力され、1画素分のエッジ方向posが出力される。エッジ方向とは画素値が小さい画素から大きい画素へ向かう方向である。注目画素が前景又は背景のエッジであれば、背景から前景への方向がエッジ方向として判定される。
The edge direction determination unit 4 determines the edge direction in each pixel of the image data.
The determination of the edge direction is performed in units of 5 × 5 pixels. The edge direction determination unit 4 inputs image data of the second to sixth lines from the line memory for five clocks, and obtains 5 × 5 pixels centered on the target pixel in the blend processing unit 5. The edge direction determination unit 4 determines and outputs the edge direction pos for the target pixel located at the center of the input 5 × 5 pixels. That is, a pixel value of 1 × 5 pixels is input to the edge direction determination unit 4 every clock and an edge direction pos for one pixel is output. The edge direction is a direction from a small pixel value to a large pixel. If the target pixel is the edge of the foreground or background, the direction from the background to the foreground is determined as the edge direction.

エッジ方向判定部4は、注目画素(識別番号25の画素)と注目画素に隣接する8つの周辺画素(識別番号17、18、19、24、26、31、32、33の画素)との差分SP、注目画素(識別番号25の画素)と注目画素の上下左右において注目画素から2画素離れた周辺画素(識別番号11、23、27、39の画素)との差分SFをそれぞれ算出する。   The edge direction determination unit 4 calculates the difference between the pixel of interest (pixel with identification number 25) and the eight neighboring pixels (pixels with identification numbers 17, 18, 19, 24, 26, 31, 32, and 33) adjacent to the pixel of interest. SP and difference SF between the target pixel (pixel of identification number 25) and peripheral pixels (pixels of identification numbers 11, 23, 27, and 39) that are two pixels away from the target pixel in the top, bottom, left, and right of the target pixel are calculated.

算出式は以下の通りである。Cは[]内の識別番号で示される各画素の画素値である。
SP[u]=C[25]−C[18]
SP[l]=C[25]−C[24]
SP[r]=C[25]−C[26]
SP[d]=C[25]−C[32]
SF[u]=C[25]−C[11]
SF[l]=C[25]−C[23]
SF[r]=C[25]−C[27]
SF[d]=C[25]−C[39]
The calculation formula is as follows. C is the pixel value of each pixel indicated by the identification number in [].
SP [u] = C [25] -C [18]
SP [l] = C [25] −C [24]
SP [r] = C [25] -C [26]
SP [d] = C [25] -C [32]
SF [u] = C [25] −C [11]
SF [l] = C [25] −C [23]
SF [r] = C [25] −C [27]
SF [d] = C [25] −C [39]

エッジ方向判定部4は、注目画素の主走査方向におけるエッジ方向x、副走査方向におけるエッジ方向yをそれぞれ判定する。x、yは0又は±1の値をとり得る。0はエッジが無いことを示し、1はエッジがあることを示す。正負の符号は方向に対応する。   The edge direction determination unit 4 determines the edge direction x in the main scanning direction and the edge direction y in the sub scanning direction of the pixel of interest. x and y can be 0 or ± 1. 0 indicates that there is no edge, and 1 indicates that there is an edge. Positive and negative signs correspond to directions.

例えば、SP[l]<SP[r]であれば、図6に示すように注目画素の左右のうち右側の周辺画素の画素値が小さい。よって、エッジ方向判定部4は主走査方向におけるエッジ方向を左と判定し、x=−1を出力する。一方、SP[l]>SP[r]であれば、図7に示すように注目画素の左右のうち左側の画素値が小さい。よって、エッジ方向判定部4は主走査方向におけるエッジ方向を右と判定し、x=+1を出力する。
同様に、SP[u]とSP[d]の比較によって副走査方向のエッジ方向が判定される。SP[u]>SP[d]であれば、エッジ方向判定部4は副走査方向におけるエッジ方向を下と判定し、y=−1を出力する。SP[u]<SP[d]であれば、エッジ方向判定部4は副走査方向におけるエッジ方向を上と判定し、y=+1を出力する。
For example, if SP [l] <SP [r], the pixel values of the peripheral pixels on the right side of the left and right of the target pixel are small as shown in FIG. Therefore, the edge direction determination unit 4 determines that the edge direction in the main scanning direction is left, and outputs x = -1. On the other hand, if SP [l]> SP [r], the left pixel value of the left and right of the target pixel is small as shown in FIG. Therefore, the edge direction determination unit 4 determines that the edge direction in the main scanning direction is right, and outputs x = + 1.
Similarly, the edge direction in the sub-scanning direction is determined by comparing SP [u] and SP [d]. If SP [u]> SP [d], the edge direction determination unit 4 determines that the edge direction in the sub-scanning direction is down, and outputs y = -1. If SP [u] <SP [d], the edge direction determination unit 4 determines that the edge direction in the sub-scanning direction is upward, and outputs y = + 1.

SP[l]=SP[r]の場合、注目画素の左右で画素値の差が無い。SP[u]=SP[d]の場合も同様に、注目画素の上下で画素値の差が無い。この場合、エッジ方向判定部4は注目画素の左右又は上下でエッジは無いと判定し、x=0、y=0をそれぞれ出力する。   When SP [l] = SP [r], there is no difference in pixel value between the left and right of the target pixel. Similarly, when SP [u] = SP [d], there is no difference in pixel values above and below the target pixel. In this case, the edge direction determination unit 4 determines that there is no edge on the left and right or top and bottom of the target pixel, and outputs x = 0 and y = 0, respectively.

エッジ方向判定部4は、注目画素がエッジではないが、エッジから1画素内側の内エッジである場合にも、そのエッジ方向を判定する。
注目画素が内エッジである場合、エッジ方向はx=y=0である。よって、エッジ方向判定部4は、エッジ方向がx=y=0である場合、注目画素から2画素離れた周辺画素から求められたSF[l]、SF[r]、SF[u]、SF[d]により、エッジ方向x、yを修正する。
The edge direction determination unit 4 determines the edge direction even when the target pixel is not an edge but is an inner edge one pixel inside the edge.
When the target pixel is the inner edge, the edge direction is x = y = 0. Therefore, when the edge direction is x = y = 0, the edge direction determination unit 4 determines SF [l], SF [r], SF [u], SF obtained from peripheral pixels that are two pixels away from the target pixel. [d] corrects the edge directions x and y.

エッジ方向判定部4は、SF[l]<SF[r]であれば、x=0をx=−1に修正し、SF[l]>SF[r]であれば、x=+1に修正する。同様に、エッジ方向判定部4は、SF[u]>SF[d]であれば、y=0をy=−1に修正し、SF[u]<SF[d]であれば、y=+1に修正する。SF[l]=SF[r]であれば修正は行わず、エッジ方向判定部4はx=0をそのまま出力する。SF[u]=SF[d]の場合も修正は行わず、エッジ方向判定部4はy=0をそのまま出力する。   The edge direction determination unit 4 corrects x = 0 to x = −1 if SF [l] <SF [r], and corrects x = + 1 if SF [l]> SF [r]. To do. Similarly, if SF [u]> SF [d], the edge direction determination unit 4 corrects y = 0 to y = −1, and if SF [u] <SF [d], y = Correct to +1. If SF [l] = SF [r], no correction is made, and the edge direction determination unit 4 outputs x = 0 as it is. Even in the case of SF [u] = SF [d], no correction is performed, and the edge direction determination unit 4 outputs y = 0 as it is.

例えば、図8に示すように注目画素から2画素離れた右側の周辺画素がエッジであり、注目画素が内エッジである場合、SP[l]=SP[r]であるから、x=0と判定される。しかし、SF[l]<SF[r]であるから、x=0はx=−1に修正される。   For example, as shown in FIG. 8, when the peripheral pixel on the right side that is two pixels away from the target pixel is an edge and the target pixel is an inner edge, SP [l] = SP [r]. Determined. However, since SF [l] <SF [r], x = 0 is corrected to x = -1.

エッジ方向判定部4は、主走査方向のエッジ方向x及び副走査方向のエッジ方向yの組み合わせによって、総合的なエッジ方向posを判定し、出力する。posは0〜4の値をとり得る。0は中央(エッジ無し)、1は左方向、2は右方向、3は上方向、4は下方向を示す。x、yの組み合わせに対するエッジ方向posは、以下の通りである。   The edge direction determination unit 4 determines and outputs a comprehensive edge direction pos by a combination of the edge direction x in the main scanning direction and the edge direction y in the sub scanning direction. pos can take a value of 0-4. 0 indicates the center (no edge), 1 indicates the left direction, 2 indicates the right direction, 3 indicates the upward direction, and 4 indicates the downward direction. The edge direction pos for the combination of x and y is as follows.

x=1かつy=−1のとき、pos=4
x=1かつy=0のとき、pos=2
x=1かつy=+1のとき、pos=2
x=0かつy=−1のとき、pos=4
x=0かつy=0のとき、pos=0
x=0かつy=+1のとき、pos=3
x=−1かつy=−1のとき、pos=1
x=−1かつy=0のとき、pos=1
x=−1かつy=+1のとき、pos=3
When x = 1 and y = −1, pos = 4
When x = 1 and y = 0, pos = 2
When x = 1 and y = + 1, pos = 2
When x = 0 and y = −1, pos = 4
pos = 0 when x = 0 and y = 0
When x = 0 and y = + 1, pos = 3
When x = -1 and y = -1, pos = 1
When x = -1 and y = 0, pos = 1
When x = -1 and y = + 1, pos = 3

ブレンド処理部5は、細線化処理とスムージング処理が同時に実現されたときの各画素の画素値を決定する。
ブレンド処理部5は、ラインメモリーの2〜6ライン目の画像データを5クロック分入力し、識別番号25の注目画素を中心とする5×5画素を得る。また、ブレンド処理部5は、スムージング処理部2及び細線化処理部3から出力される1×3画素の処理結果(変化量dSMT、dST)を主走査方向に3画素シフトして、識別番号25の注目画素を中心とする3×3画素分の処理結果を入力する。また、ブレンド処理部5はエッジ方向判定部4から注目画素のエッジ方向posを入力する。ブレンド処理部5は、注目画素における細線化の有無、スムージングの有無の組み合わせに応じて、注目画素において細線化とスムージングの双方が同時に実現されたときの画素値Gを決定する。画素値Gの決定には、注目画素、注目画素の上下左右に隣接する周辺画素、注目画素の上下左右において注目画素から2画素離れた周辺画素の各画素値C、注目画素と注目画素の上下左右に隣接する周辺画素の画素値の変化量dST、dSMT、注目画素におけるエッジ方向posが用いられる。
The blend processing unit 5 determines the pixel value of each pixel when the thinning process and the smoothing process are realized simultaneously.
The blend processing unit 5 inputs the image data of the 2nd to 6th lines in the line memory for 5 clocks, and obtains 5 × 5 pixels centered on the target pixel of the identification number 25. Further, the blend processing unit 5 shifts the processing result (change amounts dSMT, dST) of 1 × 3 pixels output from the smoothing processing unit 2 and the thinning processing unit 3 by 3 pixels in the main scanning direction, and has an identification number of 25 The processing result for 3 × 3 pixels centering on the target pixel is input. Further, the blend processing unit 5 inputs the edge direction pos of the target pixel from the edge direction determination unit 4. The blend processing unit 5 determines a pixel value G when both thinning and smoothing are simultaneously realized in the target pixel according to the combination of the presence or absence of thinning and the presence or absence of smoothing in the target pixel. The pixel value G is determined by determining the target pixel, the neighboring pixels adjacent to the target pixel in the vertical and horizontal directions, the pixel values C of the peripheral pixels that are two pixels away from the target pixel in the vertical and horizontal directions of the target pixel, Changes dST and dSMT of pixel values of neighboring pixels adjacent to the left and right, and the edge direction pos of the target pixel are used.

ブレンド処理部5は、図9に示すように、分類部50、画素値決定部51〜54を備える。
分類部50は、注目画素における細線化の有無、スムージングの有無の組み合わせによって、注目画素における細線化とスムージングの状態をケース1〜ケース4に分類する。細線化の有無、スムージングの有無は変化量dST、dSMTの値が0か否かによって判定することができる。分類部50は、注目画素について細線化処理部3から入力される変化量dST[25]がdST[25]≠0であれば、細線化処理の結果、注目画素において細線化が行われ、dST[25]=0であれば細線化が行われなかったと判定する。同様に、分類部50は注目画素についてスムージング処理部2から入力される変化量dSMT[25]がdSMT[25]≠0であればスムージングが行われ、dSMT[25]=0であればスムージングが行われなかったと判定する。
As shown in FIG. 9, the blend processing unit 5 includes a classification unit 50 and pixel value determination units 51 to 54.
The classification unit 50 classifies the thinning and smoothing states in the target pixel into cases 1 to 4 according to the combination of the presence or absence of thinning and the presence or absence of smoothing in the target pixel. The presence or absence of thinning and the presence or absence of smoothing can be determined based on whether or not the values of the change amounts dST and dSMT are zero. If the change amount dST [25] input from the thinning processing unit 3 for the target pixel is dST [25] ≠ 0, the classification unit 50 performs thinning on the target pixel as a result of the thinning process. [25] = 0, it is determined that thinning has not been performed. Similarly, the classification unit 50 performs smoothing if the change amount dSMT [25] input from the smoothing processing unit 2 for the target pixel is dSMT [25] ≠ 0, and performs smoothing if dSMT [25] = 0. Judge that it was not done.

図10は、分類部50による処理の流れを示すフローチャートである。
図10に示すように、分類部50は注目画素の変化量dST[25]≠0、dSMT[25]≠0のとき(ステップS11;Y)、ケース1に分類する(ステップS12)。注目画素の変化量dST[25]≠0、dSMT[25]=0のとき(ステップS11;N、S13;Y)、分類部50はケース2に分類する(ステップS14)。注目画素の変化量dST[25]=0、dSMT[25]≠0のとき(ステップS13;N、S15;Y)、分類部50はケース3に分類する(ステップS16)。注目画素の変化量dST[25]=0、dSMT[25]=0のとき(ステップS15;N、S17;Y)、分類部50はケース4に分類する(ステップS18)。
FIG. 10 is a flowchart showing the flow of processing by the classification unit 50.
As shown in FIG. 10, the classification unit 50 performs classification into case 1 when the change amount dST [25] ≠ 0 and dSMT [25] ≠ 0 of the target pixel (step S11; Y) (step S12). When the amount of change dST [25] ≠ 0 and dSMT [25] = 0 (step S11; N, S13; Y), the classification unit 50 classifies the pixel of interest into case 2 (step S14). When the change amount dST [25] = 0 and dSMT [25] ≠ 0 of the target pixel (step S13; N, S15; Y), the classification unit 50 classifies the case 3 (step S16). When the change amount dST [25] = 0 and dSMT [25] = 0 of the target pixel (step S15; N, S17; Y), the classification unit 50 classifies the case 4 (step S18).

分類部50は、ケース1に分類された場合は画素値決定部51に、ケース2に分類された場合は画素値決定部52に、ケース3に分類された場合は画素値決定部53に、ケース4に分類された場合は画素値決定部54に、変化量dST、dSMT、画素値C、エッジ方向posを出力する。   The classification unit 50 is classified into the pixel value determination unit 51 when classified into the case 1, the pixel value determination unit 52 when classified into the case 2, and the pixel value determination unit 53 when classified into the case 3. In the case of the case 4 classification, the change amounts dST, dSMT, the pixel value C, and the edge direction pos are output to the pixel value determination unit 54.

画素値決定部51〜54は、それぞれのケース1〜4に応じて細線化処理及びスムージング処理の双方を同時に実現したときの注目画素の画素値G[25]を決定する。   The pixel value determination units 51 to 54 determine the pixel value G [25] of the pixel of interest when both the thinning process and the smoothing process are realized simultaneously according to the cases 1 to 4.

〈ケース1〉
図11は、ケース1に対し、画素値決定部51が実行する処理のフローチャートである。
ケース1において注目画素は細線化もスムージングも行われているので、図12(a)に示すような前景のエッジであるか、或いは図12(b)に示すような背景のエッジであることが想定される。前景のエッジである場合、図12(a)に示すように注目画素Mの変化量dST、dSMTは何れも負の値であり、細線化処理、スムージング処理のそれぞれによって画素値が減じられる。背景のエッジである場合、図12(b)に示すように注目画素Mの変化量dST、dSMTは何れも正の値であり、細線化処理、スムージング処理のそれぞれによって画素値が増加される。
<Case 1>
FIG. 11 is a flowchart of processing executed by the pixel value determination unit 51 for Case 1.
In case 1, since the pixel of interest is thinned and smoothed, it may be a foreground edge as shown in FIG. 12 (a) or a background edge as shown in FIG. 12 (b). is assumed. In the case of the foreground edge, as shown in FIG. 12A, the amounts of change dST and dSMT of the target pixel M are both negative values, and the pixel value is reduced by the thinning process and the smoothing process, respectively. In the case of the background edge, as shown in FIG. 12B, the changes dST and dSMT of the target pixel M are both positive values, and the pixel value is increased by the thinning process and the smoothing process, respectively.

何れの場合も、注目画素Mは細線化及びスムージングされ、注目画素Mのエッジ方向pos又はエッジ方向の逆方向である逆エッジ方向aposに隣接する周辺画素Nは細線化もスムージングもされていない。よって、画素値決定部51は、図11に示すように注目画素の元の画素値C[25]に、変化量dST[25]、dSMT[25]を加えた値を、細線化処理とスムージング処理を同時に実現させたときの注目画素の画素値G[25]として決定し、出力する(ステップS21)。   In any case, the target pixel M is thinned and smoothed, and the peripheral pixel N adjacent to the edge direction pos of the target pixel M or the reverse edge direction apos which is the reverse direction of the edge direction is not thinned or smoothed. Therefore, as shown in FIG. 11, the pixel value determination unit 51 uses a thinning process and a smoothing process to obtain a value obtained by adding the change amounts dST [25] and dSMT [25] to the original pixel value C [25] of the target pixel. The pixel value G [25] of the pixel of interest when processing is realized simultaneously is determined and output (step S21).

決定された注目画素の画素値G[25]は、前景の画素値と背景の画素値の間になければ、前景と背景の境界で注目画素の濃度が突出し、不自然である。よって、注目画素の画素値G[25]が、前景つまり注目画素のエッジ方向に隣接する周辺画素の画素値C[pos]より大きいとき(ステップS22;Y)、画素値決定部51は決定された注目画素の画素値G[25]を前景の画素値C[pos]に修正する(ステップS23)。また、注目画素の画素値G[25]が、背景つまり注目画素の逆エッジ方向に隣接する周辺画素の画素値C[apos]より小さいとき(ステップS22;Y)、画素値決定部51は決定された注目画素の画素値G[25]を背景の画素値C[apos]に修正する(ステップS23)。aposはエッジ方向posと逆方向の値が設定される。つまり、pos=1であればapos=2、pos=3であればapos=4である。エッジ方向が無い場合、pos=apos=0である。   If the determined pixel value G [25] of the target pixel is not between the foreground pixel value and the background pixel value, the density of the target pixel protrudes at the boundary between the foreground and the background, which is unnatural. Therefore, when the pixel value G [25] of the target pixel is larger than the pixel value C [pos] of the surrounding pixels adjacent to the foreground, that is, the edge direction of the target pixel (step S22; Y), the pixel value determination unit 51 is determined. The pixel value G [25] of the target pixel is corrected to the foreground pixel value C [pos] (step S23). Further, when the pixel value G [25] of the target pixel is smaller than the background, that is, the pixel value C [apos] of the peripheral pixel adjacent in the reverse edge direction of the target pixel (step S22; Y), the pixel value determination unit 51 determines The pixel value G [25] of the target pixel thus corrected is corrected to the background pixel value C [apos] (step S23). For apos, a value in the direction opposite to the edge direction pos is set. That is, if pos = 1, apos = 2, and if pos = 3, apos = 4. If there is no edge direction, pos = apos = 0.

〈ケース2〉
図13は、ケース2に対し、画素値決定部52が実行する処理のフローチャートである。
ケース2において注目画素は細線化のみ行われているので、図14(a)に示すような前景のエッジであるか、図14(b)に示すような背景のエッジであると想定される。前景のエッジである場合、図14(a)に示すように注目画素Mの変化量dSTは負の値であり、細線化処理によって画素値が減じられる。注目画素Mに逆エッジ方向aposに隣接する周辺画素Nの変化量dSMTは正の値であり、スムージング処理によって画素値が増加される。背景のエッジである場合、図14(b)に示すように注目画素Mの変化量dSTは正の値であり、細線化処理によって画素値が増加される。注目画素Mにエッジ方向posに隣接する周辺画素Nの変化量dSMTは負の値であり、スムージング処理によって画素値が減じられる。
<Case 2>
FIG. 13 is a flowchart of processing executed by the pixel value determination unit 52 for Case 2.
In case 2, since the pixel of interest is only thinned, it is assumed that it is a foreground edge as shown in FIG. 14A or a background edge as shown in FIG. In the case of the foreground edge, as shown in FIG. 14A, the change amount dST of the pixel of interest M is a negative value, and the pixel value is reduced by the thinning process. The change amount dSMT of the peripheral pixel N adjacent to the target pixel M in the reverse edge direction apos is a positive value, and the pixel value is increased by the smoothing process. In the case of a background edge, as shown in FIG. 14B, the change amount dST of the target pixel M is a positive value, and the pixel value is increased by the thinning process. The change amount dSMT of the peripheral pixel N adjacent to the target pixel M in the edge direction pos is a negative value, and the pixel value is reduced by the smoothing process.

このように、細線化された注目画素のエッジ方向pos又は逆エッジ方向aposに、細線化されず、スムージングされた周辺画素が隣接する場合、画素値決定部52は注目画素とともに当該周辺画素の細線化処理とスムージング処理が同時に実現されたときの画素値を決定する。   In this way, when the smoothed peripheral pixel is adjacent to the edge direction pos or the reverse edge direction apos of the thinned pixel of interest, the pixel value determining unit 52, along with the pixel of interest, includes the fine line of the peripheral pixel. The pixel value when the smoothing process and the smoothing process are realized simultaneously is determined.

注目画素は細線化のみされているので、画素値決定部52は、図13に示すように、注目画素の元の画素値C[25]に細線化処理による注目画素の画素値の変化量dST[25]を加えた値を、細線化処理とスムージング処理が同時に実現されたときの注目画素の画素値G[25]として一時的に決定する(ステップS31)。次に、画素値決定部52は、スムージングされた周辺画素がエッジ方向posと逆エッジ方向aposの何れに隣接するかを判定する。   Since the target pixel is only thinned, the pixel value determination unit 52 changes the pixel value change amount dST of the target pixel by the thinning process to the original pixel value C [25] of the target pixel as shown in FIG. The value to which [25] is added is temporarily determined as the pixel value G [25] of the target pixel when the thinning process and the smoothing process are realized simultaneously (step S31). Next, the pixel value determination unit 52 determines whether the smoothed peripheral pixel is adjacent to the edge direction pos or the reverse edge direction apos.

画素値決定部52は、エッジ方向pos、エッジ方向posにおいて注目画素に隣接する周辺画素について入力された変化量dST[pos]、dSMT[pos]が、pos≠0、dST[pos]=0、dSMT[pos]≠0を満たす場合(ステップS32;Y)、スムージングされた周辺画素が注目画素のエッジ方向posに隣接すると判定する(ステップS33)。   The pixel value determination unit 52 determines that the amounts of change dST [pos] and dSMT [pos] input for peripheral pixels adjacent to the target pixel in the edge direction pos and edge direction pos are pos ≠ 0, dST [pos] = 0, If dSMT [pos] ≠ 0 is satisfied (step S32; Y), it is determined that the smoothed peripheral pixel is adjacent to the edge direction pos of the target pixel (step S33).

画素値決定部52は、逆エッジ方向apos、逆エッジ方向aposにおいて注目画素に隣接する周辺画素について入力された変化量dST[apos]、dSMT[apos]が、apos≠0、dST[apos]=0、dSMT[apos]≠0を満たす場合(ステップS32;N、S34;Y)、スムージングされた周辺画素が背景、つまり注目画素の逆エッジ方向aposに隣接すると判定する(ステップS35)。
何れの条件も満たさない場合(ステップS34;N)、画素値決定部52は、スムージングされた周辺画素がエッジ方向posにも逆エッジ方向aposにも隣接しないと判定し、ステップS31で決定された注目画素の画素値G[25]を出力する。
The pixel value determination unit 52 determines that the amounts of change dST [apos] and dSMT [apos] input to the neighboring pixels adjacent to the target pixel in the reverse edge direction apos and the reverse edge direction apos are apos ≠ 0, dST [apos] = When 0 and dSMT [apos] ≠ 0 are satisfied (step S32; N, S34; Y), it is determined that the smoothed peripheral pixel is adjacent to the background, that is, the reverse edge direction apos of the target pixel (step S35).
When none of the conditions is satisfied (step S34; N), the pixel value determination unit 52 determines that the smoothed peripheral pixel is not adjacent to the edge direction pos or the reverse edge direction apos, and is determined in step S31. The pixel value G [25] of the target pixel is output.

スムージングされた周辺画素が隣接する方向が特定されると、画素値決定部52は注目画素の元の画素値C[25]に、細線化処理による注目画素の画素値の変化量dST[25]、スムージング処理による当該周辺画素の画素値の変化量dSMT[P]を加えた値を、注目画素の画素値G[25]として決定する(ステップS36)。Pはpos又はaposが入力される。dSMT[P]は、スムージングされた周辺画素がエッジ方向posに隣接するのであれば、dSMT[pos]が用いられ、逆エッジ方向aposに隣接するのであれば、dSMT[apos]が用いられる。   When the direction in which the smoothed neighboring pixels are adjacent to each other is specified, the pixel value determination unit 52 changes the pixel value C [25] of the target pixel to the original pixel value C [25] of the target pixel by the thinning process. Then, a value obtained by adding the pixel value change amount dSMT [P] of the peripheral pixel due to the smoothing process is determined as the pixel value G [25] of the target pixel (step S36). P is input as pos or apos. For dSMT [P], dSMT [pos] is used if the smoothed neighboring pixel is adjacent to the edge direction pos, and dSMT [apos] is used if it is adjacent to the reverse edge direction apos.

その後、注目画素の画素値G[25]を前景と背景の画素値によって修正する点は、ケース1と同じである。よって、図11と同じ処理のステップには図13においても同じステップ番号を付して説明を省略する。   Thereafter, the pixel value G [25] of the target pixel is corrected by the foreground and background pixel values in the same manner as in Case 1. Therefore, the same steps as those in FIG. 11 are denoted by the same step numbers in FIG.

〈ケース3〉
図15は、ケース3に対し、画素値決定部53が実行する処理のフローチャートである。
ケース3において注目画素はスムージングのみ行われているので、注目画素は図16(a)に示すような背景のエッジであるか、或いは図16(b)に示すような前景のエッジであることが想定される。背景のエッジである場合、図16(a)に示すように注目画素Mの変化量dSMTは正の値であり、スムージング処理によって画素値が増加される。注目画素Mにエッジ方向posに隣接する周辺画素Nの変化量dSTは負の値であり、細線化処理によって画素値が減じられる。前景のエッジである場合、図16(b)に示すように注目画素Mの変化量dSMTは負の値であり、スムージング処理によって画素値が減じられる。注目画素Mに逆エッジ方向aposに隣接する周辺画素Nの変化量dSTは正の値であり、細線化処理によって画素値が増加される。
<Case 3>
FIG. 15 is a flowchart of processing executed by the pixel value determination unit 53 for case 3.
Since the pixel of interest is only smoothed in Case 3, the pixel of interest may be a background edge as shown in FIG. 16 (a) or a foreground edge as shown in FIG. 16 (b). is assumed. In the case of the background edge, as shown in FIG. 16A, the amount of change dSMT of the target pixel M is a positive value, and the pixel value is increased by the smoothing process. The change amount dST of the peripheral pixel N adjacent to the target pixel M in the edge direction pos is a negative value, and the pixel value is reduced by the thinning process. In the case of the foreground edge, as shown in FIG. 16B, the amount of change dSMT of the target pixel M is a negative value, and the pixel value is reduced by the smoothing process. The change amount dST of the peripheral pixel N adjacent to the target pixel M in the reverse edge direction apos is a positive value, and the pixel value is increased by the thinning process.

このように、スムージングされた注目画素のエッジ方向pos又は逆エッジ方向aposに、細線化された周辺画素が隣接する場合、画素値決定部53は、注目画素とともに当該周辺画素の細線化処理とスムージング処理が同時に実現されたときの画素値G[P]を決定する。   As described above, when the thinned peripheral pixel is adjacent to the edge direction pos or the reverse edge direction apos of the smoothed target pixel, the pixel value determination unit 53 performs thinning processing and smoothing of the peripheral pixel together with the target pixel. The pixel value G [P] when the processing is realized simultaneously is determined.

注目画素はスムージングのみされているので、画素値決定部53は、図15に示すように注目画素の元の画素値C[25]にスムージング処理による注目画素の変化量dSMT[25]を加えた値を、細線化処理とスムージング処理が同時に実現されたときの注目画素の画素値G[25]として一時的に決定する(ステップS41)。次に、画素値決定部53は、細線化された周辺画素がエッジ方向posと逆エッジ方向aposの何れの方向に隣接するかを判定する。   Since the target pixel is only smoothed, the pixel value determining unit 53 adds the target pixel change amount dSMT [25] by the smoothing process to the original pixel value C [25] of the target pixel as shown in FIG. The value is temporarily determined as the pixel value G [25] of the pixel of interest when the thinning process and the smoothing process are realized simultaneously (step S41). Next, the pixel value determination unit 53 determines in which direction of the edge direction pos and the reverse edge direction apos the thinned peripheral pixels are adjacent.

画素値決定部53は、エッジ方向pos、エッジ方向posにおいて注目画素に隣接する周辺画素について入力された変化量dST[pos]、dSMT[pos]が、pos≠0、dST[pos]≠0、dSMT[pos]=0を満たす場合(ステップS42;Y)、細線化された周辺画素が注目画素のエッジ方向posに隣接すると判定する(ステップS43)。   The pixel value determination unit 53 determines that the amounts of change dST [pos] and dSMT [pos] input for the neighboring pixels adjacent to the target pixel in the edge direction pos and edge direction pos are pos ≠ 0, dST [pos] ≠ 0, When dSMT [pos] = 0 is satisfied (step S42; Y), it is determined that the thinned peripheral pixel is adjacent to the edge direction pos of the target pixel (step S43).

画素値決定部53は、逆エッジ方向apos、逆エッジ方向aposにおいて注目画素に隣接する周辺画素について入力された変化量dST[apos]、dSMT[apos]が、apos≠0、dST[apos]≠0、dSMT[apos]=0を満たす場合(ステップS42;N、S44;Y)、細線化された周辺画素が注目画素の逆エッジ方向aposに隣接すると判定する(ステップS45)。
何れの条件も満たさない場合(ステップS44;N)、画素値決定部53は、細線化された周辺画素がエッジ方向posにも逆エッジ方向aposにも隣接しないと判定し、ステップS41で決定された注目画素の画素値G[25]を出力する。
The pixel value determination unit 53 determines that the changes dST [apos] and dSMT [apos] input for the neighboring pixels adjacent to the target pixel in the reverse edge direction apos and the reverse edge direction apos are apos ≠ 0 and dST [apos] ≠. When 0 and dSMT [apos] = 0 are satisfied (step S42; N, S44; Y), it is determined that the thinned peripheral pixel is adjacent to the reverse edge direction apos of the target pixel (step S45).
If neither condition is satisfied (step S44; N), the pixel value determination unit 53 determines that the thinned peripheral pixel is not adjacent to the edge direction pos or the reverse edge direction apos, and is determined in step S41. The pixel value G [25] of the target pixel is output.

細線化された周辺画素が隣接する方向が特定されると、画素値決定部53は注目画素の画素値C[25]と、細線化された周辺画素の画素値C[P]のうち、大きい方をL、小さい方をSに入力し(ステップS46)、下記式によりtempを算出する(ステップS47)。
temp=L+S+dST[P]+dSMT[25]
Pはpos又はaposが入力される。C[P]、 dST[P]は、細線化された周辺画素がエッジ方向posに隣接するのであればC[pos]、dST[pos]であり、逆エッジ方向に隣接するのであればC[apos]、dST[apos]である。
When the direction in which the thinned peripheral pixels are adjacent to each other is specified, the pixel value determining unit 53 is larger between the pixel value C [25] of the target pixel and the pixel value C [P] of the thinned peripheral pixel. One is input to L and the smaller one is input to S (step S46), and temp is calculated by the following equation (step S47).
temp = L + S + dST [P] + dSMT [25]
P is input as pos or apos. C [P] and dST [P] are C [pos] and dST [pos] if the thinned peripheral pixels are adjacent in the edge direction pos, and C [P] and dST [P] if they are adjacent in the reverse edge direction. apos], dST [apos].

tempは、スムージングされた注目画素の画素値と細線化された周辺画素の画素値を足し合わせた総和である。画素値決定部53は、このtempを注目画素と周辺画素に配分する。   “temp” is a sum total of the pixel value of the smoothed target pixel and the pixel values of the thinned peripheral pixels. The pixel value determination unit 53 distributes this temp to the target pixel and the peripheral pixels.

スムージング処理による注目画素の画素値の変化量dSMT[25]と、細線化処理による周辺画素の画素値の変化量dST[P]の合計が正の値である場合、注目画素のスムージングと周辺画素の細線化によって、この2つの画素の画素値の総和tempが元の画素値の合計L+Sより大きくなる。この場合、画素値決定部53は、元の画素値が大きい方の画素に画素値Lを割り当て、他方の画素値に残りの画素値temp−Lを割り当てる。なお、総和tempがLの2倍より大きければ、注目画素も周辺画素も画素値はL以上となり、前景にも背景にもなじまない。この場合、画素値決定部53は何れに対しても最大限許容されるLの値を割り当てる。   When the sum of the change amount dSMT [25] of the pixel value of the target pixel due to the smoothing process and the change amount dST [P] of the pixel value of the peripheral pixel due to the thinning process is a positive value, the smoothing of the target pixel and the peripheral pixel The total temp of the pixel values of the two pixels becomes larger than the sum L + S of the original pixel values. In this case, the pixel value determination unit 53 assigns the pixel value L to the pixel with the larger original pixel value, and assigns the remaining pixel value temp-L to the other pixel value. If the total temp is larger than twice L, the pixel value of both the target pixel and the surrounding pixels is equal to or greater than L, and is not adapted to the foreground or the background. In this case, the pixel value determining unit 53 assigns the maximum allowable L value to any of them.

図15に示すように、temp>L+Sを満たし(ステップS48;Y)、temp<L×2を満たす場合(ステップS49;Y)、画素値決定部53は注目画素の元の画素値C[25]が周辺画素の元の画素値C[P]より大きければ、注目画素の画素値G[25]=L、周辺画素の画素値G[P]=temp−Lに決定する。注目画素の元の画素値C[25]が周辺画素の元の画素値C[P]より小さければ、画素値決定部53は注目画素の画素値G[25]=temp−L、周辺画素の画素値G[P]=Lに決定する(ステップS50)。
temp>L+Sを満たすが(ステップS48;Y)、temp<L×2を満たさない場合(ステップS49;N)、注目画素の画素値G[25]=L、周辺画素の画素値G[P]=Lに決定する(ステップS51)。
As shown in FIG. 15, when temp> L + S is satisfied (step S48; Y) and temp <L × 2 is satisfied (step S49; Y), the pixel value determining unit 53 determines the original pixel value C [25 of the target pixel. ] Is larger than the original pixel value C [P] of the peripheral pixel, the pixel value G [25] = L of the target pixel and the pixel value G [P] = temp−L of the peripheral pixel are determined. If the original pixel value C [25] of the target pixel is smaller than the original pixel value C [P] of the surrounding pixels, the pixel value determining unit 53 sets the pixel value G [25] = temp−L of the target pixel, The pixel value G [P] = L is determined (step S50).
When temp> L + S is satisfied (step S48; Y), but temp <L × 2 is not satisfied (step S49; N), the pixel value G [25] = L of the target pixel, and the pixel value G [P] of the surrounding pixels = L is determined (step S51).

一方、スムージング処理による注目画素の画素値の変化量dSMT[25]と、細線化処理による周辺画素の画素値の変化量dST[P]の合計が負の値である場合、注目画素のスムージングと周辺画素の細線化によって、この2つの画素の画素値の総和tempが元の画素値の合計L+Sより小さくなる。この場合、画素値決定部53は、元の画素値が小さい方の画素に画素値Sを割り当て、他方の画素に残りの画素値temp−Sを割り当てる。なお、総和tempがSの2倍より小さければ、注目画素も周辺画素も画素値はS以下となり、前景にも背景にもなじまない。この場合、画素値決定部53は何れに対しても最大限許容されるSの値を割り当てる。   On the other hand, when the sum of the change amount dSMT [25] of the pixel value of the target pixel due to the smoothing process and the change amount dST [P] of the pixel value of the surrounding pixels due to the thinning process is a negative value, By thinning the peripheral pixels, the sum temp of the pixel values of these two pixels becomes smaller than the sum L + S of the original pixel values. In this case, the pixel value determination unit 53 assigns the pixel value S to the pixel with the smaller original pixel value, and assigns the remaining pixel value temp-S to the other pixel. Note that if the total temp is smaller than twice S, the pixel values of the target pixel and the surrounding pixels are equal to or less than S, and neither the foreground nor the background is suitable. In this case, the pixel value determination unit 53 assigns the maximum allowable S value to any of them.

図15に示すように、temp>L+Sを満たさず(ステップS48;N)、temp>S×2を満たす場合(ステップS52;Y)、注目画素の元の画素値C[25]が周辺画素の元の画素値C[P]より大きければ、画素値決定部53は注目画素の画素値G[25]=temp−S、周辺画素の画素値G[P]=Sに決定する。注目画素の元の画素値C[25]が周辺画素の元の画素値C[P]より小さければ、画素値決定部53は注目画素の画素値G[25]=S、周辺画素の画素値G[P]=temp−Sに決定する(ステップS53)。
temp>L+Sを満たさず(ステップS48;N)、temp>S×2も満たさない場合(ステップS52;N)、画素値決定部53は注目画素の画素値G[25]=S、周辺画素の画素値G[P]=Sに決定する(ステップS54)。
As shown in FIG. 15, when temp> L + S is not satisfied (step S48; N), and temp> S × 2 is satisfied (step S52; Y), the original pixel value C [25] of the target pixel is the surrounding pixel. If the pixel value is larger than the original pixel value C [P], the pixel value determination unit 53 determines the pixel value G [25] = temp−S of the target pixel and the pixel value G [P] = S of the peripheral pixels. If the original pixel value C [25] of the pixel of interest is smaller than the original pixel value C [P] of the surrounding pixels, the pixel value determining unit 53 sets the pixel value G [25] = S of the pixel of interest, and the pixel values of the surrounding pixels. G [P] = temp-S is determined (step S53).
If temp> L + S is not satisfied (step S48; N), and temp> S × 2 is not satisfied (step S52; N), the pixel value determination unit 53 determines the pixel value G [25] = S of the target pixel, The pixel value G [P] = S is determined (step S54).

〈ケース4〉
図17は、ケース4に対し、画素値決定部54が実行する処理のフローチャートである。
ケース4において注目画素は細線化もスムージングも行われていないので、注目画素は図18(a)に示すような前景の内エッジであるか、図18(b)に示すような背景の内エッジであることが想定される。前景の内エッジである場合、図18(a)に示すように注目画素Mは細線化もスムージングもされないが、注目画素Mに逆エッジ方向aposに隣接する周辺画素Nの変化量dST、dSMTはそれぞれ負の値であるので、細線化処理及びスムージング処理によって画素値が減じられる。背景の内エッジである場合、図18(b)に示すように注目画素Mは細線化もスムージングもされないが、注目画素Mにエッジ方向に隣接する周辺画素Nの変化量dST、dSMTはそれぞれ正の値であるので、細線化処理及びスムージング処理によって画素値が増加される。
<Case 4>
FIG. 17 is a flowchart of processing executed by the pixel value determination unit 54 for Case 4.
In case 4, since the pixel of interest is neither thinned nor smoothed, the pixel of interest is the inner edge of the foreground as shown in FIG. 18 (a) or the inner edge of the background as shown in FIG. 18 (b). It is assumed that In the case of the inner edge of the foreground, as shown in FIG. 18A, the target pixel M is neither thinned nor smoothed, but the amounts of change dST and dSMT of the peripheral pixel N adjacent to the target pixel M in the reverse edge direction apos are Since each is a negative value, the pixel value is reduced by the thinning process and the smoothing process. In the case of the inner edge of the background, as shown in FIG. 18B, the target pixel M is neither thinned nor smoothed, but the amounts of change dST and dSMT of the peripheral pixel N adjacent to the target pixel M in the edge direction are positive. Therefore, the pixel value is increased by the thinning process and the smoothing process.

このように、エッジ方向pos又は逆エッジ方向aposにおいて細線化もスムージングもされた周辺画素が注目画素に隣接する場合、画素値決定部54は、注目画素とともに当該周辺画素の細線化処理とスムージング処理が同時に実現されたときの画素値G[P]を決定する。   In this way, when the peripheral pixel that has been thinned and smoothed in the edge direction pos or the reverse edge direction apos is adjacent to the target pixel, the pixel value determination unit 54 performs the thinning process and the smoothing process on the peripheral pixel together with the target pixel. Determines the pixel value G [P] at the same time.

注目画素は細線化もスムージングもされていないので、画素値決定部54は、図17に示すように注目画素の元の画素値C[25]を、細線化処理とスムージング処理が同時に実現されたときの注目画素の画素値G[25]として一時的に決定する(ステップS61)。   Since the target pixel is neither thinned nor smoothed, the pixel value determination unit 54 realizes the thinning process and the smoothing process simultaneously on the original pixel value C [25] of the target pixel as shown in FIG. Is temporarily determined as the pixel value G [25] of the current pixel of interest (step S61).

次に、画素値決定部54は、注目画素、注目画素のエッジ方向posに隣接する周辺画素、逆エッジ方向aposに隣接する周辺画素の3つの画素が略同一の画素値であるかを判定する(ステップS62)。注目画素が内エッジである場合、注目画素と、エッジ方向pos及び逆エッジ方向aposに隣接する周辺画素の3つの画素の画素値は略同一となるからである。画素値決定部54は、エッジ方向posに隣接する周辺画素の画素値C[pos]から逆エッジ方向aposに隣接する周辺画素の画素値C[apos]を差し引いた値と、エッジ方向posに隣接する周辺画素の画素値C[pos]から注目画素の画素値C[25]を差し引いた値の何れもが閾値Th3未満である場合、3つの画素の画素値は略同一であると判定する。何れか一方でも閾値Th3を越える場合、画素値決定部54は3つの画素の画素値は略同一ではないと判定する。   Next, the pixel value determination unit 54 determines whether or not the target pixel, the peripheral pixel adjacent to the edge direction pos of the target pixel, and the peripheral pixel adjacent to the reverse edge direction apos have substantially the same pixel value. (Step S62). This is because when the pixel of interest is the inner edge, the pixel values of the pixel of interest and the peripheral pixels adjacent to the edge direction pos and the reverse edge direction apos are substantially the same. The pixel value determination unit 54 subtracts the pixel value C [apos] of the peripheral pixel adjacent to the reverse edge direction apos from the pixel value C [pos] of the peripheral pixel adjacent to the edge direction pos and the edge value pos. If all of the values obtained by subtracting the pixel value C [25] of the target pixel from the pixel value C [pos] of the surrounding pixel are less than the threshold Th3, it is determined that the pixel values of the three pixels are substantially the same. If either one exceeds the threshold Th3, the pixel value determination unit 54 determines that the pixel values of the three pixels are not substantially the same.

3つの画素の画素値が略同一ではない場合(ステップS62;N)、注目画素は内エッジではなく、内エッジより内側に位置するので、画素値決定部54はステップS61で決定された画素値G[25]を出力する。注目画素が内エッジより内側に位置する場合、注目画素に隣接する周辺画素も内エッジか内エッジより内側に位置するので、当該周辺画素に対する細線化やスムージングは適当でない。よって、画素値決定部54は強制的に周辺画素の変化量をdST[pos]=dST[apos]=0に修正し(ステップS63)、細線化やスムージングを無効化する。   If the pixel values of the three pixels are not substantially the same (step S62; N), the pixel value determination unit 54 determines the pixel value determined in step S61 because the target pixel is located not on the inner edge but on the inner edge. G [25] is output. When the target pixel is located inside the inner edge, the peripheral pixels adjacent to the target pixel are also located inside the inner edge or the inner edge, so that thinning or smoothing is not appropriate for the peripheral pixel. Therefore, the pixel value determination unit 54 forcibly modifies the amount of change in the surrounding pixels to dST [pos] = dST [apos] = 0 (step S63), and invalidates thinning and smoothing.

3つの画素の画素値が略同一である場合(ステップS62;Y)、注目画素は内エッジである。画素値決定部54は、細線化され、スムージングされた周辺画素が注目画素のエッジ方向posと逆エッジ方向aposの何れの方向に隣接するかを判定する(ステップS64)。   When the pixel values of the three pixels are substantially the same (step S62; Y), the target pixel is the inner edge. The pixel value determining unit 54 determines whether the thinned and smoothed peripheral pixel is adjacent in the edge direction pos or the reverse edge direction apos of the target pixel (step S64).

画素値決定部54は、エッジ方向pos、エッジ方向posにおいて注目画素に隣接する周辺画素について入力された変化量dST[pos]、dSMT[pos]が、pos≠0、dST[pos]≠0、dSMT[pos]≠0を満たす場合(ステップS64;Y)、細線化され、スムージングされた周辺画素が注目画素のエッジ方向posに隣接すると判定する(ステップS65)。   The pixel value determination unit 54 determines that the amounts of change dST [pos] and dSMT [pos] input for the neighboring pixels adjacent to the target pixel in the edge direction pos and edge direction pos are pos ≠ 0, dST [pos] ≠ 0, When dSMT [pos] ≠ 0 is satisfied (step S64; Y), it is determined that the thinned and smoothed peripheral pixel is adjacent to the edge direction pos of the target pixel (step S65).

画素値決定部52は、逆エッジ方向apos、逆エッジ方向aposにおいて注目画素に隣接する周辺画素について入力された変化量dST[apos]、dSMT[apos]が、apos≠0、dST[apos]≠0、dSMT[apos]≠0を満たす場合(ステップS64;N、S66;Y)、細線化され、スムージングされた周辺画素が注目画素の逆エッジ方向aposに隣接すると判定する(ステップS67)。
何れの条件も満たさない場合(ステップS66;N)、画素値決定部54は、細線化され、スムージングされた周辺画素は注目画素のエッジ方向及び逆エッジ方向の何れにも隣接しないと判定し、ステップS61で決定された注目画素の画素値G[25]を出力する。
The pixel value determination unit 52 determines that the amounts of change dST [apos] and dSMT [apos] input for the neighboring pixels adjacent to the target pixel in the reverse edge direction apos and the reverse edge direction apos are apos ≠ 0 and dST [apos] ≠. When 0 and dSMT [apos] ≠ 0 are satisfied (step S64; N, S66; Y), it is determined that the thinned and smoothed peripheral pixel is adjacent to the reverse edge direction apos of the target pixel (step S67).
When none of the conditions is satisfied (step S66; N), the pixel value determination unit 54 determines that the thinned and smoothed neighboring pixels are not adjacent to either the edge direction or the reverse edge direction of the target pixel, The pixel value G [25] of the target pixel determined in step S61 is output.

細線化され、スムージングされた周辺画素がエッジ方向posに隣接すると特定された場合、画素値決定部54は当該周辺画素の画素値C[pos]に、細線化の変化量dST[pos]、スムージングによる変化量dSMT[pos]を加えた値を、細線化処理とスムージング処理が同時に実現されたときの周辺画素の画素値G[pos]として決定する(ステップS68)。   When it is determined that the thinned and smoothed peripheral pixel is adjacent to the edge direction pos, the pixel value determination unit 54 adds the thinning change amount dST [pos] to the pixel value C [pos] of the peripheral pixel. The value obtained by adding the change amount dSMT [pos] is determined as the pixel value G [pos] of the peripheral pixels when the thinning process and the smoothing process are realized simultaneously (step S68).

細線化及びスムージングによって周辺画素の画素値G[pos]が前景の画素値より大きくなると、不自然である。よって、画素値決定部54は、決定された画素値G[pos]が、注目画素からエッジ方向posに2画素離れた周辺画素の画素値C[2pos]より大きい場合(ステップS69;Y)、周辺画素の画素値G[pos]を2画素離れた周辺画素の画素値C[2pos]に修正する。また、画素値決定部54は周辺画素で処理しきれなかった残りの画素値G[pos]−C[2pos]を、注目画素の画素値C[25]に加えた値を、細線化処理とスムージング処理が同時に実現されたときの注目画素の画素値G[25]として決定する(ステップS70)。   When the pixel value G [pos] of the surrounding pixels becomes larger than the pixel value of the foreground due to thinning and smoothing, it is unnatural. Therefore, the pixel value determination unit 54 determines that the determined pixel value G [pos] is larger than the pixel value C [2pos] of a peripheral pixel that is two pixels away from the target pixel in the edge direction pos (step S69; Y). The pixel value G [pos] of the peripheral pixel is corrected to the pixel value C [2pos] of the peripheral pixel separated by two pixels. Further, the pixel value determination unit 54 adds a value obtained by adding the remaining pixel value G [pos] −C [2pos] that could not be processed by the peripheral pixels to the pixel value C [25] of the target pixel as the thinning process. The pixel value G [25] of the pixel of interest when the smoothing process is realized simultaneously is determined (step S70).

決定された注目画素の画素値G[25]も前景の画素値以下に収めるため、決定された注目画素の画素値G[25]がエッジ方向に2画素離れた周辺画素の画素値C[2pos]より大きければ(ステップS71;Y)、画素値決定部54は注目画素の画素値G[25]を2画素離れた周辺画素の画素値C[2pos]にさらに修正する(ステップS72)。   Since the determined pixel value G [25] of the target pixel is also kept below the foreground pixel value, the determined pixel value G [25] of the target pixel is a pixel value C [2pos] of a peripheral pixel that is two pixels away in the edge direction. ] (Step S71; Y), the pixel value determination unit 54 further modifies the pixel value G [25] of the pixel of interest to the pixel value C [2pos] of the peripheral pixel that is two pixels away (step S72).

一方、細線化され、スムージングされた周辺画素が逆エッジ方向aposに隣接すると特定された場合、画素値決定部54は当該周辺画素の画素値C[apos]に、細線化処理による変化量dST[apos]、スムージング処理による変化量dSMT[apos]を加えた値を、細線化処理とスムージング処理が同時に実現されたときの周辺画素の画素値G[apos]として決定する(ステップS73)。   On the other hand, when it is determined that the thinned and smoothed peripheral pixel is adjacent to the reverse edge direction apos, the pixel value determination unit 54 changes the pixel value C [apos] of the peripheral pixel to the change amount dST [ apos] and a value obtained by adding the change amount dSMT [apos] due to the smoothing process are determined as the pixel value G [apos] of the peripheral pixel when the thinning process and the smoothing process are realized simultaneously (step S73).

細線化及びスムージングによって周辺画素の画素値G[apos]が背景の画素値より小さくなると、不自然である。よって、画素値決定部54は、決定された画素値G[apos]が、注目画素から逆エッジ方向に2画素離れた周辺画素の画素値C[2apos]より小さい場合(ステップS74;Y)、周辺画素の画素値G[apos]を2画素離れた周辺画素の画素値C[2apos]に修正する。また、画素値決定部54は周辺画素で処理しきれなかった残りの画素値G[apos]−C[2apos]を、注目画素の画素値C[25]に加えて、注目画素の画素値G[25]として決定する(ステップS75)。   When the pixel value G [apos] of the surrounding pixels becomes smaller than the background pixel value due to thinning and smoothing, it is unnatural. Therefore, the pixel value determination unit 54 determines that the determined pixel value G [apos] is smaller than the pixel value C [2apos] of the peripheral pixel that is 2 pixels away from the target pixel in the reverse edge direction (step S74; Y). The pixel value G [apos] of the peripheral pixel is corrected to the pixel value C [2apos] of the peripheral pixel separated by two pixels. In addition, the pixel value determination unit 54 adds the remaining pixel value G [apos] −C [2apos], which could not be processed by the surrounding pixels, to the pixel value C [25] of the target pixel, thereby adding the pixel value G of the target pixel. [25] is determined (step S75).

決定された注目画素の画素値G[25]も背景の画素値以下に収めるため、決定された注目画素の画素値G[25]が逆エッジ方向に2画素離れた周辺画素の画素値C[2apos]より小さければ(ステップS76;Y)、画素値決定部54は注目画素の画素値G[25]を2画素離れた周辺画素の画素値C[2apos]にさらに修正する(ステップS77)。   Since the determined pixel value G [25] of the target pixel is also kept below the background pixel value, the determined pixel value G [25] of the target pixel is a pixel value C [[ If it is smaller than 2 apos] (step S76; Y), the pixel value determination unit 54 further modifies the pixel value G [25] of the target pixel to the pixel value C [2apos] of the peripheral pixel that is 2 pixels away (step S77).

図19(a)は、上記ブレンド処理部5が行う処理のイメージ図である。
図19(a)に示す画像を細線化処理及びスムージング処理する場合、注目画素M1は細線化のみされるためケース2に分類される。このとき、エッジ方向及び逆エッジ方向に隣接する周辺画素は細線化もスムージングもされないため、細線化のみされた注目画素M1の画素値が出力される。
FIG. 19A is an image diagram of processing performed by the blend processing unit 5.
When thinning processing and smoothing processing are performed on the image shown in FIG. 19A, the pixel of interest M1 is only thinned and is classified as case 2. At this time, since the peripheral pixels adjacent in the edge direction and the reverse edge direction are neither thinned nor smoothed, the pixel value of the pixel of interest M1 that has been thinned only is output.

一方、注目画素M2はスムージングされ、注目画素M2のエッジ方向に隣接する周辺画素N2が細線化される。よって、ケース3に分類され、スムージングされた注目画素M2の画素値と細線化された周辺画素N2の画素値を足し合わせた画素値が、元の画素値が大きい周辺画素N2に寄せるように注目画素M2と周辺画素N2に配分される。   On the other hand, the target pixel M2 is smoothed, and the peripheral pixel N2 adjacent in the edge direction of the target pixel M2 is thinned. Accordingly, attention is paid so that the pixel value obtained by adding the pixel value of the pixel of interest M2 classified and smoothed in case 3 and the pixel value of the thinned peripheral pixel N2 to the peripheral pixel N2 having a large original pixel value. It is distributed to the pixel M2 and the peripheral pixel N2.

注目画素M3はスムージングと細線化の双方が行われ、エッジ方向又は逆エッジ方向に隣接する周辺画素は細線化もスムージングもされない。この場合はケース1に分類され、細線化され、スムージングされた注目画素M3の画素値が出力される。   The pixel of interest M3 is both smoothed and thinned, and neighboring pixels adjacent in the edge direction or the reverse edge direction are neither thinned nor smoothed. In this case, the pixel value of the pixel of interest M3 which is classified as case 1, thinned, and smoothed is output.

その結果、図19(b)に示すように、直線部分は細線化され、斜線部分はスムージングによって滑らかに階段化されて、細線化とスムージングがバランスよく実現されている。
このようなブレンド処理部5の良好な処理結果に対し、直線部分は細線化処理、斜線部分はスムージング処理と、画像の構造によって処理を切り替える方法や、細線化処理も同時に行われることを考慮してスムージング処理時に変更された画素値を小さな値に設定するような方法では、細線化とスムージングを同時に実現することは難しい。
As a result, as shown in FIG. 19B, the straight line portion is thinned, and the hatched portion is smoothly stepped by smoothing, so that thinning and smoothing are realized in a balanced manner.
Considering that such a favorable processing result of the blend processing unit 5 is a thinning process for a straight line portion, a smoothing process for a hatched portion, a method of switching processing depending on the structure of an image, and a thinning process are simultaneously performed. In the method of setting the pixel value changed during the smoothing process to a small value, it is difficult to realize thinning and smoothing at the same time.

図20(a)は元の画像を示す。図20(b)は元の画像に対し、細線化処理とスムージング処理を同時に行った場合に実現したい目標画像である。
元の画像にスムージング処理のみ実行すると、図20(c)に示すように、斜線部分のエッジに位置する画素の画素値が増加され、滑らかな斜線となる。元の画像に細線化処理のみ実行すると、図20(d)に示すように、直線部分の画素値が減じられ、視覚的に細線化される。
FIG. 20A shows the original image. FIG. 20B shows a target image to be realized when the thinning process and the smoothing process are simultaneously performed on the original image.
When only the smoothing process is performed on the original image, as shown in FIG. 20C, the pixel value of the pixel located at the edge of the shaded portion is increased, resulting in a smooth shaded line. When only the thinning process is performed on the original image, as shown in FIG. 20D, the pixel value of the straight line portion is reduced and the line is visually thinned.

スムージング処理と細線化処理の双方を同時に施す場合、図20(b)に示す目標画像のように、斜線部分は滑らかとなり、直線部分はエッジの画素値が減じられることが期待される。しかし、単に斜線部分をスムージング処理、直線部分を細線化処理するように切り替えると、図20(e)に示すように、矢印で示す箇所に予期しない段差が生じ、滑らかな斜線が実現できない。
また、細線化処理も同時に行われることを考慮してスムージング処理時に変更された画素値を小さな値に設定した場合、図20(f)に示すような処理結果となる。図20(e)に示される処理結果よりは改善が見られるものの、矢印で示す箇所に段差が生じ、目標画像や本実施の形態に係るブレンド処理部5の処理結果(図19(b)参照)に比べれば画質が劣る。
When both the smoothing process and the thinning process are performed at the same time, it is expected that the hatched portion becomes smooth and the straight line portion has a reduced edge pixel value as in the target image shown in FIG. However, if switching is performed so that the hatched portion is simply smoothed and the straight line portion is thinned, an unexpected step occurs at the location indicated by the arrow as shown in FIG.
Further, when the pixel value changed during the smoothing process is set to a small value in consideration of the fact that the thinning process is also performed at the same time, the processing result as shown in FIG. Although an improvement is seen from the processing result shown in FIG. 20 (e), a step is generated at the position indicated by the arrow, and the processing result of the target image and the blend processing unit 5 according to the present embodiment (see FIG. 19 (b)). ) Is inferior in quality.

上述の細線化処理とスムージング処理を同時に実現するブレンド処理において、細線化された画素が孤立すると、細線化もスムージングも実現せず、画質劣化を引き起こす。そこで、図1に示すように、画像処理装置1は細線化調整部6を備え、細線化調整部6は細線化された画素が孤立する場合に細線化処理部3による細線化を無効化する。   In the blending process that realizes the thinning process and the smoothing process at the same time, if the thinned pixels are isolated, neither thinning nor smoothing is realized, resulting in image quality deterioration. Therefore, as shown in FIG. 1, the image processing apparatus 1 includes a thinning adjustment unit 6. The thinning adjustment unit 6 invalidates thinning by the thinning processing unit 3 when the thinned pixels are isolated. .

細線化調整部6は、ブレンド処理部5における注目画素とその周辺画素の変化量dSTを細線化処理部3から入力し、入力された変化量dSTにより注目画素とその周辺画素で細線化された画素が孤立するか否かを判定する。孤立すると判定された場合、細線化調整部6は注目画素と周辺画素のうち、細線化された画素の変化量dSTを0の値にリセットし、細線化を無効化する。細線化調整部6は、制御部7から制御信号SWに応じて細線化の無効化を実行する。   The thinning adjustment unit 6 receives the change amount dST of the target pixel and its peripheral pixels in the blend processing unit 5 from the thinning processing unit 3, and is thinned at the target pixel and its peripheral pixels by the input change amount dST. It is determined whether or not the pixel is isolated. If it is determined to be isolated, the thinning adjustment unit 6 resets the change dST of the thinned pixel of the target pixel and the peripheral pixels to a value of 0, and invalidates the thinning. The thinning adjustment unit 6 invalidates the thinning according to the control signal SW from the control unit 7.

制御部7は、細線化調整部6に制御信号SWを出力し、細線化調整部6による細線化の無効化を実行するか否かを切り替える。制御部7は、細線化の無効化を実行する設定の場合はSW=1、無効化を実行しない設定の場合はSW=0を出力する。   The control unit 7 outputs a control signal SW to the thinning adjustment unit 6 and switches whether or not to invalidate the thinning by the thinning adjustment unit 6. The control unit 7 outputs SW = 1 when setting to invalidate thinning, and outputs SW = 0 when setting not to invalidate.

図21は、細線化調整部6が実行する処理のフローチャートである。
図21に示すように、細線化調整部6は、3つの細線化処理部3から出力される1×3画素の変化量dSTを主走査方向に3画素分保持し、識別番号25の注目画素とその周辺画素からなる3×3画素の変化量dSTを入力する。細線化調整部6は、3×3画素のうち、細線化処理によって細線化された画素、つまりdST≠0の画素の数をカウントし、そのカウント数を孤立度CNとして出力する(ステップS81)。
FIG. 21 is a flowchart of processing executed by the thinning adjustment unit 6.
As shown in FIG. 21, the thinning adjustment unit 6 holds the change amount dST of 1 × 3 pixels output from the three thinning processing units 3 for three pixels in the main scanning direction, and the pixel of interest with the identification number 25 And a change amount dST of 3 × 3 pixels composed of the surrounding pixels. The thinning adjustment unit 6 counts the number of pixels thinned by the thinning process among the 3 × 3 pixels, that is, the number of pixels with dST ≠ 0, and outputs the counted number as the degree of isolation CN (step S81). .

孤立度CN、つまり細線化された画素の数が1又は2であれば、3×3画素において細線化された画素が孤立すると考えられる。以下、孤立度CNが0より大きく2以下であれば、細線化調整部6は細線化された画素が孤立すると判定する例を示すが、細線化された画素が孤立する判定基準として孤立度CNが0より大きく1以下の条件を用いてもよい。孤立度CNが1以下の判定基準であっても2以下の判定基準の場合と同様の効果が得られる。   If the isolation degree CN, that is, the number of thinned pixels is 1 or 2, it is considered that the thinned pixels are isolated in 3 × 3 pixels. Hereinafter, an example in which the thinning adjustment unit 6 determines that the thinned pixel is isolated if the isolation level CN is greater than 0 and equal to or less than 2 is used. However, the isolation level CN is used as a criterion for isolating the thinned pixel. A condition that is greater than 0 and equal to or less than 1 may be used. Even if the isolation criterion CN is a criterion of 1 or less, the same effect as in the case of a criterion of 2 or less can be obtained.

細線化調整部6は、CN≦2かつSW=1の場合(ステップS82;Y)、注目画素と注目画素にエッジ方向又は逆エッジ方向に隣接する周辺画素のうち、細線化された画素の細線化処理による画素値の変化量dST[25]、dST[pos]、dST[apos]を強制的に0の値にリセットする(ステップSS83)。細線化された画素がエッジ方向pos又は逆エッジ方向aposに隣接する周辺画素である場合、細線化調整部6は注目画素が細線化されていることを条件に当該周辺画素の変化量dST[pos]、dST[apos]をリセットすることが好ましい。リセット後、細線化調整部6は3×3画素(注目画素と周辺画素)の細線化処理による画素値の変化量dSTをブレンド処理部5に出力する。   When CN ≦ 2 and SW = 1 (step S82; Y), the thinning adjustment unit 6 is a thin line of the thinned pixel among the target pixel and the peripheral pixel adjacent to the target pixel in the edge direction or the reverse edge direction. The pixel value change amounts dST [25], dST [pos], and dST [apos] due to the conversion process are forcibly reset to 0 (step SS83). When the thinned pixel is a neighboring pixel adjacent to the edge direction pos or the reverse edge direction apos, the thinning adjustment unit 6 changes the amount of change dST [pos of the neighboring pixel on the condition that the target pixel is thinned. ], DST [apos] is preferably reset. After the reset, the thinning adjustment unit 6 outputs a pixel value change amount dST due to the thinning process of 3 × 3 pixels (the target pixel and the surrounding pixels) to the blend processing unit 5.

CN≦2かつSW=1を満たさない場合(ステップS82;N)、細線化された画素が孤立しないか、孤立するが細線化のリセットを実行しない設定がされているかの何れかである。何れの場合も、細線化調整部6は変化量dSTのリセットは実行せず、入力された3×3画素の細線化処理による変化量dSTをそのままブレンド処理部5に出力する。   When CN ≦ 2 and SW = 1 are not satisfied (step S82; N), either the thinned pixel is not isolated or is set to be isolated but not perform the thinning reset. In any case, the thinning adjustment unit 6 does not reset the change amount dST and outputs the input change amount dST by the thinning process of 3 × 3 pixels to the blend processing unit 5 as it is.

ブレンド処理部5の分類部50は、細線化調整部6から出力された変化量dSTを用いて前述のケース1〜4への分類を行う。注目画素の細線化が無効化された場合、ケース3又はケース4に分類される。また、画素値決定部51〜54も細線化調整部6から出力された変化量dSTを用いて前述の注目画素のG[25]、注目画素のエッジ方向pos又は逆エッジ方向aposに隣接する周辺画素の画素値G[pos]、G[apos]の決定を行う。   The classification unit 50 of the blend processing unit 5 performs classification into the above-described cases 1 to 4 using the change amount dST output from the thinning adjustment unit 6. When thinning of the pixel of interest is invalidated, it is classified into case 3 or case 4. In addition, the pixel value determination units 51 to 54 also use the change amount dST output from the thinning adjustment unit 6 to surround G [25] of the pixel of interest, the edge direction pos of the pixel of interest, or the adjacent edge direction apos The pixel values G [pos] and G [apos] of the pixel are determined.

上記細線化の無効化によって細線の再現性が向上する。
例えば、図22(a)に示すように3画素幅の細線が階段状に並ぶ斜線構造を持つ元画像に対し、スムージング処理のみを施すと、処理結果として図22(b)に示すような画像が得られる。スムージング処理によって段差部分の各画素の画素値が増減され、滑らかな斜線が形成されている。
The reproducibility of the fine line is improved by the invalidation of the fine line.
For example, as shown in FIG. 22B, when only the smoothing process is performed on the original image having the oblique line structure in which thin lines having a width of 3 pixels are arranged in a staircase pattern as shown in FIG. Is obtained. The pixel value of each pixel in the step portion is increased or decreased by the smoothing process, and a smooth diagonal line is formed.

一方、元画像に細線化処理のみを施した場合は処理結果として図22(c)に示すような画像が得られる。図22(c)に示すように細線化された画素(図22(c)中、丸で囲まれた画素)が1画素のみであり孤立する場合、ブレンド処理部5により細線化処理とスムージング処理が同時に実現されると、図22(d)において丸で囲まれた、孤立する細線化された画素において過剰に画素値が減じられ、スムージングが実現できない。   On the other hand, when only the thinning process is performed on the original image, an image as shown in FIG. 22C is obtained as a processing result. As shown in FIG. 22C, when the thinned pixel (the pixel circled in FIG. 22C) is only one pixel and is isolated, the blend processing unit 5 performs the thinning process and the smoothing process. Is simultaneously realized, the pixel value is excessively reduced in the isolated thinned pixels surrounded by a circle in FIG. 22D, and smoothing cannot be realized.

そこで、孤立する細線化された画素の細線化が無効化されると、図22(c)に示す画像に替えて図22(e)に示す画像が細線化処理の処理結果として得られる。図22(e)において丸で囲まれた画素が、細線化が無効化された画素である。その後、ブレンド処理部5により細線化処理とスムージング処理が同時に実現されると、図22(f)に示すように細線化もスムージングも実現された細線の画像が得られる。   Therefore, when the thinning of the isolated thinned pixels is invalidated, the image shown in FIG. 22E is obtained as the processing result of the thinning process instead of the image shown in FIG. In FIG. 22E, pixels surrounded by a circle are pixels in which thinning is invalidated. Thereafter, when the thinning process and the smoothing process are realized at the same time by the blend processing unit 5, a fine line image in which the thinning and the smoothing are realized is obtained as shown in FIG.

以上のように、本実施の形態によれば、画像データに細線化処理を施す細線化処理部3と、画像データにスムージング処理を施すスムージング処理部2と、画像データの各画素についてエッジ方向posを判定するエッジ方向判定部4と、注目画素、注目画素の周辺画素の各画素値、スムージング処理による画素値の変化量dSMT、細線化処理による画素値の変化量dST、注目画素について判定されたエッジ方向posを用い、注目画素における細線化の有無、スムージングの有無の組み合わせに応じて、スムージング処理と細線化処理が同時に実現されたときの注目画素の画素値G[25]を決定するブレンド処理部5と、注目画素及びその周辺画素の細線化処理による画素値の変化量dSTにより、細線化された画素が孤立するか否かを判定し、孤立すると判定された場合、注目画素又は注目画素のエッジ方向pos又は逆エッジ方向aposに隣接する周辺画素のうち、細線化された画素の細線化処理による画素値の変化量dST[25]、dST[pos]、dST[apos]を0の値にリセットする細線化調整部6と、を備える。ブレンド処理部5は、注目画素の画素値G[25]の決定に、リセットされた細線化処理による画素値の変化量dST[25]、dST[pos]、dST[apos]を用いる。   As described above, according to the present embodiment, the thinning processing unit 3 that performs thinning processing on image data, the smoothing processing unit 2 that performs smoothing processing on image data, and the edge direction pos for each pixel of the image data. Edge direction determination unit 4 for determining the pixel value of the target pixel, the surrounding pixels of the target pixel, the pixel value change amount dSMT by the smoothing process, the pixel value change amount dST by the thinning process, and the target pixel Blending process for determining the pixel value G [25] of the target pixel when the smoothing process and the thinning process are simultaneously realized according to the combination of the presence or absence of thinning and the presence or absence of smoothing using the edge direction pos Whether or not the thinned pixel is isolated by the amount of change dST of the pixel value due to the thinning processing of the pixel 5 and the pixel of interest and its surrounding pixels If the pixel value is determined to be isolated, the pixel value change amount dST [25 due to the thinning process of the thinned pixel among the target pixel or the peripheral pixels adjacent to the edge direction pos or the reverse edge direction apos of the target pixel is determined. , DST [pos], dST [apos] are reset to 0, and the thinning adjustment unit 6 is provided. The blend processing unit 5 uses the pixel value change amounts dST [25], dST [pos], and dST [apos] due to the reset thinning process to determine the pixel value G [25] of the target pixel.

これにより、細線化処理とスムージング処理を同時に実現するうえで、細線化された画素の孤立によって生じる画質の劣化を防ぐことができる。   Thereby, when realizing the thinning process and the smoothing process at the same time, it is possible to prevent the deterioration of the image quality caused by the isolation of the thinned pixels.

細線化調整部6は、細線化された画素が注目画素のエッジ方向pos又は逆エッジ方向aposに隣接する周辺画素である場合、注目画素が細線化されていることを条件に当該周辺画素の細線化処理による画素値の変化量dST[pos]、dST[apos]を0の値にリセットすることが好ましい。   When the thinned pixel is a neighboring pixel adjacent to the edge direction pos or the reverse edge direction apos of the pixel of interest, the thinning adjustment unit 6 performs a fine line adjustment of the peripheral pixel on the condition that the pixel of interest is thinned. It is preferable to reset the pixel value change amounts dST [pos] and dST [apos] to 0 values.

細線化調整部6によるリセットを実行するか否かを切り替える制御部7を備えるので、変化量dSTのリセットを実行するか否かは適宜切り替えることができる。   Since the control part 7 which switches whether the reset by the thinning adjustment part 6 is performed is provided, it can be switched suitably whether the reset of the variation | change_quantity dST is performed.

なお、上述した実施の形態は本発明の好適な一例であり、これに限定されない。
例えば、ブレンド処理部5が注目画素における細線化の有無、スムージングの有無の組み合わせをケース1〜4に分類した後に、細線化調整部6が変化量dSTのリセットを行ってもよい。この場合、画素値決定部51〜54がそれぞれ細線化調整部6を備え、図11、13、15、17に示した処理の前に、図21に示した細線化調整部6による処理を実行する。これにより、ケース1、2の場合、注目画素の変化量dST[25]がdST[25]=0にリセットされる。ケース3、4の場合、エッジ方向posに隣接する周辺画素の変化量dST[pos] 又は逆エッジ方向aposに隣接する周辺画素の変化量dST[apos]が0にリセットされる。
The above-described embodiment is a preferred example of the present invention, and the present invention is not limited to this.
For example, the thinning adjustment unit 6 may reset the amount of change dST after the blend processing unit 5 classifies combinations of the presence / absence of thinning and the presence / absence of smoothing in the target pixel into cases 1 to 4. In this case, each of the pixel value determination units 51 to 54 includes the thinning adjustment unit 6, and the processing by the thinning adjustment unit 6 illustrated in FIG. 21 is performed before the processing illustrated in FIGS. 11, 13, 15, and 17. To do. Thereby, in cases 1 and 2, the change amount dST [25] of the target pixel is reset to dST [25] = 0. In cases 3 and 4, the change amount dST [pos] of the neighboring pixels adjacent to the edge direction pos or the change amount dST [apos] of the neighboring pixels adjacent to the reverse edge direction apos is reset to zero.

上述した実施の形態ではケース1〜4の分類前に変化量dSTの値が0にリセットされるため、リセットがケース1〜4の分類に関わってくる。これに対し、ケース1〜4の分類後にリセットを行うことにより、ケース1〜4の分類は元々の変化量dSTの値を用いて行い、ブレンド処理部5が画素値の演算をするときだけリセットした変化量dSTの値を用いることができる。   In the embodiment described above, since the value of the change amount dST is reset to 0 before the classification of cases 1 to 4, the reset is related to the classification of cases 1 to 4. On the other hand, by performing a reset after classification of cases 1 to 4, the classification of cases 1 to 4 is performed using the original value of change dST, and reset only when the blend processing unit 5 calculates the pixel value. The value of the changed amount dST can be used.

また、細線化処理、スムージング処理の処理方法は、上述した処理方法に限定されない。細線化処理による画素値の変化量、スムージング処理による画素値の変化量を出力するのであれば、何れの処理方法であってもよい。   Further, the processing method of the thinning process and the smoothing process is not limited to the processing method described above. Any processing method may be used as long as the change amount of the pixel value by the thinning process and the change amount of the pixel value by the smoothing process are output.

また、ブレンド処理部5が用いる変化量dST、dSMTを、スムージング処理部2、細線化処理部3がそれぞれ算出していたが、スムージング処理部2、細線化処理部3からは処理後の画素値を出力し、ブレンド処理部5が処理後の画素値から元の画素値を差し引いて変化量dST、dSMTを算出してもよい。   Further, although the smoothing processing unit 2 and the thinning processing unit 3 respectively calculated the change amounts dST and dSMT used by the blend processing unit 5, the pixel values after processing are calculated from the smoothing processing unit 2 and the thinning processing unit 3, respectively. And the blend processing unit 5 may calculate the change amounts dST and dSMT by subtracting the original pixel value from the processed pixel value.

また、ブレンド処理部5や細線化調整部6等の各部の処理内容をプログラム化し、このプログラムとCPU等との協働によってソフトウェア処理してもよい。このとき、プログラムのコンピューター読み取り可能な媒体としては、ROM、フラッシュメモリー等の不揮発性メモリー、CD-ROM等の可搬型記録媒体を適用することが可能である。また、プログラムのデータを通信回線を介して提供する媒体として、キャリアウエーブ(搬送波)も本発明に適用される。   Moreover, the processing content of each part, such as the blend process part 5 and the thinning adjustment part 6, may be programmed, and software processing may be performed in cooperation with this program and the CPU. At this time, as a computer-readable medium for the program, a non-volatile memory such as a ROM and a flash memory, and a portable recording medium such as a CD-ROM can be applied. A carrier wave is also applied to the present invention as a medium for providing program data via a communication line.

1 画像処理装置
2 スムージング処理部
3 細線化処理部
4 エッジ方向判定部
5 ブレンド処理部
6 細線化調整部
7 制御部
DESCRIPTION OF SYMBOLS 1 Image processing apparatus 2 Smoothing process part 3 Thinning process part 4 Edge direction determination part 5 Blend process part 6 Thinning adjustment part 7 Control part

Claims (5)

画像データに細線化処理を施す細線化処理部と、
画像データにスムージング処理を施すスムージング処理部と、
画像データの各画素についてエッジ方向を判定するエッジ方向判定部と、
注目画素、注目画素の周辺画素の各画素値、前記スムージング処理による画素値の変化量、前記細線化処理による画素値の変化量、注目画素について判定された前記エッジ方向を用い、前記注目画素における細線化の有無、スムージングの有無の組み合わせに応じて、前記スムージング処理と前記細線化処理が同時に実現されたときの前記注目画素の画素値を決定するブレンド処理部と、
前記注目画素及びその周辺画素の前記細線化処理による画素値の変化量により、細線化された画素が孤立するか否かを判定し、孤立すると判定された場合、注目画素又は注目画素のエッジ方向又は逆エッジ方向に隣接する周辺画素のうち、細線化された画素の前記細線化処理による画素値の変化量を0の値にリセットする細線化調整部と、を備え、
前記ブレンド処理部は、前記注目画素の画素値の決定に、リセットされた前記細線化処理による画素値の変化量を用いる画像処理装置。
A thinning processing unit for thinning the image data;
A smoothing processing unit for performing a smoothing process on the image data;
An edge direction determination unit that determines an edge direction for each pixel of the image data;
Using the pixel value of the target pixel, each pixel value of the peripheral pixel of the target pixel, the amount of change of the pixel value by the smoothing process, the amount of change of the pixel value by the thinning process, and the edge direction determined for the target pixel, The blending processing unit that determines the pixel value of the target pixel when the smoothing processing and the thinning processing are realized at the same time according to the combination of the presence or absence of thinning and the presence or absence of smoothing;
It is determined whether or not the thinned pixel is isolated based on the amount of change in the pixel value of the target pixel and its surrounding pixels by the thinning process. If it is determined that the pixel is isolated, the target pixel or the edge direction of the target pixel Or a thinning adjustment unit that resets a change amount of a pixel value due to the thinning process of a thinned pixel among neighboring pixels adjacent in the reverse edge direction to a value of 0,
The blend processing unit uses an amount of change of a pixel value due to the thinning process that is reset to determine a pixel value of the target pixel.
前記細線化調整部は、細線化された画素が注目画素のエッジ方向又は逆エッジ方向に隣接する周辺画素である場合、注目画素が細線化されていることを条件に当該周辺画素の細線化処理による画素値の変化量を0の値にリセットする請求項1に記載の画像処理装置。   When the thinned pixel is a peripheral pixel adjacent in the edge direction or the reverse edge direction of the target pixel, the thinning adjustment unit thins the peripheral pixel on the condition that the target pixel is thinned. The image processing apparatus according to claim 1, wherein the amount of change in the pixel value due to is reset to a value of zero. 前記細線化調整部は、前記ブレンド処理部が前記注目画素の前記細線化処理による画素値の変化量及び前記スムージング処理による画素値の変化量によって、前記注目画素における細線化の有無、スムージングの有無の組み合わせを分類した後、前記リセットを行う請求項1又は2に記載の画像処理装置。   The thinning adjustment unit is configured so that the blending processing unit determines whether there is thinning or smoothing in the pixel of interest according to the amount of change in the pixel value due to the thinning processing of the pixel of interest and the amount of change in the pixel value due to the smoothing processing. The image processing apparatus according to claim 1, wherein the reset is performed after classifying the combinations. 前記細線化調整部による前記リセットを実行するか否かを切り替える制御部を備える請求項1〜3の何れか一項に記載の画像処理装置。   The image processing apparatus according to claim 1, further comprising: a control unit that switches whether to execute the reset by the thinning adjustment unit. 画像データに細線化処理を施す工程と、
画像データにスムージング処理を施す工程と、
画像データの各画素についてエッジ方向を判定する工程と、
注目画素、注目画素の周辺画素の各画素値、前記スムージング処理による画素値の変化量、前記細線化処理による画素値の変化量、注目画素について判定された前記エッジ方向を用い、前記注目画素における細線化の有無、スムージングの有無の組み合わせに応じて、前記スムージング処理と前記細線化処理が同時に実現されたときの前記注目画素の画素値を決定する工程と、
前記注目画素及びその周辺画素の前記細線化処理による画素値の変化量により、細線化された画素が孤立するか否かを判定し、孤立すると判定された場合、注目画素又は注目画素のエッジ方向又は逆エッジ方向に隣接する周辺画素のうち、細線化された画素の前記細線化処理による画素値の変化量を0の値にリセットする工程と、を含み、
前記注目画素の画素値を決定する工程は、リセットされた前記細線化処理による画素値の変化量を用いて前記注目画素の画素値を決定する画像処理方法。
A process of thinning the image data;
Applying a smoothing process to the image data;
Determining an edge direction for each pixel of the image data;
Using the pixel value of the target pixel, each pixel value of the peripheral pixel of the target pixel, the amount of change of the pixel value by the smoothing process, the amount of change of the pixel value by the thinning process, and the edge direction determined for the target pixel, The step of determining the pixel value of the pixel of interest when the smoothing process and the thinning process are realized simultaneously according to the combination of the presence or absence of thinning and the presence or absence of smoothing;
It is determined whether or not the thinned pixel is isolated based on the amount of change in the pixel value of the target pixel and its surrounding pixels by the thinning process. If it is determined that the pixel is isolated, the target pixel or the edge direction of the target pixel Or resetting the amount of change in the pixel value due to the thinning process of the thinned pixel among neighboring pixels adjacent in the reverse edge direction to a value of 0,
The step of determining the pixel value of the target pixel is an image processing method for determining the pixel value of the target pixel using the amount of change in the pixel value due to the thinning process that has been reset.
JP2012132699A 2011-06-29 2012-06-12 Image processing apparatus and program Active JP6003260B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012132699A JP6003260B2 (en) 2011-06-29 2012-06-12 Image processing apparatus and program

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2011143684 2011-06-29
JP2011143684 2011-06-29
JP2012132699A JP6003260B2 (en) 2011-06-29 2012-06-12 Image processing apparatus and program

Publications (2)

Publication Number Publication Date
JP2013034181A true JP2013034181A (en) 2013-02-14
JP6003260B2 JP6003260B2 (en) 2016-10-05

Family

ID=47390775

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012132699A Active JP6003260B2 (en) 2011-06-29 2012-06-12 Image processing apparatus and program

Country Status (2)

Country Link
US (1) US8761536B2 (en)
JP (1) JP6003260B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9736790B1 (en) * 2016-04-04 2017-08-15 Spreadtrum Communications Usa, Inc. Transceiver system supporting transmitter self calibration and methods of performing the same
US11508172B2 (en) * 2017-12-28 2022-11-22 Dst Technologies, Inc. Identifying location of shreds on an imaged form

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07334672A (en) * 1994-06-03 1995-12-22 Fuji Xerox Co Ltd Picture processor
JPH1095141A (en) * 1996-09-20 1998-04-14 Ricoh Co Ltd Image recording apparatus
JP2008085487A (en) * 2006-09-26 2008-04-10 Konica Minolta Business Technologies Inc Image processor and image processing method
JP2010062610A (en) * 2008-09-01 2010-03-18 Konica Minolta Business Technologies Inc Image processor and image processing method
JP2010191931A (en) * 2008-10-10 2010-09-02 Sharp Corp Image processing apparatus, image forming apparatus, computer program, recording medium and image processing method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3334042B2 (en) * 1999-03-24 2002-10-15 ミノルタ株式会社 IMAGE PROCESSING APPARATUS, IMAGE READING APPARATUS AND IMAGE FORMING APPARATUS EQUIPPED WITH THE SAME, IMAGE PROCESSING METHOD, AND COMPUTER-READABLE STORAGE MEDIUM CONTAINING IMAGE PROCESSING PROCEDURE
JP3983922B2 (en) * 1999-04-26 2007-09-26 コニカミノルタビジネステクノロジーズ株式会社 Image processing apparatus, image reading apparatus and image forming apparatus equipped with the same, and image processing method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07334672A (en) * 1994-06-03 1995-12-22 Fuji Xerox Co Ltd Picture processor
JPH1095141A (en) * 1996-09-20 1998-04-14 Ricoh Co Ltd Image recording apparatus
JP2008085487A (en) * 2006-09-26 2008-04-10 Konica Minolta Business Technologies Inc Image processor and image processing method
JP2010062610A (en) * 2008-09-01 2010-03-18 Konica Minolta Business Technologies Inc Image processor and image processing method
JP2010191931A (en) * 2008-10-10 2010-09-02 Sharp Corp Image processing apparatus, image forming apparatus, computer program, recording medium and image processing method

Also Published As

Publication number Publication date
US8761536B2 (en) 2014-06-24
JP6003260B2 (en) 2016-10-05
US20130004098A1 (en) 2013-01-03

Similar Documents

Publication Publication Date Title
JP5609903B2 (en) Image processing apparatus and image processing method
JP4053345B2 (en) Image processing method, image processing apparatus, image forming apparatus including the same, program, and recording medium
JP2564959B2 (en) Pictogram area identification method for image processing device
JP3585703B2 (en) Image processing device
CN101151883A (en) Image processing method, display image processing method, image processing device, and integrated circuit containing the image processing device
KR20150097367A (en) Method and apparatus for adjusting image
JP5076186B2 (en) Image enlargement method
JP6003260B2 (en) Image processing apparatus and program
JP2015119209A (en) Image processing device, image processing method, and program
CN112150368A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
JP3644716B2 (en) Image region separation method and image region separation device, and image processing method and image processing device
JP6003259B2 (en) Image processing apparatus and program
JP2006270897A (en) Image processing device, method and program
US8565548B2 (en) Image processing apparatus which performs anti-aliasing on input image data and image processing method thereof
JP2006287623A (en) Input image correction device, method, and program, image processor, image formation apparatus, and recording medium
JP2003309725A (en) Image processing method, image processing apparatus, and image forming apparatus provided therewith
JP6335016B2 (en) Image processing apparatus and method
JP4067538B2 (en) Image processing method, image processing apparatus, image forming apparatus, computer program, and recording medium
JP3854060B2 (en) Image processing apparatus, image forming apparatus, image processing method, and recording medium
JP2954230B2 (en) Image processing device
JP2702133B2 (en) Image processing method
JPH05153393A (en) Image processor
JP4184010B2 (en) Image processing device
JP2006203939A (en) Image processing apparatus
JP2000236450A (en) Image processing unit

Legal Events

Date Code Title Description
A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20130416

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150216

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20151228

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20160126

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20160310

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: 20160809

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20160822

R150 Certificate of patent or registration of utility model

Ref document number: 6003260

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150