JP4924416B2 - Image reading device - Google Patents

Image reading device Download PDF

Info

Publication number
JP4924416B2
JP4924416B2 JP2007340769A JP2007340769A JP4924416B2 JP 4924416 B2 JP4924416 B2 JP 4924416B2 JP 2007340769 A JP2007340769 A JP 2007340769A JP 2007340769 A JP2007340769 A JP 2007340769A JP 4924416 B2 JP4924416 B2 JP 4924416B2
Authority
JP
Japan
Prior art keywords
document
edge
area
reading
document table
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2007340769A
Other languages
Japanese (ja)
Other versions
JP2009164805A (en
Inventor
博章 藤井
哲也 加藤
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 JP2007340769A priority Critical patent/JP4924416B2/en
Priority to US12/341,963 priority patent/US8284463B2/en
Publication of JP2009164805A publication Critical patent/JP2009164805A/en
Application granted granted Critical
Publication of JP4924416B2 publication Critical patent/JP4924416B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Facsimile Scanning Arrangements (AREA)
  • Editing Of Facsimile Originals (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To suppress an adverse influence of wrong detection of a document edge on postprocessing using a detection result with respect to an image reader. <P>SOLUTION: A multifunction machine pre-scans a partial area on a document table to read a lower area of a document placed on the document table, converts image data as a read result into edge image data, and extracts an edge point group corresponding to document edges from the edge image data. Further, the extracted edge point group is linearly approximated to estimate a document area of the edge image data. Then the occupation rate of edge points in an area other than the document area of the edge image data is calculated (S610) and when the calculated occupation rate is less than a threshold, it is evaluated that the accuracy of the estimated document area is high (S630), but when the occupation rate exceeds the threshold, it is evaluated that the accuracy is low (S660). Then when it is evaluated that the accuracy is low, it is estimated that the size of the document placed on the document table is a predetermined basic size (S670). <P>COPYRIGHT: (C)2009,JPO&amp;INPIT

Description

本発明は、読取ユニットを搬送し、原稿台に写る画像を、読取ユニットに読み取らせることにより、原稿台上に載置された原稿の読取画像を表す画像データを生成する画像読取装置に関する。   The present invention relates to an image reading apparatus that generates image data representing a read image of a document placed on a document table by conveying the reading unit and causing the reading unit to read an image on a document table.

従来、画像読取装置としては、読取ガラス下に読取ユニットを備え、読取ガラス下で読取ユニットを搬送しつつ、その搬送時に読取ユニットに読取動作を実行させることにより、読取ガラス上に配置された原稿を読み取り、原稿の読取画像を表す画像データを生成する画像読取装置が知られている。   2. Description of the Related Art Conventionally, an image reading apparatus includes a reading unit below a reading glass, and conveys the reading unit under the reading glass, and causes the reading unit to perform a reading operation when the reading unit is transported, whereby the document placed on the reading glass. An image reading apparatus that generates image data representing a read image of a document is known.

画像読取装置がコピー機能を有するものである場合、上記生成された画像データは、例えば、印刷処理に供される。即ち、読取画像を表す画像データが印刷処理に供されることで、記録紙には、読み取られた原稿のコピー画像が印刷される。このような、コピー機能を有する画像読取装置としては、コピー機能の他、プリンタ機能やファックス(FAX)機能などを有したディジタル複合機が知られている。   When the image reading apparatus has a copy function, the generated image data is used for, for example, a printing process. That is, the image data representing the read image is subjected to a printing process, whereby a copy image of the read original is printed on the recording paper. As such an image reading apparatus having a copy function, a digital multifunction peripheral having a printer function, a fax (FAX) function, and the like in addition to a copy function is known.

また、画像読取装置としては、プレスキャンにより、読取ガラス上の原稿が載置された領域を把握し、本スキャン時には、読取領域を、読取ガラス下全域ではなく、原稿が載置された領域に限定し、この読取領域において、読取ユニットを搬送し、原稿を読み取るものが知られている。   In addition, the image reading device grasps the area where the document is placed on the reading glass by pre-scanning, and at the time of the main scanning, the reading area is not the entire area under the reading glass but the area where the document is placed. In this reading area, a reading unit that conveys a reading unit and reads a document is known.

この他、画像読取装置としては、読取ユニットによる原稿の読取結果に基づき、原稿のサイズを検出するものが知られている。具体的には、読取結果から原稿のエッジを検出し、その検出結果から原稿サイズを検出するものが知られている(特許文献1〜4参照)。   In addition, an image reading apparatus that detects the size of a document based on the result of reading the document by a reading unit is known. Specifically, there is known a technique for detecting an edge of a document from a reading result and detecting a document size from the detection result (see Patent Documents 1 to 4).

このようにして得られる原稿サイズの検出結果は、例えば、本スキャン時の読取領域の自動設定動作や、コピー時の変倍率の自動設定動作に用いられる。例えば、検出した原稿サイズと記録紙サイズとから、原稿サイズと記録紙サイズの比に合わせて、変倍率を設定し、設定した変倍率に合わせて、読取画像を拡大/縮小し、原稿のコピー画像を、記録紙に、その用紙サイズに合わせた倍率で印刷するといった具合である。
特開2004−201240号公報 特開2005−285010号公報 特開平7−245681号公報 特開2001−036696号公報
The document size detection result obtained in this way is used, for example, for an automatic setting operation of a reading area at the time of a main scan and an automatic setting operation of a scaling factor at the time of copying. For example, from the detected document size and recording paper size, set the scaling ratio according to the ratio of the document size to the recording paper size, enlarge / reduce the scanned image according to the set scaling ratio, and copy the document For example, an image is printed on a recording paper at a magnification according to the paper size.
JP 2004-201240 A JP 2005-285010 A Japanese Patent Application Laid-Open No. 7-245681 JP 2001-036696 A

しかしながら、読取ユニットによる原稿の読取結果に基づいて、原稿サイズを検出する方法では、原稿内の罫線等を原稿エッジであると誤検出する可能性があるといった問題があった。   However, the method of detecting the document size based on the result of reading the document by the reading unit has a problem that a ruled line in the document may be erroneously detected as the document edge.

原稿エッジの検出方法としては、読取ユニットで読み取った読取画像データを、画像フィルタ(所謂微分フィルタ)に通して、読取画像データを、エッジ画像を表すエッジ画像データに変換し、このエッジ画像データから、原稿の外縁である原稿エッジを検出する方法が知られているが、読取画像データを画像フィルタに通した場合には、原稿の外縁でエッジ点の連続するパターンが検出される他、原稿内の罫線がある地点においても、原稿の外縁と似た連続するエッジ点のパターンが検出される。   As a method for detecting a document edge, read image data read by a reading unit is passed through an image filter (so-called differential filter), and the read image data is converted into edge image data representing an edge image. A method for detecting the document edge, which is the outer edge of the document, is known. However, when the scanned image data is passed through an image filter, a continuous pattern of edge points is detected at the outer edge of the document. Even at the point where there is a ruled line, a pattern of continuous edge points similar to the outer edge of the document is detected.

一方で、読取対象の原稿については、必ずしも、その原稿の全てが原稿台の読取可能領域内に収まっているとは限らない。例えば、ユーザによる原稿の置き方が雑であったために、原稿の端が読取可能領域から外れてしまう場合や、新聞等のように読取対象の原稿が大きすぎて、原稿の端が読取可能領域に収まらない場合等がある。   On the other hand, the document to be read does not necessarily have to be entirely within the readable area of the document table. For example, when the user places the document in a complicated manner, the edge of the document is out of the readable area, or the document to be read is too large, such as a newspaper, and the edge of the document is readable. May not fit in.

従って、原稿の端が読み取られていないのにも拘わらず、読取結果のエッジ画像データから原稿エッジを検出して、原稿サイズを検出しようとすると、原稿サイズを誤検出してしまうことになる。そして、このような原稿サイズの誤検出が発生した場合には、例えば、変倍率の設定ミスが生じて、コピー機能が上手く働かない事態が生じる。   Therefore, if the document edge is detected from the edge image data as a result of reading even though the edge of the document is not read, the document size is erroneously detected. If such an erroneous detection of the document size occurs, for example, a variable magnification setting error occurs and the copy function does not work well.

本発明は、こうした問題に鑑みなされたものであり、画像読取装置において、原稿エッジの誤検出により、検出結果を用いた後続の処理(コピー動作等)に、悪影響が及ぶのを抑えることを目的とする。   The present invention has been made in view of these problems, and an object of the present invention is to suppress an adverse effect on subsequent processing (such as a copying operation) using a detection result due to erroneous detection of an original edge in an image reading apparatus. And

かかる目的を達成するためになされた明は、読取対象の原稿が載置される透明な原稿台下において読取ユニットを搬送し、原稿台に写る画像を、読取ユニットに読み取らせることにより、原稿台に載置された原稿の読取画像を表す画像データを生成する画像読取装置であって、抽出手段と、外縁認識手段と、確度評価手段と、を備えるものである。 Is made the inventions in order to achieve the above object, carries the reading unit in a transparent document his honor the original to be read is placed, an image caught on the document table, by reading the reading unit, document An image reading apparatus that generates image data representing a read image of a document placed on a table, and includes an extraction unit, an outer edge recognition unit, and an accuracy evaluation unit.

抽出手段は、読取ユニットの読取結果である画像データを、エッジ画像を表すエッジ画像データに変換し、当該エッジ画像データの中から、稿台に載置された原稿の辺に対応するエッジ点群として推定されるエッジ点群を抽出する。 Extraction means, read image data is a result of reading unit and converted into an edge image data representing an edge image, from among the edge image data, the edge points corresponding to the edges of the document placed on the original manuscript platform The edge point group estimated as a group is extracted.

一方、外縁認識手段は、抽出手段により抽出された原稿の各辺に対応するエッジ点群を直線近似することにより原稿の外縁を認識し、確度評価手段は、外縁認識手段により認識された原稿の外縁より原稿台の縁側領域のエッジ点の分布に基づき、外縁認識手段により認識された外縁の確度の高低を評価する。   On the other hand, the outer edge recognizing means recognizes the outer edge of the original by linearly approximating the edge point group corresponding to each side of the original extracted by the extracting means, and the accuracy evaluating means determines the accuracy of the original recognized by the outer edge recognizing means. Based on the distribution of edge points in the edge side area of the document table with respect to the outer edge, the accuracy of the outer edge recognized by the outer edge recognition means is evaluated.

画像読取装置の構成としては、外縁認識手段により認識された原稿の外縁の情報に基づき、原稿サイズや原稿の傾き、原稿台における原稿の載置領域を推定し、これらの情報に基づき、本スキャンを実行する構成や、読取結果から原稿のデータを抽出し出力する構成などが考えられるが、このような構成の画像読取装置においては、外縁認識手段が原稿の外縁を誤認識しているにも関わらず、後続の処理を実行すると、その後続の処理にも誤りが生じて、ユーザの所望する処理結果が得られない。   The configuration of the image reading apparatus is based on information on the outer edge of the original recognized by the outer edge recognition means, estimating the original size, the inclination of the original, and the area on which the original is placed on the original table. In the image reading apparatus having such a configuration, the outer edge recognition unit erroneously recognizes the outer edge of the document. Regardless, if the subsequent process is executed, an error also occurs in the subsequent process, and the process result desired by the user cannot be obtained.

従って、外縁認識手段が誤認識をしていると推定される場合には、後続処理の内容を切り替えたり、誤認識の可能性があることをユーザに報知するのが好ましいが、従来では、その誤認識を判定する術がないため、後続処理に悪影響を与える結果となっていた。   Therefore, when it is presumed that the outer edge recognition means is misrecognizing, it is preferable to switch the contents of subsequent processing or notify the user that there is a possibility of misrecognition. Since there is no way to determine misrecognition, the subsequent processing is adversely affected.

そこで、本発明では、確度評価手段を設けて、外縁認識手段により認識された原稿の外縁より原稿台の縁側領域のエッジ点の分布に基づき、外縁認識手段により認識された外縁の確度の高低を評価するようにした。   Therefore, in the present invention, the accuracy evaluation means is provided, and the accuracy of the outer edge recognized by the outer edge recognition means is determined based on the distribution of the edge points in the edge side area of the document table from the outer edge of the original recognized by the outer edge recognition means. I tried to evaluate.

原稿台に載置された原稿の外側領域においては、埃等を除いては何もないのが通常であり、原稿の外縁が正確に認識されていれば、その認識された外縁より外側には、エッジ点が存在しないはずである。従って、本発明のように確度評価をすれば、外縁認識手段により認識された外縁が正確なものであるか否かを高精度に評価することができる。   In the outer area of the document placed on the document table, there is usually nothing except dust, and if the outer edge of the document is recognized correctly, it will be outside the recognized outer edge. , There should be no edge points. Therefore, if accuracy evaluation is performed as in the present invention, it is possible to evaluate with high accuracy whether or not the outer edge recognized by the outer edge recognition means is accurate.

結果、本発明によれば、認識結果の確からしさに応じて、後続処理の内容を切り替えることができ、誤認識が後続処理に及ぼす悪影響を抑え、誤認識による不満の及びにくい画像読取装置をユーザに提供することができるのである。   As a result, according to the present invention, the content of the subsequent processing can be switched according to the accuracy of the recognition result, the adverse effect of erroneous recognition on the subsequent processing can be suppressed, and an image reading apparatus that is less likely to be dissatisfied by erroneous recognition can be used by the user. Can be provided.

尚、上述の確度評価手段は、外縁認識手段により認識された原稿の外縁より原稿台の縁側領域に分布するエッジ点の量を算出して、算出したエッジ点の量が、閾値を超えている場合には、外縁認識手段により認識された外縁の確度が低いと評価し、上記算出したエッジ点の量が閾値以下である場合には、確度が高いと評価する構成にすることができThe accuracy evaluation unit described above calculates the amount of edge points distributed in the edge side region of the document table from the outer edge of the document recognized by the outer edge recognition unit, and the calculated amount of edge points exceeds the threshold value. If evaluates the been accuracy of the outer edge is less recognized by the outer margin recognition unit, when the amount of edge points calculated above is equal to or smaller than the threshold, Ru can be configured to evaluate the probable.

また、上述の画像読取装は、次のように構成することができる。
即ち、画像読取装置は、読取ユニットが読取可能な原稿台の領域である読取可能領域の内、一部領域において読取ユニットを搬送し、この一部領域において読取ユニットに読取動作を実行させるプレスキャン手段を備え、抽出手段が、プレスキャン手段の動作によって得られた読取ユニットの読取結果である画像データを、エッジ画像データに変換し、当該エッジ画像データの中から、稿台に載置された原稿の辺に対応するエッジ点群として推定されるエッジ点群を抽出する構成にすることができ
The image reading equipment described above can be constructed as follows.
In other words, the image reading apparatus transports the reading unit in a part of the readable area that is an area of the document table that can be read by the reading unit, and causes the reading unit to perform a reading operation in this part of the area. comprising means, extracting means, the image data is a result of reading obtained reading unit by the operation of the pre-scanning means, is converted into an edge image data, from among the edge image data is placed on the original manuscript platform and Ru can be configured to extract the edge point group estimated as edge points corresponding to edges of the document.

画像読取装置としては、原稿の一部領域のみを読み取って、その読取結果から原稿サイズ等を推定する構成が考えられるが、原稿の全体像が写っていない画像データに基づいて、原稿の外縁を認識する場合には、原稿全体を読み取って、その読取結果から原稿の外縁を認識する手法よりも、その精度が劣る。   As an image reading apparatus, a configuration in which only a partial area of a document is read and the size of the document is estimated from the read result can be considered, but the outer edge of the document is determined based on image data in which the entire image of the document is not captured. In the case of recognition, the accuracy is inferior to the method of reading the entire original and recognizing the outer edge of the original from the read result.

従って、このような画像読取装置に、本発明の概念を適用すれば、誤認識による問題を、処理の切り替え等により緩和することができ、利便性の高い画像読取装置をユーザに提供することができる。   Therefore, if the concept of the present invention is applied to such an image reading apparatus, the problem due to misrecognition can be alleviated by switching processing, and a highly convenient image reading apparatus can be provided to the user. it can.

また、一部領域のプレスキャンにて原稿の外縁を認識するようにすれば、読取可能領域全体をプレスキャンして原稿の外縁を認識する手法よりも、効率的に原稿サイズ等を推定することができるので、本発明を、このような画像読取装置に適用すれば、処理速度が高く、且つ、誤動作による悪影響の少ない画像読取装置を、ユーザに提供することができる。   Also, if the outer edge of the document is recognized by pre-scanning a part of the area, the document size and the like can be estimated more efficiently than the method of pre-scanning the entire readable area and recognizing the outer edge of the document. Therefore, if the present invention is applied to such an image reading apparatus, it is possible to provide the user with an image reading apparatus having a high processing speed and less adverse effects due to malfunction.

この他、一部領域のプレスキャンにて原稿の外縁を認識するように画像読取装置を構成する場合には、具体的に、次のように画像読取装置を構成されるとよい。
即ち、原稿台は、四角形状にされ、四つ角の内、一つの特定の角が、原稿の角を合わせるべき位置として定められたものとするのがよく、更に、プレスキャン手段は、原稿台における特定の角から延びる原稿台の一辺を構成する原稿台の端縁から、原稿台内側に所定距離離れた位置までの領域であって読取可能領域に該当する部位を、上記一部領域とし、当該領域において、読取ユニットを搬送し、読取ユニットに読取動作を実行させる構成にされるとよ
In addition, when the image reading apparatus is configured to recognize the outer edge of the document by pre-scanning of a partial area, specifically, the image reading apparatus may be configured as follows.
That is, it is preferable that the document table has a quadrangular shape, and one of the four corners is defined as a position where the corners of the document should be aligned. The part corresponding to the readable area, which is an area from the edge of the document table constituting one side of the document table extending from a specific corner to a position a predetermined distance away from the inside of the document table, is defined as the partial region. in the region, it carries the reading unit, has good when it is in the configuration to execute the reading operation to the reading unit.

このように画像読取装置を構成すれば、プレスキャン結果としての画像データに、原稿台に載置された原稿の画像が写りやすくなり、この画像データから、原稿の外縁を正確に把握し易くなる。   If the image reading apparatus is configured in this manner, the image of the document placed on the document table can be easily captured in the image data as the prescan result, and the outer edge of the document can be accurately grasped from the image data. .

また、上述の画像読取装置には、確度評価手段により確度が高いと評価されると、外縁認識手段により認識された原稿の外縁から原稿台に載置された原稿のサイズを推定するが、確度評価手段により確度が低いと評価されると、原稿台に載置された原稿のサイズが、予め定められたサイズであると推定する原稿サイズ推定手段を設けるとよ。特に、原稿サイズ推定手段は、確度評価手段により確度が低いと評価されると推定される原稿サイズを、ユーザの指示に従って切り替えられる構成にされると一層好ましい。 The image reading apparatus estimates the size of the document placed on the document table from the outer edge of the document recognized by the outer edge recognition unit when the accuracy evaluation unit evaluates that the accuracy is high. When accuracy is evaluated as low by the evaluation unit, the size of the document placed on the document table is not good when providing the document size estimation means for estimating that the predetermined size. In particular, it is more preferable that the manuscript size estimation unit is configured to switch the manuscript size estimated to be evaluated as having low accuracy by the accuracy evaluation unit in accordance with a user instruction.

確度評価手段が評価した確度の高低により、原稿サイズの推定手法を、このように切り替えるように、画像読取装置を構成すれば、外縁認識手段の誤認識が及ぼす後続処理への悪影響を抑えることができる。   If the image reading apparatus is configured so that the document size estimation method is switched in this way depending on the level of accuracy evaluated by the accuracy evaluation unit, it is possible to suppress adverse effects on subsequent processing caused by erroneous recognition of the outer edge recognition unit. it can.

例えば、外縁認識手段による認識結果の確度が低い場合でも、その認識結果に基づいて原稿サイズを推定する場合には、真の原稿サイズに対して原稿サイズ推定手段がどのように原稿サイズを推定するのかについて予測不能であり、その推定結果が後続処理に及ぼす影響をコントロールできないが、外縁認識手段による認識結果の確度が低い場合に、その認識結果に基づいて原稿サイズを推定せずに、原稿サイズを、特定の原稿サイズであると推定すれば、その推定結果が真の原稿サイズに一致しているか否かに関わらず、当該推定結果が後続処理に及ぼす影響をコントロールできる。   For example, even when the accuracy of the recognition result by the outer edge recognition unit is low, when the document size is estimated based on the recognition result, how the document size estimation unit estimates the document size with respect to the true document size. However, if the accuracy of the recognition result by the outer edge recognition means is low, the document size is not estimated based on the recognition result. Is estimated to be a specific document size, the influence of the estimation result on the subsequent processing can be controlled regardless of whether or not the estimation result matches the true document size.

従って、この発明によれば、原稿サイズの推定結果が正しいか否かに依らず、外縁認識手段の誤認識が、後続処理に及ぼす影響を抑えることができるのである。具体的に、プレスキャンにより得られた原稿外縁の認識結果の確度が低い場合に、原稿台に載置された原稿のサイズが最大サイズであると推定すれば、読取領域を自動設定する画像読取装置において、本スキャン時の読取領域が、外縁認識手段の誤認識により正しい読取領域よりも狭くなるのを防止することができる。結果、本スキャン時において、ユーザが所望する原稿の画像全体を、正しく読み取ることができる。   Therefore, according to the present invention, regardless of whether or not the document size estimation result is correct, it is possible to suppress the influence of the erroneous recognition of the outer edge recognition means on the subsequent processing. Specifically, when the accuracy of the recognition result of the document outer edge obtained by the pre-scan is low, if the size of the document placed on the document table is estimated to be the maximum size, the image reading that automatically sets the reading area is performed. In the apparatus, it is possible to prevent the reading area at the time of the main scan from becoming narrower than the correct reading area due to erroneous recognition by the outer edge recognition unit. As a result, the entire image of the original desired by the user can be read correctly during the main scan.

また、確度評価手段により確度が低いと評価される場合に原稿サイズ推定手段により推定する原稿サイズを、ユーザの指示に従って切り替えられるように、画像読取装置を構成すれば、ユーザに、誤認識による悪影響の一番少ない原稿サイズを指定させることができて、外縁認識手段の誤認識が及ぼす後続処理への悪影響を効果的に抑えることができる。   Further, if the image reading apparatus is configured so that the document size estimated by the document size estimation unit can be switched according to the user's instruction when the accuracy evaluation unit evaluates that the accuracy is low, the user is adversely affected by the erroneous recognition. Therefore, the adverse effect on the subsequent processing caused by the erroneous recognition of the outer edge recognition means can be effectively suppressed.

この他、一部領域のプレスキャンにて原稿の外縁を認識する場合には、次のように、画像読取装置を構成して、原稿サイズの推定を行うとよい。
即ち、抽出手段は、原稿台に載置された原稿の三辺の夫々について、エッジ画像データの中から、この辺に対応するエッジ点群として推定されるエッジ点群を抽出する構成にされ、外縁認識手段は、抽出手段により抽出された各辺に対応するエッジ点群を直線近似して得られる三本の直線が交わる二つの交点を、原稿台に載置された原稿の角であると認識する構成にされるのがよい。
In addition, when recognizing the outer edge of the document by pre-scanning of a partial area, it is preferable to configure the image reading apparatus and estimate the document size as follows.
That is, the extraction means is configured to extract an edge point group estimated as an edge point group corresponding to this side from the edge image data for each of the three sides of the document placed on the document table. The recognizing unit recognizes two intersection points where three straight lines obtained by linear approximation of the edge point group corresponding to each side extracted by the extracting unit are corners of the document placed on the document table. It is good to be configured to do.

また、原稿サイズ推定手段は、確度評価手段により確度が高いと評価されると、原稿台に載置された原稿が定型の用紙であるとの仮定の下で、外縁認識手段により原稿の角であると認識された二つの交点間の距離に基づき、原稿台に載置された原稿のサイズを推定し、確度評価手段により確度が低いと評価されると、原稿台に載置された原稿のサイズが、予め定められたサイズであると推定する構成にされるのがよFurther, when the accuracy evaluation unit evaluates that the accuracy is high, the manuscript size estimation unit assumes that the manuscript placed on the manuscript table is a standard sheet, and the outer edge recognition unit uses the corner of the manuscript. The size of the document placed on the platen is estimated based on the distance between the two intersections recognized as being present, and if the accuracy is evaluated to be low, the accuracy of the document placed on the platen is estimated. size, has good that is in the configuration of estimating that the predetermined size.

このように画像読取装置を構成すれば、一部領域のプレスキャン結果からでも、原稿サイズとして、原稿の縦幅及び横幅の両方を導出することができ、一部領域のプレスキャン結果から、原稿台に載置された原稿全体の外形を概ね正確に把握することができる。   If the image reading apparatus is configured in this manner, both the vertical and horizontal widths of the document can be derived as the document size even from the pre-scan result of the partial area, and the original can be derived from the pre-scan result of the partial area. The outline of the entire document placed on the table can be grasped almost accurately.

また、原稿台の特定の角が原稿の角を合わせるべき位置として定められた画像読取装置であって上述のプレスキャン手段を備える画像読取装置においては、具体的に抽出手段及び確度評価手段を次のように構成されるとよい。   Further, in an image reading apparatus in which a specific corner of the document table is determined as a position where the corner of the document should be aligned and provided with the above-described pre-scanning means, the extraction means and the accuracy evaluation means are specifically described below. It is good to be configured as follows.

即ち、抽出手段は、「原稿台における上記特定の角から延びる原稿台の辺」に対向する「原稿台に載置された原稿の辺」に対応するエッジ点群として推定されるエッジ点群をエッジ画像データの中から抽出する構成にされるのがよく、確度評価手段は、抽出手段により抽出された「原稿台における上記特定の角から延びる原稿台の辺」に対向する「原稿台に載置された原稿の辺」に対応するエッジ点群の近似直線と、原稿台の外縁と、により囲まれる領域に対応するエッジ画像データの領域において、エッジ点群が占める量を、外縁認識手段により認識された原稿の外縁より原稿台の縁側領域に分布するエッジ点の量として算出する構成にされるとよIn other words, the extracting means calculates an edge point group estimated as an edge point group corresponding to the “side of the document placed on the document table” opposite to the “side of the document table extending from the specific corner on the document table”. being in the configuration to be extracted from the edge image data is good, accuracy evaluating unit mounting "the platen facing the extracted by the extraction means" platen sides extending from said specific angular in platen " The amount of the edge point group in the area of the edge image data corresponding to the area surrounded by the approximate straight line of the edge point group corresponding to “the side of the placed document” and the outer edge of the document table is determined by the outer edge recognition unit. It has good Once the structure is calculated as the amount of the recognized edge points distributed on the document table of the edge region of the outer edge of the document.

原稿を特定の角に合わせるように定められた画像読取装置においては、ユーザにより載置される原稿の位置が、原稿台上において概ね定まるため、上述した一部領域のプレスキャン動作にて、原稿の像を捉えて原稿サイズ等を推定することが可能であるが、この場合には、上記特定の角に合わせられる原稿の角から延びる原稿の辺がプレスキャンにより読み取り辛くなる。   In an image reading apparatus that is set to align a document with a specific corner, the position of the document placed by the user is generally determined on the document table. However, in this case, it is difficult to read the side of the document extending from the corner of the document that matches the specific corner by prescanning.

即ち、上記特定の角に合わせられる原稿の角から延びる原稿の辺が原稿台の読取可能領域からからはみ出しやすくなり、プレスキャンにより当該辺を読み取ることができず、その結果として、エッジ画像データから、原稿内に描写された罫線等、原稿の辺以外の部位のエッジ点が、原稿の辺に対応するエッジ点群として抽出されてしまう可能性が高くなる。   That is, the side of the document extending from the corner of the document that is aligned with the specific corner is likely to protrude from the readable area of the document table, and the side cannot be read by pre-scanning. There is a high possibility that edge points other than the sides of the document, such as ruled lines drawn in the document, will be extracted as edge point groups corresponding to the sides of the document.

従って、このような画像読取装置に、上述の確度評価手段を設ければ、「原稿台における上記特定の角から延びる原稿台の辺」に対向する「原稿台に載置された原稿の辺」に対応するエッジ点が正しく抽出されたか否かを評価することができ、結果として、外縁認識手段の認識結果の確度を正しく評価することができて、誤認識による後続処理への悪影響を極力抑えることができるのである。   Therefore, if the above-described accuracy evaluation means is provided in such an image reading apparatus, “the side of the document placed on the document table” opposite to “the side of the document table extending from the specific corner of the document table”. It is possible to evaluate whether or not the edge point corresponding to is correctly extracted, and as a result, it is possible to correctly evaluate the accuracy of the recognition result of the outer edge recognition means, and minimize the adverse effect on the subsequent processing due to erroneous recognition. It can be done.

また、上述した原稿サイズ推定手段に関する発明は、原稿サイズ推定手段により推定された原稿サイズの情報に基づき、読取ユニットによる読取領域を決定する読取領域決定手段と、読取対象領域決定手段により決定された読取領域において、読取ユニットを搬送し、読取ユニットに読取動作を実行させることにより、原稿台に載置された原稿の読取画像を表す画像データを生成する本スキャン手段と、を備える画像読取装置に適用することができる。   The invention relating to the document size estimation means described above is determined by the reading area determination means for determining the reading area by the reading unit and the reading target area determination means based on the document size information estimated by the document size estimation means. An image reading apparatus comprising: a main scanning unit configured to generate image data representing a read image of a document placed on a document table by conveying the reading unit in the reading region and causing the reading unit to perform a reading operation. Can be applied.

このようにして本スキャンを実行する画像読取装置では、外縁認識手段の誤認識が最終的に読取領域の設定に悪影響を及ぼす可能性があるが、本発明では、外縁認識手段の認識結果の確度が低い場合、原稿サイズを固定サイズに推定するので、外縁認識手段の誤認識が読取領域の設定に悪影響を及ぼすのを従来よりも抑えることができる。   In the image reading apparatus that performs the main scan in this way, erroneous recognition by the outer edge recognition unit may ultimately have an adverse effect on the setting of the reading area. However, in the present invention, the accuracy of the recognition result of the outer edge recognition unit Is low, the document size is estimated to be a fixed size, so that it is possible to suppress the erroneous recognition of the outer edge recognition means from adversely affecting the setting of the reading area.

以下に本発明の実施例について、図面と共に説明する。
図1(a)は、本実施例のディジタル複合機1の構成を表すブロック図である。図1(a)に示すように、本実施例のディジタル複合機1は、画像読取部10、読取制御部20、印刷部30、印刷制御部40、表示操作部50、通信部60、CPU70、RAM80及びフラッシュメモリ90を備え、フラッシュメモリ90に記録されたプログラムに基づきCPU70にて各種処理を実行し、装置全体を統括制御する構成にされている。
Embodiments of the present invention will be described below with reference to the drawings.
FIG. 1A is a block diagram illustrating the configuration of the digital multifunction peripheral 1 according to the present embodiment. As shown in FIG. 1A, the digital multifunction peripheral 1 of this embodiment includes an image reading unit 10, a reading control unit 20, a printing unit 30, a printing control unit 40, a display operation unit 50, a communication unit 60, a CPU 70, A RAM 80 and a flash memory 90 are provided, and various processes are executed by the CPU 70 based on a program recorded in the flash memory 90 to control the entire apparatus.

具体的に、画像読取部10は、図1(b)(c)に示す構成にされている。図1(b)(c)は、画像読取部10の構成を示した説明図である。画像読取部10は、読取対象の原稿Pが載置される透明な板状の読取ガラス11が筐体13に支持された構成にされており、筐体13内の読取ガラス11下に、読取ガラス11に写る画像を主走査方向において光学的に読み取る読取ユニット15と、読取ユニット15を副走査方向に搬送する搬送機構16と、搬送機構16を駆動するモータ17とを備える。   Specifically, the image reading unit 10 is configured as shown in FIGS. FIGS. 1B and 1C are explanatory diagrams showing the configuration of the image reading unit 10. The image reading unit 10 is configured such that a transparent plate-shaped reading glass 11 on which a document P to be read is placed is supported by a housing 13, and the reading is performed below the reading glass 11 in the housing 13. A reading unit 15 that optically reads an image reflected on the glass 11 in the main scanning direction, a conveying mechanism 16 that conveys the reading unit 15 in the sub-scanning direction, and a motor 17 that drives the conveying mechanism 16 are provided.

この画像読取部10は、読取制御部20から入力される制御信号に従って、モータ17の回転力により搬送機構16を駆動し、これにより読取ユニット15を読取ガラス11下で副走査方向(図1(b)(c)に示す点線矢印方向)に搬送すると共に、搬送時において、読取ユニット15に読取動作を実行させる。   The image reading unit 10 drives the transport mechanism 16 by the rotational force of the motor 17 in accordance with a control signal input from the reading control unit 20, thereby causing the reading unit 15 to move under the reading glass 11 in the sub-scanning direction (FIG. 1 ( b) While being conveyed in the direction of the dotted arrow shown in (c), the reading unit 15 is caused to perform a reading operation during conveyance.

尚、読取ユニット15は、読取制御部20に制御され、副走査方向への移動と共に、読取ガラス11に写る画像を、ライン毎に読み取り、その読取画像を表すライン画像信号を出力するコンタクトイメージセンサ(CIS)である。この読取ユニット15から出力されるライン画像信号は、図示しないA/D変換器にてディジタルデータ(ライン画像データ)に変換され、読取制御部20に入力される。   Note that the reading unit 15 is controlled by the reading control unit 20 and, as it moves in the sub-scanning direction, reads an image shown on the reading glass 11 line by line and outputs a line image signal representing the read image. (CIS). The line image signal output from the reading unit 15 is converted into digital data (line image data) by an A / D converter (not shown) and input to the reading control unit 20.

また、画像読取部10には、周知のスキャナと同様、読取ガラス11を被覆可能な蓋が開閉自在に設けられており(図示せず)、読取ユニット15による読取動作の実行時には、ユーザによる手動操作により、読取ガラス11に載置された原稿の上にかぶせられるようにして蓋が閉められる。尚、読取ガラス11と対向する蓋の内側は、原稿の読取画像に蓋の画像が写らないよう白色部材で構成されている。   The image reading unit 10 is provided with a lid (not shown) that can cover the reading glass 11 so as to be openable and closable similarly to a known scanner. When the reading operation by the reading unit 15 is performed, a manual operation by the user is performed. By the operation, the lid is closed so as to be placed on the document placed on the reading glass 11. The inner side of the lid facing the reading glass 11 is made of a white member so that the image of the lid does not appear in the read image of the document.

一方、読取制御部20は、CPU70からの指令に従って読取制御処理を実行し、当該読取制御処理にて、読取ユニット15の副走査方向への移動を制御すると共に、読取ユニット15の読取動作を制御する。   On the other hand, the reading control unit 20 executes a reading control process in accordance with an instruction from the CPU 70, and controls the movement of the reading unit 15 in the sub-scanning direction and controls the reading operation of the reading unit 15 in the reading control process. To do.

この制御により、読取制御部20は、読取ユニット15を読取ガラス11下で副走査方向に搬送しつつ、CPU70から指定された読取ガラス11の読取領域に写る画像を、読取ユニット15に読み取らせ、読取ガラスの読取領域に写る画像を表す画像データを、RAM80に記録する。このような動作により、RAM80には、読取ガラス11の読取領域に載置された原稿Pの読取画像を表す画像データが記録される。   With this control, the reading control unit 20 causes the reading unit 15 to read an image reflected in the reading area of the reading glass 11 designated by the CPU 70 while conveying the reading unit 15 under the reading glass 11 in the sub-scanning direction. Image data representing an image shown in the reading area of the reading glass is recorded in the RAM 80. By such an operation, image data representing a read image of the document P placed in the reading area of the reading glass 11 is recorded in the RAM 80.

尚、読取制御部20は、画像読取部10から入力される各ライン画像データを、一旦内蔵のバッファに蓄積し、各ライン画像データに対してシェーディング補正等の画像処理を実行した後、各ライン画像データを、RAM80に記録する。   The reading control unit 20 temporarily stores each line image data input from the image reading unit 10 in a built-in buffer, performs image processing such as shading correction on each line image data, and then executes each line image data. Image data is recorded in the RAM 80.

この他、印刷部30は、印刷制御部40から入力される制御信号に従い、トレイ(図示せず)に載置された記録紙を、記録位置に搬送し、インクジェット方式やレーザプリンタ方式等の周知の記録方式で、記録紙に、制御信号に対応した画像を形成するものである。   In addition, the printing unit 30 conveys a recording sheet placed on a tray (not shown) to a recording position in accordance with a control signal input from the printing control unit 40, and is well-known such as an ink jet method or a laser printer method. In this recording method, an image corresponding to the control signal is formed on the recording paper.

また、印刷制御部40は、印刷部30を制御して記録紙に画像を形成するものであり、CPU70からの指令に従って、CPU70から指定された印刷対象データに基づく画像を、印刷部30を通じて、記録紙に印刷する。   The print control unit 40 controls the printing unit 30 to form an image on recording paper. In accordance with a command from the CPU 70, an image based on the print target data designated by the CPU 70 is transmitted through the printing unit 30. Print on recording paper.

また、通信部60は、外部機器と通信するためのインタフェース群からなり、USBインタフェース、LANインタフェース、FAXモデム等から構成されている。即ち、複合機1は、通信部60が備えるFAXモデムを通じて外部のFAX装置とFAX通信可能な構成にされ、USBインタフェース又はLANインタフェースを通じて外部のパーソナルコンピュータと通信可能な構成にされている。   The communication unit 60 includes a group of interfaces for communicating with an external device, and includes a USB interface, a LAN interface, a FAX modem, and the like. That is, the multi-function device 1 is configured to be capable of performing FAX communication with an external FAX device through a FAX modem provided in the communication unit 60, and configured to be capable of communicating with an external personal computer through a USB interface or a LAN interface.

この他、表示操作部50は、情報表示用の液晶ディスプレイ(図示せず)と、各種操作キーとを備え、CPU70に制御されて、液晶ディスプレイに、ユーザ向けの情報を表示すると共に、操作キーを通じて入力されたユーザからの指令を、CPU70に入力する。   In addition, the display operation unit 50 includes a liquid crystal display (not shown) for displaying information and various operation keys, and is controlled by the CPU 70 to display information for the user on the liquid crystal display. The command from the user input through is input to the CPU 70.

また、CPU70は、プログラムの実行により、操作キーを通じて入力される指令や通信部60を通じて外部のパーソナルコンピュータ等から入力される指令に従い、コピー機能、FAX機能、スキャナ機能、及び、プリンタ機能等を実現する。   Further, the CPU 70 realizes a copy function, a FAX function, a scanner function, a printer function, and the like according to a command input through an operation key or a command input from an external personal computer or the like through the communication unit 60 by executing a program. To do.

例えば、CPU70は、表示操作部50に設けられた操作キーを通じてユーザからコピー指令が入力されると、複写制御処理(図3参照)を実行して装置内各部を制御し、読取ガラス11上に載置された原稿Pの読取画像を、記録紙に印刷する。詳細には、読取ユニット15による読取結果に基づいて読取ガラス11上に載置された原稿Pのサイズを推定し、推定した原稿サイズと記録紙サイズとから変倍率を設定して、原稿Pの読取画像を、記録紙サイズに適合する大きさに拡大又は縮小し、これを、印刷部30を通じて記録紙に印刷する(自動変倍複写処理)。   For example, when a copy command is input from the user through an operation key provided on the display operation unit 50, the CPU 70 executes a copy control process (see FIG. 3) to control each unit in the apparatus, and on the reading glass 11. The read image of the placed document P is printed on a recording sheet. More specifically, the size of the document P placed on the reading glass 11 is estimated based on the reading result by the reading unit 15, and the scaling ratio is set from the estimated document size and the recording paper size, and the document P The read image is enlarged or reduced to a size suitable for the recording paper size, and this is printed on the recording paper through the printing unit 30 (automatic scaling copying process).

以下、この複写制御処理の内容について具体的に説明するが、それに先駆けては、図2を用いて本実施例の画像読取部10の特徴について説明する。
図2は、読取ガラス11の読取可能領域R0を示した説明図である。当該複合機1においては、一面が開口された長方体状の筐体13の当該開口部において、長方形状のガラス板である読取ガラス11が当該開口部を閉塞するように設けられており、読取ガラス11の周囲が筐体13により支持された構成にされている。
The contents of the copy control process will be specifically described below. Prior to that, the characteristics of the image reading unit 10 of this embodiment will be described with reference to FIG.
FIG. 2 is an explanatory view showing the readable region R0 of the reading glass 11. As shown in FIG. In the multifunction device 1, a reading glass 11 that is a rectangular glass plate is provided so as to close the opening portion in the opening portion of the rectangular housing 13 whose one surface is opened. The periphery of the reading glass 11 is supported by a housing 13.

この読取ガラス11は、筐体13の上面よりも若干筐体13の下側に設けられており、筐体13から露出する読取ガラス11の領域11a(以下、「原稿台」と表現する。)と筐体13との境界BDには、原稿Pを突き当て可能に段差が形成されている(以下、筐体13の読取ガラス11より上方に位置する部位(上記段差を形成する部位)13aを「フレーム」と表現する。)。   The reading glass 11 is provided slightly below the upper surface of the housing 13 from the upper surface of the housing 13, and an area 11 a of the reading glass 11 exposed from the housing 13 (hereinafter, referred to as “original table”). A step is formed at the boundary BD between the casing 13 and the casing 13 so that the original P can be abutted (hereinafter referred to as a portion 13a above the reading glass 11 of the casing 13 (the portion forming the step)). Expressed as “frame”.)

また、画像読取部10においては、読取ユニット15のライン幅と、原稿台11aの大きさとの関係から、四角形状の原稿台11aの全領域よりも若干狭い四角形状の領域R0が、読取ユニット15により原稿を読取可能な読取可能領域R0に定められている。具体的に、読取可能領域R0は、図2において点線で示すように、フレーム13aと読取ガラス11との境界BDから微小量(本実施例では3mm)離れた位置に外周を有した領域となっている。   Further, in the image reading unit 10, due to the relationship between the line width of the reading unit 15 and the size of the document table 11 a, a rectangular region R 0 that is slightly narrower than the entire region of the rectangular document table 11 a is the reading unit 15. Is defined as a readable area R0 where the original can be read. Specifically, the readable area R0 is an area having an outer periphery at a position away from the boundary BD between the frame 13a and the reading glass 11 by a minute amount (3 mm in this embodiment), as indicated by a dotted line in FIG. ing.

また、この画像読取部10においては、フレーム13aの左下部分に、原稿Pの角を突き当てるように指示するマークMKが記されている。尚、本実施例では、マークMKが付された原稿台11aの角を、「左下角」と定義して、この左下角より、主走査方向に離れた地点に位置する原稿台11aの角を「右下角」と定義し、左下角より、副走査方向に離れた地点に位置する原稿台11aの角を「左上角」と定義する。   In the image reading unit 10, a mark MK is instructed in the lower left part of the frame 13a to instruct the corner of the document P to abut. In this embodiment, the corner of the document table 11a to which the mark MK is attached is defined as “lower left corner”, and the corner of the document table 11a located at a point farther in the main scanning direction than the lower left corner is defined. The “lower right corner” is defined, and the corner of the document table 11a located at a point away from the lower left corner in the sub-scanning direction is defined as “upper left corner”.

即ち、複合機1においては、原稿台11aの左下角(換言すれば、フレーム13aの内側左下角)が、原稿Pの角を合わせるべき位置として定められており、複合機1は、ユーザが概ね、このマークMKに合わせて原稿Pを載置しているとの仮定の下で、原稿サイズの推定等を行い、原稿のコピー動作を実現する。   That is, in the multi-function device 1, the lower left corner of the document table 11a (in other words, the lower left corner inside the frame 13a) is determined as a position where the corner of the document P should be aligned. Under the assumption that the document P is placed in accordance with the mark MK, the document size is estimated and the document copy operation is realized.

この他、本実施例の複合機1においては、このマークMKが付されたフレーム13aの内側左下角に対応する読取可能領域R0の左下角を原点、主走査方向をX軸、副走査方向をY軸としたXY座標系(図2(b)参照)が導入されており、CPU70は、このXY座標系を用いて図3に示す複写制御処理を実行する。   In addition, in the multifunction machine 1 of this embodiment, the lower left corner of the readable area R0 corresponding to the inner lower left corner of the frame 13a with the mark MK is the origin, the main scanning direction is the X axis, and the sub scanning direction is An XY coordinate system (see FIG. 2B) with the Y axis is introduced, and the CPU 70 executes the copy control process shown in FIG. 3 using this XY coordinate system.

続いて、CPU70が実行する複写制御処理について説明する。図3は、操作キーを通じてコピー指令が入力されると、CPU70が実行する複写制御処理を表すフローチャートである。   Next, a copy control process executed by the CPU 70 will be described. FIG. 3 is a flowchart showing a copy control process executed by the CPU 70 when a copy command is input through the operation keys.

複写制御処理を開始すると、CPU70は、操作キーを通じて入力されたコピー指令が「自動変倍/傾き補正」コピー指令であるか否かを判断し(S110)、「自動変倍/傾き補正」コピー指令であると判断すると(S110でYes)、S120にて、図4に示す自動変倍複写処理を実行する。その後、当該複写制御処理を終了する。   When the copy control process is started, the CPU 70 determines whether or not the copy command input through the operation key is an “automatic scaling / tilt correction” copy command (S110), and copies the “automatic scaling / tilt correction”. If it is determined that it is a command (Yes in S110), the automatic zoom copying process shown in FIG. 4 is executed in S120. Thereafter, the copy control process ends.

一方、操作キーを通じて入力されたコピー指令が、「自動変倍/傾き補正」コピー指令以外のコピー指令であると判断すると(例えば、自動変倍や傾き補正の指示のないノーマルなコピー指令であると判断すると)、CPU70は、S130にて、入力されたコピー指令に対応した処理を実行した後、当該複写制御処理を終了する。   On the other hand, if it is determined that the copy command input through the operation key is a copy command other than the “automatic scaling / tilt correction” copy command (for example, a normal copy command without an automatic scaling or tilt correction instruction). In step S130, the CPU 70 executes processing corresponding to the input copy command, and then ends the copy control processing.

続いて、CPU70がS120にて実行する自動変倍複写処理について説明する。図4は、CPU70が実行する自動変倍複写処理を表すフローチャートである。
CPU70は、S120にて自動変倍複写処理を開始すると、まず、原稿読取開始位置を、読取可能領域R0の下端(Y=0)に設定し、原稿読取終了位置を、設計段階で予め定められた読取可能領域R0の下端から所定距離離れた位置(Y=YPRE)に設定することにより、上記原稿読取開始位置から原稿読取終了位置までの領域に該当する読取可能領域R0の一部を、読取領域に設定し、読取制御部20を通じて、画像読取部10に、当該読取領域に対するプレスキャン動作を実行させる(S210:先端部プレスキャン処理)。
Next, the automatic scaling copying process executed by the CPU 70 in S120 will be described. FIG. 4 is a flowchart showing the automatic scaling copying process executed by the CPU 70.
When the CPU 70 starts the automatic scaling copying process in S120, first, the document reading start position is set to the lower end (Y = 0) of the readable area R0, and the document reading end position is predetermined in the design stage. By setting a position (Y = YPRE) that is a predetermined distance away from the lower end of the readable area R0, a part of the readable area R0 corresponding to the area from the original reading start position to the original reading end position is read. The area is set, and the image reading unit 10 is caused to execute a pre-scan operation for the reading area through the reading control unit 20 (S210: tip portion pre-scanning process).

即ち、S210では、読取可能領域R0全体に対してプレスキャン動作を画像読取部10に実行させるのではなく、読取可能領域R0の下端から読取可能領域R0内側へ所定距離離れた地点まで(本実施例では、読取可能領域R0の下端から30mm離れた地点まで)に対し、プレスキャン動作を画像読取部10に実行させる。これにより、CPU70は、プレスキャン結果として、読取可能領域R0の一部領域の読取結果を表す画像データを画像読取部10から取得する。   That is, in S210, the pre-scanning operation is not performed on the entire readable area R0 by the image reading unit 10, but from the lower end of the readable area R0 to a point a predetermined distance away from the readable area R0 (this embodiment). In the example, the image reading unit 10 is caused to perform a pre-scan operation for a point 30 mm away from the lower end of the readable region R0. As a result, the CPU 70 acquires, as a pre-scan result, image data representing the read result of a partial area of the readable area R0 from the image reading unit 10.

尚、画像読取部10は、プレスキャン動作として、設定された読取領域の端から端まで、プレスキャン用の解像度に対応する速度で、読取ユニット15を副走査方向に搬送し、その読取領域の画像を読取ユニット15に読み取らせ、プレスキャン結果として、低解像度の画像データ(以下、「プレスキャン画像データ」という。)を、読取制御部20を通じて、RAM80に記録する動作を実行する。   As a pre-scan operation, the image reading unit 10 conveys the reading unit 15 in the sub-scanning direction at a speed corresponding to the pre-scan resolution from the end of the set reading area to the end of the reading area. The image is read by the reading unit 15 and, as a prescan result, low resolution image data (hereinafter referred to as “prescan image data”) is recorded in the RAM 80 through the read control unit 20.

このようにしてS210での処理を終えると、CPU70は、RAM80に記録されたプレスキャン画像データに対してエッジ検出処理を実行し、この画像データに対応するエッジ画像データを生成する(S215)。即ち、RAM80に記録されたプレスキャン画像データを、エッジ検出用の画像フィルタ(周知の微分フィルタ)に通して、この画像データに対応するエッジ画像を表すエッジ画像データを生成する。   When the processing in S210 is completed in this way, the CPU 70 performs edge detection processing on the pre-scan image data recorded in the RAM 80, and generates edge image data corresponding to this image data (S215). That is, the prescan image data recorded in the RAM 80 is passed through an image filter for edge detection (a well-known differential filter), and edge image data representing an edge image corresponding to the image data is generated.

また、S215での処理を終えると、CPU70は、上記生成したエッジ画像データを、検査対象データに設定して、図5に示す原稿推定処理を実行する(S220)。詳細は後述するが、この原稿推定処理では、検査対象データ(S215で得られたエッジ画像データ)を解析して、原稿台11aに載置された原稿のサイズ(縦幅及び横幅)、及び、原稿の傾き角θ、及び、原稿台11aにおける原稿の載置領域を推定する。   When the process in S215 is completed, the CPU 70 sets the generated edge image data as inspection target data, and executes the document estimation process shown in FIG. 5 (S220). Although details will be described later, in this document estimation process, the inspection object data (edge image data obtained in S215) is analyzed, and the size (vertical width and horizontal width) of the document placed on the document table 11a, and The document inclination angle θ and the document placement area on the document table 11a are estimated.

具体的には、原稿台11aに載置された原稿が四角形状であるとの仮定の下で、原稿台11aに載置された原稿のエッジを検査対象データにおいて検出すると共に、その検出結果から原稿の左下角位置及び右下角位置を推定して検査対象データにおける原稿領域を推定し、検査対象データの原稿領域外の領域におけるエッジ点の分布から、推定した原稿領域の確度を評価する。   Specifically, under the assumption that the document placed on the document table 11a has a square shape, the edge of the document placed on the document table 11a is detected in the inspection target data, and the detection result is used. The document area in the inspection target data is estimated by estimating the lower left corner position and the lower right corner position of the document, and the accuracy of the estimated document area is evaluated from the distribution of edge points in the area outside the document area of the inspection target data.

そして、原稿領域の確度が高い場合には、上記推定した角位置の情報から、原稿台11aに載置された原稿が定型用紙であるとの仮定の下で、当該原稿台11aに載置された原稿のサイズ、及び、原稿の傾き角θ、及び、原稿台11aにおける原稿の載置領域を推定する。但し、ここでは、X軸に対して原稿の下辺がなす角度を、原稿の傾き角θ(図8参照)とする。   When the accuracy of the document area is high, the document is placed on the document table 11a under the assumption that the document placed on the document table 11a is a standard sheet based on the estimated angular position information. The size of the original, the inclination angle θ of the original, and the original placement area on the original table 11a are estimated. However, here, the angle formed by the lower side of the document with respect to the X-axis is the document inclination angle θ (see FIG. 8).

一方、原稿領域の確度が低い場合や、原稿エッジを正常に検出できなかった場合には、原稿台11aに載置された原稿が予め定められた固定サイズの原稿であると推定する。S220では、このような内容の処理を実行する。   On the other hand, when the accuracy of the document area is low, or when the document edge cannot be detected normally, it is estimated that the document placed on the document table 11a is a document of a predetermined fixed size. In S220, processing with such contents is executed.

そして、S220での処理を終えると、CPU70は、印刷制御部40を通じて、印刷部30に給紙動作を実行させると共に(S230)、給紙動作の対象となった記録紙のサイズを検出する(S235)。尚、記録紙のサイズは、例えば、記録紙の搬送路に設けられたセンサを用いて周知の手法で検出することができる。   When the processing in S220 is completed, the CPU 70 causes the printing unit 30 to perform a paper feeding operation through the print control unit 40 (S230), and detects the size of the recording paper that is the target of the paper feeding operation (S230). S235). The size of the recording paper can be detected by a well-known method using, for example, a sensor provided in the recording paper conveyance path.

また、この処理を終えると、CPU70は、直前の原稿推定処理(S220)にて、原稿エッジの検出に失敗したことを原因として、S431(図5参照)又はS471で「失敗」判定がなされたか否かを判断する(S240)。そして、「失敗」判定がなされたと判断すると(S240でYes)、S261に移行する。一方、直前の原稿推定処理(S220)にて「失敗」判定がなされていないと判断すると(S240でNo)、S245に移行する。   When this process is finished, the CPU 70 has made a “failure” determination in S431 (see FIG. 5) or S471 due to the failure of the document edge detection in the immediately preceding document estimation process (S220). It is determined whether or not (S240). If it is determined that the “failure” determination has been made (Yes in S240), the process proceeds to S261. On the other hand, if it is determined that the “failure” determination has not been made in the immediately preceding document estimation process (S220) (No in S240), the process proceeds to S245.

また、S245では、直前の原稿推定処理にて「確度高」判定がなされたか否かを判断する(S245)。原稿推定処理では、上述したように、推定した原稿領域の確度の高低に応じて、原稿サイズの推定方法を切り替える。ここでは、原稿領域の確度が低く、原稿サイズが固定サイズに推定された状態であるか否かを、直前の原稿推定処理にて「確度高」判定がなされたか否かにより判断する。   In S245, it is determined whether or not the “high accuracy” determination is made in the immediately preceding document estimation process (S245). In the document estimation process, as described above, the document size estimation method is switched according to the estimated accuracy of the document area. Here, whether or not the accuracy of the document area is low and the document size is estimated to be a fixed size is determined based on whether or not the “high accuracy” determination is made in the immediately preceding document estimation process.

そして、「確度低」判定がなされたと判断すると(S245でNo)、S261に移行し、「確度高」判定がなされたと判断すると(S245でYes)、S251に移行する。   When it is determined that the “low accuracy” determination is made (No in S245), the process proceeds to S261. When it is determined that the “high accuracy” determination is made (Yes in S245), the process proceeds to S251.

S251に移行すると、CPU70は、S220で推定された原稿サイズ及びS235で検出された記録紙サイズに基づき、予め定められた計算式に従って変倍率を設定する。具体的には、変倍率を、原稿サイズと記録紙サイズとの比(例えば、記録紙短辺長さ÷原稿短辺長さ)に対応した倍率に設定し、後続の処理で、原稿のコピー画像が、原稿サイズとの記録紙サイズの比に対応した倍率で拡大(倍率が1未満の場合には縮小)されて記録紙に印刷されるようにする。   In step S251, the CPU 70 sets a scaling ratio according to a predetermined calculation formula based on the document size estimated in step S220 and the recording paper size detected in step S235. Specifically, the scaling factor is set to a magnification corresponding to the ratio between the document size and the recording paper size (for example, recording paper short side length ÷ original short side length), and the copy of the original is performed in the subsequent processing. The image is enlarged (or reduced if the magnification is less than 1) at a magnification corresponding to the ratio of the recording paper size to the document size and printed on the recording paper.

また、この処理を終えると、CPU70は、S220で推定された原稿の傾き角θから、画像データの傾き補正量を設定する(S253)。具体的には、原稿のコピー画像が、傾きのない状態でまっすぐ、記録紙に印刷されるように、傾き補正量を設定する。但し、推定された原稿の傾き角θが微小量(本実施例では−0.5度≦θ≦0.5度)である場合には、誤差も考慮して、傾き補正量をゼロに設定する。   When this processing is completed, the CPU 70 sets the inclination correction amount of the image data from the original inclination angle θ estimated in S220 (S253). Specifically, the tilt correction amount is set so that the copy image of the document is printed straight on the recording paper without tilting. However, when the estimated document inclination angle θ is a minute amount (in the present embodiment, −0.5 degrees ≦ θ ≦ 0.5 degrees), the inclination correction amount is set to zero in consideration of errors. To do.

S253での処理を終えると、CPU70は、S220で推定された原稿の載置領域の情報に基づいて、原稿読取開始位置及び原稿読取終了位置を設定し、原稿読取開始位置及び原稿読取終了位置で定められる読取領域を、原稿台11aにおける原稿の載置領域に対応させる(S255)。   When the processing in S253 is completed, the CPU 70 sets the document reading start position and the document reading end position based on the document placement area information estimated in S220, and sets the document reading start position and the document reading end position. The determined reading area is made to correspond to the document placement area on the document table 11a (S255).

具体的には、原稿の載置領域全体を読取ユニット15が読み取ることができるように、原稿読取開始位置を、副走査方向において最も下側に位置する原稿の端点に対応した位置に設定し、原稿読取終了位置を、副走査方向において最も上側に位置する原稿の端点に対応した位置に設定して、読取領域を原稿台11aにおける原稿の載置領域に対応させる。また、この処理を終えると、S270に移行する。   Specifically, the document reading start position is set to a position corresponding to the end point of the document located on the lowermost side in the sub-scanning direction so that the reading unit 15 can read the entire document placement area. The document reading end position is set to a position corresponding to the end point of the document located on the uppermost side in the sub-scanning direction, and the reading area is made to correspond to the document placement area on the document table 11a. When this process is finished, the process proceeds to S270.

一方、S261に移行すると、CPU70は、原稿のコピー画像が等倍で記録紙に印刷されるように、変倍率を1に設定すると共に、傾き補正量をゼロに設定する(S263)。更に、直前の原稿推定処理にて推定された原稿サイズの情報に基づき、原稿読取開始位置及び原稿読取終了位置を設定し、原稿読取開始位置及び原稿読取終了位置で定められる読取領域を、原稿台11aにおける原稿の載置領域に対応させる(S265)。   On the other hand, when proceeding to S261, the CPU 70 sets the scaling ratio to 1 and sets the tilt correction amount to zero so that the copy image of the document is printed on the recording paper at the same magnification (S263). Further, based on the document size information estimated in the immediately preceding document estimation process, the document reading start position and the document reading end position are set, and the reading area defined by the document reading start position and the document reading end position is set on the document table. It is made to correspond to the document placement area in 11a (S265).

具体的に、S265では、原稿台11aの左下角(フレーム内側左下角)に原稿の左下角が合わされて、原稿が正しく原稿台11aに載置されていると仮定し、原稿読取開始位置を、読取可能領域R0の下端(Y=0)に設定し、原稿読取終了位置を、原稿台11aの下端縁(換言すればフレーム13aの下辺内側)から上記推定した原稿の縦幅分離れた位置に設定する。このようにして、S265では、読取領域を、原稿台11aにおける原稿の載置領域に対応させる。   Specifically, in S265, it is assumed that the lower left corner of the document is aligned with the lower left corner of the document table 11a (the lower left corner inside the frame), and the document is correctly placed on the document table 11a. The lower end (Y = 0) of the readable region R0 is set, and the document reading end position is set to a position separated from the estimated lower side of the document from the lower edge of the document table 11a (in other words, the lower side of the frame 13a). Set. In this manner, in S265, the reading area is made to correspond to the document placement area on the document table 11a.

但し、S265では、後続の処理にて変倍率1でコピー動作を実現する関係上、読取領域を記録紙サイズより大きく設定する必要はないので、原稿サイズよりも記録紙サイズの方が小さい場合には、読取領域を記録紙サイズに対応させるようにしてもよい。このようにして、S265での処理を終えると、CPU70は、S270に移行する。   However, in S265, the reading area does not need to be set larger than the recording paper size in order to realize a copying operation with a scaling factor of 1 in the subsequent processing, so that the recording paper size is smaller than the document size. The reading area may correspond to the recording paper size. In this way, when the processing in S265 is completed, the CPU 70 proceeds to S270.

また、S270に移行すると、CPU70は、読取制御部20を通じて画像読取部10を制御することで、画像読取部10に、読取ユニット15を原稿読取開始位置から原稿読取終了位置まで副走査方向に搬送させると共に、当該搬送中にはライン毎の読取動作を読取ユニット15に実行させて、上記設定した読取領域の画像を、読取ユニット15に読み取らせ、当該読取領域の読取結果を表す画像データが、RAM80に記録されるようにする(S270)。   In step S <b> 270, the CPU 70 controls the image reading unit 10 through the reading control unit 20 to convey the reading unit 15 to the image reading unit 10 from the document reading start position to the document reading end position in the sub-scanning direction. In addition, during the conveyance, the reading unit 15 performs a reading operation for each line, causes the reading unit 15 to read the image of the set reading area, and image data representing a reading result of the reading area is It is recorded in the RAM 80 (S270).

また、この処理を終えると、CPU70は、RAM80に記録された上記読取結果を表す画像データを、予め設定された変倍率で拡大又は縮小処理すると共に、予め設定された傾き補正量分、回転処理して、上記読取結果を表す画像データを、印刷用の画像データに変換し、変換後の画像データを、印刷対象データに設定する(S280)。但し、傾き補正量がゼロに設定されている場合には、S280において、回転処理を、実行しないものとする。   When this process is completed, the CPU 70 enlarges or reduces the image data representing the read result recorded in the RAM 80 at a preset magnification, and performs a rotation process for a preset inclination correction amount. Then, the image data representing the read result is converted into image data for printing, and the converted image data is set as print target data (S280). However, if the tilt correction amount is set to zero, the rotation process is not executed in S280.

また、S280での処理を終えると、CPU70は、当該印刷対象データについての印刷処理を実行する(S290)。即ち、印刷制御部40を通じて、印刷部30に印刷対象データに基づく画像を、給紙した記録紙に印刷させる。その後、当該複写制御処理を終了する。   When the process in S280 is completed, the CPU 70 executes a print process for the print target data (S290). That is, the printing unit 30 causes the printing unit 30 to print an image based on the print target data on the fed recording paper. Thereafter, the copy control process ends.

このようにして、自動変倍複写処理では、読取可能領域R0における一部領域のプレスキャン結果に基づき、原稿サイズ等を推定し、その結果から、本スキャン時(S270実行時)の読取領域を決定すると共に、変倍率及び傾き補正量を決定する。特に、原稿エッジの検出に失敗した場合や、検出した原稿エッジに基づいて推定した原稿領域の確度が低い場合には、自動変倍機能をオフにして、変倍率1で、コピー動作を実現し、それ以外の場合には、自動変倍機能を働かせて、原稿のコピー画像を、原稿サイズと記録紙サイズとの比に対応する大きさに、拡大又は縮小して、記録紙に印刷する。   In this way, in the automatic scaling copying process, the document size and the like are estimated based on the prescan result of the partial area in the readable area R0, and the read area at the time of the main scan (when executing S270) is determined based on the result. At the same time, a scaling factor and an inclination correction amount are determined. In particular, when the detection of the document edge fails, or when the accuracy of the document area estimated based on the detected document edge is low, the automatic scaling function is turned off and the copying operation is realized with a scaling factor of 1. In other cases, the automatic scaling function is activated to enlarge or reduce the copy image of the original to a size corresponding to the ratio between the original size and the recording paper size and print it on the recording paper.

続いて、図5を用いて、CPU70が、S220で実行する原稿推定処理について説明する。図5は、CPU70が実行する原稿推定処理を表すフローチャートである。
この原稿推定処理を開始すると、CPU70は、まず、変数Sを上述のプレスキャン領域上端のY座標であるYPREに設定することにより(S=YPRE)、Y軸方向の検査範囲を、Y=0からY=S=YPREに設定する(S410)。また、この処理を終えると、S420に移行し、右エッジ検出処理を実行する。図6は、CPU70が実行する右エッジ検出処理を表すフローチャートである。
Subsequently, the document estimation process executed by the CPU 70 in S220 will be described with reference to FIG. FIG. 5 is a flowchart showing document estimation processing executed by the CPU 70.
When the document estimation process is started, the CPU 70 first sets the variable S to YPRE which is the Y coordinate of the upper end of the pre-scan area (S = YPRE), thereby setting the inspection range in the Y-axis direction to Y = 0. To Y = S = YPRE (S410). When this process ends, the process proceeds to S420, and a right edge detection process is executed. FIG. 6 is a flowchart showing the right edge detection process executed by the CPU 70.

右エッジ検出処理を開始すると、CPU70は、まずS510にて、副走査方向検査位置Yeを、読取可能領域R0の下端Y座標に設定し(Ye=0)、S515にて、主走査方向検査位置Xeを、読取可能領域R0の右端X座標に設定する(Xe=XMAX)。また、S515では、変数Cを値ゼロに初期化する(C=0)。その後、副走査方向検査位置Yeが検査範囲を超えているか否かを判断する(S520)。具体的には、Ye>Sであるか否かを判断する。   When the right edge detection process is started, the CPU 70 first sets the sub-scanning direction inspection position Ye to the lower end Y coordinate of the readable area R0 (Ye = 0) in S510, and the main scanning direction inspection position in S515. Xe is set to the right end X coordinate of the readable region R0 (Xe = XMAX). In S515, the variable C is initialized to zero (C = 0). Thereafter, it is determined whether or not the sub-scanning direction inspection position Ye exceeds the inspection range (S520). Specifically, it is determined whether or not Ye> S.

そして、副走査方向検査位置Yeが検査範囲を超えていないと判断すると(S520でNo)、CPU70は、主走査方向検査位置Xe及び副走査方向検査位置Yeで定まる検査位置(X,Y)=(Xe,Ye)に対応する検査対象データの画素値を参照することにより、検査位置(Xe,Ye)がエッジ点であるか否かを判断する(S525)。尚、図7は、エッジ画像データの構成を抜粋して示し、更に、右エッジ検出処理により追跡するエッジ点の軌跡を表した説明図である。図7に示す例では、画素値「1」の地点がエッジ点に該当する。   When determining that the sub-scanning direction inspection position Ye does not exceed the inspection range (No in S520), the CPU 70 determines the inspection position (X, Y) = determined by the main scanning direction inspection position Xe and the sub-scanning direction inspection position Ye = It is determined whether or not the inspection position (Xe, Ye) is an edge point by referring to the pixel value of the inspection target data corresponding to (Xe, Ye) (S525). FIG. 7 is an explanatory diagram showing the configuration of the edge image data, and further showing the locus of the edge point tracked by the right edge detection process. In the example illustrated in FIG. 7, a point with a pixel value “1” corresponds to an edge point.

そして、検査位置(Xe,Ye)がエッジ点ではないと判断すると(S525でNo)、CPU70は、S540に移行して、主走査方向検査位置Xeを、X軸マイナス方向に1画素移動した位置に更新し(Xe←Xe−1)、更新後の主走査方向検査位置Xeが読取可能領域R0の左端を、はみ出ていないかどうかを判断する。具体的には、Xe<0であるか否かを判断する(S543)。   If the CPU 70 determines that the inspection position (Xe, Ye) is not an edge point (No in S525), the CPU 70 proceeds to S540 and moves the main scanning direction inspection position Xe by one pixel in the X-axis minus direction. (Xe ← Xe−1), and it is determined whether or not the updated main scanning direction inspection position Xe protrudes from the left end of the readable area R0. Specifically, it is determined whether or not Xe <0 (S543).

そして、主走査方向検査位置Xeが、読取可能領域R0の左端をはみ出ていないと判断すると(S543でNo)、CPU70は、S520に移行して、副走査方向検査位置Yeが検査範囲を超えているか否か(Ye>Sであるか否か)を判断し、副走査方向検査位置Yeが検査範囲を超えていないと判断すると(S520でNo)、S525に移行し、副走査方向検査位置Yeが検査範囲を超えていると判断すると(S520でYes)、S590に移行する。   If the CPU 70 determines that the main scanning direction inspection position Xe does not protrude from the left end of the readable region R0 (No in S543), the CPU 70 proceeds to S520, and the sub scanning direction inspection position Ye exceeds the inspection range. If it is determined whether or not (Ye> S) and the sub-scanning direction inspection position Ye does not exceed the inspection range (No in S520), the process proceeds to S525 and the sub-scanning direction inspection position Ye is determined. If it is determined that the value exceeds the inspection range (Yes in S520), the process proceeds to S590.

一方、S543において、主走査方向検査位置Xeが読取可能領域R0の左端をはみ出ていると判断すると(Xe<0であると判断すると)、CPU70は、S547に移行し、主走査方向検査位置Xeを、読取可能領域R0の右端(XMAX)に設定すると共に(Xe=XMAX)、副走査方向検査位置Yeを、現在値Yeに8加えた値に更新する(Ye←Ye+8)。即ち、副走査方向検査位置Yeを、Y軸方向に8画素進んだ位置に設定する。その後、S520に移行して、上述の処理を実行する。   On the other hand, in S543, when it is determined that the main scanning direction inspection position Xe protrudes from the left end of the readable area R0 (when it is determined that Xe <0), the CPU 70 proceeds to S547, and the main scanning direction inspection position Xe. Is set to the right end (XMAX) of the readable region R0 (Xe = XMAX), and the sub-scanning direction inspection position Ye is updated to a value obtained by adding 8 to the current value Ye (Ye ← Ye + 8). That is, the sub-scanning direction inspection position Ye is set to a position advanced by 8 pixels in the Y-axis direction. Thereafter, the process proceeds to S520 and the above-described processing is executed.

また、検査位置(Xe,Ye)がエッジ点であると判断すると(S525でYes)、CPU70は、S530に移行し、変数(X0,Y0)に、現在の検査位置(Xe,Ye)の座標値を、設定する(X0←Xe,Y0←Ye)。また、変数Y1を、座標Y=Y0からY軸方向に8画素進んだ座標値Y1(=Y0+8)に更新する(S533)。   If the CPU 70 determines that the inspection position (Xe, Ye) is an edge point (Yes in S525), the CPU 70 proceeds to S530, and the coordinates of the current inspection position (Xe, Ye) are set in the variable (X0, Y0). The value is set (X0 ← Xe, Y0 ← Ye). Further, the variable Y1 is updated to a coordinate value Y1 (= Y0 + 8) advanced by 8 pixels from the coordinate Y = Y0 in the Y-axis direction (S533).

その後、座標(X0−1,Y1)の地点、座標(X0,Y1)の地点及び座標(X0+1,Y1)の地点の少なくとも一つが、エッジ点であるか否かを判断し(S537)、座標(X0−1,Y1)の地点、座標(X0,Y1)の地点及び座標(X0+1,Y1)の地点のいずれもがエッジ点でない場合には(S537でNo)、S540に移行して、主走査方向検査位置Xeを、X軸マイナス方向に1画素移動した位置に更新する(Xe←Xe−1)。   Thereafter, it is determined whether at least one of the point of coordinates (X0-1, Y1), the point of coordinates (X0, Y1), and the point of coordinates (X0 + 1, Y1) is an edge point (S537). If none of the point of (X0-1, Y1), the point of coordinates (X0, Y1), and the point of coordinates (X0 + 1, Y1) is an edge point (No in S537), the process proceeds to S540. The scanning direction inspection position Xe is updated to a position moved by one pixel in the X axis minus direction (Xe ← Xe−1).

一方、座標(X0−1,Y1)の地点、座標(X0,Y1)の地点及び座標(X0+1,Y1)の地点の少なくとも一つがエッジ点であると判断した場合には(S537でYes)、S550に移行して、座標(X0,Y0)の地点が連続性のあるエッジ点であると判定し、この座標(X0,Y0)を、連続性のあるエッジ点の座標データとして、一時記憶する。   On the other hand, when it is determined that at least one of the point of coordinates (X0-1, Y1), the point of coordinates (X0, Y1), and the point of coordinates (X0 + 1, Y1) is an edge point (Yes in S537), The process proceeds to S550, where it is determined that the point of coordinates (X0, Y0) is a continuous edge point, and this coordinate (X0, Y0) is temporarily stored as coordinate data of the continuous edge point. .

また、この処理を終えると、CPU70は、S560に移行し、座標(X0−1,Y1)の地点、座標(X0,Y1)の地点及び座標(X0+1,Y1)の地点の内、エッジ点である地点の一つを、予め定められた優先度に従って選択する。   When this processing is finished, the CPU 70 proceeds to S560, and at the point of the coordinates (X0-1, Y1), the coordinates (X0, Y1), and the coordinates (X0 + 1, Y1) at the edge point. One of the points is selected according to a predetermined priority.

具体的に、右エッジ検出処理においては、読取可能領域R0右端側に近い座標ほど高い優先度が設定されている。即ち、読取可能領域R0右端側に近い座標(X0+1,Y1)の地点が優先度「大」に設定され、座標(X0,Y1)の地点が優先度「中」に設定され、座標(X0−1,Y1)の地点が優先度「小」に設定されている。   Specifically, in the right edge detection process, higher priority is set for coordinates closer to the right end side of the readable area R0. That is, the point of the coordinate (X0 + 1, Y1) close to the right end side of the readable area R0 is set to the priority “high”, the point of the coordinate (X0, Y1) is set to the priority “medium”, and the coordinate (X0− 1, Y1) is set to the priority “small”.

このように優先度が設定されているのは、原稿の右端より右側においては、原稿台11aに何も存在せず、エッジ点は存在しないはずであり、読取可能領域R0右端側に近いエッジ点であるほど、そのエッジ点が原稿の右端に対応するエッジ点である可能性が高いためである。   The priority is set in this way because nothing exists on the platen 11a on the right side from the right end of the document, and there should be no edge point, and an edge point close to the right end side of the readable area R0. This is because there is a higher possibility that the edge point corresponds to the right edge of the document.

即ち、S560では、上記優先度に従って、座標(X0−1,Y1)の地点、座標(X0,Y1)の地点、及び、座標(X0+1,Y1)の地点の内、エッジ点である地点であって優先度の最も高い地点を選択する。そして、変数X0を、選択した地点のX座標に更新し、変数Y0を、選択した地点のY座標に更新する。その後、変数Cを1加算した値に更新する(S563)。   That is, in S560, according to the above priority, the point of the coordinate (X0-1, Y1), the point of the coordinate (X0, Y1), and the point of the coordinate (X0 + 1, Y1) are points that are edge points. To select the point with the highest priority. Then, the variable X0 is updated to the X coordinate of the selected point, and the variable Y0 is updated to the Y coordinate of the selected point. Thereafter, the variable C is updated to a value obtained by adding 1 (S563).

そして、この処理を終えると、CPU70は、更新後の変数Cの値がC=8であるか否かを判断し、C=8でないと判断すると(S567でNo)、S533に移行して、変数Y1を、座標Y=Y0からY軸方向に8画素進んだ地点のY座標に更新する(Y1=Y0+8)。その後、S537以降の処理を実行する。   When this process is finished, the CPU 70 determines whether or not the value of the updated variable C is C = 8. If the CPU 70 determines that C = 8 is not satisfied (No in S567), the process proceeds to S533. The variable Y1 is updated to the Y coordinate of the point advanced by 8 pixels in the Y-axis direction from the coordinate Y = Y0 (Y1 = Y0 + 8). Thereafter, the processing after S537 is executed.

CPU70は、このような処理を実行することにより、図7に示すように、Y軸方向に8画素おきに、エッジ点がY軸方向に連続するものであるか否かを検査する。そして、C=8であると判断すると(S567でYes)、8回に及ぶS550の処理で連続性のあるエッジ点として判定した計8地点の各座標データを、原稿右エッジデータとしてRAM80に記憶する(S570)。   By executing such processing, the CPU 70 checks whether the edge points are continuous in the Y-axis direction every 8 pixels in the Y-axis direction, as shown in FIG. If it is determined that C = 8 (Yes in S567), the coordinate data of a total of eight points determined as the continuous edge points in the process of S550 that has been repeated eight times is stored in the RAM 80 as the original right edge data. (S570).

また、この処理を終えると、CPU70は、S580に移行して、副走査方向検査位置Yeが検査範囲を超えているか否か(Ye>Sであるか否か)を判断し、副走査方向検査位置Yeが検査範囲を超えていないと判断すると(S580でNo)、副走査方向検査位置Yeを64画素進んだ位置に更新して(S585)、S515に移行する。   When this process is finished, the CPU 70 proceeds to S580, determines whether or not the sub-scanning direction inspection position Ye exceeds the inspection range (whether or not Ye> S), and performs the sub-scanning direction inspection. If it is determined that the position Ye does not exceed the inspection range (No in S580), the sub-scanning direction inspection position Ye is updated to a position advanced by 64 pixels (S585), and the process proceeds to S515.

このようにして、CPU70は、連続するエッジ点を、8つを1組として、繰返し検出する。そして、副走査方向検出位置Yeが検査範囲を超えると(S520でYes又はS580でYes)、S590に移行し、S570で原稿右エッジデータとして記憶された座標データ群の中から、右エッジ(原稿の右端を表すエッジ点)として確度の低い座標データ群を削除して、原稿右エッジデータを確定する。   In this way, the CPU 70 repeatedly detects eight consecutive edge points as one set. When the sub-scanning direction detection position Ye exceeds the inspection range (Yes in S520 or Yes in S580), the process proceeds to S590, and the right edge (original document) is selected from the coordinate data group stored as the original right edge data in S570. The edge data representing the right edge of the document) is deleted as a low-accuracy coordinate data group, and the document right edge data is determined.

