JP2005057813A - Image scanner - Google Patents

Image scanner Download PDF

Info

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
Application number
JP2004343245A
Other languages
Japanese (ja)
Inventor
Yukio Kaji
行雄 梶
Shinji Suzuki
慎次 鈴木
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
PFU Ltd
Original Assignee
PFU Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by PFU Ltd filed Critical PFU Ltd
Priority to JP2004343245A priority Critical patent/JP2005057813A/en
Publication of JP2005057813A publication Critical patent/JP2005057813A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a new image scanner which can detect correctly an edge which image data read by a line image sensor have. <P>SOLUTION: Then image scanner comprises a binary-coded means deriving two binary-coded values per pixel by binary-coding with a distinct threshold while the image data are binary-coded with a certain threshold, an extraction means which extracts the binary-coded value in a pixel which belongs to a middle picture element block defined alternatively in form comprising only a noticed pixel or a noticed pixel and the binary-coded value in a pixel which belongs to two picture element blocks defined by form which adjoins the middle picture element block, and a determining means to determine whether a pixel position of the noticed pixel is an edge according to the binary-coded value extracted by the extraction means. <P>COPYRIGHT: (C)2005,JPO&NCIPI

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 original reading apparatus 1 having the present invention.

この図に示すように、本発明の原稿読取装置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 document reading apparatus 1 according to the present invention includes a line image sensor 10 that reads a document conveyed by an automatic paper feeding mechanism, and an A / D converter that performs A / D conversion on image data read by the line image sensor 10. A D / A converter 11, a memory control unit 12 that reads image data by performing prescribed image processing using image data output from the A / D converter 11, and an A / D The image data output from the D converter 11 is input, the edge detection unit 13 that detects the edge portion of the image data, and the edge information detected by the edge detection unit 13 is input by using, for example, firmware. An inclination / size detection unit 14 for detecting the inclination and size of the image and a scanner, for example, configured to be firmware read from the memory control unit 12 Instructs the management start, it receives the detection result of the tilt / size detecting section 14, and a scanner control unit 15 for instructing the start of the deskew process to the memory control unit 12.

このメモリ制御部12は、ラインイメージセンサ10により読み取られる原稿の画像データをその読み取りの順番に格納する第1の画像メモリ20と、第1の画像メモリ20に格納される原稿の画像データをその傾きを補正しつつ読み出す傾き補正読出部21と、傾き補正読出部21による読み出しにより発生する画像データの持つギザギザ部分をスムーズなものにするスムージング処理部22と、スムージング処理部22の処理した画像データを平滑化する平滑化処理部23と、平滑化処理部23の処理した画像データを水平方向に拡大する水平拡大処理部24と、平滑化処理部23の処理した画像データを垂直方向に拡大する垂直拡大処理部25と、水平/垂直方向に拡大された画像データを2値化する2値化部26と、原稿の枠部分に存在する陰やノイズを除去するマスキング部27と、これらの処理の施された第1の画像メモリ20から読み出された画像データを格納して、図示しない上位装置に引き渡す第2の画像メモリ28とを備える。   The memory control unit 12 stores a first image memory 20 that stores document image data read by the line image sensor 10 in the reading order, and a document image data stored in the first image memory 20. An inclination correction reading unit 21 that reads out the image while correcting the inclination, a smoothing processing unit 22 that smoothes a jagged portion of image data generated by reading by the inclination correction reading unit 21, and image data processed by the smoothing processing unit 22 A smoothing processing unit 23 for smoothing the image, a horizontal enlargement processing unit 24 for enlarging the image data processed by the smoothing processing unit 23 in the horizontal direction, and an image data processed by the smoothing processing unit 23 in the vertical direction. A vertical enlargement processing unit 25, a binarization unit 26 for binarizing image data enlarged in the horizontal / vertical direction, and a frame portion of the document A masking unit 27 for removing existing shadows and noises, and a second image memory 28 for storing the image data read from the first image memory 20 subjected to these processes and delivering it to a host device (not shown). With.

このように、メモリ制御部12は、原稿の画像データを2値化してから傾きを補正するのではなくて、2値化する前の多値データの状態で傾きを補正する構成を採って、その後で、スムージング処理を施すという構成を採っている。これから、スムージング処理が有効なものになる。   In this way, the memory control unit 12 does not correct the inclination after binarizing the image data of the document, but adopts a configuration in which the inclination is corrected in the state of the multi-value data before binarization. After that, a configuration is adopted in which smoothing processing is performed. Thus, the smoothing process becomes effective.

なお、平滑化処理部23や水平拡大処理部24や垂直拡大処理部25や2値化部26やマスキング部27については、従来の画像処理技術で用いられたものを利用することができる。   As the smoothing processing unit 23, the horizontal enlargement processing unit 24, the vertical enlargement processing unit 25, the binarization unit 26, and the masking unit 27, those used in the conventional image processing technology can be used.

先ず最初に、本発明の原稿読取装置1が備える各構成部分の概要について説明する。   First, an outline of each component included in the document reading apparatus 1 of the present invention will be described.

(1)エッジ検出部13は、本発明を実現すべく備えられるものであり、スキャナ制御部15の発行するスキャナ読取処理の起動に応答して起動されると、図2に示すように、各ライン毎に、ラインイメージセンサ10の読み取る画像データをスキャン開始の左端から順番に確認することで、ノイズや陰に影響されることなく、「白から黒」あるいは「黒から白」に急峻に変化する画素位置を検出して、最初に検出する画素位置を「左エッジ」、最後に検出する画素位置を「右エッジ」として、それを傾き/サイズ検出部14に報告する処理を行う。   (1) The edge detection unit 13 is provided to realize the present invention. When the edge detection unit 13 is activated in response to the activation of the scanner reading process issued by the scanner control unit 15, as shown in FIG. By checking the image data read by the line image sensor 10 in order from the left edge of the scan start for each line, it changes sharply from “white to black” or “black to white” without being affected by noise or shadow. A pixel position to be detected is detected, and the first pixel position to be detected is “left edge”, and the last pixel position to be detected is “right edge”, and this is reported to the inclination / size detection unit 14.

(2)傾き/サイズ検出部14は、エッジ検出部13から各ライン毎に報告される「左エッジ座標」/「右エッジ座標」を受け取ると、図3に示すように、原稿の上端側の2つの頂点の座標を検出するとともに、原稿の最下端となる頂点の座標を検出する処理を行う。   (2) Upon receiving the “left edge coordinates” / “right edge coordinates” reported for each line from the edge detection unit 13, the inclination / size detection unit 14, as shown in FIG. While detecting the coordinates of the two vertices, a process of detecting the coordinates of the vertex which is the lowest end of the document is performed.

