JP2009164808A - Image reader - Google Patents

Image reader Download PDF

Info

Publication number
JP2009164808A
JP2009164808A JP2007340773A JP2007340773A JP2009164808A JP 2009164808 A JP2009164808 A JP 2009164808A JP 2007340773 A JP2007340773 A JP 2007340773A JP 2007340773 A JP2007340773 A JP 2007340773A JP 2009164808 A JP2009164808 A JP 2009164808A
Authority
JP
Japan
Prior art keywords
document
edge
document table
frame
cpu
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2007340773A
Other languages
Japanese (ja)
Other versions
JP4858437B2 (en
Inventor
Hidekazu Okada
英和 岡田
Hirofumi Oguri
広文 小栗
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 JP2007340773A priority Critical patent/JP4858437B2/en
Publication of JP2009164808A publication Critical patent/JP2009164808A/en
Application granted granted Critical
Publication of JP4858437B2 publication Critical patent/JP4858437B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Input (AREA)
  • Facsimile Scanning Arrangements (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To suppress a harmful effect on the following processing using a detection result by erroneously detecting an original edge in an image reader. <P>SOLUTION: The image reader prescans a partial area of a platen (S210), reads a lower area of an original mounted on the platen, converts prescanned image data being the result of the reading into edge image data (S230), and extracts an edge point group corresponding to an original edge from the data. The reader also collinearly approximates the extracted edge point group and estimates an original size, an original mounted area, or the like (S235). On the other hand, the reader converts the prescanned image data into luminance data (S215), and determines whether the original is placed on a frame located at the outer edge of the platen on the basis of a luminance distribution of the edge of the platen 11a (S220). When the "existence of the original on the frame" is determined, an original size is estimated to be a maximum size at which the original size can be mounted on the platen (S245) without calculating the original size, or the like from edge image data by the above method. <P>COPYRIGHT: (C)2009,JPO&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 the ruled line exists, 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, there is a case where a document to be read is too large, such as a newspaper, and the end of the document does not fit in the readable area.

従って、原稿の端が読み取られていないのにも拘わらず、読取結果のエッジ画像データから原稿エッジを検出して、原稿サイズを検出しようとすると、原稿サイズを誤検出してしまうことになる。そして、このような原稿サイズの誤検出が発生した場合には、例えば、変倍率の設定ミスが生じて、コピー機能が上手く働かない事態が生じる。   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

かかる目的を達成するためになされた本発明は、読取対象の原稿が載置される透明な原稿台下において読取ユニットを搬送し、原稿台に写る画像を、読取ユニットに読み取らせることにより、原稿台に載置された原稿の読取画像を表す画像データを生成する画像読取装置であって、原稿台の周縁に、原稿台の周縁を包囲するフレームが設けられ、当該フレームにより、原稿台とフレームとの境界に、フレームを高位とし原稿台を低位とする段差が形成されたものである。更に、この画像読取装置は、次のようにして、原稿台に載置された原稿の一部が、フレームに乗った状態にあるか否かを判定する構成にされている。   The present invention, which has been made to achieve the above object, conveys a reading unit under a transparent document table on which a document to be read is placed, and causes the reading unit to read an image on the document table. An image reading apparatus for generating image data representing a read image of a document placed on a table, wherein a frame surrounding the periphery of the document table is provided at the periphery of the document table. Is formed with a step with a high frame and a low document table. Further, the image reading apparatus is configured to determine whether or not a part of the document placed on the document table is on the frame as follows.

即ち、この画像読取装置は、原稿台に載置された原稿の一部が、フレームに乗った状態にあるか否かを判定するための状態判定手段を備え、当該状態判定手段は、読取ユニットの読取結果である画像データであって、原稿台とフレームとの境界周辺の画像データが示す各画素の輝度の分布に基づき、原稿台に載置された原稿の一部が、フレームに乗った状態にあるか否かを判定する構成にされている。   That is, the image reading apparatus includes a state determination unit for determining whether a part of the document placed on the document table is on the frame, and the state determination unit includes the reading unit. The image data obtained as a result of reading a part of the document placed on the document table on the frame based on the luminance distribution of each pixel indicated by the image data around the boundary between the document table and the frame It is configured to determine whether or not it is in a state.

原稿台の周縁に段差が設けられた画像読取装置においては、原稿台に載置された原稿が原稿台からはみ出すと、段差の影響を受けて、原稿台の端では、原稿が原稿台から浮き上がる。よって、この状態で、読取ユニットに、原稿台に写る画像を読み取らせると、原稿台の端付近に対応する領域が、黒っぽく写る。   In an image reading apparatus in which a step is provided on the periphery of the document table, when the document placed on the document table protrudes from the document table, the document rises from the document table at the edge of the document table due to the effect of the step. . Therefore, when the reading unit is caused to read an image on the platen in this state, an area corresponding to the vicinity of the end of the platen is darkened.

本発明の画像読取装置は、このような現象を利用して、原稿台に載置された原稿の一部が、フレームに乗った状態にあるか否かを判定するようにしたものである。
上述のように画像読取装置を構成すれば、原稿台に載置された原稿の一部が原稿台からはみ出てフレームに乗った状態にあるか否かを判定することができるので、例えば、原稿がフレームに乗った状態にあると状態判定手段により判定された場合には、画像データから原稿エッジを検出して、これに基づき原稿サイズ等を求める動作を止めるようにすることができる。
The image reading apparatus of the present invention uses such a phenomenon to determine whether or not a part of the document placed on the document table is on the frame.
If the image reading apparatus is configured as described above, it can be determined whether or not a part of the document placed on the document table protrudes from the document table and rests on the frame. When the state determination means determines that the image is on the frame, it is possible to detect the document edge from the image data and stop the operation for obtaining the document size or the like based on the detected document edge.

即ち、このような場合には、読取結果の画像データから原稿エッジを検出して、当該原稿エッジから原稿サイズ等を求めようとしても、原稿サイズ等を誤検出してしまう可能性が高いので、検出した原稿サイズの情報を用いて後続の処理を実行すると、変倍率の設定ミスが生じるなどして、後続処理に悪影響が及び、ユーザの所望する処理を実現することができずに、ユーザに不満が及ぶ可能性が高い。たとえば、原稿中の罫線を原稿エッジとして検出してしまうことにより原稿サイズを誤検出してしまう可能性がある。この誤検出された原稿サイズに基づいて拡大、縮小等の処理を行った場合、ユーザの所望する処理結果が得られない。   That is, in such a case, there is a high possibility that the document size is erroneously detected even if the document edge is detected from the read image data and the document size is obtained from the document edge. If the subsequent processing is executed using the detected document size information, an error in setting the scaling factor occurs, and the subsequent processing is adversely affected, and the processing desired by the user cannot be realized. There is a high possibility of dissatisfaction. For example, the document size may be erroneously detected by detecting a ruled line in the document as a document edge. If processing such as enlargement or reduction is performed based on the erroneously detected document size, the processing result desired by the user cannot be obtained.

従って、誤検出が発生する可能性が高い場合には、誤検出による悪影響が生じないように、画像読取装置で実行する処理の内容を切り替えるのが好ましいが、本発明によれば、そのような処理の切替を実現することができ、原稿エッジの誤検出により、検出結果を用いた後続の処理に、悪影響が及ぶのを抑えることができる。   Therefore, when there is a high possibility of erroneous detection, it is preferable to switch the contents of processing executed by the image reading apparatus so that no adverse effects due to erroneous detection occur. It is possible to realize switching of processing, and it is possible to suppress adverse effects on subsequent processing using the detection result due to erroneous detection of the document edge.

尚、具体的に、状態判定手段は、原稿台とフレームとの境界周辺の画像データが示す各画素の輝度の情報から、原稿台とフレームとの境界から広がる輝度が閾値以下の黒領域の長さを計測する構成にすることができ、黒領域の長さが所定距離以上であるとき、原稿台に載置された原稿の一部が、フレームに乗った状態にあると判定する構成にすることができる(請求項2)。   More specifically, the state determination means determines the length of the black area whose luminance spreading from the boundary between the document table and the frame is equal to or less than the threshold value from the luminance information of each pixel indicated by the image data around the boundary between the document table and the frame The configuration is such that when the length of the black area is equal to or longer than a predetermined distance, it is determined that a part of the document placed on the document table is on the frame. (Claim 2).

この他、原稿が原稿台からはみ出ているのを、高感度に検出するには、具体的に、次のように画像読取装置を構成するのが好ましい。
即ち、原稿台の特定の端縁を、原稿を突き当てるべき原稿突当位置として定めて、「原稿突当位置とは原稿台を挟んで対称的な位置に存在するフレームの部位」が形成する段差の原稿台表面からの高さが、「原稿突当位置に対応するフレームの部位」が形成する段差の原稿台表面からの高さよりも、高くなるように、フレームを構成するのがよい(請求項3)。
In addition, in order to detect with high sensitivity that the original is protruding from the original table, it is preferable to specifically configure the image reading apparatus as follows.
That is, a specific edge of the document table is defined as a document abutting position where the document is to be abutted, and “a document abutting position is a portion of a frame that exists symmetrically across the document table”. It is preferable to configure the frame such that the height of the step from the surface of the document table is higher than the height of the step from the surface of the document table formed by the “part of the frame corresponding to the document abutting position” ( Claim 3).

このように原稿突当位置を定めた画像読取装置において、大きなサイズの原稿が載置される場合には、原稿突当位置とは反対側に位置するフレームの部位において、原稿がフレームに乗り上げることになる。従って、本発明のように、原稿が乗り上げられるフレームの部位を、他の部位よりも高く設定しておけば、その部位周辺において原稿が浮きやすくなる。よって、この発明によれば、画像データの輝度の分布から、原稿の乗り上げを高感度に検出することができるようになるのである。   In the image reading apparatus in which the document abutting position is set in this way, when a large-size document is placed, the document runs on the frame at a portion of the frame located on the opposite side to the document abutting position. become. Therefore, if the part of the frame on which the document is carried is set higher than the other parts as in the present invention, the document is likely to float around the part. Therefore, according to the present invention, it is possible to detect the running of the document with high sensitivity from the luminance distribution of the image data.

また、上述の画像読取装置は、状態判定手段の判定結果に基づき、原稿台に載置された原稿の一部がフレームに乗った状態にある場合に、その旨をユーザに向けて報知する報知手段を備えた構成にすることができる(請求項4)。   In addition, the above-described image reading apparatus notifies the user of the fact when a part of the document placed on the document table is on the frame based on the determination result of the state determination unit. It is possible to adopt a configuration provided with means (claim 4).

このように報知手段を画像読取装置に設ければ、所望の結果が得られない可能性があることを、ユーザに知らせることができ、例えば、原稿サイズを手動入力するように、促すことができる。従って、この発明によれば、利便性の高い画像読取装置をユーザに提供することができる。   By providing the notification means in the image reading apparatus in this way, it is possible to notify the user that there is a possibility that a desired result may not be obtained. For example, it is possible to prompt the user to manually input the document size. . Therefore, according to the present invention, a highly convenient image reading apparatus can be provided to the user.

この他、上述の画像読取装置は、次のように構成されてもよい。即ち、画像読取装置には、読取ユニットの読取結果である画像データに基づき、原稿台に載置された原稿のエッジを検出し、この検出結果に基づき、原稿台に載置された原稿のサイズを推定する原稿推定手段を設けて、原稿推定手段は、状態判定手段により原稿の一部がフレームに乗った状態にあると判定されると、エッジの検出結果に依らず、原稿台に載置された原稿のサイズを、原稿台に載置可能な最大サイズであると推定する構成にされるとよい(請求項5)。   In addition, the above-described image reading apparatus may be configured as follows. That is, the image reading apparatus detects the edge of the document placed on the document table based on the image data that is the reading result of the reading unit, and based on this detection result, the size of the document placed on the document table. The document estimation unit is configured to estimate the position of the document. When the state determination unit determines that a part of the document is on the frame, the document estimation unit is placed on the document table regardless of the edge detection result. It is preferable that the size of the original document is estimated to be the maximum size that can be placed on the document table.

原稿が原稿台からはみ出しフレームに乗り上げている場合には、当然のことながら、原稿が原稿台のサイズよりも大きい可能性が高い。従って、状態判定手段により原稿の一部がフレームに乗った状態にあると判定された場合には、原稿サイズを最大サイズと推定することで、後続処理を適切に実行することができる。   When the document is placed on the protruding frame from the document table, it is natural that the document is likely to be larger than the size of the document table. Therefore, when it is determined by the state determination means that a part of the document is on the frame, the subsequent process can be appropriately executed by estimating the document size as the maximum size.

例えば、プレスキャンにより原稿サイズを推定し、この推定結果に基づいて本スキャンでの読取領域を決定する画像読取装置を考える。更に、このような画像読取装置において、原稿台には、当該原稿台よりも大きなサイズの原稿が載置されているにも拘わらず、原稿の罫線の影響を受けて原稿エッジが誤検出されており、原稿エッジに基づいて原稿サイズを推定すると、原稿サイズが、当該画像読取装置にて読取可能な最大サイズよりも小さくなるような状況を考える。   For example, consider an image reading apparatus that estimates a document size by pre-scanning and determines a reading area in main scanning based on the estimation result. Further, in such an image reading apparatus, although a document having a size larger than that of the document table is placed on the document table, the document edge is erroneously detected due to the influence of the ruled line of the document. Therefore, when the document size is estimated based on the document edge, a situation is considered in which the document size is smaller than the maximum size that can be read by the image reading apparatus.

このような状況では、原稿エッジから推定した原稿サイズに基づいて読取領域を設定すると、本スキャン時に、画像読取装置の能力を最大限生かして、原稿台に載置された原稿を読み取ることができず、ユーザに不満が及ぶ可能性があるが、上述のように原稿推定手段を構成すれば、原稿台に大きな原稿が載置された場合、画像読取装置の能力を最大限生かし、原稿を最大限の広さ読み取ることができる。   In such a situation, if the reading area is set based on the document size estimated from the document edge, the document placed on the document table can be read during the main scan by making the best use of the capabilities of the image reading device. However, if the document estimation unit is configured as described above, when a large document is placed on the document table, the maximum capacity of the image reading device can be utilized to maximize the document. A wide range can be read.

以下に本発明の実施例について、図面と共に説明する。
図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と対向する蓋の内側には、読取ユニット15の読取結果である画像データにおいて、原稿外側領域に、黒い影が写らないように、白色部材が設けられている(詳細後述)。   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. A white member is provided on the inner side of the lid facing the reading glass 11 so that a black shadow does not appear in the outer area of the document in the image data that is the reading result of the reading unit 15 (details will be described later). .

一方、読取制御部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は、画像読取部10の読取ガラス11周辺の構成を表す説明図であり、特に、図2(a)は、読取ガラス11周辺の平面図、図2(b)は、図2(a)に示すA−A’一点鎖線に沿った読取ガラス11周辺のA−A’断面図である。
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.
2A and 2B are explanatory views showing the configuration around the reading glass 11 of the image reading unit 10. In particular, FIG. 2A is a plan view around the reading glass 11, and FIG. It is AA 'sectional drawing of the surroundings of the reading glass 11 along the AA' dashed-dotted line shown in FIG.

当該複合機1においては、一面が開口された長方体状の筐体13の当該開口部において、長方形状のガラス板である読取ガラス11が当該開口部を閉塞するように設けられており、読取ガラス11の周囲が筐体13により支持された構成にされている。   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”.)

即ち、本実施例においては、原稿台11aの周縁に、原稿台11aの周縁を包囲するフレーム13aが設けられており、フレーム13aにより、原稿台11aとフレーム13aとの境界BDには、フレーム13aを高位とし原稿台11aを低位とする段差が形成されている。   In other words, in the present embodiment, a frame 13a surrounding the periphery of the document table 11a is provided at the periphery of the document table 11a, and the frame 13a is positioned at the boundary BD between the document table 11a and the frame 13a by the frame 13a. A step is formed in which the height of the document platen 11a is low and the level of the document table 11a is low.

また、この画像読取部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 the “upper left corner”.

即ち、複合機1においては、原稿台11aの左下角(換言すれば、フレーム13aの内側左下角)が、原稿Pの角を合わせるべき位置として定められている。換言すると、原稿台11aの左下角から延びる原稿台11aの左端縁及び下端縁が、原稿を合わせるべき端縁として定められている。   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 the position where the corner of the document P should be aligned. In other words, the left edge and the lower edge of the document table 11a extending from the lower left corner of the document table 11a are defined as the edges to be aligned with the document.

複合機1は、ユーザが概ね、このマークMKに合わせて、原稿台11aの左端縁及び下端縁の段差に原稿を突き当てるように原稿Pを載置しているとの仮定の下で、原稿サイズの推定等を行う。   The multi-function device 1 assumes that the user is placing the original P so that the user generally abuts the step between the left and lower edges of the original table 11a in accordance with the mark MK. Estimate the size.

この他、本実施例においては、原稿台11aの右端縁に接するフレーム13aの右辺13a(R)の原稿台11a表面からの高さh’が、原稿が突き当てられる原稿台11aの左端縁に接するフレーム13aの左辺13a(L)及び原稿台11aの下端縁に接するフレーム13aの下辺13a(D)の原稿台11a表面からの高さhに対し、異なる値に設定されている。以下、フレーム13aの右辺13a(R)を、右フレーム13a(R)、フレーム13aの左辺13a(L)を、左フレーム13a(L)、フレーム13aの上辺13a(U)を、上フレーム13a(U)、フレーム13aの下辺13a(D)を、下フレーム13a(D)と称する。   In addition, in the present embodiment, the height h ′ of the right side 13a (R) of the frame 13a in contact with the right edge of the document table 11a from the surface of the document table 11a is the left edge of the document table 11a against which the document is abutted. Different values are set for the height h from the surface of the document table 11a of the lower side 13a (D) of the frame 13a in contact with the left side 13a (L) of the frame 13a in contact and the lower edge of the document table 11a. Hereinafter, the right side 13a (R) of the frame 13a is designated as the right frame 13a (R), the left side 13a (L) of the frame 13a is designated as the left frame 13a (L), the upper side 13a (U) of the frame 13a is designated as the upper frame 13a ( U), the lower side 13a (D) of the frame 13a is referred to as a lower frame 13a (D).

詳述すると、図2(b)に示すように、右フレーム13a(R)が形成する段差の原稿台11a表面からの高さh’は、原稿台11aを挟んで、それとは対称的に位置する左フレーム13a(L)及び下フレーム13a(D)が形成する段差の原稿台11a表面からの高さhよりも高い値に設定されている(h’>h)。   More specifically, as shown in FIG. 2B, the height h ′ of the step formed by the right frame 13a (R) from the surface of the document table 11a is located symmetrically with respect to the document table 11a. The height of the step formed by the left frame 13a (L) and the lower frame 13a (D) is higher than the height h from the surface of the document table 11a (h ′> h).

このように、原稿が突き当てられる左フレーム13a(L)とは原稿台11aを挟んで反対側に位置する右フレーム13a(R)の段差が高く設定されているのは、原稿台11aに対して、原稿台11aよりも大きなサイズの原稿が載置されたことを、原稿突当位置とは反対側のフレーム13aへの原稿の乗り上げ有無を判定して、検知するように、本実施例の複合機1が構成されているためである。   As described above, the step difference between the right frame 13a (R) located on the opposite side of the document table 11a from the left frame 13a (L) against which the document is abutted is set higher than the document table 11a. In this embodiment, it is detected that a document having a size larger than the document table 11a is placed by detecting whether or not the document has been placed on the frame 13a opposite to the document abutting position. This is because the multifunction device 1 is configured.

原稿がフレーム13aへ乗り上げると、原稿が、乗り上げた地点周辺で原稿台11aから浮き上がるため、その地点の読取画像は、黒くなる。本実施例では、このような現象を、読取ユニット15の読取結果である画像データを解析することにより検知して原稿の右フレーム13a(R)への乗り上げ有無を判定するのであるが(詳細後述)、このような現象は、右フレーム13a(R)を高くする程、顕著に現れる。本実施例では、このような理由から、右フレーム13a(R)を、左フレーム13a(L)や下フレーム13a(D)よりも高く設定している。   When the manuscript rides on the frame 13a, the manuscript floats from the manuscript table 11a around the place where the manuscript rides, and the read image at that point becomes black. In the present embodiment, such a phenomenon is detected by analyzing image data that is a reading result of the reading unit 15 to determine whether or not the document is loaded on the right frame 13a (R) (details will be described later). ), Such a phenomenon becomes more prominent as the right frame 13a (R) is raised. In this embodiment, for this reason, the right frame 13a (R) is set higher than the left frame 13a (L) and the lower frame 13a (D).

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