具体的には、図8に示すように、原稿右エッジデータとして記憶された座標データ群の内、連続性のある座標データ群に対して原稿内側領域に大きくずれた位置にある、明白に連続性のない座標データ群を、原稿右エッジデータから除去し、原稿右エッジデータを確定する。その後、当該右エッジ検出処理を終了する。但し、S590の処理は原稿エッジの検出精度を高めるための処理であるので、S590の処理については、実行しないように、右エッジ検出処理を構成してもよい。   Specifically, as shown in FIG. 8, the coordinate data group stored as the document right edge data is clearly continuously located at a position greatly shifted to the document inner area with respect to the coordinate data group having continuity. The inconsistent coordinate data group is removed from the document right edge data to determine the document right edge data. Thereafter, the right edge detection process ends. However, since the process of S590 is a process for improving the document edge detection accuracy, the right edge detection process may be configured not to execute the process of S590.

このようにして、右エッジ検出処理を終えると、CPU70は、S430に移行し、直前の右エッジ検出処理で右エッジの検出に失敗したか否かを判断する。具体的には、直前の右エッジ検出処理で原稿右エッジデータとして登録された座標データがない場合、右エッジの検出に失敗したと判断し、原稿右エッジデータとして登録された座標データがある場合には、右エッジの検出に成功したと判断する。   In this way, when the right edge detection process is completed, the CPU 70 proceeds to S430, and determines whether or not the right edge detection has failed in the immediately preceding right edge detection process. Specifically, when there is no coordinate data registered as document right edge data in the immediately preceding right edge detection process, it is determined that detection of the right edge has failed, and there is coordinate data registered as document right edge data It is determined that the right edge has been successfully detected.