そして、傾き/サイズ検出部14は、この上端側の2つの頂点の座標が検出できた段階で、図中に示す原稿の「幅」と「水平傾き(θ) 」とを算出し、更に、“1/cos θ”に従って水平倍率補正値を算出するとともに、原稿の搬送速度が規定の標準である場合には、その水平倍率補正値と同じ値を垂直倍率補正値として算出し、原稿の搬送速度が規定の標準のものでない場合には、“1/cos θ”と搬送速度の比率値とに従って垂直倍率補正値を算出して、それらの「幅」/「傾き(tan θで表現する)」/「倍率補正値」と、原稿の上左端の頂点に対応付けられる画素データの格納先アドレス(第1の画像メモリ20の格納アドレス)として定義される「切出開始アドレス」とをスキャナ制御部15に報告する処理を行う。   Then, the inclination / size detection unit 14 calculates the “width” and “horizontal inclination (θ)” of the document shown in the drawing at the stage where the coordinates of the two vertices on the upper end side can be detected, and further, The horizontal magnification correction value is calculated according to “1 / cos θ”, and when the document conveyance speed is a prescribed standard, the same value as the horizontal magnification correction value is calculated as the vertical magnification correction value, and the document conveyance When the speed is not the specified standard, the vertical magnification correction value is calculated according to the ratio value of “1 / cos θ” and the conveyance speed, and their “width” / “slope (expressed in tan θ) ] / “Magnification correction value” and “cutout start address” defined as a storage destination address (storage address of the first image memory 20) of pixel data associated with the top leftmost vertex of the document Processing to be reported to the unit 15 is performed.

そして、傾き/サイズ検出部14は、検出した原稿の最下端の頂点までの読み取りが終えたことを検出(図中に示す原稿の「長さ」を算出できる状態)すると、原稿の読み取りが終了した旨をスキャナ制御部15に報告する処理を行う。   Then, when the inclination / size detection unit 14 detects that the reading to the lowest vertex of the detected original has been completed (a state in which the “length” of the original shown in the figure can be calculated), the reading of the original is completed. A process of reporting the fact to the scanner control unit 15 is performed.

(3)スキャナ制御部15は、メモリ制御部12に対してスキャナ読取処理の実行を指示することで、図4に示すように、ラインイメージセンサ10により読み取られる原稿の画像データ(多値データ)を、メモリ制御部12の持つ第1の画像メモリ20にその読み取りの順番に書き込む処理を行う。   (3) The scanner control unit 15 instructs the memory control unit 12 to execute the scanner reading process, and as shown in FIG. 4, the image data (multi-value data) of the original read by the line image sensor 10 Are written into the first image memory 20 of the memory control unit 12 in the order of reading.

そして、スキャナ制御部15は、傾き/サイズ検出部14から、上述した「切出開始アドレス」/「幅」/「傾き」/「倍率補正値」の報告を受け取ると、「画像処理モード」/「マスキング範囲」を設定して、それらの受け取った値とその設定した値とを通知しつつ、メモリ制御部12に対してデスキュー処理の実行を指示する処理を行う。   When the scanner control unit 15 receives the report of “cutting start address” / “width” / “tilt” / “magnification correction value” from the tilt / size detection unit 14, the “image processing mode” / The “masking range” is set, and the received value and the set value are notified, and the memory controller 12 is instructed to execute the deskew process.

なお、スキャナ制御部15は、傾き/サイズ検出部14が傾き/サイズの検出に失敗した場合には、メモリ制御部12に対して傾き“0”のデスキュー処理の実行を指示することになる。   When the tilt / size detection unit 14 fails to detect the tilt / size, the scanner control unit 15 instructs the memory control unit 12 to execute a deskew process with the tilt “0”.

そして、スキャナ制御部15は、傾き/サイズ検出部14から、原稿の読み取りが終了した旨の通知を受け取ると、それに応動して、メモリ制御部12に対してデスキュー処理の終了を指示する処理を行う。   When the scanner control unit 15 receives a notification from the inclination / size detection unit 14 that the reading of the document has been completed, the scanner control unit 15 responds to the process and instructs the memory control unit 12 to end the deskew process. Do.

(4)メモリ制御部12は、スキャナ制御部15からスキャナ読取処理の起動がかかると、図4に示したように、ラインイメージセンサ10により読み取られる原稿の画像データを、メモリ制御部12の持つ第1の画像メモリ20にその読み取りの順番に書き込む処理を行う。   (4) When the scanner control process 15 is activated from the scanner control unit 15, the memory control unit 12 has the image data of the original read by the line image sensor 10 in the memory control unit 12, as shown in FIG. The first image memory 20 is written in the reading order.

そして、メモリ制御部12は、スキャナ制御部15からデスキュー処理の起動がかかると、スキャナ制御部15から通知される「切出開始アドレス」/「幅」/「傾き」/「倍率補正値」に従って、図5に示すように、第1の画像メモリ20に格納される原稿の画像データをその傾きを補正しつつ読み出すとともに、その読み出しにより発生する画像データの持つギザギザ部分をスムーズなものにするスムージング処理を施し、更に、平滑化処理部23や水平拡大処理部24や垂直拡大処理部25や2値化部26やマスキング部27を使って、スキャナ制御部15から通知される「画像処理モード」/「マスキング範囲」に応じた画像処理を施す処理に入って、原稿の読み取りの終了に連動してスキャナ制御部15からデスキュー処理の終了が指示されると、その処理を終了する処理を行う。   When the deskew processing is activated from the scanner control unit 15, the memory control unit 12 follows the “cutting start address” / “width” / “tilt” / “magnification correction value” notified from the scanner control unit 15. As shown in FIG. 5, the image data of the document stored in the first image memory 20 is read while correcting the inclination, and the jagged portion of the image data generated by the reading is smoothed. Further, the “image processing mode” notified from the scanner control unit 15 using the smoothing processing unit 23, the horizontal enlargement processing unit 24, the vertical enlargement processing unit 25, the binarization unit 26, and the masking unit 27 is performed. / Enter processing to perform image processing according to “masking range”, and complete deskew processing from scanner control unit 15 in conjunction with the end of document reading When instructed, it performs a process of ending the process.

