JP4941316B2 - Image reading device - Google Patents
Image reading device Download PDFInfo
- Publication number
- JP4941316B2 JP4941316B2 JP2008006926A JP2008006926A JP4941316B2 JP 4941316 B2 JP4941316 B2 JP 4941316B2 JP 2008006926 A JP2008006926 A JP 2008006926A JP 2008006926 A JP2008006926 A JP 2008006926A JP 4941316 B2 JP4941316 B2 JP 4941316B2
- Authority
- JP
- Japan
- Prior art keywords
- edge
- document
- group
- point
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Image Input (AREA)
- Facsimile Scanning Arrangements (AREA)
Description
本発明は、原稿の読取画像を表す画像データを解析する機能を備えた画像読取装置に関する。 The present invention relates to an image reading apparatus having a to that function analyzes the image data representing the read image of the originals.
従来、画像読取装置としては、読取ガラス下に読取ユニットを備え、読取ガラス上に載置された原稿を、読取ガラス下で読取ユニットを通じて読み取るフラットベッド型の画像読取装置が知られている。この種の画像読取装置では、読取ガラス下で読取ユニットを搬送しつつ、その搬送時に読取ユニットに読取動作を実行させることにより、読取ガラス上に配置された原稿を読み取り、原稿の読取画像を表す画像データを生成する。 2. Description of the Related Art Conventionally, as an image reading apparatus, a flat bed type image reading apparatus that includes a reading unit under a reading glass and reads a document placed on the reading glass through the reading unit under the reading glass is known. In this type of image reading apparatus, while the reading unit is conveyed under the reading glass, the reading unit is caused to perform a reading operation during the conveyance, thereby reading a document placed on the reading glass and representing a read image of the document. Generate image data.
この他、画像読取装置としては、コピー機能を有するものが知られており、コピー機能を有する画像読取装置としては、コピー機能の他、プリンタ機能やファックス(FAX)機能などを有したディジタル複合機が知られている。 In addition, an image reading apparatus having a copy function is known. As an image reading apparatus having a copy function, a digital multifunction peripheral having a printer function, a fax (FAX) function, etc. in addition to a copy function. It has been known.
また、画像読取装置としては、読取対象の原稿を、読取ユニットを通じて読み取って、その読取結果から原稿エッジ(原稿の端縁)を検出するものが知られている(例えば、特許文献1〜特許文献3参照)。また、コピー機能を有する画像読取装置としては、プレスキャンにより得られた読取結果から読取対象の原稿のサイズや傾きを検出し(例えば、特許文献4参照)、検出した原稿サイズや傾きの情報に基づいて、変倍率や傾き補正量等を設定する画像読取装置が知られている。
ところで、読取ユニットによる原稿の読取結果から、原稿の端縁である原稿エッジを検出する方法では、原稿内に描写された罫線等を、原稿エッジであると誤検出する可能性がある。即ち、原稿の読取画像を表す画像データにおいては、原稿内の罫線がある地点でも、原稿の端縁に似た画像パターンが現れる。一方で、読取対象の原稿については、原稿が傾いていたり、原稿サイズが不定であるため、読取結果としての上記画像データから、原稿の端縁に対応する画像パターンを見つけて原稿エッジを検出しようとしても、誤って、原稿内部の罫線等の画像パターンを見つけて原稿エッジを誤検出してしまう可能性があるのである。 By the way, in the method of detecting the document edge that is the edge of the document from the result of reading the document by the reading unit, there is a possibility that the ruled line drawn in the document is erroneously detected as the document edge. That is, in the image data representing the read image of the document, an image pattern similar to the edge of the document appears even at a point where the ruled line is present in the document. On the other hand, since the original to be read is tilted or the original size is indeterminate, an image pattern corresponding to the edge of the original is found from the above image data as a read result and the original edge is detected. However, there is a possibility that an image pattern such as a ruled line inside a document is erroneously detected and a document edge is erroneously detected.
また、フラットベッド型の画像読取装置では、読取ガラス上に原稿を載置した状態で、読取ガラスに写る画像を読取ガラス下で読み取るため、読取ガラス上に、埃(髪の毛等)が載っていると、その埃についても読み取ってしまい、読取結果としての画像データに、原稿以外の像が現れることになる。従って、このような埃の像が現れた画像データを解析して、原稿エッジを検出する場合にも、埃の像に惑わされて原稿エッジを誤検出してしまう可能性がある。 Further, in a flat bed type image reading apparatus, dust (hair, etc.) is placed on the reading glass in order to read an image on the reading glass under the reading glass with a document placed on the reading glass. Then, the dust is also read, and an image other than the original appears in the image data as the read result. Therefore, even when image data in which such a dust image appears is analyzed to detect a document edge, the document edge may be misled by the dust image.
このように、読取ユニットによる原稿の読取結果から、原稿エッジを検出する方法では、様々な要因により、原稿エッジを誤検出する可能性がある。
本発明は、こうした問題に鑑みなされたものであり、読取ユニットによる読取結果としての画像データから、原稿エッジ(原稿の端縁)を検出する装置において、原稿内部の罫線や埃等の影響を抑えて、原稿エッジを適切に検出可能な技術を提供することを目的とする。
As described above, in the method of detecting the document edge from the result of reading the document by the reading unit, the document edge may be erroneously detected due to various factors.
The present invention has been made in view of these problems, and suppresses the influence of ruled lines, dust, and the like inside a document in an apparatus that detects a document edge (document edge) from image data obtained as a result of reading by a reading unit. An object of the present invention is to provide a technique capable of appropriately detecting an edge of a document.
かかる目的を達成するためになされた発明は、読取対象の原稿が載置される原稿台と、原稿台に載置された原稿を読み取るための読取ユニットと、読取ユニットに、原稿台に載置された原稿を読み取らせることにより、原稿台に載置された原稿の読取画像を表す画像データを生成する読取制御手段と、を備える画像読取装置であって、更に、変換手段と、選択手段と、記憶手段と、検出手段と、を備えるものである。 Is made the inventions in order to achieve the above object, a document table document to be read is placed, a reading unit for reading a document placed on the document table, the reading unit, mounting the platen by reading the location to the document, an image reading apparatus Ru comprising a reading control means for generating image data representing the read image of a document placed on the document table, the further conversion means, selection Means, storage means, and detection means.
この画像読取装置における変換手段は、読取制御手段により生成された画像データを、エッジ画像を表す画像データに変換する。また、選択手段は、原稿台において、特定方向に延びる原稿の端縁、を表すエッジ点の候補を、上記変換手段による変換後の画像データから選択する。また、記憶手段は、上記選択手段により候補として選択されたエッジ点の位置情報を記憶する。 The conversion unit in the image reading apparatus converts the image data generated by the reading control unit into image data representing an edge image. Further, the selection means selects, from the image data converted by the conversion means , candidate edge points representing the edge of the document extending in a specific direction on the document table . The storage means stores position information of the edge point selected as a candidate by the selection means.
この他、検出手段は、上記記憶手段が記憶するエッジ点の位置情報から特定される上記選択手段により候補として選択されたエッジ点の分布に基づき、選択手段により選択された候補の一群の中から、原稿の端縁を表すエッジ点としての確度が低いエッジ点を破棄することにより、当該破棄後に残る候補を、上記特定方向に延びる原稿の端縁を表すエッジ点として検出する。 In addition, the detecting means is selected from a group of candidates selected by the selecting means based on the distribution of edge points selected as candidates by the selecting means specified from the position information of the edge points stored in the storing means. By discarding edge points with low accuracy as edge points representing the edge of the document, candidates remaining after the discard are detected as edge points representing the edge of the document extending in the specific direction.
また、選択手段は、具体的に、上記変換後の画像データの端点を、参照開始位置に設定して、当該参照開始位置から、予め定められた第一の方向に沿って、画像データの内側へと、この画像データを構成する各画素の画素値を参照することにより、連続性を検査する対象のエッジ点を検出すると共に、検出したエッジ点を起点として、第一の方向とは垂直な第二の方向に、この画像データを構成する各画素の画素値を参照して、第二の方向へのエッジ点の連続性を検査することにより、第二の方向に連続する所定量のエッジ点を、特定方向に延びる原稿の端縁を表すエッジ点の候補として、画像データから選択する。 In addition, the selection unit specifically sets the end point of the converted image data as a reference start position, and extends from the reference start position to the inner side of the image data along a predetermined first direction. Then, by referring to the pixel value of each pixel constituting the image data, the edge point to be inspected for continuity is detected, and the detected edge point is the starting point and is perpendicular to the first direction. A predetermined amount of edges that are continuous in the second direction by checking the continuity of the edge points in the second direction with reference to the pixel values of the pixels that make up this image data in the second direction A point is selected from the image data as a candidate for an edge point representing the edge of the document extending in a specific direction.
選択手段は、このような動作を、参照開始位置を第二の方向にずらしながら複数回繰返し実行することにより、特定方向に延びる原稿の端縁を表すエッジ点の候補を、所定量ずつ、画像データの端から探索して選択する。 The selection unit repeatedly performs such an operation a plurality of times while shifting the reference start position in the second direction, thereby generating a predetermined amount of edge point candidates representing the edge of the document extending in a specific direction. Search and select from the end of the data.
このように、本発明の画像読取装置では、原稿の端縁を表すエッジ点の候補を、上記所定量としての複数個ずつ、画像データの端から探索して選択するので、原稿台に載置された埃や原稿内部に描写された罫線等の影響を抑えて、原稿の端縁を表すエッジ点(原稿エッジ)を正確に検出することができる。 As described above, in the image reading apparatus according to the present invention, the plurality of edge point candidates representing the edge of the document are searched and selected from the edge of the image data in units of the predetermined amount. The edge point (document edge) representing the edge of the document can be accurately detected while suppressing the influence of the dust and the ruled lines drawn inside the document.
即ち、本発明によれば、所定量ずつ、独立して、原稿の端縁を表すエッジ点の候補を探索して選択するので、その複数回に及ぶ選択動作の一部の動作が誤選択に該当する動作であっても、その誤選択の影響が、他の回の選択動作に及ぶことがなく、誤選択が、複数回に及ぶ選択動作の全体に波及するのを抑えることができる。 That is, according to the present invention, the candidate of the edge point representing the edge of the document is independently searched and selected by a predetermined amount, so that some of the selection operations that are performed multiple times are erroneously selected. Even in the corresponding operation, the influence of the erroneous selection does not affect the selection operation of other times, and it is possible to suppress the erroneous selection from spreading to the entire selection operation of a plurality of times.
従って、この画像読取装置によれば、原稿の端縁を表すエッジ点の候補として、誤ったエッジ点を選択することがあっても、その誤選択の動作を、検出手段の動作により修正して、最終的に正しい原稿エッジ(原稿の端縁を表すエッジ点)を検出することができ、原稿内部の罫線や埃等の影響を抑え、原稿エッジを適切に検出することができるのである。 Therefore, according to this image reading apparatus , even when an erroneous edge point is selected as an edge point candidate representing the edge of the document, the erroneous selection operation is corrected by the operation of the detection means. Finally, the correct document edge (edge point representing the edge of the document) can be detected, the influence of ruled lines and dust inside the document can be suppressed, and the document edge can be detected appropriately.
ところで、読取制御手段は、第二の方向に垂直な原稿台の一辺から第二の方向に延びる中央までの領域よりも短い領域を、読取ユニットに読み取らせる機能を有する構成にすることができ、選択手段は、この機能により読取制御手段が生成した画像データについての変換手段による変換後の画像データから、エッジ点の候補を選択する構成にすることができる。また、検出手段は、選択手段により選択された所定量の候補を1グループ単位として、各グループの第二の方向への連続性を、第二の方向において最も原稿台の中央寄りのグループを基準に評価し、当該基準としたグループとは不連続なグループに属する候補の全てを、確度が低い候補として破棄する構成にすることができる。 By the way, the reading control means can be configured to have a function of causing the reading unit to read an area shorter than the area extending from one side of the document table perpendicular to the second direction to the center extending in the second direction. The selection means can be configured to select edge point candidates from the image data converted by the conversion means for the image data generated by the reading control means by this function. In addition, the detection unit sets a predetermined amount of candidates selected by the selection unit as one group unit, and the continuity of each group in the second direction is determined based on the group closest to the center of the document table in the second direction. evaluated, all candidate belonging to discontinuous groups and groups and the reference, Ru can certainty is to destroy configured as low candidates.
上述の画像読取装置においては、原稿台に原稿が正しく載置されたときに検出対象の原稿の端縁が延びる方向を、第二の方向に定め、それとは垂直な方向を第一の方向に定めることで、目的の原稿エッジを検出することができるが、このように第一及び第二の方向を定めた場合には、原稿台に原稿が正しく載置されておらず、傾いて載置されている場合、検出対象の原稿の端縁とは違う原稿の端縁に対応するエッジ点を、連続性を検査する対象のエッジ点として検出してしまう可能性があり、当該端縁から原稿の内部に描写された罫線等を、原稿の端縁を表すエッジ点の候補として誤選択してしまう可能性がある(図9(a)参照)。 In the image reading apparatus described above, the direction in which the edge of the document to be detected extends when the document is correctly placed on the document table is defined as the second direction, and the direction perpendicular thereto is defined as the first direction. In this way, the target document edge can be detected. However, when the first and second directions are determined in this way, the document is not placed correctly on the document table, but placed at an angle. The edge point corresponding to the document edge different from the edge of the document to be detected may be detected as the edge point to be inspected for continuity. There is a possibility that a ruled line or the like drawn inside is erroneously selected as a candidate for an edge point representing the edge of the document (see FIG. 9A).
従って、このように誤選択されたエッジ点については、検出手段により破棄できるのが好ましいが、原稿が傾いていることが原因で発生する誤選択動作は、原稿台の端側で発生する可能性が高く原稿台の中央側で発生する可能性は低い。 Accordingly, it is preferable that the erroneously selected edge point can be discarded by the detecting means. However, an erroneous selection operation that occurs due to the inclination of the document may occur on the end side of the document table. Is high and is unlikely to occur at the center of the platen.
このような理由により、上述の検出手段では、選択手段により候補として選択されたエッジ点の内、原稿台の中央寄りに位置するエッジ点を、原稿の端縁を表すエッジ点である確度の高いエッジ点であると取り扱い、第二の方向において最も原稿台の中央寄りのグループとは不連続なグループに属する上記候補の全てを、確度が低い候補として破棄するようにしているのである。 For this reason, the detection means described above has a high probability that the edge point located near the center of the document table among the edge points selected as candidates by the selection means is an edge point representing the edge of the document. It is treated as an edge point, and all of the candidates belonging to a group discontinuous from the group closest to the center of the document table in the second direction are discarded as candidates with low accuracy.
従って、この検出手段を備える画像読取装置の発明によれば、原稿が傾いていることによる選択手段の誤選択動作を、検出手段で修正して、正しく原稿エッジを検出することができて、原稿の罫線等の影響を受けずに、適切に原稿エッジを検出することができる。 Therefore, according to the inventions of an image reading apparatus including the detecting means, an erroneous selection operation of the selection means according to the document is tilted, with modification detection means able to detect the correct document edge, Document edges can be detected appropriately without being affected by the ruled lines of the document.
また、上記検出手段は、検査対象切替設定手段と、第一判定手段と、乖離度算出手段と、第二判定手段と、を備えることができる。 Further, the detection means may comprise an inspection object switching setting means, a first determination unit, a divergence degree calculating unit, a second determination means.
検査対象切替設定手段は、検査対象のグループを、第二の方向において最も原稿台の中央寄りのグループから端寄りのグループへ、順次切り替えるようにして設定し、第一判定手段は、検査対象切替設定手段により検査対象のグループが切り替えられる方向において、検査対象切替設定手段により現在設定されている検査対象のグループに、隣接するグループが存在するか否かを、第二の方向に平行な一次元空間上で評価して判定する。即ち、検査対象のグループに隣接するグループが、検査対象切替設定手段により検査対象のグループが切り替えられる方向に存在するか否かを、第二の方向において評価して判定する。この際、第一の方向については評価しない。 The inspection target switching setting means sets the inspection target group so as to be sequentially switched from the group closest to the center of the document table to the endmost group in the second direction, and the first determination means switches the inspection target switching. In the direction in which the group to be inspected is switched by the setting means, a one-dimensional parallel to the second direction indicates whether or not an adjacent group exists in the group to be inspected currently set by the inspection target switching setting means. Evaluate and judge in space. That is, it is determined by evaluating in the second direction whether or not a group adjacent to the group to be inspected exists in a direction in which the group to be inspected is switched by the inspection target switching setting unit. At this time, the first direction is not evaluated.
そして、乖離度算出手段は、第一判定手段により隣接するグループが存在すると判定されると、検査対象のグループに属する候補であって最も隣接するグループ寄りの候補と、上記隣接するグループに属する候補であって最も検査対象のグループ寄りの候補と、の第一の方向の乖離度を算出する(図9(b)参照)。また、第二判定手段は、乖離度算出手段により算出された乖離度が閾値未満であるか否かを判定する。 When the first determination unit determines that there is an adjacent group, the divergence degree calculation unit is a candidate belonging to the group to be inspected and closest to the group, and a candidate belonging to the adjacent group Then, the degree of deviation in the first direction from the candidate closest to the group to be examined is calculated (see FIG. 9B). Further, the second determination unit determines whether or not the divergence degree calculated by the divergence degree calculation unit is less than a threshold value.
そして、検出手段は、第一判定手段により隣接するグループが存在しないと判定されるか、第二判定手段により乖離度が閾値以上であると判定されると、その時点までに検査対象のグループに設定されなかったグループ(第二の方向において原稿台の端側に位置するグループ)の全てを、第二の方向において最も原稿台の中央寄りのグループとは不連続なグループであるとみなして、当該不連続なグループに属する候補の全てを、破棄する。 When the first determination unit determines that the adjacent group does not exist or the second determination unit determines that the divergence degree is equal to or greater than the threshold, the detection unit determines that the group to be inspected by that time point. All of the groups that were not set (groups located on the edge side of the platen in the second direction) are considered as discontinuous groups from the group closest to the center of the platen in the second direction. Discard all candidates belonging to the discontinuous group.
このように検出手段を構成することにより、第二の方向において最も原稿台の中央寄りのグループとは不連続なグループに属する上記候補の全てを破棄するようにすれば、上述した発明と同様の効果を得ることができる。 By configuring the detection means in this way, if all of the candidates belonging to a group discontinuous from the group closest to the center of the document table in the second direction are discarded, the same as in the above-described invention . An effect can be obtained.
また、検出手段は、選択手段により選択された所定量の候補を1グループ単位として、各グループの第二の方向への連続性を評価し、最も長く連続するグループの集合を、確度が高い候補の集合とみなし、当該最も長く連続するグループの集合に属さないグループ、に属する各候補を、確度が低い候補とみなして、当該確度が低い候補を破棄する構成にされてもよい。 The detection hand stage, as a group unit candidates selected predetermined amount by the selection means, a set of groups to evaluate the continuity of the second direction of each group, successive longest probable A candidate may be regarded as a set of candidates, and each candidate belonging to a group that does not belong to the longest continuous group set may be regarded as a candidate with low accuracy, and a candidate with low accuracy may be discarded.
第二の方向へ長く連続するエッジ点の集合ほど、当該エッジ点の集合が真に検出対象の原稿の端縁を表すエッジ点である可能性が高く、短く連続するエッジ点については、それが原稿台に載置された埃等によって生じたエッジ点である可能性が高い。 The set of edge points that continue long in the second direction is more likely to be the edge point that truly represents the edge of the original document to be detected. There is a high possibility that the edge point is caused by dust or the like placed on the document table.
したがって、このように検出手段を構成して、第二の方向に最も長くエッジ点の集合を、原稿の端縁を表すエッジ点として検出するようにすれば、原稿台に載置された埃等の影響により選択手段で誤選択したエッジ点の集合を、検出手段で破棄して、正しく原稿エッジを検出することができ、埃等の影響を抑えて、適切に原稿エッジを検出することができる。 Therefore, if the detection means is configured in this way so that a set of edge points that are longest in the second direction is detected as an edge point that represents the edge of the document, dust or the like placed on the document table The set of edge points erroneously selected by the selection means due to the influence of the selection means can be discarded by the detection means, and the document edge can be detected correctly, and the influence of dust etc. can be suppressed and the document edge can be detected appropriately. .
また、検出手段は、検査対象のグループを、第二の方向に順次切り替えるようにして設定する検査対象切替設定手段と、上述した第一判定手段と、乖離度算出手段と、第二判定手段と、を備えて、第一判定手段により隣接するグループが存在すると判定され且つ第二判定手段により乖離度が閾値未満であると判定された検査対象のグループについては、そのグループと、当該グループの次に検査対象のグループに設定される上記隣接するグループとが連続していると評価し、第一判定手段により隣接するグループが存在しないと判定されるか、第二判定手段により乖離度が閾値以上であると判定された検査対象のグループについては、そのグループと、当該グループの次に検査対象のグループに設定されるグループが連続していないと評価して、上記最も長く連続するグループの集合を検出する構成にすることができる。 Further, the detection means includes an inspection object switching setting means for setting the inspection object group so as to sequentially switch in the second direction, the first determination means, the divergence degree calculation means, and the second determination means. For the group to be inspected that is determined by the first determination means that there is an adjacent group and the degree of divergence is determined to be less than the threshold by the second determination means. It is evaluated that the adjacent group set as the group to be inspected is continuous, and it is determined by the first determination unit that there is no adjacent group, or the second determination unit determines that the divergence degree is equal to or greater than a threshold value For a group to be inspected that is determined to be, the group and the group set as the group to be inspected next to the group are evaluated as not consecutive. , It can be configured to detect a set of successive groups the longest.
この他、検出手段は、選択手段により選択された所定量の候補を1グループ単位として、各グループの近似直線を算出すると共に、算出した各グループの近似直線の傾き及び切片の情報に基づき、近似直線についてのヒストグラムデータを生成し、生成したヒストグラムデータに基づき、度数の最も高い近似直線が算出されたグループの集合を、確度が高い候補の集合とみなし、当該度数の最も高い近似直線が算出されたグループの集合に属さないグループ、に属する各候補を、確度が低い候補とみなして、当該確度が低い候補を破棄することで、上記特定方向に延びる原稿の端縁を表すエッジ点を検出する構成にすることができる。 In addition, the detecting means, a candidate of a predetermined amount selected by selecting means as a group unit, calculates the approximate line of each group, based on the calculated slope and intercept information of the approximate straight line in each group, Generate histogram data for the approximate line, and based on the generated histogram data, consider the set of groups for which the approximate line with the highest frequency is calculated as a candidate set with the highest accuracy, and calculate the approximate line with the highest frequency By detecting each candidate belonging to a group that does not belong to the group of the selected group as a low-accuracy candidate and discarding the low-accuracy candidate, an edge point representing the edge of the document extending in the specific direction is detected. Can be configured.
即ち、検出手段は、各グループの近似直線の内、度数の最も高い近似直線に対応するグループの集合を、原稿の端縁を表すエッジ点の集合として、検出する構成にすることができる。 In other words, the detecting means can detect a set of groups corresponding to the approximate straight line having the highest frequency among the approximate straight lines of each group as a set of edge points representing the edge of the document.
各グループが、真に原稿の端縁を表すエッジ点の集合である場合には、当然のことながら近似直線の傾き及び切片は一致するはずである。換言すれば、各グループの近似直線の傾き及び切片の類似性をヒストグラムにより評価して、度数の最も高い近似直線に対応するエッジ点の集合を、原稿の端縁を表すエッジ点として検出するようにすれば、高精度に原稿エッジを検出することができる。 If each group is a set of edge points that truly represent the edge of the document, it should be understood that the slope and intercept of the approximate line should match. In other words, the slope of the approximate line of each group and the similarity of the intercepts are evaluated by a histogram, and a set of edge points corresponding to the approximate line with the highest frequency is detected as an edge point representing the edge of the document. Thus, the document edge can be detected with high accuracy.
従って、この手法により、選択手段で所定量ずつ候補を選択し、検出手段で原稿の端縁を表すエッジ点を検出すれば、原稿台に載置された埃や原稿内部の罫線等による影響を極力抑えて、原稿エッジを正しく検出することができるのである。 Thus, this technique, select the candidate by a predetermined amount in the selecting means, by detecting the edge points representing the edge of the document by the detection means, the effects of the placed dust and document internal borders such as platen The edge of the document can be detected correctly with as little as possible.
また、当該画像読取装置にて検出した原稿の端縁を表すエッジ点の情報(原稿エッジの情報)は、例えば、OCR処理や、変倍率・傾き補正量の設定動作等に利用することができる。 Also, edge point information (document edge information) representing the edge of the document detected by the image reading apparatus can be used for, for example, OCR processing, a variable magnification / tilt correction amount setting operation, and the like. The
以下に本発明の実施例について、図面と共に説明する。
図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
具体的に、画像読取部10は、図1(b)(c)に示す構成にされている。図1(b)(c)は、画像読取部10の構成を示した説明図である。画像読取部10は、読取対象の原稿Pが載置される透明な板状の読取ガラス11が筐体13に支持された構成にされており、筐体13内の読取ガラス11下に、読取ガラス11に写る画像を主走査方向において光学的に読み取る読取ユニット15と、読取ユニット15を副走査方向に搬送する搬送機構16と、搬送機構16を駆動するモータ17とを備える。
Specifically, the
この画像読取部10は、読取制御部20から入力される制御信号に従って、モータ17の回転力により搬送機構16を駆動し、これにより読取ユニット15を読取ガラス11下で副走査方向(図1(b)(c)に示す点線矢印方向)に搬送すると共に、搬送時において、読取ユニット15に読取動作を実行させる。
The
尚、読取ユニット15は、読取制御部20に制御され、副走査方向への移動と共に、読取ガラス11に写る画像を、ライン毎に読み取り、その読取画像を表すライン画像信号を出力するコンタクトイメージセンサ(CIS)である。この読取ユニット15から出力されるライン画像信号は、図示しないA/D変換器にてディジタルデータ(ライン画像データ)に変換され、読取制御部20に入力される。
Note that the
また、画像読取部10には、周知のスキャナと同様、読取ガラス11を被覆可能な蓋が開閉自在に設けられており(図示せず)、読取ユニット15による読取動作の実行時には、ユーザによる手動操作により、読取ガラス11に載置された原稿の上にかぶせられるようにして蓋が閉められる。尚、読取ガラス11と対向する蓋の内側には、読取ユニット15の読取結果である画像データにおいて、原稿外側領域に、黒い影が写らないように、白色部材が設けられている。
The
一方、読取制御部20は、CPU70からの指令に従って読取制御処理を実行し、当該読取制御処理にて、読取ユニット15の副走査方向への移動を制御すると共に、読取ユニット15の読取動作を制御する。
On the other hand, the
この制御により、読取制御部20は、読取ユニット15を読取ガラス11下で副走査方向に搬送しつつ、CPU70から指定された読取ガラス11の読取領域に写る画像を、読取ユニット15に読み取らせ、読取ガラスの読取領域に写る画像を表す画像データを、RAM80に記録する。このような動作により、RAM80には、読取ガラス11の読取領域に載置された原稿Pの読取画像を表す画像データ(主走査方向及び副走査方向に画素が配列された二次元画像データ)が記録される。
With this control, the
尚、読取制御部20は、画像読取部10から入力される各ライン画像データを、一旦内蔵のバッファに蓄積し、各ライン画像データに対してシェーディング補正等の画像処理を実行した後、各ライン画像データを、RAM80に記録する。
The
この他、印刷部30は、印刷制御部40から入力される制御信号に従い、トレイ(図示せず)に載置された記録紙を、記録位置に搬送し、インクジェット方式やレーザプリンタ方式等の周知の記録方式で、記録紙に、制御信号に対応した画像を形成するものである。
In addition, the
また、印刷制御部40は、印刷部30を制御して記録紙に画像を形成するものであり、CPU70からの指令に従って、CPU70から指定された印刷対象データに基づく画像を、印刷部30を通じて、記録紙に印刷する。
The print control unit 40 controls the
また、通信部60は、外部機器と通信するためのインタフェース群からなり、USBインタフェース、LANインタフェース、FAXモデム等から構成されている。即ち、複合機1は、通信部60が備えるFAXモデムを通じて外部のFAX装置とFAX通信可能な構成にされ、USBインタフェース又はLANインタフェースを通じて外部のパーソナルコンピュータと通信可能な構成にされている。
The
この他、表示操作部50は、情報表示用の液晶ディスプレイ(図示せず)と、各種操作キーとを備え、CPU70に制御されて、液晶ディスプレイに、ユーザ向けの情報を表示すると共に、操作キーを通じて入力されたユーザからの指令を、CPU70に入力する。
In addition, the
また、CPU70は、プログラムの実行により、操作キーを通じて入力される指令や通信部60を通じて外部のパーソナルコンピュータ等から入力される指令に従い、コピー機能、FAX機能、スキャナ機能、及び、プリンタ機能等を実現する。
Further, the
例えば、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
以下、この複写制御処理の内容について具体的に説明するが、それに先駆けては、図2を用いて本実施例の画像読取部10の特徴について説明する。
図2は、読取ガラス11の読取可能領域R0を示した説明図である。当該複合機1においては、一面が開口された長方体状の筐体13の当該開口部において、長方形状のガラス板である読取ガラス11が当該開口部を閉塞するように設けられており、読取ガラス11の周囲が筐体13により支持された構成にされている。
The contents of the copy control process will be specifically described below. Prior to that, the characteristics of the
FIG. 2 is an explanatory view showing the readable region R0 of the reading
この読取ガラス11は、筐体13の上面よりも若干筐体13の下側に設けられており、筐体13から露出する読取ガラス11の領域11a(以下、「原稿台」と表現する。)と筐体13との境界BDには、原稿Pを突き当て可能に段差が形成されている(以下、筐体13の読取ガラス11より上方に位置する部位(上記段差を形成する部位)13aを「フレーム」と表現する。)。
The reading
また、画像読取部10においては、読取ユニット15のライン幅と、原稿台11aの大きさとの関係から、四角形状の原稿台11aの全領域よりも若干狭い四角形状の領域R0が、読取ユニット15により原稿を読取可能な読取可能領域R0に定められている。具体的に、読取可能領域R0は、図2において点線で示すように、フレーム13aと読取ガラス11との境界BDから微小量(本実施例では3mm)離れた位置に外周を有した領域となっている。
Further, in the
また、この画像読取部10においては、フレーム13aの左下部分に、原稿Pの角を突き当てるように指示するマークMKが記されている。尚、本実施例では、マークMKが付された原稿台11aの角を、「左下角」と定義して、この左下角より、主走査方向に離れた地点に位置する原稿台11aの角を「右下角」と定義し、左下角より、副走査方向に離れた地点に位置する原稿台11aの角を「左上角」と定義する。
In the
即ち、複合機1においては、原稿台11aの左下角(換言すれば、フレーム13aの内側左下角)が、原稿Pの角を合わせるべき位置として定められ、原稿台11aの当該左下角から延びる左端縁及び下端縁が、原稿Pの辺(端縁)を合わせるべき端縁として定められており、複合機1は、ユーザが概ね、このマークMKに合わせて原稿Pを載置しているとの仮定の下で、原稿サイズの推定等を行い、原稿のコピー動作を実現する。
That is, in the
この他、本実施例の複合機1においては、このマークMKが付されたフレーム13aの内側左下角に対応する読取可能領域R0の左下角を原点、主走査方向をX軸、副走査方向をY軸としたXY座標系(図2(b)参照)が導入されており、CPU70は、このXY座標系を用いて図3に示す複写制御処理を実行する。
In addition, in the
続いて、CPU70が実行する複写制御処理について説明する。図3は、操作キーを通じてコピー指令が入力されると、CPU70が実行する複写制御処理を表すフローチャートである。
Next, a copy control process executed by the
複写制御処理を開始すると、CPU70は、操作キーを通じて入力されたコピー指令が「自動変倍/傾き補正」コピー指令であるか否かを判断し(S110)、「自動変倍/傾き補正」コピー指令であると判断すると(S110でYes)、S120にて、図4に示す自動変倍複写処理を実行する。その後、当該複写制御処理を終了する。
When the copy control process is started, the
一方、操作キーを通じて入力されたコピー指令が、「自動変倍/傾き補正」コピー指令以外のコピー指令であると判断すると(例えば、自動変倍や傾き補正の指示のないノーマルなコピー指令であると判断すると)、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
続いて、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
When the
即ち、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
尚、画像読取部10は、プレスキャン動作として、設定された読取領域の端から端まで、プレスキャン用の解像度に対応する速度で、読取ユニット15を副走査方向に搬送し、その読取領域の画像を読取ユニット15に読み取らせ、プレスキャン結果として、低解像度の画像データ(以下、「プレスキャン画像データ」という。)を、読取制御部20を通じて、RAM80に記録する動作を実行する。
As a pre-scan operation, the
このようにしてS210での処理を終えると、次に、CPU70は、RAM80に記録されたプレスキャン画像データに対してエッジ検出処理を実行し、この画像データに対応するエッジ画像データを生成する(S215)。即ち、RAM80に記録されたプレスキャン画像データを、エッジ検出用の画像フィルタ(周知の微分フィルタ)に通して、この画像データに対応するエッジ画像を表すエッジ画像データを生成する。
When the processing in S210 is completed in this way, the
また、S215での処理を終えると、CPU70は、上記生成したエッジ画像データを、検査対象データに設定して、図5に示す原稿推定処理を実行する(S220)。詳細は後述するが、この原稿推定処理では、検査対象データ(S215で得られたエッジ画像データ)を解析して、原稿エッジを検出し、この検出結果から、原稿台11aに載置された原稿のサイズ(縦幅及び横幅)、及び、原稿の傾き角θ、及び、原稿台11aにおける原稿の載置領域を推定する。
When the process in S215 is completed, the
そして、S220での処理を終えると、CPU70は、印刷制御部40を通じて、印刷部30に給紙動作を実行させると共に(S230)、給紙動作の対象となった記録紙のサイズを検出する(S240)。その後、S251に移行する。尚、記録紙のサイズは、例えば、記録紙の搬送路に設けられたセンサを用いて周知の手法で検出することができる。
When the processing in S220 is completed, the
また、S251に移行すると、CPU70は、S220で推定された原稿サイズ及びS240で検出された記録紙サイズに基づき、予め定められた計算式に従って変倍率を設定する。具体的には、変倍率を、原稿サイズと記録紙サイズとの比(例えば、記録紙短辺長さ÷原稿短辺長さ)に対応した倍率に設定し、後続の処理で、原稿のコピー画像が、原稿サイズとの記録紙サイズの比に対応した倍率で拡大(倍率が1未満の場合には縮小)されて記録紙に印刷されるようにする。
In step S251, the
また、この処理を終えると、CPU70は、S220で推定された原稿の傾き角θから、画像データの傾き補正量を設定する(S253)。具体的には、原稿のコピー画像が、傾きのない状態でまっすぐ、記録紙に印刷されるように、傾き補正量を設定する。但し、推定された原稿の傾き角θが微小量(本実施例では−0.5度≦θ≦0.5度)である場合には、誤差も考慮して、傾き補正量をゼロに設定する。
When this processing is completed, the
S253での処理を終えると、CPU70は、S220で推定された原稿の載置領域の情報に基づいて、原稿読取開始位置及び原稿読取終了位置を設定し、原稿読取開始位置及び原稿読取終了位置で定められる読取領域を、原稿台11aにおける原稿の載置領域に対応させる(S255)。
When the processing in S253 is completed, the
具体的には、原稿の載置領域全体を読取ユニット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
また、S270に移行すると、CPU70は、読取制御部20を通じて画像読取部10を制御することで、画像読取部10に、読取ユニット15を原稿読取開始位置から原稿読取終了位置まで副走査方向に搬送させると共に、当該搬送中にはライン毎の読取動作を読取ユニット15に実行させて、上記設定した読取領域の画像を、読取ユニット15に読み取らせ、当該読取領域の読取結果を表す画像データが、RAM80に記録されるようにする(S270)。
In step S <b> 270, the
また、この処理を終えると、CPU70は、RAM80に記録された上記読取結果を表す画像データを、予め設定された変倍率で拡大又は縮小処理すると共に、予め設定された傾き補正量分、回転処理して、上記読取結果を表す画像データを、印刷用の画像データに変換し、変換後の画像データを、印刷対象データに設定する(S280)。但し、傾き補正量がゼロに設定されている場合には、S280において、回転処理を、実行しないものとする。
When this process is completed, the
また、S280での処理を終えると、CPU70は、当該印刷対象データについての印刷処理を実行する(S290)。即ち、印刷制御部40を通じて、印刷部30に印刷対象データに基づく画像を、給紙した記録紙に印刷させる。その後、当該複写制御処理を終了する。
When the process in S280 is completed, the
このようにして、自動変倍複写処理では、読取可能領域R0における一部領域のプレスキャン結果から、原稿エッジを検出して、原稿サイズ等を推定し、その結果から、本スキャン時(S270実行時)の読取領域を決定すると共に、変倍率及び傾き補正量を決定する。そして、原稿のコピー画像を、原稿サイズと記録紙サイズとの比に対応する大きさに、拡大又は縮小すると共に、傾き補正して、記録紙に印刷する。 In this way, in the automatic scaling copying process, the document edge is detected from the prescan result of a partial area in the readable area R0, the document size and the like are estimated, and based on the result, during the main scan (S270 execution) ) And a variable magnification and an inclination correction amount are determined. Then, the copy image of the original is enlarged or reduced to a size corresponding to the ratio between the original size and the recording paper size, and the inclination is corrected and printed on the recording paper.
続いて、図5を用いて、CPU70が、S220で実行する原稿推定処理について説明する。図5は、CPU70が実行する原稿推定処理を表すフローチャートである。
この原稿推定処理を開始すると、CPU70は、まず、変数Sを上述のプレスキャン領域上端のY座標であるYPREに設定することにより(S=YPRE)、Y軸方向の検査範囲を、Y=0からY=S=YPREに設定する(S410)。また、この処理を終えると、S420に移行し、右エッジ検出処理を実行する。図6は、CPU70が実行する右エッジ検出処理を表すフローチャートである。
Subsequently, the document estimation process executed by the
When the document estimation process is started, the
右エッジ検出処理を開始すると、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
そして、副走査方向検査位置Yeが検査範囲を超えていないと判断すると(S520でNo)、CPU70は、主走査方向検査位置Xe及び副走査方向検査位置Yeで定まる検査位置(X,Y)=(Xe,Ye)に対応する検査対象データの画素値を参照することにより、検査位置(Xe,Ye)がエッジ点であるか否かを判断する(S525)。尚、図7は、エッジ画像データの構成を抜粋して示し、更に、右エッジ検出処理により追跡するエッジ点の軌跡を表した説明図である。図7に示す例では、画素値「1」の地点がエッジ点に該当する。
When determining that the sub-scanning direction inspection position Ye does not exceed the inspection range (No in S520), the
そして、検査位置(Xe,Ye)がエッジ点ではないと判断すると(S525でNo)、CPU70は、S540に移行して、主走査方向検査位置Xeを、X軸マイナス方向に1画素移動した位置に更新し(Xe←Xe−1)、更新後の主走査方向検査位置Xeが読取可能領域R0の左端を、はみ出ていないかどうかを判断する。具体的には、Xe<0であるか否かを判断する(S543)。
If the
そして、主走査方向検査位置Xeが、読取可能領域R0の左端をはみ出ていないと判断すると(S543でNo)、CPU70は、S520に移行して、副走査方向検査位置Yeが検査範囲を超えているか否か(Ye>Sであるか否か)を判断し、副走査方向検査位置Yeが検査範囲を超えていないと判断すると(S520でNo)、S525に移行し、副走査方向検査位置Yeが検査範囲を超えていると判断すると(S520でYes)、S590に移行する。
If the
一方、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
また、検査位置(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
その後、座標(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
具体的に、右エッジ検出処理においては、読取可能領域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
即ち、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
CPU70は、このような処理を実行することにより、図7に示すように、Y軸方向に8画素おきに、エッジ点がY軸方向に連続するものであるか否かを検査する。そして、C=8であると判断すると(S567でYes)、8回に及ぶS550の処理で連続性のあるエッジ点として判定した計8地点の各座標データを、原稿右エッジデータとしてRAM80に記憶する(S570)。
By executing such processing, the
また、この処理を終えると、CPU70は、副走査方向検査位置Yeを64画素進んだ位置に更新して(S580)、S515に移行する。
このようにして、CPU70は、連続するエッジ点を、8つを1組として、繰返し検出する。そして、副走査方向検出位置Yeが検査範囲を超えると(S520でYes)、S590に移行し、S570で原稿右エッジデータとして記憶された座標データ群の中から、右エッジ(原稿の右端を表すエッジ点)として確度の低い座標データ群を削除して、原稿右エッジデータを確定する。
When this process is finished, the
In this way, the
具体的に、S590では、原稿右エッジデータを処理対象データに設定して、図8に示す第一エッジ確定処理を実行することで、右エッジとして確度の低い座標データ群を原稿右エッジデータから削除し、原稿右エッジデータを確定する。図8は、CPU70が実行する第一エッジ確定処理を表すフローチャートである。
Specifically, in S590, the original right edge data is set as processing target data, and the first edge determination process shown in FIG. 8 is executed, whereby a coordinate data group with low accuracy is selected as the right edge from the original right edge data. Delete and confirm the document right edge data. FIG. 8 is a flowchart showing the first edge determination process executed by the
第一エッジ確定処理を開始すると、CPU70は、予め設定された処理対象データが、少なくとも8つ以上のエッジ点の座標データを含むものであるか否かを判断し(S610)、処理対象データが8つ以上のエッジ点の座標データを含むものであると判断すると(S610でYes)、S620に移行し、処理対象データが8つ以上のエッジ点の座標データを含むものではない(換言すれば処理対象データが空データである)と判断すると(S610でNo)、S620〜S670の処理を実行することなく、当該第一エッジ確定処理を終了する。
When the first edge determination process is started, the
一方、S620に移行すると、CPU70は、処理対象データを構成するエッジ点の座標データ群に基づき、処理対象データにおいて、Y座標値が最大のブロックを検査ブロックに設定する。
On the other hand, when proceeding to S620, the
但し、ここでは、処理対象データに座標データが登録されたエッジ点の集合であって、当該処理対象データを生成するに至ったエッジ検出処理(右エッジ検出処理又は左エッジ検出処理又は下エッジ検出処理)で連続すると判定された8つのエッジ点の集合を、「ブロック」と称する。 However, here, the edge detection processing (right edge detection processing or left edge detection processing or lower edge detection) that is a set of edge points in which coordinate data is registered in the processing target data and has led to generation of the processing target data. A set of eight edge points determined to be continuous in (processing) is referred to as a “block”.
上述したように、本実施例では、右エッジ検出処理にて、Y軸方向に連続するエッジ点を、8つを1組として検出し、検出した8つのエッジ点の座標データをRAM80に記録すると(S570参照)、次の連続するエッジ点の集合を、画像データの右端から画像データ内部に向けて再度検索していく(S580,S515参照)。
As described above, in this embodiment, in the right edge detection process, eight edge points continuous in the Y-axis direction are detected as one set, and the coordinate data of the detected eight edge points is recorded in the
S620では、このようにしてRAM80に座標データが登録された連続する8点のエッジ点の集合からなるブロックであって、Y座標値が最大のエッジ点を要素に含むブロックを、処理対象データから選択し、これを検査ブロックに設定する。
In S620, a block consisting of a set of eight consecutive edge points whose coordinate data has been registered in the
また、このようにしてS620での処理を終えると、CPU70は、S630に移行し、検査ブロックよりY軸マイナス方向に隣接するエッジ点の座標データが、処理対象データに含まれているか否かを判断する。
In addition, when the processing in S620 is completed in this way, the
ここでは、検査ブロックを構成するエッジ点の内、Y座標値が最小のエッジ点の画素位置が(X,Y)=(X0,Y0)であるとすると、Y軸マイナス方向に隣接するエッジ点の座標データとして、Y座標値がY=Y0−8を採るエッジ点の当該座標データが、処理対象データに含まれているか否かを判断する。これにより、Y軸のみの一次元空間上で、隣接するエッジ点(換言すれば隣接するブロック)の有無を判断する。 Here, if the pixel position of the edge point having the smallest Y coordinate value among the edge points constituting the inspection block is (X, Y) = (X0, Y0), the edge point adjacent in the Y axis minus direction It is determined whether or not the coordinate data of the edge point having the Y coordinate value of Y = Y0-8 is included in the processing target data. Thereby, it is determined whether or not there is an adjacent edge point (in other words, an adjacent block) on the one-dimensional space only on the Y axis.
そして、Y軸マイナス方向に隣接するエッジ点の座標データが処理対象データに含まれていると判断すると(S630でYes)、S640に移行し、Y軸マイナス方向に隣接するエッジ点の座標データが処理対象データに含まれていないと判断すると(S630でNo)、S670に移行する。 If it is determined that the coordinate data of the edge point adjacent in the Y axis minus direction is included in the processing target data (Yes in S630), the process proceeds to S640, and the coordinate data of the edge point adjacent in the Y axis minus direction is obtained. If it is determined that the data is not included in the processing target data (No in S630), the process proceeds to S670.
また、S640に移行すると、CPU70は、検査ブロックのY軸マイナス方向末端のエッジ点のX座標値(換言すれば、検査ブロックを構成するエッジ点の内、Y座標値最小のエッジ点のX座標値)と、上述した検査ブロックよりY軸マイナス方向に隣接するエッジ点のX座標値との差δXを算出する。検査ブロックのY軸マイナス方向末端のエッジ点の画素位置が(X,Y)=(X0,Y0)であり、検査ブロックよりY軸マイナス方向に隣接するエッジ点の画素位置が(X,Y)=(X1,Y0−8)である場合には、δX=|X0−X1|を算出する。
In step S640, the
また、この処理を終えると、CPU70は、差δXが、予め設計段階で定められた閾値未満であるか否かを判断し(S650)、閾値未満であると判断すると(S650でYes)、検査ブロックをY軸マイナス方向に隣接する次ブロックに更新し(S660)、その後、S630に移行する。例えば、検査ブロックのY軸マイナス方向末端のエッジ点の画素位置が(X,Y)=(X0,Y0)である場合には、Y座標値がY=Y0−8からY=Y0−64までの範囲の値を採る計8個のエッジ点の集合を、新たな検査ブロックに設定した後、S630に移行する。
When this process is completed, the
一方、差δXが、閾値以上であると判断すると(S650でNo)、CPU70は、現在の検査ブロックのY軸マイナス方向末端よりY軸マイナス方向に位置するエッジ点については、原稿エッジとしての確度が低いと判断して、S670に移行し、現在の検査ブロックのY軸マイナス方向末端よりY軸マイナス方向に位置するエッジ点の座標データを、全て処理対象データから削除して、処理対象データを更新する。
On the other hand, when determining that the difference δX is equal to or larger than the threshold (No in S650), the
例えば、現在の検査ブロックのY軸マイナス方向末端のエッジ点の画素位置が(X,Y)=(X0,Y0)である場合には、Y座標値がY0未満のエッジ点の座標データを全て処理対象データから削除して、処理対象データを更新する。その後、当該第一エッジ確定処理を終了する。第一エッジ確定処理では、このようにして、処理対象データを構成するエッジ点の座標データの内、原稿エッジとして確度の低い座標データを削除する。 For example, if the pixel position of the edge point at the end in the Y-axis minus direction of the current inspection block is (X, Y) = (X0, Y0), all the coordinate data of the edge point whose Y coordinate value is less than Y0 Delete the processing target data and update the processing target data. Thereafter, the first edge determination process ends. In the first edge determination process, the coordinate data having low accuracy as the document edge is deleted from the coordinate data of the edge points constituting the processing target data in this way.
即ち、右エッジ検出処理のS590では、このようにして、原稿右エッジデータから右エッジとして確度の低いエッジ点の座標データを削除し、原稿右エッジデータを確定する。 That is, in S590 of the right edge detection process, the coordinate data of the edge point with low accuracy is deleted as the right edge from the document right edge data in this way, and the document right edge data is determined.
尚、図9は、S590における原稿右エッジデータの確定手法を示した説明図であり、図9(b)は、Y軸方向の画素を8画素おきに表したエッジ画像データと共に、δXの算出手法を視覚的に表した説明図である。 FIG. 9 is an explanatory diagram showing a method for determining the right edge data of the document in S590. FIG. 9B shows calculation of δX together with edge image data that represents every eight pixels in the Y-axis direction. It is explanatory drawing which represented the method visually.
S590で、上述のようにして、Y座標値が大きいエッジ点程、エッジ点が原稿の右端を表すエッジ点(右エッジ)である確度が高いと取り扱い、Y座標値が大きいエッジ点群からX軸方向に大きくずれた位置に存在するY座標値が小さいエッジ点群を、原稿右エッジデータから削除する理由は、右エッジ検出処理にて、Ye=0から順に検査位置(Xe,Ye)をずらして原稿の右端を表すエッジ点を検索すると、原稿が左側に傾いている場合には、原稿の右端ではなく、図9(a)に示すように、原稿内部に描写された罫線等に対応するエッジ点を、原稿の右端を表すエッジ点として誤検出してしまう可能性があるためである。 In S590, as described above, an edge point having a larger Y coordinate value is treated as having a higher probability that the edge point is an edge point (right edge) representing the right edge of the document. The reason why the edge point group having a small Y coordinate value existing at a position greatly displaced in the axial direction is deleted from the original right edge data is that the inspection positions (Xe, Ye) are sequentially detected from Ye = 0 in the right edge detection process. When the edge point representing the right edge of the document is searched by shifting, if the document is tilted to the left, it corresponds not to the right edge of the document but to the ruled line drawn inside the document as shown in FIG. This is because the edge point to be detected may be erroneously detected as the edge point representing the right edge of the document.
このような誤検出は、原稿台11aの下端寄りに位置するY座標値が小さいエッジ点群において発生している可能性が高く、原稿台11aの中央寄りに位置するY座標値が大きいエッジ点群において発生している可能性は、小さい。このような理由から、S590では、Y座標値が大きいエッジ点程、エッジ点が原稿の右端を表すエッジ点(右エッジ)である確度が高いと取り扱って、確度の低いエッジ点を原稿右エッジデータから削除し、原稿右エッジデータを確定するようにしている。 Such an erroneous detection is likely to occur at an edge point group with a small Y coordinate value located near the lower end of the document table 11a, and an edge point with a large Y coordinate value located near the center of the document table 11a. It is unlikely that it is occurring in a group. For this reason, in S590, an edge point with a larger Y coordinate value is treated as having a higher probability that the edge point is an edge point (right edge) representing the right edge of the document, and an edge point with a lower accuracy is treated as the right edge of the document. The data is deleted from the data, and the right edge data of the document is determined.
また、このようにしてS590での処理を終えると、CPU70は、S420での右エッジ検出処理を終了して、S430に移行し、S430では、直前の右エッジ検出処理で右エッジの検出に失敗したか否かを判断する。具体的には、直前の右エッジ検出処理で原稿右エッジデータとして登録された座標データがない場合、右エッジの検出に失敗したと判断し、原稿右エッジデータとして登録された座標データがある場合には、右エッジの検出に成功したと判断する。
In addition, when the processing in S590 is completed in this way, the
但し、例外的に、原稿右エッジデータとして登録された座標データが読取可能領域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
この他、複合機1は、S431におけるエラー処理として、『原稿台11aに載置された原稿のサイズを、予め定められた固定サイズであると形式的に推定すると共に、原稿の傾き角θをゼロと推定し、更に、原稿の載置領域を、上記推定したサイズの原稿の左下角が原稿台11aの左下角に正しく突き当てられていると仮定したときに原稿が載置される領域に推定する』処理を実行し、その後、当該原稿推定処理を終了して、S230に移行する構成にされてもよい。
In addition, the
一方、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
また、この処理を終えると、CPU70は、S440に移行して、右エッジ近似直線がY軸に対し所定角度より大きく傾いているか否かを判断する。本実施例では、具体的に、右エッジ近似直線がY軸に対し0.5度より大きく傾いているか否かを判断する。
When this process is finished, the
そして、右エッジ近似直線の傾きが上記所定角度以下であると判断すると(S440でNo)、CPU70は、原稿がフレーム13aの内側左下角に突き当てられて原稿台11aに正しく載置されていると推定して、図5右図に示すように、右エッジ近似直線と原稿台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
また、この処理を終えると、CPU70は、原稿の左下角位置が原稿台11aの左下角の地点であると推定し(S443)、S441及びS443で推定した角位置の位置座標に基づき、原稿台11aに載置されている原稿が四角形状の定型用紙であるとの仮定の下で、原稿台11aに載置された原稿のサイズ及び原稿台11aにおける原稿の載置領域を推定すると共に、原稿の傾き角θを推定する(S445)。
When this processing is completed, the
具体的には、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 starting from 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 accurately abutted against the lower left corner of the document table 11a and placed on the document table 11a. Therefore, in S445, the inclination angle of the document is determined. It is estimated that θ is zero (no slope).
このようにして、S445での処理を終えると、CPU70は、当該原稿推定処理(S220)を終えて、S230に移行し、上述したようにして、後続の処理を実行する。即ち、原稿推定処理で推定した原稿サイズ、原稿の傾き角、原稿の載置領域の情報を基に、変倍率及び傾き補正量を設定し(S251,S253)、更に読取領域を設定する(S255)。その後、本スキャンに移行して(S270)、コピー動作を実現する。但し、ここでは、原稿の傾き角θがゼロと推定されるので、傾き補正は実質実行されない。
When the process in S445 is completed in this way, the
話を原稿推定処理のS440(図5参照)に戻すと、CPU70は、ここで、右エッジ近似直線がY軸に対し所定角度より大きく傾いていると判断した場合(S440でYes)、S450に移行して、図10に示す左エッジ検出処理を実行する。図10は、CPU70が実行する左エッジ検出処理を表すフローチャートである。
When the story is returned to S440 (see FIG. 5) of the document estimation process, the
左エッジ検出処理を開始すると、CPU70は、S710にて、副走査方向検査位置Ye=0に設定し、S715にて、主走査方向検査位置Xeを、読取可能領域R0の左端X座標に設定する(Xe=0)。また、S715では、変数Cを値ゼロに初期化する(C=0)。
When the left edge detection process is started, the
その後、CPU70は、副走査方向検査位置Yeが検査範囲を超えているか否か(即ち、Ye>Sであるか否か)を判断し(S720)、副走査方向検査位置Yeが検査範囲を超えていないと判断すると(S720でNo)、検査位置(X,Y)=(Xe,Ye)に対応する検査対象データの画素値を参照して、検査位置(Xe,Ye)がエッジ点であるか否かを判断する(S725)。
Thereafter, the
そして、検査位置(Xe,Ye)がエッジ点ではないと判断すると(S725でNo)、S740に移行し、主走査方向検査位置Xeを、X軸プラス方向に1画素移動した地点に更新し(Xe←Xe+1)、更新した主走査方向検査位置Xeが、読取可能領域R0の右端を、はみ出ていないかどうかを判断する(S743)。具体的には、Xe>XMAXであるか否かを判断する(S743)。そして、主走査方向検査位置Xeが、読取可能領域R0の右端をはみ出ていないと判断すると(S743でNo)、S720に移行する。 If it is determined that the inspection position (Xe, Ye) is not an edge point (No in S725), the process proceeds to S740, and the main scanning direction inspection position Xe is updated to a point moved by one pixel in the X axis plus direction ( Xe ← Xe + 1), it is determined whether or not the updated main scanning direction inspection position Xe protrudes from the right end of the readable area R0 (S743). Specifically, it is determined whether Xe> XMAX (S743). If it is determined that the main scanning direction inspection position Xe does not protrude from the right end of the readable area R0 (No in S743), the process proceeds to S720.
一方、S743で主走査方向検査位置Xeが読取可能領域R0の右端をはみ出ていると判断すると(Xe>XMAXであると判断すると)、CPU70は、S747に移行し、主走査方向検査位置Xeを、読取可能領域R0の左端に設定すると共に(Xe=0)、副走査方向検査位置Yeを、Y軸方向に8画素進んだ位置に設定する(Ye←Ye+8)。その後、S720に移行する。
On the other hand, when it is determined in S743 that the main scanning direction inspection position Xe protrudes from the right end of the readable region R0 (when it is determined that Xe> XMAX), the
また、検査位置(Xe,Ye)がエッジ点であると判断すると(S725でYes)、CPU70は、S730に移行して、変数(X0,Y0)に、現在の検査位置(Xe,Ye)の座標値を設定する(X0←Xe,Y0←Ye)と共に、変数Y1を、値Y1=Y0+8に更新する(S733)。
If the
その後、座標(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
具体的に、左エッジ検出処理においては、読取可能領域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
このような処理手順により、CPU70は、右エッジ検出処理と同様(図7参照)、Y軸方向に8画素おきに、エッジ点がY軸方向に連続するものであるか否かを検査する。そして、C=8であると判断すると(S767でYes)、S750で連続性のあるエッジ点として判定した計8地点の各座標データを、原稿左エッジデータとしてRAM80に記憶する(S770)。
By such a processing procedure, the
また、この処理を終えると、CPU70は、S780に移行して、副走査方向検査位置Yeを64画素進んだ地点に更新した後、S715に移行する。
このようにして、CPU70は、連続するエッジ点を、8つずつ、繰返し検出する。そして、副走査方向検出位置Yeが検査範囲を超えると(S720でYes)、S790に移行し、S770で原稿左エッジデータとして記憶された座標データ群の中から、左エッジ(原稿の左端を表すエッジ点)として確度の低い座標データ群を削除して、原稿左エッジデータを確定する。
When this process is completed, the
In this way, the
具体的には、S590での処理と同様、原稿左エッジデータを処理対象データに設定して、図8に示す第一エッジ確定処理を実行することで、左エッジとして確度の低い座標データ群を原稿左エッジデータから削除し、原稿左エッジデータを確定する。 Specifically, similar to the processing in S590, the left edge data of the document is set as processing target data, and the first edge determination processing shown in FIG. Delete from the document left edge data and determine the document left edge data.
また、このようにして、左エッジ検出処理を終えると、CPU70は、S455に移行し、左エッジ検出処理で確定された原稿左エッジデータが示す各点を直線近似して、原稿左エッジデータが示す点群の近似直線(以下、「左エッジ近似直線」という。)を算出する。その後、S460に移行する。
In addition, when the left edge detection process is completed in this way, the
但し、直前の左エッジ検出処理で原稿左エッジデータとして登録された座標データがない場合には、左エッジの検出に失敗したと判断して、左エッジ近似直線を算出することなく、S460に移行するものとする。この他、原稿左エッジデータとして登録されている座標データの全て又は一部が原稿右エッジデータにも登録されている場合には、右エッジ(原稿の右端を表すエッジ点)の座標データが間違って原稿左エッジデータとして登録されているとみなして、原稿左エッジデータとして登録された座標データがある場合でも、左エッジの検出に失敗したと判断し、左エッジ近似直線を算出することなく、S460に移行するようにしてもよい。 However, if there is no coordinate data registered as document left edge data in the immediately preceding left edge detection process, it is determined that detection of the left edge has failed, and the process proceeds to S460 without calculating the left edge approximate straight line. It shall be. In addition, when all or part of the coordinate data registered as the document left edge data is also registered in the document right edge data, the coordinate data of the right edge (the edge point representing the right edge of the document) is incorrect. Even if there is coordinate data registered as document left edge data, it is determined that detection of the left edge has failed, and without calculating the left edge approximate straight line, You may make it transfer to S460.
また、S460に移行すると、CPU70は、図11に示す下エッジ検出処理を実行する。図11は、CPU70が実行する下エッジ検出処理を表すフローチャートである。
下エッジ検出処理を開始すると、CPU70は、S810にて、主走査方向検査位置Xeを、読取可能領域R0の左端X座標に設定し(Xe=0)、S815にて、副走査方向検査位置Yeを、読取可能領域R0の下端Y座標に設定する(Ye=0)。また、S815では、変数Cを値ゼロに初期化する(C=0)。
In S460, the
When the lower edge detection process is started, the
また、この処理を終えると、CPU70は、主走査方向検査位置Xeが読取可能領域R0の右端を超えているか否か(即ち、Xe>XMAXであるか否か)を判断し(S820)、主走査方向検査位置Xeが読取可能領域R0の右端を超えていないと判断すると(S820でNo)、検査位置(X,Y)=(Xe,Ye)に対応する検査対象データの画素値を参照し、検査位置(Xe,Ye)がエッジ点であるか否かを判断する(S825)。
When this process is finished, the
そして、検査位置(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
この他、CPU70は、S825において、検査位置(Xe,Ye)がエッジ点であると判断すると(S825でYes)、S830に移行し、変数(X0,Y0)に、現在の検査位置(Xe,Ye)の座標値を、設定する(X0←Xe,Y0←Ye)。また、変数X1を、値X1=X0+8に更新する(S833)。
In addition, when the
その後、CPU70は、座標(X1,Y0−1)の地点、座標(X1,Y0)の地点及び座標(X1,Y0+1)の地点の少なくとも一つが、エッジ点であるか否かを判断し(S837)、座標(X1,Y0−1)の地点、座標(X1,Y0)の地点及び座標(X1,Y0+1)の地点のいずれもがエッジ点でない場合には(S837でNo)、S840に移行する。
Thereafter, the
一方、座標(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
また、この処理を終えると、CPU70は、S860に移行し、座標(X1,Y0−1)の地点、座標(X1,Y0)の地点及び座標(X1,Y0+1)の地点の内、エッジ点である地点の一つを、予め定められた優先度に従って選択する。
When this process is finished, the
具体的に、下エッジ検出処理においては、読取可能領域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
このような処理を実行することにより、CPU70は、X軸方向に8画素おきに、エッジ点がX軸方向に連続するものであるか否かを検査する。そして、C=8であると判断すると(S867でYes)、S850で連続性のあるエッジ点として判定した計8地点の各座標データを、原稿下エッジデータとしてRAM80に記憶する(S870)。
By executing such processing, the
また、この処理を終えると、CPU70は、S880に移行して、主走査方向検査位置Xeを64画素進んだ地点に更新した後、S815に移行する。
このようにして、CPU70は、連続するエッジ点を、8つずつ、繰返し検出する。そして、主走査方向検出位置Xeが読取可能領域R0右端を超えると(S820でYes)、S890に移行し、S870で原稿下エッジデータとして記憶された座標データ群の中から、下エッジ(原稿の下端を表すエッジ点)として確度の低い座標データ群を削除して、原稿下エッジデータを確定する。
When this process is finished, the
In this way, the
具体的に、S890では、原稿下エッジデータを処理対象データに設定して、第二エッジ確定処理を実行することで、下エッジとして確度の低い座標データ群を原稿下エッジデータから削除し、原稿下エッジデータを確定する。図12は、CPU70が実行する第二エッジ確定処理を表すフローチャートである。
Specifically, in S890, the lower edge data of the document is set as processing target data, and the second edge determination process is executed to delete the coordinate data group having low accuracy as the lower edge from the lower edge data of the document. Confirm the bottom edge data. FIG. 12 is a flowchart showing the second edge determination process executed by the
第二エッジ確定処理を開始すると、CPU70は、予め設定された処理対象データが、少なくとも8つ以上のエッジ点の座標データを含むものであるか否かを判断し(S910)、処理対象データが8つ以上のエッジ点の座標データを含むものであると判断すると(S910でYes)、S920に移行し、処理対象データが8つ以上のエッジ点の座標データを含むものではない(換言すれば処理対象データが空データである)と判断すると(S910でNo)、S920〜S970の処理を実行することなく、当該第二エッジ確定処理を終了する。
When the second edge determination process is started, the
一方、S920に移行すると、CPU70は、処理対象データを構成するエッジ点の座標データ群に基づき、処理対象データにおいて、X座標値が最大のブロックを検査ブロックに設定する。
On the other hand, when proceeding to S920, the
上述したように、本実施例では、下エッジ検出処理にて、X軸方向に連続するエッジ点を8つを1組として検出し、検出した8つのエッジ点の座標データをRAM80に記録すると(S870参照)、次の連続するエッジ点の集合を、画像データ(検査対象データ)の下端から画像データ内部に向けて再度検索していく(S880,S815参照)。 As described above, in this embodiment, in the lower edge detection process, eight edge points continuous in the X-axis direction are detected as one set, and the coordinate data of the detected eight edge points is recorded in the RAM 80 ( In step S870, the next set of consecutive edge points is searched again from the lower end of the image data (inspection data) toward the inside of the image data (see steps S880 and S815).
S920では、このようにしてRAM80に座標データが登録された連続する8点のエッジ点の集合からなるブロックであって、X座標値が最大のエッジ点を要素に含むブロックを、処理対象データから選択し、これを検査ブロックに設定する。
In S920, a block composed of a set of eight consecutive edge points whose coordinate data is registered in the
また、このようにしてS920での処理を終えると、CPU70は、S930に移行し、検査ブロックよりX軸マイナス方向に隣接するエッジ点の座標データが、処理対象データに含まれているか否かを判断する。
In addition, when the processing in S920 is completed in this way, the
ここでは、検査ブロックを構成するエッジ点の内、X座標値が最小のエッジ点の画素位置が(X,Y)=(X0,Y0)であるとすると、X軸マイナス方向に隣接するエッジ点の座標データとして、X座標値がX=X0−8を採るエッジ点の当該座標データが、処理対象データに含まれているか否かを判断する。これにより、X軸のみの一次元空間上で、隣接するエッジ点(換言すれば隣接するブロック)の有無を判断する。 Here, if the pixel position of the edge point having the smallest X coordinate value among the edge points constituting the inspection block is (X, Y) = (X0, Y0), the edge point adjacent in the X axis minus direction It is determined whether or not the coordinate data of the edge point whose X coordinate value is X = X0-8 is included in the processing target data. Thereby, the presence / absence of an adjacent edge point (in other words, an adjacent block) is determined on the one-dimensional space only on the X axis.
そして、X軸マイナス方向に隣接するエッジ点の座標データが処理対象データに含まれていると判断すると(S930でYes)、S940に移行し、X軸マイナス方向に隣接するエッジ点の座標データが処理対象データに含まれていないと判断すると(S930でNo)、S970に移行する。 When it is determined that the coordinate data of the edge point adjacent in the X axis minus direction is included in the processing target data (Yes in S930), the process proceeds to S940, and the coordinate data of the edge point adjacent in the X axis minus direction is obtained. If it is determined that the data is not included in the processing target data (No in S930), the process proceeds to S970.
また、S940に移行すると、CPU70は、検査ブロックのX軸マイナス方向末端のエッジ点のY座標値(換言すれば、検査ブロックを構成するエッジ点の内、X座標値最小のエッジ点のY座標値)と、上述した検査ブロックよりX軸マイナス方向に隣接するエッジ点のY座標値との差δYを算出する。検査ブロックのX軸マイナス方向末端のエッジ点の画素位置が(X,Y)=(X0,Y0)であり、検査ブロックよりX軸マイナス方向に隣接するエッジ点の画素位置が(X,Y)=(X0−8,Y1)である場合には、δY=|Y0−Y1|を算出する。
In S940, the
また、この処理を終えると、CPU70は、差δYが、予め設計段階で定められた閾値未満であるか否かを判断し(S950)、閾値未満であると判断すると(S950でYes)、検査ブロックをX軸マイナス方向に隣接する次ブロックに更新し(S960)、その後、S930に移行する。例えば、検査ブロックのX軸マイナス方向末端のエッジ点の画素位置が(X,Y)=(X0,Y0)である場合には、X座標値がX=X0−8からX=X0−64までの範囲の値を採る計8個のエッジ点の集合を、新たな検査ブロックに設定した後、S930に移行する。
When this process is completed, the
一方、差δYが、閾値以上であると判断すると(S950でNo)、CPU70は、現在の検査ブロックのX軸マイナス方向末端よりX軸マイナス方向に位置するエッジ点については、原稿エッジとしての確度が低いと判断して、S970に移行し、現在の検査ブロックのX軸マイナス方向末端よりX軸マイナス方向に位置するエッジ点の座標データを、全て処理対象データから削除して、処理対象データを更新する。
On the other hand, if it is determined that the difference δY is equal to or greater than the threshold value (No in S950), the
例えば、現在の検査ブロックのX軸マイナス方向末端のエッジ点の画素位置が(X,Y)=(X0,Y0)である場合には、X座標値がX0未満のエッジ点の座標データを全て処理対象データから削除して、処理対象データを更新する。その後、当該第二エッジ確定処理を終了する。第二エッジ確定処理では、このようにして、処理対象データを構成するエッジ点の座標データの内、原稿エッジとして確度の低い座標データを削除する。 For example, if the pixel position of the edge point at the end of the current X-axis minus direction of the inspection block is (X, Y) = (X0, Y0), all the coordinate data of the edge points whose X coordinate values are less than X0 Delete the processing target data and update the processing target data. Thereafter, the second edge determination process ends. In the second edge determination process, the coordinate data having low accuracy as the document edge is deleted from the coordinate data of the edge points constituting the processing target data.
即ち、下エッジ検出処理のS890では、このようにして、原稿下エッジデータから下エッジとして確度の低いエッジ点の座標データを削除し、原稿下エッジデータを確定する。尚、S890で、上述のようにして、X座標値が大きいエッジ点程、エッジ点が原稿の下端を表すエッジ点(下エッジ)である確度が高いと取り扱い、X座標値が大きいエッジ点群からY軸方向に大きくずれた位置に存在するX座標値が小さいエッジ点群を、原稿下エッジデータから削除する理由は、下エッジ検出処理にて、Xe=0から順に検査位置(Xe,Ye)をずらして原稿の下端を表すエッジ点を検索すると、原稿が左側に傾いている場合には、原稿の下端ではなく、原稿内部に描写された罫線等に対応するエッジ点を、原稿の下端を表すエッジ点として誤検出してしまう可能性があるためである。 That is, in S890 of the lower edge detection process, the coordinate data of the edge point with low accuracy is deleted from the document lower edge data as the lower edge in this way, and the document lower edge data is determined. In S890, as described above, an edge point having a larger X coordinate value is treated as having a higher probability that the edge point is an edge point (lower edge) representing the lower end of the document, and an edge point group having a larger X coordinate value. The reason why the edge point group having a small X coordinate value existing at a position greatly deviated in the Y axis direction from the document is deleted from the document lower edge data is that the inspection positions (Xe, Ye in order from Xe = 0 in the lower edge detection process) ) To search for an edge point representing the bottom edge of the document. If the document is tilted to the left, the edge point corresponding to the ruled line drawn inside the document is not the bottom edge of the document. This is because there is a possibility of erroneous detection as an edge point representing.
このような誤検出は、X座標値が小さいエッジ点群において発生している可能性が高く、X座標値が大きいエッジ点群において発生している可能性は、小さい。このような理由から、S890では、X座標値が大きいエッジ点程、エッジ点が原稿の下端を表すエッジ点(下エッジ)である確度が高いと取り扱って、確度の低いエッジ点を原稿下エッジデータから削除し、原稿下エッジデータを確定するようにしている。 Such an erroneous detection is highly likely to occur in an edge point group having a small X coordinate value, and is unlikely to occur in an edge point group having a large X coordinate value. For this reason, in S890, an edge point with a larger X coordinate value is treated as having a higher probability that the edge point is an edge point (lower edge) representing the lower end of the document, and an edge point with lower accuracy is treated as the lower edge of the document. The data is deleted from the data, and the document lower edge data is determined.
また、このようにしてS890での処理を終えると、CPU70は、S460での下エッジ検出処理を終了して、S465に移行し、S465では、下エッジ検出処理で確定された原稿下エッジデータが示す各点を直線近似して、原稿下エッジデータが示す点群の近似直線(以下、「下エッジ近似直線」という。)を算出する。その後、S470に移行する。但し、直前の下エッジ検出処理で原稿下エッジデータとして登録された座標データがない場合には、下エッジの検出に失敗したと判断して、下エッジ近似直線を算出することなく、S470に移行するものとする。
When the processing in S890 is completed in this manner, the
また、S470に移行すると、CPU70は、右エッジ近似直線、左エッジ近似直線、及び下エッジ近似直線の相互関係から、右エッジ検出処理(S420)、左エッジ検出処理(S450)及び下エッジ検出処理(S460)にて正しく原稿エッジが検出されたか否かを判断する。即ち、右エッジ、左エッジ及び下エッジの全てが正常に検出されたか否かを判断する。
In step S470, the
具体的には、右エッジ近似直線と左エッジ近似直線とが平行な関係にあり、右エッジ近似直線と下エッジ近似直線とが直交関係にあり、左エッジ近似直線と下エッジ近似直線とが直交関係にある場合には、正しく原稿エッジが検出されたとして、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
On the other hand, if it is determined in S470 that the document edge is correctly detected (Yes in S470), the
また、S485での処理を終えると、CPU70は、S480及びS485で推定した角位置の位置座標に基づき、原稿台11aに載置されている原稿が定型用紙であるとの仮定の下で、原稿台11aに載置された原稿のサイズ及び原稿台11aにおける原稿の載置領域を推定すると共に、右エッジ近似直線に基づき、原稿台11aに載置されている原稿の傾き角θを推定する(S490)。
When the process in S485 is completed, the
即ち、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. Assuming that the document size is estimated by estimating the side length (vertical width), the document of the document size is placed on the document table 11a starting from 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は、S220での原稿推定処理を終了して、S230に移行し、後続の処理を実行する。即ち、原稿推定処理での推定結果に基づき、変倍率及び傾き補正量を設定し(S251,S253)、更に読取領域を設定する(S255)。その後、本スキャンに移行する(S270)。
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 is completed, the
そして、本スキャン(S270)では、上記設定した読取領域下において読取ユニット15を搬送し、その領域に写る画像を読取ユニット15に読み取らせる。そして、その読取結果を、上記設定した変倍率に合わせて拡大/縮小処理すると共に、上記設定した傾き補正量に合わせて回転処理して、印刷用の画像データを生成する。また、これを印刷対象データとして印刷処理することで、原稿のコピー画像であって、自動変倍され、更に傾き補正された画像を、印刷部30を通じて、記録紙に印刷する。
In the main scan (S270), the
以上、本実施例のディジタル複合機1の構成について説明したが、本実施例の複合機1によれば、読取可能領域R0の一部領域をプレスキャンして、その読取結果に基づき、原稿エッジを検出し、原稿の状態(原稿サイズ・原稿の傾き・原稿の載置領域)を推定するようにしているので、従来のように、読取可能領域R0全体をプレスキャンする手法よりも高速にプレスキャン動作を終了することができ、効率的に原稿の状態を推定することができる。 The configuration of the digital multi-function peripheral 1 according to the present embodiment has been described above. According to the multi-function peripheral 1 according to the present embodiment, a part of the readable area R0 is pre-scanned, and the document edge is based on the read result. Is detected, and the state of the original (original size, original inclination, original placement area) is estimated, so that the press can be performed at a higher speed than the conventional method of pre-scanning the entire readable area R0. The can operation can be terminated, and the state of the document can be estimated efficiently.
また、本実施例では、右エッジ及び左エッジを検出する際に、原稿台11aの中央側にある原稿エッジの候補点ほど、それが原稿エッジである確度が高いと取り扱って、原稿台11aの中央寄りにあるブロック(Y座標値が最大のブロック)を基準に、原稿右エッジデータ及び原稿左エッジデータを確定し、これらのデータに基づいて右エッジ近似直線及び左エッジ近似直線を求めるようにした。 In this embodiment, when the right edge and the left edge are detected, the document edge candidate point at the center of the document table 11a is treated as having a higher probability of being the document edge, and the document table 11a The document right edge data and document left edge data are determined based on the block closer to the center (the block with the largest Y coordinate value), and the right edge approximate straight line and the left edge approximate straight line are obtained based on these data. did.
従って、本実施例によれば、原稿が傾いていることが原因で原稿内部に描写された罫線等を原稿エッジ(右エッジ又は左エッジ)として誤検出してしまい、結果として、近似直線に誤差が大きく現れるのを抑えることができる。よって、本実施例によれば、一部領域のプレスキャン程度で、高精度に、原稿サイズや原稿の傾き角、原稿の載置領域を推定することができる。 Therefore, according to the present embodiment, a ruled line or the like drawn inside the document is erroneously detected as a document edge (right edge or left edge) due to the document being inclined, and as a result, an error occurs in the approximate straight line. Can be suppressed from appearing greatly. Therefore, according to the present embodiment, it is possible to estimate the document size, the inclination angle of the document, and the document placement area with high accuracy with a pre-scan of a partial region.
また、本実施例では、下エッジ近似直線を求める際に、原稿台11aの右側にある下エッジの候補点(エッジ点)程、それが真に下エッジである確度が高いと取り扱って、原稿台11aの右側寄りにあるブロックを基準に、原稿下エッジデータを確定し、これらのデータに基づいて下エッジ近似直線を求めるようにした。従って、本実施例によれば、原稿が左側に傾いて載置されている場合の下エッジの誤検出を極力抑えることができて、高精度に、原稿サイズや原稿の傾き角、原稿の載置領域を推定することができる。 Further, in this embodiment, when the approximate straight line of the lower edge is obtained, the lower edge candidate point (edge point) on the right side of the document table 11a is treated as having a high probability of being truly the lower edge, and the original document is processed. The document lower edge data is determined on the basis of the block on the right side of the table 11a, and the lower edge approximate straight line is obtained based on these data. Therefore, according to the present embodiment, it is possible to suppress erroneous detection of the lower edge when the document is placed on the left side as much as possible, and with high accuracy, the document size, the inclination angle of the document, and the placement of the document. The placement area can be estimated.
尚、原稿が右側に傾いている場合には、原稿台11aの左側にある下エッジの候補点(エッジ点)程、それが真に下エッジである確度が高いので、右エッジ近似直線の傾きに応じて、第二エッジ確定処理の内容を切り替えるようにしてもよい。即ち、原稿が右側に傾いていると推定される場合には、検査ブロックを、X座標値が最小のエッジ点を含むブロックから、順に、X軸プラス方向に切り替えて、原稿台11aの左端寄りにあるブロックを基準に、原稿下エッジデータを確定し、これらのデータに基づいて下エッジ近似直線を求めるようにしてもよい。
[第一変形例]
続いて、第一変形例について説明する。但し、第一変形例の複合機は、S590,S790で実行する第一エッジ確定処理及びS890で実行する第二エッジ確定処理の内容が一部変更された程度のものであり、他の構成は、上記実施例の複合機1と同一であるので、以下では、上記実施例と同一構成の部位についての説明を適宜省略する。
When the document is inclined to the right side, the lower edge candidate point (edge point) on the left side of the document table 11a is more likely to be a truly lower edge. The contents of the second edge determination process may be switched according to the above. That is, when it is estimated that the document is inclined to the right side, the inspection block is sequentially switched from the block including the edge point with the smallest X coordinate value to the X axis plus direction, and closer to the left end of the document table 11a. Alternatively, the document lower edge data may be determined based on the blocks in the document, and the lower edge approximate straight line may be obtained based on these data.
[First modification]
Subsequently, a first modification will be described. However, the multifunctional machine of the first modification is such that the contents of the first edge determination process executed in S590 and S790 and the contents of the second edge determination process executed in S890 are partially changed. Since it is the same as the
図14は、第一変形例において、CPU70が実行する第一エッジ確定処理を表すフローチャートである。
CPU70は、S590又はS790で図14に示す第一エッジ確定処理を開始すると、まず、変数L及び変数LMAXを値ゼロに初期化する(S1010)。その後、S1015に移行して、予め設定された処理対象データが、少なくとも8つ以上のエッジ点の座標データを含むものであるか否かを判断する。
FIG. 14 is a flowchart showing a first edge determination process executed by the
When starting the first edge determination process shown in FIG. 14 in S590 or S790, the
そして、処理対象データが8つ以上のエッジ点の座標データを含むものであると判断すると(S1015でYes)、S1020に移行し、処理対象データが8つ以上のエッジ点の座標データを含むものではないと判断すると(S1015でNo)、S1020〜S1090の処理を実行することなく、当該第一エッジ確定処理を終了する。 If it is determined that the processing target data includes coordinate data of eight or more edge points (Yes in S1015), the process proceeds to S1020, and the processing target data does not include coordinate data of eight or more edge points. (No in S1015), the first edge determination process is terminated without executing the processes of S1020 to S1090.
一方、S1020に移行すると、CPU70は、S620での処理と同様に、処理対象データにおいて、Y座標値が最大のエッジ点を要素に含むブロックを検査ブロックに設定する。その後、S1030に移行する。
On the other hand, when proceeding to S1020, the
また、S1030に移行すると、CPU70は、変数Lを8加算した値に更新する(L←L+8)。尚、変数Lは、連続するエッジ点の長さを計測するための変数であり、ここで、値8を加算するのは、検査ブロックを構成する8つのエッジ点が連続しているためである。
In S1030, the
このようにしてS1030での処理を終えると、CPU70は、S1040に移行し、S630での処理と同様に、検査ブロックよりY軸マイナス方向に隣接するエッジ点の座標データが、処理対象データに含まれているか否かを判断する。即ち、検査ブロックを構成するエッジ点の内、Y座標値が最小のエッジ点の画素位置が(X,Y)=(X0,Y0)であるとすると、Y軸マイナス方向に隣接するエッジ点の座標データとして、Y座標値がY=Y0−8を採るエッジ点の当該座標データが、処理対象データに含まれているか否かを判断する。
When the processing in S1030 is completed in this way, the
そして、Y軸マイナス方向に隣接するエッジ点の座標データが処理対象データに含まれていると判断すると(S1040でYes)、S1050に移行し、Y軸マイナス方向に隣接するエッジ点の座標データが処理対象データに含まれていないと判断すると(S1040でNo)、S1071に移行する。 If it is determined that the coordinate data of the edge point adjacent in the Y axis minus direction is included in the processing target data (Yes in S1040), the process proceeds to S1050, and the coordinate data of the edge point adjacent in the Y axis minus direction is obtained. If it is determined that the data is not included in the processing target data (No in S1040), the process proceeds to S1071.
また、S1050に移行すると、CPU70は、S640での処理と同様、検査ブロックのY軸マイナス方向末端のエッジ点のX座標値と、上述した検査ブロックよりY軸マイナス方向に隣接するエッジ点のX座標値との差δXを算出する。即ち、検査ブロックのY軸マイナス方向末端のエッジ点の画素位置が(X,Y)=(X0,Y0)であり、検査ブロックよりY軸マイナス方向に隣接するエッジ点の画素位置が(X,Y)=(X1,Y0−8)である場合には、δX=|X0−X1|を算出する。
In S1050, the
また、この処理を終えると、CPU70は、差δXが、予め設計段階で定められた閾値未満であるか否かを判断し(S1055)、閾値未満であると判断すると(S1055でYes)、検査ブロックをY軸マイナス方向に隣接する次ブロックに更新し(S1060)、その後、S1030に移行する。例えば、検査ブロックのY軸マイナス方向末端のエッジ点の画素位置が(X,Y)=(X0,Y0)である場合には、Y座標値がY=Y0−8からY=Y0−64までの範囲の値を採る計8個のエッジ点の集合を、新たな検査ブロックに設定した後、S1030に移行する。
When this process is finished, the
一方、差δXが、閾値以上であると判断すると(S1055でNo)、CPU70は、S1071に移行する。そして、S1071では、変数Lの現在値が、変数LMAXより大きいか否かを判断し、変数Lの現在値が、変数LMAXより大きいと判断すると(S1071でYes)、最後に変数L=0に設定(初期化)した時点から現在までに検査ブロックに設定した各ブロックを構成するエッジ点を、最も長く連続するエッジ点の集合であると判断し、この集合に属するエッジ点の各座標データを、最終候補データとして、RAM80に記録する(S1073)。尚、ここでは、前回記録した最終候補データに上書きするようにして、RAM80に、最新の最終候補データを記録することで、最終候補データの前回値を破棄する。
On the other hand, when determining that the difference δX is equal to or greater than the threshold (No in S1055), the
また、S1073での処理を終えると、CPU70は、S1075に移行し、変数LMAXの値を、変数Lの現在値に更新する(LMAX←L)。その後、S1080に移行する。
When the process in S1073 is completed, the
一方、S1071で、変数Lの現在値が変数LMAXの値以下であると判断すると(S1071でNo)、CPU70は、S1073,S1075の処理を実行することなく、S1080に移行する。
On the other hand, if it is determined in S1071 that the current value of the variable L is less than or equal to the value of the variable LMAX (No in S1071), the
また、S1080に移行すると、CPU70は、検査ブロックのY軸マイナス方向末端よりY軸マイナス方向に位置するエッジ点が、処理対象データに登録されているか否かを判断する。即ち、現在の検査ブロックのY軸マイナス方向末端のエッジ点の画素位置が(X,Y)=(X0,Y0)である場合、Y座標値がY0未満のエッジ点が処理対象データに登録されているか否かを判断する。
In S1080, the
そして、検査ブロックのY軸マイナス方向末端よりY軸マイナス方向に位置するエッジ点が、処理対象データに登録されていると判断すると(S1080でYes)、S1081に移行し、変数Lの値をゼロに初期化する(L=0)。その後、検査ブロックを、現在の検査ブロックよりもY軸マイナス方向に位置する次ブロックに更新し(S1085)、S1030に移行する。 If it is determined that an edge point located in the Y-axis minus direction from the Y-axis minus direction end of the inspection block is registered in the processing target data (Yes in S1080), the process proceeds to S1081, and the value of the variable L is set to zero. (L = 0). Thereafter, the inspection block is updated to the next block located in the negative Y-axis direction from the current inspection block (S1085), and the process proceeds to S1030.
例えば、検査ブロックのY軸マイナス方向末端のエッジ点の画素位置が(X,Y)=(X0,Y0)である場合には、Y座標値がY=Y0未満であるエッジ点の内、Y座標値が最大のエッジ点を起点として、このエッジ点からY軸マイナス方向にある計8個のエッジ点の集合を、新たな検査ブロックに設定した後(S1085)、S1030に移行する。 For example, when the pixel position of the edge point at the end of the Y-axis minus direction of the inspection block is (X, Y) = (X0, Y0), among the edge points whose Y coordinate value is less than Y = Y0, Y Starting from the edge point with the largest coordinate value, a set of a total of eight edge points in the negative Y-axis direction from this edge point is set as a new inspection block (S1085), and the process proceeds to S1030.
このようにして、CPU70は、S1030〜S1085の処理を繰返し実行し、検査ブロックのY軸マイナス方向末端よりY軸マイナス方向に位置するエッジ点が、処理対象データ内でなくなると(S1080でNo)、その時点で最終候補データとしてRAM80に登録されているエッジ点以外の各エッジ点の座標データを、処理対象データから削除して、処理対象データを更新する。その後、当該第一エッジ確定処理を終了する。
In this way, the
第一エッジ確定処理では、このようにして、Y軸方向に最も長く連続するエッジ点の集合を、原稿エッジとして確度の高いエッジ点であると取り扱い、この集合に属するエッジ点以外のエッジ点の座標データを処理対象データから削除することで、処理対象データから、原稿エッジとして確度の低い座標データを削除する。 In the first edge determination process, a set of edge points that are longest and continuous in the Y-axis direction is treated as a highly accurate edge point as a document edge in this way, and edge points other than the edge points belonging to this set are handled. By deleting the coordinate data from the processing target data, the coordinate data having low accuracy as the document edge is deleted from the processing target data.
尚、図15は、第一変形例での原稿右エッジデータの確定手法を示した説明図である。
図15に示す例では、変数Lの値として計測された連続するエッジ点の集合の長さが夫々、L[0],L[1],L[2]であり、その大小関係がL[1]>L[2]>L[0]であるので、長さL[1]のエッジ点の集合が、右エッジとして確度の高いエッジ点の集合であると取り扱って、この集合に属するエッジ点の座標データのみを原稿右エッジデータに残して、原稿右エッジデータを確定する。そして、最終的に、このエッジ点の集合から、右エッジ近似直線を求める。
FIG. 15 is an explanatory diagram showing a method for determining document right edge data in the first modification.
In the example illustrated in FIG. 15, the lengths of sets of continuous edge points measured as the value of the variable L are L [0], L [1], and L [2], respectively, and the magnitude relationship is L [0]. Since 1]> L [2]> L [0], the set of edge points of length L [1] is treated as a set of edge points with high accuracy as the right edge, and the edges belonging to this set Only the point coordinate data is left in the document right edge data, and the document right edge data is determined. Finally, a right edge approximate straight line is obtained from the set of edge points.
このような手順により、第一変形例では、S590において原稿右エッジデータを確定し、S790において原稿左エッジデータを確定する。
一方、S890においては、原稿下エッジデータを処理対象データに設定して、図16に示す第二エッジ確定処理を実行することにより、当該原稿下エッジデータを確定する。尚、図16は、第一変形例において、CPU70が実行する第二エッジ確定処理を表すフローチャートである。
According to such a procedure, in the first modification, the document right edge data is determined in S590, and the document left edge data is determined in S790.
On the other hand, in S890, the document lower edge data is set as processing target data, and the second edge determination process shown in FIG. 16 is executed to determine the document lower edge data. FIG. 16 is a flowchart showing the second edge determination process executed by the
図16に示す第二エッジ確定処理を開始すると、CPU70は、まず、変数L及び変数LMAXを値ゼロに初期化する(S1110)。その後、S1115に移行して、予め設定された処理対象データが、少なくとも8つ以上のエッジ点の座標データを含むものであるか否かを判断する。
When the second edge determination process shown in FIG. 16 is started, the
そして、処理対象データが8つ以上のエッジ点の座標データを含むものであると判断すると(S1115でYes)、S1120に移行し、処理対象データが8つ以上のエッジ点の座標データを含むものではないと判断すると(S1115でNo)、S1120〜S1190の処理を実行することなく、当該第二エッジ確定処理を終了する。 If it is determined that the processing target data includes coordinate data of eight or more edge points (Yes in S1115), the process proceeds to S1120, and the processing target data does not include coordinate data of eight or more edge points. (No in S1115), the second edge determination process is terminated without executing the processes in S1120 to S1190.
一方、S1120に移行すると、CPU70は、S920での処理と同様に、処理対象データにおいて、X座標値が最大のエッジ点を要素に含むブロックを検査ブロックに設定する。その後、S1130に移行する。
On the other hand, when the process proceeds to S1120, the
また、S1130に移行すると、CPU70は、変数Lを8加算した値に更新した後(L←L+8)、S1140に移行し、S930での処理と同様に、検査ブロックよりX軸マイナス方向に隣接するエッジ点の座標データが、処理対象データに含まれているか否かを判断する。即ち、検査ブロックを構成するエッジ点の内、X座標値が最小のエッジ点の画素位置が(X,Y)=(X0,Y0)であるとすると、X軸マイナス方向に隣接するエッジ点の座標データとして、X座標値がX=X0−8を採るエッジ点の当該座標データが、処理対象データに含まれているか否かを判断する。
When the process proceeds to S1130, the
そして、X軸マイナス方向に隣接するエッジ点の座標データが処理対象データに含まれていると判断すると(S1140でYes)、S1150に移行し、X軸マイナス方向に隣接するエッジ点の座標データが処理対象データに含まれていないと判断すると(S1140でNo)、S1171に移行する。 If it is determined that the coordinate data of the edge point adjacent in the X axis minus direction is included in the processing target data (Yes in S1140), the process proceeds to S1150, and the coordinate data of the edge point adjacent in the X axis minus direction is obtained. If it is determined that the data is not included in the processing target data (No in S1140), the process proceeds to S1171.
また、S1150に移行すると、CPU70は、S940での処理と同様、検査ブロックのX軸マイナス方向末端のエッジ点のX座標値と、上述した検査ブロックよりX軸マイナス方向に隣接するエッジ点のX座標値との差δYを算出する。即ち、検査ブロックのX軸マイナス方向末端のエッジ点の画素位置が(X,Y)=(X0,Y0)であり、検査ブロックよりX軸マイナス方向に隣接するエッジ点の画素位置が(X,Y)=(X0−8,Y1)である場合には、δY=|Y0−Y1|を算出する。
In step S1150, as in the process in step S940, the
また、この処理を終えると、CPU70は、差δYが、予め設計段階で定められた閾値未満であるか否かを判断し(S1155)、閾値未満であると判断すると(S1155でYes)、検査ブロックをX軸マイナス方向に隣接する次ブロックに更新し(S1160)、その後、S1130に移行する。例えば、検査ブロックのX軸マイナス方向末端のエッジ点の画素位置が(X,Y)=(X0,Y0)である場合には、X座標値がX=X0−8からX=X0−64までの範囲の値を採る計8個のエッジ点の集合を、新たな検査ブロックに設定した後、S1130に移行する。
When this process is finished, the
一方、差δYが、閾値以上であると判断すると(S1155でNo)、CPU70は、S1171に移行する。そして、S1171では、変数Lの現在値が、変数LMAXより大きいか否かを判断し、変数Lの現在値が、変数LMAXより大きいと判断すると(S1171でYes)、最後に変数L=0に設定(初期化)した時点から現在までに検査ブロックに設定した各ブロックを構成するエッジ点を、最も長く連続するエッジ点の集合であると判断し、S1073での処理と同様に、この集合に属するエッジ点の各座標データを、最終候補データとして、RAM80に記録する(S1173)。
On the other hand, when determining that the difference δY is equal to or greater than the threshold (No in S1155), the
また、S1173での処理を終えると、CPU70は、S1175に移行し、変数LMAXの値を、変数Lの現在値に更新する(LMAX←L)。その後、S1180に移行する。
When the processing in S1173 is completed, the
これに対し、S1171で、変数Lの現在値が変数LMAXの値以下であると判断すると(S1171でNo)、CPU70は、S1173,S1175の処理を実行することなく、S1180に移行する。
On the other hand, if it is determined in S1171 that the current value of the variable L is equal to or less than the value of the variable LMAX (No in S1171), the
また、S1180に移行すると、CPU70は、検査ブロックのX軸マイナス方向末端よりX軸マイナス方向に位置するエッジ点が、処理対象データに登録されているか否かを判断する。即ち、現在の検査ブロックのX軸マイナス方向末端のエッジ点の画素位置が(X,Y)=(X0,Y0)である場合、X座標値がX0未満のエッジ点が処理対象データに登録されているか否かを判断する。
In S1180, the
そして、検査ブロックのX軸マイナス方向末端よりX軸マイナス方向に位置するエッジ点が、処理対象データに登録されていると判断すると(S1180でYes)、S1181に移行し、変数Lの値をゼロに初期化する(L=0)。その後、検査ブロックを、現在の検査ブロックよりもX軸マイナス方向に位置する次ブロックに更新し(S1185)、S1130に移行する。 If it is determined that the edge point located in the X-axis minus direction from the X-axis minus direction end of the inspection block is registered in the processing target data (Yes in S1180), the process proceeds to S1181, and the value of the variable L is set to zero. (L = 0). Thereafter, the inspection block is updated to the next block positioned in the minus direction of the X axis from the current inspection block (S1185), and the process proceeds to S1130.
例えば、検査ブロックのX軸マイナス方向末端のエッジ点の画素位置が(X,Y)=(X0,Y0)である場合には、X座標値がX=X0未満であるエッジ点の内、X座標値が最大のエッジ点を起点として、このエッジ点からX軸マイナス方向にある計8個のエッジ点の集合を、新たな検査ブロックに設定した後(S1185)、S1130に移行する。 For example, when the pixel position of the edge point at the end of the X-axis minus direction of the inspection block is (X, Y) = (X0, Y0), among the edge points whose X coordinate value is less than X = X0, X Starting from the edge point with the maximum coordinate value, a set of a total of eight edge points in the negative X-axis direction from this edge point is set as a new inspection block (S1185), and the process proceeds to S1130.
このようにして、CPU70は、S1130〜S1185の処理を繰返し実行し、検査ブロックのX軸マイナス方向末端よりX軸マイナス方向に位置するエッジ点が、処理対象データ内でなくなると(S1180でNo)、その時点で最終候補データとしてRAM80に登録されているエッジ点以外の各エッジ点の座標データを、処理対象データから削除して、処理対象データを更新する。その後、当該第二エッジ確定処理を終了する。
In this way, the
第二エッジ確定処理では、このようにして、X軸方向に最も長く連続するエッジ点の集合を、原稿エッジとして確度の高いエッジ点であると取り扱い、この集合に属するエッジ点以外のエッジ点の座標データを処理対象データから削除することで、処理対象データから、原稿エッジとして確度の低い座標データを削除する。 In the second edge determination process, a set of edge points that are longest in the X-axis direction is treated as a highly accurate edge point as a document edge in this way, and edge points other than the edge points belonging to this set are handled. By deleting the coordinate data from the processing target data, the coordinate data having low accuracy as the document edge is deleted from the processing target data.
このようにして、第一変形例では、X軸方向に最も長く連続するエッジ点の集合に属するエッジ点の座標データのみを原稿下エッジデータに残して、原稿下エッジデータを確定する。そして、最終的に、このエッジ点の集合から、下エッジ近似直線を求める。 In this way, in the first modification, only the coordinate data of the edge points belonging to the set of edge points that are longest in the X-axis direction are left in the document lower edge data, and the document lower edge data is determined. Finally, a lower edge approximate straight line is obtained from the set of edge points.
以上、第一変形例について説明したが、第一変形例では、最も長く連続するエッジ点の集合を最も原稿エッジとして確度の高いエッジ点の集合として取り扱って、右エッジ近似直線、左エッジ近似直線、及び、下エッジ近似直線を求めるようにした。 The first modification has been described above. In the first modification, the longest continuous edge point set is treated as the most accurate edge point set as the document edge, and the right edge approximate straight line and the left edge approximate straight line are handled. And a lower edge approximate straight line.
従って、第一変形例によれば、原稿内部の罫線や埃等に惑わされて、原稿エッジの近似直線として誤った近似直線を求めてしまうのを、極力防止することができて、一部領域のプレスキャン程度で、高精度に、原稿サイズや原稿の傾き角、原稿の載置領域を推定することができる。 Therefore, according to the first modification, it is possible to prevent as much as possible from obtaining an approximate straight line as an approximate straight line of the document edge by being confused by ruled lines or dust inside the original, Thus, it is possible to estimate the document size, the inclination angle of the document, and the document placement area with high accuracy.
[第二変形例]
続いて、第二変形例について説明する。但し、第二変形例の複合機は、S590,S790で実行する第一エッジ確定処理及びS890で実行する第二エッジ確定処理の内容が一部変更された程度のものであり、他の構成は、上述した実施例の複合機1と同一であるので、以下では、上記実施例と同一構成の部位についての説明を適宜省略する。
[Second modification]
Subsequently, a second modification will be described. However, the MFP of the second modified example is such that the contents of the first edge determination process executed in S590 and S790 and the contents of the second edge determination process executed in S890 are partially changed. Since it is the same as the
図17は、第二変形例において、CPU70が実行する第一エッジ確定処理を表すフローチャートである。
CPU70は、S590又はS790で、図17に示す第一エッジ確定処理を開始すると、まず、S1210にて、予め設定された処理対象データが、少なくとも8つ以上のエッジ点の座標データを含むものであるか否かを判断する。
FIG. 17 is a flowchart showing a first edge determination process executed by the
When the
そして、処理対象データが8つ以上のエッジ点の座標データを含むものであると判断すると(S1210でYes)、S1220に移行し、処理対象データが8つ以上のエッジ点の座標データを含むものではないと判断すると(S1210でNo)、S1220〜S1290の処理を実行することなく、当該第一エッジ確定処理を終了する。 If it is determined that the processing target data includes coordinate data of eight or more edge points (Yes in S1210), the process proceeds to S1220, and the processing target data does not include coordinate data of eight or more edge points. (No in S1210), the first edge determination process is terminated without executing the processes in S1220 to S1290.
一方、S1220に移行すると、CPU70は、S620での処理と同様に、処理対象データにおいて、Y座標値が最大のエッジ点を要素に含むブロックを検査ブロックに設定する。その後、S1230に移行する。
On the other hand, when the process proceeds to S1220, the
また、S1230に移行すると、CPU70は、検査ブロックに属する計8個のエッジ点の各座標データに基づき、これらエッジ点の近似直線を算出する。そして、算出した近似直線の傾き及び切片の値を、当該近似直線の算出に用いたエッジ点の座標データと関連付けて、RAM80に記憶する(S1240)。その後、S1250に移行する。
In step S1230, the
また、S1250に移行すると、CPU70は、検査ブロックのY軸マイナス方向末端よりY軸マイナス方向に位置するエッジ点が、処理対象データに登録されているか否かを判断する。即ち、現在の検査ブロックのY軸マイナス方向末端のエッジ点の画素位置が(X,Y)=(X0,Y0)である場合、Y座標値がY0未満のエッジ点が処理対象データに登録されているか否かを判断する。
In S1250, the
そして、検査ブロックのY軸マイナス方向末端よりY軸マイナス方向に位置するエッジ点が、処理対象データに登録されていると判断すると(S1250でYes)、検査ブロックを、現在の検査ブロックよりもY軸マイナス方向に位置する次ブロックに更新し(S1260)、その後、S1230に移行する。 If it is determined that the edge point located in the Y-axis minus direction from the Y-axis minus direction end of the inspection block is registered in the processing target data (Yes in S1250), the inspection block is set to be more than the current inspection block. The next block located in the negative axis direction is updated (S1260), and then the process proceeds to S1230.
例えば、検査ブロックのY軸マイナス方向末端のエッジ点の画素位置が(X,Y)=(X0,Y0)である場合には、Y座標値がY=Y0未満であるエッジ点の内、Y座標値が最大のエッジ点を起点として、このエッジ点からY軸マイナス方向にある計8個のエッジ点の集合を、新たな検査ブロックに設定した後(S1260)、S1230に移行する。 For example, when the pixel position of the edge point at the end of the Y-axis minus direction of the inspection block is (X, Y) = (X0, Y0), among the edge points whose Y coordinate value is less than Y = Y0, Y Starting from the edge point with the largest coordinate value, a set of a total of eight edge points in the negative Y-axis direction from this edge point is set as a new inspection block (S1260), and the process proceeds to S1230.
このようにして、CPU70は、S1230〜S1260の処理を繰返し実行し、処理対象データに登録されたエッジ点の近似直線を、ブロック毎に求めて、各ブロックの近似直線の傾き及び切片の値を、その近似直線の算出に用いたエッジ点の座標データと関連付けて、RAM80に蓄積する。
In this way, the
そして、検査ブロックのY軸マイナス方向末端よりY軸マイナス方向に位置するエッジ点が、処理対象データ内でなくなると(S1250でNo)、それまでにRAM80に蓄積した各ブロックの近似直線の傾きから、傾きについてのヒストグラムデータを生成する(S1270)。尚、図18は、S1270で生成する傾きのヒストグラムデータを、グラフ化して示した説明図である。
Then, when the edge point located in the Y-axis minus direction from the Y-axis minus direction end of the inspection block is not in the processing target data (No in S1250), from the inclination of the approximate straight line of each block accumulated in the
本変形例では、近似直線が採りうる傾きの範囲を複数のクラスに区分することで、傾きに対して複数のクラスを設定している。S1270では、各ブロックの傾きを、その値に応じたクラスに分類し、各クラスの度数を算出することで、傾きのヒストグラムデータを生成する。 In this modification, a plurality of classes are set for the inclination by dividing the range of inclination that the approximate straight line can take into a plurality of classes. In S1270, the slope of each block is classified into classes corresponding to the values, and the histogram data of the slope is generated by calculating the frequency of each class.
そして、傾きのヒストグラムデータから、傾きについて度数が最大のクラスを特定し、処理対象データの中から、度数が最大のクラスに属する傾きの近似直線を算出するに至ったブロックの全てを選択する(S1275)。 Then, the class having the highest frequency is specified from the histogram data of the slope, and all the blocks that have been used to calculate the approximate straight line of the slope belonging to the class having the highest frequency are selected from the processing target data ( S1275).
また、S1275での処理を終えると、CPU70は、RAM80に蓄積された各ブロックの近似直線の切片の情報に基づき、S1275で選択した各ブロックの近似直線の切片についてのヒストグラムデータを生成する(S1280)。
When the processing in S1275 is finished, the
即ち、RAM80に蓄積された各ブロックの近似直線の切片の情報の中から、S1275で選択したブロックについての切片の情報を選択的に用いて、切片についてのヒストグラムデータを生成する。
That is, from the information on the intercept of the approximate straight line of each block stored in the
尚、本変形例では、近似直線が採りうる切片の範囲を複数のクラスに区分することで、切片に対して複数のクラスを設定している。S1280では、S1275で選択した各ブロックの切片を、その値に応じたクラスに分類して、各クラスの度数を算出することで、切片のヒストグラムデータを生成する。 In this modification, a plurality of classes are set for the intercept by dividing the range of the intercept that the approximate straight line can take into a plurality of classes. In S1280, the intercept of each block selected in S1275 is classified into classes according to the values, and the frequency of each class is calculated, thereby generating intercept histogram data.
そして、切片のヒストグラムデータから、切片について度数が最大のクラスを特定し、S1275で選択したブロック群の中から、当該特定したクラスに属する切片の近似直線を算出するに至ったブロックの全てを選択する(S1285)。 Then, from the histogram data of the intercept, the class having the highest frequency for the intercept is identified, and all of the blocks that have been used to calculate the approximate straight line of the intercept belonging to the identified class are selected from the block group selected in S1275. (S1285).
そして、S1285での処理を終えると、CPU70は、S1290に移行し、S1285で選択したブロックに属するエッジ点以外のエッジ点の座標データを、処理対象データから削除して、処理対象データ内に、S1285で選択したブロックに属するエッジ点の座標データのみが残るように、処理対象データを更新する。その後、当該第一エッジ確定処理を終了する。
After completing the processing in S1285, the
このようにして、第二変形例の第一エッジ確定処理では、度数の最も高い近似直線が算出されたブロックの集合を、原稿エッジである確度の高いエッジ点の集合であると取り扱って、これらのエッジ点の座標データのみが残るように、処理対象データを更新する。 In this way, in the first edge determination process of the second modified example, the set of blocks for which the approximate straight line having the highest frequency is calculated is treated as a set of edge points with high accuracy that are document edges, and these The processing target data is updated so that only the coordinate data of the edge point remains.
このような手順により、第二変形例では、S590において原稿右エッジデータを確定し、S790において原稿左エッジデータを確定する。
一方、S890においては、原稿下エッジデータを処理対象データに設定して、図19に示す第二エッジ確定処理を実行することにより、当該原稿下エッジデータを確定する。尚、図19は、第二変形例において、CPU70が実行する第二エッジ確定処理を表すフローチャートである。
According to such a procedure, in the second modification, the document right edge data is determined in S590, and the document left edge data is determined in S790.
On the other hand, in S890, the document lower edge data is set as processing target data, and the second edge determination process shown in FIG. 19 is executed to determine the document lower edge data. FIG. 19 is a flowchart illustrating a second edge determination process executed by the
図19に示す第二エッジ確定処理を開始すると、CPU70は、まず、S1310にて、予め設定された処理対象データが、少なくとも8つ以上のエッジ点の座標データを含むものであるか否かを判断する。
When the second edge determination process shown in FIG. 19 is started, the
そして、処理対象データが8つ以上のエッジ点の座標データを含むものであると判断すると(S1310でYes)、S1320に移行し、処理対象データが8つ以上のエッジ点の座標データを含むものではないと判断すると(S1310でNo)、S1320〜S1390の処理を実行することなく、当該第二エッジ確定処理を終了する。 If it is determined that the processing target data includes coordinate data of eight or more edge points (Yes in S1310), the process proceeds to S1320, and the processing target data does not include coordinate data of eight or more edge points. (No in S1310), the second edge determination process is terminated without executing the processes in S1320 to S1390.
一方、S1320に移行すると、CPU70は、S920での処理と同様に、処理対象データにおいて、X座標値が最大のエッジ点を要素に含むブロックを検査ブロックに設定する。その後、S1330に移行する。
On the other hand, when proceeding to S1320, the
また、S1330に移行すると、CPU70は、検査ブロックに属する計8個のエッジ点の各座標データに基づいて、これらエッジ点の近似直線を算出する。そして、算出した近似直線の傾き及び切片の値を、当該近似直線の算出に用いたエッジ点の座標データと関連付けて、RAM80に記憶する(S1340)。その後、S1350に移行する。
In step S1330, the
また、S1350に移行すると、CPU70は、検査ブロックのX軸マイナス方向末端よりX軸マイナス方向に位置するエッジ点が、処理対象データに登録されているか否かを判断する。即ち、現在の検査ブロックのX軸マイナス方向末端のエッジ点の画素位置が(X,Y)=(X0,Y0)である場合、X座標値がX0未満のエッジ点が処理対象データに登録されているか否かを判断する。
In S1350, the
そして、検査ブロックのX軸マイナス方向末端よりX軸マイナス方向に位置するエッジ点が、処理対象データに登録されていると判断すると(S1350でYes)、検査ブロックを、現在の検査ブロックよりもX軸マイナス方向に位置する次ブロックに更新し(S1360)、その後、S1330に移行する。 If it is determined that the edge point located in the X-axis minus direction from the X-axis minus direction end of the inspection block is registered in the processing target data (Yes in S1350), the inspection block is set to be more X than the current inspection block. The block is updated to the next block located in the negative axis direction (S1360), and thereafter, the process proceeds to S1330.
例えば、検査ブロックの方向末端のエッジ点の画素位置が(X,Y)=(X0,Y0)である場合には、X座標値がX=X0未満であるエッジ点の内、X座標値が最大のエッジ点を起点として、このエッジ点からX軸マイナス方向にある計8個のエッジ点の集合を、新たな検査ブロックに設定した後(S1360)、S1330に移行する。 For example, when the pixel position of the edge point at the end of the direction of the inspection block is (X, Y) = (X0, Y0), among the edge points whose X coordinate value is less than X = X0, the X coordinate value is Starting from the maximum edge point, a set of a total of eight edge points in the negative X-axis direction from this edge point is set as a new inspection block (S1360), and then the process proceeds to S1330.
このようにして、CPU70は、S1330〜S1360の処理を繰返し実行し、処理対象データに登録されたエッジ点の近似直線を、ブロック毎に求めて、各ブロックの近似直線の傾き及び切片の値を、その近似直線の算出に用いたエッジ点の座標データと関連付けて、RAM80に蓄積する。
In this way, the
そして、検査ブロックのX軸マイナス方向末端よりX軸マイナス方向に位置するエッジ点が、処理対象データ内でなくなると(S1350でNo)、それまでにRAM80に蓄積した各ブロックの近似直線の傾きから、S1270での処理と同様に、傾きについてのヒストグラムデータを生成する(S1370)。この後、傾きのヒストグラムデータから、傾きについて度数が最大のクラスを特定し、処理対象データの中から、度数が最大のクラスに属する傾きの近似直線を算出するに至ったブロックの全てを選択する(S1375)。
Then, when the edge point located in the X-axis minus direction from the X-axis minus direction end of the inspection block is not in the processing target data (No in S1350), from the inclination of the approximate straight line of each block accumulated in the
また、S1375での処理を終えると、CPU70は、RAM80に蓄積された近似直線の切片の情報であって、S1375で選択した各ブロックの近似直線の切片の情報に基づき、S1280での処理と同様に、これら切片についてのヒストグラムデータを生成する(S1380)。即ち、S1380では、S1375で選択した各ブロックの切片を、その値に応じたクラスに分類して、各クラスの度数を算出することで、切片のヒストグラムデータを生成する。
When the processing in S1375 is completed, the
そして、切片のヒストグラムデータから、切片について度数が最大のクラスを特定し、当該特定したクラスに属する切片の近似直線を算出するに至ったブロックの全てを、S1375で選択したブロック群の中から、選択する(S1385)。 Then, from the histogram data of the intercept, the class having the highest frequency for the intercept is identified, and all of the blocks that have been used to calculate the approximate straight line of the intercept belonging to the identified class are selected from the block group selected in S1375. Select (S1385).
そして、S1385での処理を終えると、CPU70は、S1390に移行し、S1385で選択したブロックに属するエッジ点以外のエッジ点の座標データを、処理対象データから削除して、処理対象データ内に、S1385で選択したブロックに属するエッジ点の座標データのみが残るように、処理対象データを更新する。その後、当該第二エッジ確定処理を終了する。
When the processing in S1385 is finished, the
このようにして、第二変形例の第二エッジ確定処理では、度数の最も高い近似直線が算出されたブロックの集合を、原稿エッジ(下エッジ)である確度の高いエッジ点の集合であると取り扱って、これらのエッジ点の座標データのみが残るように、処理対象データを更新する。このような手順により、第二変形例では、S890において原稿下エッジデータを確定する。 In this way, in the second edge determination process of the second modification, the set of blocks for which the approximate straight line having the highest frequency is calculated is the set of highly accurate edge points that are document edges (lower edges). The processing target data is updated so that only the coordinate data of these edge points remains. According to such a procedure, in the second modified example, the document lower edge data is determined in S890.
以上、第二変形例について説明したが、第二変形例では、度数の最も高い近似直線が算出されたブロック群の各エッジ点を、原稿エッジとしての確度の高いエッジ点として取り扱い、右エッジ近似直線、左エッジ近似直線、及び、下エッジ近似直線を求める。 The second modification has been described above. In the second modification, each edge point of the block group for which the approximate straight line having the highest frequency is calculated is treated as a highly accurate edge point as a document edge, and right edge approximation is performed. A straight line, a left edge approximate line, and a lower edge approximate line are obtained.
従って、第二変形例によれば、原稿内部の罫線や埃等に惑わされて、原稿エッジの近似直線として誤った近似直線を求めてしまうのを、極力防止することができ、一部領域のプレスキャン程度で、高精度に、原稿サイズや原稿の傾き角、原稿の載置領域を推定することができる。
[特許請求の範囲との対応関係]
以上、本発明の実施例について説明したが、本発明の画像読取装置が有する画像解析機能は、CPU70によりソフトウェア的に実現されている。また、読取制御手段は、読取制御部20により実現されている。
Therefore, according to the second modified example, it is possible to prevent as much as possible the determination of an incorrect approximate line as an approximate line of the document edge, which is confused by ruled lines, dust, etc. inside the document, It is possible to estimate the document size, the document inclination angle, and the document placement area with a high degree of accuracy by pre-scanning.
[Correspondence with Claims]
Although the embodiments of the present invention have been described above, the image analysis function of the image reading apparatus of the present invention is realized by the
また、変換手段は、CPU70が実行するS215の処理により実現され、選択手段は、CPU70が実行するS510〜S580,S710〜S780,S810〜S880の処理により実現されている。特に、「連続性を検査する対象のエッジ点を検出する」動作は、S525,S725,S825等の処理により実現されている。
The conversion means is realized by the processing of S215 executed by the
この他、検出手段は、CPU70が実行するS590,S790,S890の処理により実現されている。特に、検査対象切替設定手段は、検査ブロックを切り替えて設定する動作にて実現されている。尚、上述した実施例では、一部領域のプレスキャンにより得られた画像データを検査対象データに設定して原稿エッジを検出しており、プレスキャン領域は、原稿台の中央より端側に位置しているので、本実施例では、第一エッジ確定処理にて、Y座標値が最大のエッジ点を含むブロックを検査ブロックに設定することにより、最も原稿台の中央寄りのグループを検査対象のブロックに設定している。 In addition, the detection means is realized by the processing of S590, S790, and S890 executed by the CPU. In particular, the inspection object switching setting means is realized by an operation of switching and setting the inspection block. In the above-described embodiment, image data obtained by pre-scanning a partial area is set as inspection target data to detect a document edge, and the pre-scan area is located on the end side from the center of the document table. Therefore, in this embodiment, in the first edge determination process, by setting a block including an edge point having the maximum Y coordinate value as an inspection block, the group closest to the center of the document table is set as the inspection target. Set to block.
また、第一判定手段は、S630,S930,S1040,S1140等の処理により実現され、乖離度算出手段は、S640,S940,S1050,S1150等の処理により実現され、第二判定手段は、S650,S950,S1055,S1155等の処理により実現されている。
[その他]
また、本発明は、上記実施例に限定されるものではなく、種々の態様を採ることができる。例えば、上記実施例では、コンタクトイメージセンサを読取ユニットとして備えるディジタル複合機1に、本発明を適用した例を説明したが、本発明は、コンタクトイメージセンサを読取ユニットとして備える画像読取装置に限定されるものではないことは言うまでもない。
Further, the first determination means is realized by processing such as S630, S930, S1040, and S1140, the divergence degree calculating means is realized by processing such as S640, S940, S1050, and S1150, and the second determination means is S650, This is realized by the processing of S950, S1055, S1155 and the like.
[Others]
Further, the present invention is not limited to the above-described embodiments, and can take various forms. For example, in the above-described embodiment, the example in which the present invention is applied to the digital multifunction peripheral 1 including the contact image sensor as a reading unit has been described. However, the present invention is limited to an image reading apparatus including the contact image sensor as a reading unit. Needless to say, it is not something.
1…ディジタル複合機、10…画像読取部、11…読取ガラス、11a…原稿台、13…筐体、13a…フレーム、15…読取ユニット、16…搬送機構、17…モータ、20…読取制御部、30…印刷部、40…印刷制御部、50…表示操作部、60…通信部、70…CPU、80…RAM、90…フラッシュメモリ、MK…マーク、P…原稿、R0…読取可能領域
DESCRIPTION OF
Claims (6)
前記原稿台に載置された原稿を読み取るための読取ユニットと、
前記読取ユニットに、前記原稿台に載置された原稿を読み取らせることにより、前記原稿台に載置された原稿の読取画像を表す画像データを生成する読取制御手段と、
前記読取制御手段により生成された画像データを、エッジ画像を表す画像データに変換する変換手段と、
特定方向に延びる原稿の端縁、を表すエッジ点の候補を、前記変換手段による変換後の画像データから選択する選択手段と、
前記選択手段により前記候補として前記選択された前記エッジ点の位置情報を記憶する記憶手段と、
前記記憶手段が記憶する前記エッジ点の位置情報から特定される前記選択手段により前記候補として選択されたエッジ点の分布に基づき、前記選択手段により選択された前記候補の一群の中から、前記原稿の端縁を表すエッジ点としての確度が低いエッジ点を破棄することで、当該破棄後に残る前記候補を、前記変換後の画像データにおいて前記特定方向に延びる原稿の端縁を表すエッジ点として検出する検出手段と、
を備え、
前記選択手段は、
前記変換後の画像データの端点を、参照開始位置に設定して、当該参照開始位置から、予め定められた第一の方向に沿って、前記画像データの内側へと、前記変換後の画像データを構成する各画素の画素値を参照することにより、連続性を検査する対象のエッジ点を検出すると共に、検出したエッジ点を起点として、前記第一の方向とは垂直な第二の方向に、前記変換後の画像データを構成する各画素の画素値を参照して、前記第二の方向へのエッジ点の連続性を検査することにより、前記第二の方向に連続する所定量のエッジ点を、前記特定方向に延びる原稿の端縁を表すエッジ点の候補として、前記変換後の画像データから選択する動作を、前記参照開始位置を前記第二の方向にずらしながら複数回繰返し実行することにより、前記特定方向に延びる原稿の端縁を表すエッジ点の候補を、前記所定量としての複数個ずつ、前記画像データの端から探索して選択する構成にされていること
を特徴とする画像読取装置。 A document table on which a document to be read is placed;
A reading unit for reading a document placed on the document table;
Reading control means for generating image data representing a read image of the document placed on the document table by causing the reading unit to read the document placed on the document table ;
The image data generated by the reading control means, conversion means for converting the image data representing an edge image,
The candidate edge points representing the edge of the document and extending in a specific direction, selecting means for selecting from the image data converted by said converting means,
Storage means for storing position information of the selected edge point as the candidate by the selection means;
Based on the distribution of the edge points selected as the candidates by the selection means specified from the position information of the edge points stored in the storage means , the original from the group of candidates selected by the selection means By discarding edge points with low accuracy as edge points representing the edges of the document, the candidates remaining after the discard are detected as edge points representing the edges of the document extending in the specific direction in the converted image data Detecting means for
With
The selection means includes
The end point of the converted image data is set as a reference start position, and the converted image data is moved from the reference start position to the inside of the image data along a predetermined first direction. Referring to the pixel value of each pixel that constitutes, the edge point to be inspected for continuity is detected, and the detected edge point is used as a starting point in a second direction perpendicular to the first direction. , By referring to the pixel value of each pixel constituting the image data after the conversion and checking the continuity of the edge points in the second direction, a predetermined amount of edges in the second direction points, as candidate edge points representing the edge of the document and extending in the specific direction, the operation of selecting the image data after the conversion, a plurality of times repeatedly performed while shifting the reference start position in the second direction By specifying Candidate edge points representing the edge of the document extending direction, by a plurality of the predetermined amount, the image reading apparatus characterized by being in the configuration of selecting in search from the end of the image data.
前記選択手段は、前記機能により前記読取制御手段が生成した画像データについての前記変換手段による変換後の画像データから、前記エッジ点の候補を選択し、
前記検出手段は、前記選択手段により選択された前記所定量の候補を1グループ単位として、各グループの前記第二の方向への連続性を、前記第二の方向において最も原稿台の中央寄りのグループを基準に評価し、当該基準としたグループとは不連続なグループに属する前記候補の全てを、前記確度が低い候補として破棄することで、前記特定方向に延びる原稿の端縁を表すエッジ点を検出することを特徴とする請求項1記載の画像読取装置。 The reading control unit has a function of causing the reading unit to read an area shorter than an area extending from one side of the document table perpendicular to the second direction to a center extending in the second direction;
The selection means selects the edge point candidates from the image data converted by the conversion means for the image data generated by the reading control means by the function,
The detection means sets the predetermined amount of candidates selected by the selection means as one group unit, and determines the continuity of each group in the second direction in the second direction closest to the center of the document table. An edge point that represents the edge of the document extending in the specific direction by discarding all of the candidates belonging to a group that is discontinuous from the group that is a criterion as a criterion and discarding all of the candidates as the low-accuracy candidates The image reading apparatus according to claim 1, wherein:
検査対象のグループを、前記第二の方向において前記最も原稿台の中央寄りのグループから端寄りのグループへ、順次切り替えるようにして設定する検査対象切替設定手段と、
前記検査対象切替設定手段により検査対象のグループが切り替えられる方向において、前記検査対象切替設定手段により現在設定されている検査対象のグループに隣接するグループが存在するか否かを、前記第二の方向に平行な一次元空間上で評価して判定する第一判定手段と、
前記第一判定手段により前記隣接するグループが存在すると判定されると、前記検査対象のグループに属する前記候補であって最も前記隣接するグループ寄りの前記候補と、前記隣接するグループに属する前記候補であって最も前記検査対象のグループ寄りの前記候補と、の前記第一の方向の乖離度を算出する乖離度算出手段と、
前記乖離度算出手段により算出された乖離度が閾値未満であるか否かを判定する第二判定手段と、
を備え、前記第一判定手段により前記隣接するグループが存在しないと判定されるか、前記第二判定手段により前記乖離度が閾値以上であると判定されると、その時点までに検査対象のグループに設定されなかった前記第二の方向において原稿台の端側に位置するグループの全てを、前記第二の方向において最も原稿台の中央寄りのグループとは不連続なグループであるとみなして、当該不連続なグループに属する前記候補の全てを、破棄する構成にされていること
を特徴とする請求項2記載の画像読取装置。 The detection means includes
Inspection object switching setting means for setting the inspection target group so as to sequentially switch from the group closest to the center of the document table to the group closest to the edge in the second direction;
In the direction in which the inspection target group is switched by the inspection target switching setting unit, whether or not there is a group adjacent to the inspection target group currently set by the inspection target switching setting unit is determined in the second direction. First determination means for evaluation and determination in a one-dimensional space parallel to
When the first determination unit determines that the adjacent group exists, the candidate belonging to the group to be inspected and closest to the adjacent group and the candidate belonging to the adjacent group A deviation degree calculating means for calculating a deviation degree in the first direction of the candidate closest to the group to be inspected;
Second determination means for determining whether or not the deviation degree calculated by the deviation degree calculation means is less than a threshold;
And when the first determination means determines that the adjacent group does not exist or the second determination means determines that the degree of divergence is equal to or greater than a threshold, the group to be inspected up to that point All of the groups located on the edge side of the document table in the second direction that are not set to be considered as discontinuous groups from the group closest to the center of the document table in the second direction, The image reading apparatus according to claim 2, wherein all of the candidates belonging to the discontinuous group are configured to be discarded.
検査対象のグループを、前記第二の方向に、順次切り替えるようにして設定する検査対象切替設定手段と、
前記検査対象切替設定手段により検査対象のグループが切り替えられる方向において、前記検査対象切替設定手段により現在設定されている検査対象のグループに隣接するグループが存在するか否かを、前記第二の方向に平行な一次元空間上で評価して判定する第一判定手段と、
前記第一判定手段により前記隣接するグループが存在すると判定されると、前記検査対象のグループに属する前記候補であって最も前記隣接するグループ寄りの前記候補と、前記隣接するグループに属する前記候補であって最も前記検査対象のグループ寄りの前記候補と、の前記第一の方向の乖離度を算出する乖離度算出手段と、
前記乖離度算出手段により算出された乖離度が閾値未満であるか否かを判定する第二判定手段と、
を備え、前記第一判定手段により前記隣接するグループが存在すると判定され且つ前記第二判定手段により前記乖離度が閾値未満であると判定された前記検査対象のグループについては、そのグループと、当該グループの次に前記検査対象のグループに設定される前記隣接するグループとが連続していると評価し、前記第一判定手段により前記隣接するグループが存在しないと判定されるか、前記第二判定手段により前記乖離度が閾値以上であると判定された前記検査対象のグループについては、そのグループと、当該グループの次に前記検査対象のグループに設定されるグループが連続していないと評価して、前記最も長く連続するグループの集合を検出することを特徴とする請求項4記載の画像読取装置。 The detection means includes
Inspection object switching setting means for setting the inspection object group to sequentially switch in the second direction;
In the direction in which the inspection target group is switched by the inspection target switching setting unit, whether or not there is a group adjacent to the inspection target group currently set by the inspection target switching setting unit is determined in the second direction. First determination means for evaluation and determination in a one-dimensional space parallel to
When the first determination unit determines that the adjacent group exists, the candidate belonging to the group to be inspected and closest to the adjacent group and the candidate belonging to the adjacent group A deviation degree calculating means for calculating a deviation degree in the first direction of the candidate closest to the group to be inspected;
Second determination means for determining whether or not the deviation degree calculated by the deviation degree calculation means is less than a threshold;
The inspection target group determined by the first determination means that the adjacent group is present and the divergence degree is determined by the second determination means to be less than a threshold, and the group After the group, it is evaluated that the adjacent group set as the group to be inspected is continuous, and the first determination unit determines that the adjacent group does not exist, or the second determination With respect to the group to be inspected, which is determined by the means that the degree of divergence is equal to or greater than a threshold value, the group and the group set as the group to be inspected next to the group are evaluated as not consecutive. 5. The image reading apparatus according to claim 4, wherein a set of the longest continuous groups is detected.
前記選択手段により選択された前記所定量の候補を1グループ単位として、各グループの近似直線を算出すると共に、算出した各グループの近似直線の傾き及び切片の情報に基づき、近似直線についてのヒストグラムデータを生成するヒストグラムデータ生成手段
を備え、前記ヒストグラムデータ生成手段により生成された前記ヒストグラムデータに基づき、度数の最も高い近似直線が算出されたグループの集合を、前記確度が高い候補の集合とみなし、当該度数の最も高い近似直線が算出されたグループの集合に属さないグループ、に属する前記候補を、前記確度が低い候補とみなして、当該確度が低い候補を破棄することで、前記特定方向に延びる原稿の端縁を表すエッジ点を検出することを特徴とする請求項1記載の画像読取装置。 The detection means includes
The approximate line for each group is calculated using the predetermined amount of candidates selected by the selection means as a group unit, and the histogram data for the approximate line based on the calculated slope and intercept information for each group. A set of groups for which an approximate straight line with the highest frequency is calculated based on the histogram data generated by the histogram data generation unit is regarded as a set of candidates with high accuracy. The candidate belonging to a group that does not belong to the set of groups for which the approximate straight line with the highest frequency is calculated is regarded as a candidate with low accuracy, and the candidate with low accuracy is discarded, thereby extending in the specific direction. The image reading apparatus according to claim 1, wherein an edge point representing an edge of the document is detected.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008006926A JP4941316B2 (en) | 2008-01-16 | 2008-01-16 | Image reading device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008006926A JP4941316B2 (en) | 2008-01-16 | 2008-01-16 | Image reading device |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2009171217A JP2009171217A (en) | 2009-07-30 |
JP4941316B2 true JP4941316B2 (en) | 2012-05-30 |
Family
ID=40971911
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008006926A Expired - Fee Related JP4941316B2 (en) | 2008-01-16 | 2008-01-16 | Image reading device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4941316B2 (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5766073B2 (en) * | 2011-09-08 | 2015-08-19 | 株式会社Pfu | Image processing apparatus, image processing method, image processing program, and image processing system |
JP6021557B2 (en) * | 2012-09-28 | 2016-11-09 | 株式会社Pfu | Image processing apparatus, image processing system, image processing method, and image processing program |
JP6471423B2 (en) | 2014-08-01 | 2019-02-20 | ブラザー工業株式会社 | Reader and program |
JP6592951B2 (en) * | 2015-04-30 | 2019-10-23 | ブラザー工業株式会社 | Image reading device |
JP6918481B2 (en) | 2016-12-16 | 2021-08-11 | キヤノン株式会社 | Image reader |
JP6918482B2 (en) | 2016-12-16 | 2021-08-11 | キヤノン株式会社 | Image reader |
JP7131415B2 (en) * | 2019-01-31 | 2022-09-06 | 株式会社リコー | TILT DETECTION DEVICE, READING DEVICE, IMAGE PROCESSING DEVICE, AND TILT DETECTION METHOD |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3249605B2 (en) * | 1992-11-25 | 2002-01-21 | イーストマン・コダックジャパン株式会社 | Document edge detection device |
JPH11177775A (en) * | 1997-12-15 | 1999-07-02 | Minolta Co Ltd | Detector for original |
JP3670571B2 (en) * | 2000-10-31 | 2005-07-13 | 株式会社Pfu | Image reading device |
JP4598426B2 (en) * | 2004-03-30 | 2010-12-15 | 富士通株式会社 | Boundary extraction method, program, and apparatus using the same |
JP2007150849A (en) * | 2005-11-29 | 2007-06-14 | Kyocera Mita Corp | Image reader and image forming apparatus |
JP4482898B2 (en) * | 2007-10-26 | 2010-06-16 | 村田機械株式会社 | Image processing apparatus and image reading apparatus |
-
2008
- 2008-01-16 JP JP2008006926A patent/JP4941316B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2009171217A (en) | 2009-07-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4941316B2 (en) | Image reading device | |
JP5205963B2 (en) | Image reading device | |
US8174737B2 (en) | Image reading apparatus | |
US8284463B2 (en) | Image reading apparatus | |
JP4888439B2 (en) | Image reading apparatus and original size determination program | |
JP4687765B2 (en) | Image reading device | |
JP4952576B2 (en) | Image reading device | |
US8115953B2 (en) | Image forming apparatus and information processing method | |
JP5585552B2 (en) | Image reading apparatus and reading control program | |
JP4924416B2 (en) | Image reading device | |
JP4858437B2 (en) | Image reading device | |
JP2021128356A (en) | Information processing equipment and programs | |
CN107925709B (en) | Image reading apparatus and image forming apparatus | |
JP4941317B2 (en) | Image reading device | |
JP4924417B2 (en) | Image analysis device | |
JP7482625B2 (en) | IMAGE PROCESSING APPARATUS, CONTROL METHOD FOR IMAGE PROCESSING APPARATUS, AND PROGRAM | |
JP4998257B2 (en) | Image reading device | |
JP2016010094A (en) | Image reading apparatus | |
JP4952575B2 (en) | Image reading device | |
US20090310991A1 (en) | Image forming apparatus, image forming system, computer readable medium storing program and image forming method | |
JP2005268906A (en) | Image-forming device, method, and program | |
JP5765169B2 (en) | Image processing apparatus, image reading apparatus, and image processing program | |
JP2018148445A (en) | Image reading apparatus, image reading system, and image reading program | |
JP2006340103A (en) | Image processor, image processing method, and program | |
JP6606957B2 (en) | Copy machine and control program |
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: 20110628 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20110726 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20110926 |
|
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: 20120131 |
|
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: 20120213 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 4941316 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: 20150309 Year of fee payment: 3 |
|
LAPS | Cancellation because of no payment of annual fees |