但し、例外的に、原稿右エッジデータとして登録された座標データが読取可能領域R0の左端(Y=0)近傍にある場合には、左エッジ(原稿の左端を表すエッジ点)の座標データが間違って原稿右エッジデータとして登録されているとみなして、原稿右エッジデータとして登録された座標データがある場合でも、右エッジの検出に失敗したと判断してもよい。   However, exceptionally, when the coordinate data registered as the document right edge data is in the vicinity of the left end (Y = 0) of the readable region R0, the coordinate data of the left edge (the edge point representing the left end of the document) is It may be determined that the detection of the right edge has failed even when there is coordinate data registered as the right edge data of the document, assuming that it is erroneously registered as the right edge data of the document.

尚、右エッジの検出に失敗するケースとしては、原稿サイズが原稿台11aのサイズより大きく、原稿の右端が原稿台11aからはみ出しているケースなどを挙げることができる。   Examples of cases where the detection of the right edge fails include a case where the document size is larger than the size of the document table 11a and the right edge of the document protrudes from the document table 11a.

そして、右エッジの検出に失敗したと判断すると(S430でYes)、CPU70は、S431に移行し、「失敗」判定をすると共に、原稿台11aに載置されている原稿のサイズ(縦幅及び横幅)が、原稿台11aに載置可能な最大サイズ(読取可能領域R0に対応するサイズ)であると推定する(S433)。そして、この処理を終えると、当該原稿推定処理を終了する。尚、S431で「失敗」判定がなされると、上述したS240では、Yesと判断される。   If the CPU 70 determines that detection of the right edge has failed (Yes in S430), the CPU 70 proceeds to S431 to make a “failure” determination, and also determines the size (length and width) of the document placed on the document table 11a. It is estimated that (width) is the maximum size (size corresponding to the readable area R0) that can be placed on the document table 11a (S433). Then, when this process is finished, the document estimation process is finished. If “failure” determination is made in S431, “Yes” is determined in S240 described above.