なお、メモリ制御部12は、スキャナ制御部15から傾き“0”のデスキュー処理の実行を指示されるときには、第1の画像メモリ20に格納される原稿の画像データをそのまま読み出すことで、傾きの補正やスムージング処理は行わないように処理することになる。   When the memory control unit 12 is instructed by the scanner control unit 15 to execute the deskew process with the inclination “0”, the image data of the original stored in the first image memory 20 is read as it is, so The correction or smoothing process is not performed.

次に、本発明の原稿読取装置1を構成する各構成部分の詳細な構成について説明する。   Next, a detailed configuration of each component constituting the document reading apparatus 1 of the present invention will be described.

先ず最初に、図6に示すエッジ検出部13の一実施形態例に従って、エッジ検出部13の詳細な構成について説明する。   First, a detailed configuration of the edge detection unit 13 will be described according to an embodiment of the edge detection unit 13 shown in FIG.

エッジ検出部13は、図6に示すように、ドットカウンタ130と、左端エッジ座標検出部131と、右端エッジ座標検出部132と、エッジ座標報告部133と、エッジフィルタ部134とで構成されている。   As shown in FIG. 6, the edge detection unit 13 includes a dot counter 130, a left end edge coordinate detection unit 131, a right end edge coordinate detection unit 132, an edge coordinate report unit 133, and an edge filter unit 134. Yes.

このドットカウンタ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 detection unit 132 sets (FF) to the last edge register when the horizontal synchronization signal is ON, and (2) the horizontal valid signal is ON, and the edge filter unit 134 detects the edge. If detected, the counter value of the dot counter 130 is set in the register of the last edge. (3) If the horizontal valid signal is OFF or the edge filter unit 134 does not detect the edge, the value of the register of the last edge is held. Thus, the dot counter value of the pixel detected as the final edge portion is held for each line.

エッジ座標報告部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 / size detection unit 14.

エッジフィルタ部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 / D converter 11 with the Low slice / High slice described above, and the comparator 200. The shift register 201 that shifts and holds the high slice comparison output that is output from the shift register 202 that shifts and holds the low slice comparison output that is output from the comparator 200, and the pixels belonging to the left block held by the shift register 201 The AND circuit 203 that calculates the logical product of the comparison output values, the AND circuit 204 that calculates the logical product of the comparison output values of the pixels belonging to the left block held by the shift register 202, and the middle block held by the shift register 201 AND circuit 2 for calculating the logical product of the comparison output values of the pixels 5 and an AND circuit 206 that calculates the logical product of the comparison output values of the pixels belonging to the middle block held by the shift register 202, and the logical product of the comparison output values of the pixels that belong to the right block held by the shift register 201. The AND pixel 207, the AND circuit 208 that calculates the logical product of the comparison output values of the pixels belonging to the right block held by the shift register 202, and the calculation results of the AND circuits 203 to 208 are input, and the target pixel position is an edge. An edge determination circuit 209 for determining whether or not.

この構成に従って入力されるデータを受けて、エッジ判定回路209は、外部から指示されるフィルタタイプに従って「原稿の押え板が黒」であることを判断する場合には、図9に示すフィルタタイプ1の論理演算を実行することで、注目画素位置がエッジ部分であるのか否かを判断し、そして、外部から指示されるフィルタタイプに従って「原稿の押え板が白」であることを判断する場合には、図9に示すフィルタタイプ2の論理演算を実行することで、注目画素位置がエッジ部分であるのか否かを判断する。   When the edge determination circuit 209 receives the data input according to this configuration and determines that “the presser plate of the document is black” according to the filter type instructed from the outside, the filter type 1 shown in FIG. To determine whether or not the target pixel position is an edge portion, and according to the filter type instructed from the outside, it is determined that “the original press plate is white” Performs a filter type 2 logical operation shown in FIG. 9 to determine whether or not the target pixel position is an edge portion.

なお、図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 determination circuit 209.

この構成に従って、エッジ検出部13は、スキャナ制御部15の発行するスキャナ読取処理の起動に応答して起動されると、図2に示すように、各ライン毎に、ラインイメージセンサ10の読み取る画像データをスキャン開始の左端から順番に確認することで、ノイズや陰に影響されることなく、「白から黒」あるいは「黒から白」に急峻に変化する画素位置を検出して、最初に検出する画素位置を「左エッジ」、最後に検出する画素位置を「右エッジ」として、それを傾き/サイズ検出部14に報告する処理を行うのである。   According to this configuration, when the edge detection unit 13 is activated in response to the activation of the scanner reading process issued by the scanner control unit 15, the image read by the line image sensor 10 for each line as shown in FIG. By checking the data in order from the left edge of the scan start, the pixel position that changes sharply from “white to black” or “black to white” is detected first without being affected by noise or shadow. The pixel position to be detected is the “left edge”, the pixel position to be detected last is the “right edge”, and the process of reporting it to the inclination / size detection unit 14 is performed.

次に、傾き/サイズ検出部14の実行する詳細な処理について説明する。   Next, detailed processing executed by the tilt / size detection unit 14 will be described.

傾き/サイズ検出部14は、図11(a)に示すような傾いた姿勢で搬送されてくる原稿の傾きとサイズとを検出する処理を行う。このとき、図11(b)に示すように、原稿の四隅が折り曲げられていたり、原稿の四隅にマーク等が記載されていても、原稿の傾きとサイズとを正確に検出する機能を有している。   The inclination / size detection unit 14 performs processing for detecting the inclination and size of the document conveyed in an inclined posture as shown in FIG. At this time, as shown in FIG. 11B, even if the four corners of the document are bent or marks or the like are written at the four corners of the document, the document has a function of accurately detecting the inclination and size of the document. ing.

傾き/サイズ検出部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 / size detection unit 14 has an expression “Y = A * X + B” indicating the coordinate position of the left side of the document and an expression “Y = A * X + C ”, an expression“ Y = − (1 / A) * X + D ”indicating the coordinate position of the upper side of the document, and an expression“ Y = − (1 / A) * X + E ”indicating the coordinate position of the lower side of the document. This detection function is realized by calculating the coordinates of the two vertices on the upper end side of the document and the coordinates of the vertex that is the lowest end of the document according to these four equations.

図13ないし図15に、傾き/サイズ検出部14の実行する処理フローの一例を図示する。次に、この処理フローに従って、この検出機能を実現する傾き/サイズ検出部14の実行する処理について詳細に説明する。   FIGS. 13 to 15 show an example of a processing flow executed by the tilt / size detection unit 14. Next, according to this processing flow, processing executed by the inclination / size detection unit 14 that realizes this detection function will be described in detail.

