JP2015211321A - Reading apparatus and program - Google Patents

Reading apparatus and program Download PDF

Info

Publication number
JP2015211321A
JP2015211321A JP2014091354A JP2014091354A JP2015211321A JP 2015211321 A JP2015211321 A JP 2015211321A JP 2014091354 A JP2014091354 A JP 2014091354A JP 2014091354 A JP2014091354 A JP 2014091354A JP 2015211321 A JP2015211321 A JP 2015211321A
Authority
JP
Japan
Prior art keywords
document
edge
reading
edge data
scanner
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2014091354A
Other languages
Japanese (ja)
Other versions
JP6409317B2 (en
Inventor
侑典 宮本
Yusuke Miyamoto
侑典 宮本
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.)
Brother Industries Ltd
Original Assignee
Brother Industries 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 Brother Industries Ltd filed Critical Brother Industries Ltd
Priority to JP2014091354A priority Critical patent/JP6409317B2/en
Publication of JP2015211321A publication Critical patent/JP2015211321A/en
Application granted granted Critical
Publication of JP6409317B2 publication Critical patent/JP6409317B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

PROBLEM TO BE SOLVED: To provide a technique for improving accuracy of detecting edges of an original document.SOLUTION: A scanner 100 includes a reading head 21 for reading an image and acquires image data 51 by reading an original document. The scanner 100 further acquires edge data, which is information on edges of the original documents, from the acquired image data 51. The scanner 100 further determines whether an end part in a principle scanning direction of the original document exceeds a reading range in a longer direction of the reading head 21 on the basis of the acquired edge data.

Description

本発明は,原稿の画像を読み取る読取装置およびプログラムに関する。さらに詳細には,読み取った画像のうち,原稿と背景部材との境界となる原稿のエッジを検知する技術に関するものである。   The present invention relates to a reading device and a program for reading an image of a document. More specifically, the present invention relates to a technique for detecting an edge of a document serving as a boundary between a document and a background member in a read image.

従来から,原稿の画像を読み取り,読み取った画像のうち,原稿と背景部材との境界となる原稿のエッジを検知する技術が知られている。例えば,特許文献1には,読み取った画像のうち,原稿のエッジを検知する機能を有する画像読取装置であって,当該機能を用いて,読み取った画像から背景部分にある原稿の影を除去する技術が開示されている。   2. Description of the Related Art Conventionally, a technique for reading an image of a document and detecting an edge of the document serving as a boundary between the document and a background member among the read images is known. For example, Patent Document 1 discloses an image reading apparatus having a function of detecting an edge of a document among read images, and removes the shadow of the document in the background portion from the read image using the function. Technology is disclosed.

特開2009−16904号公報JP 2009-16904 A

しかしながら,前記した従来の技術には,次のような問題があった。すなわち,原稿サイズが大きい場合や原稿が傾いている場合,原稿の端部が読取範囲外となる場合がある。この場合,原稿の途中を原稿のエッジと誤判断する可能性がある。   However, the conventional technique described above has the following problems. That is, when the document size is large or the document is inclined, the edge of the document may be outside the reading range. In this case, the middle of the document may be erroneously determined as the edge of the document.

本発明は,前記した従来の技術が有する問題点を解決するためになされたものである。すなわちその課題とするところは,原稿のエッジの検知精度を向上させる技術を提供することにある。   The present invention has been made to solve the above-described problems of the prior art. That is, the problem is to provide a technique for improving the detection accuracy of the edge of the document.

この課題の解決を目的としてなされた読取装置は,画像を読み取る読取部と,制御部とを備え,前記制御部は,前記読取部に画像を読み取らせる読取処理と,前記読取処理にて読み取った画像データから,原稿のエッジの情報であるエッジデータを取得するエッジ取得処理と,前記エッジ取得処理にて取得された前記エッジデータに基づいて,原稿の主走査方向の端部が前記読取部の読取範囲を超えるか否かを判断する判断処理とを実行することを特徴としている。   A reading apparatus for solving this problem includes a reading unit that reads an image and a control unit, and the control unit reads the image by the reading unit that causes the reading unit to read the image. An edge acquisition process for acquiring edge data, which is edge information of the document, from the image data, and an edge in the main scanning direction of the document is based on the edge data acquired in the edge acquisition process. A determination process for determining whether or not the reading range is exceeded is performed.

本明細書に開示される読取装置は,読み取った画像データから,原稿のエッジの情報であるエッジデータを取得する。そして,取得したエッジデータに基づいて,原稿の主走査方向の端部が読取部の読取範囲を超えるか否かを判断する。   The reading device disclosed in this specification acquires edge data, which is information about the edge of a document, from the read image data. Then, based on the acquired edge data, it is determined whether or not the end of the document in the main scanning direction exceeds the reading range of the reading unit.

すなわち,本明細書に開示される読取装置は,原稿のエッジの情報であるエッジデータの取得に加え,そのエッジデータに基づいて原稿の主走査方向の端部が読取部の読取範囲を超えるか否かの判断も行っている。そのため,その判断結果を利用することで,エッジデータのみで原稿の端部の位置を判断する場合と比較して,原稿の端部でないエッジの位置を原稿の端部の位置と判断する誤判断の抑制が期待できる。   In other words, the reading device disclosed in this specification, in addition to acquiring edge data, which is information on the edge of the document, determines whether the end of the document in the main scanning direction exceeds the reading range of the reading unit based on the edge data. Judgment of whether or not. Therefore, by using the result of the determination, an erroneous determination that determines the position of the edge that is not the end of the document as the position of the end of the document is compared with the case where the position of the end of the document is determined only by the edge data. Can be expected.

また,前記制御部は,前記エッジ取得処理にて取得された前記エッジデータに基づいて,原稿の先端角部を抽出する抽出処理を実行し,前記判断処理では,原稿の先端角部が抽出されていない場合,あるいは原稿の先端角部が,前記読取部の読取範囲の限界から規定距離までの範囲内にある場合に,前記読取部の読取範囲を超えると判断するとよい。原稿の先端角部が抽出されていない場合には,原稿の端部が読取範囲外となっている可能性がある。また,原稿の先端角部が読取部の読取範囲の限界から規定距離までの範囲内にある場合にも,取得されたエッジデータから原稿の端部の位置を正確に判断することが困難な場合がある。そのため,読取部の読取範囲を超えると判断する方が好ましい。   Further, the control unit executes an extraction process for extracting a leading edge portion of the document based on the edge data acquired in the edge acquisition process, and the leading edge portion of the document is extracted in the determination process. If the leading edge of the document is within the range from the limit of the reading range of the reading unit to a specified distance, it may be determined that the reading range of the reading unit is exceeded. If the leading end corner of the document is not extracted, the end of the document may be outside the reading range. Also, when it is difficult to accurately determine the position of the end of the document from the acquired edge data even when the leading edge of the document is within the range from the limit of the reading range of the reading unit to the specified distance. There is. For this reason, it is preferable to determine that the reading range of the reading unit is exceeded.

また,前記制御部は,前記エッジ取得処理にて取得された前記エッジデータに基づいて,原稿の傾きを取得する傾き取得処理を実行し,前記判断処理では,前記傾き取得処理にて取得された前記傾きに基づいて,原稿の主走査方向の端部が前記読取部の読取範囲を超えるか否かを判断するとよい。原稿の傾きを考慮することで,原稿の副走査方向の途中から読取範囲外となる位置を検出できる。そのため,より正確に読取部の読取範囲を超えるか否かを判断できる。   Further, the control unit executes an inclination acquisition process for acquiring an inclination of the document based on the edge data acquired in the edge acquisition process, and the determination process acquires the inclination acquisition process. Based on the inclination, it may be determined whether or not the end of the document in the main scanning direction exceeds the reading range of the reading unit. By taking into account the inclination of the original, a position outside the reading range can be detected from the middle of the original in the sub-scanning direction. Therefore, it can be determined whether or not the reading range of the reading unit is exceeded more accurately.

また,前記制御部は,前記エッジ取得処理では,副走査方向に所定の頻度で,主走査方向に前記エッジデータを取得し,前記判断処理にて前記読取部の読取範囲を超えると判断された場合,読取範囲を超える位置である超過位置から所定範囲内の領域である境界領域での前記エッジデータを取得する頻度を,前記境界領域以外の領域での前記頻度と比較して,高くするとよい。この構成によれば,境界領域でのエッジの精度の高精度化を図ることができる一方で,境界領域以外の領域でのエッジの取得速度の高速化を図ることができる。   In the edge acquisition process, the control unit acquires the edge data in the main scanning direction at a predetermined frequency in the sub-scanning direction, and is determined to exceed the reading range of the reading unit in the determination process. In this case, the frequency of acquiring the edge data in the boundary area that is an area within the predetermined range from the excess position that is the position exceeding the reading range may be higher than the frequency in the area other than the boundary area. . According to this configuration, it is possible to increase the accuracy of the edge in the boundary region, while it is possible to increase the edge acquisition speed in the region other than the boundary region.

また,前記制御部は,前記エッジ取得処理では,前記エッジデータを用いて取得する原稿の特性と状態との少なくとも一方に応じて,異なる頻度で前記エッジデータを取得するとよい。取得する原稿の情報として原稿の特性と状態との少なくとも一方があり,その種類によって要求精度が異なる。そのため,原稿の情報の種類に応じて,高精度化と高速化との均衡を図る方が好ましい。原稿の特性には,例えば,原稿の形状,原稿のサイズ,パンチ穴の位置が該当する。原稿の状態には,例えば,原稿の傾き,回転斜行量が該当する。例えば,原稿の斜行状態は高精度が要求されるが,パンチ穴の位置や原稿サイズの場合は,高精度が要求されない。   In the edge acquisition process, the control unit may acquire the edge data at a different frequency according to at least one of a characteristic and a state of the document acquired using the edge data. There is at least one of the characteristics and state of the document as information of the document to be acquired, and the required accuracy differs depending on the type. For this reason, it is preferable to achieve a balance between high accuracy and high speed according to the type of information of the document. For example, the shape of the document, the size of the document, and the position of the punch hole correspond to the characteristics of the document. The document state corresponds to, for example, document tilt and rotational skew. For example, high accuracy is required for the skew state of the document, but high accuracy is not required for the position of the punch hole or the document size.

また,前記制御部は,前記エッジ取得処理にて取得された前記エッジデータのうち,前記判断処理にて読取範囲を超えないと判断された端部側の側辺である特定側辺のエッジデータを用いて,原稿の特性と状態との少なくとも一方を取得する情報取得処理を実行するとよい。読取範囲を超えないと判断された端部側の側辺のエッジデータを用いて,原稿の特性と状態との少なくとも一方である原稿の情報を取得する,すなわち読取範囲を超えたと判断された端部側の側辺のエッジデータを用いずに,原稿の情報を取得することで,当該原稿の情報の精度の向上が期待できる。   In addition, the control unit includes edge data of a specific side that is a side on the end side that is determined not to exceed the reading range in the determination process among the edge data acquired in the edge acquisition process. It is preferable to execute an information acquisition process for acquiring at least one of the characteristics and the state of the document. Using the edge data on the side of the edge that is determined not to exceed the reading range, information on the document that is at least one of the characteristics and state of the document is acquired, that is, the edge determined to have exceeded the reading range. By obtaining the document information without using the edge data on the side of the section side, the accuracy of the document information can be improved.