一方、S430において右エッジの検出に成功したと判断すると(S430でNo)、CPU70は、S437に移行し、右エッジ検出処理で確定された原稿右エッジデータが示す各点を直線近似して、原稿右エッジデータが示す点群の近似直線(以下、「右エッジ近似直線」と表現する。)を算出する。   On the other hand, if it is determined in S430 that the right edge has been successfully detected (No in S430), the CPU 70 proceeds to S437 and linearly approximates each point indicated by the document right edge data determined in the right edge detection process. An approximate straight line of the point group indicated by the original right edge data (hereinafter referred to as “right edge approximate straight line”) is calculated.

また、この処理を終えると、CPU70は、S440に移行して、右エッジ近似直線がY軸に対し所定角度より大きく傾いているか否かを判断する。本実施例では、具体的に、右エッジ近似直線がY軸に対し0.5度より大きく傾いているか否かを判断する。   When this process is finished, the CPU 70 proceeds to S440 and determines whether or not the right edge approximate straight line is inclined more than a predetermined angle with respect to the Y axis. In this embodiment, specifically, it is determined whether or not the right edge approximate straight line is inclined more than 0.5 degrees with respect to the Y axis.

そして、右エッジ近似直線の傾きが上記所定角度以下であると判断すると(S440でNo)、CPU70は、原稿がフレーム13aの内側左下角に突き当てられて原稿台11aに正しく載置されていると推定して、図5右図に示すように、右エッジ近似直線と原稿台11a下端縁(換言すると、フレーム13aの下辺(以下、「下フレーム」と表現する。)内側)との交点を、原稿の右下角位置であると推定する(S441)。   If it is determined that the slope of the right edge approximate straight line is equal to or smaller than the predetermined angle (No in S440), the CPU 70 is placed on the document table 11a by being abutted against the inner left lower corner of the frame 13a. 5 and the intersection of the right edge approximate straight line and the lower edge of the document table 11a (in other words, the inner side of the lower side of the frame 13a (hereinafter referred to as “lower frame”)), as shown in the right diagram of FIG. The position of the lower right corner of the document is estimated (S441).