この他、本実施例の複合機1においては、このマークMKが付されたフレーム13aの内側左下角に対応する読取可能領域R0の左下角を原点、主走査方向をX軸、副走査方向をY軸としたXY座標系(図2(c)参照)が導入されており、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. 2C) 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. An area (in other words, a pre-scan area) is set, and the image reading unit 10 is caused to execute a pre-scan operation on 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に記録されたプレスキャン画像データが示す各画素のRGB値を、所定の計算式に従って、輝度値Zに変換することにより、プレスキャン画像データを、各画素の輝度値を表す輝度データに変換する(S215)。周知のように、RGB値から輝度値Zへの変換は、係数α,β,γを用いて、計算式Z=α・R+β・G+γ・Bに従い、行うことができる。   When the processing in S210 is completed in this manner, the CPU 70 then converts the RGB value of each pixel indicated by the prescan image data recorded in the RAM 80 into a luminance value Z according to a predetermined calculation formula. The prescan image data is converted into luminance data representing the luminance value of each pixel (S215). As is well known, conversion from RGB values to luminance values Z can be performed according to the calculation formula Z = α · R + β · G + γ · B using coefficients α, β, and γ.

また、この処理を終えると、CPU70は、S220に移行し、上記生成した輝度データに基づいて、図5に示す乗り上げ判定処理を実行する。図5は、CPU70が実行する乗り上げ判定処理を表すフローチャートである。   When this process is completed, the CPU 70 proceeds to S220, and executes the riding determination process shown in FIG. 5 based on the generated luminance data. FIG. 5 is a flowchart showing the ride determination process executed by the CPU 70.

乗り上げ判定処理を開始すると、CPU70は、まずS310にて、副走査方向検査位置Yeを、設計段階で予め定められた検査開始位置YINIに、設定する(Ye=YINI)。尚、検査開始位置YINIは、Y=0からY=YPREまでの領域においてプレスキャンを実行する関係上、0以上YPRE未満の値に、予め定められている。   When the boarding determination process is started, the CPU 70 first sets the sub-scanning direction inspection position Ye to the inspection start position YINI predetermined in the design stage in S310 (Ye = YINI). Note that the inspection start position YINI is set to a value not less than 0 and less than YPRE because the pre-scan is executed in the region from Y = 0 to Y = YPRE.

また、S310での処理を終えると、CPU70は、S321に移行して、主走査方向検査位置Xeを、読取可能領域R0右端(換言すれば、プレスキャン領域右端)のX座標に、設定する(Xe=XMAX)。   When the process in S310 is completed, the CPU 70 proceeds to S321 and sets the main scanning direction inspection position Xe to the X coordinate of the right end of the readable area R0 (in other words, the right end of the prescan area) ( Xe = XMAX).