また,前記情報取得処理には,前記判断処理にて否定判断された場合に,原稿の先端側のエッジデータと前記特定側辺のエッジデータとを用いて原稿の傾きを取得し,前記判断処理にて肯定判断された場合に,原稿の先端側のエッジデータを用いて原稿の傾きを取得する処理が含まれるとよい。側辺のエッジデータを用いることができれば,原稿の傾きを高精度に取得できる。   In the information acquisition process, when a negative determination is made in the determination process, the inclination of the document is acquired using the edge data on the leading edge side of the document and the edge data on the specific side, and the determination process is performed. In the case where the affirmative determination is made in the above, it is preferable to include processing for obtaining the inclination of the document using the edge data on the leading end side of the document. If the side edge data can be used, the inclination of the document can be acquired with high accuracy.

また,前記制御部は,前記情報取得処理では,前記判断処理にて否定判断された場合に,前記特定側辺のエッジデータを回転斜行量の取得に用い,前記判断処理にて肯定判断された場合に,前記特定側辺のエッジデータを回転斜行量の取得に用いないとよい。側辺のエッジデータを用いることができれば,回転斜行量を高精度に取得できる。   In addition, in the information acquisition process, the control unit uses the edge data of the specific side to acquire the rotation skew amount when a negative determination is made in the determination process, and an affirmative determination is made in the determination process. In this case, the edge data on the specific side may not be used for obtaining the rotation skew amount. If the side edge data can be used, the rotational skew amount can be acquired with high accuracy.

また,前記制御部は,前記情報取得処理では,前記判断処理にて否定判断された場合に,前記特定側辺のエッジデータを原稿の形状の取得に用い,前記判断処理にて肯定判断された場合に,前記特定側辺のエッジデータを原稿の形状の取得に用いないとよい。側辺のエッジデータを用いることができれば,原稿の形状を高精度に取得できる。なお,原稿の形状には,原稿の定型サイズの他,長方形以外の形状も含まれる。   Further, in the information acquisition process, when the determination is negative in the determination process, the control unit uses the edge data of the specific side to acquire the shape of the document, and is positively determined in the determination process. In this case, the edge data on the specific side may not be used for obtaining the shape of the document. If the side edge data can be used, the shape of the document can be acquired with high accuracy. In addition, the shape of the document includes shapes other than the rectangle in addition to the standard size of the document.

また,前記制御部は,前記情報取得処理では,前記判断処理にて否定判断された場合に,前記特定側辺のエッジデータをパンチ穴の位置の取得に用い,前記判断処理にて肯定判断された場合に,前記特定側辺のエッジデータをパンチ穴の位置の取得に用いないとよい。側辺のエッジデータを用いることができれば,パンチ穴の位置を高精度に取得できる。   In addition, in the information acquisition process, the control unit uses the edge data of the specific side to acquire the position of the punch hole and makes an affirmative determination in the determination process when a negative determination is made in the determination process. In this case, the edge data of the specific side may not be used for acquiring the punch hole position. If the edge data of the side can be used, the position of the punch hole can be acquired with high accuracy.

上記読取装置の機能を実現するためのコンピュータプログラムも,新規で有用である。   A computer program for realizing the function of the reading device is also new and useful.

本発明によれば,原稿のエッジの検知精度を向上させる技術が実現される。   According to the present invention, a technique for improving the edge detection accuracy of a document is realized.

実施の形態にかかるスキャナの概略構成を示す断面図である。It is sectional drawing which shows schematic structure of the scanner concerning Embodiment. スキャナの電気的構成を示すブロック図である。It is a block diagram which shows the electric constitution of a scanner. 原稿の配置を示す説明図である。It is explanatory drawing which shows arrangement | positioning of a document. 読取処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of a reading process. 検出されたエッジを示す説明図である。It is explanatory drawing which shows the detected edge. サンプリング位置決定処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of a sampling position determination process. 傾き角を示す説明図である。It is explanatory drawing which shows an inclination angle. サンプリング頻度の例を示す説明図である。It is explanatory drawing which shows the example of sampling frequency. 原稿サイズ取得処理の手順を示すフローチャートである。6 is a flowchart illustrating a procedure of document size acquisition processing. 回転斜行取得処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of a rotation skew feeding acquisition process.

以下,本発明にかかる読取装置を具体化した実施の形態について,添付図面を参照しつつ詳細に説明する。本形態は,画像読取機能を備えたスキャナに本発明を適用したものである。   DESCRIPTION OF THE PREFERRED EMBODIMENTS Embodiments embodying a reading apparatus according to the present invention will be described below in detail with reference to the accompanying drawings. In this embodiment, the present invention is applied to a scanner having an image reading function.

本形態のスキャナ100は,その断面を図1に示すように,読取ヘッド21を有し,原稿と読取ヘッド21とを相対的に移動させつつ,原稿の画像を読み取る。読取ヘッド21は,対向する箇所に光を照射し,受光量に基づく信号を出力する。スキャナ100は,読取ヘッド21の出力信号に基づいて,例えば,1ライン分の画像データを連続して取得する。なお,本形態のスキャナ100の読取方式は,CIS方式でもよいし,CCD方式でもよい。   As shown in FIG. 1, the scanner 100 of this embodiment has a reading head 21, and reads an image of a document while relatively moving the document and the reading head 21. The reading head 21 irradiates light at the opposite location and outputs a signal based on the amount of received light. For example, the scanner 100 continuously acquires image data for one line based on the output signal of the reading head 21. The reading method of the scanner 100 of this embodiment may be a CIS method or a CCD method.

原稿を面として読み取るために,本形態のスキャナ100は,原稿を搬送する原稿搬送部22を有している。原稿搬送部22は,複数の搬送ローラ26等を含み,図1中に一点鎖線で示す搬送路25に沿って原稿を搬送する。そして,原稿搬送部22は,原稿を1枚ずつ所定の速度で搬送し,読取ヘッド21に対向する箇所を通過させる。そして,スキャナ100は,原稿搬送部22にて搬送中の原稿を,読取ヘッド21にて読み取る。   In order to read a document as a surface, the scanner 100 of this embodiment has a document transport unit 22 that transports the document. The document conveyance unit 22 includes a plurality of conveyance rollers 26 and the like, and conveys the document along a conveyance path 25 indicated by a one-dot chain line in FIG. Then, the document conveying unit 22 conveys the document one by one at a predetermined speed, and passes the portion facing the reading head 21. Then, the scanner 100 reads the document being conveyed by the document conveying unit 22 with the reading head 21.

また,原稿搬送部22には,読み取り前の原稿が収容される原稿トレイ28と,読み取り後の原稿が収容される原稿排出トレイ29とが設けられている。そして,スキャナ100は,読み取り実行の指示入力を受け付けると,原稿トレイ28にセットされた原稿の1枚を搬送路25に引き込んで搬送し,読み取りが終了した原稿を原稿排出トレイ29に排出する。   Further, the document transport unit 22 is provided with a document tray 28 for storing a document before reading and a document discharge tray 29 for storing a document after reading. When the scanner 100 receives an instruction to execute reading, the scanner 100 draws one of the documents set on the document tray 28 into the conveyance path 25 and conveys it, and discharges the document after reading to the document discharge tray 29.

本形態のスキャナ100は,読取ヘッド21にて,主走査方向の画像データを連続して取得する。スキャナ100は,主走査方向について,原稿の配置に関わらず,読取ヘッド21の長さに対応する範囲である読取範囲の画像データを取得する。図1に示すように,原稿の搬送路25を挟んで読取ヘッド21に対向する位置には,白板23が配置されている。そのため,スキャナ100は,読取ヘッド21の対向位置に原稿がない場合には,白板23を読み取る。   The scanner 100 according to the present embodiment continuously acquires image data in the main scanning direction by the reading head 21. The scanner 100 acquires image data in a reading range that is a range corresponding to the length of the reading head 21 in the main scanning direction regardless of the arrangement of the originals. As shown in FIG. 1, a white plate 23 is disposed at a position facing the reading head 21 across the document transport path 25. Therefore, the scanner 100 reads the white plate 23 when there is no document at the position facing the reading head 21.

そして,本形態のスキャナ100は,原稿の搬送に伴って,副走査方向に画像データを取得する。つまり,画像データは,主走査方向に連続して取得され,原稿の搬送と読み取りとの進行につれて副走査方向に増えていく。本形態では,読取ヘッド21が,読取部の一例であり,読取ヘッド21の長さが,読取範囲の限界の一例である。   The scanner 100 according to this embodiment acquires image data in the sub-scanning direction as the document is conveyed. That is, the image data is acquired continuously in the main scanning direction, and increases in the sub-scanning direction as the document is conveyed and read. In this embodiment, the reading head 21 is an example of a reading unit, and the length of the reading head 21 is an example of the limit of the reading range.

続いて,スキャナ100の電気的構成について説明する。スキャナ100は,図2に示すように,CPU31と,ROM32と,RAM33と,NVRAM(不揮発性RAM)34と,ASIC35とを含むコントローラ30を備えている。また,スキャナ100は,読取ヘッド21と,原稿搬送部22と,ネットワークインターフェース37と,USBインターフェース38と,操作パネル40とを備え,これらがコントローラ30に電気的に接続されている。   Next, the electrical configuration of the scanner 100 will be described. As shown in FIG. 2, the scanner 100 includes a controller 30 including a CPU 31, a ROM 32, a RAM 33, an NVRAM (nonvolatile RAM) 34, and an ASIC 35. Further, the scanner 100 includes a reading head 21, a document conveying unit 22, a network interface 37, a USB interface 38, and an operation panel 40, which are electrically connected to the controller 30.

ROM32には,スキャナ100を制御するための各種制御プログラムや各種設定,初期値等が記憶されている。RAM33は,各種制御プログラムが読み出される作業領域として,あるいは,データを一時的に記憶する記憶領域として利用される。CPU31は,ROM32から読み出した制御プログラムに従って,その処理結果をRAM33またはNVRAM34に記憶させながら,スキャナ100の各構成要素を制御する。   The ROM 32 stores various control programs for controlling the scanner 100, various settings, initial values, and the like. The RAM 33 is used as a work area from which various control programs are read, or as a storage area for temporarily storing data. The CPU 31 controls each component of the scanner 100 while storing the processing result in the RAM 33 or the NVRAM 34 according to the control program read from the ROM 32.

CPU31は,制御部の一例である。なお,コントローラ30が制御部であってもよいし,ASIC35が制御部であってもよい。なお,図2中のコントローラ30は,CPU31等,スキャナ100の制御に利用されるハードウェアを纏めた総称であって,実際にスキャナ100に存在する単一のハードウェアを表すとは限らない。   The CPU 31 is an example of a control unit. The controller 30 may be a control unit, and the ASIC 35 may be a control unit. Note that the controller 30 in FIG. 2 is a collective term for the hardware used for controlling the scanner 100, such as the CPU 31, and does not necessarily represent a single piece of hardware that actually exists in the scanner 100.

ネットワークインターフェース37は,LANケーブル等を用いてネットワークを介して接続された装置と通信を行うためのハードウェアである。USBインターフェース38は,USBケーブル等を介して接続された装置と通信を行うためのハードウェアである。操作パネル40は,ディスプレイと入力ボタン等を有し,ユーザへの告知を表示し,ユーザによる入力操作を受け付ける。   The network interface 37 is hardware for communicating with a device connected via a network using a LAN cable or the like. The USB interface 38 is hardware for communicating with a device connected via a USB cable or the like. The operation panel 40 has a display, an input button, etc., displays a notification to the user, and accepts an input operation by the user.