また、この処理を終えると、CPU70は、原稿の左下角位置が原稿台11aの左下角(換言すると、フレーム13aの内側左下角)の地点であると推定して(S443)、検査対象データにおける原稿の画像を表す領域(以下、「原稿領域」と表現する。)を推定する(S445)。   When this processing is finished, the CPU 70 estimates that the lower left corner position of the document is the point of the lower left corner of the document table 11a (in other words, the inner lower left corner of the frame 13a) (S443), and in the inspection target data An area representing the image of the original (hereinafter referred to as “original area”) is estimated (S445).

具体的に、S445では、原稿台11aに載置されている原稿が四角形状であるとの仮定の元で、推定した左下角位置及び右下角位置から、検査対象データにおける原稿領域を推定する。即ち、左下角位置及び右下角位置を結ぶ線分、右下角位置からY軸方向に伸びる線分、左下角位置からY軸方向に伸びる線分に囲まれる検査対象データの領域を、原稿領域と推定する(図9(b)参照)。   Specifically, in S445, the document area in the inspection target data is estimated from the estimated lower left corner position and lower right corner position on the assumption that the document placed on the document table 11a is square. That is, the area of the inspection target data surrounded by the line segment connecting the lower left corner position and the lower right corner position, the line segment extending from the lower right corner position in the Y axis direction, and the line segment extending from the lower left corner position in the Y axis direction is defined as the document area. Estimate (see FIG. 9B).

また、S445での処理を終えると、CPU70は、S447に移行して、図9(a)に示す原稿推定副処理を実行する。尚、図9(a)は、CPU70が実行する原稿推定副処理を表すフローチャートである。   When the process in S445 is completed, the CPU 70 proceeds to S447 and executes the document estimation sub-process shown in FIG. FIG. 9A is a flowchart showing the document estimation sub-process executed by the CPU 70.

S447で原稿推定副処理を開始すると、CPU70は、まず、予め推定した原稿領域の情報に基づき、検査対象データの原稿領域外の領域でのエッジ点の占有率を算出する(S610)。即ち、次の計算式『占有率=原稿領域外のエッジ点の数÷原稿領域外の総画素数』に従って、検査対象データの原稿領域外の領域でのエッジ点の占有率を算出する(S610)。   When the document estimation sub-process is started in S447, the CPU 70 first calculates the occupancy rate of the edge points in the area outside the document area of the inspection target data based on the document area information estimated in advance (S610). That is, the occupancy ratio of the edge points in the area outside the document area of the inspection target data is calculated according to the following calculation formula “occupancy ratio = number of edge points outside the document area ÷ total number of pixels outside the document area” (S610). ).

尚、図9(b)は、S447で実行する原稿推定副処理にて、原稿領域外と取り扱われる検査対象データの領域の具体例を、斜線により示した説明図である。
但し、ここでは、例外的に、原稿右エッジデータとして登録されたエッジ点について、そのエッジ点が原稿領域外にある場合、それを原稿領域外のエッジ点の数としてカウントしないものとする。即ち、S447で実行する原稿推定副処理では、上記「原稿領域外のエッジ点の数」に、原稿右エッジデータとして登録されたエッジ点であって原稿領域外にあるエッジ点の数を含ませないものとする。
Note that FIG. 9B is a diagram illustrating a specific example of the area of the inspection target data that is handled as being outside the original area in the original estimation sub-process executed in S447.
However, here, as an exception, if an edge point registered as document right edge data is outside the document area, it is not counted as the number of edge points outside the document area. That is, in the document estimation sub-process executed in S447, the “number of edge points outside the document area” includes the number of edge points registered as document right edge data and outside the document area. Make it not exist.

また、この処理を終えると、CPU70は、S610で算出した占有率が、予め定められた閾値以下(例えば、0.05以下)であるか否かを判断し(S620)、上記算出した占有率が閾値以下であると判断すると(S620でYes)、予め推定した原稿領域の確度が高いと評価して、「確度高」と判定する(S630)。尚、S630で「確度高」と判定した場合、後続の処理である上述のS245において、CPU70は、Yesと判断する。   When this process is finished, the CPU 70 determines whether or not the occupation rate calculated in S610 is equal to or less than a predetermined threshold (for example, 0.05 or less) (S620), and calculates the calculated occupation rate. Is determined to be less than or equal to the threshold value (Yes in S620), it is evaluated that the accuracy of the document area estimated in advance is high, and “high accuracy” is determined (S630). If it is determined in S630 that the “accuracy is high”, the CPU 70 determines Yes in the subsequent S245 described later.

また、この処理を終えると、CPU70は、S640に移行し、予め推定した原稿の左下角位置及び右下角位置を結ぶ線分が原稿短辺であり、原稿台11aに載置されている原稿が定型用紙であると仮定して、原稿台11aに載置された原稿のサイズ及び原稿台11aにおける原稿の載置領域を推定する。   When this process is completed, the CPU 70 proceeds to S640, where the line segment connecting the pre-estimated lower left corner position and lower right corner position of the original document is the original short side, and the original document placed on the original document table 11a is detected. Assuming that it is a standard sheet, the size of the document placed on the document table 11a and the document placement area on the document table 11a are estimated.

即ち、上記推定した原稿の左下角位置から右下角位置までの長さを、原稿の短辺長さ(横幅)と推定し、この短辺長さの√2倍を、原稿の長辺長さ(縦幅)と推定して、原稿サイズを推定すると共に、上記推定した左下角位置及び右下角位置を基点に上記原稿サイズの原稿が原稿台11aに載置されているものとして、原稿の左上角及び右上角が位置する座標を導出し、これら4つの角を結んでできる四角形内の領域を、原稿の載置領域であると推定する(S640)。尚、ここで原稿短辺長さの√2倍を、原稿の長辺長さとして推定しているのは、定型用紙の短辺長さ:長辺長さの比が1:√2となっているためである。   That is, the estimated length from the lower left corner position to the lower right corner position of the original is estimated as the short side length (horizontal width) of the original, and √2 times the short side length is set to the long side length of the original. Assuming that the document size is estimated based on (vertical width), and the document of the document size is placed on the document table 11a with the estimated lower left corner position and lower right corner position as the base points, the upper left corner of the document The coordinates where the corners and the upper right corner are located are derived, and an area within the quadrilateral formed by connecting these four corners is estimated as the document placement area (S640). Here, the reason why √2 times the original short side length is estimated as the long side length of the original is that the ratio of the short side length to the long side length of the standard paper is 1: √2. This is because.

また、この処理を終えると、CPU70は、原稿台11aに載置されている原稿の傾き角を推定する(S650)。尚、S447で実行する原稿推定副処理では、その直前の処理(S441,S443)にて、原稿が原稿台11aの左下角に正確に突き当てられて原稿台11aに載置されていると仮定して角位置を求めているので、S650では、原稿の傾き角がゼロである(傾きがない)と推定する。その後、当該原稿推定副処理を終了する。   When this process is completed, the CPU 70 estimates the inclination angle of the document placed on the document table 11a (S650). Note that in the document estimation sub-process executed in S447, it is assumed that the document is placed on the document table 11a by being exactly abutted against the lower left corner of the document table 11a in the immediately preceding processing (S441, S443). Therefore, in S650, it is estimated that the inclination angle of the document is zero (no inclination) in S650. Thereafter, the document estimation sub-process is terminated.

これに対し、S610で算出した占有率が閾値を超えていると判断すると(S620でNo)、CPU70は、予め推定した原稿領域の確度が低いと評価して、「確度低」と判定する(S660)。尚、S660で「確度低」と判定した場合、後続の処理である上述のS245において、CPU70は、Noと判断する。   On the other hand, if it is determined that the occupation rate calculated in S610 exceeds the threshold (No in S620), the CPU 70 evaluates that the accuracy of the document area estimated in advance is low, and determines that “the accuracy is low” ( S660). If it is determined that the “accuracy is low” in S660, the CPU 70 determines No in the above-described S245, which is a subsequent process.

ところで、S660で原稿領域の確度が低いと評価するのは、推定した原稿領域が正しい限り、原稿領域外には、埃等で検出されたエッジ点が存在する程度で、基本的に、原稿領域外にはエッジ点は存在しないはずであるためである。   By the way, in S660, it is evaluated that the accuracy of the document area is low, as long as the estimated document area is correct, an edge point detected by dust or the like exists outside the document area. This is because there should be no edge points outside.

換言すると、原稿領域外に、エッジ点が多く存在する場合には、原稿台11aに載置された原稿に描写された罫線等に惑わされて誤った領域を原稿領域であると推定している可能性が高く、推定した原稿領域を超えて真の原稿領域がある可能性が高い。そこで、占有率が高い場合には、予め推定した原稿領域の確度が低いと評価して、「確度低」と判定するようにしているのである。   In other words, when there are many edge points outside the document area, it is estimated that the erroneous area is confused by the ruled lines drawn on the document placed on the document table 11a. The possibility is high, and there is a high possibility that there is a true original area beyond the estimated original area. Therefore, when the occupation ratio is high, it is evaluated that the accuracy of the document area estimated in advance is low, and “accuracy is low” is determined.

CPU70は、S660で「確度低」と判定すると、S670に移行し、上記推定した左下角位置及び右下角位置の情報を用いずに、原稿台11aに載置された原稿のサイズが、予め設定された基本サイズであると推定する。その後、当該原稿推定副処理を終了する。   If the CPU 70 determines that the “accuracy is low” in S660, the process proceeds to S670, and the size of the document placed on the document table 11a is set in advance without using the information of the estimated lower left corner position and lower right corner position. Estimated base size. Thereafter, the document estimation sub-process is terminated.

尚、本実施例の複合機1は、基本サイズの情報を、設定情報として、予め操作キーを通じてユーザから入手可能な構成にされている。即ち、S670では、原稿台11aに載置された原稿のサイズが、ユーザから予め指定された基本サイズの原稿であると推定する。但し、S660で「確度低」と判定されるような状況下では、原稿台11aに載置されている原稿のサイズが読取可能領域R0のサイズより大きい可能性が高いので、製品出荷時の基本サイズの設定値は、原稿台11aに載置可能な原稿の最大サイズとしておくのが好ましい。   The multi-function device 1 according to the present embodiment is configured so that basic size information can be obtained from the user through operation keys in advance as setting information. That is, in S670, it is estimated that the size of the document placed on the document table 11a is a basic size document specified in advance by the user. However, in a situation where it is determined that “the accuracy is low” in S660, the size of the document placed on the document table 11a is likely to be larger than the size of the readable area R0. The set value of the size is preferably set to the maximum size of the document that can be placed on the document table 11a.

このようにして、S447での原稿推定副処理を終えると、CPU70は、S220での原稿推定処理を終了して、S230に移行し、後続の処理を実行する。即ち、原稿推定処理で推定した原稿サイズの情報を基に読取領域等を設定し、コピー動作を実現する。   In this way, when the document estimation sub-process in S447 is completed, the CPU 70 ends the document estimation process in S220, proceeds to S230, and executes subsequent processes. In other words, the reading area is set based on the document size information estimated in the document estimation process, and the copy operation is realized.

話を原稿推定処理のS440(図5参照)に戻すと、CPU70は、ここで、右エッジ近似直線がY軸に対し所定角度より大きく傾いていると判断した場合(S440でYes)、S450に移行して、図10に示す左エッジ検出処理を実行する。図10は、CPU70が実行する左エッジ検出処理を表すフローチャートである。   When the story is returned to S440 (see FIG. 5) of the document estimation process, the CPU 70 determines that the right edge approximate straight line is inclined more than a predetermined angle with respect to the Y axis (Yes in S440), the process proceeds to S450. Then, the left edge detection process shown in FIG. 10 is executed. FIG. 10 is a flowchart showing the left edge detection process executed by the CPU 70.

左エッジ検出処理を開始すると、CPU70は、S710にて、副走査方向検査位置Ye=0に設定し、S715にて、主走査方向検査位置Xeを、読取可能領域R0の左端X座標に設定する(Xe=0)。また、S715では、変数Cを値ゼロに初期化する(C=0)。   When the left edge detection process is started, the CPU 70 sets the sub-scanning direction inspection position Ye = 0 in S710, and sets the main scanning direction inspection position Xe to the left end X coordinate of the readable area R0 in S715. (Xe = 0). In S715, the variable C is initialized to zero (C = 0).

その後、CPU70は、副走査方向検査位置Yeが検査範囲を超えているか否か(即ち、Ye>Sであるか否か)を判断し(S720)、副走査方向検査位置Yeが検査範囲を超えていないと判断すると(S720でNo)、検査位置(X,Y)=(Xe,Ye)に対応する検査対象データの画素値を参照して、検査位置(Xe,Ye)がエッジ点であるか否かを判断する(S725)。   Thereafter, the CPU 70 determines whether or not the sub-scanning direction inspection position Ye exceeds the inspection range (that is, whether or not Ye> S) (S720), and the sub-scanning direction inspection position Ye exceeds the inspection range. If it is determined that it is not (No in S720), the inspection position (Xe, Ye) is an edge point with reference to the pixel value of the inspection target data corresponding to the inspection position (X, Y) = (Xe, Ye). Whether or not (S725).

そして、検査位置(Xe,Ye)がエッジ点ではないと判断すると(S725でNo)、S740に移行し、主走査方向検査位置Xeを、X軸プラス方向に1画素移動した地点に更新し(Xe←Xe+1)、更新した主走査方向検査位置Xeが、読取可能領域R0の右端を、はみ出ていないかどうかを判断する(S743)。具体的には、Xe>XMAXであるか否かを判断する(S743)。そして、主走査方向検査位置Xeが、読取可能領域R0の右端をはみ出ていないと判断すると(S743でNo)、S720に移行する。   If it is determined that the inspection position (Xe, Ye) is not an edge point (No in S725), the process proceeds to S740, and the main scanning direction inspection position Xe is updated to a point moved by one pixel in the X axis plus direction ( Xe ← Xe + 1), it is determined whether or not the updated main scanning direction inspection position Xe protrudes from the right end of the readable area R0 (S743). Specifically, it is determined whether Xe> XMAX (S743). If it is determined that the main scanning direction inspection position Xe does not protrude from the right end of the readable area R0 (No in S743), the process proceeds to S720.

一方、S743で主走査方向検査位置Xeが読取可能領域R0の右端をはみ出ていると判断すると(Xe>XMAXであると判断すると)、CPU70は、S747に移行し、主走査方向検査位置Xeを、読取可能領域R0の左端に設定すると共に(Xe=0)、副走査方向検査位置Yeを、Y軸方向に8画素進んだ位置に設定する(Ye←Ye+8)。その後、S720に移行する。   On the other hand, when it is determined in S743 that the main scanning direction inspection position Xe protrudes from the right end of the readable region R0 (when it is determined that Xe> XMAX), the CPU 70 proceeds to S747 and sets the main scanning direction inspection position Xe. The sub scanning direction inspection position Ye is set to a position advanced by 8 pixels in the Y-axis direction (Y ← Ye + 8) while being set to the left end of the readable region R0 (Xe = 0). Thereafter, the process proceeds to S720.

また、検査位置(Xe,Ye)がエッジ点であると判断すると(S725でYes)、CPU70は、S730に移行して、変数(X0,Y0)に、現在の検査位置(Xe,Ye)の座標値を設定する(X0←Xe,Y0←Ye)と共に、変数Y1を、値Y1=Y0+8に更新する(S733)。   If the CPU 70 determines that the inspection position (Xe, Ye) is an edge point (Yes in S725), the CPU 70 proceeds to S730 and sets the variable (X0, Y0) to the current inspection position (Xe, Ye). The coordinate value is set (X0 ← Xe, Y0 ← Ye), and the variable Y1 is updated to the value Y1 = Y0 + 8 (S733).

その後、座標(X0−1,Y1)の地点、座標(X0,Y1)の地点及び座標(X0+1,Y1)の地点の少なくとも一つが、エッジ点であるか否かを判断し(S737)、座標(X0−1,Y1)の地点、座標(X0,Y1)の地点及び座標(X0+1,Y1)の地点のいずれもがエッジ点でない場合には(S737でNo)、S740に移行する。   Thereafter, it is determined whether at least one of the point of coordinates (X0-1, Y1), the point of coordinates (X0, Y1), and the point of coordinates (X0 + 1, Y1) is an edge point (S737). If none of the point of (X0-1, Y1), the point of coordinates (X0, Y1), and the point of coordinates (X0 + 1, Y1) is an edge point (No in S737), the process proceeds to S740.

一方、座標(X0−1,Y1)の地点、座標(X0,Y1)の地点及び座標(X0+1,Y1)の地点の少なくとも一つがエッジ点であると判断した場合には(S737でYes)、S750に移行して、座標(X0,Y0)の地点が連続性のあるエッジ点であると判定し、この座標(X0,Y0)を、連続性のあるエッジ点の座標データとして、一時記憶する。   On the other hand, when it is determined that at least one of the point of coordinates (X0-1, Y1), the point of coordinates (X0, Y1), and the point of coordinates (X0 + 1, Y1) is an edge point (Yes in S737), Moving to S750, it is determined that the point of coordinates (X0, Y0) is a continuous edge point, and the coordinates (X0, Y0) are temporarily stored as coordinate data of the continuous edge point. .

また、この処理を終えると、CPU70は、S760に移行し、座標(X0−1,Y1)の地点、座標(X0,Y1)の地点及び座標(X0+1,Y1)の地点の内、エッジ点である地点の一つを、予め定められた優先度に従って選択する。   When this process is finished, the CPU 70 proceeds to S760, where the coordinates (X0-1, Y1), the coordinates (X0, Y1), and the coordinates (X0 + 1, Y1) are the edge points. One of the points is selected according to a predetermined priority.

具体的に、左エッジ検出処理においては、読取可能領域R0左端側に近い座標ほど高い優先度が設定されている。即ち、読取可能領域R0左端側に近い座標(X0−1,Y1)の地点が優先度「大」に設定され、座標(X0,Y1)の地点が優先度「中」に設定され、座標(X0+1,Y1)の地点が優先度「小」に設定されている。このように優先度が設定されているのは、原稿の左端より左側においては、原稿台11aに何も存在せず、エッジ点は存在しないはずであり、読取可能領域R0左端側に近いエッジ点であるほど、そのエッジ点が原稿の左端に対応するエッジ点である可能性が高いためである。   Specifically, in the left edge detection process, higher priority is set for coordinates closer to the left end side of the readable area R0. That is, the point of the coordinates (X0-1, Y1) close to the left end side of the readable area R0 is set to the priority “large”, the point of the coordinates (X0, Y1) is set to the priority “medium”, and the coordinates ( The point of X0 + 1, Y1) is set to the priority “small”. The priority is set in this way because there is nothing on the document table 11a on the left side of the left edge of the document, and there should be no edge point, and the edge point close to the left edge side of the readable area R0. This is because there is a high possibility that the edge point is an edge point corresponding to the left end of the document.