傾き/サイズ検出部14は、原稿読取処理に入ることで起動されると、図13ないし図15の処理フローに示すように、先ず最初に、ステップ1で、エッジ検出部13からエッジのX座標値となる「左端エッジ座標」/「右端エッジ座標」の報告を待って、その報告を受け取ると、ステップ2に進んで、その報告される「左端エッジ座標」/「右端エッジ座標」を受け取る。   When the tilt / size detection unit 14 is started by entering the document reading process, first, as shown in the processing flow of FIGS. 13 to 15, first, in step 1, the X coordinate of the edge is detected from the edge detection unit 13. After receiving the report of the “left edge coordinate” / “right edge coordinate” as a value and receiving the report, the process proceeds to step 2 to receive the reported “left edge coordinate” / “right edge coordinate”.

続いて、ステップ3で、読取ライン数を加算することで、その受け取った「左端エッジ座標」/「右端エッジ座標」のY座標値を算出し、続くステップ4で、その受け取った「左端エッジ座標」/「右端エッジ座標」を、読取ライン数と対応を取りつつ保存する。   Subsequently, in step 3, the Y coordinate value of the received “left edge coordinate” / “right edge coordinate” is calculated by adding the number of read lines, and in step 4, the received “left edge coordinate” is received. "/" Right edge edge coordinates "are stored in correspondence with the number of read lines.

続いて、ステップ5で、原稿の上端の2つの頂点を検出してあるのか否かを判断して、検出していないことを判断するときには、ステップ6に進んで、受け取った「右端エッジ座標」と「左端エッジ座標」との差分値を算出することで原稿幅を算出する。   Subsequently, in step 5, it is determined whether or not two vertices at the upper end of the document have been detected. If it is determined that they have not been detected, the process proceeds to step 6 to receive the received "right edge coordinate". The document width is calculated by calculating a difference value between the “left edge coordinate” and the “left edge coordinate”.

続いて、ステップ7で、その算出した原稿幅が前回のものよりも広くなったのか否かを判断して、広くなったことを判断するときには、そのままステップ1に戻り、広くなっていないことを判断するときには、ステップ8に進んで、その状態が規定のライン数連続したのか否かを判断して、規定のライン数連続していない場合には、そのままステップ1に戻る。   Subsequently, in step 7, it is determined whether or not the calculated document width is wider than the previous one, and when it is determined that the document is widened, the process returns to step 1 as it is. When making a determination, the process proceeds to step 8 where it is determined whether or not the state continues for a specified number of lines. If the specified number of lines is not continued, the process returns to step 1 as it is.

一方、ステップ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 step 8 that the document width is not widened for a predetermined number of lines, that is, when it is determined that the position of the document width W shown in FIG. The left edge coordinate (X1, Y1) that is the starting point of the number of continuous lines and the left edge coordinate (X2, Y2) that is the arrival point of the number of continuous lines indicate the coordinate position of the left side of the document. Formula Y = A * X + B
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 step 10, the inclinations of the top and bottom sides of the document are “corresponding to the fact that the top side, the left side, and the right side of the document are orthogonal to each other and the bottom side, the left side, and the right side of the document are orthogonal to each other. -(1 / A) ".

続いて、ステップ11で、保存してあるエッジ座標の中から原稿の上辺に位置するエッジ座標を抽出する。この原稿の上辺に位置するエッジ座標を抽出する処理は、例えば、保存してあるエッジ座標(左端エッジ座標/右端エッジ座標)の中から、ステップ8でその到達を判断した原稿幅Wよりも小さな原稿幅を持つエッジ座標を抽出して、それらの中から、原稿の左辺の座標位置を示す式「Y=A*X+B」や、原稿の右辺の座標位置を示す式「Y=A*X+C」に乗らないものを特定することで行う。   Subsequently, at step 11, edge coordinates located on the upper side of the document are extracted from the stored edge coordinates. The processing for extracting the edge coordinates located on the upper side of the document is, for example, smaller than the document width W determined to be reached in step 8 from the stored edge coordinates (left edge coordinate / right edge coordinate). Edge coordinates having the document width are extracted, and among them, an expression “Y = A * X + B” indicating the coordinate position of the left side of the document or an expression “Y = A * X + C” indicating the coordinate position of the right side of the document. This is done by identifying things that do not ride on.

続いて、ステップ12で、この抽出したエッジ座標(例えば、図12に示す(X5,Y5))を、原稿の上辺の座標位置を示す式
Y=−(1/A)*X+D
に代入することで、この抽出した各エッジ座標毎にDの値を算出して、他のものから外れている値を除外しつつその算出されたDの値の平均値を算出することで、原稿の上辺の座標位置を示す式
Y=−(1/A)*X+D
を算出する。
Subsequently, in step 12, the extracted edge coordinates (for example, (X5, Y5) shown in FIG. 12) are expressed by the equation Y =-(1 / A) * X + D indicating the coordinate position of the upper side of the document.
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 step 13, an expression “Y = A * X + B” indicating the coordinate position of the left side of the document calculated in step 9 and an expression “Y = − (1 / A / A) indicating the calculated coordinate position of the upper side of the document. ) * X + D ”is calculated to obtain the coordinates of the upper left vertex of the document, and the equation“ Y = A * X + C ”indicating the coordinate position of the right side of the document calculated in step 9 is calculated. The coordinates of the upper right vertex of the document are obtained by calculating the position of the intersection with the expression “Y = − (1 / A) * X + D” indicating the coordinate position of the upper side of the document.

続いて、ステップ14で、その算出した原稿の左上頂点の座標と右上頂点の座標とから、原稿が右上がりに傾いているのか左上がりに傾いているのかを検出する。すなわち、左上頂点の座標の方が右上頂点の座標よりも読取開始側に近い位置にあるときには、原稿は左上がりの形態で傾いていると判断し、右上頂点の座標の方が左上頂点の座標よりも読取開始側に近い位置にあるときには、原稿は右上がりの形態で傾いていると判断するのである。   Subsequently, in step 14, it is detected from the calculated coordinates of the upper left vertex of the original and the coordinates of the upper right vertex whether the original is inclined upward or upward. That is, when the coordinates of the upper left vertex are closer to the reading start side than the coordinates of the upper right vertex, it is determined that the document is tilted in a left-up manner, and the coordinates of the upper right vertex are the coordinates of the upper left vertex. When the position is closer to the reading start side than the original, it is determined that the document is inclined in a right-up manner.

続いて、ステップ15で、図3に示したもので定義される「切出開始アドレス(原稿の上左端のエッジ座標に対応付けられる画素データの第1の画像メモリ20上の格納アドレス)」と、「幅」と、「傾き(tan θ)」と、「倍率補正値(1/cos θ) 」とを算出して、それをスキャナ制御部15に通知してから、ステップ1に戻る。   Subsequently, in step 15, “the extraction start address (the storage address on the first image memory 20 of the pixel data associated with the edge coordinates of the upper left edge of the document)” defined by the one shown in FIG. , “Width”, “tilt (tan θ)”, and “magnification correction value (1 / cos θ)” are calculated and notified to the scanner controller 15, and the process returns to step 1.

一方、ステップ5で、原稿の上端の2つの頂点を検出してあることを判断するときには、ステップ16に進んで、原稿の最下端の頂点を検出してあるのか否かを判断して、最下端の頂点を検出していないことを判断するときには、ステップ17に進んで、受け取った「右端エッジ座標」と「左端エッジ座標」との差分値を算出することで原稿幅を算出する。   On the other hand, if it is determined in step 5 that the two top vertices of the document have been detected, the process proceeds to step 16 to determine whether or not the bottommost vertex of the document has been detected. When it is determined that the bottom vertex is not detected, the process proceeds to step 17 to calculate the document width by calculating the difference value between the received “right end edge coordinates” and “left end edge coordinates”.

続いて、ステップ18で、その算出した原稿幅が概略0となったのか否かを判断して、原稿幅が概略0になっていないことを判断するときには、ステップ1に戻り、原稿幅が概略0となったことを判断するときには、ステップ18に進んで、保存してあるエッジ座標の中から原稿の下辺に位置するエッジ座標を抽出する。   Subsequently, in step 18, when it is determined whether or not the calculated document width is approximately 0, and it is determined that the document width is not approximately 0, the process returns to step 1, and the document width is approximately When it is determined that the value is 0, the process proceeds to step 18 to extract the edge coordinates located on the lower side of the document from the stored edge coordinates.

この原稿の下辺に位置するエッジ座標を抽出する処理は、例えば、保存してあるエッジ座標(左端エッジ座標/右端エッジ座標)の中から上述の原稿幅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 step 20, the equation “Y = A * X + B” indicating the coordinate position of the left side of the document or the equation “Y = One of the formulas “A * X + C” is selected, and the intersection position of the selected formula and the formula “Y = − (1 / A) * X + E” indicating the coordinate position of the detected lower side of the original is determined. By calculating, the lowest vertex of the document is obtained.

すなわち、ステップ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 step 14 that the document is tilted upward as shown in FIG. 12, the equation “Y = A * X + C” indicating the coordinate position of the right side of the document and the calculated document By calculating the position of the intersection with the expression “Y = − (1 / A) * X + E” indicating the coordinate position of the lower side of the document, the lowest vertex of the document is obtained, while the document is tilted upward to the right Is detected, the equation “Y = A * X + B” indicating the coordinate position of the left side of the document, and the equation “Y = − (1 / A) * X + E” indicating the calculated coordinate position of the lower side of the document, By calculating the position of the intersection, the lowermost vertex of the document is obtained.

続いて、ステップ21で、読取ラインが原稿の最下端の頂点の位置と一致したのか否かを判断して、一致しないことを判断するときには、ステップ1に戻り、一致したことを判断するときには、ステップ22に進んで、原稿の読み取りの終了をスキャナ制御部15に通知して、処理を終了する。   Subsequently, in step 21, it is determined whether or not the reading line coincides with the position of the lowermost vertex of the document. When it is determined that the reading line does not match, the process returns to step 1, and when it is determined that the reading line matches, Proceeding to step 22, the scanner control unit 15 is notified of the end of reading of the document, and the process ends.

そして、ステップ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 scanner control section 15 is notified of the “length” of the original shown in FIG. This is based on how much memory capacity (= [length / cos θ] * [width] for storing document image data for a host device (not shown) that receives document image data from the second image memory 28. This is to inform whether it is necessary to prepare / cos θ]).

このようにして、傾き/サイズ検出部14は、エッジ検出部13から各ライン毎に報告される「左エッジ座標」/「右エッジ座標」を受け取ると、図3に示すように、原稿の上端側の2つの頂点の座標を検出するとともに、原稿の最下端となる頂点の座標を検出する処理を行う。   In this way, upon receiving the “left edge coordinates” / “right edge coordinates” reported for each line from the edge detection unit 13, the inclination / size detection unit 14 receives the upper edge of the document as shown in FIG. In addition to detecting the coordinates of the two vertices on the side, processing is performed to detect the coordinates of the vertex that is the lowermost end of the document.

そして、傾き/サイズ検出部14は、この上端側の2つの頂点の座標が検出できた段階で、原稿の「幅」と、原稿の「傾き(tan θ:好ましくは分子が1、分母が自然数となる値に近似する)」と、原稿の「倍率補正値(1/cos θ:但し、原稿の搬送速度が標準のものでない場合には、水平倍率補正値と垂直倍率補正値とを別々に算出する)」と算出するとともに、「切出開始アドレス(原稿の上左端のエッジ座標に対応付けられる画素データの第1の画像メモリ20上の格納アドレス)」を特定して、これらのデータをスキャナ制御部15に報告する処理を行う。   The inclination / size detection unit 14 detects the coordinates of the two vertices on the upper end side and the original “width” and the original “inclination (tan θ: preferably numerator 1, denominator is a natural number”. ”And the“ magnification correction value (1 / cos θ: when the document transport speed is not a standard one), the horizontal magnification correction value and the vertical magnification correction value are separately set. And “the extraction start address (the storage address on the first image memory 20 of the pixel data associated with the edge coordinates of the upper left edge of the document)” is specified. Processing to report to the scanner control unit 15 is performed.

そして、傾き/サイズ検出部14は、検出した原稿の最下端の頂点までの読み取りが終えたことを検出すると、原稿の読み取りが終了した旨をスキャナ制御部15に報告する処理を行う。   When the inclination / size detection unit 14 detects that the reading of the detected original to the lowest vertex is completed, the inclination / size detection unit 14 performs processing to report to the scanner control unit 15 that the reading of the original has been completed.

スキャナ制御部15は、上述したように、メモリ制御部12に対してスキャナ読取処理の実行を指示することで、図4に示すように、ラインイメージセンサ10により読み取られる原稿の画像データ(多値データ)を、メモリ制御部12の持つ第1の画像メモリ20にその読み取りの順番に書き込む処理を行う。   As described above, the scanner control unit 15 instructs the memory control unit 12 to execute the scanner reading process, and as shown in FIG. 4, the image data (multivalued) of the document read by the line image sensor 10 is read. Data) is written into the first image memory 20 of the memory control unit 12 in the order of reading.