続いて,本形態のスキャナ100における原稿の読み取り動作について説明する。本形態のスキャナ100は,前述したように,原稿を搬送しつつ読み進める。そして,読み取り終わった部分の画像データを利用して,その範囲内に含まれる画像のエッジを検出し,検出したエッジの位置情報をエッジデータとして取得する。   Next, a document reading operation in the scanner 100 of this embodiment will be described. As described above, the scanner 100 according to the present embodiment reads a document while conveying it. Then, using the image data of the read portion, the edge of the image included in the range is detected, and the position information of the detected edge is acquired as edge data.

エッジとは,画像データの中で,画像データのデータ値が所定の閾値を超えて変化する位置である。スキャナ100は,例えば,画像データ中の各点の輝度値を所定の閾値で二値化し,二値化データの値が0から1へ変化した箇所をエッジであると判断して,エッジの位置をエッジデータとして取得する。   An edge is a position in the image data where the data value of the image data changes beyond a predetermined threshold. For example, the scanner 100 binarizes the luminance value of each point in the image data with a predetermined threshold, determines that the position where the value of the binarized data has changed from 0 to 1 is an edge, and determines the position of the edge Is acquired as edge data.

本形態のスキャナ100にてシート状の原稿を読み取った場合,シートの縁辺と白板23との境界に影が生じる。そのため,画像データ51は,図3に示すように,シートの縁辺に対応する部分に,原稿の内容部分より濃い色の影画像52が含まれることが多い。この図3では,取得した画像データ51の全体を破線で囲い,その内部に原稿の画像が含まれていることを示している。例えば,長方形の原稿を読み取った画像データ51には,原稿の四辺による影画像52が含まれ,前述したエッジ検出動作を実行すると影画像52によるエッジが検出される。   When a sheet-like document is read by the scanner 100 of this embodiment, a shadow is generated at the boundary between the edge of the sheet and the white plate 23. For this reason, as shown in FIG. 3, the image data 51 often includes a shadow image 52 having a darker color than the content portion of the document at the portion corresponding to the edge of the sheet. In FIG. 3, the entire acquired image data 51 is surrounded by a broken line and indicates that an image of the document is included therein. For example, the image data 51 obtained by reading a rectangular document includes a shadow image 52 based on the four sides of the document. When the above-described edge detection operation is executed, the edge of the shadow image 52 is detected.

ここで,原稿の各辺を,図3に示すように定義する。原稿のうち,読取ヘッド21の位置に最初に到達する箇所を,「上辺」とする。原稿が読取ヘッド21に対して平行に配置されていれば,上辺によってできる影画像52は,読み取った画像データ51では主走査方向に整列して現れる。また,原稿のうち,最後に読取ヘッド21の位置に到達する箇所を,「下辺」とする。さらに,原稿の読み取り面に向かって,上辺を上,下辺を下に配置した場合に,右側に配置される箇所を「右辺」,左側に配置される箇所を「左辺」とする。なお,左辺と右辺とを区別しない場合には,まとめて「側辺」とする。   Here, each side of the document is defined as shown in FIG. The portion of the document that first reaches the position of the reading head 21 is referred to as “upper side”. If the document is arranged parallel to the reading head 21, the shadow image 52 formed by the upper side appears in the read image data 51 aligned in the main scanning direction. Further, a portion of the original that finally reaches the position of the reading head 21 is defined as a “lower side”. Further, when the upper side is arranged on the upper side and the lower side is arranged on the lower side of the original reading surface, a position arranged on the right side is designated as a “right side” and a place arranged on the left side is designated as a “left side”. When the left side and the right side are not distinguished, they are collectively referred to as “side”.

本形態のスキャナ100にて原稿を読み取って取得された画像データ51について,各点の位置を,図3に示すように,X−Y平面内の座標を用いて説明する。画像データ51の生成開始位置を原点として,読取ヘッド21の長手方向(主走査方向)をX軸,読み取りの進行方向(副走査方向)をY軸とする。X軸方向の画像データ51の幅Wxは,読取ヘッド21の長さに基づく固定長である。そして,Wxは,画像データ51のX座標の最大値である。また,画像データ51は,読み取りの進行とともに,1ピクセル分ずつY軸方向へ増えていく。   The position of each point in the image data 51 obtained by reading the document with the scanner 100 of this embodiment will be described using coordinates in the XY plane as shown in FIG. With the generation start position of the image data 51 as the origin, the longitudinal direction (main scanning direction) of the reading head 21 is the X axis, and the reading progress direction (sub scanning direction) is the Y axis. The width Wx of the image data 51 in the X-axis direction is a fixed length based on the length of the reading head 21. Wx is the maximum value of the X coordinate of the image data 51. The image data 51 increases in the Y-axis direction by one pixel as reading progresses.

本形態のスキャナ100は,読取開始の指示入力を受け付けると,原稿の搬送を開始し,その後,所定のタイミングにて読取動作を開始する。読み取りを開始するタイミングは,図3に示すように,原稿の上辺が読取ヘッド21に対向する位置に到達すると予測されるタイミングより,少し前である。なお,原稿の先端が読取ヘッド21に対向する位置に到達すると予測されるタイミングは,原稿の搬送開始からの経過時間と原稿の搬送速度とに基づいて決定できる。   When the scanner 100 of this embodiment receives an instruction to start reading, the scanner 100 starts conveying a document, and then starts a reading operation at a predetermined timing. As shown in FIG. 3, the timing for starting reading is slightly before the timing at which the upper side of the document is predicted to reach a position facing the reading head 21. Note that the timing at which the leading edge of the document is predicted to reach the position facing the reading head 21 can be determined based on the elapsed time from the start of document conveyance and the document conveyance speed.

スキャナ100は,読み取りの進行に伴って,生成中の画像データ51に対して,エッジ検出動作を実行する。まず,スキャナ100は,読み取り開始から所定のライン数の画像データ51を取得した後,原稿の上辺によって生じた影画像52のエッジを検出する。例えば,Y=0の点から副走査方向に所定の範囲の画像データ51から,エッジを検出する。そして,取得されたエッジの位置であるエッジデータに基づいて,原稿の上辺の位置を推定する。なお,X軸方向についての全ての点についてエッジ検出動作を実行すると,処理に時間が掛かりすぎる。そのため,本形態のスキャナ100では,所定の間隔のX位置についてエッジ検出動作を実行する。また,ノイズを上辺と誤判断することを抑制するために,所定の個数以上の点で連続して輝度値が閾値を超えている場合に限って,上辺と判断する。   As the reading progresses, the scanner 100 performs an edge detection operation on the image data 51 being generated. First, after acquiring a predetermined number of lines of image data 51 from the start of reading, the scanner 100 detects the edge of the shadow image 52 caused by the upper side of the document. For example, an edge is detected from the image data 51 in a predetermined range from the point Y = 0 in the sub-scanning direction. Then, the position of the upper side of the document is estimated based on the edge data that is the acquired edge position. Note that if the edge detection operation is executed for all points in the X-axis direction, the process takes too much time. Therefore, in the scanner 100 of this embodiment, an edge detection operation is executed for X positions at a predetermined interval. Further, in order to suppress erroneous determination of noise as the upper side, the upper side is determined only when the luminance value continuously exceeds the threshold at a predetermined number of points or more.

スキャナ100は,さらに読み取りが進行したら,原稿の側辺によって生じた影画像52のエッジを検出する。この場合には,読み取りの進行とともに,原稿の上辺側から副走査方向に順に検出することになる。そして,スキャナ100は,Y軸方向に所定の頻度でサンプリングして,X軸方向にエッジデータを取得する。つまり,画像データ51のうち,Y軸方向に所定の間隔を置いた位置ごとにエッジを検出し,側辺の位置を推定する。例えば,X=0の点からX軸方向に検出することで,原稿の左辺の位置を推定する。また,X=Wxの点からX軸方向の逆方向に検出することで,原稿の右辺の位置を推定する。なお,サンプリングの頻度は,左辺と右辺とで同じ頻度でもよいし,異なる頻度でもよい。   As the reading further proceeds, the scanner 100 detects the edge of the shadow image 52 caused by the side of the document. In this case, as the reading progresses, detection is sequentially performed from the upper side of the document in the sub-scanning direction. The scanner 100 samples at a predetermined frequency in the Y-axis direction and acquires edge data in the X-axis direction. That is, an edge is detected for each position at a predetermined interval in the Y-axis direction in the image data 51, and the position of the side is estimated. For example, the position of the left side of the document is estimated by detecting in the X-axis direction from the point X = 0. Further, the position of the right side of the document is estimated by detecting in the direction opposite to the X-axis direction from the point of X = Wx. The sampling frequency may be the same on the left side and the right side or may be different.

スキャナ100では,読取ヘッド21の長さ方向の端部近傍はノイズの影響を受けやすく,主走査方向の端部近傍にて,原稿の側辺ではない箇所にエッジを検出してしまうことがある。また,原稿が読取ヘッド21の長さ方向にはみ出した位置にセットされた場合,原稿の側辺によるエッジが適切に検出できない可能性がある。そのため,これらの場合には,前述したエッジ検出動作によって原稿の側辺の位置を推定すると,誤判断を招くおそれがある。   In the scanner 100, the vicinity of the end portion in the length direction of the reading head 21 is easily affected by noise, and an edge may be detected near the end portion in the main scanning direction at a location other than the side of the document. . Further, when the document is set at a position that protrudes in the length direction of the reading head 21, there is a possibility that the edge due to the side of the document cannot be detected properly. Therefore, in these cases, if the position of the side of the document is estimated by the above-described edge detection operation, there is a risk of erroneous determination.

本形態のスキャナ100は,検出されたエッジの位置が,画像データ51のX軸方向の両端から予め決めた規定距離までの範囲内にある場合には,適切なエッジの位置ではないと判断する。具体的には,検出されたエッジの位置のX座標が0に近いかまたはWxに近い場合は,適切なエッジの位置ではないと判断する。この場合,原稿の主走査方向の端部が読取ヘッド21の読取範囲を超えている可能性を否定できないので,原稿の主走査方向の端部が読取ヘッド21の読取範囲を超えていると判断する。そして,そのエッジの位置に基づく原稿の側辺の位置の推定を行わない。   The scanner 100 according to the present embodiment determines that the detected edge position is not an appropriate edge position when the detected edge position is within a predetermined distance from both ends of the image data 51 in the X-axis direction. . Specifically, if the X coordinate of the detected edge position is close to 0 or close to Wx, it is determined that the edge position is not appropriate. In this case, the possibility that the end of the document in the main scanning direction exceeds the reading range of the reading head 21 cannot be denied, so it is determined that the end of the document in the main scanning direction exceeds the reading range of the reading head 21. To do. Then, the side position of the document is not estimated based on the position of the edge.

さらに,スキャナ100は,読取範囲を超えていると判断した場合には,後述する原稿の情報を取得する処理にて,検出されたエッジの両端の位置情報を使用しない。なお,規定距離は,画像データ51のX軸方向について,左端側と右端側とで同じでもよいし,異なっていてもよい。   Further, when the scanner 100 determines that the reading range is exceeded, the position information on both ends of the detected edge is not used in the process of acquiring document information to be described later. The specified distance may be the same or different between the left end side and the right end side in the X-axis direction of the image data 51.