従って、S760では、この優先度に従って、座標(X0−1,Y1)の地点、座標(X0,Y1)の地点、及び、座標(X0+1,Y1)の地点の内、エッジ点である地点であって優先度の最も高い地点を選択する。そして、変数X0を、選択した地点のX座標に更新し、変数Y0を、選択した地点のY座標に更新する。その後、変数Cを1加算した値に更新する(S763)。   Therefore, in S760, according to the priority, the point of the coordinate (X0-1, Y1), the point of the coordinate (X0, Y1), and the point of the coordinate (X0 + 1, Y1) are points that are edge points. To select the point with the highest priority. Then, the variable X0 is updated to the X coordinate of the selected point, and the variable Y0 is updated to the Y coordinate of the selected point. Thereafter, the variable C is updated to a value obtained by adding 1 (S763).

また、この処理を終えると、CPU70は、更新後の変数Cの値がC=8であるか否かを判断し、C=8でないと判断すると(S767でNo)、S733に移行して、変数Y1を、Y1=Y0+8に更新する。その後、S737以降の処理を実行する。   When this process is finished, the CPU 70 determines whether or not the value of the updated variable C is C = 8. If the CPU 70 determines that C = 8 is not satisfied (No in S767), the process proceeds to S733. The variable Y1 is updated to Y1 = Y0 + 8. Thereafter, the processing after S737 is executed.

このような処理手順により、CPU70は、右エッジ検出処理と同様(図7参照)、Y軸方向に8画素おきに、エッジ点がY軸方向に連続するものであるか否かを検査する。そして、C=8であると判断すると(S767でYes)、S750で連続性のあるエッジ点として判定した計8地点の各座標データを、原稿左エッジデータとしてRAM80に記憶する(S770)。   By such a processing procedure, the CPU 70 checks whether the edge points are continuous in the Y-axis direction every 8 pixels in the Y-axis direction, as in the right edge detection process (see FIG. 7). If it is determined that C = 8 (Yes in S767), the coordinate data of a total of eight points determined as continuous edge points in S750 are stored in the RAM 80 as document left edge data (S770).

また、この処理を終えると、CPU70は、S780に移行して、副走査方向検査位置Yeが検査範囲を超えているか否か(Ye>Sであるか否か)を判断し、副走査方向検査位置Yeが検査範囲を超えていないと判断すると(S780でNo)、副走査方向検査位置Yeを64画素進んだ地点に更新して(S785)、S715に移行する。   When this process is finished, the CPU 70 proceeds to S780, determines whether or not the sub-scanning direction inspection position Ye exceeds the inspection range (whether or not Ye> S), and performs the sub-scanning direction inspection. If it is determined that the position Ye does not exceed the inspection range (No in S780), the sub-scanning direction inspection position Ye is updated to a point advanced by 64 pixels (S785), and the process proceeds to S715.

このようにして、CPU70は、連続するエッジ点を、8つずつ、繰返し検出する。そして、副走査方向検出位置Yeが検査範囲を超えると(S720でYes又はS780でYes)、S790に移行し、S770で原稿左エッジデータとして記憶された座標データ群の中から、左エッジ(原稿の左端を表すエッジ点)として確度の低い座標データ群を削除して、原稿左エッジデータを確定する。   In this way, the CPU 70 repeatedly detects eight consecutive edge points. When the sub-scanning direction detection position Ye exceeds the inspection range (Yes in S720 or Yes in S780), the process proceeds to S790, and the left edge (original document) is selected from the coordinate data group stored as the original left edge data in S770. The edge data representing the left edge of the document) is deleted as a low-accuracy coordinate data group, and the document left edge data is determined.

具体的には、S590での処理と同様、原稿左エッジデータとして記憶された座標データ群の内、連続性のある座標データ群に対して原稿内側領域に大きくずれた位置にある、明白に連続性のない座標データ群を、原稿左エッジデータから除去し、原稿左エッジデータを確定する。その後、当該左エッジ検出処理を終了する。但し、S790の処理については、実行しないように、左エッジ検出処理を構成してもよい。   Specifically, in the same manner as the processing in S590, the coordinate data group stored as the document left edge data is clearly continuously located at a position greatly shifted to the document inner area with respect to the coordinate data group having continuity. The inconsistent coordinate data group is removed from the document left edge data to determine the document left edge data. Thereafter, the left edge detection process ends. However, the left edge detection process may be configured not to execute the process of S790.

また、このようにして、左エッジ検出処理を終えると、CPU70は、S455に移行し、左エッジ検出処理で確定された原稿左エッジデータが示す各点を直線近似して、原稿左エッジデータが示す点群の近似直線(以下、「左エッジ近似直線」という。)を算出する。その後、S460に移行する。   In addition, when the left edge detection process is completed in this way, the CPU 70 proceeds to S455, linearly approximates each point indicated by the document left edge data determined by the left edge detection process, and the document left edge data is obtained. An approximate straight line (hereinafter referred to as “left edge approximate straight line”) of the point group shown is calculated. Thereafter, the process proceeds to S460.

但し、直前の左エッジ検出処理で原稿左エッジデータとして登録された座標データがない場合には、左エッジの検出に失敗したと判断して、左エッジ近似直線を算出することなく、S460に移行するものとする。この他、原稿左エッジデータとして登録されている座標データの全て又は一部が原稿右エッジデータにも登録されている場合には、右エッジ(原稿の右端を表すエッジ点)の座標データが間違って原稿左エッジデータとして登録されているとみなして、原稿左エッジデータとして登録された座標データがある場合でも、左エッジの検出に失敗したと判断し、左エッジ近似直線を算出することなく、S460に移行するようにしてもよい。   However, if there is no coordinate data registered as document left edge data in the immediately preceding left edge detection process, it is determined that detection of the left edge has failed, and the process proceeds to S460 without calculating the left edge approximate straight line. It shall be. In addition, when all or part of the coordinate data registered as the document left edge data is also registered in the document right edge data, the coordinate data of the right edge (the edge point representing the right edge of the document) is incorrect. Even if there is coordinate data registered as document left edge data, it is determined that detection of the left edge has failed, and without calculating the left edge approximate straight line, You may make it transfer to S460.

また、S460に移行すると、CPU70は、図11に示す下エッジ検出処理を実行する。図11は、CPU70が実行する下エッジ検出処理を表すフローチャートである。
下エッジ検出処理を開始すると、CPU70は、S810にて、主走査方向検査位置Xeを、読取可能領域R0の左端X座標に設定し(Xe=0)、S815にて、副走査方向検査位置Yeを、読取可能領域R0の下端Y座標に設定する(Ye=0)。また、S815では、変数Cを値ゼロに初期化する(C=0)。
In S460, the CPU 70 executes the lower edge detection process shown in FIG. FIG. 11 is a flowchart showing the lower edge detection process executed by the CPU 70.
When the lower edge detection process is started, the CPU 70 sets the main scanning direction inspection position Xe to the left end X coordinate of the readable area R0 (Xe = 0) in S810, and the sub scanning direction inspection position Ye in S815. Is set to the lower end Y coordinate of the readable area R0 (Ye = 0). In S815, the variable C is initialized to zero (C = 0).

また、この処理を終えると、CPU70は、主走査方向検査位置Xeが読取可能領域R0の右端を超えているか否か(即ち、Xe>XMAXであるか否か)を判断し(S820)、主走査方向検査位置Xeが読取可能領域R0の右端を超えていないと判断すると(S820でNo)、検査位置(X,Y)=(Xe,Ye)に対応する検査対象データの画素値を参照し、検査位置(Xe,Ye)がエッジ点であるか否かを判断する(S825)。   When this process is finished, the CPU 70 determines whether or not the main scanning direction inspection position Xe exceeds the right end of the readable area R0 (that is, whether Xe> XMAX) (S820). If it is determined that the scanning direction inspection position Xe does not exceed the right end of the readable region R0 (No in S820), the pixel value of the inspection target data corresponding to the inspection position (X, Y) = (Xe, Ye) is referred to. Then, it is determined whether or not the inspection position (Xe, Ye) is an edge point (S825).

そして、検査位置(Xe,Ye)がエッジ点ではないと判断すると(S825でNo)、S840に移行して、副走査方向検査位置Yeを、Y軸プラス方向に1画素移動した位置に更新し(Ye←Ye+1)、更新後の副走査方向検査位置Yeが検査範囲を超えているか否か(Ye>Sであるか否か)を判断する(S843)。   If it is determined that the inspection position (Xe, Ye) is not an edge point (No in S825), the process proceeds to S840, and the sub-scanning inspection position Ye is updated to a position moved by one pixel in the Y-axis plus direction. (Ye ← Ye + 1), it is determined whether or not the updated sub-scanning direction inspection position Ye exceeds the inspection range (whether or not Ye> S) (S843).

そして、副走査方向検査位置Yeが検査範囲を超えていないと判断すると(S843でNo)、S820に移行する。
一方、S843で副走査方向検査位置Yeが検査範囲を超えていると判断すると(Ye>Sであると判断すると)、CPU70は、S847に移行し、副走査方向検査位置Yeを、読取可能領域R0の下端に設定すると共に(Ye=0)、主走査方向検査位置Xeを、X軸方向に8画素進んだ位置に設定する(Xe←Xe+8)。その後、S820に移行する。
If it is determined that the sub-scanning direction inspection position Ye does not exceed the inspection range (No in S843), the process proceeds to S820.
On the other hand, when it is determined in S843 that the sub-scanning direction inspection position Ye exceeds the inspection range (when it is determined that Ye> S), the CPU 70 proceeds to S847, and the sub-scanning direction inspection position Ye is set in the readable area. While setting at the lower end of R0 (Ye = 0), the main scanning direction inspection position Xe is set to a position advanced by 8 pixels in the X-axis direction (Xe ← Xe + 8). Thereafter, the process proceeds to S820.

この他、CPU70は、S825において、検査位置(Xe,Ye)がエッジ点であると判断すると(S825でYes)、S830に移行し、変数(X0,Y0)に、現在の検査位置(Xe,Ye)の座標値を、設定する(X0←Xe,Y0←Ye)。また、変数X1を、値X1=X0+8に更新する(S833)。   In addition, when the CPU 70 determines in S825 that the inspection position (Xe, Ye) is an edge point (Yes in S825), the CPU 70 proceeds to S830 and sets the current inspection position (Xe, Y0) in the variable (X0, Y0). The coordinate value of (Ye) is set (X0 ← Xe, Y0 ← Ye). Also, the variable X1 is updated to the value X1 = X0 + 8 (S833).

その後、CPU70は、座標(X1,Y0−1)の地点、座標(X1,Y0)の地点及び座標(X1,Y0+1)の地点の少なくとも一つが、エッジ点であるか否かを判断し(S837)、座標(X1,Y0−1)の地点、座標(X1,Y0)の地点及び座標(X1,Y0+1)の地点のいずれもがエッジ点でない場合には(S837でNo)、S840に移行する。   Thereafter, the CPU 70 determines whether or not at least one of the coordinates (X1, Y0-1), the coordinates (X1, Y0), and the coordinates (X1, Y0 + 1) is an edge point (S837). ), If any of the point of coordinates (X1, Y0-1), the point of coordinates (X1, Y0), and the point of coordinates (X1, Y0 + 1) is not an edge point (No in S837), the process proceeds to S840. .

一方、座標(X1,Y0−1)の地点、座標(X1,Y0)の地点及び座標(X1,Y0+1)の地点の少なくとも一つがエッジ点であると判断すると(S837でYes)、CPU70は、S850に移行して、座標(X0,Y0)の地点が連続性のあるエッジ点であると判定し、この座標(X0,Y0)を、連続性のあるエッジ点の座標データとして、一時記憶する。   On the other hand, if it is determined that at least one of the coordinates (X1, Y0-1), the coordinates (X1, Y0), and the coordinates (X1, Y0 + 1) is an edge point (Yes in S837), the CPU 70 Moving to S850, it is determined that the point of coordinates (X0, Y0) is a continuous edge point, and this coordinate (X0, Y0) is temporarily stored as coordinate data of a continuous edge point. .

また、この処理を終えると、CPU70は、S860に移行し、座標(X1,Y0−1)の地点、座標(X1,Y0)の地点及び座標(X1,Y0+1)の地点の内、エッジ点である地点の一つを、予め定められた優先度に従って選択する。   When this process is finished, the CPU 70 proceeds to S860, where the coordinates (X1, Y0-1), the coordinates (X1, Y0), and the coordinates (X1, Y0 + 1) are the edge points. One of the points is selected according to a predetermined priority.

具体的に、下エッジ検出処理においては、読取可能領域R0下端側に近い座標ほど高い優先度が設定されている。即ち、読取可能領域R0下端側に近い座標(X1,Y0−1)の地点が優先度「大」に設定され、座標(X1,Y0)の地点が優先度「中」に設定され、座標(X1,Y0+1)の地点が優先度「小」に設定されている。このように優先度が設定されているのは、原稿の下端より下側においては、原稿台11aに何も存在せず、エッジ点は存在しないはずであり、読取可能領域R0下端側に近いエッジ点であるほど、そのエッジ点が原稿の下端に対応するエッジ点である可能性が高いためである。   Specifically, in the lower edge detection process, a higher priority is set for coordinates closer to the lower end side of the readable area R0. That is, the point of the coordinates (X1, Y0-1) close to the lower end side of the readable area R0 is set to the priority “large”, the point of the coordinates (X1, Y0) is set to the priority “medium”, and the coordinates ( The point of (X1, Y0 + 1) is set to the priority “small”. The priority is set in this way because there is nothing on the document table 11a below the lower end of the original, there should be no edge point, and the edge close to the lower end of the readable area R0. This is because the point is more likely to be the edge point corresponding to the lower end of the document.

従って、S860では、この優先度に従って、座標(X1,Y0−1)の地点、座標(X1,Y0)の地点及び座標(X1,Y0+1)の地点の内、エッジ点である地点であって優先度の最も高い地点を選択する。そして、変数X0を、選択した地点のX座標に更新し、変数Y0を、選択した地点のY座標に更新する。その後、変数Cを1加算した値に更新する(S863)。   Therefore, in S860, according to this priority, the point that is the edge point among the point of the coordinate (X1, Y0-1), the point of the coordinate (X1, Y0), and the point of the coordinate (X1, Y0 + 1) is preferred. Select the point with the highest degree. Then, the variable X0 is updated to the X coordinate of the selected point, and the variable Y0 is updated to the Y coordinate of the selected point. Thereafter, the variable C is updated to a value obtained by adding 1 (S863).

また、この処理を終えると、CPU70は、更新後の変数Cの値がC=8であるか否かを判断し(S867)、C=8でないと判断すると(S867でNo)、S833に移行して、変数X1を、X1=X0+8に更新する。その後、S837以降の処理を実行する。   When this process is finished, the CPU 70 determines whether or not the value of the updated variable C is C = 8 (S867). If it is determined that C = 8 is not satisfied (No in S867), the process proceeds to S833. Then, the variable X1 is updated to X1 = X0 + 8. Thereafter, the processing after S837 is executed.

このような処理を実行することにより、CPU70は、X軸方向に8画素おきに、エッジ点がX軸方向に連続するものであるか否かを検査する。そして、C=8であると判断すると(S867でYes)、S850で連続性のあるエッジ点として判定した計8地点の各座標データを、原稿下エッジデータとしてRAM80に記憶する(S870)。   By executing such processing, the CPU 70 checks whether the edge points are continuous in the X-axis direction every 8 pixels in the X-axis direction. If it is determined that C = 8 (Yes in S867), the coordinate data of a total of eight points determined as continuous edge points in S850 are stored in the RAM 80 as document lower edge data (S870).

また、この処理を終えると、CPU70は、S880に移行して、主走査方向検査位置Xeが読取可能領域R0右端を超えているか否か(Xe>XMAXであるか否か)を判断し、主走査方向検査位置Xeが読取可能領域R0右端を超えていないと判断すると(S880でNo)、主走査方向検査位置Xeを64画素進んだ地点に更新して(S885)、S815に移行する。   When this process is finished, the CPU 70 proceeds to S880 to determine whether the main scanning direction inspection position Xe exceeds the right end of the readable area R0 (whether Xe> XMAX). If it is determined that the scanning direction inspection position Xe does not exceed the right end of the readable region R0 (No in S880), the main scanning direction inspection position Xe is updated to a point advanced by 64 pixels (S885), and the process proceeds to S815.

このようにして、CPU70は、連続するエッジ点を、8つずつ、繰返し検出する。そして、主走査方向検出位置Xeが読取可能領域R0右端を超えると(S820でYes又はS880でYes)、S890に移行し、S870で原稿下エッジデータとして記憶された座標データ群の中から、下エッジ(原稿の下端を表すエッジ点)として確度の低い座標データ群を削除して、原稿下エッジデータを確定する。   In this way, the CPU 70 repeatedly detects eight consecutive edge points. When the main scanning direction detection position Xe exceeds the right end of the readable area R0 (Yes in S820 or Yes in S880), the process proceeds to S890, and the coordinate data group stored as the document lower edge data in S870 is The coordinate data group with low accuracy is deleted as an edge (edge point representing the lower end of the document), and the document lower edge data is determined.

具体的には、S590での処理と同様、原稿下エッジデータとして記憶された座標データ群の内、連続性のある座標データ群に対して原稿内側領域に大きくずれた位置にある、明白に連続性のない座標データ群を、原稿下エッジデータから除去し、原稿下エッジデータを確定する。その後、当該下エッジ検出処理を終了する。但し、S890の処理については、実行しないように、下エッジ検出処理を構成してもよい。   Specifically, as in the process at S590, the coordinate data group stored as the document lower edge data is clearly continuously located at a position greatly shifted to the inner area of the document with respect to the coordinate data group having continuity. The inferior coordinate data group is removed from the document lower edge data to determine the document lower edge data. Thereafter, the lower edge detection process ends. However, the lower edge detection process may be configured not to execute the process of S890.

また、このようにして、下エッジ検出処理を終えると、CPU70は、S465に移行し、下エッジ検出処理で確定された原稿下エッジデータが示す各点を直線近似して、原稿下エッジデータが示す点群の近似直線(以下、「下エッジ近似直線」という。)を算出する。その後、S470に移行する。但し、直前の下エッジ検出処理で原稿下エッジデータとして登録された座標データがない場合には、下エッジの検出に失敗したと判断して、下エッジ近似直線を算出することなく、S470に移行するものとする。   In addition, when the lower edge detection process is completed in this way, the CPU 70 proceeds to S465, linearly approximates each point indicated by the document lower edge data determined by the lower edge detection process, and the document lower edge data is obtained. An approximate straight line (hereinafter referred to as a “lower edge approximate straight line”) of the indicated point group is calculated. Thereafter, the process proceeds to S470. However, if there is no coordinate data registered as the document lower edge data in the immediately preceding lower edge detection process, it is determined that the lower edge detection has failed, and the process proceeds to S470 without calculating the lower edge approximate straight line. It shall be.

また、S470に移行すると、CPU70は、右エッジ近似直線、左エッジ近似直線、及び下エッジ近似直線の相互関係から、右エッジ検出処理(S420)、左エッジ検出処理(S450)及び下エッジ検出処理(S460)にて正しく原稿エッジが検出されたか否かを判断する。即ち、右エッジ、左エッジ及び下エッジの全てが正常に検出されたか否かを判断する。   In step S470, the CPU 70 determines the right edge detection process (S420), the left edge detection process (S450), and the lower edge detection process from the mutual relationship between the right edge approximate line, the left edge approximate line, and the lower edge approximate line. In (S460), it is determined whether or not the document edge is correctly detected. That is, it is determined whether all of the right edge, the left edge, and the lower edge have been detected normally.

具体的には、右エッジ近似直線と左エッジ近似直線とが平行な関係にあり、右エッジ近似直線と下エッジ近似直線とが直交関係にあり、左エッジ近似直線と下エッジ近似直線とが直交関係にある場合には、正しく原稿エッジが検出されたとして、S470でYesと判断する。   Specifically, the right edge approximate line and the left edge approximate line are parallel, the right edge approximate line and the lower edge approximate line are orthogonal, and the left edge approximate line and the lower edge approximate line are orthogonal If there is a relationship, it is determined that the document edge is correctly detected, and the determination in S470 is Yes.

一方、右エッジ、左エッジ及び下エッジのいずれか一つの検出にでも失敗している場合や、右エッジ、左エッジ及び下エッジの関係が正しい関係にない場合には、S470でNoと判断する。即ち、右エッジ近似直線と左エッジ近似直線とが平行な関係にあり、右エッジ近似直線と下エッジ近似直線とが直交関係にあり、且つ、左エッジ近似直線と下エッジ近似直線とが直交関係にある場合を除いては、原稿エッジが正しく検出されていないとして、S470でNoと判断する。但し、ここでの相互関係の判定は、誤差を考慮して実行すべきである。   On the other hand, if detection of any one of the right edge, the left edge, and the lower edge fails, or if the relationship between the right edge, the left edge, and the lower edge is not correct, it is determined No in S470. . That is, the right edge approximate line and the left edge approximate line are parallel, the right edge approximate line and the lower edge approximate line are orthogonal, and the left edge approximate line and the lower edge approximate line are orthogonal. Except in the case of No., it is determined that the document edge is not correctly detected, and No is determined in S470. However, the determination of the mutual relationship here should be executed in consideration of an error.

そして、原稿エッジが正しく検出されていないと判断すると(S470でNo)、CPU70は、S471に移行して、「失敗」判定をすると共に、S670での処理と同様、原稿台11aに載置された原稿のサイズが、予め設定された基本サイズであると推定する(S473)。その後、当該原稿推定処理を終了して、S230以降の処理を実行することにより、S473で推定した原稿サイズの情報を基に読取領域等を設定し(S265)、変倍率1且つ傾き補正量ゼロで、コピー動作を実現する。   If it is determined that the document edge is not correctly detected (No in S470), the CPU 70 proceeds to S471 to make a “failure” determination and place it on the document table 11a as in the process in S670. It is estimated that the size of the original is a preset basic size (S473). Thereafter, the document estimation process is terminated, and the processes after S230 are executed to set a reading area and the like based on the document size information estimated in S473 (S265), with a scaling factor of 1 and an inclination correction amount of zero. The copy operation is realized.

これに対し、S470で原稿エッジが正しく検出されていると判断すると(S470でYes)、CPU70は、S481に移行して、原稿の左下角位置を、左エッジ近似直線と下エッジ近似直線との交点であると推定して、その座標値を算出し、更に、原稿の右下角位置を、右エッジ近似直線と下エッジ近似直線との交点であると推定して、その座標値を算出する(S483)。尚、図12は、S481及びS483での原稿左下角位置Ka及び原稿右下角位置Kbの推定方法を示した説明図である。図中、白丸がエッジ点を表し、黒丸が角位置Ka,Kbを表す。   On the other hand, if it is determined in S470 that the document edge is correctly detected (Yes in S470), the CPU 70 proceeds to S481 and sets the lower left corner position of the document between the left edge approximate line and the lower edge approximate line. It is estimated that the point is an intersection, and its coordinate value is calculated. Further, the lower right corner position of the document is estimated to be the intersection of the right edge approximate line and the lower edge approximate line, and the coordinate value is calculated ( S483). FIG. 12 is an explanatory diagram showing a method for estimating the document lower left corner position Ka and the document lower right corner position Kb in S481 and S483. In the figure, white circles represent edge points, and black circles represent the corner positions Ka and Kb.

また、S483での処理を終えると、CPU70は、上記推定した原稿の左下角位置及び右下角位置の関係から、S445での処理と同様に、検査対象データにおける原稿領域を推定する(S485)。   When the process in S483 is completed, the CPU 70 estimates the document area in the inspection target data from the estimated relationship between the lower left corner position and the lower right corner position of the document, similarly to the process in S445 (S485).

具体的に、S485では、下エッジ近似直線の線分であって原稿左下角位置に対応する地点から原稿右下角位置に対応する地点までの線分、右エッジ近似直線の線分であって原稿右下角位置に対応する地点からY軸プラス方向に検査対象データの端縁までの線分、左エッジ近似直線の線分であって原稿左下角位置に対応する地点からY軸プラス方向に検査対象データの端縁までの線分に囲まれる検査対象データ内の領域を、原稿領域と推定する(図9(c)参照)。   Specifically, in S485, the line segment of the lower edge approximate straight line, the line segment from the point corresponding to the lower left corner position of the document to the point corresponding to the lower right corner position of the document, the line segment of the right edge approximate straight line and the original document The line segment from the point corresponding to the lower right corner position to the edge of the inspection target data in the Y axis plus direction, the line segment of the left edge approximate straight line, and the inspection object in the Y axis plus direction from the point corresponding to the lower left corner position of the document An area in the inspection target data surrounded by the line segment to the edge of the data is estimated as a document area (see FIG. 9C).

また、S485での処理を終えると、CPU70は、S490に移行し、S447での処理と同様に、図9(a)に示す原稿推定副処理を実行する。
即ち、CPU70は、S610にて、S485で推定した原稿領域の情報に基づき、検査対象データの原稿領域外の領域でのエッジ点の占有率を算出する。但し、S490で実行する原稿推定副処理のS610では、上記計算式に従って占有率を算出する際、上記「原稿領域外のエッジ点の数」に、原稿右エッジデータ及び原稿左エッジデータ及び原稿下エッジデータのいずれかに登録されたエッジ点であって原稿領域外にあるエッジ点の数を含ませないものとする。即ち、S610では、例外的に、原稿右エッジデータ及び原稿左エッジデータ及び原稿下エッジデータのいずれかに登録されたエッジ点について、そのエッジ点が原稿領域外にある場合でも、これを原稿領域外のエッジ点の数としてカウントしないものとする。
When the process in S485 is completed, the CPU 70 proceeds to S490 and executes the document estimation sub-process shown in FIG. 9A as in the process in S447.
That is, in S610, the CPU 70 calculates the occupancy rate of the edge points in the area outside the document area of the inspection target data based on the document area information estimated in S485. However, in S610 of the document estimation sub-process executed in S490, when the occupation ratio is calculated according to the above calculation formula, the “right edge data outside the document area”, the document left edge data, and the document bottom It is assumed that the number of edge points registered in one of the edge data and outside the document area is not included. That is, in S610, as an exception, even if the edge point registered in any of the document right edge data, document left edge data, and document bottom edge data is outside the document area, It is not counted as the number of outside edge points.

尚、図9(c)は、S490で実行する原稿推定副処理にて、原稿領域外と取り扱われる検査対象データの領域の具体例を、斜線により示した説明図である。
また、S610での処理を終えると、CPU70は、S610で算出した占有率が閾値以下であるか否かを判断し(S620)、算出した占有率が閾値以下である場合には(S620でYes)、S485で推定した原稿領域の確度が高いと評価し、「確度高」と判定する(S630)。尚、S630で「確度高」と判定した場合、CPU70は、S245においてYesと判断する。
FIG. 9C is an explanatory diagram showing a specific example of the area of the inspection target data that is handled as being outside the original area in the original estimation sub-process executed in S490.
When the processing in S610 is completed, the CPU 70 determines whether or not the occupation rate calculated in S610 is equal to or less than the threshold (S620). If the calculated occupation rate is equal to or less than the threshold (Yes in S620). ), It is evaluated that the accuracy of the document area estimated in S485 is high, and it is determined that the accuracy is high (S630). If the CPU 70 determines “high accuracy” in S630, the CPU 70 determines Yes in S245.