また、この処理を終えると、CPU70は、輝度データを参照することにより、主走査方向検査位置Xe及び副走査方向検査位置Yeで定まる検査位置(X,Y)=(Xe,Ye)に対応する画素の輝度値Zを得て、この検査位置(Xe,Ye)に対応する画素の輝度値Zが、予め定められた閾値Zthを超えているか否かを判断する(S323)。即ち、Z>Zthであるか否かを判断する。   When this process is finished, the CPU 70 refers to the luminance data, and corresponds to the inspection position (X, Y) = (Xe, Ye) determined by the main scanning direction inspection position Xe and the sub scanning direction inspection position Ye. A luminance value Z of the pixel is obtained, and it is determined whether or not the luminance value Z of the pixel corresponding to the inspection position (Xe, Ye) exceeds a predetermined threshold value Zth (S323). That is, it is determined whether Z> Zth.

そして、輝度値Zが閾値Zth以下である(即ち、Z≦Zthである)と判断すると(S323でNo)、CPU70は、S325に移行し、主走査方向検査位置Xeを、1画素分マイナス方向にずらした値に更新した後に(即ち、Xe←Xe−1に更新した後に)、S327に移行する。   When it is determined that the luminance value Z is equal to or less than the threshold value Zth (that is, Z ≦ Zth) (No in S323), the CPU 70 proceeds to S325 and sets the main scanning direction inspection position Xe in the minus direction by one pixel. After updating to the value shifted to (ie, after updating to Xe ← Xe−1), the process proceeds to S327.

また、S327では、更新後の主走査方向検査位置Xeが読取可能領域R0の左端(換言すれば、プレスキャン領域の左端)であるか否かを判断する。即ち、Xe=0であるか否かを判断する。そして、更新後の主走査方向検査位置Xeが読取可能領域R0の左端であると判断すると(S327でYes)、S329に移行する。   In S327, it is determined whether or not the updated main scanning direction inspection position Xe is the left end of the readable area R0 (in other words, the left end of the prescan area). That is, it is determined whether Xe = 0. When it is determined that the updated main scanning direction inspection position Xe is the left end of the readable area R0 (Yes in S327), the process proceeds to S329.

一方、Xe>0であり、更新後の主走査方向検査位置Xeが読取可能領域R0の左端ではないと判断すると(327でNo)、CPU70は、S323に移行し、更新後の検査位置(X,Y)=(Xe,Ye)について、この検査位置に対応する画素の輝度値Zが、閾値Zthを超えているか否かを判断する。   On the other hand, if Xe> 0 and the updated main scanning direction inspection position Xe is determined not to be the left end of the readable area R0 (No in 327), the CPU 70 proceeds to S323 and updates the updated inspection position (X , Y) = (Xe, Ye), it is determined whether or not the luminance value Z of the pixel corresponding to this inspection position exceeds the threshold value Zth.

そして、検査位置に対応する画素の輝度値Zが閾値Zth以下であると判断すると(S323でNo)、S325に移行し、検査位置に対応する画素の輝度値Zが閾値Zthを超えていると判断すると(S323でYes)、S329に移行する。   If it is determined that the luminance value Z of the pixel corresponding to the inspection position is equal to or smaller than the threshold value Zth (No in S323), the process proceeds to S325, and the luminance value Z of the pixel corresponding to the inspection position exceeds the threshold value Zth. If it is determined (Yes in S323), the process proceeds to S329.

また、S329では、読取可能領域R0右端から、現在設定されている主走査方向検査位置XeまでのX軸方向長さLを、座標Y=Yeの地点における黒領域長L(Y=Ye)として算出する。   In S329, the X-axis direction length L from the right end of the readable area R0 to the currently set main scanning direction inspection position Xe is set as the black area length L (Y = Ye) at the point where the coordinate Y = Ye. calculate.

即ち、式L=XMAX−Xeに従って、座標Y=Yeの地点における黒領域長L(Y=Ye)を算出する。
また、S329での処理を終えると、CPU70は、S330に移行し、副走査方向検査位置Yeを、Y軸プラス方向に1画素分移動した位置に更新する(Ye←Ye+1)。その後、副走査方向検査位置Yeが、設計段階で予め定められた検査終了位置YFINを超えているか否かを判断する(S340)。尚、検査終了位置YFINは、検査開始位置YINIと同様、設計段階で、設計者により、0以上YPRE以下の値に、定められる。但し、当然のことながら、検査終了位置YFINは、検査開始位置YINIよりもY軸プラス方向にずれた地点に、定められる(YFIN>YINI)。
That is, the black area length L (Y = Ye) at the point of the coordinate Y = Ye is calculated according to the formula L = XMAX−Xe.
When the process in S329 is completed, the CPU 70 proceeds to S330 and updates the sub-scanning direction inspection position Ye to a position moved by one pixel in the Y axis plus direction (Ye ← Ye + 1). Thereafter, it is determined whether or not the sub-scanning direction inspection position Ye exceeds the inspection end position YFIN determined in the design stage (S340). Note that the inspection end position YFIN is set to a value between 0 and YPRE by the designer at the design stage, like the inspection start position YINI. However, as a matter of course, the inspection end position YFIN is determined at a point shifted in the Y axis plus direction from the inspection start position YINI (YFIN> YINI).

そして、副走査方向検査位置Yeが検査終了位置YFINを超えていないと判断すると(即ち、Ye≦YFINであると判断すると)、CPU70は、S321に移行し、後続の処理を実行する。このような動作の繰返しによって、CPU70は、検査開始位置YINIから検査終了位置YFINまでの各座標Yにおいて、上述の手法により、読取可能領域R0右端を基点とした黒領域長L(Y)を算出する。   If it is determined that the sub-scanning direction inspection position Ye does not exceed the inspection end position YFIN (ie, if it is determined that Ye ≦ YFIN), the CPU 70 proceeds to S321 and executes subsequent processing. By repeating such an operation, the CPU 70 calculates the black region length L (Y) from the right end of the readable region R0 as the base point at each coordinate Y from the inspection start position YINI to the inspection end position YFIN by the above-described method. To do.

そして、副走査方向検査位置Yeが検査終了位置YFINを超えていると判断すると(S340でYes)、CPU70は、S350に移行し、S329で算出した、YINI≦Y≦YFINの範囲における各座標Yでの黒領域長L(Y)の値を用いて、それら黒領域長L(Y)の平均値AVE(L)を算出する。   If the CPU 70 determines that the sub-scanning direction inspection position Ye exceeds the inspection end position YFIN (Yes in S340), the CPU 70 proceeds to S350 and calculates each coordinate Y in the range of YINI ≦ Y ≦ YFIN calculated in S329. The average value AVE (L) of the black area length L (Y) is calculated using the value of the black area length L (Y).

また、S350での処理を終えると、CPU70は、この平均値AVE(L)が、予め定められた閾値Lth以上であるか否かを判断する(S360)。そして、平均値AVE(L)が閾値Lth以上であると判断すると(S360でYes)、原稿が右フレーム13a(R)に乗り上げられているとして、「乗り上げ有」判定を下す(S370)。一方、平均値AVE(L)が閾値Lth未満であると判断すると(S360でNo)、原稿が右フレーム13a(R)に乗り上げられていないとして、「乗り上げ無」判定を下す(SS380)。   When the process in S350 is completed, the CPU 70 determines whether or not the average value AVE (L) is equal to or greater than a predetermined threshold Lth (S360). If it is determined that the average value AVE (L) is equal to or greater than the threshold value Lth (Yes in S360), it is determined that the document is being carried on the right frame 13a (R) (S370). On the other hand, if it is determined that the average value AVE (L) is less than the threshold value Lth (No in S360), it is determined that the document is not mounted on the right frame 13a (R), and “no boarding” determination is made (SS380).

このようにして、S370又はS380の処理を終えると、CPU70は、当該乗り上げ判定処理を終了して、S225に移行する。
尚、図6(a)は、フレーム13aに原稿が乗り上げていない場合の原稿台11a端部における輝度の分布を表した説明図であり、図6(b)は、フレーム13aに原稿が乗り上げている場合の原稿台11a端部における輝度の分布を表した説明図である。
In this way, when the process of S370 or S380 is completed, the CPU 70 ends the ride-up determination process and proceeds to S225.
FIG. 6A is an explanatory diagram showing the distribution of luminance at the end of the document table 11a when no document is placed on the frame 13a, and FIG. 6B is a diagram where the document is placed on the frame 13a. FIG. 6 is an explanatory diagram showing the distribution of luminance at the end of the document table 11a when the document is present.

本実施例では、画像読取部10に設けられた開閉自在な上記蓋の内側に設けられた白色部材が、用紙より柔軟な部材で構成され容易に変形可能な構成にされているため、蓋が閉められた状態でプレスキャン動作が行われた場合であって、フレーム13aに原稿が乗り上げていない場合には、白色部材が、原稿に代わり、原稿台11aにおける原稿が載置されていない領域の略全域において、原稿台11aの表面に接触し、原稿台11a表面を被覆する。尚、図6(a)上図に示す点線は、このときの白色部材(蓋内面)の配置を示す。   In this embodiment, the white member provided inside the openable / closable lid provided in the image reading unit 10 is configured by a member that is more flexible than paper and can be easily deformed. When the pre-scan operation is performed in a closed state, and no document is running on the frame 13a, the white member replaces the document in the area where the document is not placed on the document table 11a. In almost the entire area, the surface of the document table 11a is contacted to cover the surface of the document table 11a. In addition, the dotted line shown to the upper figure of Fig.6 (a) shows arrangement | positioning of the white member (lid inner surface) at this time.

このため、フレーム13aに原稿が乗り上げていない場合には、読取可能領域R0の端部まで輝度値Zが上述の閾値Zthよりも高くなる。
これに対し、フレーム13aに原稿が乗り上げている場合には、フレーム13aと原稿台11aとの間に段差が設けられ、且つ、白色部材が用紙よりも柔軟な部材で構成されている関係上、読取可能領域R0の端部を挟むフレーム13aと原稿台11aとの間の領域において、原稿は、原稿台11aから浮き上がった状態となり、その領域において、原稿台11aの表面が、原稿及び白色部材のいずれにも被覆されない状態となる。
For this reason, when the document does not run on the frame 13a, the brightness value Z is higher than the above-described threshold value Zth up to the end of the readable area R0.
On the other hand, when a document is placed on the frame 13a, a step is provided between the frame 13a and the document table 11a, and the white member is formed of a member that is more flexible than the paper. In the region between the frame 13a and the document table 11a sandwiching the end of the readable region R0, the document is lifted from the document table 11a. In this region, the surface of the document table 11a is composed of the document and the white member. It will be in the state which is not coat | covered by any.

尚、図6(b)上図には、原稿のフレーム13aへの乗り上げにより、蓋内面を構成する白色部材と共に、原稿が原稿台11aから浮き上がった状態となった原稿台11a表面の様子を示す。この図6(b)上図において、点線は、白色部材(蓋内面)の配置を示す。   6B shows the state of the surface of the original platen 11a in which the original has been lifted from the original platen 11a together with the white member constituting the inner surface of the lid by riding the original on the frame 13a. . In the upper diagram of FIG. 6B, the dotted line indicates the arrangement of the white member (the inner surface of the lid).

周知のように、コンタクトイメージセンサを使った読み取りでは、原稿台11aの表面に原稿等が接触せず、原稿台11a表面が被覆されていない場合、その領域の読取画像が、その他の領域に比べて黒くなる。換言すると、原稿が原稿台11aから浮き上がった領域においては、輝度値Zが閾値Zthよりも低い画素領域が広がった状態になる。   As is well known, in reading using a contact image sensor, when a document or the like is not in contact with the surface of the document table 11a and the surface of the document table 11a is not covered, the read image in that region is compared with other regions. It becomes black. In other words, in a region where the document is lifted from the document table 11a, a pixel region having a luminance value Z lower than the threshold value Zth is expanded.

本実施例では、このような理由から、Y=YINIからY=YFINの領域において、右フレーム13a(R)からの黒領域L(Y)の長さを計算し、この平均値AVE(L)が閾値Lth以上である場合には、原稿が右フレーム13a(R)に乗り上げていると判定するようにしている。   In this embodiment, for this reason, the length of the black region L (Y) from the right frame 13a (R) is calculated in the region of Y = YINI to Y = YFIN, and this average value AVE (L) Is greater than or equal to the threshold value Lth, it is determined that the document is on the right frame 13a (R).

このような原理にて乗り上げ判定処理を終了し、S225に移行すると、CPU70は、直前のS220で実行した乗り上げ判定処理において、「乗り上げ有」判定が下されたか否かを判断する。そして、「乗り上げ有」判定が下されておらず、「乗り上げ無」判定が下されたと判断すると(S225でNo)、S230に移行する。   When the boarding determination process is terminated based on this principle and the process proceeds to S225, the CPU 70 determines whether or not the “boarding” determination is made in the boarding determination process executed in the immediately preceding S220. Then, if it is determined that the “ride on” determination is not made and the “no ride” determination is made (No in S225), the process proceeds to S230.

また、S230では、RAM80に記録されたプレスキャン画像データに対応する上記輝度データに対してエッジ検出処理を実行し、この画像データに対応するエッジ画像データを生成する。即ち、S230では、上記輝度データを、エッジ検出用の画像フィルタ(周知の微分フィルタ)に通して、この画像データに対応するエッジ画像を表すエッジ画像データを生成する。   In S230, edge detection processing is performed on the luminance data corresponding to the pre-scan image data recorded in the RAM 80, and edge image data corresponding to the image data is generated. That is, in S230, the luminance data is passed through an edge detection image filter (a well-known differential filter), and edge image data representing an edge image corresponding to the image data is generated.

また、S230での処理を終えると、CPU70は、S235に移行し、上記生成したエッジ画像データを、検査対象データに設定して、図7に示す原稿推定処理を実行する。詳細は後述するが、この原稿推定処理では、検査対象データ(S230で得られたエッジ画像データ)を解析して、原稿台11aに載置された原稿のサイズ(縦幅及び横幅)、及び、原稿の傾き角θ、及び、原稿台11aにおける原稿の載置領域を推定する。   When the processing in S230 is completed, the CPU 70 proceeds to S235, sets the generated edge image data as inspection target data, and executes the document estimation processing shown in FIG. Although details will be described later, in this document estimation process, the inspection target data (edge image data obtained in S230) 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に載置された原稿のエッジを検査対象データにおいて検出すると共に、その検出結果から原稿の左下角位置及び右下角位置を推定し、推定した角位置の情報から、原稿台11aに載置された原稿が定型用紙であるとの仮定の下で、当該原稿台11aに載置された原稿のサイズ、及び、原稿の傾き角θ、及び、原稿台11aにおける原稿の載置領域を推定する。但し、ここでは、X軸に対して原稿の下辺がなす角度を、原稿の傾き角θ(図10参照)とする。   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 lower left corner position and the lower right corner position of the document are estimated, and 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 corner 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. 10).

そして、S235での処理を終えると、CPU70は、印刷制御部40を通じて、印刷部30に給紙動作を実行させると共に(S250)、給紙動作の対象となった記録紙のサイズを検出する(S255)。尚、記録紙のサイズは、例えば、記録紙の搬送路に設けられたセンサを用いて周知の手法で検出することができる。   When the processing in S235 is completed, the CPU 70 causes the printing unit 30 to execute a paper feeding operation through the print control unit 40 (S250) and detects the size of the recording paper that is the target of the paper feeding operation (S250). S255). 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は、S261に移行し、S235で推定された原稿サイズ及びS255で検出された記録紙サイズに基づき、予め定められた計算式に従って変倍率を設定する。具体的には、変倍率を、原稿サイズと記録紙サイズとの比(例えば、記録紙短辺長さ÷原稿短辺長さ)に対応した倍率に設定し、後続の処理で、原稿のコピー画像が、原稿サイズとの記録紙サイズの比に対応した倍率で拡大(倍率が1未満の場合には縮小)されて記録紙に印刷されるようにする。   When this process is finished, the CPU 70 proceeds to S261, and sets a scaling factor according to a predetermined calculation formula based on the document size estimated in S235 and the recording paper size detected in S255. 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は、S235で推定された原稿の傾き角θから、画像データの傾き補正量を設定する(S263)。具体的には、原稿のコピー画像が、傾きのない状態でまっすぐ、記録紙に印刷されるように、傾き補正量を設定する。但し、推定された原稿の傾き角θが微小量(本実施例では−0.5度≦θ≦0.5度)である場合には、誤差も考慮して、傾き補正量をゼロに設定する。   When this process is completed, the CPU 70 sets the inclination correction amount of the image data from the original inclination angle θ estimated in S235 (S263). 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.

また、S263での処理を終えると、CPU70は、S235で推定された原稿の載置領域の情報に基づいて、原稿読取開始位置及び原稿読取終了位置を設定し、原稿読取開始位置及び原稿読取終了位置で定められる読取領域を、原稿台11aにおける原稿の載置領域に対応させる(S265)。   When the processing in S263 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 S235, and the document reading start position and the document reading end. The reading area determined by the position is made to correspond to the document placement area on the document table 11a (S265).

具体的には、原稿の載置領域全体を読取ユニット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.

一方、S225において「乗り上げ有」判定が下されたと判断すると、CPU70は、S241に移行し、原稿がフレーム13aに乗った状態にある旨のメッセージを、表示操作部50に設けられたディスプレイに表示して、原稿の乗り上げをユーザに向けて報知する。また、この際には、後続処理の継続要否を問合せるメッセージを、表示操作部50に設けられたディスプレイに表示することにより、上記問合せに対する回答の操作キーを通じた入力を、ユーザに促す。   On the other hand, if it is determined in S225 that the determination “Yes” is made, the CPU 70 proceeds to S241 and displays a message indicating that the document is on the frame 13a on a display provided in the display operation unit 50. Then, the user is notified of the start of the document. In this case, a message for inquiring whether or not to continue the subsequent process is displayed on a display provided in the display operation unit 50, thereby prompting the user to input an answer to the inquiry through the operation key.

また、この処理を終えると、CPU70は、S243に移行し、操作キーを通じて、上記問合せに対する回答が入力されるまで待機する。そして、回答が入力されると、当該入力された回答の種類に基づいて、ユーザから処理継続指示が入力されたか否かを判断する。具体的にS243では、上記回答として後続処理の「継続要」との回答が入力されると、ユーザから処理継続指示が入力されたと判断する(S243でYes)。一方、上記回答として後続処理の「継続不要」との回答が入力されると、ユーザから処理継続指示が入力されなかったと判断する(S243でNo)。   When this process is completed, the CPU 70 proceeds to S243 and waits until an answer to the inquiry is input through the operation key. When an answer is input, it is determined whether or not a processing continuation instruction is input from the user based on the type of the input answer. Specifically, in S243, when an answer “continuation required” of the subsequent process is input as the above-mentioned answer, it is determined that a process continuation instruction is input from the user (Yes in S243). On the other hand, if an answer “continuation unnecessary” of the subsequent process is input as the answer, it is determined that a process continuation instruction has not been input from the user (No in S243).

そして、ユーザから処理継続指示が入力されなかったと判断すると(S243でNo)、CPU70は、当該自動変倍複写処理を終了することで、S243の処理を実行するに至ったコピー指令を無効化する。   If it is determined that the process continuation instruction has not been input from the user (No in S243), the CPU 70 terminates the automatic scaling copying process, thereby invalidating the copy command that led to the execution of the process of S243. .

一方、ユーザから処理継続指示が入力されたと判断すると(S243でYes)、CPU70は、S245に移行し、原稿台11aに載置された原稿のサイズ(縦幅及び横幅)を、本実施例の複合機1において原稿台11aに載置可能な原稿の最大サイズであると推定する。即ち、原稿サイズが、読取可能領域R0と同サイズであると推定する。この他、CPU70は、原稿台11aに載置された原稿の当該載置領域が、読取可能領域R0の全域であると推定すると共に、原稿の傾き角θがゼロ(θ=0)であると推定する(S247)。   On the other hand, if it is determined that a processing continuation instruction has been input from the user (Yes in S243), the CPU 70 proceeds to S245 and determines the size (vertical width and horizontal width) of the document placed on the document table 11a according to the present embodiment. It is estimated that the maximum size of the document that can be placed on the document table 11a in the multi-function device 1. That is, it is estimated that the document size is the same size as the readable area R0. In addition, the CPU 70 estimates that the placement area of the document placed on the document table 11a is the entire readable area R0, and that the inclination angle θ of the document is zero (θ = 0). Estimate (S247).

また、S247での処理を終えると、CPU70は、S250に移行し、印刷制御部40を通じて、印刷部30に給紙動作を実行させると共に、給紙動作の対象となった記録紙のサイズを検出する(S255)。そして、この処理後、S261に移行し、S245で推定された原稿サイズ及びS255で検出された記録紙サイズに基づき、上述の手法で、変倍率を設定する。   When the processing in S247 is completed, the CPU 70 proceeds to S250, causes the printing unit 30 to execute a paper feeding operation through the print control unit 40, and detects the size of the recording paper that is the target of the paper feeding operation. (S255). After this processing, the process proceeds to S261, and the scaling ratio is set by the above-described method based on the document size estimated in S245 and the recording paper size detected in S255.

また、この処理を終えると、CPU70は、S247で推定された原稿の傾き角θから、画像データの傾き補正量を設定し(S263)、更に、S245で推定された原稿の載置領域の情報に基づいて、本スキャン時(S270実行時)の読取領域を、原稿台11aにおける原稿の載置領域に対応させる(S265)。具体的に、S225でYesと判断した後のS265では、原稿読取開始位置を、読取可能領域R0の下端(Y=0)に設定し、原稿読取終了位置を、読取可能領域R0の上端(Y=YMAX)に設定して、読取可能領域R0全域を、読取領域に設定する。また、この処理を終えると、S270に移行する。   When this processing is completed, the CPU 70 sets the inclination correction amount of the image data from the document inclination angle θ estimated in S247 (S263), and further, information on the document placement area estimated in S245. Based on the above, the reading area at the time of the main scan (when executing S270) is made to correspond to the document placement area on the document table 11a (S265). Specifically, in S265 after determining Yes in S225, 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 set to the upper end (Y = YMAX), and the entire readable area R0 is set as a reading area. When this process is finished, the process 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実行時)の読取領域を決定すると共に、変倍率及び傾き補正量を決定する。但し、本実施例では、原稿のフレーム13aへの乗り上げを検知した場合、プレスキャン結果に基づかず、原稿サイズを最大サイズと推定して、原稿載置領域を読取可能領域R0全域と推定し、本スキャン時の読取領域を読取可能領域R0全域に決定する。   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. However, in this embodiment, when it is detected that the document has entered the frame 13a, the document size is estimated as the maximum size, based on the prescan result, and the document placement area is estimated as the entire readable area R0. The reading area at the time of the main scan is determined over the entire readable area R0.

尚、原稿のフレーム13aへの乗り上げを検知した場合に、プレスキャン結果を利用せずに、原稿サイズを最大サイズと推定している理由は、本実施例では、S235における原稿推定処理にて、プレスキャン結果から原稿のエッジを検出し、この検出結果に基づいて、原稿台11aに載置されている原稿サイズ等を推定しているためである。   Note that the reason why the document size is estimated to be the maximum size without using the pre-scan result when the document is loaded on the frame 13a is detected in the document estimation process in S235 in this embodiment. This is because the edge of the document is detected from the prescan result, and the size of the document placed on the document table 11a is estimated based on the detection result.

即ち、原稿台11aに載置可能な最大サイズを超える大きさの原稿が当該原稿台11aに載置されている場合に、S235の処理を実行して、原稿サイズ等を求めようとすると、原稿に描写された罫線等の影響を受けて、原稿のエッジが誤って検出され、原稿サイズ等が誤って推定される可能性がある。このような理由から、本実施例では、原稿のフレーム13aの乗り上げを検知した場合、原稿推定に係る処理の切替を行うようにしている。   That is, when a document having a size exceeding the maximum size that can be placed on the document table 11a is placed on the document table 11a, the process of S235 is executed to obtain the document size and the like. There is a possibility that the edge of the document is erroneously detected due to the influence of the ruled line described in FIG. For this reason, in the present embodiment, when the rising of the document frame 13a is detected, the process related to document estimation is switched.

以下では、図7を用いて、CPU70がS235で実行する、この原稿推定処理について説明する。図7は、CPU70が実行する原稿推定処理を表すフローチャートである。
この原稿推定処理を開始すると、CPU70は、まず、変数Sを上述のプレスキャン領域上端のY座標であるYPREに設定することにより(S=YPRE)、Y軸方向の検査範囲を、Y=0からY=S=YPREに設定する(S410)。また、この処理を終えると、S420に移行し、右エッジ検出処理を実行する。図8は、CPU70が実行する右エッジ検出処理を表すフローチャートである。
Hereinafter, the document estimation process executed by the CPU 70 in S235 will be described with reference to FIG. FIG. 7 is a flowchart showing document estimation processing executed by 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. 8 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)。尚、図9は、エッジ画像データの構成を抜粋して示し、更に、右エッジ検出処理により追跡するエッジ点の軌跡を表した説明図である。図9に示す例では、画素値「1」の地点がエッジ点に該当する。   If it is determined 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. 9 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. 9, 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は、このような処理を実行することにより、図9に示すように、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.

具体的には、図10に示すように、原稿右エッジデータとして記憶された座標データ群の内、連続性のある座標データ群に対して原稿内側領域に大きくずれた位置にある、明白に連続性のない座標データ群を、原稿右エッジデータから除去し、原稿右エッジデータを確定する。その後、当該右エッジ検出処理を終了する。但し、S590の処理は原稿エッジの検出精度を高めるための処理であるので、S590の処理については、実行しないように、右エッジ検出処理を構成してもよい。   Specifically, as shown in FIG. 10, among the coordinate data groups stored as the right edge data of the document, it is clearly continuously located at a position greatly shifted to the inner region of the document with respect to the coordinate data group having continuity. The inconsistent coordinate data group is removed from the document right edge data, and the document right edge data is determined. 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に移行し、エラー処理を実行する。例えば、複合機1は、S431におけるエラー処理として、『原稿を正しく載置するか、自動変倍複写機能は使用できないので他のコピー指令を入力するように促すメッセージを表示操作部50のディスプレイに表示した後、S431を実行するに至ったコピー指令に対応する当該複写制御処理を強制終了して、当該コピー指令を無効にする』処理を実行する構成にすることができる。   If it is determined that the detection of the right edge has failed (Yes in S430), the CPU 70 proceeds to S431 and executes error processing. For example, the multi-function device 1 displays, as an error process in S431, a message prompting the user to input another copy command because the document is placed correctly or the automatic scaling copying function cannot be used. After the display, the process can be configured to execute the process of forcibly terminating the copy control process corresponding to the copy command that led to the execution of S431 and invalidating the copy command.

この他、複合機1は、S431におけるエラー処理として、『原稿台11aに載置された原稿のサイズを、予め定められた固定サイズであると形式的に推定すると共に、原稿の傾き角θをゼロと推定し、更に、原稿の載置領域を、上記推定したサイズの原稿の左下角が原稿台11aの左下角に正しく突き当てられていると仮定したときに原稿が載置される領域に推定する』処理を実行し、その後、当該原稿推定処理を終了して、S250に移行する構成にされてもよい。   In addition, the multi function device 1 performs the error processing in S431 as follows: “The size of the document placed on the document table 11a is formally estimated to be a predetermined fixed size, and the inclination angle θ of the document is determined. Further, it is estimated that the original is placed on the area where the original is placed when it is assumed that the lower left corner of the estimated size of the original is correctly abutted against the lower left corner of the original table 11a. The “estimating” process may be executed, and then the document estimation process may be terminated and the process may proceed to S250.

一方、S430において右エッジの検出に成功したと判断すると(S430でNo)、CPU70は、S433に移行し、右エッジ検出処理で確定された原稿右エッジデータが示す各点を直線近似して、原稿右エッジデータが示す点群の近似直線(以下、「右エッジ近似直線」と表現する。)を算出する。   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 S433 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に正しく載置されていると推定して、図7右図に示すように、右エッジ近似直線と原稿台11a下端縁との交点を、原稿の右下角位置であると推定する(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. As shown in the right diagram of FIG. 7, the intersection of the right edge approximate straight line and the lower edge of the document table 11a is estimated to be the lower right corner position of the document (S441).

また、この処理を終えると、CPU70は、原稿の左下角位置が原稿台11aの左下角の地点であると推定し(S443)、S441及びS443で推定した角位置の位置座標に基づき、原稿台11aに載置されている原稿が定型用紙であるとの仮定の下で、原稿台11aに載置された原稿のサイズ及び原稿台11aにおける原稿の載置領域を推定すると共に、原稿の傾き角θを推定する(S445)。   When this processing is completed, the CPU 70 estimates that the lower left corner position of the document is the lower left corner point of the document table 11a (S443), and based on the position coordinates of the angular position estimated in S441 and S443, the document table. Under the assumption that the original placed on the original 11a is a standard paper, the size of the original placed on the original table 11a and the placement area of the original on the original table 11a are estimated, and the inclination angle of the original is set. θ is estimated (S445).

具体的には、S441及びS443で推定した原稿の左下角位置から右下角位置までの長さを、原稿の短辺長さ(横幅)と推定し、この短辺長さの√2倍を、原稿の長辺長さ(縦幅)と推定して、原稿サイズを推定すると共に、上記推定した左下角位置及び右下角位置を基点に上記原稿サイズの原稿が原稿台11aに載置されているものとして、原稿の左上角及び右上角が位置する座標を導出し、これら4つの角を結んでできる四角形内の領域を、原稿の載置領域であると推定する。尚、ここで原稿短辺長さの√2倍を、原稿の長辺長さとして推定しているのは、定型用紙の短辺長さ:長辺長さの比が1:√2となっているためである。   Specifically, the length from the lower left corner position to the lower right corner position of the document estimated in S441 and S443 is estimated as the short side length (horizontal width) of the document, and √2 times the short side length is The document size is estimated by estimating the long side length (vertical width) of the document, and the document of the document size is placed on the document table 11a based on the estimated lower left corner position and lower right corner position. As an example, the coordinates at which the upper left corner and the upper right corner of the document are located are derived, and an area within a quadrilateral formed by connecting these four corners is estimated as the document placement area. 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.

また、S441,S443では、原稿が原稿台11aの左下角に正確に突き当てられて原稿台11aに載置されていると仮定して角位置を求めているので、S445では、原稿の傾き角θがゼロである(傾きがない)と推定する。   Further, in S441 and S443, the angular position is obtained on the assumption that the document is placed on the document table 11a by being accurately abutted against the lower left corner of the document table 11a. It is estimated that θ is zero (no slope).

このようにして、S445での処理を終えると、CPU70は、当該原稿推定処理(S235)を終えて、S250に移行し、上述したようにして、後続の処理を実行する。即ち、原稿推定処理で推定した原稿サイズ、原稿の傾き角、原稿の載置領域の情報を基に、変倍率及び傾き補正量を設定し(S261,S263)、更に読取領域を設定する(S265)。その後、本スキャンに移行して(S270)、コピー動作を実現する。   When the process in S445 is completed in this way, the CPU 70 ends the document estimation process (S235), proceeds to S250, and executes the subsequent process as described above. That is, based on the document size estimated by the document estimation process, the document tilt angle, and the document placement area information, the scaling factor and tilt correction amount are set (S261, S263), and the reading area is set (S265). ). Thereafter, the process shifts to the main scan (S270), and the copy operation is realized.

話を原稿推定処理のS440(図7参照)に戻すと、CPU70は、ここで、右エッジ近似直線がY軸に対し所定角度より大きく傾いていると判断した場合(S440でYes)、S450に移行して、図11に示す左エッジ検出処理を実行する。図11は、CPU70が実行する左エッジ検出処理を表すフローチャートである。   If the story is returned to S440 (see FIG. 7) 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. 11 is executed. FIG. 11 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 area 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は、右エッジ検出処理と同様(図9参照)、Y軸方向に8画素おきに、エッジ点がY軸方向に連続するものであるか否かを検査する。そして、C=8であると判断すると(S767でYes)、S750で連続性のあるエッジ点として判定した計8地点の各座標データを、原稿左エッジデータとしてRAM80に記憶する(S770)。   By such a processing procedure, the CPU 70 checks whether or not the edge points are continuous in the Y-axis direction every eight pixels in the Y-axis direction, as in the right edge detection process (see FIG. 9). 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, and the document left edge data is determined. 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は、図12に示す下エッジ検出処理を実行する。図12は、CPU70が実行する下エッジ検出処理を表すフローチャートである。
下エッジ検出処理を開始すると、CPU70は、S810にて、主走査方向検査位置Xeを、読取可能領域R0の左端X座標に設定し(Xe=0)、S815にて、副走査方向検査位置Yeを、読取可能領域R0の下端Y座標に設定する(Ye=0)。また、S815では、変数Cを値ゼロに初期化する(C=0)。
In step S460, the CPU 70 executes a lower edge detection process shown in FIG. FIG. 12 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に移行して、S431での処理と同様のエラー処理を実行する。
一方、S470で原稿エッジが正しく検出されていると判断すると(S470でYes)、CPU70は、S480に移行して、原稿の左下角位置を、左エッジ近似直線と下エッジ近似直線との交点であると推定して、その座標値を算出し、更に、原稿の右下角位置を、右エッジ近似直線と下エッジ近似直線との交点であると推定して、その座標値を算出する(S485)。尚、図13は、S480及びS485での原稿左下角位置Ka及び原稿右下角位置Kbの推定方法を示した説明図である。図中、白丸がエッジ点を表し、黒丸が角位置Ka,Kbを表す。
If it is determined that the document edge is not correctly detected (No in S470), the CPU 70 proceeds to S471 and executes error processing similar to the processing in S431.
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 S480, and the lower left corner position of the document is determined by the intersection of the left edge approximate line and the lower edge approximate line. Assuming that there is a coordinate value, the 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 (S485). . FIG. 13 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 S480 and S485. In the figure, white circles represent edge points, and black circles represent the corner positions Ka and Kb.

また、S485での処理を終えると、CPU70は、S480及びS485で推定した角位置の位置座標に基づき、原稿台11aに載置されている原稿が定型用紙であるとの仮定の下で、原稿台11aに載置された原稿のサイズ及び原稿台11aにおける原稿の載置領域を推定すると共に、右エッジ近似直線に基づき、原稿台11aに載置されている原稿の傾き角θを推定する(S490)。   When the process in S485 is completed, the CPU 70 assumes that the document placed on the document table 11a is a standard sheet based on the position coordinates of the angular position estimated in S480 and S485. The size of the document placed on the table 11a and the document placement area on the document table 11a are estimated, and the inclination angle θ of the document placed on the document table 11a is estimated based on the right-edge approximate straight line ( S490).

即ち、S480及びS485で推定した原稿の左下角位置から右下角位置までの長さを、原稿の短辺長さ(横幅)と推定し、この短辺長さの√2倍を、原稿の長辺長さ(縦幅)と推定して、原稿サイズを推定すると共に、上記推定した左下角位置及び右下角位置を基点に上記原稿サイズの原稿が原稿台11aに載置されているものとして、原稿の左上角及び右上角が位置する座標を導出し、これら4つの角を結んでできる四角形内の領域を、原稿の載置領域であると推定する。   That is, the length from the lower left corner position to the lower right corner position of the document estimated in S480 and S485 is estimated as the short side length (horizontal width) of the document, and √2 times the short side length is set to the document length. Assume that the document size is estimated by estimating the side length (vertical width), and the document of the document size is placed on the document table 11a based on the estimated lower left corner position and lower right corner position. The coordinates where the upper left corner and the upper right corner of the document are located are derived, and an area within a quadrilateral formed by connecting these four corners is estimated as the document placement area.

この他、S490では、Y軸に対して右エッジ近似直線がなす角度を、原稿の傾き角θと推定する。そして、この処理を終えると、CPU70は、S235での原稿推定処理を終了して、S250に移行し、後続の処理を実行する。   In addition, in S490, the angle formed by the right edge approximate line with respect to the Y axis is estimated as the document inclination angle θ. When this process ends, the CPU 70 ends the document estimation process in S235, proceeds to S250, and executes the subsequent process.

このような動作により、CPU70は、原稿のフレーム13aへの乗り上げが検知されなかった場合、プレスキャンにより得られたエッジ画像データ(検査対象データ)から原稿エッジを検出して、その検出結果に基づき、原稿が定型用紙であるとの仮定の下、原稿台11aに載置された原稿のサイズ・原稿の載置領域・原稿の傾き角を推定する(S490)。そして、この推定結果に基づき、変倍率及び傾き補正量を設定し(S261,S263)、更に読取領域を設定する(S265)。その後、本スキャンに移行する(S270)。   By such an operation, the CPU 70 detects the document edge from the edge image data (inspection target data) obtained by the pre-scanning when it is not detected that the document runs on the frame 13a, and based on the detection result. Under the assumption that the document is a standard sheet, the size of the document placed on the document table 11a, the placement area of the document, and the inclination angle of the document are estimated (S490). Based on the estimation result, a scaling factor and an inclination correction amount are set (S261, S263), and a reading area is further set (S265). 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.

以上、本実施例のディジタル複合機1の構成について説明したが、本実施例の複合機1では、プレスキャンでの読取結果から、原稿エッジを検出して、原稿の状態(原稿サイズ・原稿の傾き・原稿の載置領域)を推定するようにしている。このため、原稿台11aに新聞等の許容サイズ以上の大きな原稿が載置された場合に、プレスキャンでの読取結果から、原稿エッジを検出して原稿状態を推定すると、原稿サイズ等を誤って推定する可能性がある。このような理由から、本実施例では、原稿の乗り上げを、原稿台11a端の輝度分布から検知して、原稿がフレーム13aに乗り上げている場合には、プレスキャン結果から原稿エッジを検出して原稿サイズ等を求めず、原稿サイズが原稿台11aに載置可能な最大サイズであると推定するようにした。   The configuration of the digital multi-function peripheral 1 according to the present embodiment has been described above. However, the multi-function peripheral 1 according to the present embodiment detects the document edge from the read result of the pre-scan, and the document state (document size / document size). Inclination / document placement area) is estimated. For this reason, when a large document of an allowable size such as a newspaper is placed on the document table 11a, if the document edge is detected and the document state is estimated from the pre-scan reading result, the document size or the like is erroneously determined. There is a possibility of estimation. For this reason, in the present embodiment, when the original is detected from the luminance distribution at the end of the original table 11a and the original is on the frame 13a, the original edge is detected from the prescan result. The document size is estimated to be the maximum size that can be placed on the document table 11a without obtaining the document size or the like.

従って、本実施例によれば、原稿台11aに新聞等の許容サイズ以上の大きな原稿が載置された場合にも、適切に原稿サイズを推定して、後続の処理を実行することができ、原稿サイズ等が誤って推定されることにより、後続処理(変倍率や読取領域の設定動作)に影響が及ぶのを極力抑えることができる。例えば、原稿台11aに新聞等の大きな原稿が載置されているにも拘わらず、原稿内の罫線に惑わされ、原稿サイズを小さく誤推定してしまうことで、ユーザが原稿台11aに面する原稿の全領域のコピーを所望しているにも拘わらず、一部領域のみのコピー動作を実行してしまうのを回避することができる。   Therefore, according to the present embodiment, even when a large document larger than an allowable size such as a newspaper is placed on the document table 11a, it is possible to appropriately estimate the document size and execute subsequent processing. It is possible to suppress as much as possible the influence on subsequent processing (magnification / reading area setting operation) by erroneously estimating the document size or the like. For example, although a large document such as a newspaper is placed on the document table 11a, the user faces the document table 11a by being confused by the ruled lines in the document and erroneously estimating the document size. Even though it is desired to copy the entire area of the document, it is possible to avoid performing a copy operation for only a part of the area.

また、本実施例では、原稿が突き当てられる左フレーム13a(L)とは原稿台11aを挟んで反対側に位置する右フレーム13a(R)の原稿台11a表面からの高さh’を、左フレーム13a(L)の原稿台11a表面からの高さhより高く設定することにより、フレーム13aに乗り上がってしまった原稿の読取画像が歪んでしまうのを極力抑えつつ、原稿台11aに最大サイズ以上の原稿が載置されたことを、黒領域長Lの長さから感度よく検知できるようにしているので、利便性の高い複合機1をユーザに提供することができる。   Further, in this embodiment, the height h ′ from the surface of the document table 11a of the right frame 13a (R) located on the opposite side of the document table 11a with respect to the left frame 13a (L) against which the document is abutted, By setting the height of the left frame 13a (L) higher than the height h from the surface of the document table 11a, it is possible to maximize the document table 11a while suppressing the distortion of the read image of the document that has run on the frame 13a as much as possible. Since it is possible to detect with high sensitivity from the length of the black area length L that a document of a size or larger is placed, the highly convenient multifunction machine 1 can be provided to the user.

即ち、原稿がフレーム13aに乗り上がっていることを感度よく検知するには、フレーム13aの原稿台11a表面からの高さを大きくするのが良いが、フレーム13aの高さを大きくすると、乗り上げにより原稿台11aの端部で原稿が大きく歪むため、読取可能領域R0端部の読取画像の画質が劣化する。このため、原稿台11aに最大サイズ以上の原稿が載置されたといった例外的なケースを感度よく検知するだけのために、フレーム13a全体の高さを大きくするのは、決して好ましいものではない。   That is, in order to detect with high sensitivity that the document has been placed on the frame 13a, it is preferable to increase the height of the frame 13a from the surface of the document table 11a. However, if the height of the frame 13a is increased, the height of the frame 13a increases. Since the document is greatly distorted at the end of the document table 11a, the image quality of the read image at the end of the readable area R0 is deteriorated. For this reason, it is never preferable to increase the height of the entire frame 13a in order to detect with high sensitivity an exceptional case in which a document of the maximum size or more is placed on the document table 11a.

このような理由から、本実施例では、上述のように、原稿の乗り上げを検知する領域である右フレーム13a(R)の原稿台11a表面からの高さh’のみを大きく設定し、他のフレーム13a(L),13a(U),13a(D)の原稿台11a表面からの高さhを、一律に同一の高さh(<h’)としているのである。   For this reason, in this embodiment, as described above, only the height h ′ from the surface of the document table 11a of the right frame 13a (R), which is an area for detecting the rising of the document, is set large. The heights h of the frames 13a (L), 13a (U), and 13a (D) from the surface of the document table 11a are uniformly set to the same height h (<h ′).

本実施例では、原稿台11aの左下角に原稿の左下角を突き当てるように指示している関係上、原稿台11aに載置される原稿が読取可能領域R0を超えるサイズのものであったとしても、左フレーム13a(L)や下フレーム13a(D)に原稿が乗り上げるケースは少ない。これに対し、原稿台11aに、読取可能領域R0を超えるサイズの原稿が載置された場合には、高い確率で右フレーム13a(R)において原稿が乗り上がる。   In this embodiment, since the lower left corner of the original is in contact with the lower left corner of the original platen 11a, the original placed on the original platen 11a has a size exceeding the readable area R0. However, there are few cases in which the document runs on the left frame 13a (L) or the lower frame 13a (D). On the other hand, when a document having a size exceeding the readable area R0 is placed on the document table 11a, the document runs on the right frame 13a (R) with high probability.

従って、原稿が突き当てられる左フレーム13a(L)とは原稿台11aを挟んで反対側に位置する右フレーム13a(R)の原稿台11a表面からの高さh’を、左フレーム13a(L)の原稿台11a表面からの高さhより高く設定すれば、読取画像の画質の劣化を極力抑えて、原稿台11aに最大サイズ以上の原稿が載置されたことを、黒領域長Lの長さから感度よく検知できるのである。   Accordingly, the height h ′ of the right frame 13a (R) located on the opposite side of the document table 11a from the surface of the document table 11a with respect to the left frame 13a (L) against which the document is abutted is set to the left frame 13a (L). ) Is set higher than the height h from the surface of the document table 11a, the deterioration of the image quality of the read image is suppressed as much as possible, and a document of a size larger than the maximum size is placed on the document table 11a. Sensitivity can be detected from the length.

この他、本実施例の複合機1では、読取可能領域R0の一部領域をプレスキャンして、その読取結果に基づき、原稿の状態(原稿サイズ・原稿の傾き・原稿の載置領域)を推定するようにしているので、本実施例によれば、従来のように、読取可能領域R0全体をプレスキャンする手法よりも高速にプレスキャン動作を終了することができ、効率的に原稿の状態を推定することができる。   In addition, in the MFP 1 of this embodiment, a partial area of the readable area R0 is pre-scanned, and based on the reading result, the state of the original (original size, original inclination, original placement area) is determined. Thus, according to the present embodiment, the prescan operation can be completed at a higher speed than the conventional method of prescanning the entire readable region R0, and the state of the document can be efficiently performed. Can be estimated.

また、以上では、プレスキャンを、読取可能領域R0全体ではなく、一部領域のみに対して実行するように、複合機1を設計している関係上、原稿の乗り上げ検知を、右フレーム13a(R)を通じて行うようにしたが、プレスキャンを、読取可能領域R0全体に対して行うように複合機1を構成する場合には、原稿の乗り上げ検知を、上フレーム13a(U)を通じて行うようにしてもよい。
[変形例]
図14は、変形例における画像読取部10の原稿台11a周辺の構成を表した説明図であり、図14上図は、その平面図、図14下図は、B−B’断面図である。
Further, in the above, because the multi-function device 1 is designed so that the pre-scan is performed not on the entire readable area R0 but only on a partial area, the detection of the document on the right frame 13a ( R), but when the multi-function peripheral 1 is configured to perform pre-scan on the entire readable area R0, the detection of the document is detected through the upper frame 13a (U). May be.
[Modification]
FIG. 14 is an explanatory diagram showing a configuration around the document table 11a of the image reading unit 10 in a modified example. FIG. 14 is a plan view, and FIG. 14 is a cross-sectional view taken along line BB ′.

図14に示すように、変形例では、原稿台11aの上端縁に接する上フレーム13a(U)の原稿台11a表面からの高さh’が、原稿台11aの下端縁に接する下フレーム13a(D)の原稿台11a表面からの高さhよりも高い値に設定されている(h’>h)。   As shown in FIG. 14, in the modification, the height h ′ of the upper frame 13a (U) in contact with the upper edge of the document table 11a from the surface of the document table 11a is lower frame 13a (in contact with the lower edge of the document table 11a). D) is set to a value higher than the height h from the surface of the document table 11a (h ′> h).

また、変形例においては、CPU70が実行する自動変倍複写処理のS210及びS235の処理が夫々、以下に説明するS211及びS236の処理に置き換えられ、更に、S220で実行する乗り上げ判定処理が、図16に示す内容に置き換えられている。   Further, in the modification, the processes of S210 and S235 of the automatic scaling copying process executed by the CPU 70 are respectively replaced with the processes of S211 and S236 described below, and the ride determination process executed in S220 is shown in FIG. The contents shown in FIG.

尚、図15は、変形例においてCPU70が実行する自動変倍複写処理の一部を抜粋して表したフローチャートであり、図16は、変形例においてCPU70が実行する乗り上げ判定処理を表すフローチャートである。   FIG. 15 is a flowchart showing a part of the automatic scaling copying process executed by the CPU 70 in the modification, and FIG. 16 is a flowchart showing the riding determination process executed by the CPU 70 in the modification. .