また,スキャナ100は,原稿の上辺によるエッジの左右の端部の位置である先端角部についても,同様に判断する。先端角部によるエッジの位置を取得できなかった場合や,先端角部が,画像データ51のX軸方向の両端から予め決めた規定距離までの範囲内にある場合には,先端角部の位置を使用しない。例えば,先端角部の位置に基づく原稿の側辺の位置の推定を行わない。つまり,原稿の先端角部と推定されるエッジの位置が,主走査方向の端部近傍であった場合には,原稿の先端角部が読取範囲を超えていると判断する。   In addition, the scanner 100 similarly determines the leading edge corners, which are the positions of the left and right edges of the edge of the upper side of the document. When the position of the edge due to the tip corner cannot be obtained, or when the tip corner is within a predetermined distance from both ends in the X-axis direction of the image data 51, the position of the tip corner Do not use. For example, the position of the side of the document is not estimated based on the position of the leading edge. That is, when the position of the edge estimated to be the leading edge portion of the document is near the end portion in the main scanning direction, it is determined that the leading edge portion of the document exceeds the reading range.

つまり,本形態のスキャナ100は,エッジの検出された位置が,読取範囲のうちX軸方向の両端近傍ではない範囲内にエッジが検出されたと判断した場合には,そのエッジの位置情報であるエッジデータを原稿の側辺の位置であると推定して,原稿の位置や形状に係る各種の情報を取得する際に使用する。以下では,読取範囲内にエッジが検出されたと判断した場合を,エッジデータが有効であるとする。一方,読取範囲内にエッジが検出されなかったと判断した場合には,エッジデータが無効であるとし,エッジデータを使用しない。   That is, the scanner 100 according to the present embodiment is the position information of the edge when it is determined that the edge is detected in a range that is not near the both ends in the X-axis direction in the reading range. The edge data is estimated to be the position of the side of the document, and is used when acquiring various information related to the position and shape of the document. In the following, it is assumed that the edge data is valid when it is determined that an edge is detected within the reading range. On the other hand, if it is determined that no edge is detected within the reading range, the edge data is invalid and the edge data is not used.

続いて,本形態のスキャナ100において,前述した原稿の読み取り動作を行う読取処理について,図4のフローチャートを参照して説明する。読取処理は,スキャナ100にて,読取開始の指示入力を受け付けたことを契機に,CPU31にて実行される。なお,以下では,画像データ51内の各点の位置を,前述したX−Y平面内の座標を用いて,「(X座標,Y座標)」と表記する。   Next, reading processing for performing the above-described document reading operation in the scanner 100 according to the present embodiment will be described with reference to a flowchart of FIG. The reading process is executed by the CPU 31 when the scanner 100 receives an instruction to start reading. Hereinafter, the position of each point in the image data 51 is expressed as “(X coordinate, Y coordinate)” using the coordinates in the XY plane described above.

本形態のスキャナ100は,読取処理を開始すると,まず,原稿の搬送を開始する(S101)。そして,原稿の搬送開始から所定の時間が経過したら,スキャナ100は,読取ヘッド21による読み取りを開始する(S102)。S102によって,スキャナ100は,X軸方向に1ライン分ずつ画像データを取得する。以後は,各ラインの画像データが,Y軸方向に順次追加して取得される。S102の処理は,読取処理の一例である。   When the scanner 100 of the present embodiment starts the reading process, it first starts conveying the document (S101). When a predetermined time elapses from the start of document conveyance, the scanner 100 starts reading with the reading head 21 (S102). In step S102, the scanner 100 acquires image data for each line in the X-axis direction. Thereafter, the image data of each line is sequentially acquired in the Y-axis direction and acquired. The process of S102 is an example of a reading process.

さらに,スキャナ100は,取得した画像データ51に基づいて,原稿の上辺による影画像52と推定されるエッジの検出を開始する(S104)。具体的には,X軸方向にサンプリングした各位置において,Y軸方向に所定の幅の画像データ51に基づいて,輝度値が閾値を超えた箇所をエッジとして検出し,エッジの位置情報であるエッジデータを取得する。   Further, based on the acquired image data 51, the scanner 100 starts detecting an edge that is estimated to be a shadow image 52 by the upper side of the document (S104). Specifically, at each position sampled in the X-axis direction, based on the image data 51 having a predetermined width in the Y-axis direction, a location where the luminance value exceeds a threshold value is detected as an edge, which is edge position information. Get edge data.

そして,スキャナ100は,上辺の一部であると判断できるエッジを検出したか否かを判断する(S105)。上辺を検出していないと判断した場合には(S105:NO),スキャナ100は,さらに読み進める。そして,上辺を検出したと判断した場合には,(S105:YES),スキャナ100は,検出された上辺の位置からさらに,予め決めた所定の距離だけ読み進める(S106)。   Then, the scanner 100 determines whether an edge that can be determined to be a part of the upper side has been detected (S105). If it is determined that the upper side has not been detected (S105: NO), the scanner 100 proceeds further. If it is determined that the upper side has been detected (S105: YES), the scanner 100 further reads a predetermined distance from the detected position of the upper side (S106).

そして,スキャナ100は,読み取り開始からS106の終了までに読み取った画像データ51から検出されたエッジの位置に基づき,原稿の上辺全体の位置情報を取得する(S108)。例えば,S104にて上辺と推定された位置からX軸方向に連続するエッジを検出して,連続する上辺の位置とする。S108の処理は,エッジ取得処理の一例である。   Then, the scanner 100 acquires position information of the entire upper side of the document based on the edge positions detected from the image data 51 read from the reading start to the end of S106 (S108). For example, a continuous edge in the X-axis direction is detected from the position estimated as the upper side in S104 and set as the position of the continuous upper side. The process of S108 is an example of an edge acquisition process.

次に,スキャナ100は,上辺の角部の位置を取得する(S109)。S108にて検出されたエッジの途切れた位置を原稿の角部と推定して,その位置からY軸方向に連続するエッジを検出する。Y軸方向にエッジが連続していれば,上辺によるエッジの途切れる位置は,原稿の先端角部に相当すると判断する。つまり,S109では,スキャナ100は,原稿の上辺によるエッジの終端の位置から,図5に示すように,原稿の上辺の角部の座標を取得する。例えば,上辺と左辺とによる角部C(Xc,Yc)と,上辺と右辺とによる角部D(Xd,Yd)とを取得する。S109の処理は,抽出処理の一例である   Next, the scanner 100 acquires the position of the upper corner (S109). The position at which the edge detected in S108 is interrupted is estimated as the corner of the document, and an edge continuous in the Y-axis direction is detected from that position. If the edges are continuous in the Y-axis direction, it is determined that the position where the edge is interrupted by the upper side corresponds to the leading edge of the document. That is, in S109, the scanner 100 acquires the coordinates of the corners of the upper side of the document as shown in FIG. 5 from the position of the end of the edge by the upper side of the document. For example, a corner C (Xc, Yc) formed by the upper side and the left side and a corner D (Xd, Yd) formed by the upper side and the right side are acquired. The process of S109 is an example of an extraction process.

そして,スキャナ100は,左右両側の角部C,Dの取得に成功したか否かを判断する(S112)。例えば,上辺に終端が検出できなかった場合や,上辺が波打っている等により上辺の両端が適切に検出できなかった場合には,スキャナ100は,角部C,Dの座標を適切に取得できない。従って,スキャナ100は,角部C,Dの取得に失敗したと判断する。   Then, the scanner 100 determines whether or not the right and left corners C and D have been successfully acquired (S112). For example, if the end cannot be detected on the upper side, or if both ends of the upper side cannot be detected properly due to the upper side being wavy, the scanner 100 appropriately acquires the coordinates of the corners C and D. Can not. Accordingly, the scanner 100 determines that acquisition of the corners C and D has failed.

さらに,スキャナ100は,前述したように,検出されたエッジの位置が画像データ51のX軸方向の両端近傍にあった場合には,そのエッジデータは信頼性が低い。つまりそのエッジデータに基づいて,辺の位置を判断することは好ましくない。そのため,そのエッジデータは無効であるとして,スキャナ100は,辺の位置の推定にそのエッジデータを使用しない。以下では,エッジデータを無効とする範囲を,図5に示すように,左辺側を規定距離Wlとし,右辺側を規定距離Wrとする。WlとWrとは,同じ距離でもよいし,異なっていてもよい。   Further, as described above, when the position of the detected edge is in the vicinity of both ends of the image data 51 in the X-axis direction, the scanner 100 has low reliability. That is, it is not preferable to determine the position of the side based on the edge data. Therefore, assuming that the edge data is invalid, the scanner 100 does not use the edge data for estimating the position of the side. In the following, as shown in FIG. 5, the range in which the edge data is invalid is defined as a specified distance Wl on the left side and a specified distance Wr on the right side. Wl and Wr may be the same distance or different.

つまり,スキャナ100は,S112にて,取得された角部CのX座標Xcが,0から予め決めた規定距離Wlまでの範囲内にある場合,つまり,Xc<Wlである場合には,角部Cの取得に失敗したと判断する。また,スキャナ100は,取得された角部DのX座標Xdが,X座標の最大値Wxから予め決めた規定距離Wrまでの範囲内である場合,つまり,Xd>Wx−Wrである場合には,角部Dの取得に失敗したと判断する。S112の処理は,判断処理の一例である。   That is, in S112, the scanner 100 determines that if the acquired X-coordinate Xc of the corner C is within the range from 0 to a predetermined distance Wl, that is, if Xc <Wl. It is determined that acquisition of part C has failed. Further, the scanner 100 determines that the acquired X coordinate Xd of the corner D is within a range from the maximum value Wx of the X coordinate to a predetermined specified distance Wr, that is, when Xd> Wx−Wr. Determines that acquisition of the corner D has failed. The process of S112 is an example of a determination process.

そして,スキャナ100は,左右両側の角部C,Dの取得に成功したと判断した場合には(S112:YES),上辺と左辺と右辺とを使用すると決定する(S113)。つまり,左辺のエッジデータも,右辺のエッジデータも,ともに有効であり,いずれも以後の処理に使用できる。   When the scanner 100 determines that the left and right corners C and D have been successfully acquired (S112: YES), the scanner 100 determines to use the upper side, the left side, and the right side (S113). That is, both the edge data on the left side and the edge data on the right side are valid and can be used for subsequent processing.

一方,スキャナ100は,角部C,Dの少なくとも一方の取得に成功しなかったと判断した場合には(S112:NO),左辺側の角部Cの取得に成功したか否かを判断する(S115)。そして,スキャナ100は,左辺側の角部Cの取得に成功したと判断した場合には(S115:YES),左辺のエッジデータは有効であり,以後の処理にて上辺と左辺とを使用すると決定する(S116)。   On the other hand, when the scanner 100 determines that acquisition of at least one of the corners C and D is not successful (S112: NO), the scanner 100 determines whether acquisition of the corner C on the left side is successful (step S112). S115). If the scanner 100 determines that the left side corner C has been successfully acquired (S115: YES), the left side edge data is valid, and the upper side and the left side are used in the subsequent processing. Determine (S116).