また、この処理を終えると、CPU70は、S640に移行し、S481及びS483で推定した原稿の左下角位置及び右下角位置を結ぶ線分が原稿短辺であり、原稿台11aに載置されている原稿が定型用紙であると仮定して、原稿台11aに載置された原稿のサイズ及び原稿台11aにおける原稿の載置領域を推定すると共に、原稿台11aに載置されている原稿の傾き角θを右エッジ近似直線を基に推定する(S650)。即ち、S650では、Y軸に対して右エッジ近似直線がなす角度を、原稿の傾き角θと推定する。その後、当該原稿推定副処理を終了する。   When this processing is completed, the CPU 70 proceeds to S640, and the line segment connecting the lower left corner position and the lower right corner position of the document estimated in S481 and S483 is the document short side and is placed on the document table 11a. Assuming that the original is a standard paper, the size of the original placed on the original platen 11a and the placement area of the original on the original platen 11a are estimated, and the inclination of the original placed on the original platen 11a is estimated. The angle θ is estimated based on the right edge approximate straight line (S650). That is, in S650, the angle formed by the right edge approximate line with respect to the Y axis is estimated as the document inclination angle θ. Thereafter, the document estimation sub-process is terminated.

これに対し、S610で算出した占有率が閾値を超えていると判断すると(S620でNo)、CPU70は、予め推定した原稿領域の確度が低いと評価して、「確度低」と判定し(S660)、S481及びS483で推定した左下角位置及び右下角位置の情報を用いずに、原稿台11aに載置された原稿のサイズが、予め設定された基本サイズであると推定する(S670)。その後、当該原稿推定副処理を終了する。尚、S660で「確度低」と判定した場合、CPU70は、S245においてNoと判断する。   On the other hand, if it is determined that the occupation rate calculated in S610 exceeds the threshold (No in S620), the CPU 70 evaluates that the accuracy of the document area estimated in advance is low, and determines that “the accuracy is low” ( S660), without using the information of the lower left corner position and the lower right corner position estimated in S481 and S483, it is estimated that the size of the document placed on the document table 11a is a preset basic size (S670). . Thereafter, the document estimation sub-process is terminated. If it is determined that the accuracy is low in S660, the CPU 70 determines No in S245.

S490で、このようにして原稿推定副処理を終了すると、CPU70は、S220での原稿推定処理を終了して、S230に移行し、後続の処理を実行する。
このような動作により、CPU70は、プレスキャンにより得られたエッジ画像データ(検査対象データ)から推定した原稿領域の確度が高い場合には、原稿が定型用紙であるとの仮定の下、エッジ画像データにより推定した原稿左下角位置及び右下角位置の情報に基づき、原稿台11aに載置された原稿のサイズを推定すると共に原稿の傾き角θを推定し、これに基づき、変倍率及び傾き補正量を設定し(S251,S253)、更に読取領域を設定する(S255)。その後、本スキャンに移行する(S270)。
When the document estimation sub-process is terminated in this way at S490, the CPU 70 terminates the document estimation process at S220, proceeds to S230, and executes subsequent processes.
With such an operation, the CPU 70 assumes that the original is a standard paper when the accuracy of the original area estimated from the edge image data (inspection target data) obtained by the prescan is high. Based on the information of the lower left corner position and the lower right corner position estimated from the data, the size of the document placed on the document table 11a is estimated and the inclination angle θ of the document is estimated. Based on this, the scaling factor and the inclination correction are performed. An amount is set (S251, S253), and a reading area is further set (S255). Thereafter, the process proceeds to the main scan (S270).

そして、本スキャン(S270)では、上記設定した読取領域下において読取ユニット15を搬送し、その領域に写る画像を読取ユニット15に読み取らせる。そして、その読取結果を、上記設定した変倍率に合わせて拡大/縮小処理すると共に、上記設定した傾き補正量に合わせて回転処理して、印刷用の画像データを生成する。また、これを印刷対象データとして印刷処理することで、原稿のコピー画像であって、自動変倍され、更に傾き補正された画像を、印刷部30を通じて、記録紙に印刷する。   In the main scan (S270), the reading unit 15 is transported under the set reading area, and the reading unit 15 is caused to read an image shown in the area. Then, the read result is enlarged / reduced in accordance with the set variable magnification, and rotated in accordance with the set inclination correction amount to generate image data for printing. Also, by printing this as print target data, a copy image of the original, which has been automatically scaled and further tilt-corrected, is printed on recording paper through the printing unit 30.

一方、CPU70は、プレスキャンにより得られたエッジ画像データから推定した原稿領域の確度が低い場合には、原稿が基本サイズの原稿であると推定すると共に(S670)、原稿の左下角が原稿台11aの左下角に合わせられて、当該原稿がまっすぐ正確に載置されていると仮定して、傾き補正量をゼロに設定し(S263)、更に、自動変倍機能を無効にするように変倍率1に設定する(S261)。   On the other hand, when the accuracy of the document area estimated from the edge image data obtained by the prescan is low, the CPU 70 estimates that the document is a basic size document (S670), and the lower left corner of the document is the document table. Assuming that the document is placed in a straight line with the lower left corner of 11a, the tilt correction amount is set to zero (S263), and the automatic scaling function is disabled. The magnification is set to 1 (S261).

また、推定した原稿サイズに合わせて読取領域を設定し(S265)、本スキャンに移行する(S270)。そして、原稿のコピー画像を、変倍率1で、印刷部30を通じて、記録紙に印刷する。   Further, a reading area is set according to the estimated document size (S265), and the process proceeds to the main scan (S270). Then, a copy image of the document is printed on the recording paper through the printing unit 30 at a scaling factor of 1.

以上、本実施例のディジタル複合機1の構成について説明したが、本実施例の複合機1では、読取可能領域R0の一部領域をプレスキャンして、その読取結果に基づき、原稿の状態(原稿サイズ・原稿の傾き・原稿の載置領域)を推定するようにした。従って、本実施例によれば、従来のように、読取可能領域R0全体をプレスキャンする手法よりも高速にプレスキャン動作を終了することができて、効率的に原稿の状態を推定することができる。   The configuration of the digital multi-function peripheral 1 according to the present embodiment has been described above. However, in the multi-function peripheral 1 according to the present embodiment, a partial area of the readable area R0 is pre-scanned, and the document state ( The document size, document tilt, and document placement area are estimated. Therefore, according to the present embodiment, the prescan operation can be completed faster than the conventional method of prescanning the entire readable region R0, and the state of the document can be estimated efficiently. it can.

但し、このように読取可能領域R0全体ではなく、一部領域をプレスキャンする手法を採用すると、原稿の全体像をプレスキャンで読み取ることができなり、原稿状態の推定精度が悪くなる可能性がある。   However, if a method of pre-scanning a partial area instead of the entire readable area R0 is adopted, the entire image of the original can be read by pre-scanning, and the estimation accuracy of the original state may be deteriorated. is there.

そこで、本実施例では、上述したように、プレスキャンにより得られたエッジ画像データから推定した原稿領域の確度を評価して、確度が高い場合には、その原稿領域を導出する基となった原稿左下角及び右下角の位置座標の情報から、原稿のサイズ(縦幅・横幅)を推定するが、確度が低い場合には、原稿サイズが、ユーザにより予め定められたサイズであると推定するようにした。   Therefore, in this embodiment, as described above, the accuracy of the document area estimated from the edge image data obtained by the pre-scan is evaluated, and when the accuracy is high, the document area is derived. The document size (vertical width / horizontal width) is estimated from the position coordinate information of the lower left corner and the lower right corner of the document. If the accuracy is low, the document size is estimated to be a size predetermined by the user. I did it.

従って、本実施例によれば、エッジ画像データから原稿領域を推定する過程で、原稿に描写された罫線などの図形に惑わされて、その原稿領域の推定に誤りが生じた場合に、適切にモードを切り替えて、ユーザの要望(ユーザから指定されたサイズ)にあわせた処理を実行することができる。従って、本実施例によれば、誤った推定により、誤った変倍率や読取領域を設定してしまい、ユーザにとって不要なコピー動作が実行されてしまうのを抑えることができる。よって、本実施例によれば、ユーザに対して利便性の高い複合機1を提供することができる。   Therefore, according to the present embodiment, in the process of estimating the document area from the edge image data, when an error occurs in the estimation of the document area due to being confused by a figure such as a ruled line drawn on the document, It is possible to execute processing in accordance with the user's desire (size specified by the user) by switching the mode. Therefore, according to the present embodiment, it is possible to prevent an erroneous scaling ratio or reading area from being set due to erroneous estimation and a copy operation unnecessary for the user from being executed. Therefore, according to the present embodiment, it is possible to provide the multifunction device 1 that is highly convenient for the user.

尚、上記実施例では、S660で「確度低」と判定した際に、ユーザに対して、その旨を報知せずに、S670に移行するようにしたが、S660では、表示操作部50のディスプレイを通じて「確度低」と判定した旨を報知するようにしてもよい。   In the above embodiment, when it is determined that the “accuracy is low” in S660, the process is shifted to S670 without notifying the user, but in S660, the display of the display operation unit 50 is displayed. It is also possible to notify that it is determined that “the accuracy is low”.

この他、S660では、表示操作部50のディスプレイを通じて「確度低」と判定した旨を報知すると共に、後続の処理を継続するか否かをユーザに問い合わせ、操作キーを通じて継続する旨の回答が入力された場合には、S670に移行するが、操作キーを通じて継続しない旨の回答が入力された場合には、S670に移行せずに、S660の処理をするに至ったコピー指令に対応する複写制御処理を終了し、当該コピー指令を無効にするようにしてもよい。   In addition, in S660, while notifying that the “accuracy is low” is displayed through the display of the display operation unit 50, the user is inquired as to whether or not to continue the subsequent processing, and an answer to continue using the operation key is input. If YES, the process proceeds to S670, but if an answer indicating that the operation is not continued is input through the operation key, the process does not proceed to S670 and the copy control corresponding to the copy command that has led to the process of S660 is performed. The processing may be terminated and the copy command may be invalidated.

また、S490で実行する原稿推定副処理は、図13(a)に示す内容に変更されてもよい。
[変形例]
図13(a)は、CPU70がS490で実行する変形例の原稿推定副処理を表すフローチャートである。図13(a)に示す原稿推定副処理を開始すると、CPU70は、S450で推定した左エッジ近似直線により分離される検査対象データの領域であって原稿領域外側の領域を、占有率算出領域に設定して、当該占有率算出領域におけるエッジ点の占有率を算出する(S1010)。尚、図13(b)は、S1010で設定する占有率算出領域の具体例を示した説明図である。図中、太線は、推定した原稿領域の外縁を表し、斜線は、占有率算出領域を表す。
Further, the document estimation sub-process executed in S490 may be changed to the content shown in FIG.
[Modification]
FIG. 13A is a flowchart showing the document estimation sub-process of the modification executed by CPU 70 in S490. When the document estimation sub-process shown in FIG. 13A is started, the CPU 70 sets the area outside the document area, which is the area to be inspected separated by the left edge approximate straight line estimated in S450, as the occupation rate calculation area. Then, the occupancy rate of the edge points in the occupancy rate calculation area is calculated (S1010). FIG. 13B is an explanatory diagram showing a specific example of the occupation rate calculation area set in S1010. In the figure, the bold line represents the estimated outer edge of the document area, and the hatched line represents the occupation rate calculation area.

具体的に、S1010では、次の計算式『占有率=占有率算出領域のエッジ点の数÷占有率算出領域の総画素数』に従って、占有率算出領域内のエッジ点の占有率を算出する。但し、ここでは、例外的に、原稿左エッジデータとして登録されたエッジ点について、そのエッジ点が占有率算出領域にある場合、それを占有率算出領域のエッジ点の数としてカウントしないものとする。即ち、S1010では、上記「占有率算出領域のエッジ点の数」に、原稿左エッジデータとして登録されたエッジ点であって占有率算出領域にあるエッジ点の数を含ませないものとする。   Specifically, in S1010, the occupancy rate of the edge points in the occupancy rate calculation area is calculated according to the following calculation formula: “occupancy rate = number of edge points in the occupancy rate calculation region ÷ total number of pixels in the occupancy rate calculation region”. . However, here, as an exception, when an edge point registered as document left edge data is in the occupancy rate calculation area, it is not counted as the number of edge points in the occupancy rate calculation area. . That is, in S1010, the “number of edge points in the occupation rate calculation area” does not include the number of edge points registered in the document left edge data and in the occupation rate calculation area.

また、この処理を終えると、CPU70は、S1010で算出した占有率が、予め定められた閾値以下であるか否かを判断し(S1020)、上記算出した占有率が閾値を越えていると判断すると(S1020でNo)、S1080に移行し、上述したS660〜S670の処理と同様の後続処理(S1080〜S1090)を実行する。その後、当該原稿推定副処理を終了する。   When this process is finished, the CPU 70 determines whether or not the occupation rate calculated in S1010 is equal to or less than a predetermined threshold (S1020), and determines that the calculated occupation rate exceeds the threshold. Then (No in S1020), the process proceeds to S1080, and subsequent processes (S1080 to S1090) similar to the processes of S660 to S670 described above are executed. Thereafter, the document estimation sub-process is terminated.

一方、上記算出した占有率が閾値以下であると判断すると(S1020でYes)、CPU70は、S1030に移行し、S460で推定した下エッジ近似直線により分離される検査対象データの領域であって原稿領域外側の領域を、占有率算出領域に設定し、S1010と同様の計算式に従って、当該占有率算出領域におけるエッジ点の占有率を算出する(S1030)。   On the other hand, if it is determined that the calculated occupancy is equal to or less than the threshold (Yes in S1020), the CPU 70 proceeds to S1030 and is an area of the inspection target data separated by the lower edge approximate straight line estimated in S460, and the document The area outside the area is set as an occupancy ratio calculation area, and the occupancy ratio of edge points in the occupancy ratio calculation area is calculated according to the same calculation formula as in S1010 (S1030).

尚、図13(c)は、S1030で設定する占有率算出領域の具体例を示した説明図である。図中、太線は、推定した原稿領域の外縁を表し、斜線は、占有率算出領域を表す。
但し、ここでは、例外的に、原稿下エッジデータとして登録されたエッジ点について、そのエッジ点が占有率算出領域にある場合、それを占有率算出領域のエッジ点の数としてカウントしないものとする。即ち、S1030では、上記「占有率算出領域のエッジ点の数」に、原稿下エッジデータとして登録されたエッジ点であって占有率算出領域にあるエッジ点の数を含ませないものとする。
FIG. 13C is an explanatory diagram showing a specific example of the occupation rate calculation area set in S1030. In the figure, the bold line represents the estimated outer edge of the document area, and the hatched line represents the occupation rate calculation area.
However, here, as an exception, if the edge point registered as the document lower edge data is in the occupation rate calculation area, it is not counted as the number of edge points in the occupation rate calculation area. . That is, in S1030, the “number of edge points in the occupation rate calculation area” does not include the number of edge points registered as the document lower edge data and in the occupation rate calculation area.

また、この処理を終えると、CPU70は、S1030で算出した占有率が、予め定められた閾値以下であるか否かを判断し(S1040)、上記算出した占有率が閾値を越えていると判断すると(S1040でNo)、S1080に移行し、上述したS660〜S670の処理と同様の後続処理(S1080〜S1090)を実行した後、当該原稿推定副処理を終了する。   When this process is finished, the CPU 70 determines whether or not the occupation rate calculated in S1030 is equal to or less than a predetermined threshold (S1040), and determines that the calculated occupation rate exceeds the threshold. Then (No in S1040), the process proceeds to S1080, the subsequent processes (S1080 to S1090) similar to the processes of S660 to S670 described above are executed, and then the document estimation sub-process is terminated.

一方、上記算出した占有率が閾値以下であると判断すると(S1040でYes)、CPU70は、S1050に移行し、上述したS630〜S650の処理と同様の後続処理(S1050〜S1070)を実行する。その後、当該原稿推定副処理を終了する。   On the other hand, if it is determined that the calculated occupancy is equal to or less than the threshold (Yes in S1040), the CPU 70 proceeds to S1050 and executes subsequent processes (S1050 to S1070) similar to the processes of S630 to S650 described above. Thereafter, the document estimation sub-process is terminated.

以上、変形例の原稿推定副処理について説明したが、S490において、このような内容の原稿推定副処理を実行しても、概ね、図9(a)に示す原稿推定副処理と同様の効果を得ることができる。   Although the document estimation sub-process of the modification has been described above, even if the document estimation sub-process having such contents is executed in S490, the same effects as the document estimation sub-process shown in FIG. Obtainable.

また、以上には、本発明の実施例について説明したが、本発明の抽出手段は、上記実施例において、CPU70が実行するS215,S420,S450,S460の処理により実現され、外縁認識手段は、S437,S455,S465,S441〜S445,S481〜S485の処理により実現され、確度評価手段は、S610〜S630,S660,S1010〜S1050,S1080の処理により実現されている。   Further, although the embodiment of the present invention has been described above, the extraction means of the present invention is realized by the processing of S215, S420, S450, S460 executed by the CPU 70 in the above embodiment, and the outer edge recognition means is S437, S455, S465, S441 to S445, S481 to S485 are realized, and the accuracy evaluation means is realized by S610 to S630, S660, S1010 to S1050, and S1080.

また、プレスキャン手段は、CPU70が実行するS210の処理及び読取制御部20の動作により実現され、原稿サイズ推定手段は、S640,S670,S1060,S1090の処理により実現され、読取領域決定手段は、S255,S265の処理により実現され、本スキャン手段は、S270の処理及び読取制御部20の動作により実現されている。   The pre-scanning means is realized by the processing of S210 executed by the CPU 70 and the operation of the reading control unit 20, the document size estimation means is realized by the processing of S640, S670, S1060, and S1090, and the reading area determining means is This scanning means is realized by the processing of S255 and S265, and is realized by the processing of S270 and the operation of the reading control unit 20.

また、本発明は、上記実施例に限定されるものではなく、種々の態様を採ることができる。例えば、上記実施例では、コンタクトイメージセンサを読取ユニットとして備えるディジタル複合機1に、本発明を適用した例を説明したが、本発明は、コンタクトイメージセンサを読取ユニットとして備える画像読取装置に限定されるものではないことは言うまでもない。   Further, the present invention is not limited to the above-described embodiments, and can take various forms. For example, in the above-described embodiment, the example in which the present invention is applied to the digital multifunction peripheral 1 including the contact image sensor as a reading unit has been described. However, the present invention is limited to an image reading apparatus including the contact image sensor as a reading unit. Needless to say, it is not something.

ディジタル複合機1の構成を表す説明図である。2 is an explanatory diagram illustrating a configuration of a digital multi-function peripheral 1. FIG. 読取ガラス11の読取可能領域R0を示した説明図である。It is explanatory drawing which showed readable area | region R0 of the reading glass. CPU70が実行する複写制御処理を表すフローチャートである。6 is a flowchart illustrating a copy control process executed by a CPU. CPU70が実行する自動変倍複写処理を表すフローチャートである。6 is a flowchart showing an automatic scaling copying process executed by a CPU. CPU70が実行する原稿推定処理を表すフローチャートである。6 is a flowchart showing document estimation processing executed by CPU. CPU70が実行する右エッジ検出処理を表すフローチャートである。It is a flowchart showing the right edge detection process which CPU70 performs. エッジ画像データの構成を示した説明図である。It is explanatory drawing which showed the structure of edge image data. 原稿右エッジデータの確定手法を説明した説明図である。FIG. 6 is an explanatory diagram illustrating a method for determining original right edge data. CPU70が実行する原稿推定副処理を表すフローチャート(a)及び占有率算出領域に関する説明図(b)(c)である。FIG. 6 is a flowchart (a) showing a document estimation sub-process executed by a CPU 70 and explanatory diagrams (b) and (c) regarding an occupation rate calculation area. CPU70が実行する左エッジ検出処理を表すフローチャートである。It is a flowchart showing the left edge detection process which CPU70 performs. CPU70が実行する下エッジ検出処理を表すフローチャートである。It is a flowchart showing the lower edge detection process which CPU70 performs. 原稿左下角位置及び原稿右下角位置の推定方法を示した説明図である。FIG. 5 is an explanatory diagram showing a method for estimating a document lower left corner position and a document lower right corner position. CPU70が実行する変形例の原稿推定副処理を表すフローチャート(a)及び占有率算出領域に関する説明図(b)(c)である。FIG. 6 is a flowchart (a) showing a document estimation sub-process of a modification executed by the CPU 70 and explanatory diagrams (b) and (c) regarding an occupation rate calculation area.

符号の説明Explanation of symbols

1…ディジタル複合機、10…画像読取部、11…読取ガラス、11a…原稿台、13…筐体、13a…フレーム、15…読取ユニット、16…搬送機構、17…モータ、20…読取制御部、30…印刷部、40…印刷制御部、50…表示操作部、60…通信部、70…CPU、80…RAM、90…フラッシュメモリ、MK…マーク、P…原稿、R0…読取可能領域 DESCRIPTION OF SYMBOLS 1 ... Digital compound machine, 10 ... Image reading part, 11 ... Reading glass, 11a ... Original plate, 13 ... Housing | casing, 13a ... Frame, 15 ... Reading unit, 16 ... Conveyance mechanism, 17 ... Motor, 20 ... Reading control part , 30 ... printing section, 40 ... print control section, 50 ... display operation section, 60 ... communication section, 70 ... CPU, 80 ... RAM, 90 ... flash memory, MK ... mark, P ... original, R0 ... readable area

Claims (7)

読取対象の原稿が載置される透明な原稿台下において読取ユニットを搬送し、前記原稿台に写る画像を、前記読取ユニットに読み取らせることにより、前記原稿台に載置された原稿の読取画像を表す画像データを生成する画像読取装置であって、
前記読取ユニットの読取結果である画像データを、エッジ画像を表すエッジ画像データに変換し、当該エッジ画像データの中から、記原稿台に載置された原稿の辺に対応するエッジ点群として推定されるエッジ点群を抽出する抽出手段と、
前記抽出手段により抽出された原稿の各辺に対応するエッジ点群を直線近似することにより原稿の外縁を認識する外縁認識手段と、
前記外縁認識手段により認識された前記原稿の外縁より前記原稿台の縁側領域のエッジ点の分布に基づき、前記外縁認識手段により認識された前記外縁の確度の高低を評価する手段であって、前記外縁認識手段により認識された前記原稿の外縁より前記原稿台の縁側領域に分布するエッジ点の量を算出して、前記算出したエッジ点の量が、閾値を超えている場合には、前記外縁認識手段により認識された前記外縁の確度が低いと評価し、前記算出したエッジ点の量が閾値以下である場合には、前記確度が高いと評価する確度評価手段と、
を備えることを特徴とする画像読取装置。
A reading unit is conveyed under a transparent document table on which a document to be read is placed, and an image on the document table is read by the reading unit, whereby a read image of the document placed on the document table is read. An image reading device for generating image data representing
Image data which is read result of the reading unit, is converted into an edge image data representing an edge image, from among the edge image data, as edge points corresponding to edges of the front SL document placed on the document table Extracting means for extracting the estimated edge point group ;
Outer edge recognition means for recognizing the outer edge of the original by linearly approximating edge points corresponding to each side of the original extracted by the extraction means;
Means for evaluating the accuracy of the outer edge recognized by the outer edge recognition means based on the distribution of edge points of the edge side region of the document table from the outer edge of the original recognized by the outer edge recognition means , The amount of edge points distributed in the edge side region of the document table is calculated from the outer edge of the document recognized by the outer edge recognition means, and when the calculated amount of edge points exceeds a threshold, the outer edge When the accuracy of the outer edge recognized by the recognition unit is evaluated to be low, and the amount of the calculated edge point is equal to or less than a threshold, the accuracy evaluation unit to evaluate that the accuracy is high ,
An image reading apparatus comprising:
前記読取ユニットが読取可能な前記原稿台の領域である読取可能領域の内、一部領域において前記読取ユニットを搬送し、前記一部領域において前記読取ユニットに読取動作を実行させるプレスキャン手段
を備え、
前記抽出手段は、前記プレスキャン手段の動作によって得られた前記読取ユニットの読取結果である画像データを、エッジ画像を表すエッジ画像データに変換し、当該エッジ画像データの中から、記原稿台に載置された原稿の辺に対応するエッジ点群として推定されるエッジ点群を抽出する構成にされていること
を特徴とする請求項1記載の画像読取装置。
Pre-scanning means for conveying the reading unit in a partial area of the readable area that is an area of the original platen that can be read by the reading unit and causing the reading unit to perform a reading operation in the partial area. ,
The extracting means, the image data is a read result of the reading unit obtained by the operation of the pre-scanning unit, is converted into an edge image data representing an edge image, from among the edge image data, before Symbol platen The image reading apparatus according to claim 1, wherein an edge point group estimated as an edge point group corresponding to a side of the document placed on the document is extracted.
前記原稿台は、四角形状にされ、四つ角の内、一つの特定の角が、原稿の角を合わせるべき位置として定められたものであり、
前記プレスキャン手段は、前記原稿台における前記特定の角から延びる前記原稿台の一辺を構成する前記原稿台の端縁から、前記原稿台内側に所定距離離れた位置までの領域であって前記読取可能領域に該当する部位を、前記一部領域として、当該領域において、前記読取ユニットを搬送し、前記読取ユニットに読取動作を実行させる構成にされていることを特徴とする請求項2記載の画像読取装置。
The document table has a quadrangular shape, and one specific corner among the four corners is defined as a position where the corners of the document should be aligned,
The pre-scanning unit is an area from the edge of the document table that forms one side of the document table extending from the specific corner of the document table to a position that is a predetermined distance away from the document table inside. The image according to claim 2 , wherein a part corresponding to a possible area is defined as the partial area, and the reading unit is transported in the area to cause the reading unit to perform a reading operation. Reader.
前記確度評価手段により確度が高いと評価されると、前記外縁認識手段により認識された原稿の外縁から前記原稿台に載置された原稿のサイズを推定するが、前記確度評価手段により確度が低いと評価されると、前記原稿台に載置された原稿のサイズが、予め定められたサイズであると推定する原稿サイズ推定手段
を備えることを特徴とする請求項1〜請求項3のいずれかに記載の画像読取装置。
If the accuracy evaluation unit evaluates that the accuracy is high, the size of the document placed on the document table is estimated from the outer edge of the document recognized by the outer edge recognition unit, but the accuracy is low by the accuracy evaluation unit. When evaluated as the size of the document placed on the platen is any one of claims 1 to 3, characterized in that it comprises a document size estimation means for estimating that the predetermined size The image reading apparatus described in 1.
前記抽出手段は、前記原稿台に載置された原稿の三辺の夫々について、前記エッジ画像データの中から、この辺に対応するエッジ点群として推定されるエッジ点群を抽出する構成にされ、
前記外縁認識手段は、前記抽出手段により抽出された各辺に対応するエッジ点群を直線近似して得られる三本の直線が交わる二つの交点を、前記原稿台に載置された原稿の角であると認識する構成にされ、
更に、当該画像読取装置は、
前記確度評価手段により確度が高いと評価されると、前記原稿台に載置された原稿が定型の用紙であるとの仮定の下で、前記外縁認識手段により原稿の角であると認識された前記二つの交点間の距離に基づき、前記原稿台に載置された原稿のサイズを推定するが、前記確度評価手段により確度が低いと評価されると、前記原稿台に載置された原稿のサイズが、予め定められたサイズであると推定する原稿サイズ推定手段
を備えることを特徴とする請求項2又は請求項3記載の画像読取装置。
The extraction means is configured to extract an edge point group estimated as an edge point group corresponding to this side from the edge image data for each of the three sides of the document placed on the document table ,
The outer edge recognizing means sets two intersection points at which three straight lines obtained by linearly approximating the edge point group corresponding to each side extracted by the extracting means to the corners of the document placed on the document table. It is configured to recognize that
Furthermore, the image reading apparatus
If the accuracy evaluation unit evaluates that the accuracy is high, the outer edge recognition unit recognizes the corner of the document under the assumption that the document placed on the document table is a standard sheet. Based on the distance between the two intersections, the size of the document placed on the document table is estimated. If the accuracy evaluation means evaluates that the accuracy is low, the size of the document placed on the document table is estimated. The image reading apparatus according to claim 2, further comprising a document size estimation unit configured to estimate that the size is a predetermined size.
前記抽出手段は、前記エッジ画像データの中から、前記原稿台における特定の角から延びる前記原稿台の辺、に対向する前記原稿台に載置された原稿の辺に対応するエッジ点群として推定されるエッジ点群を抽出する構成にされ、
前記確度評価手段は、前記抽出手段により抽出された前記原稿台における特定の角から延びる前記原稿台の辺、に対向する前記原稿台に載置された原稿の辺に対応するエッジ点群の近似直線と、前記原稿台の外縁と、により囲まれる領域に対応するエッジ画像データの領域において、エッジ点群が占める量を、前記外縁認識手段により認識された前記原稿の外縁より前記原稿台の縁側領域に分布するエッジ点の量として算出し、前記算出したエッジ点の量が、閾値を超えている場合には、前記外縁認識手段により認識された前記外縁の確度が低いと評価し、前記算出したエッジ点の量が閾値以下である場合には、前記確度が高いと評価する構成にされていること
を特徴とする請求項3記載の画像読取装置。
The extraction means estimates from the edge image data as an edge point group corresponding to a side of the document placed on the document table facing a side of the document table extending from a specific corner of the document table. Is configured to extract the edge point group ,
The accuracy evaluation unit approximates an edge point group corresponding to a side of the document placed on the document table opposite to a side of the document table extending from a specific corner of the document table extracted by the extraction unit. The amount of the edge point group in the area of the edge image data corresponding to the area surrounded by the straight line and the outer edge of the document table is the edge side of the document table from the outer edge of the document recognized by the outer edge recognition means. Calculated as the amount of edge points distributed in the region, and when the calculated amount of edge points exceeds a threshold value, the accuracy of the outer edge recognized by the outer edge recognition means is evaluated to be low, and the calculation The image reading apparatus according to claim 3 , wherein when the amount of edge points is equal to or less than a threshold value, the accuracy is evaluated to be high.
前記原稿サイズ推定手段により推定された原稿サイズの情報に基づき、前記読取ユニットによる読取領域を決定する読取領域決定手段と、
前記読取対象領域決定手段により決定された前記読取領域において、前記読取ユニットを搬送し、前記読取ユニットに読取動作を実行させることにより、前記原稿台に載置された原稿の読取画像を表す画像データを生成する本スキャン手段と、
を備えることを特徴とする請求項4又は請求項5記載の画像読取装置。
A reading area determining means for determining a reading area by the reading unit based on the information of the document size estimated by the document size estimating means;
Image data representing a read image of a document placed on the document table by transporting the reading unit and causing the reading unit to perform a reading operation in the reading region determined by the reading target region determining means. A main scanning means for generating
The image reading apparatus according to claim 4, further comprising:
JP2007340769A 2007-12-28 2007-12-28 Image reading device Expired - Fee Related JP4924416B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2007340769A JP4924416B2 (en) 2007-12-28 2007-12-28 Image reading device
US12/341,963 US8284463B2 (en) 2007-12-28 2008-12-22 Image reading apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007340769A JP4924416B2 (en) 2007-12-28 2007-12-28 Image reading device

Publications (2)

Publication Number Publication Date
JP2009164805A JP2009164805A (en) 2009-07-23
JP4924416B2 true JP4924416B2 (en) 2012-04-25

Family

ID=40966914

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007340769A Expired - Fee Related JP4924416B2 (en) 2007-12-28 2007-12-28 Image reading device

Country Status (1)

Country Link
JP (1) JP4924416B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5618664B2 (en) * 2010-07-16 2014-11-05 キヤノン株式会社 Image processing method, program, image reading apparatus, and information device
JP6521614B2 (en) * 2014-11-27 2019-05-29 シャープ株式会社 Image forming device
JP6648455B2 (en) * 2015-09-16 2020-02-14 富士ゼロックス株式会社 Image reading apparatus and image forming apparatus
JP7159878B2 (en) * 2019-01-09 2022-10-25 コニカミノルタ株式会社 Image processing device, image processing method and image processing program

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2502591B2 (en) * 1987-05-13 1996-05-29 株式会社リコー Document position detector
JPH11177774A (en) * 1997-12-15 1999-07-02 Minolta Co Ltd Detector for original
JP3747695B2 (en) * 1999-07-19 2006-02-22 富士ゼロックス株式会社 Image reading device
JP2001268367A (en) * 2000-03-22 2001-09-28 Minolta Co Ltd Image scanning apparatus
JP2003283766A (en) * 2002-03-22 2003-10-03 Ricoh Co Ltd Image input apparatus
JP2004282517A (en) * 2003-03-17 2004-10-07 Sharp Corp Original reader
JP4598426B2 (en) * 2004-03-30 2010-12-15 富士通株式会社 Boundary extraction method, program, and apparatus using the same

Also Published As

Publication number Publication date
JP2009164805A (en) 2009-07-23

Similar Documents

Publication Publication Date Title
JP5205963B2 (en) Image reading device
US8174737B2 (en) Image reading apparatus
US8284463B2 (en) Image reading apparatus
US8395807B2 (en) Image processing apparatus and method for borderless printing
JP4678278B2 (en) Double-sided simultaneous reading device
JP4941316B2 (en) Image reading device
JPH04313958A (en) Picture processor
JP4952576B2 (en) Image reading device
JP2009027396A (en) Printer
JP4687765B2 (en) Image reading device
JP4924416B2 (en) Image reading device
JP4888439B2 (en) Image reading apparatus and original size determination program
JP5585552B2 (en) Image reading apparatus and reading control program
JP4858437B2 (en) Image reading device
JP4924417B2 (en) Image analysis device
JP4952575B2 (en) Image reading device
WO2017056799A1 (en) Image-reading device and image-forming device
JP4998257B2 (en) Image reading device
JP4941317B2 (en) Image reading device
US11290609B2 (en) Image processing apparatus and image processing method
JP6394579B2 (en) Image reading apparatus and image forming apparatus
JP6128994B2 (en) Print control apparatus, print control method, and program
JP6472160B2 (en) Print control apparatus, print control method, and program
JP2023116052A (en) Image reading apparatus
JP2005187099A (en) Image forming device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20100212

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20110714

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110816

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20111017

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120123

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150217

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 4924416

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees