JP6263951B2 - Image processing apparatus and program - Google Patents
Image processing apparatus and program Download PDFInfo
- Publication number
- JP6263951B2 JP6263951B2 JP2013220565A JP2013220565A JP6263951B2 JP 6263951 B2 JP6263951 B2 JP 6263951B2 JP 2013220565 A JP2013220565 A JP 2013220565A JP 2013220565 A JP2013220565 A JP 2013220565A JP 6263951 B2 JP6263951 B2 JP 6263951B2
- Authority
- JP
- Japan
- Prior art keywords
- color
- image information
- unit
- target pixel
- value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Image Processing (AREA)
- Facsimile Image Signal Circuits (AREA)
- Color Image Communication Systems (AREA)
Description
本発明は、画像処理装置、画像読み取り装置、画像形成装置、プログラムに関する。 The present invention relates to an image processing apparatus, an image reading apparatus, an image forming apparatus, and a program.
従来、スキャナ等で読み取るなどして得られた画像を二値化し、二値画像情報とする装置が知られている。 2. Description of the Related Art Conventionally, an apparatus that binarizes an image obtained by reading with a scanner or the like to obtain binary image information is known.
特許文献1には、少なくとも2つの色チャネルから走査カラー画像データを得て、走査カラー画像データ内で、フォアグラウンド内容とバックグラウンド内容とを含有する少なくとも1つの関心領域を識別し、少なくとも1つの閾値データ値は、関心領域内のフォアグラウンド内容とバックグラウンド内容との間で異なる画像属性に従って得られ、文書の走査カラー画像データは、関心領域から得られた少なくとも1つの閾値データ値に従って、複調画像データに変換される文書から複調画像データを得る方法が開示されている。
また特許文献2には、各色のフィルタを通した画像のエッジ情報を検出する複数のエッジ部と、エッジ検出部の出力の論理和をとる論理和回路と、カラー画像を白黒変換した画像をエッジ検出する検出部と、論理和回路の出力とエッジ検出部の出力との排他的論理和をとる排他的論理和回路と、カラー画像を白黒変換した画像を2値化する多値2値変換部の出力と、排他的論理和回路の排他的論理和をとる排他的論理和回路を備えるファクシミリ装置が開示されている。
In US Pat. No. 6,057,033, scanned color image data is obtained from at least two color channels, at least one region of interest containing foreground content and background content is identified in the scanned color image data, and at least one threshold value is identified. The data values are obtained according to image attributes that differ between the foreground content and the background content within the region of interest, and the scanned color image data of the document is determined according to at least one threshold data value obtained from the region of interest. A method for obtaining bi-tonal image data from a document converted to data is disclosed.
本発明は、入力画像情報の二値化を行う際に、文字と背景との境界がより明瞭な二値画像を得られることが望ましい。 In the present invention, it is desirable to obtain a binary image with a clearer boundary between characters and background when binarizing input image information.
請求項1に記載の発明は、予め定められた色空間における画像情報である入力画像情報を取得する入力画像情報取得部と、前記入力画像情報取得部によって取得された前記入力画像情報を基に注目画素を選択する注目画素選択部と、前記注目画素選択部により選択された前記注目画素を含む予め定められた範囲の画像領域を局所領域として設定する局所領域設定部と、前記局所領域設定部により設定された前記局所領域に含まれる画素の色値の平均値である平均色値を算出する平均色値算出部と、前記平均色値算出部により算出された前記平均色値と前記注目画素の色値との差を前記色空間におけるベクトル量で表した色変位を算出する色変位算出部と、前記色変位算出部により算出された前記色変位に基づき前記注目画素の画像情報を二値化する二値化決定部と、を備え、前記局所領域設定部は、前記画像領域の大きさが異なる複数の前記局所領域を設定し、前記二値化決定部は、前記色変位の大きさが予め定められた値以上となる前記複数の局所領域の中から最小の画像領域のものについて算出された当該色変位を基にして前記注目画素の画像情報を二値化することを特徴とする画像処理装置である。
請求項2に記載の発明は、予め定められた色空間における画像情報である入力画像情報を取得する入力画像情報取得部と、前記入力画像情報取得部によって取得された前記入力画像情報を基に注目画素を選択する注目画素選択部と、前記注目画素選択部により選択された前記注目画素を含む予め定められた範囲の画像領域を局所領域として設定する局所領域設定部と、前記局所領域設定部により設定された前記局所領域に含まれる画素の色値の平均値である平均色値を算出する平均色値算出部と、前記平均色値算出部により算出された前記平均色値と前記注目画素の色値との差を前記色空間におけるベクトル量で表した色変位を算出する色変位算出部と、前記色変位算出部により算出された前記色変位に基づき前記注目画素の画像情報を二値化する二値化決定部と、を備え、前記局所領域設定部は、前記画像領域の大きさが異なる複数の前記局所領域を設定し、前記二値化決定部は、前記色変位の方向が類似する前記局所領域の中から最大の画像領域のものについて算出された当該色変位を基にして前記注目画素の画像情報を二値化することを特徴とする画像処理装置である。
請求項3に記載の発明は、前記二値化決定部は、前記色変位の大きさおよび/または方向に基づき前記注目画素の画像情報を二値化することを特徴とする請求項1または2に記載の画像処理装置である。
請求項4に記載の発明は、前記二値化決定部は、前記色変位算出部が算出した前記色変位から特定の色軸を選択し、当該特定の色軸についての色変位に基づき前記注目画素の画像情報を二値化することを特徴とする請求項1乃至3の何れか1項に記載の画像処理装置である。
請求項5に記載の発明は、コンピュータに、予め定められた色空間における画像情報である入力画像情報を取得する機能と、取得された前記入力画像情報を基に注目画素を選択する機能と、選択された前記注目画素を含む予め定められた範囲の画像領域を局所領域として設定する機能と、設定された前記局所領域に含まれる画素の色値の平均値である平均色値を算出する機能と、算出された前記平均色値と前記注目画素の色値との差を前記色空間におけるベクトル量で表した色変位を算出する機能と、算出された前記色変位に基づき前記注目画素の画像情報を二値化する機能と、を実現させ、前記設定する機能は、前記画像領域の大きさが異なる複数の前記局所領域を設定し、前記二値化する機能は、前記色変位の大きさが予め定められた値以上となる前記複数の局所領域の中から最小の画像領域のものについて算出された当該色変位を基にして前記注目画素の画像情報を二値化するプログラムである。
請求項6に記載の発明は、コンピュータに、予め定められた色空間における画像情報である入力画像情報を取得する機能と、取得された前記入力画像情報を基に注目画素を選択する機能と、選択された前記注目画素を含む予め定められた範囲の画像領域を局所領域として設定する機能と、設定された前記局所領域に含まれる画素の色値の平均値である平均色値を算出する機能と、算出された前記平均色値と前記注目画素の色値との差を前記色空間におけるベクトル量で表した色変位を算出する機能と、算出された前記色変位に基づき前記注目画素の画像情報を二値化する機能と、を実現させ、前記設定する機能は、前記画像領域の大きさが異なる複数の前記局所領域を設定し、前記二値化する機能は、前記色変位の方向が類似する前記局所領域の中から最大の画像領域のものについて算出された当該色変位を基にして前記注目画素の画像情報を二値化するプログラム
The invention according to
The invention according to
The invention according to claim 3, wherein the binarization decision unit according to
According to a fourth aspect of the present invention, the binarization determination unit selects a specific color axis from the color displacement calculated by the color displacement calculation unit, and the attention is based on the color displacement with respect to the specific color axis. the image processing apparatus according to any one of
According to a fifth aspect of the present invention, the computer has a function of acquiring input image information that is image information in a predetermined color space, a function of selecting a target pixel based on the acquired input image information, A function of setting an image area in a predetermined range including the selected pixel of interest as a local area, and a function of calculating an average color value that is an average value of color values of pixels included in the set local area And a function of calculating a color displacement in which a difference between the calculated average color value and the color value of the target pixel is represented by a vector amount in the color space, and an image of the target pixel based on the calculated color displacement A function for binarizing information, and the function for setting sets a plurality of the local areas having different sizes of the image area, and the function for binarizing is a magnitude of the color displacement. Is a predetermined value Is a program for binarizing the image information of the pixel of interest based on the color displacement calculated for the smallest image area from the plurality of local regions to be the upper.
According to a sixth aspect of the present invention, a computer has a function of acquiring input image information that is image information in a predetermined color space, a function of selecting a target pixel based on the acquired input image information, A function of setting an image area in a predetermined range including the selected pixel of interest as a local area, and a function of calculating an average color value that is an average value of color values of pixels included in the set local area And a function of calculating a color displacement in which a difference between the calculated average color value and the color value of the target pixel is represented by a vector amount in the color space, and an image of the target pixel based on the calculated color displacement A function for binarizing information, and the function for setting sets a plurality of the local areas having different sizes of the image area, and the function for binarizing has a direction of the color displacement. Similar local regions Program for binarizing the image information of the pixel of interest based on the color displacement calculated for the largest image area from the
請求項1の発明によれば、本構成を採用しない場合に比較して、文字と背景との境界がより明瞭な二値画像を得られる画像処理装置を提供することができる。また本構成を採用しない場合に比較して、二値化処理の精度がより向上する。
請求項2の発明によれば、本構成を採用しない場合に比較して、文字と背景との境界がより明瞭な二値画像を得られる画像処理装置を提供することができる。また本構成を採用しない場合に比較して、二値化処理の精度がより向上する。
請求項3の発明によれば、本構成を採用しない場合に比較して、注目画素の二値化処理がより容易になる。
請求項4の発明によれば、本構成を採用しない場合に比較して、二値化処理に要する処理時間がより短くなる。
請求項5の発明によれば、本構成を採用しない場合に比較して、文字と背景との境界がより明瞭な二値画像を得られる処理をコンピュータにより実現できる。また本構成を採用しない場合に比較して、二値化処理の精度がより向上する。
請求項6の発明によれば、本構成を採用しない場合に比較して、文字と背景との境界がより明瞭な二値画像を得られる処理をコンピュータにより実現できる。また本構成を採用しない場合に比較して、二値化処理の精度がより向上する。
According to the first aspect of the present invention, it is possible to provide an image processing apparatus that can obtain a binary image with a clearer boundary between the character and the background than when the present configuration is not adopted. Further, the accuracy of the binarization process is further improved as compared with the case where this configuration is not adopted.
According to the second aspect of the present invention, it is possible to provide an image processing apparatus capable of obtaining a binary image with a clearer boundary between the character and the background than when this configuration is not employed. Further, the accuracy of the binarization process is further improved as compared with the case where this configuration is not adopted.
According to the third aspect of the present invention, the binarization processing of the target pixel becomes easier as compared with the case where this configuration is not adopted.
According to the fourth aspect of the present invention, the processing time required for the binarization process is shorter than when this configuration is not adopted.
According to the fifth aspect of the present invention, a process for obtaining a binary image with a clearer boundary between the character and the background can be realized by a computer as compared with the case where this configuration is not adopted. Further, the accuracy of the binarization process is further improved as compared with the case where this configuration is not adopted.
According to the sixth aspect of the present invention, a process for obtaining a binary image with a clearer boundary between the character and the background can be realized by a computer as compared with the case where this configuration is not adopted. Further, the accuracy of the binarization process is further improved as compared with the case where this configuration is not adopted.
以下、添付図面を参照して、本発明の実施の形態について詳細に説明する。 Embodiments of the present invention will be described below in detail with reference to the accompanying drawings.
<画像読み取り装置の説明>
図1は、本実施の形態の画像処理装置が適用される画像読み取り装置1の機能構成について説明したブロック図である。
図示する画像読み取り装置1は、原稿の画像を読み取り得られた画像情報を二値化して二値画像情報を作成する。そして画像読み取り装置1は、後処理部にてこの二値画像情報を利用した予め定められた処理を行う。
<Description of Image Reading Device>
FIG. 1 is a block diagram illustrating a functional configuration of an
An
図1では、画像読み取り装置1のうち、制御部10、画像読み取りユニット20、信号処理部30、後処理部40を示している。
FIG. 1 shows a
制御部10は、画像読み取り装置1の画像読み取り動作における各部の制御を行う。図示する例では、制御部10は、画像読み取りユニット20、信号処理部30、後処理部40を制御する。
The
画像読み取りユニット20は、原稿の画像を読み取る画像読み取り手段の一例である。そして画像読み取りユニット20は、駆動モータ21、発光部22、受光部23とを備える。
発光部22は、複数の発光素子(例えば、LED(Light Emitting Diode))を主走査方向に並べて配置したものである。また受光部23は、CCD(Charge Coupled Devices)で受光するCCD方式や、発光部22から原稿に順に照射した光に対する反射光をCIS(Contact Image Sensor)で受光するCIS方式のものを用いることができる。
The
The light emitting unit 22 is configured by arranging a plurality of light emitting elements (for example, LEDs (Light Emitting Diodes)) side by side in the main scanning direction. The
駆動モータ21は、画像読み取りユニット20を副走査方向およびその逆方向に移動させる。そして発光部22が、原稿に対して予め定められた光量で光を原稿に照射する。さらに受光部23が、原稿から反射された光を受光することにより生成された画像データであるR信号、G信号、B信号を信号処理部30に送信する。
The
信号処理部30は、サンプルホールド部31と、ゲイン調整部32と、オフセット調整部33と、A/D変換部34と、シェーディング補正部35と、二値化処理部36とを備える。
The
サンプルホールド部31は、受光部23から出力されたアナログ画像信号であるR信号、G信号、B信号をサンプリングする。
ゲイン調整部32は、発光部22の点灯状態で受光部23から出力された電圧がA/D変換部34の最高入力電圧に近い値となるように調整する。
オフセット調整部33は、発光部22の消灯状態で受光部23から出力された電圧がA/D変換部34の最低入力電圧に近い値となるように調整する。
The sample hold
The
The
A/D変換部34は、オフセット調整部33から出力されたアナログ画像信号をデジタル画像信号に変換する。
シェーディング補正部35は、A/D変換部34から出力されたデジタル画像信号に対し、シェーディングデータを用いて、主走査方向の読み取り濃度差の補正を施す。
二値化処理部36は、画像読み取りユニット20により読み取られた原稿の画像情報を、予め定められた色空間における画像情報から二値画像情報に変換する処理を行う画像処理手段として機能する。ここではRGB色空間における画像情報であるRGB信号を二値化し、二値画像情報とする処理を行う。二値化処理部36については、後でより詳しく説明を行う。
The A /
The
The
なおこれら信号処理部30が行なう各機能は、ASIC(Application Specific Integrated Circuit)等を設けることにより実現することができる。
Each function performed by the
後処理部40は、二値化処理部36により作成された二値画像情報を利用した処理を行う。
この後処理部40は、例えば、後述する画像形成装置2の画像形成部70(図2参照)にて画像を形成するための二値画像情報を直接送信するための画像情報送信部である。これにより画像形成装置2にて二値画像の形成が行われる。この場合、画像読み取り装置1は、原稿の画像を読み取り、得られた二値画像情報により画像を形成する画像形成ユニットにおいて原稿の画像を読み取るスキャナ部として捉えることもできる。
またこの後処理部40は、例えば、ファクシミリ送信を行う機能部である。即ち、外部機器であるファクシミリ装置に対し、公衆電話回線、もしくはLAN(Local Area Network)、インターネット等のネットワークを介して二値画像情報を送信する。この場合、画像読み取り装置1は、ファクシミリ装置として捉えることもできる。
さらにこの後処理部40は、例えば、原稿の画像情報を保存するドキュメントアーカイブを行う機能部である。即ち、得られた二値画像情報をHDD(Hard Disk Drive等に蓄積する。そして他のパーソナルコンピュータ、携帯端末等からの操作により必要なドキュメントの情報がHDDからダウンロードされ、パーソナルコンピュータ、携帯端末等でこのドキュメントの画像が表示される。この場合、画像読み取り装置1は、ドキュメントアーカイブシステムとして捉えることもできる。
またさらにこの後処理部40は、例えば、文字認識を行う機能部である。即ち、得られた二値画像情報を基に、前もって記憶されたパターンとの照合により二値画像情報に含まれる文字を特定する。この場合、画像読み取り装置1は、OCR(Optical Character Reader)として捉えることもできる。
The
The
The
Further, the
Further, the
<画像形成装置の説明>
図2は、本実施の形態の画像処理装置が適用される画像形成装置2の機能構成について説明したブロック図である。
図示する画像形成装置2は、外部装置であるパーソナルコンピュータ、携帯端末等から送られた画像情報を二値化して二値画像情報を作成する。そして画像形成装置2は、得られた二値画像情報を基に画像形成部にて二値画像の形成が行われる。
<Description of Image Forming Apparatus>
FIG. 2 is a block diagram illustrating a functional configuration of the
An
図示するように画像形成装置2は、通信I/F50と、制御部60と、画像形成部70とを備える。
As illustrated, the
通信I/F50は、ネットワークを介して外部装置であるパーソナルコンピュータや携帯端末との間で各種情報の送受信を行う。
The communication I /
制御部60は、印刷データを受け取りページ記述言語(PDL:Page Description Language)に変換するPDL生成部61と、PDL生成部61により生成されたPDLからラスタイメージを作成するラスタライズ(rasterize)部62と、RGBデータをYMCKデータに変換する色変換処理部63と、色変換処理部63により変換されたラスタイメージの調整を行なうラスタイメージ調整部64と、YMCKデータを二値化し二値画像情報とする二値化処理部65とを備える。
The
本実施の形態では、まずPDL生成部61がPCから印刷データを受け取る。この画像データは、パーソナルコンピュータや携帯端末を使用するユーザが、画像形成装置2により印刷したい画像情報である。画像情報を受け取ったPDL生成部61は、これをPDLで記述されたコードデータに変換して出力する。
In the present embodiment, first, the
ラスタライズ部62は、PDL生成部61から出力されてくるPDLで記述されたコードデータを各画素毎のラスタデータに変換し、ラスタイメージとする。そして、ラスタライズ部62は、変換後のラスタデータをRGB(Red、Green、Blue)のビデオデータ(RGBビデオデータ)として出力する。このとき、ラスタライズ部62は、1ページ毎にRGBデータを出力することになる。
The rasterizing
色変換処理部63は、ラスタライズ部62から入力されるRGBデータをデバイスインディペンデントな[XYZ]、[L*a*b*]、[L*u*v*]等のカラーバリューに変換した後、画像形成装置2の再現色(イエロー、マゼンタ、シアン、黒)であるYMCKデータに変換して出力する。このYMCKデータは、色毎に分離されたY色データ、M色データ、C色データ、K色データで構成され、ここでは画像情報の一例として捉えることができる。
The color
ラスタイメージ調整部64は、色変換処理部63から入力されるYMCKデータに対し、γ変換、精細度処理、中間調処理等を施すことで、より良好な画質を画像形成装置2で得られるように各種の調整を行なう。
The raster
二値化処理部65は、予め定められた色空間における画像情報から二値画像情報に変換する処理を行う画像処理手段の一例である。ここではYMCK色空間における画像情報であるYMCKデータを二値化し、二値画像情報とする処理を行う。
二値化処理部65については、後でより詳しく説明を行う。
The
The
画像形成部70は、画像形成手段の一例であり、二値化処理部65により生成された二値画像情報を基に記録媒体である用紙等に画像を形成する。画像形成部70は、例えばプリンタであり、感光体に付着させたトナーを記録媒体に転写して像を形成する電子写真方式や、インクを記録媒体上に吐出して像を形成するインクジェット方式のものを用いることができる。
The
ここで従来、画像読み取り装置1や画像形成装置2で、画像情報を二値化する場合に下記のような問題があった。
(1)画像情報について背景の判定を行い、これにより例えば、文字をON、背景をOFFとして二値化を行う場合、判定精度に補正精度が依存する。
(2)エッジ情報の重畳、または隣接近傍領域を補正して二値化を行う場合、例えば、小さい文字などの場合、文字と背景との間に明瞭な境界が得られにくいとともに、線幅が広い文字の場合、線の中央付近に抜け(白抜け)が発生する場合がある。
(3)エッジ検出、周波数変化分析、ヒストグラム判定などを行う場合、処理時間が長くなる。
Heretofore, when the image information is binarized in the
(1) When the background of image information is determined, and binarization is performed with, for example, characters set to ON and background set to OFF, the correction accuracy depends on the determination accuracy.
(2) When binarization is performed by superimposing edge information or correcting adjacent neighboring areas, for example, in the case of a small character, it is difficult to obtain a clear boundary between the character and the background, and the line width is In the case of wide characters, omission (white omission) may occur near the center of the line.
(3) When performing edge detection, frequency change analysis, histogram determination, etc., the processing time becomes long.
<二値化処理部の機能構成の説明>
本実施の形態では、以上の問題点の抑制を図るため、画像情報の二値化を行う上述した二値化処理部を以下の構成としている。なお以下の説明では、図2の二値化処理部65を例にとり説明を行う。
<Description of functional configuration of binarization processing unit>
In the present embodiment, in order to suppress the above problems, the above-described binarization processing unit that binarizes image information has the following configuration. In the following description, the
図3は、本実施の形態の二値化処理部65の機能構成について説明したブロック図である。
本実施の形態の二値化処理部65は、入力画像情報取得部651と、注目画素選択部652と、局所領域設定部653と、局所領域サイズ記憶部654と、平均色値算出部655と、色変位算出部656と、二値化決定部657と、二値画像情報出力部658とを備える。
FIG. 3 is a block diagram illustrating a functional configuration of the
The
入力画像情報取得部651は、予め定められた色空間における画像情報である入力画像情報を取得する。本実施の形態では、入力画像情報取得部651は、制御部60のラスタイメージ調整部64(図2参照)からのYMCK色空間における画像情報を入力画像情報として取得する。
The input image
注目画素選択部652は、入力画像情報取得部651によって取得された入力画像情報を基に注目画素を選択する。詳しくは後述するが、注目画素は、入力画像を構成する画素の中から選択される一画素である。そして入力画像を構成する画素について順に選択されていく。
The target
局所領域設定部653は、注目画素選択部652により選択された注目画素を含む予め定められた範囲の画像領域を局所領域として設定する。詳しくは後述するが、局所領域は、入力画像の中の予め定められた範囲の画像領域であり、注目画素が例えば、その中央付近に位置するようにする。
The local
局所領域サイズ記憶部654は、局所領域の大きさを記憶する。局所領域は、例えば、正方形であり、この場合、局所領域サイズ記憶部654は、この正方形の大きさを記憶する。また詳しくは後述するが、局所領域の大きさは、大きさが異なる複数のものが用意されるときがある。この場合、局所領域サイズ記憶部654は、それぞれの局所領域の大きさを記憶する。なお局所領域の形状は正方形に限られるものではなく、長方形、六角形、円形など他の形状でもよい。
The local area
平均色値算出部655は、局所領域設定部653により設定された局所領域に含まれる画素の色値の平均値である平均色値を算出する。つまり平均色値算出部655は、色空間がYMCK色空間であったときは、局所領域に含まれる全ての画素についてのY色、M色、C色、K色の色値のそれぞれの合計値を算出し、画素数で除算することで平均値を算出する。そしてY色、M色、C色、K色毎について、この平均値を平均色値とする。
The average color
色変位算出部656は、平均色値算出部655により算出された平均色値と注目画素の色値との差を使用する色空間におけるベクトル量で表した色変位を算出する。即ち、使用する色空間中において、平均色値を始点とし、注目画素の色値を終点とするベクトル量を考えることができる。このベクトル量は、大きさおよび方向を有する。ここではベクトル量を色変位とし、色変位算出部656では、この色変位を算出する。
The color
二値化決定部657は、色変位算出部656により算出された色変位に基づき注目画素の画像情報を二値化する。詳しくは後述するが、二値化決定部657は、ベクトル量である色変位の大きさおよび/または方向に基づき注目画素の画像情報を二値化する。
The
二値画像情報出力部658は、二値化決定部657により生成された二値画像情報を画像形成部70(図2参照)に対し、出力する。
The binary image
<二値化処理部の動作の説明>
図4は、本実施の形態の二値化処理部65の動作について説明したフローチャートである。
以下、図3および図4を使用して本実施の形態の二値化処理部の動作について説明を行う。
<Description of operation of binarization processing unit>
FIG. 4 is a flowchart for explaining the operation of the
Hereinafter, the operation of the binarization processing unit of the present embodiment will be described with reference to FIGS. 3 and 4.
まず入力画像情報取得部651が、入力画像情報を取得する(ステップ101)。本実施の形態では、入力画像情報取得部651は、YMCK色空間におけるYMCKデータを入力画像情報として取得する。
First, the input image
次に注目画素選択部652が、入力画像情報を基に注目画素を選択する(ステップ102)。ここで注目画素は、入力画像の中から選択される一画素であり、二値化の対象となる画素である。注目画素は、入力画像の例えば、第1行目の第1列目に位置する画素から選択が開始され、第1行目の画素が順に選択される。さらに1つの行の画素の選択が全て終了すると次の行の画素が同様に順に選択されていく。これは、最終行目の最終列目の画素が選択されるまで続けられる。
Next, the pixel-of-
そして局所領域設定部653が、注目画素を含む予め定められた範囲の画像領域を局所領域として設定する(ステップ103)。局所領域の大きさは、局所領域設定部653が局所領域サイズ記憶部654を参照して決定される。局所領域は、入力画像の中において予め定められた範囲を切り出した画像領域である。そして注目画素が局所領域の中央付近に位置するように設定することが好ましい。また詳しくは後述するが、このとき複数の大きさの局所領域が選択されることがある。
Then, the local
次に平均色値算出部655が、局所領域に含まれる画素の色値の平均値である平均色値を算出する(ステップ104)。本実施の形態では、使用する色空間がYMCK色空間であるので、Y色、M色、C色、K色の4色のそれぞれに対し、局所領域に含まれる画素の色値の平均色値が算出される。なお局所領域設定部653で複数の大きさの局所領域が選択されたときは、この大きさが異なる局所領域毎に平均色値がさらにそれぞれ算出される。例えば、局所領域が3種類選択された場合は、平均色値算出部655で算出される平均色値は、4色×3種類=12個となる。
Next, the average color
次に色変位算出部656が、平均色値と注目画素の色値との差を使用する色空間におけるベクトル量で表した色変位を算出する(ステップ105)。このときのベクトル量は、
使用する色空間中において、平均色値を始点とし、注目画素の色値を終点とするベクトル量となる。例えばY色、M色、C色、K色のそれぞれの平均色値が、Yave、Mave、Cave、Kaveであり、注目画素のY色、M色、C色、K色のそれぞれの色値がC0、M0、Y0、K0だったとする。このときYMCK色空間中における座標として、(Yave、Mave、Cave、Kave)を始点とし、(Y0、M0、C0、K0)を終点とするベクトル量が色変位となる。またYMCK色空間中の座標(Yave、Mave、Cave、Kave)を点A、座標(Y0、M0、C0、K0)を点Bとすれば、ABベクトルが色変位となる。
またこのとき色変位の大きさは、A(Yave、Mave、Cave、Kave)とB(Y0、M0、C0、K0)との距離となり、色変位の方向は、A(Yave、Mave、Cave、Kave)からB(Y0、M0、C0、K0)への方向となる。
Next, the color
In the color space to be used, this is a vector quantity starting from the average color value and ending at the color value of the pixel of interest. For example, the average color values of Y color, M color, C color, and K color are Yave, Mave, Cave, and Kave, and the color values of Y color, M color, C color, and K color of the pixel of interest are It is assumed that they are C0, M0, Y0, K0. At this time, as a coordinate in the YMCK color space, a vector amount starting from (Yave, Mave, Cave, Kave) and ending at (Y0, M0, C0, K0) is a color displacement. If the coordinates (Yave, Mave, Cave, Kave) in the YMCK color space are point A and the coordinates (Y0, M0, C0, K0) are point B, the AB vector is the color displacement.
At this time, the magnitude of the color displacement is the distance between A (Yave, Mave, Cave, Kave) and B (Y0, M0, C0, K0), and the direction of the color displacement is A (Yave, Mave, Cave, The direction is from Kave) to B (Y0, M0, C0, K0).
そして二値化決定部657が、色変位に基づき注目画素の画像情報を二値化する(ステップ106)。
さらに注目画素選択部652が、選択すべき注目画素がさらに存在するか否かを判定する(ステップ107)。
そして選択すべき注目画素が存在する場合(ステップ107でYes)、ステップ102に戻る。一方、選択すべき注目画素が存在しない場合(ステップ107でNo)、二値画像情報出力部658が、生成された二値画像情報を画像形成部70に対し出力する(ステップ108)。
Then, the
Further, the pixel-of-
If there is a target pixel to be selected (Yes in Step 107), the process returns to Step 102. On the other hand, when there is no target pixel to be selected (No in Step 107), the binary image
<注目画素の画像情報を二値化する方法の説明>
二値化決定部657が、色変位に基づき注目画素の画像情報を二値化する方法としては、種々の方法が存在する。
<Description of method for binarizing image information of target pixel>
There are various methods for the
図5は、二値化決定部657が、色変位に基づき注目画素の画像情報を二値化する方法の一例について説明した図である。
図5では、YMCK色空間中における色変位を概念的に図示している。
図中色変位は、ABベクトルとして図示されている。そしてこのとき色変位の大きさ(ABベクトルの大きさ)が、この閾値より大きいときは、二値化決定部657は、注目画素の二値画像情報をON(黒)とする。一方、色変位の大きさが、この閾値以下であるときは、二値化決定部657は、注目画素の二値画像情報をOFF(白)とする。
つまり図5で説明した例では、二値化決定部657は、色変位の大きさに基づき注目画素の画像情報を二値化する、と言うことができる。
FIG. 5 is a diagram illustrating an example of a method in which the
FIG. 5 conceptually illustrates color displacement in the YMCK color space.
In the figure, the color displacement is shown as an AB vector. At this time, when the magnitude of the color displacement (the magnitude of the AB vector) is larger than this threshold value, the
That is, in the example described with reference to FIG. 5, it can be said that the
また二値化決定部657は、色変位の大きさに加え、色変位の方向を加味して注目画素の画像情報を二値化してもよい。
この場合、例えば、色変位の明度軸に沿った方向(明度軸方向)を加味することが考えられる。つまり色変位の大きさが、閾値より大きいときに、色変位の方向が明度が小さくなる方向であるときは、上述の通り、注目画素の二値画像情報をON(黒)とする。即ち、入力画像の中で文字は、通常は明度が小さい画像として描かれる。よってこのようにすることで、画像情報を二値化するときに文字の箇所をON(黒)とすることができる。対して、色変位の大きさが、閾値より大きいときに、色変位の方向が明度が大きくなる方向であるときは、注目画素の二値画像情報をOFF(白)とする。色変位の明度軸方向は、明度ベクトルと色変位の内積を採ることで導出することができる。
Further, the
In this case, for example, it is conceivable to consider a direction along the lightness axis of the color displacement (lightness axis direction). That is, when the magnitude of the color displacement is larger than the threshold and the direction of the color displacement is a direction in which the brightness is reduced, as described above, the binary image information of the target pixel is set to ON (black). That is, in the input image, characters are usually drawn as an image having a low brightness. Therefore, by doing in this way, the character part can be turned ON (black) when the image information is binarized. On the other hand, when the magnitude of the color displacement is larger than the threshold value and the direction of the color displacement is a direction in which the brightness increases, the binary image information of the target pixel is set to OFF (white). The lightness axis direction of the color displacement can be derived by taking the inner product of the lightness vector and the color displacement.
なお色変位の方向としては、明度軸方向に限られるものではなく、他の色軸を採用してもよい。例えば、明度ベクトルと色変位の内積が予め定められた値に達しなかったときは、他の色軸として、Y色の色軸に沿った方向(Y色軸方向)を考え、色変位の方向としてY値が大きくなる方向であるときは、注目画素の二値画像情報をON(黒)とし、Y値が小さくなる方向であるときは、注目画素の二値画像情報をOFF(白)としてもよい。またC色の色軸に沿った方向(C色軸方向)、M色の色軸に沿った方向(M色軸方向)を採用してもよい。 The direction of color displacement is not limited to the lightness axis direction, and other color axes may be employed. For example, when the inner product of the brightness vector and the color displacement does not reach a predetermined value, the direction along the Y color axis (Y color axis direction) is considered as the other color axis, and the direction of the color displacement When the Y value is in the increasing direction, the binary image information of the target pixel is set to ON (black). When the Y value is in the decreasing direction, the binary image information of the target pixel is set to OFF (white). Also good. A direction along the C color axis (C color axis direction) and a direction along the M color axis (M color axis direction) may be employed.
また二値化決定部657は、色変位算出部656が算出した色変位から特定の色軸を選択し、この特定の色軸についての色変位に基づき注目画素の画像情報を二値化してもよい。
つまり図5の例では、ABベクトルの大きさを算出するのではなく、例えば、色軸としてY色の色軸を選択する。そしてY色についての平均色値と注目画素の色値の差である、Y0−Yaveの値と、予め定められた閾値とを比較する。そしてY0−Yaveの値が、この閾値より大きいときは、二値化決定部657は、注目画素の二値画像情報をON(黒)とする。一方、色変位の大きさが、この閾値以下であるときは、二値化決定部657は、注目画素の二値画像情報をOFF(白)とする。
この方法では、ABベクトルの大きさを求めるより、二値化決定部657で行う処理が少なくてすむという利点がある。
Further, the
That is, in the example of FIG. 5, the size of the AB vector is not calculated, but, for example, the Y color axis is selected as the color axis. Then, the value of Y0−Yave, which is the difference between the average color value for Y color and the color value of the target pixel, is compared with a predetermined threshold value. When the value of Y0-Yave is larger than the threshold value, the
This method has the advantage that less processing is performed in the
なおこのときY色、M色、C色、K色のうちどの色軸を選択するかが問題となるが、それぞれの色軸のうち、平均色値と注目画素の色値の差が最も大きい色軸を選択すればよい。即ち、Y0−Yave、M0−Mave、C0−Cave、K0−Kaveの値をそれぞれ算出し、これらの色値の差の中から最大のものを選択すればよい。またはYMCKのうち注目画素の色値が最も大きいものを選択してもよい。即ち、Y0、M0、C0、K0のうち最も大きいものについての色軸を選択する。 At this time, there is a problem of which color axis to select from among Y color, M color, C color, and K color, but of each color axis, the difference between the average color value and the color value of the target pixel is the largest. A color axis may be selected. That is, the values of Y0-Yave, M0-Mave, C0-Cave, and K0-Kave may be calculated, and the maximum value may be selected from these color value differences. Alternatively, YMCK having the largest color value of the target pixel may be selected. That is, the color axis for the largest one of Y0, M0, C0, and K0 is selected.
なおこのように特定の色軸を選択し、この特定の色軸についての色変位に基づき注目画素の画像情報を二値化する場合、二値化決定部657は、色変位であるABベクトルを特定の色軸について射影したときの大きさに基づき注目画素の画像情報を二値化すると言い換えることもできる。
When a specific color axis is selected in this way and the image information of the pixel of interest is binarized based on the color displacement about the specific color axis, the
また上述した例では、Y色、M色、C色、K色についての色軸を考えたが、これに限られるものではなく、他の色軸であってもよい。例えば、上述した明度軸や、彩度を表す彩度軸などを選択してもよい。
また色軸の選択にあたり、注目画素に対し周辺に位置する画素の色変位を参照してもよい。つまりこの周辺に位置する画素が注目画素であるときに選択される色軸と同様の色軸を選択することで、色軸の選択が大きくばらつくことがなく、二値化を行う際の判定精度がより向上する。
In the above-described example, the color axes for the Y color, the M color, the C color, and the K color are considered. However, the present invention is not limited to this, and other color axes may be used. For example, the lightness axis described above or the saturation axis representing saturation may be selected.
In selecting the color axis, the color displacement of a pixel located in the vicinity of the target pixel may be referred to. In other words, by selecting a color axis that is the same as the color axis that is selected when the surrounding pixel is the pixel of interest, the color axis selection does not vary greatly, and determination accuracy when binarization is performed Will be improved.
図6(a)〜(d)は、局所領域の中での注目画素の位置について説明した図である。
図6(a)は、局所領域Rが、文字を含まない背景のみであり、注目画素Qも背景の画素である場合を示している。また図6(b)は、局所領域Rが、文字を一部含むが、注目画素Qは背景の画素である場合を示している。さらに図6(c)は、局所領域Rが、文字を一部含み、注目画素Qは文字の画素である場合を示している。またさらに図6(d)は、局所領域Rが、背景を含まない文字のみであり、注目画素Qも文字の画素である場合を示している。
FIGS. 6A to 6D are diagrams illustrating the position of the target pixel in the local region.
FIG. 6A shows a case where the local region R is only a background that does not include characters, and the pixel of interest Q is also a background pixel. FIG. 6B shows a case where the local region R includes a part of characters, but the target pixel Q is a background pixel. Further, FIG. 6C shows a case where the local region R includes a part of a character and the target pixel Q is a character pixel. Further, FIG. 6D shows a case where the local region R is only a character that does not include a background, and the pixel of interest Q is also a character pixel.
このとき図6(a)の場合、局所領域Rが適切な大きさ(それほど大きくはない大きさ)であれば、背景は、一色により形成されるため、平均色値と注目画素Qの色値との差は、ほとんどない。よってこの場合、閾値を適切な値に設定すれば、この色値の差は、閾値以下となる。よって注目画素Qは、背景の画素と判定され、二値画像情報をOFF(白)とすることができる。 In this case, in the case of FIG. 6A, if the local region R is an appropriate size (not so large), the background is formed by one color, and therefore the average color value and the color value of the pixel of interest Q There is almost no difference. Therefore, in this case, if the threshold value is set to an appropriate value, the difference between the color values becomes equal to or less than the threshold value. Therefore, the target pixel Q is determined as a background pixel, and the binary image information can be turned off (white).
そして図6(b)のように局所領域R中に文字が含まれると、文字が含まれる領域が大きいほど、平均色値と注目画素Qの色値との色値の差は、大きくなっていく。つまり平均色値が文字の色値の影響を受け、平均色値は、背景の色値と文字の色値の間となる。その結果、背景の色値を示す注目画素Qの色値との差が生じる。ただし閾値を適切な値に設定すれば、図6(b)の場合、色値の差は閾値以下となり、注目画素Qは、背景の画素と判定され、二値画像情報がOFF(白)となる。 When a character is included in the local region R as shown in FIG. 6B, the difference between the average color value and the color value of the pixel of interest Q increases as the region including the character increases. Go. That is, the average color value is affected by the character color value, and the average color value is between the background color value and the character color value. As a result, a difference from the color value of the target pixel Q indicating the background color value occurs. However, if the threshold value is set to an appropriate value, in the case of FIG. 6B, the color value difference is equal to or smaller than the threshold value, the target pixel Q is determined to be a background pixel, and the binary image information is OFF (white). Become.
一方、図6(c)の場合では、注目画素Qの色値は、文字の色値となる。そして平均色値は、図6(b)と同様に背景の色値と文字の色値の間となる。このような場合、平均色値と注目画素Qの色値との差は一般的に大きくなるため、閾値を適切な値に設定すれば、平均色値と注目画素Qの色値との差は閾値より大きくなる。よって注目画素Qは、文字の画素と判定され、二値画像情報がON(黒)となる。 On the other hand, in the case of FIG. 6C, the color value of the pixel of interest Q is the color value of the character. The average color value is between the background color value and the character color value, as in FIG. In such a case, since the difference between the average color value and the color value of the target pixel Q is generally large, if the threshold is set to an appropriate value, the difference between the average color value and the color value of the target pixel Q is It becomes larger than the threshold value. Accordingly, the target pixel Q is determined as a character pixel, and the binary image information is turned ON (black).
よって、図6(a)〜(c)の場合、閾値を適切な値に設定すれば、注目画素Qが背景の画素であるか、文字の画素であるかが判定でき、二値画像情報としたときに背景の箇所は、OFF(白)となるとともに、文字の箇所は、ON(黒)となる。この方法によれば、図6(b)の場合と図6(c)の場合とで、区別が可能である。 Therefore, in the case of FIGS. 6A to 6C, if the threshold value is set to an appropriate value, it can be determined whether the target pixel Q is a background pixel or a character pixel. In this case, the background portion is OFF (white) and the character portion is ON (black). According to this method, it is possible to distinguish between the case of FIG. 6B and the case of FIG.
つまり本実施の形態では、まず入力画像は、局所的には一色または二色で構成されていることを想定している。そして入力画像が一色で構成されている場合は、色変位の大きさは小さいが、入力画像が二色で構成されている場合は、色変位の大きさが大きくなることを利用する。即ち、色変位の大きさに閾値を設定し、色変位の大きさがこの閾値を超えるか、閾値以下であるかにより注目画素Qが文字を構成する画素であるか、背景を構成する画素であるかを判定している。そして注目画素Qが文字を構成する画素と判定したときは、二値画像情報を、例えば、ON(黒)とし、注目画素Qが背景を構成する画素と判定したときは、二値画像情報を、例えば、OFF(白)とする。 That is, in this embodiment, first, it is assumed that the input image is locally composed of one color or two colors. If the input image is composed of one color, the color displacement is small, but if the input image is composed of two colors, the fact that the color displacement is large is utilized. That is, a threshold is set for the magnitude of color displacement, and the pixel of interest Q is a pixel constituting a character or a pixel constituting a background depending on whether the magnitude of the color displacement exceeds this threshold or is less than or equal to the threshold. Judging whether there is. When the target pixel Q is determined to be a pixel constituting a character, the binary image information is set to ON (black), for example. When the target pixel Q is determined to be a pixel constituting a background, the binary image information is For example, it is set to OFF (white).
ただし、図6(d)のような場合は、平均色値と注目画素Qの色値との色値の差は図6(a)と同様にほとんどなくなるため、この注目画素Qについては、背景の画素と判定される。その結果、二値画像情報がOFF(白)となり、誤判定が生じる。この場合、例えば、文字の線の中央付近に抜け(白抜け)が発生するような現象が起こる。 However, in the case of FIG. 6D, the difference between the color values of the average color value and the color value of the target pixel Q is almost the same as in FIG. 6A. This pixel is determined. As a result, the binary image information is turned off (white), and erroneous determination occurs. In this case, for example, a phenomenon occurs in which an omission (white omission) occurs near the center of a character line.
そこで本実施の形態では、二値化決定部657が、注目画素Qの画像情報を二値化する際に、適切な大きさの局所領域Rの色変位に基づき判定を行う。そして判定を行う際の局所領域Rが図6(d)のような場合になることを防止し、誤判定を回避している。
Therefore, in the present embodiment, the
図7(a)〜(c)は、画像領域の大きさが異なる複数の局所領域Rを設定したときの色変位の変化について説明した図である。
図7(a)は、局所領域Rとして大きさが異なる3種類(小、中、大)のものを選択した場合を示している。そして図7(b)は、注目画素Q1について、図7(a)で示すそれぞれの局所領域Rにおける色変位を概念的に示している。さらに図7(c)は、注目画素Q2について、図7(a)で示すそれぞれの局所領域Rにおける色変位を概念的に示している。
FIGS. 7A to 7C are diagrams illustrating changes in color displacement when a plurality of local regions R having different image region sizes are set.
FIG. 7A shows a case where three types (small, medium, large) having different sizes are selected as the local region R. FIG. 7B conceptually shows the color displacement in each local region R shown in FIG. 7A for the target pixel Q1. Further, FIG. 7C conceptually shows the color displacement in each local region R shown in FIG. 7A for the target pixel Q2.
ここで図7(b)に示す注目画素Q1の場合、局所領域Rが「小」の場合は、色変位の大きさは、小さく、向きは図中上方を向いている。そして局所領域Rが「中」の場合は、色変位の大きさは、大きくなり、向きは図中ほぼ上方を向いている。さらに局所領域Rが「大」の場合は、色変位の大きさは、局所領域Rが「中」の場合と変わらず、向きは図中左上の方向を向いている。 In the case of the pixel of interest Q1 shown in FIG. 7B, when the local region R is “small”, the magnitude of the color displacement is small and the direction is upward in the drawing. When the local region R is “medium”, the magnitude of the color displacement is large and the direction is substantially upward. Further, when the local region R is “large”, the magnitude of the color displacement is the same as when the local region R is “medium”, and the direction is the upper left direction in the figure.
また図7(c)に示す注目画素Q2の場合、局所領域Rが「小」の場合は、色変位の大きさは、大きく、向きは図中右上の方向を向いている。そして局所領域Rが「中」の場合は、色変位の大きさと方向は、局所領域Rが「小」の場合と変わらない。さらに局所領域Rが「大」の場合は、色変位の大きさは、局所領域Rが「中」の場合と変わらず、向きは図中ほぼ上方を向いている。 In the case of the pixel of interest Q2 shown in FIG. 7C, when the local region R is “small”, the magnitude of the color displacement is large and the direction is in the upper right direction in the figure. When the local region R is “medium”, the magnitude and direction of the color displacement is the same as when the local region R is “small”. Further, when the local region R is “large”, the magnitude of the color displacement is the same as when the local region R is “medium”, and the direction is substantially upward in the figure.
このとき本実施の形態では、二値化決定部657が、例えば、下記の基準(I)、(II)により局所領域Rを選択し、この局所領域Rについて算出された色変位を基にして注目画素Qの画像情報を二値化する。
At this time, in this embodiment, the
(I)色変位の大きさが予め定められた値以上となる複数の局所領域Rの中から最小の画像領域のものを選択する。
(II)色変位の方向が類似する局所領域Rの中から最大の画像領域のものを選択する。
(I) The thing of the minimum image area is selected from the several local area | region R from which the magnitude | size of a color displacement becomes more than a predetermined value.
(II) From the local region R having the similar color displacement direction, the one with the largest image region is selected.
上記基準(I)によれば、注目画素Q1の場合、局所領域Rが「中」、「大」のときに色変位の大きさが予め定められた値以上であったとすると、この中から最小の画像領域のものとして「中」の局所領域Rを選択する。また注目画素Q2の場合、局所領域Rが「小」、「中」、「大」の全てで色変位の大きさが予め定められた値以上であったとすると、この中から最小の画像領域のものとして「小」の局所領域Rを選択する。 According to the reference (I), in the case of the target pixel Q1, if the local region R is “medium” or “large” and the magnitude of the color displacement is greater than or equal to a predetermined value, the minimum value is determined from these The “medium” local region R is selected as the image region. In the case of the pixel of interest Q2, if the local region R is all of “small”, “medium”, and “large” and the magnitude of the color displacement is greater than or equal to a predetermined value, As the object, the “small” local region R is selected.
つまり注目画素Q1の場合、局所領域Rが「小」の場合は、色変位の大きさが小さいため、図6(a)の場合に該当し、局所領域Rが「中」、「大」の場合は、色変位の大きさが大きくなるため、図6(b)または図6(c)の場合に該当することを意味する。よってこの場合、局所領域Rが「中」、「大」の何れかを選択すればよい。ただし、局所領域Rが「大」の場合は、局所領域Rが「小」、「中」に対し、色変位の方向が変化している。これは、局所領域Rが大きくなることにより、背景を構成する色が一色ではなく他の色が混入してきたためと考えられる。背景を構成する色は一色(つまり文字の色と合わせ局所領域Rが二色で構成される)である方が、二値化するときの判定精度の点からは、より好ましい。そのためこのように局所領域Rとして複数の候補が存在したときは、他の色の混入を抑制するため、より小さい画像領域Rのものを選択するようにする。よってこの場合は、局所領域Rが「中」のものが選択される。 That is, in the case of the pixel of interest Q1, when the local region R is “small”, the magnitude of the color displacement is small, which corresponds to the case of FIG. 6A, and the local region R is “medium” and “large”. This case corresponds to the case of FIG. 6B or 6C because the magnitude of the color displacement becomes large. Therefore, in this case, the local region R may be selected as “medium” or “large”. However, when the local region R is “large”, the direction of color displacement is changed with respect to the local region R being “small” and “medium”. This is considered to be due to the fact that the local region R becomes larger, so that the color constituting the background is mixed with other colors instead of one color. The color constituting the background is more preferably one color (that is, the local region R is composed of two colors in combination with the character color) from the viewpoint of determination accuracy when binarizing. Therefore, when there are a plurality of candidates as the local region R in this way, a smaller image region R is selected in order to suppress mixing of other colors. Therefore, in this case, the local region R is selected as “medium”.
また注目画素Q2の場合、局所領域Rが「小」、「中」、「大」の全てで、図6(b)または図6(c)の場合に該当することを意味する。そしてこの中から最小の画像領域のものとして局所領域Rが「小」のものが選択される。 In the case of the pixel of interest Q2, it means that the local region R is all “small”, “medium”, and “large” and corresponds to the case of FIG. 6B or FIG. 6C. Of these, the one with the local region R “small” is selected as the smallest image region.
また上記基準(II)によれば、注目画素Q1の場合、局所領域Rが「小」、「中」のときに色変位の方向が類似であるが、この中から最大の画像領域のものとして「中」の局所領域Rを選択する。また注目画素Q2の場合も、局所領域Rが「小」、「中」のときに色変位の方向が類似であるが、この中から最大の画像領域Rのものとして「中」の局所領域Rを選択する。 Further, according to the standard (II), in the case of the pixel of interest Q1, the direction of color displacement is similar when the local region R is “small” and “medium”. The “medium” local region R is selected. In the case of the target pixel Q2, the direction of color displacement is similar when the local region R is “small” and “medium”, but the “middle” local region R is the largest image region R among them. Select.
つまり上述の通り、色変位の方向がほぼ同じであれば、背景を構成する色が一色である可能性が高い(つまり文字の色と合わせ局所領域Rが二色で構成される)。よって二値化するときの判定精度の点から色変位の方向が類似する局所領域Rがまず選択する。そして局所領域Rがより大きい方が、図6(b)または図6(c)の場合に該当する可能性が高い。そのため注目画素Q1、Q2の双方で「中」の局所領域Rを選択する。 That is, as described above, if the direction of the color displacement is substantially the same, there is a high possibility that the color constituting the background is one color (that is, the local region R is composed of two colors together with the character color). Therefore, a local region R having a similar color displacement direction is first selected from the viewpoint of determination accuracy when binarizing. The larger local region R is more likely to correspond to the case of FIG. 6B or FIG. Therefore, the “medium” local region R is selected in both the target pixels Q1 and Q2.
以上基準(I)、(II)の2つの基準について説明したが、この何れかの基準を採用してもよく、双方を併用してもよい。
このように画像領域の大きさが異なる複数の局所領域Rを設定し、基準(I)、(II)を採用することで、上述した図6(d)のような局所領域Rではなく、図6(b)、図6(c)のような局所領域Rを選択することが可能となる。
なお局所領域Rの大きさとしては、他の色が混入しない限り、より大きい方が二値化するときの判定精度はより高い。そのため最も大きい大きさの局所領域Rが選択された場合は、さらに大きい局所領域Rを追加して設定し、基準(I)、(II)を適用してもよい。
Although the two criteria (I) and (II) have been described above, either of these criteria may be adopted, or both may be used in combination.
By setting a plurality of local areas R having different image area sizes and adopting the references (I) and (II), the local area R as shown in FIG. It is possible to select a local region R as shown in 6 (b) and FIG. 6 (c).
As for the size of the local region R, the determination accuracy when binarizing is larger is higher unless another color is mixed. Therefore, when the largest local region R is selected, a larger local region R may be added and set, and the criteria (I) and (II) may be applied.
本実施の形態によれば、背景の判定の精度に依存するようなことが生じにくく、文字と背景との境界がより明瞭である二値画像を得ることができる。
また本実施の形態によれば、文字の大きさや、文字と背景の色の組み合わせに依存しにくく、文字と背景との境界がより明瞭である二値画像を得ることができる。
さらになだらかな絵柄の上に文字が存在する入力画像の場合でも、適切な大きさの局所領域を設定することで、局所領域中の画像が一色または二色で構成されるものとすることができる。そのためこのような場合でも文字と背景との境界がより明瞭である二値画像を得ることができる。
そしてエッジ検出、周波数変化分析、ヒストグラム判定などは行わなくてよいため、処理が軽く、二値化処理の処理時間がより短くてすむ。
また適切な大きさの局所領域を設定することで、線幅が広い文字の場合でも線の中央付近に抜け(白抜け)が発生しにくくなる。
According to the present embodiment, it is difficult to depend on the accuracy of background determination, and a binary image with a clearer boundary between characters and the background can be obtained.
Further, according to the present embodiment, it is possible to obtain a binary image that is less dependent on the size of the character and the combination of the character and the background color and has a clearer boundary between the character and the background.
Furthermore, even in the case of an input image in which characters are present on a gentle pattern, by setting a local area of an appropriate size, the image in the local area can be configured with one or two colors. . Therefore, even in such a case, it is possible to obtain a binary image in which the boundary between the character and the background is clearer.
Since edge detection, frequency change analysis, histogram determination, etc. need not be performed, the processing is light and the processing time of the binarization processing can be shortened.
In addition, by setting a local area of an appropriate size, it is difficult for missing (whiteout) to occur near the center of a line even in the case of a character with a wide line width.
図8(a)〜(b)は、本実施の形態により二値化された二値画像と従来技術により二値化された二値画像とを比較した図である。ここでは入力画像として、背景が青色、文字である「長」の箇所が緑色であるものに対し二値化処理した結果を示している。また従来技術としては、文字のエッジ抽出を行い、抽出したエッジを重畳させることで文字と背景との境界を再現した場合を示している。
図8(a)に示すように本実施の形態による二値化処理では、「長」で示される文字の部分が背景に対して明瞭な境界を有して分離されていることがわかる。対して、図8(b)に示すように従来技術による二値化処理では、「長」で示される文字の部分と背景との境界が不明瞭であり、さらに「長」の文字を構成する線の中央付近に抜け(白抜け)が発生している。
FIGS. 8A to 8B are diagrams comparing a binary image binarized by the present embodiment and a binary image binarized by the conventional technique. Here, the result of binarization processing is shown for an input image in which the background is blue and the character “long” portion is green. Moreover, as a prior art, the case where the edge of a character is extracted and the boundary of a character and a background is reproduced by superimposing the extracted edge is shown.
As shown in FIG. 8A, in the binarization process according to the present embodiment, it can be seen that the character portion indicated by “long” is separated from the background with a clear boundary. On the other hand, as shown in FIG. 8B, in the binarization processing according to the prior art, the boundary between the character portion indicated by “long” and the background is unclear, and further, a “long” character is formed. There is a dropout (white dropout) near the center of the line.
なお以上詳述した例では、入力画像情報を二値化処理したときに、ONの場合を白(白画素)、OFFの場合を黒(黒画素)としていたが、これに限られるものではなく、他の色を設定してもよい。
また以上詳述した例では、YMCK色空間を使用した場合について説明したが、これに限られるものではなく、RGB色空間など他の色空間でもよい。
さらに以上詳述した例では、色変位である平均色値と注目画素の色値との差として、単純に色値の差を考えたが、これに限られるものではなく、平均色値と注目画素の色値とを比較したときの変化率や微分値等を求め、これを平均色値と注目画素の色値との差としてもよい。
またさらに以上詳述した例では、平均色値は、局所領域に含まれる画素の色値の単純な平均値を算出することで導出していたが、これに限られるものではなく、画素毎に重みをつけてもよい。
In the example described in detail above, when the input image information is binarized, white (white pixel) is set to ON and black (black pixel) is set to OFF. However, the present invention is not limited to this. Other colors may be set.
In the example described in detail above, the case where the YMCK color space is used has been described. However, the present invention is not limited to this, and other color spaces such as an RGB color space may be used.
In the example described in detail above, the difference between the average color value, which is the color displacement, and the color value of the pixel of interest is simply considered as a difference in color value. However, the present invention is not limited to this. A change rate, a differential value, or the like when the color value of the pixel is compared may be obtained and used as a difference between the average color value and the color value of the target pixel.
Further, in the example described in detail above, the average color value is derived by calculating a simple average value of the color values of the pixels included in the local region, but is not limited to this, and is not limited to each pixel. You may give weight.
そして以上詳述した例では、閾値を設定し、色変位の大きさが閾値を超えるか否かで、注目画素のON、OFFを決める固定二値化の方法を採用していたが、これに限られるものではない。例えば、注目画素ごとに、例えば、周辺領域の濃度に応じて閾値を調整して注目画素のON、OFFを決める浮動二値化の方法を採用してもよい。またこの場合、局所領域の大きさにより二値化処理の精度が依存する。よって局所領域の大きさを可変とし、色変位に応じて局所領域の大きさを決定するようにすることが好ましい。 In the example described above in detail, a threshold value is set, and a fixed binarization method for determining ON / OFF of the pixel of interest depending on whether the magnitude of the color displacement exceeds the threshold value is used. It is not limited. For example, for each target pixel, for example, a floating binarization method may be adopted in which the threshold value is adjusted according to the density of the peripheral region to determine ON / OFF of the target pixel. In this case, the accuracy of the binarization process depends on the size of the local area. Therefore, it is preferable that the size of the local region is variable and the size of the local region is determined according to the color displacement.
また以上詳述した例では、二値化処理部36(図1参照)は、画像読み取り装置1(図1参照)の一部であり、二値化処理部65(図2参照)は、画像形成装置2(図2参照)の一部であったが、これに限られるものではなく、画像処理装置として単独でも使用することができる。 In the example described above in detail, the binarization processing unit 36 (see FIG. 1) is a part of the image reading apparatus 1 (see FIG. 1), and the binarization processing unit 65 (see FIG. 2) Although it was a part of the forming apparatus 2 (see FIG. 2), the present invention is not limited to this and can be used alone as an image processing apparatus.
<プログラムの説明>
二値化処理部36、65が行なう処理は、ソフトウェアとハードウェア資源とが協働することにより実現される。即ち、信号処理部30(図1参照)や制御部60(図2参照)に設けられた制御用コンピュータ内部の図示しないCPUが、二値化処理部36、65の各機能を実現するプログラムを実行し、上述した制御を行なうことで、これらの各機能を実現させる。
<Description of the program>
The processing performed by the
よって二値化処理部36、65が行なう処理は、コンピュータに、予め定められた色空間における画像情報である入力画像情報を取得する機能と、取得された入力画像情報を基に注目画素を選択する機能と、選択された注目画素を含む予め定められた範囲の画像領域を局所領域として設定する機能と、設定された局所領域に含まれる画素の色値の平均値である平均色値を算出する機能と、算出された平均色値と注目画素の色値との差を色空間におけるベクトル量で表した色変位を算出する機能と、算出された色変位に基づき注目画素の画像情報を二値化する機能と、を実現させるプログラムとして捉えることができる。
Accordingly, the processing performed by the
なお、本実施の形態を実現するプログラムは、通信手段により提供することはもちろん、CD−ROM等の記録媒体に格納して提供することも可能である。 The program for realizing the present embodiment can be provided not only by communication means but also by storing it in a recording medium such as a CD-ROM.
1…画像読み取り装置、2…画像形成装置、10…制御部、20…画像読み取りユニット、30…信号処理部、36…二値化処理部、40…後処理部、50…通信I/F、60…制御部、65…二値化処理部、70…画像形成部、651…入力画像情報取得部、652…注目画素選択部、653…局所領域設定部、654…局所領域サイズ記憶部、655…平均色値算出部、656…色変位算出部、657…二値化決定部、658…二値画像情報出力部
DESCRIPTION OF
Claims (6)
前記入力画像情報取得部によって取得された前記入力画像情報を基に注目画素を選択する注目画素選択部と、
前記注目画素選択部により選択された前記注目画素を含む予め定められた範囲の画像領域を局所領域として設定する局所領域設定部と、
前記局所領域設定部により設定された前記局所領域に含まれる画素の色値の平均値である平均色値を算出する平均色値算出部と、
前記平均色値算出部により算出された前記平均色値と前記注目画素の色値との差を前記色空間におけるベクトル量で表した色変位を算出する色変位算出部と、
前記色変位算出部により算出された前記色変位に基づき前記注目画素の画像情報を二値化する二値化決定部と、
を備え、
前記局所領域設定部は、前記画像領域の大きさが異なる複数の前記局所領域を設定し、
前記二値化決定部は、前記色変位の大きさが予め定められた値以上となる前記複数の局所領域の中から最小の画像領域のものについて算出された当該色変位を基にして前記注目画素の画像情報を二値化することを特徴とする画像処理装置。 An input image information acquisition unit that acquires input image information that is image information in a predetermined color space;
A target pixel selection unit that selects a target pixel based on the input image information acquired by the input image information acquisition unit;
A local region setting unit that sets, as a local region, an image region of a predetermined range including the target pixel selected by the target pixel selection unit;
An average color value calculation unit that calculates an average color value that is an average value of color values of pixels included in the local region set by the local region setting unit;
A color displacement calculation unit that calculates a color displacement in which a difference between the average color value calculated by the average color value calculation unit and the color value of the target pixel is represented by a vector amount in the color space;
A binarization determining unit that binarizes image information of the target pixel based on the color displacement calculated by the color displacement calculating unit;
Equipped with a,
The local region setting unit sets a plurality of the local regions having different sizes of the image region,
The binarization determining unit is configured to perform the attention based on the color displacement calculated for the smallest image region from among the plurality of local regions where the color displacement is equal to or greater than a predetermined value. An image processing apparatus that binarizes image information of pixels .
前記入力画像情報取得部によって取得された前記入力画像情報を基に注目画素を選択する注目画素選択部と、A target pixel selection unit that selects a target pixel based on the input image information acquired by the input image information acquisition unit;
前記注目画素選択部により選択された前記注目画素を含む予め定められた範囲の画像領域を局所領域として設定する局所領域設定部と、A local region setting unit that sets, as a local region, an image region of a predetermined range including the target pixel selected by the target pixel selection unit;
前記局所領域設定部により設定された前記局所領域に含まれる画素の色値の平均値である平均色値を算出する平均色値算出部と、An average color value calculation unit that calculates an average color value that is an average value of color values of pixels included in the local region set by the local region setting unit;
前記平均色値算出部により算出された前記平均色値と前記注目画素の色値との差を前記色空間におけるベクトル量で表した色変位を算出する色変位算出部と、A color displacement calculation unit that calculates a color displacement in which a difference between the average color value calculated by the average color value calculation unit and the color value of the target pixel is represented by a vector amount in the color space;
前記色変位算出部により算出された前記色変位に基づき前記注目画素の画像情報を二値化する二値化決定部と、A binarization determining unit that binarizes image information of the target pixel based on the color displacement calculated by the color displacement calculating unit;
を備え、With
前記局所領域設定部は、前記画像領域の大きさが異なる複数の前記局所領域を設定し、The local region setting unit sets a plurality of the local regions having different sizes of the image region,
前記二値化決定部は、前記色変位の方向が類似する前記局所領域の中から最大の画像領域のものについて算出された当該色変位を基にして前記注目画素の画像情報を二値化することを特徴とする画像処理装置。The binarization determination unit binarizes the image information of the target pixel based on the color displacement calculated for the largest image region from among the local regions having similar color displacement directions. An image processing apparatus.
予め定められた色空間における画像情報である入力画像情報を取得する機能と、
取得された前記入力画像情報を基に注目画素を選択する機能と、
選択された前記注目画素を含む予め定められた範囲の画像領域を局所領域として設定する機能と、
設定された前記局所領域に含まれる画素の色値の平均値である平均色値を算出する機能と、
算出された前記平均色値と前記注目画素の色値との差を前記色空間におけるベクトル量で表した色変位を算出する機能と、
算出された前記色変位に基づき前記注目画素の画像情報を二値化する機能と、
を実現させ、
前記設定する機能は、前記画像領域の大きさが異なる複数の前記局所領域を設定し、
前記二値化する機能は、前記色変位の大きさが予め定められた値以上となる前記複数の局所領域の中から最小の画像領域のものについて算出された当該色変位を基にして前記注目画素の画像情報を二値化するプログラム。 On the computer,
A function of acquiring input image information which is image information in a predetermined color space;
A function of selecting a pixel of interest based on the acquired input image information;
A function of setting an image area of a predetermined range including the selected target pixel as a local area;
A function of calculating an average color value that is an average value of color values of pixels included in the set local region;
A function of calculating a color displacement in which a difference between the calculated average color value and the color value of the target pixel is represented by a vector amount in the color space;
A function of binarizing the image information of the target pixel based on the calculated color displacement;
To achieve,
The setting function sets a plurality of the local regions having different sizes of the image region,
The binarizing function is based on the color displacement calculated based on the color displacement calculated for the smallest image region from among the plurality of local regions where the color displacement is greater than or equal to a predetermined value. A program that binarizes pixel image information .
予め定められた色空間における画像情報である入力画像情報を取得する機能と、A function of acquiring input image information which is image information in a predetermined color space;
取得された前記入力画像情報を基に注目画素を選択する機能と、A function of selecting a pixel of interest based on the acquired input image information;
選択された前記注目画素を含む予め定められた範囲の画像領域を局所領域として設定する機能と、A function of setting an image area of a predetermined range including the selected target pixel as a local area;
設定された前記局所領域に含まれる画素の色値の平均値である平均色値を算出する機能と、A function of calculating an average color value that is an average value of color values of pixels included in the set local region;
算出された前記平均色値と前記注目画素の色値との差を前記色空間におけるベクトル量で表した色変位を算出する機能と、A function of calculating a color displacement in which a difference between the calculated average color value and the color value of the target pixel is represented by a vector amount in the color space;
算出された前記色変位に基づき前記注目画素の画像情報を二値化する機能と、A function of binarizing the image information of the target pixel based on the calculated color displacement;
を実現させ、Realized
前記設定する機能は、前記画像領域の大きさが異なる複数の前記局所領域を設定し、The setting function sets a plurality of the local regions having different sizes of the image region,
前記二値化する機能は、前記色変位の方向が類似する前記局所領域の中から最大の画像領域のものについて算出された当該色変位を基にして前記注目画素の画像情報を二値化するプログラム。The binarization function binarizes image information of the pixel of interest based on the color displacement calculated for the largest image region from among the local regions having similar color displacement directions. program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013220565A JP6263951B2 (en) | 2013-10-23 | 2013-10-23 | Image processing apparatus and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013220565A JP6263951B2 (en) | 2013-10-23 | 2013-10-23 | Image processing apparatus and program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2015082774A JP2015082774A (en) | 2015-04-27 |
JP6263951B2 true JP6263951B2 (en) | 2018-01-24 |
Family
ID=53013163
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2013220565A Expired - Fee Related JP6263951B2 (en) | 2013-10-23 | 2013-10-23 | Image processing apparatus and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6263951B2 (en) |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4569785B2 (en) * | 2008-01-07 | 2010-10-27 | 富士ゼロックス株式会社 | Binarization device and binarization processing program |
JP5365817B2 (en) * | 2011-11-24 | 2013-12-11 | 富士ゼロックス株式会社 | Image processing apparatus and image processing program |
-
2013
- 2013-10-23 JP JP2013220565A patent/JP6263951B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2015082774A (en) | 2015-04-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7986837B2 (en) | Image processing apparatus, image forming apparatus, image distributing apparatus, image processing method, computer program product, and recording medium | |
JP4137890B2 (en) | Image processing apparatus, image forming apparatus, image reading processing apparatus, image processing method, image processing program, and computer-readable recording medium | |
US8270046B2 (en) | Image processor and image processing method for extracting removal color and color around removal color in an image prior to image color/monochrome determination | |
US7903872B2 (en) | Image-processing apparatus and method, computer program, and storage medium | |
US8150147B2 (en) | Image processing apparatus, image processing method, computer program, and storage medium | |
US8248659B2 (en) | Image processing apparatus, image processing method, image forming apparatus, program, and recording medium | |
US8203773B2 (en) | Image processing method, image processing apparatus, image forming apparatus, and recording medium for chromatic content determination | |
US8345310B2 (en) | Halftone frequency determination method and printing apparatus | |
US8363946B2 (en) | Decoding two-dimensional code using multiple binarization thresholds | |
US20070236707A1 (en) | Image processing apparatus, image processing method and image processing program | |
JP5146085B2 (en) | Image processing apparatus and program | |
US7365880B2 (en) | Image processing apparatus and image processing method | |
JP2015173419A (en) | Image processing device, control method of the same and program | |
US20160026904A1 (en) | Image processing apparatus, image processing method, and computer-readable recording medium | |
US6661921B2 (en) | Image process apparatus, image process method and storage medium | |
JP6263951B2 (en) | Image processing apparatus and program | |
JP2010119006A (en) | Image processing apparatus,and image processing method | |
JP4149368B2 (en) | Image processing method, image processing apparatus and image forming apparatus, computer program, and computer-readable recording medium | |
JP4080252B2 (en) | Image processing apparatus, image forming apparatus, image processing method, program, and recording medium | |
JP6025803B2 (en) | Image processing device | |
JP5957989B2 (en) | Image confirmation apparatus, image forming system, and program | |
JP4176053B2 (en) | Image processing method, image processing apparatus, image forming apparatus, and computer program | |
JP2023059743A (en) | Image inspection apparatus, image inspection system, and program | |
JP2024018460A (en) | Image processing device, image processing method and program | |
JP2000151997A (en) | Original type discrimination device and image processor |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20160623 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20170307 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20170418 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20170616 |
|
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: 20171121 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20171204 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6263951 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
S533 | Written request for registration of change of name |
Free format text: JAPANESE INTERMEDIATE CODE: R313533 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
LAPS | Cancellation because of no payment of annual fees |