図15に示すように、変形例のCPU70は、自動変倍複写処理を開始すると、まず、原稿読取開始位置を、読取可能領域R0の下端(Y=0)に設定し、原稿読取終了位置を、読取可能領域R0の上端(Y=YMAX)に設定することにより、読取可能領域R0全域を読取領域(換言すればプレスキャン領域)に設定し、読取制御部20を通じて、画像読取部10に、読取可能領域R0全域に対するプレスキャン動作を実行させる(S211:全体プレスキャン処理)。   As shown in FIG. 15, when the CPU 70 of the modified example starts the automatic scaling copying process, first, the document reading start position is set at the lower end (Y = 0) of the readable area R0, and the document reading end position is set. By setting the upper end of the readable area R0 (Y = YMAX), the entire readable area R0 is set as a reading area (in other words, a pre-scan area). A pre-scan operation is performed on the entire readable area R0 (S211: whole pre-scan process).

また、この処理を終えると、CPU70は、RAM80に記録されたプレスキャン画像データが示す各画素のRGB値を、所定の計算式に従って、輝度値Zに変換することにより、プレスキャン画像データを、各画素の輝度値を表す輝度データに変換し(S215)、上記生成した輝度データに基づいて、乗り上げ判定処理を実行する(S220)。但し、ここでは、図16に示す乗り上げ判定処理を実行する。   When this process is finished, the CPU 70 converts the RGB value of each pixel indicated by the prescan image data recorded in the RAM 80 into a luminance value Z according to a predetermined calculation formula, thereby converting the prescan image data into It converts into the luminance data showing the luminance value of each pixel (S215), and a riding-up determination process is executed based on the generated luminance data (S220). However, the boarding determination process shown in FIG. 16 is executed here.

図16に示す乗り上げ判定処理を開始すると、CPU70は、まずS910にて、主走査方向検査位置Xeを、設計段階で予め定められた検査開始位置XINIに、設定する(Xe=YINI)。また、S910での処理を終えると、CPU70は、S921に移行して、副走査方向検査位置Yeを、読取可能領域R0上端のY座標に設定する(Ye=YMAX)。   When the boarding determination process shown in FIG. 16 is started, the CPU 70 first sets the main scanning direction inspection position Xe to the inspection start position XINI predetermined in the design stage (Xe = YINI) in S910. When the processing in S910 is completed, the CPU 70 proceeds to S921 and sets the sub-scanning direction inspection position Ye to the Y coordinate of the upper end of the readable area R0 (Ye = YMAX).

また、この処理を終えると、CPU70は、輝度データを参照することにより、検査位置(X,Y)=(Xe,Ye)に対応する画素の輝度値Zを得て、この検査位置(Xe,Ye)に対応する画素の輝度値Zが、予め定められた閾値Zthを超えているか否かを判断する(S923)。   When this process is completed, the CPU 70 refers to the luminance data to obtain the luminance value Z of the pixel corresponding to the inspection position (X, Y) = (Xe, Ye), and this inspection position (Xe, It is determined whether or not the luminance value Z of the pixel corresponding to Ye) exceeds a predetermined threshold value Zth (S923).

そして、輝度値Zが閾値Zth以下である(即ち、Z≦Zthである)と判断すると(S923でNo)、CPU70は、S925に移行し、副走査方向検査位置Yeを、1画素分マイナス方向にずらした値に更新した後に(即ち、Ye←Ye−1に更新した後に)、S927に移行する。   If it is determined that the luminance value Z is equal to or less than the threshold value Zth (that is, Z ≦ Zth) (No in S923), the CPU 70 proceeds to S925 and sets the sub-scanning direction inspection position Ye in the minus direction by one pixel. After updating to the value shifted to (that is, after updating to Ye ← Ye−1), the process proceeds to S927.

また、S927では、更新後の副走査方向検査位置Yeが読取可能領域R0の下端であるか否かを判断する。即ち、Ye=0であるか否かを判断する。そして、更新後の副走査方向検査位置Yeが読取可能領域R0の下端であると判断すると(S927でYes)、S929に移行する。   In S927, it is determined whether or not the updated sub-scanning direction inspection position Ye is the lower end of the readable area R0. That is, it is determined whether Ye = 0. When it is determined that the updated sub-scanning direction inspection position Ye is the lower end of the readable area R0 (Yes in S927), the process proceeds to S929.

一方、Ye>0であり、更新後の副走査方向検査位置Yeが読取可能領域R0の下端でないと判断すると(S927でNo)、CPU70は、S923に移行し、更新後の検査位置(X,Y)=(Xe,Ye)について、この検査位置に対応する画素の輝度値Zが、閾値Zthを超えているか否かを判断する。   On the other hand, if it is determined that Ye> 0 and the updated sub-scanning direction inspection position Ye is not the lower end of the readable region R0 (No in S927), the CPU 70 proceeds to S923 and updates the updated inspection position (X, For Y) = (Xe, Ye), it is determined whether or not the luminance value Z of the pixel corresponding to this inspection position exceeds the threshold value Zth.

そして、検査位置に対応する画素の輝度値Zが閾値Zthを超えていると判断すると(S923でYes)、S929に移行する。
また、S929では、読取可能領域R0の上端から、現在設定されている副走査方向検査位置YeまでのY軸方向長さLを、座標X=Xeの地点における黒領域長L(X=Xe)として算出する。即ち、式L=YMAX−Yeに従って、座標X=Xeの地点における黒領域長L(X=Xe)を算出する。
When it is determined that the luminance value Z of the pixel corresponding to the inspection position exceeds the threshold value Zth (Yes in S923), the process proceeds to S929.
In S929, the Y-axis direction length L from the upper end of the readable area R0 to the currently set sub-scanning direction inspection position Ye is set to the black area length L (X = Xe) at the point of the coordinate X = Xe. Calculate as That is, the black area length L (X = Xe) at the point of the coordinate X = Xe is calculated according to the equation L = YMAX−Ye.

また、S929での処理を終えると、CPU70は、S930に移行し、主走査方向検査位置Xeを、X軸プラス方向に1画素分移動した位置に更新する(Xe←Xe+1)。その後、主走査方向検査位置Xeが、設計段階で予め定められた検査終了位置XFINを超えているか否かを判断する(S940)。尚、検査終了位置XFINは、検査開始位置XINIと同様、設計段階で、設計者により、0以上XMAX以下の値に、定められる。但し、当然のことながら、検査終了位置XFINは、検査開始位置XINIよりもX軸プラス方向に大きな値として、定められる(XFIN>XINI)。   When the process in S929 is completed, the CPU 70 proceeds to S930 and updates the main scanning direction inspection position Xe to a position moved by one pixel in the X axis plus direction (Xe ← Xe + 1). Thereafter, it is determined whether or not the main scanning direction inspection position Xe exceeds the inspection end position XFIN predetermined in the design stage (S940). The inspection end position XFIN is set to a value between 0 and XMAX by the designer at the design stage, as with the inspection start position XINI. However, as a matter of course, the inspection end position XFIN is determined as a value larger in the X-axis plus direction than the inspection start position XINI (XFIN> XINI).

そして、主走査方向検査位置Xeが検査終了位置XFINを超えていないと判断すると(即ち、Xe≦XFINであると判断すると)、CPU70は、S921に移行し、後続の処理を実行する。このような動作の繰返しによって、CPU70は、検査開始位置XINIから検査終了位置XFINまでの各座標Xにおいて、上述の手法により、読取可能領域R0領域上端を基点とした黒領域長L(X)を算出する。   If the CPU 70 determines that the main scanning direction inspection position Xe does not exceed the inspection end position XFIN (that is, determines that Xe ≦ XFIN), the CPU 70 proceeds to S921 and executes subsequent processing. By repeating such an operation, the CPU 70 calculates the black area length L (X) with the upper end of the readable area R0 area as the base point at each coordinate X from the inspection start position XINI to the inspection end position XFIN by the above-described method. calculate.

そして、主走査方向検査位置Xeが検査終了位置XFINを超えていると判断すると(S940でYes)、CPU70は、S950に移行し、S929で算出した、XINI≦X≦XMAXの範囲における各座標Xでの黒領域長L(X)の値を用いて、それら黒領域長L(X)の平均値AVE(L)を算出する。   If it is determined that the main scanning direction inspection position Xe exceeds the inspection end position XFIN (Yes in S940), the CPU 70 proceeds to S950 and calculates each coordinate X in the range of XINI ≦ X ≦ XMAX calculated in S929. The average value AVE (L) of the black area length L (X) is calculated using the value of the black area length L (X).

また、S950での処理を終えると、CPU70は、この平均値AVE(L)が、予め定められた閾値Lth以上であるか否かを判断する(S960)。そして、平均値AVE(L)が閾値Lth以上であると判断すると(S960でYes)、原稿が上フレーム13a(U)に乗り上げられているとして、「乗り上げ有」判定を下す(S970)。一方、平均値AVE(L)が閾値Lth未満であると判断すると(S960でNo)、原稿が上フレーム13a(U)に乗り上げられていないとして、「乗り上げ無」判定を下す(SS980)。   When the process in S950 is completed, the CPU 70 determines whether or not the average value AVE (L) is equal to or greater than a predetermined threshold Lth (S960). If it is determined that the average value AVE (L) is equal to or greater than the threshold value Lth (Yes in S960), it is determined that the document is on the upper frame 13a (U) (S970). On the other hand, if it is determined that the average value AVE (L) is less than the threshold value Lth (No in S960), it is determined that the document is not carried on the upper frame 13a (U), and a “no ride” determination is made (SS980).

このようにして、S970又はS980の処理を終えると、CPU70は、当該乗り上げ判定処理を終了して、S225に移行する。
また、S225に移行すると、CPU70は、直前のS220で実行した乗り上げ判定処理において、「乗り上げ有」判定が下されたか否かを判断し、「乗り上げ有」判定が下されておらず、「乗り上げ無」判定が下されたと判断すると(S225でNo)、S230に移行する。
Thus, when the process of S970 or S980 is completed, the CPU 70 ends the ride-up determination process and proceeds to S225.
When the process proceeds to S225, the CPU 70 determines whether or not the “ride on” determination is made in the ride determination process executed in the immediately preceding S220, and the “ride on” determination is not made. If it is determined that the “no” determination is made (No in S225), the process proceeds to S230.