また,スキャナ100は,左辺側の角部Cの取得に成功しなかったと判断した場合には(S115:NO),右辺側の角部Dの取得に成功したか否かを判断する(S118)。そして,スキャナ100は,右辺側の角部Dの取得に成功したと判断した場合には(S118:YES),右辺のエッジデータは有効であり,以後の処理にて上辺と右辺とを使用すると決定する(S119)。   If the scanner 100 determines that the left side corner C has not been successfully acquired (S115: NO), the scanner 100 determines whether the right side corner D has been successfully acquired (S118). . If the scanner 100 determines that acquisition of the corner D on the right side is successful (S118: YES), the edge data on the right side is valid, and the upper side and the right side are used in the subsequent processing. Determine (S119).

スキャナ100は,右辺側の角部Dの取得に成功しなかったと判断した場合には(S118:NO),上辺のみを使用すると決定する(S121)。つまり,左辺のエッジデータも右辺のエッジデータも無効であり,左辺も右辺も使用できない。この場合には,スキャナ100は,後述する原稿の情報を取得する処理を実行しない。   If the scanner 100 determines that acquisition of the corner D on the right side has not been successful (S118: NO), the scanner 100 determines to use only the upper side (S121). That is, the left edge data and the right edge data are invalid, and neither the left edge nor the right edge can be used. In this case, the scanner 100 does not execute processing for acquiring document information, which will be described later.

そこで,S121の後,スキャナ100は,原稿の下辺まで読み取りが終了したか否かを判断する(S123)。例えば,原稿の終端が読取ヘッド21に対向する位置を通り抜け,さらに予め決めた時間だけ搬送したら,原稿の下辺までの読み取りが終了したと判断できる。読み取りが終了していないと判断した場合には(S123:NO),さらに読み取りを継続する。そして,読み取りが終了したと判断したら(S123:YES),読取処理を終了する。なお,S121の後,上辺の情報のみを利用して可能な処理が有れば,当該処理を実行してもよい。   Therefore, after S121, the scanner 100 determines whether reading has been completed up to the lower side of the document (S123). For example, when the end of the original passes through the position facing the reading head 21 and is conveyed for a predetermined time, it can be determined that the reading to the lower side of the original has been completed. If it is determined that the reading is not completed (S123: NO), the reading is further continued. If it is determined that the reading is finished (S123: YES), the reading process is finished. If there is a process that can be performed using only the information on the upper side after S121, the process may be executed.

一方,S113,S116,S119のいずれかにて,左辺と右辺との少なくとも一方は使用すると決定した場合には,スキャナ100は,まず,サンプリング位置決定処理を実行する(S125)。図6のフローチャートに,サンプリング位置決定処理の手順を示す。   On the other hand, if it is determined in any one of S113, S116, and S119 that at least one of the left side and the right side is to be used, the scanner 100 first executes a sampling position determination process (S125). The flowchart of FIG. 6 shows the procedure of the sampling position determination process.

原稿の傾きが大きい場合などでは,例えば,図7に示すように,左右のいずれかの辺によるエッジデータが途中から無効となる可能性がある。サンプリング位置決定処理は,側辺のエッジデータが有効から無効に変化すると予測される位置である超過位置Hの座標を取得し,読取位置の副走査方向の位置がその超過位置HのY座標に近づいたら,それまでよりサンプリング頻度を高くする処理である。なお,この処理では,原稿が長方形であると推定している。   In the case where the inclination of the document is large, for example, as shown in FIG. 7, there is a possibility that the edge data by one of the left and right sides becomes invalid from the middle. In the sampling position determination process, the coordinates of the excess position H, which is the position where the side edge data is predicted to change from valid to invalid, are acquired, and the position of the reading position in the sub-scanning direction is changed to the Y coordinate of the excess position H. When approaching, the sampling frequency is increased more than before. In this process, it is estimated that the document is rectangular.

サンプリング位置決定処理では,スキャナ100は,まず,上辺のX軸方向に対する原稿の傾き角θを取得する(S201)。傾き角θは,図7に示すように,角部Cと角部Dとを結ぶ線分とX軸とがなす角としてもよいし,上辺の各エッジデータを直線近似した直線とX軸とのなす角としてもよい。S201の処理は,傾き取得処理の一例である。   In the sampling position determination process, the scanner 100 first acquires the document inclination angle θ with respect to the X-axis direction of the upper side (S201). As shown in FIG. 7, the inclination angle θ may be an angle formed by a line segment connecting the corner C and the corner D and the X axis, or a straight line approximating each edge data of the upper side and the X axis. It may be an angle formed by The process of S201 is an example of an inclination acquisition process.

次に,傾き角θ>0であれば,超過位置Hの座標を取得する。例えば,図7に示すように,Yc<Ydであれば,左辺側のエッジデータが無効となる可能性がある。そこで,スキャナ100は,角部Cから上辺に直角な直線を想定し,原稿の左辺と仮定する。さらに,スキャナ100は,仮定した左辺とX=Wlの直線とが交差すると予測される超過位置Hの座標(Wl,Yh)を取得する(S203)。   Next, if the inclination angle θ> 0, the coordinates of the excess position H are acquired. For example, as shown in FIG. 7, if Yc <Yd, the edge data on the left side may become invalid. Therefore, the scanner 100 assumes a straight line perpendicular to the upper side from the corner C and assumes the left side of the document. Further, the scanner 100 acquires the coordinates (Wl, Yh) of the excess position H where the assumed left side and the straight line X = Wl are predicted to intersect (S203).

具体的に,超過位置HのY座標Yhは,S201にて求めた傾き角θを用いて,以下の(式1)のように表すことができる。
tanθ = (Xc−Wl) / (Yh−Yc)
Yh = Yc + (Xc−Wl)/tanθ … (式1)
Specifically, the Y coordinate Yh of the excess position H can be expressed as (Equation 1) below using the inclination angle θ obtained in S201.
tan θ = (Xc−Wl) / (Yh−Yc)
Yh = Yc + (Xc−Wl) / tan θ (Formula 1)

次に,スキャナ100は,左辺側のエッジ検出のためのサンプリング頻度を決定する(S205)。スキャナ100では,前述したように,Y軸方向に所定のサンプリング頻度でエッジ検出を実行する。そして,スキャナ100は,図8に示すように,超過位置HのY座標Yhから所定範囲内の領域Qでは,領域Q以外の領域よりもサンプリング頻度を高くする。領域Qは,境界領域の一例である。   Next, the scanner 100 determines the sampling frequency for detecting the left side edge (S205). As described above, the scanner 100 performs edge detection at a predetermined sampling frequency in the Y-axis direction. Then, as shown in FIG. 8, the scanner 100 increases the sampling frequency in the region Q within the predetermined range from the Y coordinate Yh of the excess position H as compared to the region other than the region Q. The region Q is an example of a boundary region.

具体的に,スキャナ100は,検出位置のY座標に応じて,図8に示すように,サンプリング頻度Pa,Pbを決定する。所定範囲としては,例えば,100ピクセルとする。
サンプリング頻度Pa =50(ピクセル) ただし,Y < Yh−100
サンプリング頻度Pb = 5(ピクセル) ただし,Y ≧ Yh−100
Specifically, the scanner 100 determines sampling frequencies Pa and Pb as shown in FIG. 8 according to the Y coordinate of the detection position. The predetermined range is, for example, 100 pixels.
Sampling frequency Pa = 50 (pixels) where Y <Yh-100
Sampling frequency Pb = 5 (pixels) where Y ≧ Yh−100

そして,スキャナ100は,S205にて決定したサンプリング頻度に従って,エッジ検出を実行する位置を決定し,RAM33に記憶する(S207)。なお,実際に超過する位置が超過位置Hより下方となる可能性もあるので,エッジ検出位置は,超過位置Hよりも少し下方まで決定しておくとよい。S207の後,サンプリング位置決定処理を終了する。   Then, the scanner 100 determines a position for executing edge detection according to the sampling frequency determined in S205, and stores it in the RAM 33 (S207). Note that since the position that actually exceeds may be below the excess position H, the edge detection position may be determined to be slightly below the excess position H. After S207, the sampling position determination process ends.

そして,スキャナ100は,決定されたエッジ検出位置まで画像データ51を生成したら,エッジ検出動作を実行する。検出されたエッジの位置のX座標がWl以下となったら,スキャナ100は,その後は左辺側のエッジ検出を実行しない。つまり,エッジデータが無効となったら,左辺についてのエッジ検出動作の実行は中止し,原稿の読み取りのみを継続する。そして,スキャナ100は,この時点以降は,左辺は使用しない。なお,左辺が無効となっても,右辺のエッジデータを適切に取得できていれば,右辺側のエッジ検出については継続する。   When the scanner 100 generates the image data 51 up to the determined edge detection position, the scanner 100 performs an edge detection operation. When the X coordinate of the detected edge position is equal to or less than W1, the scanner 100 does not perform edge detection on the left side thereafter. That is, when the edge data becomes invalid, the execution of the edge detection operation for the left side is stopped, and only reading of the original is continued. The scanner 100 does not use the left side after this point. Even if the left side is invalid, the edge detection on the right side continues if the edge data on the right side can be acquired appropriately.

サンプリング位置決定処理によって決定されたように,超過位置Hに近い位置では,サンプリング頻度を高くするので,検出されたエッジデータが無効となったことを見逃す可能性は低い。従って,無効のエッジデータを有効であると誤判断する可能性は低い。   As determined by the sampling position determination process, since the sampling frequency is increased at a position close to the excess position H, it is unlikely that the detected edge data has been invalidated. Therefore, there is a low possibility of erroneously determining invalid edge data as valid.

これにより,側辺のエッジデータが有効であるか否かを精密に判断できる。つまり,信頼性の低いエッジデータを側辺の位置と推定して使用する可能性は低い。なお,右辺側のエッジデータが途中で無効となる可能性がある場合には,スキャナ100は,S203にて,角部Dを通る右辺を仮定し,仮定した右辺とX=Wrの直線とが交差すると予測される点を超過位置Hとする。   As a result, it is possible to accurately determine whether or not the side edge data is valid. That is, it is unlikely that edge data with low reliability is used as the position of the side. If there is a possibility that the edge data on the right side is invalid in the middle, the scanner 100 assumes a right side passing through the corner D in S203, and the assumed right side and a straight line of X = Wr are obtained. The point predicted to intersect is defined as the excess position H.

また,原稿の搬送方向についての長さが,(Yh−Yc)よりも小さい場合には,エッジデータが無効となる前に読み取りが終了する。読取位置のY座標が(Yh−100)に達しないうちに原稿の終端に達した場合には,スキャナ100は,結果的にサンプリング頻度を変更しない。   If the length of the document in the conveyance direction is smaller than (Yh−Yc), the reading ends before the edge data becomes invalid. If the end of the document is reached before the Y coordinate of the reading position reaches (Yh-100), the scanner 100 does not change the sampling frequency as a result.

図4の読取処理に戻り,S125のサンプリング位置決定処理が終了したので,次に,原稿情報取得処理を実行する(S127)。原稿情報取得処理とは,有効であると判断されたエッジデータを用いて原稿に係る情報を取得する処理である。取得する原稿の情報は,原稿の特性と状態との少なくとも一方であり,例えば,原稿のサイズ,原稿の傾き,原稿の回転斜行,原稿の形状,原稿に形成されているパンチ穴の位置がある。原稿情報取得処理の詳細については,後述する。S127の処理は,情報取得処理の一例である。   Returning to the reading process of FIG. 4, since the sampling position determination process of S125 is completed, an original information acquisition process is executed (S127). The document information acquisition process is a process of acquiring information related to a document using edge data determined to be valid. The information of the original to be acquired is at least one of the characteristics and state of the original. For example, the size of the original, the inclination of the original, the rotation of the original, the shape of the original, and the position of the punch hole formed in the original is there. Details of the manuscript information acquisition process will be described later. The process of S127 is an example of an information acquisition process.

本形態のスキャナ100は,上辺の位置のみでなく,左辺と右辺との少なくとも一方の位置に関するエッジデータが有効である場合に,種々の原稿情報取得処理のうち,必要に応じて1以上の処理を実行する。左辺と右辺との両方とも無効である場合には,いずれの処理も実行しない。スキャナ100は,原稿の情報を取得する各種の処理のうち,1つ以上を有していればよい。複数の処理を有している場合には,全て実行してもよいし,ユーザの設定などによって選択された処理のみを実行してもよい。   The scanner 100 according to the present embodiment includes one or more processes as necessary among various document information acquisition processes when the edge data regarding not only the position of the upper side but also at least one of the left side and the right side is valid. Execute. If both the left and right sides are invalid, no processing is performed. The scanner 100 only needs to have one or more of various processes for acquiring document information. When there are a plurality of processes, all of them may be executed, or only the processes selected by the user's settings may be executed.

原稿情報取得処理が終了したら,原稿の読み取りが終了したか否かを判断する(S123)。読み取りが終了していないと判断したら(S123:NO),さらに読み取りを継続する。そして,読み取りが終了したと判断したら(S123:YES),読取処理を終了する。   When the document information acquisition process is completed, it is determined whether or not the document reading is completed (S123). If it is determined that the reading has not been completed (S123: NO), the reading is further continued. If it is determined that the reading is finished (S123: YES), the reading process is finished.

続いて,S127にて実行される原稿情報取得処理について説明する。まず,各種の情報を取得する処理の概要を説明する。本形態のスキャナ100は,原稿のサイズを取得する処理では,長方形以外の形状の原稿でも,原稿の全体を含む最小の長方形のサイズを取得する。スキャナ100は,例えば,原稿の途中に上辺よりも幅広の箇所がある場合には,その箇所の幅に基づいて,原稿の主走査方向の大きさを取得する。スキャナ100は,左右両辺のエッジデータがともに有効である場合に,原稿のサイズを取得する処理を実行する。   Subsequently, the document information acquisition process executed in S127 will be described. First, an overview of processing for acquiring various types of information will be described. In the process of acquiring the size of the document, the scanner 100 according to the present embodiment acquires the minimum rectangular size including the entire document even if the document has a shape other than the rectangle. For example, when there is a part wider than the upper side in the middle of the document, the scanner 100 acquires the size of the document in the main scanning direction based on the width of the part. The scanner 100 executes a process of acquiring the size of the document when both the left and right edge data are valid.

また,本形態のスキャナ100は,原稿の傾きを取得する処理では,原稿の辺縁と軸方向とのなす傾き角を取得する。上辺のみによる検出ではなく,左辺と右辺との少なくとも一方の位置を用いることで,より精密に傾き角を取得できる。スキャナ100は,例えば,取得した傾き角に基づいて,画像データ51を補正する。スキャナ100は,左辺と右辺との少なくとも一方のエッジデータが有効である場合に,原稿の傾きを取得する処理を実行する。   Further, the scanner 100 according to the present embodiment acquires an inclination angle formed between the edge of the original and the axial direction in the process of acquiring the inclination of the original. By using at least one position of the left side and the right side instead of detecting only by the upper side, the tilt angle can be acquired more precisely. For example, the scanner 100 corrects the image data 51 based on the acquired tilt angle. The scanner 100 executes processing for obtaining the inclination of the document when at least one edge data of the left side and the right side is valid.

また,本形態のスキャナ100は,原稿の回転斜行を取得する処理では,原稿の左辺または右辺と軸方向とのなす傾き角が,搬送につれて変化していく状態であるか否かを取得する。原稿の傾き角が搬送につれて増加していると,原稿のジャムの原因となる可能性がある。スキャナ100は,例えば,回転斜行を検出したら,エラーメッセージを表示して,原稿の搬送を停止する。スキャナ100は,左辺と右辺との少なくとも一方のエッジデータが有効であれば,原稿の回転斜行を取得する処理を実行する。ただし,左右両辺の位置のエッジデータがともに有効であれば,より確実な判断が可能となる。   Further, the scanner 100 according to the present embodiment acquires whether or not the inclination angle formed between the left side or the right side of the document and the axial direction changes in the process of acquiring the rotation skew of the document. . If the inclination angle of the document increases as it is conveyed, it may cause jamming of the document. For example, when the scanner 100 detects rotation skew, it displays an error message and stops conveying the document. If at least one edge data of the left side and the right side is valid, the scanner 100 executes a process of acquiring the rotation skew of the document. However, if both edge data at the left and right sides are valid, a more reliable determination is possible.

また,本形態のスキャナ100は,原稿の形状を取得する処理では,エッジデータとして検出された左辺と右辺との位置を繋いで,原稿の形状として取得する。スキャナ100は,例えば,原稿の形状に応じて,読み取った画像データ51を補正する。スキャナ100は,両辺のエッジデータがともに有効である場合,原稿の形状を取得する処理を実行する。左辺または右辺のいずれか一方のみが有効な場合には,取得できる原稿の形状は,不完全な情報となる。   Further, in the process of acquiring the shape of the document, the scanner 100 according to the present embodiment acquires the shape of the document by connecting the positions of the left side and the right side detected as edge data. For example, the scanner 100 corrects the read image data 51 according to the shape of the document. When both edge data are valid, the scanner 100 executes processing for acquiring the shape of the document. If only either the left side or the right side is valid, the shape of the document that can be acquired is incomplete information.

また,本形態のスキャナ100は,原稿に形成されているパンチ穴の位置を取得する処理では,各辺から所定の距離範囲の位置に所定の大きさの円状の画像が含まれている場合に,パンチ穴と判断する。スキャナ100は,例えば,パンチ穴があると判断した場合には,パンチ穴の画像を周辺の地色に変換する処理を実行する。スキャナ100は,左辺と右辺との少なくとも一方の位置のエッジデータが有効である場合に,有効である側の辺に近いパンチ穴について,パンチ穴の位置を取得する処理を実行する。   In the scanner 100 according to this embodiment, in the process of acquiring the position of the punch hole formed in the document, a circular image having a predetermined size is included at a position within a predetermined distance range from each side. Judged as a punch hole. For example, when the scanner 100 determines that there is a punch hole, the scanner 100 executes processing for converting the punch hole image into a surrounding ground color. When the edge data at at least one position of the left side and the right side is valid, the scanner 100 executes a process of acquiring the punch hole position with respect to the punch hole close to the valid side.

なお,側辺のエッジデータを取得するためのエッジ検出動作のサンプリング頻度は,側辺を使用して取得する原稿の情報の種類に応じて,異なる頻度とする。前述した超過位置Hの近傍以外でのサンプリング頻度Paを,原稿情報取得処理として実行する処理の種類ごとに予め設定されている頻度とする。例えば,側辺の位置が高精度に要求される情報を取得する場合には,それ以外の場合に比較して高いサンプリング頻度とする。これにより,取得される原稿の情報の精度の向上が期待できる。なお,超過位置Hの近傍でのサンプリング頻度Pbは,サンプリング頻度Paに基づいて決定してもよいし,情報の種類にかかわらず予め決めた値に設定してもよい。   Note that the sampling frequency of the edge detection operation for acquiring the edge data of the side is different depending on the type of document information acquired using the side. The sampling frequency Pa outside the vicinity of the excess position H described above is set to a frequency set in advance for each type of processing executed as the document information acquisition processing. For example, in the case of acquiring information whose side position is required with high accuracy, the sampling frequency is set higher than in other cases. As a result, it is expected that the accuracy of the information of the obtained document will be improved. Note that the sampling frequency Pb in the vicinity of the excess position H may be determined based on the sampling frequency Pa, or may be set to a predetermined value regardless of the type of information.

以下では,原稿情報取得処理の例として,図9に示す原稿サイズ取得処理と,図10に示す回転斜行取得処理とについて,それぞれのフローチャートを参照して説明する。これらの処理は,読取処理において,S113,S116,S119のいずれかを実行した後に実行される。つまり,本処理の開始時には,上辺以外に使用できる辺(左辺または右辺または両方)が確定している。   In the following, as an example of the document information acquisition process, the document size acquisition process shown in FIG. 9 and the rotation skew acquisition process shown in FIG. 10 will be described with reference to the respective flowcharts. These processes are executed after executing any one of S113, S116, and S119 in the reading process. That is, at the start of this processing, the sides (left side or right side or both) that can be used other than the upper side are determined.

まず,図9のフローチャートを参照して,原稿サイズ取得処理について説明する。この処理は,S113にて左右の両辺の位置を使用できると決定した場合に実行される。原稿サイズ取得処理では,スキャナ100は,まず,上辺の情報に基づいて原稿の左右の位置の初期値を決定し,左辺位置と右辺位置との初期位置を決定する(S301)。具体的には,スキャナ100は,左辺位置を角部CのX座標Xcとし,右辺位置を角部DのX座標Xdとする。   First, the document size acquisition process will be described with reference to the flowchart of FIG. This process is executed when it is determined in S113 that the positions of both the left and right sides can be used. In the document size acquisition process, the scanner 100 first determines the initial values of the left and right positions of the document based on the upper side information, and determines the initial positions of the left side position and the right side position (S301). Specifically, the scanner 100 sets the left side position as the X coordinate Xc of the corner C and the right side position as the X coordinate Xd of the corner D.

次に,スキャナ100は,原稿の読み取り動作とエッジ検出動作とによって取得されたエッジデータが,左辺位置や右辺位置より外側であるか否かを判断する(S303)。具体的には,左側のエッジデータのX座標が左辺位置より小さいか,または,右側のエッジデータのX座標が右辺位置より大きいかの少なくとも一方を満たしていれば,スキャナ100は,エッジデータが外側であると判断する。   Next, the scanner 100 determines whether or not the edge data acquired by the document reading operation and the edge detection operation is outside the left side position or the right side position (S303). Specifically, if the X coordinate of the left edge data is smaller than the left side position or the X coordinate of the right edge data is larger than the right side position, the scanner 100 satisfies the edge data. Judged to be outside.

スキャナ100は,エッジデータの方が外側であると判断した場合には(S303:YES),外側であると判断したエッジデータのX座標を,対応する左辺位置または右辺位置とする(S305)。外側であると判断したエッジデータが片側の辺のみであれば,スキャナ100は,片側の辺位置のみを変更する。一方,スキャナ100は,エッジデータの方が外側ではないと判断した場合には(S303:NO),S305をスキップする。   When the scanner 100 determines that the edge data is outside (S303: YES), the X coordinate of the edge data determined to be outside is set as the corresponding left side position or right side position (S305). If the edge data determined to be outside is only on one side, the scanner 100 changes only the side position on one side. On the other hand, when the scanner 100 determines that the edge data is not outside (S303: NO), it skips S305.

そして,スキャナ100は,1ページ分の読み取りが完了したか否かを判断する(S307)。読み取りが完了していなければ(S307:NO),スキャナ100は,次に取得されたエッジデータが有効であるか否かを判断する(S309)。前述したように,原稿の搬送につれて,原稿の側辺が読取範囲から逸脱する場合がある。逸脱した後は,検出されたエッジデータは無効となるので,スキャナ100は,仮にエッジデータが取得されても使用しない。   Then, the scanner 100 determines whether or not reading for one page is completed (S307). If the reading has not been completed (S307: NO), the scanner 100 determines whether the next acquired edge data is valid (S309). As described above, the side of the document may deviate from the reading range as the document is conveyed. After the deviation, the detected edge data becomes invalid, and the scanner 100 is not used even if the edge data is acquired.

スキャナ100は,エッジデータが有効であると判断した場合には(S309:YES),S303に戻って,エッジデータと辺位置とを比較する。そして,スキャナ100は,エッジデータが有効で読み取りを完了したと判断したら(S307:YES),最終的な左辺位置と右辺位置との間隔を原稿の幅として原稿のサイズを算出し(S311),原稿サイズ取得処理を終了する。   When the scanner 100 determines that the edge data is valid (S309: YES), the scanner 100 returns to S303 and compares the edge data with the side position. If the scanner 100 determines that the edge data is valid and the reading has been completed (S307: YES), the scanner 100 calculates the size of the document using the distance between the final left side position and the right side position as the width of the document (S311). The document size acquisition process is terminated.

一方,スキャナ100は,読み取りが完了する前に,エッジデータが無効となったと判断した場合には(S309:NO),原稿のサイズの取得に失敗したことになる。そこで,スキャナ100は,原稿サイズは不明であると決定して(S313),原稿サイズ取得処理を終了する。なお,原稿の読み取りが完了していなければ,読み取り動作は継続する。   On the other hand, if the scanner 100 determines that the edge data has become invalid before the reading is completed (S309: NO), it means that acquisition of the document size has failed. Therefore, the scanner 100 determines that the document size is unknown (S313), and ends the document size acquisition process. If the reading of the original is not completed, the reading operation continues.

続いて,図10のフローチャートを参照して,回転斜行取得処理について説明する。この処理は,左辺と右辺との少なくとも一方の位置を使用できると決定した場合に実行される。回転斜行取得処理では,まず,スキャナ100は,上辺の情報に基づいて,左辺と右辺との予測位置を取得する(S401)。例えば,前述した傾き角θとサンプリング位置とを利用して,スキャナ100は,次にエッジ検出が実行される位置でのエッジデータを予測する。   Next, the rotation skew acquisition process will be described with reference to the flowchart of FIG. This process is executed when it is determined that at least one position of the left side and the right side can be used. In the rotation skew acquisition processing, first, the scanner 100 acquires the predicted positions of the left side and the right side based on the information on the upper side (S401). For example, using the tilt angle θ and the sampling position described above, the scanner 100 predicts edge data at a position where edge detection is performed next.

スキャナ100は,エッジ検出を実行したら,取得されたエッジデータと,S401にて予測した予測位置とを比較する。そして,スキャナ100は,予測位置とエッジデータとの差分が予め決めた近似範囲内であるか否かを判断する(S403)。予測位置とエッジデータとが近く,差分が近似範囲内であると判断した場合には(S403:YES),スキャナ100は,1ページ分の読み取りが完了したか否かを判断する(S405)。   After performing the edge detection, the scanner 100 compares the acquired edge data with the predicted position predicted in S401. Then, the scanner 100 determines whether or not the difference between the predicted position and the edge data is within a predetermined approximate range (S403). When it is determined that the predicted position is close to the edge data and the difference is within the approximate range (S403: YES), the scanner 100 determines whether reading of one page has been completed (S405).

スキャナ100は,読み取りが完了したと判断した場合には(S405:YES),回転斜行は発生せず,読み取りが終わったので,そのまま回転斜行取得処理を終了する。一方,読み取りが完了していなければ(S405:NO),スキャナ100は,読み取りを継続するとともに,S401に戻って,次の予測位置を取得する。   When the scanner 100 determines that the reading has been completed (S405: YES), the rotation skew feeding does not occur and the reading is finished. On the other hand, if the reading is not completed (S405: NO), the scanner 100 continues the reading and returns to S401 to acquire the next predicted position.

一方,予測位置とエッジデータとの差分が近似範囲を超えていると判断した場合には(S403:NO),回転斜行の可能性がある。そこで,スキャナ100は,例えば,両辺とものエッジデータが有効であれば,両側の差分が同程度であるか否かを判断する(S407)。   On the other hand, if it is determined that the difference between the predicted position and the edge data exceeds the approximate range (S403: NO), there is a possibility of rotational skew. Therefore, for example, if the edge data on both sides is valid, the scanner 100 determines whether or not the difference between the two sides is comparable (S407).

そして,スキャナ100は,両側の差分が同程度であれば(S407:YES),回転斜行と決定する(S409)。そして,スキャナ100は,例えば,エラーメッセージを表示して,原稿の搬送と読み取りとを停止する。一方,両側の差分が同程度でなければ(S407:NO),スキャナ100は,不定形の原稿であると決定する(S411)。不定形と決定した場合は,読取完了まで読み取りを継続してもよい。S409とS411の後,回転斜行取得処理を終了する。   If the difference between the two sides is approximately the same (S407: YES), the scanner 100 determines that the rotation is skewed (S409). Then, for example, the scanner 100 displays an error message and stops the conveyance and reading of the document. On the other hand, if the difference between the two sides is not comparable (S407: NO), the scanner 100 determines that the document is an irregular document (S411). If it is determined to be indefinite, reading may be continued until reading is completed. After S409 and S411, the rotation skew acquisition process is terminated.

なお,片側のみのエッジデータが有効である場合には,S403にてNOであれば回転斜行であると判断してもよい。あるいは,さらに次のエッジデータと予測位置とを比較して,差分が増大している場合に回転斜行であると判断してもよい。判断結果に応じて,読み取りを継続するか否かを決定して,回転斜行取得処理を終了する。   If edge data on only one side is valid, if NO in S403, it may be determined that the rotation is skewed. Alternatively, the next edge data may be compared with the predicted position, and if the difference increases, it may be determined that the rotation is skewed. Depending on the determination result, it is determined whether or not to continue reading, and the rotational skew acquisition processing is terminated.

以上,詳細に説明したように,本形態のスキャナ100は,原稿を搬送しつつ原稿の画像を読み取る。そして,エッジ検出動作を実行して,読み取った画像データ51から,エッジの位置の情報であるエッジデータを取得する。さらに,取得したエッジデータに基づいて,原稿の左辺または右辺が読取ヘッド21の読取範囲を超えるか否かを判断する。つまり,エッジ検出動作にて検出されたエッジのすべてをそのままで原稿の端部とせず,信頼性の高いエッジデータであるか否かを判断するので,原稿のエッジの検知精度の向上が期待できる。   As described above in detail, the scanner 100 of this embodiment reads an image of a document while conveying the document. Then, an edge detection operation is executed, and edge data that is edge position information is acquired from the read image data 51. Further, based on the acquired edge data, it is determined whether the left side or the right side of the document exceeds the reading range of the reading head 21. In other words, since all the edges detected by the edge detection operation are not used as the end of the document as it is and it is determined whether or not the edge data is highly reliable, an improvement in the detection accuracy of the document edge can be expected. .

なお,本実施の形態は単なる例示にすぎず,本発明を何ら限定するものではない。したがって本発明は当然に,その要旨を逸脱しない範囲内で種々の改良,変形が可能である。例えば,スキャナに限らず,複写機,複合機,FAX装置等,画像読取機能を備えるものであれば適用可能である。また,例えば,原稿を搬送する代わりに,読取ヘッド21を移動させて読み取る構成のものにも適用可能である。   Note that this embodiment is merely an example, and does not limit the present invention. Therefore, the present invention can naturally be improved and modified in various ways without departing from the gist thereof. For example, the present invention is not limited to a scanner, and can be applied to any apparatus having an image reading function, such as a copying machine, a multifunction machine, and a FAX apparatus. Further, for example, the present invention can be applied to a configuration in which the reading head 21 is moved and read instead of conveying the document.

また,本発明は,PC等の情報処理装置にも適用可能である。例えば,PCにて,スキャナ100から画像データを取得し,取得した画像データに基づいて,エッジ検出動作を行うこともできる。そして,PCにてエッジデータを取得するとともに,そのエッジデータが有効であるか否かを判断してもよい。さらに,判断結果をスキャナ100に送信してもよいし,PCにて利用してもよい。   The present invention can also be applied to an information processing apparatus such as a PC. For example, image data can be acquired from the scanner 100 by a PC, and an edge detection operation can be performed based on the acquired image data. Then, the edge data may be acquired by the PC, and it may be determined whether or not the edge data is valid. Furthermore, the determination result may be transmitted to the scanner 100 or may be used by a PC.

また,例えば,左辺側の規定距離Wlと右辺側の規定距離Wrとの少なくとも一方は,無くてもよい。つまり,Wl=0でもよいし,Wr=0でもよい。   Further, for example, at least one of the specified distance Wl on the left side and the specified distance Wr on the right side may be omitted. That is, Wl = 0 or Wr = 0 may be used.

また,先端の角部C,Dの座標に基づいて超過位置Hを算出するとしたが,検出されたエッジの位置と読取範囲の限界から規定距離の位置との距離が閾値以下となった場合に,超過位置Hに近づいたと判断してもよい。また,超過位置Hに近づいたらサンプリング頻度を高くするとしたが,変更しなくてもよい。また,取得する原稿の情報に応じて異なる頻度でサンプリングするとしたが,全て一律の頻度としてもよい。   Further, the excess position H is calculated based on the coordinates of the corners C and D of the tip. However, when the distance between the detected edge position and the position of the specified distance from the limit of the reading range is less than the threshold value. , It may be determined that the excess position H has been approached. Further, although the sampling frequency is increased when the excess position H is approached, it does not have to be changed. Further, although sampling is performed at a different frequency according to the information of the original to be acquired, all may be set at a uniform frequency.

また,例えば,S105にタイムアウトを設けてもよい。つまり,上辺のエッジデータを取得できなかった場合は,読み取り失敗であり,エラーメッセージを表示して処理を終了するとしてもよい。   For example, a timeout may be provided in S105. In other words, if the upper edge data cannot be acquired, the reading has failed, and an error message may be displayed to end the process.

また,実施の形態に開示されている処理は,単一のCPU,複数のCPU,ASICなどのハードウェア,またはそれらの組み合わせで実行されてもよい。また,実施の形態に開示されている処理は,その処理を実行するためのプログラムを記録した記録媒体,または方法等の種々の態様で実現することができる。   The processing disclosed in the embodiments may be executed by a single CPU, a plurality of CPUs, hardware such as an ASIC, or a combination thereof. Further, the processing disclosed in the embodiment can be realized in various modes such as a recording medium or a method recording a program for executing the processing.

21 読取ヘッド
31 CPU
100 スキャナ
21 Read head 31 CPU
100 scanner

Claims (11)

画像を読み取る読取部と,
制御部と,
を備え,
前記制御部は,
前記読取部に画像を読み取らせる読取処理と,
前記読取処理にて読み取った画像データから,原稿のエッジの情報であるエッジデータを取得するエッジ取得処理と,
前記エッジ取得処理にて取得された前記エッジデータに基づいて,原稿の主走査方向の端部が前記読取部の読取範囲を超えるか否かを判断する判断処理と,
を実行することを特徴とする読取装置。
A reading unit for reading an image;
A control unit;
With
The controller is
A reading process for causing the reading unit to read an image;
Edge acquisition processing for acquiring edge data, which is edge information of the document, from the image data read by the reading processing;
A determination process for determining whether or not an end of the document in the main scanning direction exceeds a reading range of the reading unit based on the edge data acquired in the edge acquisition process;
The reading apparatus characterized by performing.
請求項1に記載する読取装置において,
前記制御部は,
前記エッジ取得処理にて取得された前記エッジデータに基づいて,原稿の先端角部を抽出する抽出処理を実行し,
前記判断処理では,原稿の先端角部が抽出されていない場合,あるいは原稿の先端角部が,前記読取部の読取範囲の限界から規定距離までの範囲内にある場合に,前記読取部の読取範囲を超えると判断することを特徴とする読取装置。
The reading device according to claim 1,
The controller is
Based on the edge data acquired in the edge acquisition process, an extraction process for extracting the leading edge corner of the document is executed,
In the determination process, when the leading end corner of the document is not extracted or when the leading end corner of the document is within the range from the limit of the reading range of the reading unit to a specified distance, A reading apparatus characterized by determining that the range is exceeded.
請求項1または請求項2に記載する読取装置において,
前記制御部は,
前記エッジ取得処理にて取得された前記エッジデータに基づいて,原稿の傾きを取得する傾き取得処理を実行し,
前記判断処理では,前記傾き取得処理にて取得された前記傾きに基づいて,原稿の主走査方向の端部が前記読取部の読取範囲を超えるか否かを判断することを特徴とする読取装置。
The reading device according to claim 1 or 2,
The controller is
Based on the edge data acquired in the edge acquisition process, an inclination acquisition process for acquiring the inclination of the document is executed,
In the determination process, based on the inclination acquired in the inclination acquisition process, it is determined whether or not the end portion of the document in the main scanning direction exceeds the reading range of the reading unit. .
請求項1から請求項3のいずれか1つに記載する読取装置において,
前記制御部は,
前記エッジ取得処理では,
副走査方向に所定の頻度で,主走査方向に前記エッジデータを取得し,
前記判断処理にて前記読取部の読取範囲を超えると判断された場合,読取範囲を超える位置である超過位置から所定範囲内の領域である境界領域での前記エッジデータを取得する頻度を,前記境界領域以外の領域での前記頻度と比較して,高くすることを特徴とする読取装置。
The reading apparatus according to any one of claims 1 to 3,
The controller is
In the edge acquisition process,
Acquiring the edge data in the main scanning direction at a predetermined frequency in the sub-scanning direction;
When it is determined in the determination process that the reading range of the reading unit is exceeded, the frequency of acquiring the edge data in a boundary region that is a region within a predetermined range from an excess position that is a position exceeding the reading range, A reading apparatus characterized in that the reading frequency is higher than the frequency in an area other than the boundary area.
請求項4に記載する読取装置において,
前記制御部は,
前記エッジ取得処理では,前記エッジデータを用いて取得する原稿の特性と状態との少なくとも一方に応じて,異なる頻度で前記エッジデータを取得することを特徴とする読取装置。
The reading device according to claim 4,
The controller is
In the edge acquisition process, the edge data is acquired at a different frequency according to at least one of a characteristic and a state of a document acquired using the edge data.
請求項1から請求項5のいずれか1つに記載する読取装置において,
前記制御部は,
前記エッジ取得処理にて取得された前記エッジデータのうち,前記判断処理にて読取範囲を超えないと判断された端部側の側辺である特定側辺のエッジデータを用いて,原稿の特性と状態との少なくとも一方を取得する情報取得処理を実行することを特徴とする読取装置。
In the reading device according to any one of claims 1 to 5,
The controller is
Of the edge data acquired in the edge acquisition process, using edge data of a specific side that is a side on the edge side determined not to exceed the reading range in the determination process, the characteristics of the document An information acquisition process for acquiring at least one of a state and a state is performed.
請求項6に記載する読取装置において,
前記制御部は,
前記情報取得処理には,前記判断処理にて否定判断された場合に,原稿の先端側のエッジデータと前記特定側辺のエッジデータとを用いて原稿の傾きを取得し,前記判断処理にて肯定判断された場合に,原稿の先端側のエッジデータを用いて原稿の傾きを取得する処理が含まれることを特徴とする読取装置。
The reading device according to claim 6,
The controller is
In the information acquisition process, when a negative determination is made in the determination process, the inclination of the document is acquired using the edge data on the leading edge side of the document and the edge data on the specific side, and the determination process A reading apparatus, comprising: processing for obtaining an inclination of a document by using edge data on a leading end side of the document when an affirmative determination is made.
請求項6または請求項7に記載する読取装置において,
前記制御部は,
前記情報取得処理では,前記判断処理にて否定判断された場合に,前記特定側辺のエッジデータを回転斜行量の取得に用い,前記判断処理にて肯定判断された場合に,前記特定側辺のエッジデータを回転斜行量の取得に用いないことを特徴とする読取装置。
In the reading device according to claim 6 or 7,
The controller is
In the information acquisition process, when a negative determination is made in the determination process, the edge data of the specific side is used to acquire the rotation skew amount, and when the determination process is positive, the specific side A reading apparatus, wherein edge data of a side is not used for acquiring a rotational skew amount.
請求項6から請求項8のいずれか1つに記載する読取装置において,
前記制御部は,
前記情報取得処理では,前記判断処理にて否定判断された場合に,前記特定側辺のエッジデータを原稿の形状の取得に用い,前記判断処理にて肯定判断された場合に,前記特定側辺のエッジデータを原稿の形状の取得に用いないことを特徴とする読取装置。
In the reading device according to any one of claims 6 to 8,
The controller is
In the information acquisition process, when a negative determination is made in the determination process, the edge data of the specific side is used to acquire the shape of the document, and when the determination is positive, the specific side The reading apparatus is characterized in that the edge data is not used for obtaining the shape of the document.
請求項6から請求項9のいずれか1つに記載する読取装置において,
前記制御部は,
前記情報取得処理では,前記判断処理にて否定判断された場合に,前記特定側辺のエッジデータをパンチ穴の位置の取得に用い,前記判断処理にて肯定判断された場合に,前記特定側辺のエッジデータをパンチ穴の位置の取得に用いないことを特徴とする読取装置。
In the reading device according to any one of claims 6 to 9,
The controller is
In the information acquisition process, when a negative determination is made in the determination process, the edge data of the specific side is used to acquire the position of the punch hole, and when the determination process is positive, the specific side A reading apparatus, wherein edge data of a side is not used for acquiring a punch hole position.
情報処理装置に,
原稿の画像データを取得する原稿取得処理と,
前記原稿取得処理にて取得した画像データから,原稿のエッジの情報であるエッジデータを取得するエッジ取得処理と,
前記エッジ取得処理にて取得された前記エッジデータに基づいて,原稿の主走査方向の端部が読取範囲を超えているか否かを判断する判断処理と,
を実行させることを特徴とするプログラム。
In the information processing device,
A document acquisition process for acquiring image data of the document;
Edge acquisition processing for acquiring edge data, which is edge information of the document, from the image data acquired in the document acquisition processing;
A determination process for determining whether or not an end of the document in the main scanning direction exceeds the reading range based on the edge data acquired in the edge acquisition process;
A program characterized by having executed.
JP2014091354A 2014-04-25 2014-04-25 Reader and program Active JP6409317B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014091354A JP6409317B2 (en) 2014-04-25 2014-04-25 Reader and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014091354A JP6409317B2 (en) 2014-04-25 2014-04-25 Reader and program

Publications (2)

Publication Number Publication Date
JP2015211321A true JP2015211321A (en) 2015-11-24
JP6409317B2 JP6409317B2 (en) 2018-10-24

Family

ID=54613232

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014091354A Active JP6409317B2 (en) 2014-04-25 2014-04-25 Reader and program

Country Status (1)

Country Link
JP (1) JP6409317B2 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10341332A (en) * 1997-06-10 1998-12-22 Minolta Co Ltd Image-forming device
JP2006335525A (en) * 2005-06-02 2006-12-14 Konica Minolta Business Technologies Inc Sheet carrying device and document reading device
JP2007228032A (en) * 2006-02-21 2007-09-06 Matsushita Electric Ind Co Ltd Image reader and image forming apparatus equipped with it
JP2010273324A (en) * 2009-04-23 2010-12-02 Sharp Corp Control apparatus, image reading apparatus, image forming apparatus, control method of image reading apparatus, program, and recording medium
JP2013098720A (en) * 2011-10-31 2013-05-20 Brother Ind Ltd Image reader

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10341332A (en) * 1997-06-10 1998-12-22 Minolta Co Ltd Image-forming device
JP2006335525A (en) * 2005-06-02 2006-12-14 Konica Minolta Business Technologies Inc Sheet carrying device and document reading device
JP2007228032A (en) * 2006-02-21 2007-09-06 Matsushita Electric Ind Co Ltd Image reader and image forming apparatus equipped with it
JP2010273324A (en) * 2009-04-23 2010-12-02 Sharp Corp Control apparatus, image reading apparatus, image forming apparatus, control method of image reading apparatus, program, and recording medium
JP2013098720A (en) * 2011-10-31 2013-05-20 Brother Ind Ltd Image reader

Also Published As

Publication number Publication date
JP6409317B2 (en) 2018-10-24

Similar Documents

Publication Publication Date Title
US8427714B2 (en) Image-reading device
JP5698396B1 (en) Image reading apparatus, image reading method, and program
US9531897B2 (en) Scanner and scanning method
US10694098B2 (en) Apparatus displaying guide for imaging document, storage medium, and information processing method
JP6459384B2 (en) Image reading apparatus, program, and read image correction method
JP2015043158A (en) Image processing apparatus, image processing method, and program
CN110115020B (en) Image reading apparatus
JP6471423B2 (en) Reader and program
US10225436B2 (en) Image processing apparatus, and method and computer-readable medium therefor
JP2015198390A (en) Image reading device and image forming apparatus
JP6409317B2 (en) Reader and program
JP2015198327A (en) Image reading device, image reading method, and computer program
JP5516539B2 (en) Reading apparatus and program
JPWO2017056799A1 (en) Image reading apparatus and image forming apparatus
US8717646B2 (en) Image reading device capable of performing rotation process on read image appropriately
US11343406B2 (en) Image reading apparatus, image reading system, image reading method, and non-transitory computer-readable storage medium storing program
US20200076976A1 (en) Reading apparatus and non-transitory computer-readable storage medium storing program
JP6428057B2 (en) Reading device, notification method, and program
JP2019193050A (en) Image processing apparatus, image processing method, and image processing program
JP2015119239A (en) Information processing program, image reader, and image reading system
JP7006145B2 (en) Image processing device, image processing method
JP2017201755A (en) Reading device
JP6950236B2 (en) Computer programs and image processing equipment
JP2017092561A (en) Image reading device and image reading method
JP2017073727A (en) Image reading device and image forming apparatus

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170421

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20180213

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20180403

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20180528

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20180828

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20180910

R150 Certificate of patent or registration of utility model

Ref document number: 6409317

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150