そして、スキャナ制御部15は、上述した処理に従って傾き/サイズ検出部14から、「切出開始アドレス」/「幅」/「傾き」/「倍率補正値」の報告を受け取ると、「画像処理モード」/「マスキング範囲」を設定して、それらの受け取った値とその設定した値とを通知しつつ、メモリ制御部12に対してデスキュー処理の実行を指示する処理を行う。   When the scanner control unit 15 receives the report of “cutting start address” / “width” / “tilt” / “magnification correction value” from the tilt / size detection unit 14 according to the above-described processing, the “image processing mode” "/ Masking range" is set, and the received value and the set value are notified, and processing for instructing the memory control unit 12 to execute deskew processing is performed.

そして、スキャナ制御部15は、傾き/サイズ検出部14から、原稿の読み取りが終了した旨の通知を受け取ると、メモリ制御部12に対してデスキュー処理の終了を指示する処理を行う。   When the scanner control unit 15 receives a notification from the inclination / size detection unit 14 that the reading of the document has been completed, the scanner control unit 15 performs a process for instructing the memory control unit 12 to end the deskew process.

次に、メモリ制御部12の実行する処理の詳細について説明する。   Next, details of processing executed by the memory control unit 12 will be described.

メモリ制御部12は、スキャナ制御部15からスキャナ読取処理の起動がかかると、図4に示したように、ラインイメージセンサ10により読み取られる原稿の画像データを、メモリ制御部12の持つ第1の画像メモリ20にその読み取りの順番に書き込む処理を行う。   When the scanner reading process is activated from the scanner control unit 15, the memory control unit 12, as shown in FIG. 4, stores the first image data of the document read by the line image sensor 10 in the memory control unit 12. A process of writing to the image memory 20 in the order of reading is performed.

なお、これから説明するように、メモリ制御部12は、第1の画像メモリ20に書き込んだ画像データを順次読み出して並列的に処理していくことになるので、ラインイメージセンサ10により読み取られる原稿の画像データを上書きする形で第1の画像メモリ20に書き込むことが可能となる。これから、第1の画像メモリ20は、原稿1枚分の画像データを格納できるようにする容量を持つ必要はない。   As will be described below, the memory control unit 12 sequentially reads the image data written in the first image memory 20 and processes it in parallel, so that the document read by the line image sensor 10 can be processed. The image data can be overwritten in the first image memory 20 in an overwritten manner. Thus, the first image memory 20 does not need to have a capacity for storing image data for one original.

この書き込みに応答して、傾き/サイズ検出部14は上述した処理に入り、これを受けて、スキャナ制御部15は、ある時点で、メモリ制御部12に対して、「切出開始アドレス」/「幅」/「傾き(tan θ)」/「倍率補正値」/「画像処理モード」/「マスキング範囲」を通知しつつ、デスキュー処理の実行を指示する。   In response to this writing, the inclination / size detection unit 14 enters the above-described processing, and in response to this, the scanner control unit 15 instructs the memory control unit 12 to “cut out start address” / While performing notification of “width” / “tilt (tan θ)” / “magnification correction value” / “image processing mode” / “masking range”, execution of deskew processing is instructed.

このデスキュー処理の実行指示を受け取ると、メモリ制御部12を構成する傾き補正読出部21は、通知された「切出開始アドレス」を起点にして、通知された「傾き(tan θ)」と通知された「幅」とに応じた形で格納アドレスを順次設定しながら、第1の画像メモリ20に格納される原稿の画像データをその傾きを補正しつつ読み出す処理を行う。   Upon receiving this deskew processing execution instruction, the inclination correction reading unit 21 constituting the memory control unit 12 notifies the notified “tilt (tan θ)” from the notified “cutout start address”. While the storage addresses are sequentially set in accordance with the “width”, the image data of the original stored in the first image memory 20 is read while correcting 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 first image memory 20 has regularity as shown in FIG. 17, and from this, the inclination correction reading unit 21 reads “cutting start address” / “inclination (tan θ)”. ”/“ Width ”notification, you can know how to change the storage address and read the image data of the document with corrected tilt. The image data of the document stored in the first image memory 20 is read out while correcting the inclination while sequentially setting the storage addresses.

図18ないし図20に、傾き補正読出部21が実行するこの画像データの読み出し処理を処理フローの形で記述したものを図示する。   FIG. 18 to FIG. 20 illustrate the image data reading process executed by the inclination correction reading unit 21 in the form of a processing flow.

ここで、この処理フローでは、「水平傾き(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 step 2 is performed with a code added to “horizontal inclination (1 / (p + 1))”. Steps 3 to 14 are processes executed when the document is tilted upward to the right, and steps 15 to 26 are processes performed when the document is tilted upward to the left.

図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 step 5 is, for example, the fourth pixel data e following the address X. This is the storage address of the pixel data f one line before that is associated with the storage address. Further, the “address after one line associated with the address next to the address X” described in step 14 is, for example, pixel data (1) (1 shown in the figure). Pixel data after one line (3) (in the figure) associated with the storage address of the next pixel data (2) (pixel data in which 2 is circled in the figure) (2) 3 is a storage address of pixel data surrounded by a circle.

ステップ3〜ステップ14で実行する原稿が右上がりに傾いているときの処理では、原稿の上左端の頂点を起点にして、1ライン前1ライン前と辿って画像データを読み出していくのに対して、ステップ15〜ステップ26で実行する原稿が左上がりに傾いているときの処理では、原稿の上左端の頂点を起点にして、1ライン後1ライン後と辿って画像データを読み出していく点に違いがあるだけである。   In the processing executed in steps 3 to 14 when the document is tilted upward to the right, the image data is read by tracing back one line before one line starting from the top left edge of the document. Thus, in the processing executed when the original is tilted to the left in steps 15 to 26, the image data is read by tracing one line and one line starting from the top left edge of the original. There is only a difference.

このような斜め読み出しの方法を用いると、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 processing unit 22 constituting the memory control unit 12 is prepared for correcting this image shift.

傾き補正読出部21は、このスムージング処理部22に対して、どの画素に対してスームジング処理を施せばよいのかを知らせるために、図16に示すように、垂直方向にずらした形で画素データを読み出すときには、そのずらしの直前に読み出した画素データ(例えば図中のd)と、そのずらして読み出した画素データ(例えば図中のf)とを「水平ズレ画素」として定義して、画素データに付加される1ビット構成の水平ズレビットをONするように処理している。   In order to notify the smoothing processing unit 22 to which pixel the smoothing processing should be performed, the inclination correction reading unit 21 shifts the pixel data in a form shifted in the vertical direction as shown in FIG. When reading, pixel data read immediately before the shift (for example, d in the figure) and pixel data read by the shift (for example, f in the figure) are defined as “horizontal misalignment pixels”, and the pixel data Processing is performed to turn on the horizontal shift bit of the 1-bit configuration to be added.

そして、傾き補正読出部21は、このスムージング処理部22に対して、どの画素に対してスームジング処理を施せばよいのかを知らせるために、図16に示すように、水平方向にずらした形で画素データを読み出すときには、そのずらしの直前に読み出したライン上の画素データ(図中の左上がりの斜線で示すもの)と、そのずらして読み出したライン上の画素データ(図中の右上がりの斜線で示すもの)とを「垂直ズレ画素」として定義して、画素データに付加される1ビット構成の垂直ズレビットをONするように処理している。   Then, in order to inform the smoothing processing unit 22 to which pixel the smoothing processing should be performed, the inclination correction reading unit 21 shifts the pixels in the horizontal direction as shown in FIG. When reading data, the pixel data on the line read immediately before the shift (indicated by the left-upward slanted line in the figure) and the pixel data on the line read out of the shift (in the right-upward slanted line in the figure) Are defined as “vertical misalignment pixels”, and processing is performed to turn on the 1-bit vertical misalignment bits added to the pixel data.

メモリ制御部12を構成するスムージング処理部22は、傾き補正読出部21により読み出される傾きの補正された原稿の画像データを受け取ると、図21に示すような画像フィルタを用いて、傾き補正により発生する画像データの持つギザギザ部分をスムーズなものとする処理を行う。   When the smoothing processing unit 22 constituting the memory control unit 12 receives the image data of the original whose inclination is corrected and read by the inclination correction reading unit 21, it is generated by the inclination correction using an image filter as shown in FIG. To make the jagged portion of the image data to be smoothed.

すなわち、水平ズレビットが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 processing unit 22 has a mechanism for holding image data for three lines read by the inclination correction reading unit 21.

メモリ制御部12を構成する平滑化処理部23は、スムージング処理部22によりスムージング処理の施された原稿の画像データを受け取ると、図22に示すような画像フィルタを用いて、そのスムージング処理では取り除けなかった画像データの持つギザギザ部分を平滑化する処理を行う。   When the smoothing processing unit 23 included in the memory control unit 12 receives the image data of the document that has been subjected to the smoothing processing by the smoothing processing unit 22, the smoothing processing unit 23 uses the image filter as shown in FIG. A process is performed to smooth the jagged portions of the image data that did not exist.

すなわち、全ての画素に対して、例えば、図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 processing unit 22 is used. Performs a smoothing process on the jagged parts of the image.

ちなみに、この図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 processing unit 23 has a mechanism for holding image data for three lines subjected to the smoothing processing by the smoothing processing unit 22.

メモリ制御部12を構成する水平拡大処理部24は、傾き補正読出部21により読み出される傾きの補正された原稿の画像データが本来の画像データに比べて水平方向に「cos θ」倍に縮小されていることを考慮して、その読み出された画像データを水平方向に「1/cos θ」倍に拡大する処理を行う。   The horizontal enlargement processing unit 24 constituting the memory control unit 12 reduces the image data of the original whose inclination is corrected read out by the inclination correction reading unit 21 by “cos θ” times in the horizontal direction compared to the original image data. Therefore, a process of enlarging the read image data by “1 / cos θ” times in the horizontal direction is performed.

そして、メモリ制御部12を構成する垂直拡大処理部25は、傾き補正読出部21により読み出される傾きの補正された原稿の画像データが本来の画像データに比べて垂直方向に例えば「cos θ」倍(原稿の搬送速度により変わる)に縮小されていることを考慮して、その読み出された画像データを垂直方向に例えば「1/cos θ」倍に拡大する処理を行う。   Then, the vertical enlargement processing unit 25 constituting the memory control unit 12 has the image data of the document whose inclination is corrected read by the inclination correction reading unit 21 multiplied by, for example, “cos θ” in the vertical direction compared to the original image data. Considering that the image data has been reduced (changes depending on the document conveyance speed), the read image data is enlarged by, for example, “1 / cos θ” times in the vertical direction.

この水平拡大処理部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 enlargement processing unit 25 determines that it is necessary to insert one line for every 100 lines in the vertical direction when, for example, “1 / cos θ = 1.01”. For example, the calculation is performed by calculating the average value of the pixel data of the pixels on the upper and lower lines of the insertion location, and inserting the pixel data having the average value into the insertion location.

メモリ制御部12を構成する2値化部26は、水平拡大処理部24と垂直拡大処理部25とにより拡大処理された画像データを規定の閾値と比較することで、多値の画像データを2値化する処理を行う。   The binarization unit 26 constituting the memory control unit 12 compares the image data enlarged by the horizontal enlargement processing unit 24 and the vertical enlargement processing unit 25 with a prescribed threshold value, thereby converting the multivalued image data into 2 Performs the process of converting to a value.

このように、メモリ制御部12は、原稿の画像データを2値化してから傾きを補正するのではなくて、2値化する前の多値データの状態で傾きを補正する構成を採って、その後で、スムージング処理を施すという構成を採っている。これから、スムージング処理が有効なものになる。   In this way, the memory control unit 12 does not correct the inclination after binarizing the image data of the document, but adopts a configuration in which the inclination is corrected in the state of the multi-value data before binarization. After that, a configuration is adopted in which smoothing processing is performed. Thus, the smoothing process becomes effective.

メモリ制御部12を構成するマスキング部27は、2値化部26により2値化された原稿の画像データの持つ枠部分(端部分)に存在する影を消去する処理を行って、第2の画像メモリ28に格納する処理を行う。   The masking unit 27 constituting the memory control unit 12 performs a process of erasing shadows existing in the frame portion (edge portion) of the image data of the document binarized by the binarization unit 26, thereby performing the second processing. Processing to be stored in the image memory 28 is performed.

このようにして、メモリ制御部12は、スキャナ制御部15からスキャナ読取処理の起動がかかると、図4に示したように、ラインイメージセンサ10により読み取られる原稿の画像データを、メモリ制御部12の持つ第1の画像メモリ20にその読み取りの順番に書き込む処理を行う。   In this way, when the scanner reading process is activated from the scanner control unit 15, the memory control unit 12 converts the image data of the original read by the line image sensor 10 into the memory control unit 12 as shown in FIG. Is written in the first image memory 20 in the reading order.

そして、メモリ制御部12は、スキャナ制御部15からデスキュー処理の起動がかかると、スキャナ制御部15から通知される「切出開始アドレス」/「幅」/「傾き」/「倍率補正値」に従って、図5に示すように、第1の画像メモリ20に格納される原稿の画像データをその傾きを補正しつつ読み出すとともに、その傾き補正により発生する画像データの持つギザギザ部分をスムーズなものにするスムージング処理を施し、更に、平滑化処理部23や水平拡大処理部24や垂直拡大処理部25や2値化部26やマスキング部27を使って、スキャナ制御部15から通知される「画像処理モード」/「マスキング範囲」に応じた画像処理を施す処理に入って、原稿の読み取りの終了に連動してスキャナ制御部15からデスキュー処理の終了が指示されると、その処理を終了する処理を行う。   When the deskew processing is activated from the scanner control unit 15, the memory control unit 12 follows the “cutting start address” / “width” / “tilt” / “magnification correction value” notified from the scanner control unit 15. As shown in FIG. 5, the original image data stored in the first image memory 20 is read while correcting its inclination, and the jagged portion of the image data generated by the inclination correction is made smooth. Further, smoothing processing is performed, and the “image processing mode” notified from the scanner control unit 15 using the smoothing processing unit 23, horizontal enlargement processing unit 24, vertical enlargement processing unit 25, binarization unit 26, and masking unit 27. ”/“ Masking range ”is entered, and the deskew processing is finished from the scanner control unit 15 in conjunction with the end of reading of the document. When instructed, it performs a process of ending the process.

なお、図1では説明しなかったが、メモリ制御部12は、画像処理部として、その他に、強調処理を行う処理部や、誤差拡散を行う処理部や、浮動スライスへの変換を行う処理部などが用意している。   Although not described in FIG. 1, the memory control unit 12 includes an image processing unit, a processing unit that performs enhancement processing, a processing unit that performs error diffusion, and a processing unit that performs conversion to a floating slice. Etc. are prepared.

以上説明したように、本発明の画像読取装置では、陰やノイズの影響を受けずにエッジ部分を検出できるようにするために、画素ブロックという概念を導入するとともに、各画素の画素データを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 is an example embodiment of the present invention. エッジ検出部の処理の説明図である。It is explanatory drawing of a process of an edge detection part. 傾き/サイズ検出部の処理の説明図である。It is explanatory drawing of the process of an inclination / size detection part. 第1の画像メモリへの画像データの格納処理の説明図である。It is explanatory drawing of the storage process of the image data to a 1st image memory. メモリ制御部の処理の説明図である。It is explanatory drawing of a process of a memory control part. エッジ検出部の回路構成の一実施形態例である。It is an example of an embodiment of a circuit configuration of the edge detection unit. エッジフィルタ部の2値化処理の説明図である。It is explanatory drawing of the binarization process of an edge filter part. エッジフィルタ部の一実施形態例である。It is an embodiment of an edge filter unit. エッジ判定回路の判定処理の説明図である。It is explanatory drawing of the determination process of an edge determination circuit. エッジフィルタ部の一実施形態例である。It is an embodiment of an edge filter unit. 搬送されてくる原稿の説明図である。It is explanatory drawing of the original document conveyed. 傾き/サイズ検出部の検出処理の説明図である。It is explanatory drawing of the detection process of an inclination / size detection part. 傾き/サイズ検出部の実行する処理フローの一例である。It is an example of the processing flow which an inclination / size detection part performs. 傾き/サイズ検出部の実行する処理フローの一例である。It is an example of the processing flow which an inclination / size detection part performs. 傾き/サイズ検出部の実行する処理フローの一例である。It is an example of the processing flow which an inclination / size detection part performs. 傾き補正読出部の読出処理の説明図である。It is explanatory drawing of the read-out process of an inclination correction read-out part. 第1の画像メモリに格納される画像データの説明図である。It is explanatory drawing of the image data stored in a 1st image memory. 傾き補正読出部の実行する処理の説明図である。It is explanatory drawing of the process which an inclination correction read-out part performs. 傾き補正読出部の実行する処理の説明図である。It is explanatory drawing of the process which an inclination correction read-out part performs. 傾き補正読出部の実行する処理の説明図である。It is explanatory drawing of the process which an inclination correction read-out part performs. スムージング処理を施す画像フィルタの説明図である。It is explanatory drawing of the image filter which performs a smoothing process. 平滑化処理を施す画像フィルタの説明図である。It is explanatory drawing of the image filter which performs a smoothing process.

符号の説明Explanation of symbols

1 原稿読取装置
10 ラインイメージセンサ
11 A/D変換器
12 メモリ制御部
13 エッジ検出部
14 傾き/サイズ検出部
15 スキャナ制御部
20 第1の画像メモリ
21 傾き補正読出部
22 スムージング処理部
23 平滑化処理部
24 水平拡大処理部
25 垂直拡大処理部
26 2値化部
27 マスキング部
28 第2の画像メモリ
DESCRIPTION OF SYMBOLS 1 Document reader 10 Line image sensor 11 A / D converter 12 Memory control part 13 Edge detection part 14 Inclination / size detection part 15 Scanner control part 20 First image memory 21 Inclination correction reading part 22 Smoothing process part 23 Smoothing Processing unit 24 Horizontal enlargement processing unit 25 Vertical enlargement processing unit 26 Binarization unit 27 Masking unit 28 Second image memory

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.
請求項1に記載の画像読取装置において、
上記判断手段は、上記中画素ブロックに隣接する一方の画素ブロックに属する全ての画素の持つ上記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.
請求項1に記載の画像読取装置において、
上記判断手段は、上記中画素ブロックに隣接する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.
請求項1ないし3のいずれか1項に記載の画像読取装置において、
上記取出手段は、指定されたブロックサイズを持つ画素ブロックに属する画素の持つ上記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.
JP2004343245A 2004-11-29 2004-11-29 Image scanner Pending JP2005057813A (en)

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)

* Cited by examiner, † Cited by third party
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

Cited By (4)

* Cited by examiner, † Cited by third party
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