そして、S230では、RAM80に記録されたプレスキャン画像データに対応する上記輝度データに対してエッジ検出処理を実行し、この画像データに対応するエッジ画像データを生成する。また、S230での処理を終えると、CPU70は、S236に移行し、上記生成したエッジ画像データから原稿エッジを検出し、この検出結果に基づいて、原稿台11aに載置された原稿のサイズ(縦幅及び横幅)、及び、原稿の傾き角θ、及び、原稿台11aにおける原稿の載置領域を推定する。尚、S236では、S235と同様に、図7に示す原稿推定処理を実行してもよいし、原稿エッジとして左エッジ・右エッジ・下エッジの他、上エッジをも検出して、これらの近似直線から、原稿サイズ等を推定するようにしてもよい。   In S230, edge detection processing is performed on the luminance data corresponding to the pre-scan image data recorded in the RAM 80, and edge image data corresponding to the image data is generated. When the processing in S230 is completed, the CPU 70 proceeds to S236, detects the document edge from the generated edge image data, and based on the detection result, the size of the document placed on the document table 11a ( (Vertical width and horizontal width), the inclination angle θ of the document, and the document placement area on the document table 11a are estimated. In S236, as in S235, the document estimation processing shown in FIG. 7 may be executed, or the upper edge is detected as the document edge in addition to the left edge, right edge, and lower edge, and approximation thereof is performed. The document size or the like may be estimated from the straight line.

このようにして、S236での処理を終えると、CPU70は、S250に移行し、後続の処理を、上記実施例と同様に実行する。この他、「乗り上げ有」判定が下されたと判断すると(S225でYes)、CPU70は、S241に移行し、後続の処理を、上記実施例と同様に実行する。   In this way, when the processing in S236 is completed, the CPU 70 proceeds to S250 and executes the subsequent processing in the same manner as in the above embodiment. In addition, if it is determined that the “ride on” determination has been made (Yes in S225), the CPU 70 proceeds to S241 and executes the subsequent processing in the same manner as in the above embodiment.

以上、変形例の複合機1の構成を説明したが、本変形例においても、上述の実施例と同様の効果を得ることができる。
また、以上には、変形例を含む本発明の実施例について説明したが、本発明の状態判定手段は、CPU70が実行するS215,S220の処理により実現され、報知手段は、S241の処理により実現され、原稿推定手段は、CPU70が実行するS225〜S247の処理により実現されている。
The configuration of the MFP 1 according to the modification has been described above, but the same effect as that of the above-described embodiment can be obtained in this modification.
Moreover, although the embodiment of the present invention including the modification has been described above, the state determination unit of the present invention is realized by the processing of S215 and S220 executed by the CPU 70, and the notification unit is realized by the processing of S241. The document estimation unit is realized by the processing of S225 to S247 executed by the CPU 70.

また、本発明は、上記実施例に限定されるものではなく、種々の態様を採ることができる。例えば、複合機1は、読取可能領域R0全体をプレスキャンして、そのプレスキャン結果に基づき、右フレーム13a(R)及び上フレーム13a(U)のいずれか一方に、原稿が乗り上げている場合、「乗り上げ有」判定し、右フレーム13a(R)及び上フレーム13a(U)のいずれにも、原稿が乗り上げていない場合に限って、「乗り上げ無」判定するように、構成されてもよい。   Further, the present invention is not limited to the above-described embodiments, and can take various forms. For example, when the multifunction device 1 pre-scans the entire readable area R0 and a document is placed on one of the right frame 13a (R) and the upper frame 13a (U) based on the pre-scan result. It may be configured to determine “riding on” and to determine “no riding” only when the document is not riding on either the right frame 13a (R) or the upper frame 13a (U). .

ディジタル複合機1の構成を表す説明図である。2 is an explanatory diagram illustrating a configuration of a digital multi-function peripheral 1. FIG. 原稿台11a周辺の構成を表す画像読取部10の平面図(a)及び原稿台11a周辺のA−A’断面図(b)及びXY座標系の説明図(c)である。2A is a plan view of the image reading unit 10 showing the configuration around the document table 11a, FIG. 3B is a cross-sectional view along A-A ′ around the document table 11a, and FIG. 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が実行する乗り上げ判定処理を表すフローチャートである。It is a flowchart showing the boarding determination process which CPU70 performs. 原稿台11a端部における輝度の分布を表した説明図である。FIG. 6 is an explanatory diagram showing a luminance distribution at an end portion of a document table 11a. 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が実行する左エッジ検出処理を表すフローチャートである。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. 変形例の原稿台11a周辺の構成を表した画像読取部10の平面図及びB−B’断面図である。FIG. 10 is a plan view and a B-B ′ sectional view of an image reading unit 10 showing a configuration around a document table 11 a of a modified example. CPU70が実行する変形例の自動変倍複写処理を表すフローチャートである。10 is a flowchart showing a modified automatic scaling copying process executed by a CPU. CPU70が実行する変形例の乗り上げ判定処理を表すフローチャートである。It is a flowchart showing the boarding determination process of the modification which CPU70 performs.

符号の説明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 (5)

読取対象の原稿が載置される透明な原稿台下において読取ユニットを搬送し、前記原稿台に写る画像を、前記読取ユニットに読み取らせることにより、前記原稿台に載置された原稿の読取画像を表す画像データを生成する画像読取装置であって、
前記原稿台の周縁に、前記原稿台の周縁を包囲するフレームを備え、
当該フレームにより、前記原稿台と前記フレームとの境界には、前記フレームを高位とし前記原稿台を低位とする段差が形成され、
更に、当該画像読取装置は、
前記読取ユニットの読取結果である画像データであって、前記原稿台と前記フレームとの境界周辺の画像データが示す各画素の輝度の分布に基づき、前記原稿台に載置された原稿の一部が、前記フレームに乗った状態にあるか否かを判定する状態判定手段
を備えることを特徴とする画像読取装置。
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
A frame surrounding the periphery of the document table on the periphery of the document table;
The frame forms a step at the boundary between the document table and the frame, with the frame as a high level and the document table as a low level.
Furthermore, the image reading apparatus
A part of the document placed on the document table, based on the distribution of luminance of each pixel indicated by the image data around the boundary between the document table and the frame, which is image data that is a reading result of the reading unit An image reading apparatus comprising: state determination means for determining whether or not the vehicle is on the frame.
前記状態判定手段は、前記原稿台と前記フレームとの境界周辺の画像データが示す各画素の輝度の情報から、前記原稿台と前記フレームとの境界から広がる前記輝度が閾値以下の黒領域の長さを計測し、前記黒領域の長さが所定距離以上であるとき、前記原稿台に載置された原稿の一部が、前記フレームに乗った状態にあると判定する構成にされていること
を特徴とする請求項1記載の画像読取装置。
The state determination means determines the length of the black region whose luminance spreading from the boundary between the document table and the frame is below a threshold value from information on the luminance of each pixel indicated by image data around the boundary between the document table and the frame. When the length of the black area is equal to or longer than a predetermined distance, it is determined that a part of the document placed on the document table is in a state of being on the frame. The image reading apparatus according to claim 1.
前記原稿台の特定の端縁は、原稿を突き当てるべき原稿突当位置として定められ、
前記原稿突当位置とは前記原稿台を挟んで対称的な位置に存在する前記フレームの部位、が形成する段差の前記原稿台表面からの高さは、前記原稿突当位置に対応する前記フレームの部位が形成する段差の前記原稿台表面からの高さよりも、高く設定されていること
を特徴とする請求項1又は請求項2記載の画像読取装置。
The specific edge of the document table is defined as a document abutting position where the document should be abutted,
The height of the step formed by the document abutting position from the surface of the document table formed by a portion of the frame existing symmetrically with respect to the document table is the frame corresponding to the document abutting position. The image reading apparatus according to claim 1, wherein the step formed by the portion is set to be higher than a height from the surface of the document table.
前記状態判定手段の判定結果に基づき、前記原稿台に載置された原稿の一部が前記フレームに乗った状態にある場合には、その旨をユーザに向けて報知する報知手段
を備えることを特徴とする請求項1〜請求項3のいずれかに記載の画像読取装置。
When a part of the document placed on the document table is in the state of being on the frame based on the determination result of the state determination unit, a notification unit is provided to notify the user to that effect. The image reading apparatus according to claim 1, wherein the image reading apparatus is an image reading apparatus.
前記読取ユニットの読取結果である画像データに基づき、前記原稿台に載置された原稿のエッジを検出し、この検出結果に基づき、前記原稿台に載置された原稿のサイズを推定する原稿推定手段
を備え、
前記原稿推定手段は、前記状態判定手段により前記原稿の一部が前記フレームに乗った状態にあると判定されると、前記エッジの検出結果に依らず、前記原稿台に載置された原稿のサイズを、前記原稿台に載置可能な最大サイズであると推定する構成にされていること
を特徴とする請求項1〜請求項4のいずれかに記載の画像読取装置。
Document estimation for detecting an edge of a document placed on the document table based on image data as a reading result of the reading unit and estimating a size of the document placed on the document table based on the detection result Means
When the state determination unit determines that a part of the document is on the frame, the document estimation unit determines whether the document placed on the document table is independent of the edge detection result. The image reading apparatus according to claim 1, wherein the size is estimated to be a maximum size that can be placed on the document table.
JP2007340773A 2007-12-28 2007-12-28 Image reading device Expired - Fee Related JP4858437B2 (en)

Priority Applications (1)

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

Applications Claiming Priority (1)

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

Publications (2)

Publication Number Publication Date
JP2009164808A true JP2009164808A (en) 2009-07-23
JP4858437B2 JP4858437B2 (en) 2012-01-18

Family

ID=40966917

Family Applications (1)

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

Country Status (1)

Country Link
JP (1) JP4858437B2 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012253415A (en) * 2011-05-31 2012-12-20 Brother Ind Ltd Image reader
JP2018098722A (en) * 2016-12-16 2018-06-21 キヤノン株式会社 Image reading device, image forming device, reading method, and image forming system
JP2018170731A (en) * 2017-03-30 2018-11-01 キヤノン株式会社 Document reading apparatus and image forming apparatus
US10616428B2 (en) 2016-12-16 2020-04-07 Canon Kabushiki Kaisha Image reading apparatus and image reading method
US10764461B2 (en) 2016-12-16 2020-09-01 Canon Kabushiki Kaisha Image reading apparatus with determination of original size, and image forming apparatus, reading method, and image forming system therewith

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001318437A (en) * 2000-05-08 2001-11-16 Seiko Epson Corp Image reading device
JP2004282517A (en) * 2003-03-17 2004-10-07 Sharp Corp Original reader
JP2007199886A (en) * 2006-01-25 2007-08-09 Fuji Xerox Co Ltd Image reading apparatus, image processing apparatus, image forming apparatus, image processing method, image forming method and program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001318437A (en) * 2000-05-08 2001-11-16 Seiko Epson Corp Image reading device
JP2004282517A (en) * 2003-03-17 2004-10-07 Sharp Corp Original reader
JP2007199886A (en) * 2006-01-25 2007-08-09 Fuji Xerox Co Ltd Image reading apparatus, image processing apparatus, image forming apparatus, image processing method, image forming method and program

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012253415A (en) * 2011-05-31 2012-12-20 Brother Ind Ltd Image reader
JP2018098722A (en) * 2016-12-16 2018-06-21 キヤノン株式会社 Image reading device, image forming device, reading method, and image forming system
US10616428B2 (en) 2016-12-16 2020-04-07 Canon Kabushiki Kaisha Image reading apparatus and image reading method
US10764461B2 (en) 2016-12-16 2020-09-01 Canon Kabushiki Kaisha Image reading apparatus with determination of original size, and image forming apparatus, reading method, and image forming system therewith
JP2018170731A (en) * 2017-03-30 2018-11-01 キヤノン株式会社 Document reading apparatus and image forming apparatus
CN111314575A (en) * 2017-03-30 2020-06-19 佳能株式会社 Image reading apparatus and image forming apparatus
EP4161046A1 (en) * 2017-03-30 2023-04-05 Canon Kabushiki Kaisha Image reading apparatus and image forming apparatus for detecting whether sheet is protruding from readable range

Also Published As

Publication number Publication date
JP4858437B2 (en) 2012-01-18

Similar Documents

Publication Publication Date Title
JP5205963B2 (en) Image reading device
US8174737B2 (en) Image reading apparatus
JP5264831B2 (en) Image processing apparatus, image reading apparatus, image forming apparatus, image processing method, computer program, and recording medium
US8284463B2 (en) Image reading apparatus
JP4858437B2 (en) Image reading device
JP4941316B2 (en) Image reading device
JP4888439B2 (en) Image reading apparatus and original size determination program
JP4952576B2 (en) Image reading device
WO2017056799A1 (en) Image-reading device and image-forming device
JP5407627B2 (en) Image processing apparatus, image processing method, and program
JP4924416B2 (en) Image reading device
JP2015181218A (en) Image scanning device and image scanning method
JP4924417B2 (en) Image analysis device
US20090073463A1 (en) Image processing apparatus, image processing method, and computer-readable recording medium
JP4998257B2 (en) Image reading device
JP4952575B2 (en) Image reading device
JP7482625B2 (en) IMAGE PROCESSING APPARATUS, CONTROL METHOD FOR IMAGE PROCESSING APPARATUS, AND PROGRAM
JP4941317B2 (en) Image reading device
JP2023069850A (en) Image reader and control method of image reader
JP5765169B2 (en) Image processing apparatus, image reading apparatus, and image processing program
JP2003319144A (en) Image forming apparatus
JP5312864B2 (en) Image forming apparatus
JP7211118B2 (en) Reading system and reading method
JP2023116052A (en) Image reading apparatus
JP6081874B2 (en) Image reading 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: 20110701

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110712

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110912

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

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

R150 Certificate of patent or registration of utility model

Ref document number: 4858437

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20141111

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees