JP2005057813A - Image scanner - Google Patents
Image scanner Download PDFInfo
- Publication number
- JP2005057813A JP2005057813A JP2004343245A JP2004343245A JP2005057813A JP 2005057813 A JP2005057813 A JP 2005057813A JP 2004343245 A JP2004343245 A JP 2004343245A JP 2004343245 A JP2004343245 A JP 2004343245A JP 2005057813 A JP2005057813 A JP 2005057813A
- Authority
- JP
- Japan
- Prior art keywords
- pixel
- document
- edge
- value
- image
- 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.)
- Pending
Links
Images
Abstract
Description
本発明は、ラインイメージセンサにより読み取られる画像データの持つエッジ部分を正確に検出できるようにする画像読取装置に関する。 The present invention relates to an image reading apparatus capable of accurately detecting an edge portion of image data read by a line image sensor.
搬送されてくる原稿や載置される原稿を読み取る画像読取装置では、高速の原稿読み取りが要求されることを考慮し、複雑な画像処理を施すことなく原稿を読み取れるようにするために、原稿の姿勢をある決まったものに規制するという方法を用いている。 In consideration of the demand for high-speed document reading, an image reading apparatus that reads a document that is being transported or placed on the document is designed so that the document can be read without performing complex image processing. A method of restricting the posture to a certain one is used.
すなわち、複数枚の読取原稿を自動給紙機構にセットして連続的に読み取るような場合には、従来技術では、ユーザに対して、自動給紙機構の用紙ガイドを読取原稿のサイズに合った位置にセットさせることで、原稿の姿勢をある決まったものに規制して読み取るという方法を用いている。 That is, when a plurality of read originals are set on the automatic paper feed mechanism and read continuously, in the conventional technique, the paper guide of the automatic paper feed mechanism is matched to the size of the read original. A method is used in which the position of the original is restricted to a predetermined position and is read by setting the position.
また、読取原稿を原稿台に載置させて読み取るような場合には、従来技術では、ユーザに対して、読取原稿を原稿台の上に規定の姿勢で載置させることで、原稿の姿勢をある決まったものに規制して読み取るという方法を用いている。 Further, in the case where a read document is placed on a document table and read, in the related art, the user can place the read document in a specified posture on the document table, thereby changing the posture of the document. It uses a method of restricting and reading certain things.
しかしながら、このような従来技術に従っていると、原稿の姿勢が規定のものにならない場合には、原稿を正確に読み取れないという問題点がある。 However, according to such a conventional technique, there is a problem that the original cannot be read accurately if the attitude of the original does not become a specified one.
すなわち、原稿が傾いてセットされてしまうと、画像読取装置に対して、傾いた形の原稿の画像データが入力されてしまうことで、原稿を正確に読み取れないのである。 In other words, if the original is set to be tilted, the image data of the tilted original is input to the image reading apparatus, so that the original cannot be read accurately.
確かに、最近の画像処理技術の進歩により、パーソナルコンピュータ上などで、傾いた画像データを処理対象として、画像データに対して回転処理などの編集処理を施すことが広く行われている。 Certainly, due to recent advances in image processing technology, it has been widely performed to perform editing processing such as rotation processing on image data using tilted image data as a processing target on a personal computer or the like.
しかしながら、このような画像処理技術により実現される回転処理は、その処理時間がかかり、これがために、リアルタイムの原稿読み取りが要求されるような画像読取装置には適用できない。 However, the rotation processing realized by such an image processing technique takes a long processing time, and therefore cannot be applied to an image reading apparatus that requires real-time document reading.
このようなことから、従来技術に従っていると、自動給紙機構を備える画像読取装置を使って、例えば、A4サイズの読取原稿とB5サイズの読取原稿とを混在させて連続的に読み取らせるようにすると、小さい方のB5サイズの読取原稿の姿勢が自動給紙機構による規制を受けないことで傾くことが避けられず、これがために、B5サイズの読取原稿を正確に読み取ることができないという問題点や、B5サイズの読取原稿が空白を持つA4サイズの画像になってしまうという問題点があることで、高精度の画像読み取りを実現できないという問題点がある。 For this reason, according to the conventional technology, for example, an A4 size read original and a B5 size read original are mixedly read using an image reading apparatus having an automatic paper feeding mechanism. Then, the orientation of the smaller B5 size read original is not tilted because it is not restricted by the automatic paper feed mechanism, and this makes it impossible to read the B5 size read original accurately. In addition, there is a problem that high-precision image reading cannot be realized because there is a problem that a B5-size read original becomes an A4-size image having a blank.
この問題点を解決するために、搬送されてくる原稿や載置される原稿をラインイメージセンサにより読み取るときにあって、ラインイメージセンサにより読み取られる画像データの持つエッジ部分を検出して、その検出結果に基づいて、この問題点を解決するための処理を行う方法を用いることが考えられる。 In order to solve this problem, the line image sensor is used to read a transported document or a placed document, and an edge portion of image data read by the line image sensor is detected and detected. Based on the result, it is conceivable to use a method for performing processing for solving this problem.
従来では、このエッジ部分を検出する場合、予めあるひとつの閾値を設定して、各画素の画素データをその閾値を使って2値化することで2値化値を得て、その2値化値が変化するところをエッジ部分として検出するようにしている。 Conventionally, when this edge portion is detected, a threshold value is set in advance, and the binarized value is obtained by binarizing the pixel data of each pixel using the threshold value, and the binarization is performed. A portion where the value changes is detected as an edge portion.
しかしがら、このような単純な方法に従ってエッジ部分を検出すると、原稿の陰やノイズの影響を受けることでエッジ部分を正確に検出できないという問題点がある。 However, when the edge portion is detected according to such a simple method, there is a problem that the edge portion cannot be accurately detected due to the influence of the shadow of the original or noise.
これから、ラインイメージセンサにより読み取られる画像データの持つエッジ部分を正確に検出できるようにする技術を確立する必要がある。 Therefore, it is necessary to establish a technique for accurately detecting the edge portion of the image data read by the line image sensor.
本発明はかかる事情に鑑みてなされたものであって、ラインイメージセンサにより読み取られる画像データの持つエッジ部分を正確に検出できるようにする新たな画像読取装置の提供を目的とする。 The present invention has been made in view of such circumstances, and an object thereof is to provide a new image reading apparatus that can accurately detect an edge portion of image data read by a line image sensor.
この目的を達成するために、本発明の画像読取装置は、ラインイメージセンサにより読み取られる画像データの持つエッジ部分を検出するときにあって、画像データをある閾値で2値化するとともに、それとは異なる閾値で2値化することで、各画素毎に2つの2値化値を得る2値化手段と、注目画素のみあるいは注目画素を含む形で定義される中画素ブロックに属する画素の持つ2値化値と、その中画素ブロックに隣接する形で定義される2つの画素ブロックに属する画素の持つ2値化値とを取り出す取出手段と、取出手段の取り出す2値化値に従って、注目画素の画素位置がエッジ部分であるのか否かを判断する判断手段とを備える構成を採る。 In order to achieve this object, the image reading apparatus of the present invention detects an edge portion of image data read by a line image sensor, binarizes the image data with a certain threshold value, and Binarization means that obtains two binarized values for each pixel by binarizing with different thresholds, and 2 of pixels belonging to the middle pixel block defined in a form including only the target pixel or including the target pixel Extracting means for extracting a binarized value and binarized values of pixels belonging to two pixel blocks defined adjacent to the middle pixel block, and a binarized value extracted by the extracting means And a determination unit that determines whether or not the pixel position is an edge portion.
このように構成される本発明の画像読取装置では、原稿の下地と背景とがコントラストを持つ場合には、その境界個所を検出することでエッジ部分を検出するために、判断手段は、中画素ブロックに隣接する一方の画素ブロックに属する全ての画素の持つ2値化値が同一値を示し、かつ、中画素ブロックに隣接するもう一方の画素ブロックに属する全ての画素の持つ2値化値がそれとは異なる値の同一値を示す場合に、注目画素の画素位置がエッジ部分であると判断するように処理する。 In the image reading apparatus of the present invention configured as described above, in the case where the background and background of the document have contrast, in order to detect the edge portion by detecting the boundary portion, The binarized values of all pixels belonging to one pixel block adjacent to the block indicate the same value, and the binarized values of all pixels belonging to the other pixel block adjacent to the middle pixel block are When the same value of a different value is indicated, processing is performed so as to determine that the pixel position of the target pixel is an edge portion.
そして、原稿の下地と背景とがコントラストを持たない場合には、原稿と背景との境界に生ずる陰を検出することでエッジ部分を検出するために、判断手段は、中画素ブロックに隣接する2つの画素ブロックに属する全ての画素の持つ2値化値が同一値を示し、かつ、中画素ブロックに属する少なくとも注目画素の持つ2値化値がそれとは異なる値の同一値を示す場合に、注目画素の画素位置がエッジ部分であると判断するように処理する。 When the background and background of the document do not have contrast, the determination means detects the shadow generated at the boundary between the document and the background, so that the determination means 2 is adjacent to the middle pixel block. When the binarized values of all the pixels belonging to one pixel block indicate the same value and at least the binarized value of the target pixel belonging to the middle pixel block indicates the same value different from that Processing is performed so that the pixel position of the pixel is determined to be an edge portion.
このようにして、本発明の画像読取装置では、陰やノイズの影響を受けずにエッジ部分を検出できるようにするために、画素ブロックという概念を導入するとともに、各画素の画素データを2つの閾値で2値化することで2値化値を得て、その2値化値を使って、原稿の下地と背景とがコントラストを持つ場合には、その境界個所が持つあいまいさを考慮して、その境界個所に隣接する2つの画素ブロックの内の一方がはっきりとした原稿の下地を示すとともに、もう一方がはっきりとした背景を示すのか否かを判断することでエッジ部分を検出するように処理する。 In this way, in the image reading apparatus of the present invention, in order to be able to detect an edge portion without being affected by shadows or noise, the concept of a pixel block is introduced and pixel data of each pixel is converted into two A binarized value is obtained by binarizing with a threshold value. When the binarized value is used and the background and background of the document have a contrast, the ambiguity of the boundary portion is taken into consideration. The edge portion is detected by judging whether one of the two pixel blocks adjacent to the boundary portion shows a clear background of the original and the other shows a clear background. To process.
そして、原稿の下地と背景とがコントラストを持たない場合には、その境界個所の示す陰を考慮して、その境界個所に隣接する2つの画素ブロックの両方がはっきりとした原稿の下地と背景とを示すとともに、その境界個所に位置する画素ブロックがそれとは異なるはっきりした状態を示すのか否かを判断することでエッジ部分を検出するように処理する。 If the background and background of the document do not have contrast, considering the shade indicated by the boundary portion, both the two pixel blocks adjacent to the boundary portion are clearly defined. And processing to detect an edge portion by determining whether or not the pixel block located at the boundary portion shows a clear state different from that.
この構成に従って、本発明の画像読取装置によれば、搬送されてくる原稿や載置される原稿をラインイメージセンサにより読み取るときにあって、ラインイメージセンサにより読み取られる画像データの持つエッジ部分を検出するときに、陰やノイズの影響を受けずにエッジ部分を正確に検出できるようになる。 According to this configuration, according to the image reading apparatus of the present invention, when the conveyed document or the placed document is read by the line image sensor, the edge portion of the image data read by the line image sensor is detected. The edge portion can be accurately detected without being affected by shadows or noise.
以下、実施の形態に従って本発明を詳細に説明する。 Hereinafter, the present invention will be described in detail according to embodiments.
図1に、本発明を具備する原稿読取装置1の一実施形態例を図示する。
FIG. 1 shows an embodiment of an
この図に示すように、本発明の原稿読取装置1は、自動給紙機構により搬送されてくる原稿を読み取るラインイメージセンサ10と、ラインイメージセンサ10の読み取る画像データをA/D変換するA/D変換器11と、A/D変換器11の出力する画像データを入力として、規定の画像処理を施すことで原稿を読み取るメモリ制御部12と、本発明を実現すべく備えられて、A/D変換器11の出力する画像データを入力として、その画像データの持つエッジ個所を検出するエッジ検出部13と、例えばファームウェアにより構成されて、エッジ検出部13の検出するエッジ情報を入力として、原稿の傾きやサイズを検出する傾き/サイズ検出部14と、例えばファームウェアにより構成されて、メモリ制御部12に対してスキャナ読取処理の起動を指示するとともに、傾き/サイズ検出部14の検出結果を受けて、メモリ制御部12に対してデスキュー処理の起動を指示するスキャナ制御部15とを備える。
As shown in this figure, a
このメモリ制御部12は、ラインイメージセンサ10により読み取られる原稿の画像データをその読み取りの順番に格納する第1の画像メモリ20と、第1の画像メモリ20に格納される原稿の画像データをその傾きを補正しつつ読み出す傾き補正読出部21と、傾き補正読出部21による読み出しにより発生する画像データの持つギザギザ部分をスムーズなものにするスムージング処理部22と、スムージング処理部22の処理した画像データを平滑化する平滑化処理部23と、平滑化処理部23の処理した画像データを水平方向に拡大する水平拡大処理部24と、平滑化処理部23の処理した画像データを垂直方向に拡大する垂直拡大処理部25と、水平/垂直方向に拡大された画像データを2値化する2値化部26と、原稿の枠部分に存在する陰やノイズを除去するマスキング部27と、これらの処理の施された第1の画像メモリ20から読み出された画像データを格納して、図示しない上位装置に引き渡す第2の画像メモリ28とを備える。
The
このように、メモリ制御部12は、原稿の画像データを2値化してから傾きを補正するのではなくて、2値化する前の多値データの状態で傾きを補正する構成を採って、その後で、スムージング処理を施すという構成を採っている。これから、スムージング処理が有効なものになる。
In this way, the
なお、平滑化処理部23や水平拡大処理部24や垂直拡大処理部25や2値化部26やマスキング部27については、従来の画像処理技術で用いられたものを利用することができる。
As the
先ず最初に、本発明の原稿読取装置1が備える各構成部分の概要について説明する。
First, an outline of each component included in the
(1)エッジ検出部13は、本発明を実現すべく備えられるものであり、スキャナ制御部15の発行するスキャナ読取処理の起動に応答して起動されると、図2に示すように、各ライン毎に、ラインイメージセンサ10の読み取る画像データをスキャン開始の左端から順番に確認することで、ノイズや陰に影響されることなく、「白から黒」あるいは「黒から白」に急峻に変化する画素位置を検出して、最初に検出する画素位置を「左エッジ」、最後に検出する画素位置を「右エッジ」として、それを傾き/サイズ検出部14に報告する処理を行う。
(1) The
(2)傾き/サイズ検出部14は、エッジ検出部13から各ライン毎に報告される「左エッジ座標」/「右エッジ座標」を受け取ると、図3に示すように、原稿の上端側の2つの頂点の座標を検出するとともに、原稿の最下端となる頂点の座標を検出する処理を行う。
(2) Upon receiving the “left edge coordinates” / “right edge coordinates” reported for each line from the
そして、傾き/サイズ検出部14は、この上端側の2つの頂点の座標が検出できた段階で、図中に示す原稿の「幅」と「水平傾き(θ) 」とを算出し、更に、“1/cos θ”に従って水平倍率補正値を算出するとともに、原稿の搬送速度が規定の標準である場合には、その水平倍率補正値と同じ値を垂直倍率補正値として算出し、原稿の搬送速度が規定の標準のものでない場合には、“1/cos θ”と搬送速度の比率値とに従って垂直倍率補正値を算出して、それらの「幅」/「傾き(tan θで表現する)」/「倍率補正値」と、原稿の上左端の頂点に対応付けられる画素データの格納先アドレス(第1の画像メモリ20の格納アドレス)として定義される「切出開始アドレス」とをスキャナ制御部15に報告する処理を行う。
Then, the inclination /
そして、傾き/サイズ検出部14は、検出した原稿の最下端の頂点までの読み取りが終えたことを検出(図中に示す原稿の「長さ」を算出できる状態)すると、原稿の読み取りが終了した旨をスキャナ制御部15に報告する処理を行う。
Then, when the inclination /
(3)スキャナ制御部15は、メモリ制御部12に対してスキャナ読取処理の実行を指示することで、図4に示すように、ラインイメージセンサ10により読み取られる原稿の画像データ(多値データ)を、メモリ制御部12の持つ第1の画像メモリ20にその読み取りの順番に書き込む処理を行う。
(3) The
そして、スキャナ制御部15は、傾き/サイズ検出部14から、上述した「切出開始アドレス」/「幅」/「傾き」/「倍率補正値」の報告を受け取ると、「画像処理モード」/「マスキング範囲」を設定して、それらの受け取った値とその設定した値とを通知しつつ、メモリ制御部12に対してデスキュー処理の実行を指示する処理を行う。
When the
なお、スキャナ制御部15は、傾き/サイズ検出部14が傾き/サイズの検出に失敗した場合には、メモリ制御部12に対して傾き“0”のデスキュー処理の実行を指示することになる。
When the tilt /
そして、スキャナ制御部15は、傾き/サイズ検出部14から、原稿の読み取りが終了した旨の通知を受け取ると、それに応動して、メモリ制御部12に対してデスキュー処理の終了を指示する処理を行う。
When the
(4)メモリ制御部12は、スキャナ制御部15からスキャナ読取処理の起動がかかると、図4に示したように、ラインイメージセンサ10により読み取られる原稿の画像データを、メモリ制御部12の持つ第1の画像メモリ20にその読み取りの順番に書き込む処理を行う。
(4) When the
そして、メモリ制御部12は、スキャナ制御部15からデスキュー処理の起動がかかると、スキャナ制御部15から通知される「切出開始アドレス」/「幅」/「傾き」/「倍率補正値」に従って、図5に示すように、第1の画像メモリ20に格納される原稿の画像データをその傾きを補正しつつ読み出すとともに、その読み出しにより発生する画像データの持つギザギザ部分をスムーズなものにするスムージング処理を施し、更に、平滑化処理部23や水平拡大処理部24や垂直拡大処理部25や2値化部26やマスキング部27を使って、スキャナ制御部15から通知される「画像処理モード」/「マスキング範囲」に応じた画像処理を施す処理に入って、原稿の読み取りの終了に連動してスキャナ制御部15からデスキュー処理の終了が指示されると、その処理を終了する処理を行う。
When the deskew processing is activated from the
なお、メモリ制御部12は、スキャナ制御部15から傾き“0”のデスキュー処理の実行を指示されるときには、第1の画像メモリ20に格納される原稿の画像データをそのまま読み出すことで、傾きの補正やスムージング処理は行わないように処理することになる。
When the
次に、本発明の原稿読取装置1を構成する各構成部分の詳細な構成について説明する。
Next, a detailed configuration of each component constituting the
先ず最初に、図6に示すエッジ検出部13の一実施形態例に従って、エッジ検出部13の詳細な構成について説明する。
First, a detailed configuration of the
エッジ検出部13は、図6に示すように、ドットカウンタ130と、左端エッジ座標検出部131と、右端エッジ座標検出部132と、エッジ座標報告部133と、エッジフィルタ部134とで構成されている。
As shown in FIG. 6, the
このドットカウンタ130は、(1)水平同期信号(図2に図示)がONならば、カウンタ値を“0”にリセットし、(2)水平有効信号(図2に図示)がONならば、画像クロックをカウントアップし、(3)水平有効信号がOFFならば、カウンタ値を保持するように動作することで、左端から順次入力されてくる画像データのドット数をカウントする。 The dot counter 130 resets the counter value to “0” if the horizontal synchronizing signal (shown in FIG. 2) is ON, and (2) if the horizontal valid signal (shown in FIG. 2) is ON. The image clock is counted up. (3) If the horizontal valid signal is OFF, the number of dots of image data sequentially input from the left end is counted by operating so as to hold the counter value.
左端エッジ座標検出部131は、(1)水平同期信号がONならば、最初エッジのレジスタに“0000”をセットし、(2)水平有効信号がONで、かつ、最初エッジのレジスタに“0000”がセットされ、かつ、エッジフィルタ部134がエッジを検出するならば、最初エッジのレジスタにドットカウンタ130のカウンタ値をセットし、(3)水平有効信号がOFFか、最初エッジのレジスタに“0000”でない値がセットされているか、エッジフィルタ部134がエッジを検出しないならば、最初エッジのレジスタの値を保持することで、各ライン毎に、最初のエッジ部分として検出された画素のドットカウンタ値を保持する。 The left end edge coordinate detection unit 131 sets (0000) to the first edge register when the horizontal synchronization signal is ON, and (2) sets the horizontal valid signal to ON and sets “0000” to the first edge register. Is set, and the edge filter unit 134 detects an edge, the counter value of the dot counter 130 is set in the register of the first edge, and (3) the horizontal valid signal is OFF or the register of the first edge is set to “ If a value other than 0000 "is set or the edge filter unit 134 does not detect an edge, the value of the register of the first edge is held, so that the dot of the pixel detected as the first edge portion for each line. Holds the counter value.
右端エッジ座標検出部132は、(1)水平同期信号がONならば、最終エッジのレジスタに“FFFF”をセットし、(2)水平有効信号がONで、かつ、エッジフィルタ部134がエッジを検出するならば、最終エッジのレジスタにドットカウンタ130のカウンタ値をセットし、(3)水平有効信号がOFFか、エッジフィルタ部134がエッジを検出しないならば、最終エッジのレジスタの値を保持することで、各ライン毎に、最終のエッジ部分として検出された画素のドットカウンタ値を保持する。
The right edge coordinate
エッジ座標報告部133は、(1)水平同期信号がONならば、上述した最初エッジのレジスタが保持するドットカウンタ値を左端エッジ座標を保持するレジスタにセットするとともに、上述した最終エッジのレジスタが保持するドットカウンタ値を右端エッジ座標を保持するレジスタにセットし、(2)水平同期信号がOFFならば、左端エッジ座標を保持するレジスタの値を保持するとともに、右端エッジ座標を保持するレジスタの値を保持することで、左端エッジの座標と右端エッジの座標とを傾き/サイズ検出部14に報告する。
The edge coordinate reporting unit 133 (1) sets the dot counter value held in the first edge register to the register holding the left edge edge coordinate and the last edge register described above if the horizontal synchronization signal is ON. The dot counter value to be held is set in the register that holds the right edge coordinate. (2) If the horizontal synchronization signal is OFF, the value of the register that holds the left edge coordinate is held and the register that holds the right edge coordinate is held. By holding the value, the coordinates of the left end edge and the coordinates of the right end edge are reported to the inclination /
エッジフィルタ部134は、注目画素を中心とする中ブロックと、その中ブロックの右側に位置する右ブロックと、その中ブロックの左側に位置する左ブロックとを使い、「原稿の押え板が黒」の場合には、ノイズや陰を除去しつつ、原稿と原稿押え板との境界目や原稿が持つエッジ部分を検出するために、(1)図7(a)に示すように、左ブロックに属する全ての画素の画素データがLowスライスよりも小さく、かつ、右ブロックに属する全ての画素の画素データがHigh スライスよりも大きい場合に注目画素位置をエッジであると検出するとともに、(2)そのパターンが逆となる、左ブロックに属する全ての画素の画素データがHigh スライスよりも大きく、かつ、右ブロックに属する全ての画素の画素データがLowスライスよりも小さい場合に注目画素位置をエッジであると検出する。ここで、「Lowスライス<High スライス」に設定される。 The edge filter unit 134 uses a middle block centered on the pixel of interest, a right block located on the right side of the middle block, and a left block located on the left side of the middle block. In this case, in order to detect the boundary between the document and the document pressing plate and the edge portion of the document while removing noise and shadow, (1) as shown in FIG. When the pixel data of all the pixels belonging to it is smaller than the Low slice and the pixel data of all the pixels belonging to the right block are larger than the High slice, the target pixel position is detected as an edge, and (2) The pixel data of all the pixels belonging to the left block whose pattern is reversed is larger than the High slice, and the pixel data of all the pixels belonging to the right block is smaller than the Low slice. The target pixel position is detected as an edge when. Here, “Low slice <High slice” is set.
そして、「原稿の押え板が白」の場合には、ノイズや陰を除去しつつ、原稿端部の持つ影や原稿が持つエッジ部分を検出するために、(1)図7(b)に示すように、左ブロックと右ブロックとに属する全ての画素の画素データがHigh スライスよりも大きく、かつ、中ブロックに属する全ての画素の画素データのLowスライスよりも小さい場合に注目画素位置をエッジであると検出するとともに、(2)そのパターンが逆となる、左ブロックと右ブロックに属する全ての画素の画素データがLowスライスよりも小さく、かつ、中ブロックに属する全ての画素の画素データのHigh スライスよりも大きい場合に注目画素位置をエッジであると検出する。ここで、「Lowスライス>High スライス」に設定される。 Then, in the case of “original document pressing plate is white”, in order to detect the shadow of the document edge and the edge portion of the document while removing noise and shadow, (1) in FIG. As shown, when the pixel data of all the pixels belonging to the left block and the right block are larger than the high slice and smaller than the low slice of the pixel data of all the pixels belonging to the middle block, the target pixel position is edged (2) The pixel data of all the pixels belonging to the left block and the right block whose pattern is reversed are smaller than the Low slice and the pixel data of all the pixels belonging to the middle block When the pixel is larger than the high slice, the target pixel position is detected as an edge. Here, “Low slice> High slice” is set.
図8に、エッジフィルタ部134の一実施形態例を図示する。 FIG. 8 illustrates an embodiment of the edge filter unit 134.
この図に示すように、エッジフィルタ部134は、A/D変換器11から入力される画素データ(8ビットの多値データ)を上述のLowスライス/High スライスと比較するコンパレータ200と、コンパレータ200の出力するHigh スライス比較出力をシフトさせつつ保持するシフトレジスタ201と、コンパレータ200の出力するLowスライス比較出力をシフトさせつつ保持するシフトレジスタ202と、シフトレジスタ201が保持する左ブロックに属する画素の比較出力値の論理積を演算するAND回路203と、シフトレジスタ202が保持する左ブロックに属する画素の比較出力値の論理積を演算するAND回路204と、シフトレジスタ201が保持する中ブロックに属する画素の比較出力値の論理積を演算するAND回路205と、シフトレジスタ202が保持する中ブロックに属する画素の比較出力値の論理積を演算するAND回路206と、シフトレジスタ201が保持する右ブロックに属する画素の比較出力値の論理積を演算するAND回路207と、シフトレジスタ202が保持する右ブロックに属する画素の比較出力値の論理積を演算するAND回路208と、AND回路203〜208の演算結果を入力として、注目画素位置をエッジであるのか否かを判定するエッジ判定回路209とを備える。
As shown in this figure, the edge filter unit 134 compares the pixel data (8-bit multi-value data) input from the A /
この構成に従って入力されるデータを受けて、エッジ判定回路209は、外部から指示されるフィルタタイプに従って「原稿の押え板が黒」であることを判断する場合には、図9に示すフィルタタイプ1の論理演算を実行することで、注目画素位置がエッジ部分であるのか否かを判断し、そして、外部から指示されるフィルタタイプに従って「原稿の押え板が白」であることを判断する場合には、図9に示すフィルタタイプ2の論理演算を実行することで、注目画素位置がエッジ部分であるのか否かを判断する。
When the
なお、図8では図示していないが、Lowスライス/High スライスを発生する回路が用意されていて、このスライス発生回路は、外部から指示されるフィルタタイプに応じて、適切なLowスライス/High スライスを発生してコンパレータ200に与えるように動作する。 Although not shown in FIG. 8, a circuit for generating a low slice / high slice is prepared, and this slice generation circuit is adapted to an appropriate low slice / high slice according to the filter type designated from the outside. Is generated and supplied to the comparator 200.
このエッジフィルタ部134は、スキャナ装置が固有の特性を持つことに対処するために、中ブロックのサイズを1画素/3画素/5画素/9画素の中から選択できるようにするとともに、左ブロックと右ブロックのサイズを2画素/4画素/8画素/16画素の中から選択できるようにしている。 The edge filter unit 134 allows the size of the middle block to be selected from 1 pixel / 3 pixels / 5 pixels / 9 pixels in order to cope with the unique characteristics of the scanner device, and the left block. The right block size can be selected from 2 pixels / 4 pixels / 8 pixels / 16 pixels.
この選択の構成は、例えば、図10に示すように、1画素を中ブロックのサイズとして、セレクタによりAND回路を選択することで、左右ブロックのサイズを2画素/4画素/8画素/16画素の中から選択できるようにするエッジフィルタ回路と、3画素を中ブロックのサイズとして、セレクタによりAND回路を選択することで、左右ブロックのサイズを2画素/4画素/8画素/16画素の中から選択できるようにするエッジフィルタ回路と、5画素を中ブロックのサイズとして、セレクタによりAND回路を選択することで、左右ブロックのサイズを2画素/4画素/8画素/16画素の中から選択できるようにするエッジフィルタ回路と、9画素を中ブロックのサイズとして、セレクタによりAND回路を選択することで、左右ブロックのサイズを2画素/4画素/8画素/16画素の中から選択できるようにするエッジフィルタ回路と、これらの4つのエッジフィルタ回路の出力値の中から指定されるものを選択してエッジ判定回路209に入力するセレクタとで実現されることになる。
For example, as shown in FIG. 10, the selection configuration is such that the size of the left and right blocks is 2 pixels / 4 pixels / 8 pixels / 16 pixels by selecting an AND circuit by the selector with 1 pixel as the size of the middle block. The edge filter circuit that enables selection from among the three, the size of the middle block as 3 pixels, and the AND circuit is selected by the selector, so that the size of the left and right blocks is 2 pixels / 4 pixels / 8 pixels / 16 pixels Select edge filter circuit and 5 pixels as the size of the middle block and select the AND circuit by the selector to select the size of the left and right blocks from 2 pixels / 4 pixels / 8 pixels / 16 pixels Edge filter circuit to be able to do and left and right by selecting AND circuit by selector with 9 pixels as middle block size Edge filter circuit that makes it possible to select a lock size from 2 pixels / 4 pixels / 8 pixels / 16 pixels, and an edge by selecting a specified one from the output values of these four edge filter circuits This is realized by a selector input to the
この構成に従って、エッジ検出部13は、スキャナ制御部15の発行するスキャナ読取処理の起動に応答して起動されると、図2に示すように、各ライン毎に、ラインイメージセンサ10の読み取る画像データをスキャン開始の左端から順番に確認することで、ノイズや陰に影響されることなく、「白から黒」あるいは「黒から白」に急峻に変化する画素位置を検出して、最初に検出する画素位置を「左エッジ」、最後に検出する画素位置を「右エッジ」として、それを傾き/サイズ検出部14に報告する処理を行うのである。
According to this configuration, when the
次に、傾き/サイズ検出部14の実行する詳細な処理について説明する。
Next, detailed processing executed by the tilt /
傾き/サイズ検出部14は、図11(a)に示すような傾いた姿勢で搬送されてくる原稿の傾きとサイズとを検出する処理を行う。このとき、図11(b)に示すように、原稿の四隅が折り曲げられていたり、原稿の四隅にマーク等が記載されていても、原稿の傾きとサイズとを正確に検出する機能を有している。
The inclination /
傾き/サイズ検出部14は、具体的には、図12に示すように、原稿の左辺の座標位置を示す式「Y=A*X+B」と、原稿の右辺の座標位置を示す式「Y=A*X+C」と、原稿の上辺の座標位置を示す式「Y=−(1/A)*X+D」と、原稿の下辺の座標位置を示す式「Y=−(1/A)*X+E」とを求めて、これらの4つの式に従って、原稿の上端側の2つの頂点の座標と、原稿の最下端となる頂点の座標とを算出することで、この検出機能を実現している。
Specifically, as shown in FIG. 12, the inclination /
図13ないし図15に、傾き/サイズ検出部14の実行する処理フローの一例を図示する。次に、この処理フローに従って、この検出機能を実現する傾き/サイズ検出部14の実行する処理について詳細に説明する。
FIGS. 13 to 15 show an example of a processing flow executed by the tilt /
傾き/サイズ検出部14は、原稿読取処理に入ることで起動されると、図13ないし図15の処理フローに示すように、先ず最初に、ステップ1で、エッジ検出部13からエッジのX座標値となる「左端エッジ座標」/「右端エッジ座標」の報告を待って、その報告を受け取ると、ステップ2に進んで、その報告される「左端エッジ座標」/「右端エッジ座標」を受け取る。
When the tilt /
続いて、ステップ3で、読取ライン数を加算することで、その受け取った「左端エッジ座標」/「右端エッジ座標」のY座標値を算出し、続くステップ4で、その受け取った「左端エッジ座標」/「右端エッジ座標」を、読取ライン数と対応を取りつつ保存する。
Subsequently, in
続いて、ステップ5で、原稿の上端の2つの頂点を検出してあるのか否かを判断して、検出していないことを判断するときには、ステップ6に進んで、受け取った「右端エッジ座標」と「左端エッジ座標」との差分値を算出することで原稿幅を算出する。
Subsequently, in
続いて、ステップ7で、その算出した原稿幅が前回のものよりも広くなったのか否かを判断して、広くなったことを判断するときには、そのままステップ1に戻り、広くなっていないことを判断するときには、ステップ8に進んで、その状態が規定のライン数連続したのか否かを判断して、規定のライン数連続していない場合には、そのままステップ1に戻る。
Subsequently, in
一方、ステップ8で、原稿幅が広くならないことが規定のライン数連続したことを判断するとき、すなわち、図12中に示す原稿幅Wの位置に到達したことを判断するときには、ステップ9に進んで、その連続ライン数の起点となった左端エッジ座標(X1,Y1)と、その連続ライン数の到達点となった左端エッジ座標(X2,Y2)とから、原稿の左辺の座標位置を示す式
Y=A*X+B
を算出するとともに、その連続ライン数の起点となった右端エッジ座標(X3,Y3)と、その連続ライン数の到達点となった右端エッジ座標(X4,Y4)とから、原稿の右辺の座標位置を示す式
Y=A*X+C
を算出する。
On the other hand, when it is determined in
And the right edge coordinate (X3, Y3) that is the starting point of the number of continuous lines and the right edge coordinate (X4, Y4) that is the arrival point of the number of continuous lines Formula indicating position Y = A * X + C
Is calculated.
続いて、ステップ10で、原稿の上辺と左辺及び右辺とが直交しているとともに、原稿の下辺と左辺及び右辺とが直交していることに対応して、原稿の上辺及び下辺の傾きを「−(1/A)」に従って算出する。
Subsequently, in
続いて、ステップ11で、保存してあるエッジ座標の中から原稿の上辺に位置するエッジ座標を抽出する。この原稿の上辺に位置するエッジ座標を抽出する処理は、例えば、保存してあるエッジ座標(左端エッジ座標/右端エッジ座標)の中から、ステップ8でその到達を判断した原稿幅Wよりも小さな原稿幅を持つエッジ座標を抽出して、それらの中から、原稿の左辺の座標位置を示す式「Y=A*X+B」や、原稿の右辺の座標位置を示す式「Y=A*X+C」に乗らないものを特定することで行う。
Subsequently, at
続いて、ステップ12で、この抽出したエッジ座標(例えば、図12に示す(X5,Y5))を、原稿の上辺の座標位置を示す式
Y=−(1/A)*X+D
に代入することで、この抽出した各エッジ座標毎にDの値を算出して、他のものから外れている値を除外しつつその算出されたDの値の平均値を算出することで、原稿の上辺の座標位置を示す式
Y=−(1/A)*X+D
を算出する。
Subsequently, in
By substituting into, the value of D is calculated for each of the extracted edge coordinates, and the average value of the calculated values of D is calculated while excluding the values deviating from the others. Expression indicating the coordinate position of the upper side of the document Y = − (1 / A) * X + D
Is calculated.
続いて、ステップ13で、ステップ9で算出した原稿の左辺の座標位置を示す式「Y=A*X+B」と、この算出した原稿の上辺の座標位置を示す式「Y=−(1/A)*X+D」との交点位置を算出することで、原稿の左上頂点の座標を求めるとともに、ステップ9で算出した原稿の右辺の座標位置を示す式「Y=A*X+C」と、この算出した原稿の上辺の座標位置を示す式「Y=−(1/A)*X+D」との交点位置を算出することで、原稿の右上頂点の座標を求める。
Subsequently, in
続いて、ステップ14で、その算出した原稿の左上頂点の座標と右上頂点の座標とから、原稿が右上がりに傾いているのか左上がりに傾いているのかを検出する。すなわち、左上頂点の座標の方が右上頂点の座標よりも読取開始側に近い位置にあるときには、原稿は左上がりの形態で傾いていると判断し、右上頂点の座標の方が左上頂点の座標よりも読取開始側に近い位置にあるときには、原稿は右上がりの形態で傾いていると判断するのである。
Subsequently, in
続いて、ステップ15で、図3に示したもので定義される「切出開始アドレス(原稿の上左端のエッジ座標に対応付けられる画素データの第1の画像メモリ20上の格納アドレス)」と、「幅」と、「傾き(tan θ)」と、「倍率補正値(1/cos θ) 」とを算出して、それをスキャナ制御部15に通知してから、ステップ1に戻る。
Subsequently, in
一方、ステップ5で、原稿の上端の2つの頂点を検出してあることを判断するときには、ステップ16に進んで、原稿の最下端の頂点を検出してあるのか否かを判断して、最下端の頂点を検出していないことを判断するときには、ステップ17に進んで、受け取った「右端エッジ座標」と「左端エッジ座標」との差分値を算出することで原稿幅を算出する。
On the other hand, if it is determined in
続いて、ステップ18で、その算出した原稿幅が概略0となったのか否かを判断して、原稿幅が概略0になっていないことを判断するときには、ステップ1に戻り、原稿幅が概略0となったことを判断するときには、ステップ18に進んで、保存してあるエッジ座標の中から原稿の下辺に位置するエッジ座標を抽出する。
Subsequently, in
この原稿の下辺に位置するエッジ座標を抽出する処理は、例えば、保存してあるエッジ座標(左端エッジ座標/右端エッジ座標)の中から上述の原稿幅Wの検出以降にその原稿幅Wのよりも小さな原稿幅を持つことになったエッジ座標を抽出して、それらの中から、原稿の左辺の座標位置を示す式「Y=A*X+B」や、原稿の右辺の座標位置を示す式「Y=A*X+C」に乗らないものを特定することで行う。 The processing for extracting the edge coordinates located on the lower side of the original is performed, for example, by the original width W after the detection of the original width W from the stored edge coordinates (left end edge coordinates / right end edge coordinates). Also, the edge coordinates having a small document width are extracted, and among them, the expression “Y = A * X + B” indicating the coordinate position of the left side of the document or the expression “Y” indicating the coordinate position of the right side of the document “ This is done by specifying something that does not ride "Y = A * X + C".
続いて、ステップ19で、この抽出したエッジ座標(例えば、図12に示す(X6,Y6))を、原稿の下辺の座標位置を示す式
Y=−(1/A)*X+E
に代入することで、この抽出した各エッジ座標毎にEの値を算出して、他のものから外れている値を除外しつつその算出されたEの値の平均値を算出することで、原稿の下辺の座標位置を示す式
Y=−(1/A)*X+E
を算出する。
Subsequently, in step 19, the extracted edge coordinates (for example, (X6, Y6) shown in FIG. 12) are converted into an equation Y =-(1 / A) * X + E indicating the coordinate position of the lower side of the document.
By substituting into, the value of E is calculated for each of the extracted edge coordinates, and the average value of the calculated values of E is calculated while excluding values that are out of the others. Expression indicating the coordinate position of the lower side of the document Y = − (1 / A) * X + E
Is calculated.
続いて、ステップ20で、ステップ14で検出される原稿の姿勢に応じて、原稿の左辺の座標位置を示す式「Y=A*X+B」か、原稿の右辺の座標位置を示す式「Y=A*X+C」のいずれか一方の式を選択して、その選択した式と、この検出した原稿の下辺の座標位置を示す式「Y=−(1/A)*X+E」との交点位置を算出することで、原稿の最下端の頂点を求める。
Subsequently, in
すなわち、ステップ14で、原稿が図12に示すように左上がりに傾いていることを検出する場合には、原稿の右辺の座標位置を示す式「Y=A*X+C」と、この算出した原稿の下辺の座標位置を示す式「Y=−(1/A)*X+E」との交点位置を算出することで、原稿の最下端の頂点を求め、一方、原稿が右上がりに傾いていることを検出する場合には、原稿の左辺の座標位置を示す式「Y=A*X+B」と、この算出した原稿の下辺の座標位置を示す式「Y=−(1/A)*X+E」との交点位置を算出することで、原稿の最下端の頂点を求めるのである。
That is, if it is detected in
続いて、ステップ21で、読取ラインが原稿の最下端の頂点の位置と一致したのか否かを判断して、一致しないことを判断するときには、ステップ1に戻り、一致したことを判断するときには、ステップ22に進んで、原稿の読み取りの終了をスキャナ制御部15に通知して、処理を終了する。
Subsequently, in
そして、ステップ16で、原稿の最下端の頂点を検出してあることを判断するときには、ステップ17〜ステップ20の処理を省略して、直ちにステップ21に進んで、読取ラインが原稿の最下端の頂点の位置と一致したのか否かを判断して、一致しないことを判断するときには、ステップ1に戻り、一致したことを判断するときには、ステップ22に進んで、原稿の読み取りの終了をスキャナ制御部15に通知して、処理を終了する。 When it is determined in step 16 that the lowermost vertex of the document has been detected, the processing in steps 17 to 20 is omitted, and the process proceeds immediately to step 21 where the reading line is at the lowermost edge of the document. When it is determined whether or not the positions of the vertices coincide with each other, and when it is determined that they do not match, the process returns to step 1, and when it is determined that they match, the process proceeds to step 22 to end the reading of the document. 15 and the process is terminated.
なお、この原稿の読み取りの終了の際に、図3に示す原稿の「長さ」をスキャナ制御部15に通知するようにしている。これは、第2の画像メモリ28から原稿の画像データを受け取る図示しない上位装置に対して、原稿の画像データを格納するのにどれ位のメモリ容量(=〔長さ/cos θ〕*〔幅/cos θ〕)を用意する必要があるのかを知らせるようにするためである。
At the end of reading the original, the
このようにして、傾き/サイズ検出部14は、エッジ検出部13から各ライン毎に報告される「左エッジ座標」/「右エッジ座標」を受け取ると、図3に示すように、原稿の上端側の2つの頂点の座標を検出するとともに、原稿の最下端となる頂点の座標を検出する処理を行う。
In this way, upon receiving the “left edge coordinates” / “right edge coordinates” reported for each line from the
そして、傾き/サイズ検出部14は、この上端側の2つの頂点の座標が検出できた段階で、原稿の「幅」と、原稿の「傾き(tan θ:好ましくは分子が1、分母が自然数となる値に近似する)」と、原稿の「倍率補正値(1/cos θ:但し、原稿の搬送速度が標準のものでない場合には、水平倍率補正値と垂直倍率補正値とを別々に算出する)」と算出するとともに、「切出開始アドレス(原稿の上左端のエッジ座標に対応付けられる画素データの第1の画像メモリ20上の格納アドレス)」を特定して、これらのデータをスキャナ制御部15に報告する処理を行う。
The inclination /
そして、傾き/サイズ検出部14は、検出した原稿の最下端の頂点までの読み取りが終えたことを検出すると、原稿の読み取りが終了した旨をスキャナ制御部15に報告する処理を行う。
When the inclination /
スキャナ制御部15は、上述したように、メモリ制御部12に対してスキャナ読取処理の実行を指示することで、図4に示すように、ラインイメージセンサ10により読み取られる原稿の画像データ(多値データ)を、メモリ制御部12の持つ第1の画像メモリ20にその読み取りの順番に書き込む処理を行う。
As described above, the
そして、スキャナ制御部15は、上述した処理に従って傾き/サイズ検出部14から、「切出開始アドレス」/「幅」/「傾き」/「倍率補正値」の報告を受け取ると、「画像処理モード」/「マスキング範囲」を設定して、それらの受け取った値とその設定した値とを通知しつつ、メモリ制御部12に対してデスキュー処理の実行を指示する処理を行う。
When the
そして、スキャナ制御部15は、傾き/サイズ検出部14から、原稿の読み取りが終了した旨の通知を受け取ると、メモリ制御部12に対してデスキュー処理の終了を指示する処理を行う。
When the
次に、メモリ制御部12の実行する処理の詳細について説明する。
Next, details of processing executed by the
メモリ制御部12は、スキャナ制御部15からスキャナ読取処理の起動がかかると、図4に示したように、ラインイメージセンサ10により読み取られる原稿の画像データを、メモリ制御部12の持つ第1の画像メモリ20にその読み取りの順番に書き込む処理を行う。
When the scanner reading process is activated from the
なお、これから説明するように、メモリ制御部12は、第1の画像メモリ20に書き込んだ画像データを順次読み出して並列的に処理していくことになるので、ラインイメージセンサ10により読み取られる原稿の画像データを上書きする形で第1の画像メモリ20に書き込むことが可能となる。これから、第1の画像メモリ20は、原稿1枚分の画像データを格納できるようにする容量を持つ必要はない。
As will be described below, the
この書き込みに応答して、傾き/サイズ検出部14は上述した処理に入り、これを受けて、スキャナ制御部15は、ある時点で、メモリ制御部12に対して、「切出開始アドレス」/「幅」/「傾き(tan θ)」/「倍率補正値」/「画像処理モード」/「マスキング範囲」を通知しつつ、デスキュー処理の実行を指示する。
In response to this writing, the inclination /
このデスキュー処理の実行指示を受け取ると、メモリ制御部12を構成する傾き補正読出部21は、通知された「切出開始アドレス」を起点にして、通知された「傾き(tan θ)」と通知された「幅」とに応じた形で格納アドレスを順次設定しながら、第1の画像メモリ20に格納される原稿の画像データをその傾きを補正しつつ読み出す処理を行う。
Upon receiving this deskew processing execution instruction, the inclination
例えば、水平方向に5画素進んで垂直方向に1画素ずれるという右上がりの「tan θ=1/5」という傾きが通知される場合には、図16に示すように、「切出開始アドレス」を起点にして、水平方向に4画素読み出したら、1つ前の読取ラインの読み出しに入って水平方向に4画素読み出していくということを、通知された「幅」の長さ分繰り返すことで原稿の第1番目のラインをその傾きを補正しつつ読み出し、それに続いて、第2番目のラインと第3番目のラインと第4番目のラインについても、「切出開始アドレス」と同じ水平位置を起点として同様の形で読み出し、第5番目のラインに入ると、「切出開始アドレス」から右に1画素ずれた位置を起点として同様な形で読み出していくということを原稿の最終ラインまで繰り返していくことで、原稿の画像データをその傾きを補正しつつ読み出す処理を行うのである。 For example, when a slope of “tan θ = 1/5”, which rises right by 5 pixels in the horizontal direction and shifts by 1 pixel in the vertical direction, is notified, as shown in FIG. Starting from the above, when 4 pixels are read in the horizontal direction, reading the previous reading line and reading 4 pixels in the horizontal direction are repeated for the length of the notified “width”. The first line is read out while correcting its inclination, and subsequently, the same horizontal position as the “cutting start address” is set for the second line, the third line, and the fourth line. Reading in the same way as the starting point, and entering the fifth line, repeatedly reading up to the last line of the document starting from the same position starting from the position shifted by one pixel to the right from the “cutting start address” Have It is, is performed a process of reading the image data of the document while correcting its tilt.
一方、左上がりの「tan θ=1/5」という傾きが通知される場合には、「切出開始アドレス」を起点にして、水平方向に4画素読み出したら、1つ後の読取ラインの読み出しに入って水平方向に4画素読み出していくということを、通知された「幅」の長さ分繰り返すことで原稿の第1番目のラインをその傾きを補正しつつ読み出し、それに続いて、第2番目のラインと第3番目のラインと第4番目のラインについても、「切出開始アドレス」と同じ水平位置を起点として同様の形で読み出し、第5番目のラインに入ると、「切出開始アドレス」から左に1画素ずれた位置を起点として同様な形で読み出していくということを原稿の最終ラインまで繰り返していくことで、原稿の画像データをその傾きを補正しつつ読み出す処理を行うのである。 On the other hand, when an inclination of “tan θ = 1/5” rising to the left is notified, reading out the next reading line after reading out four pixels in the horizontal direction from the “cutting start address”. The first line of the document is read while correcting the inclination by repeating the notified “width” length to read out four pixels in the horizontal direction, and then the second line is read. For the 3rd line, the 3rd line, and the 4th line, the same horizontal position as the “cutting start address” is read out in the same manner, and when entering the 5th line, “cutting start” By repeating the process of reading out in a similar manner starting from a position shifted by one pixel to the left from the “address” to the last line of the document, the document image data is read out while correcting its inclination. Ah .
第1の画像メモリ20に格納される画素データの格納アドレスは、図17に示すような規則性を持ち、これから、傾き補正読出部21は、「切出開始アドレス」/「傾き(tan θ)」/「幅」の通知を受け取ると、どのように格納アドレスを変更していけば傾きを補正した形で原稿の画像データを読み出すことができるのかということを知ることができるので、それに応じた形で格納アドレスを順次設定しながら、第1の画像メモリ20に格納される原稿の画像データをその傾きを補正しつつ読み出す処理を行うことになる。
The storage address of the pixel data stored in the
図18ないし図20に、傾き補正読出部21が実行するこの画像データの読み出し処理を処理フローの形で記述したものを図示する。
FIG. 18 to FIG. 20 illustrate the image data reading process executed by the inclination
ここで、この処理フローでは、「水平傾き(1/(p+1))」と「垂直傾き(1/(q+1))」とが別々の値で与えられることを想定している。ステップ2で行う右上がりか否かの判断処理は、「水平傾き(1/(p+1))」に付加される符号で行う。また、ステップ3〜ステップ14は原稿が右上がりに傾いているときに実行する処理、ステップ15〜ステップ26は原稿が左上がりに傾いていくときに実行する処理である。
Here, in this processing flow, it is assumed that “horizontal inclination (1 / (p + 1))” and “vertical inclination (1 / (q + 1))” are given as different values. The process of determining whether or not it is going up to the right in
図16との対応で説明するならば、図16では「p=4」となる。ステップ5に記述する「アドレスXに続くp番目のアドレスに対応付けられる1ライン前のアドレス」とは、図16の例で説明するならば、例えば、アドレスXに続く4番目の画素データeの格納アドレスに対応付けられる1ライン前の画素データfの格納アドレスということである。また、ステップ14に記述する「アドレスXの次のアドレスに対応付けられる1ライン後のアドレス」とは、図16の例で説明するならば、例えば、画素データ(1)(図中に示す1を○で囲った画素データ)の次の画素データ(2)(図中に示す2を○で囲った画素データ)の格納アドレスに対応付けられる1ライン後の画素データ(3)(図中に示す3を○で囲った画素データ)の格納アドレスということである。
If described with reference to FIG. 16, “p = 4” in FIG. The “address one line before the address corresponding to the p-th address following the address X” described in
ステップ3〜ステップ14で実行する原稿が右上がりに傾いているときの処理では、原稿の上左端の頂点を起点にして、1ライン前1ライン前と辿って画像データを読み出していくのに対して、ステップ15〜ステップ26で実行する原稿が左上がりに傾いているときの処理では、原稿の上左端の頂点を起点にして、1ライン後1ライン後と辿って画像データを読み出していく点に違いがあるだけである。
In the processing executed in
このような斜め読み出しの方法を用いると、1画素未満の量子化誤差のために、局所的に画像のズレが発生する。メモリ制御部12を構成するスムージング処理部22は、この画像ズレの補正を行うために用意される。
When such an oblique reading method is used, an image shift locally occurs due to a quantization error of less than one pixel. A smoothing
傾き補正読出部21は、このスムージング処理部22に対して、どの画素に対してスームジング処理を施せばよいのかを知らせるために、図16に示すように、垂直方向にずらした形で画素データを読み出すときには、そのずらしの直前に読み出した画素データ(例えば図中のd)と、そのずらして読み出した画素データ(例えば図中のf)とを「水平ズレ画素」として定義して、画素データに付加される1ビット構成の水平ズレビットをONするように処理している。
In order to notify the smoothing
そして、傾き補正読出部21は、このスムージング処理部22に対して、どの画素に対してスームジング処理を施せばよいのかを知らせるために、図16に示すように、水平方向にずらした形で画素データを読み出すときには、そのずらしの直前に読み出したライン上の画素データ(図中の左上がりの斜線で示すもの)と、そのずらして読み出したライン上の画素データ(図中の右上がりの斜線で示すもの)とを「垂直ズレ画素」として定義して、画素データに付加される1ビット構成の垂直ズレビットをONするように処理している。
Then, in order to inform the smoothing
メモリ制御部12を構成するスムージング処理部22は、傾き補正読出部21により読み出される傾きの補正された原稿の画像データを受け取ると、図21に示すような画像フィルタを用いて、傾き補正により発生する画像データの持つギザギザ部分をスムーズなものとする処理を行う。
When the smoothing
すなわち、水平ズレビットがONする水平ズレ画素に対しては、例えば、図21(a)に示すような画像フィルタ(スムージングの度合いKについては選択可能である)を用いて、傾き補正により発生する画像データの持つギザギザ部分をスムーズなものとする処理を行う。 That is, for a horizontal shift pixel in which the horizontal shift bit is turned on, for example, an image generated by tilt correction using an image filter (smoothing degree K can be selected) as shown in FIG. Performs processing to smooth the jagged portion of the data.
ちなみに、この図21(a)に示す画像フィルタでは、「K=1」の場合には、水平ズレ画素の画素データ(図中のX)を左右に隣接する画素の画素データの平均値に置き換えることで、水平ズレ画素により発生するギザギザ部分をスムーズなものとする処理を行うことになる。 Incidentally, in the image filter shown in FIG. 21A, when “K = 1”, the pixel data (X in the drawing) of the horizontal shift pixel is replaced with the average value of the pixel data of the pixels adjacent to the left and right. As a result, the process of smoothing the jagged portion generated by the horizontal shift pixel is performed.
また、垂直ズレビットがONする垂直ズレ画素に対しては、例えば、図21(b)に示すような画像フィルタ(スムージングの度合いKについては選択可能である)を用いて、傾き補正により発生する画像データの持つギザギザ部分をスムーズなものとする処理を行う。 In addition, for a vertical shift pixel in which the vertical shift bit is turned ON, for example, an image generated by tilt correction using an image filter (smoothing degree K can be selected) as shown in FIG. Performs processing to smooth the jagged portion of the data.
ちなみに、この図21(b)に示す画像フィルタでは、「K=1」の場合には、垂直ズレ画素の画素データ(図中のX)を上下に隣接する画素の画素データの平均値に置き換えることで、垂直ズレ画素により発生するギザギザ部分をスムーズなものとする処理を行うことになる。 Incidentally, in the image filter shown in FIG. 21B, in the case of “K = 1”, the pixel data (X in the drawing) of the vertically shifted pixels is replaced with the average value of the pixel data of the vertically adjacent pixels. Thus, a process for smoothing the jagged portion generated by the vertical shift pixels is performed.
また、水平ズレビットがONするとともに垂直ズレビットがONする水平垂直ズレ画素に対しては、例えば、図21(c)に示すような画像フィルタ(スムージングの度合いKについては選択可能である)を用いて、傾き補正により発生する画像データの持つギザギザ部分をスムーズなものとする処理を行う。 In addition, for a horizontal / vertical shift pixel in which the horizontal shift bit is turned on and the vertical shift bit is turned on, for example, an image filter as shown in FIG. 21C (smoothing degree K can be selected) is used. Then, the process of smoothing the jagged portion of the image data generated by the inclination correction is performed.
ちなみに、この図21(c)に示す画像フィルタでは、「K=1」の場合には、水平垂直ズレ画素の画素データ(図中のX)を上下左右に隣接する画素の画素データの平均値に置き換えることで、水平垂直ズレ画素により発生するギザギザ部分をスムーズなものとする処理を行うことになる。 Incidentally, in the image filter shown in FIG. 21C, in the case of “K = 1”, the pixel data of the horizontal and vertical misalignment pixels (X in the figure) is the average value of the pixel data of the pixels adjacent vertically and horizontally. By replacing with, a process of smoothing the jagged portion generated by the horizontal and vertical misalignment pixels is performed.
なお、この画像フィルタの適用を可能とするために、スムージング処理部22は、傾き補正読出部21により読み出される3ライン分の画像データを保持する機構を有している。
In order to enable application of this image filter, the smoothing
メモリ制御部12を構成する平滑化処理部23は、スムージング処理部22によりスムージング処理の施された原稿の画像データを受け取ると、図22に示すような画像フィルタを用いて、そのスムージング処理では取り除けなかった画像データの持つギザギザ部分を平滑化する処理を行う。
When the smoothing
すなわち、全ての画素に対して、例えば、図22に示すような画像フィルタ(平滑化の度合いKについては選択可能である)を用いて、スムージング処理部22によるスムージング処理では取り除けなかった画像データの持つギザギザ部分を平滑化する処理を行う。
That is, for all pixels, for example, using an image filter as shown in FIG. 22 (the degree of smoothing K can be selected), image data that could not be removed by the smoothing processing by the smoothing
ちなみに、この図22に示す画像フィルタでは、「K=1」の場合には、処理対象の画素の画素データ(図中のX)を8方向に隣接する8個の画素の画素データの平均値に置き換えることで、スムージング処理では取り除けなかった画像データの持つギザギザ部分を平滑化する処理を行うことになる。 Incidentally, in the image filter shown in FIG. 22, in the case of “K = 1”, the pixel data (X in the drawing) of the pixel to be processed is the average value of the pixel data of eight pixels adjacent in the eight directions. By replacing with, a jagged portion of image data that could not be removed by the smoothing process is smoothed.
なお、この画像フィルタの適用を可能とするために、平滑化処理部23は、スムージング処理部22によりスムージング処理の施された3ライン分の画像データを保持する機構を有している。
In order to enable application of this image filter, the smoothing
メモリ制御部12を構成する水平拡大処理部24は、傾き補正読出部21により読み出される傾きの補正された原稿の画像データが本来の画像データに比べて水平方向に「cos θ」倍に縮小されていることを考慮して、その読み出された画像データを水平方向に「1/cos θ」倍に拡大する処理を行う。
The horizontal enlargement processing unit 24 constituting the
そして、メモリ制御部12を構成する垂直拡大処理部25は、傾き補正読出部21により読み出される傾きの補正された原稿の画像データが本来の画像データに比べて垂直方向に例えば「cos θ」倍(原稿の搬送速度により変わる)に縮小されていることを考慮して、その読み出された画像データを垂直方向に例えば「1/cos θ」倍に拡大する処理を行う。
Then, the vertical
この水平拡大処理部24による水平方向の拡大処理は、例えば、「1/cos θ=1.01」のときには、水平方向の100画素につき1画素を挿入する必要があることを判断して、例えば、その挿入個所の左右の画素の画素データの平均値を算出し、その平均値を持つ画素データを挿入個所に挿入することで行う。 The horizontal enlargement processing by the horizontal enlargement processing unit 24 determines that it is necessary to insert one pixel for every 100 pixels in the horizontal direction when “1 / cos θ = 1.01”, for example. The average value of the pixel data of the left and right pixels at the insertion location is calculated, and the pixel data having the average value is inserted into the insertion location.
そして、この垂直拡大処理部25による垂直方向の拡大処理は、例えば、「1/cos θ=1.01」のときには、垂直方向の100ラインにつき1ラインを挿入する必要があることを判断して、例えば、その挿入個所の上下のラインの画素の画素データの平均値を算出し、その平均値を持つ画素データを挿入個所に挿入することで行う。
The vertical enlargement processing by the vertical
メモリ制御部12を構成する2値化部26は、水平拡大処理部24と垂直拡大処理部25とにより拡大処理された画像データを規定の閾値と比較することで、多値の画像データを2値化する処理を行う。
The binarization unit 26 constituting the
このように、メモリ制御部12は、原稿の画像データを2値化してから傾きを補正するのではなくて、2値化する前の多値データの状態で傾きを補正する構成を採って、その後で、スムージング処理を施すという構成を採っている。これから、スムージング処理が有効なものになる。
In this way, the
メモリ制御部12を構成するマスキング部27は、2値化部26により2値化された原稿の画像データの持つ枠部分(端部分)に存在する影を消去する処理を行って、第2の画像メモリ28に格納する処理を行う。
The masking unit 27 constituting the
このようにして、メモリ制御部12は、スキャナ制御部15からスキャナ読取処理の起動がかかると、図4に示したように、ラインイメージセンサ10により読み取られる原稿の画像データを、メモリ制御部12の持つ第1の画像メモリ20にその読み取りの順番に書き込む処理を行う。
In this way, when the scanner reading process is activated from the
そして、メモリ制御部12は、スキャナ制御部15からデスキュー処理の起動がかかると、スキャナ制御部15から通知される「切出開始アドレス」/「幅」/「傾き」/「倍率補正値」に従って、図5に示すように、第1の画像メモリ20に格納される原稿の画像データをその傾きを補正しつつ読み出すとともに、その傾き補正により発生する画像データの持つギザギザ部分をスムーズなものにするスムージング処理を施し、更に、平滑化処理部23や水平拡大処理部24や垂直拡大処理部25や2値化部26やマスキング部27を使って、スキャナ制御部15から通知される「画像処理モード」/「マスキング範囲」に応じた画像処理を施す処理に入って、原稿の読み取りの終了に連動してスキャナ制御部15からデスキュー処理の終了が指示されると、その処理を終了する処理を行う。
When the deskew processing is activated from the
なお、図1では説明しなかったが、メモリ制御部12は、画像処理部として、その他に、強調処理を行う処理部や、誤差拡散を行う処理部や、浮動スライスへの変換を行う処理部などが用意している。
Although not described in FIG. 1, the
以上説明したように、本発明の画像読取装置では、陰やノイズの影響を受けずにエッジ部分を検出できるようにするために、画素ブロックという概念を導入するとともに、各画素の画素データを2つの閾値で2値化することで2値化値を得て、その2値化値を使って、原稿の下地と背景とがコントラストを持つ場合には、その境界個所が持つあいまいさを考慮して、その境界個所に隣接する2つの画素ブロックの内の一方がはっきりとした原稿の下地を示すとともに、もう一方がはっきりとした背景を示すのか否かを判断することでエッジ部分を検出するように処理するのである。 As described above, the image reading apparatus of the present invention introduces the concept of a pixel block in order to be able to detect an edge portion without being affected by shadows or noise, and 2 pixel data of each pixel. Binarization is obtained by binarization with two threshold values, and when the background of the document has contrast with the binarization value, the ambiguity of the boundary portion is taken into consideration. The edge portion is detected by determining whether one of the two pixel blocks adjacent to the boundary portion shows a clear background of the original and the other shows a clear background. Is processed.
そして、原稿の下地と背景とがコントラストを持たない場合には、その境界個所の示す陰を考慮して、その境界個所に隣接する2つの画素ブロックの両方がはっきりとした原稿の下地と背景とを示すとともに、その境界個所に位置する画素ブロックがそれとは異なるはっきりした状態を示すのか否かを判断することでエッジ部分を検出するように処理するのである。 If the background and background of the document do not have contrast, considering the shade indicated by the boundary portion, both the two pixel blocks adjacent to the boundary portion are clearly defined. And processing to detect the edge portion by determining whether or not the pixel block located at the boundary portion shows a clear state different from that.
これから、本発明の画像読取装置によれば、陰やノイズの影響を受けずにエッジ部分を検出できるようになる。 Thus, according to the image reading apparatus of the present invention, the edge portion can be detected without being affected by shadows or noise.
1 原稿読取装置
10 ラインイメージセンサ
11 A/D変換器
12 メモリ制御部
13 エッジ検出部
14 傾き/サイズ検出部
15 スキャナ制御部
20 第1の画像メモリ
21 傾き補正読出部
22 スムージング処理部
23 平滑化処理部
24 水平拡大処理部
25 垂直拡大処理部
26 2値化部
27 マスキング部
28 第2の画像メモリ
DESCRIPTION OF
Claims (4)
画像データをある閾値で2値化するとともに、それとは異なる閾値で2値化することで、各画素毎に2つの2値化値を得る2値化手段と、
注目画素のみあるいは注目画素を含む形で定義される中画素ブロックに属する画素の持つ上記2値化値と、該中画素ブロックに隣接する形で定義される2つの画素ブロックに属する画素の持つ上記2値化値とを取り出す取出手段と、
上記取出手段の取り出す2値化値に従って、注目画素の画素位置がエッジ部分であるのか否かを判断する判断手段とを備えることを、
特徴とする画像読取装置。 In an image reading apparatus that detects an edge portion of image data read by a line image sensor,
Binarization means for obtaining two binarized values for each pixel by binarizing the image data with a certain threshold value and binarizing with a different threshold value;
The binarized value of a pixel belonging to a middle pixel block defined so as to include only the pixel of interest or including the pixel of interest and the pixel belonging to two pixel blocks defined in a form adjacent to the middle pixel block Extraction means for extracting the binarized value;
Determining means for determining whether or not the pixel position of the pixel of interest is an edge portion in accordance with the binarized value extracted by the extracting means;
A characteristic image reading apparatus.
上記判断手段は、上記中画素ブロックに隣接する一方の画素ブロックに属する全ての画素の持つ上記2値化値が同一値を示し、かつ、上記中画素ブロックに隣接するもう一方の画素ブロックに属する全ての画素の持つ上記2値化値がそれとは異なる値の同一値を示す場合に、注目画素の画素位置がエッジ部分であると判断することを、
特徴とする画像読取装置。 The image reading apparatus according to claim 1,
The determination means has the same binarized value of all pixels belonging to one pixel block adjacent to the middle pixel block, and belongs to the other pixel block adjacent to the middle pixel block. When the binarized values of all the pixels indicate the same value different from that, it is determined that the pixel position of the target pixel is an edge part.
A characteristic image reading apparatus.
上記判断手段は、上記中画素ブロックに隣接する2つの画素ブロックに属する全ての画素の持つ上記2値化値が同一値を示し、かつ、上記中画素ブロックに属する少なくとも注目画素の持つ上記2値化値がそれとは異なる値の同一値を示す場合に、注目画素の画素位置がエッジ部分であると判断することを、
特徴とする画像読取装置。 The image reading apparatus according to claim 1,
The determination means indicates that the binarized values of all pixels belonging to two pixel blocks adjacent to the middle pixel block have the same value, and the binary value of at least the target pixel belonging to the middle pixel block. Determining that the pixel position of the pixel of interest is an edge portion when the conversion value indicates the same value different from that,
A characteristic image reading apparatus.
上記取出手段は、指定されたブロックサイズを持つ画素ブロックに属する画素の持つ上記2値化値を取り出すことを、
特徴とする画像読取装置。 The image reading apparatus according to any one of claims 1 to 3,
The extraction means extracts the binarized value of a pixel belonging to a pixel block having a designated block size.
A characteristic image reading apparatus.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004343245A JP2005057813A (en) | 2004-11-29 | 2004-11-29 | Image scanner |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004343245A JP2005057813A (en) | 2004-11-29 | 2004-11-29 | Image scanner |
Related Parent Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2000331916A Division JP3670571B2 (en) | 2000-10-31 | 2000-10-31 | Image reading device |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2005057813A true JP2005057813A (en) | 2005-03-03 |
Family
ID=34373931
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2004343245A Pending JP2005057813A (en) | 2004-11-29 | 2004-11-29 | Image scanner |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2005057813A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010004128A (en) * | 2008-06-18 | 2010-01-07 | Konica Minolta Business Technologies Inc | Image processor, image processing program, and image processing method |
US8018629B2 (en) | 2006-11-13 | 2011-09-13 | Canon Denshi Kabushiki Kaisha | Image reading apparatus, image reading method, and program for implementing the method |
JP2014030109A (en) * | 2012-07-31 | 2014-02-13 | Brother Ind Ltd | Image reader |
JP2015018328A (en) * | 2013-07-09 | 2015-01-29 | 富士ゼロックス株式会社 | Image reading apparatus, image processing apparatus, and program |
-
2004
- 2004-11-29 JP JP2004343245A patent/JP2005057813A/en active Pending
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8018629B2 (en) | 2006-11-13 | 2011-09-13 | Canon Denshi Kabushiki Kaisha | Image reading apparatus, image reading method, and program for implementing the method |
JP2010004128A (en) * | 2008-06-18 | 2010-01-07 | Konica Minolta Business Technologies Inc | Image processor, image processing program, and image processing method |
JP2014030109A (en) * | 2012-07-31 | 2014-02-13 | Brother Ind Ltd | Image reader |
JP2015018328A (en) * | 2013-07-09 | 2015-01-29 | 富士ゼロックス株式会社 | Image reading apparatus, image processing apparatus, and program |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP3670571B2 (en) | Image reading device | |
US8254683B2 (en) | Code image processing method | |
JP4525787B2 (en) | Image extraction apparatus and image extraction program | |
JP4180497B2 (en) | Code type discrimination method and code boundary detection method | |
JP4358193B2 (en) | Automatic image cropping method | |
JP5507134B2 (en) | Two-dimensional code reading method, two-dimensional code recognition method, and two-dimensional code reading apparatus | |
JP2005316755A (en) | Two-dimensional rectangular code symbol reader and two-dimensional rectangular code symbol reading method | |
TW201432576A (en) | Two-dimensional code, system for creation of two-dimensional code, and analysis program | |
JP2004140764A (en) | Image processing device and method therefor | |
JP2008084014A (en) | Image area detection method, program and device | |
US7350710B2 (en) | Two-dimensional code extracting method | |
CN110569845A (en) | test paper image correction method and related device | |
JP2007272348A (en) | Character string recognition method and character string recognition device | |
US6771842B1 (en) | Document image skew detection method | |
US9392140B2 (en) | Image processing apparatus | |
JP2005057813A (en) | Image scanner | |
JP4398498B2 (en) | Code boundary detection method | |
JP2017102841A (en) | Two-dimensional code, two-dimensional code analysis method, two-dimensional code analyzer, and two-dimensional code analyzing program | |
JP4905767B2 (en) | Two-dimensional code detection system and two-dimensional code detection program | |
JP2009093360A (en) | Image processor, image processing method, and program | |
JP2009124332A (en) | Image processor, image processing method and program | |
JP2007328652A (en) | Image processing device and image processing program | |
JP3932201B2 (en) | Form type identification device and recording medium | |
JP2859936B2 (en) | Image information processing device | |
JP2005056346A (en) | Skew-detecting method, skew-detecting device and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20041129 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20050729 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20050906 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20060110 |