JP6848290B2 - Image forming device and program - Google Patents

Image forming device and program Download PDF

Info

Publication number
JP6848290B2
JP6848290B2 JP2016183040A JP2016183040A JP6848290B2 JP 6848290 B2 JP6848290 B2 JP 6848290B2 JP 2016183040 A JP2016183040 A JP 2016183040A JP 2016183040 A JP2016183040 A JP 2016183040A JP 6848290 B2 JP6848290 B2 JP 6848290B2
Authority
JP
Japan
Prior art keywords
region
manuscript
area
peak
document
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.)
Active
Application number
JP2016183040A
Other languages
Japanese (ja)
Other versions
JP2018050114A (en
Inventor
羽場 健矢
健矢 羽場
卓也 川野
卓也 川野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Konica Minolta Inc
Original Assignee
Konica Minolta Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Konica Minolta Inc filed Critical Konica Minolta Inc
Priority to JP2016183040A priority Critical patent/JP6848290B2/en
Publication of JP2018050114A publication Critical patent/JP2018050114A/en
Application granted granted Critical
Publication of JP6848290B2 publication Critical patent/JP6848290B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Description

本発明は、MFP(マルチ・ファンクション・ペリフェラル(Multi-Functional Peripheral))などの画像形成装置およびそれに関連する技術に関する。 The present invention relates to an image forming apparatus such as an MFP (Multi-Functional Peripheral) and related techniques.

原稿台に載置された原稿に関するスキャン画像において、原稿が存在する領域(原稿領域)と原稿が存在しない領域(原稿外領域)とを判別し、スキャン画像から原稿外領域を消去する技術が存在する。 There is a technique for discriminating between an area where a document exists (a document area) and an area where a document does not exist (an area outside the document) in a scanned image of a document placed on a platen, and erasing the area outside the document from the scanned image. To do.

たとえば、特許文献1に記載の技術では、スキャン画像全体の複数の画素の画素値の度数分布が生成され、当該度数分布において、原稿領域のエッジ候補を抽出するための閾値が算出される。そして、スキャン画像全体に関して算出された当該閾値に基づいて、原稿領域と原稿外領域とが判別される。原稿領域と原稿外領域とが判別されると、当該原稿外領域がスキャン画像から消去される。 For example, in the technique described in Patent Document 1, a frequency distribution of pixel values of a plurality of pixels in the entire scanned image is generated, and a threshold value for extracting edge candidates in a document region is calculated in the frequency distribution. Then, the original area and the outer area of the original are discriminated based on the threshold value calculated for the entire scanned image. When the document area and the document area are determined, the document area is deleted from the scanned image.

特開2003−60878号公報Japanese Unexamined Patent Publication No. 2003-60878

しかしながら、たとえば特許文献1に記載の技術のような判別手法(原稿領域と原稿外領域とを判別するための手法)が用いられる場合、生成されたスキャン画像において原稿領域と原稿外領域とが常に正確に判別されるとは限らない。 However, when a discrimination method (a method for discriminating between the original region and the outer region of the original) such as the technique described in Patent Document 1 is used, the original region and the outer region of the original are always separated in the generated scanned image. It is not always accurately determined.

たとえば、原稿カバーの開閉状態によっては、特許文献1に記載の技術のような判別手法を用いた場合、生成されたスキャン画像において原稿領域と原稿外領域とを正確に判別することができないことがある。 For example, depending on the open / closed state of the document cover, when a discrimination method such as the technique described in Patent Document 1 is used, it may not be possible to accurately distinguish between the document area and the area outside the document in the generated scanned image. is there.

原稿台の原稿載置用ガラス面の下部には、光を出射する光源と光を検知する受光部との双方が配置されている。そして、原稿台に載置された原稿に対するスキャン処理が実行されると、光源から光が出射され、光源から出射されて原稿載置用ガラス面を透過した光のうち原稿台上の原稿に当たって反射した光は、原稿載置用ガラス面を再び透過して受光部によって検知される。 Both a light source that emits light and a light receiving unit that detects light are arranged below the glass surface for placing a document on the platen. Then, when the scanning process for the document placed on the platen is executed, light is emitted from the light source, and the light emitted from the light source and transmitted through the glass surface for placing the document hits the document on the platen and is reflected. The generated light passes through the glass surface for placing the document again and is detected by the light receiving unit.

ここにおいて、スキャン処理の実行に際して原稿カバーが全開状態(たとえば原稿カバーが原稿台に対して直交する程度に開放された状態)である場合には、光源から出射されて原稿載置用ガラス面を透過した光のうち原稿台上の原稿に当たらなかった光は、受光部に入射せず、当該受光部によって検知されない。 Here, when the document cover is fully opened (for example, the document cover is opened to the extent that it is orthogonal to the platen) when the scanning process is executed, the document cover is emitted from the light source to cover the glass surface for placing the document. Of the transmitted light, the light that does not hit the document on the platen does not enter the light receiving unit and is not detected by the light receiving unit.

この場合、原稿に関するスキャン画像(図5参照)においては、原稿領域内の画素の画素値は比較的大きく(明るく)、原稿外領域の画素の画素値は比較的小さい(暗い)。そして、このようなスキャン画像に関して、特許文献1に記載の技術を用いて生成された度数分布(スキャン画像全体の各画素の画素値に関する度数分布)においては、図6に示されるように、比較的大きい輝度値を有するピークと比較的小さい輝度値を有するピークとの2つのピークが形成される。当該度数分布において、左側のピークは、原稿外領域に対応するピークであり、右側のピークは、原稿領域に対応するピークである。そして、たとえば原稿外領域に対応するピーク(左側のピーク)を形成する曲線の裾野部分の特定の位置(画素値)に、原稿領域のエッジ候補を抽出するための閾値が設定される。 In this case, in the scanned image of the document (see FIG. 5), the pixel values of the pixels in the document area are relatively large (bright), and the pixel values of the pixels in the area outside the document are relatively small (dark). Then, with respect to such a scanned image, in the frequency distribution (frequency distribution relating to the pixel value of each pixel of the entire scanned image) generated by using the technique described in Patent Document 1, as shown in FIG. 6, comparison is made. Two peaks are formed, a peak having a targetly large brightness value and a peak having a relatively small brightness value. In the frequency distribution, the peak on the left side is the peak corresponding to the outside document region, and the peak on the right side is the peak corresponding to the document region. Then, for example, a threshold value for extracting edge candidates of the document region is set at a specific position (pixel value) of the base portion of the curve forming the peak corresponding to the region outside the document (peak on the left side).

このように、原稿カバーが全開状態である場合には、当該スキャン画像全体に関する度数分布において2つのピークが形成され、正確な閾値が算出される。その結果、スキャン画像においては、原稿領域と原稿外領域とが正確に判別される。 As described above, when the document cover is fully opened, two peaks are formed in the frequency distribution for the entire scanned image, and an accurate threshold value is calculated. As a result, in the scanned image, the original area and the outer area of the original are accurately discriminated.

ただし、スキャン処理の実行に際して原稿カバーが半開き状態(全開状態に対して半分程度閉じられた状態)である場合には、当該スキャン画像全体に関する閾値を正確に算出することができないことがある。 However, when the document cover is half-opened (about half-closed with respect to the fully-opened state) when the scanning process is executed, it may not be possible to accurately calculate the threshold value for the entire scanned image.

具体的には、図11のように原稿カバーが半開き状態である場合、光源から出射されて原稿載置用ガラス面を透過した光のうち原稿台上の原稿に当たらなかった光は原稿カバーの反射板に当たり、反射光の一部が原稿載置用ガラス面を再び透過して受光部に入射する。この場合、原稿台の一方側(たとえば奥行方向の奥側(原稿カバーのヒンジに近い側))に比較的多くの反射光が入射し、他方側(手前側)には反射光はほとんど入射しない。そのため、原稿に関するスキャン画像においては、たとえば図12のように、当該奥側(比較的多くの反射光の入射が検知された部分)の画素値が比較的大きく(明るく)、主走査方向の位置が当該奥側から手前側へと向かうにつれて画素値が徐々に減少する(暗くなる)グラデーションが生じてしまう。 Specifically, when the document cover is in the half-open state as shown in FIG. 11, the light emitted from the light source and transmitted through the glass surface for placing the document, which does not hit the document on the document table, is the light of the document cover. When it hits the reflector, a part of the reflected light passes through the glass surface for placing the document again and is incident on the light receiving portion. In this case, a relatively large amount of reflected light is incident on one side of the platen (for example, the back side in the depth direction (the side close to the hinge of the document cover)), and almost no reflected light is incident on the other side (front side). .. Therefore, in the scanned image of the original, for example, as shown in FIG. 12, the pixel value on the back side (the portion where the incident of a relatively large amount of reflected light is detected) is relatively large (bright), and the position in the main scanning direction. However, a gradation is generated in which the pixel value gradually decreases (darkens) as the image moves from the back side to the front side.

スキャン画像がこのようなグラデーションを有する場合、スキャン画像全体に関する度数分布においては、原稿外領域の画素のうち、比較的多くの反射光が入射した部分の画素の画素値が比較的大きいことに起因して、図13のように、原稿領域に対応するピークと原稿外領域に対応するピークとの2つのピークが形成されない(単一のピークしか形成されない)。当該単一のピークを有する度数分布においては、原稿領域のエッジ候補を抽出するための閾値として設定すべき位置(画素値)を特定することは困難である。また、仮に暫定的な位置に閾値が設定される場合、スキャン画像において、原稿領域と原稿外領域とが正確に判別されない。たとえば、単一のピークにおける左側の裾野部分に閾値が暫定的に設定された場合(図13参照)、原稿領域と原稿外領域との双方の画素が当該単一のピークに混在することによって、スキャン画像においては、図23に示されるように、原稿領域と原稿外領域とが正確に判別されない。 When the scanned image has such a gradation, in the frequency distribution for the entire scanned image, it is caused by the fact that the pixel value of the pixel in the portion where a relatively large amount of reflected light is incident is relatively large among the pixels in the region outside the document. As shown in FIG. 13, two peaks, a peak corresponding to the document region and a peak corresponding to the outside region, are not formed (only a single peak is formed). In the frequency distribution having the single peak, it is difficult to specify the position (pixel value) to be set as the threshold value for extracting the edge candidate of the document region. Further, if the threshold value is set at a provisional position, the original area and the outer area of the original cannot be accurately discriminated in the scanned image. For example, when a threshold is tentatively set at the left foot of a single peak (see FIG. 13), both pixels in the manuscript area and the out-of-manuscript area are mixed in the single peak. In the scanned image, as shown in FIG. 23, the original area and the outer area of the original are not accurately discriminated.

このように、原稿カバーの開閉状態によっては、特許文献1に記載の技術のような判別手法を用いた場合、スキャン画像において原稿領域と原稿外領域とを正確に判別することができないことがある。 As described above, depending on the open / closed state of the document cover, it may not be possible to accurately distinguish between the document area and the area outside the document in the scanned image when the discrimination method such as the technique described in Patent Document 1 is used. ..

また、その他の状況においても、特許文献1に記載の技術のような判別手法を用いた場合に、スキャン画像において原稿領域と原稿外領域とを正確に判別することができないことがある。すなわち、原稿領域と原稿外領域とを判別するための手法として特定の判別手法が常に用いられる場合、スキャン画像において原稿領域と原稿外領域とを正確に判別することができないことがある。 Further, even in other situations, when a discrimination method such as the technique described in Patent Document 1 is used, it may not be possible to accurately discriminate between the original region and the non-manuscript region in the scanned image. That is, when a specific discrimination method is always used as a method for discriminating between the original region and the outer region of the original, it may not be possible to accurately discriminate between the original region and the outer region of the original in the scanned image.

そこで、本願発明は、原稿台に載置された原稿に関するスキャン画像において、原稿領域と原稿外領域とをより正確に判別することが可能な技術を提供することを課題とする。 Therefore, an object of the present invention is to provide a technique capable of more accurately discriminating between a document area and an area outside the document in a scanned image of a document placed on a platen.

上記課題を解決すべく、請求項1の発明は、画像処理装置であって、原稿台に載置された原稿に関するスキャン画像内の複数の画素の画素値の分布状況を分析する分析手段と、前記分析手段による分析結果に基づいて、画像内にて前記原稿が存在する領域である原稿領域と前記原稿が存在しない領域である原稿外領域とを判別するための複数の判別手法の中から、前記スキャン画像に最も適した手法である最適手法を決定し、決定された最適手法を用いて、前記原稿領域と前記原稿外領域とを判別する領域判別手段と、を備え、前記複数の判別手法は、第1判別手法と第3判別手法とを含み、前記第1判別手法は、前記スキャン画像の全体における複数の画素の画素値に関する度数分布に存在する複数のピークのうち、そのピーク位置の画素値が最も小さなピークを、前記原稿外領域に対応するピークである原稿外領域ピークとして判定し、残余のピークを、前記原稿領域に対応するピークである原稿領域ピークとして判定するとともに、前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法であり、前記第3判別手法は、前記スキャン画像を縦方向と横方向とのうちの一の方向に区分して複数の分割領域に分割するとともに、分割領域ごとの度数分布であってその分割領域内の複数の画素の画素値に関する度数分布に存在する複数のピークのうち前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を分割領域ごとの閾値とし、分割領域ごとの当該閾値に基づいて前記原稿領域と前記原稿外領域とを分割領域ごとに判別する手法であり、前記分析手段は、前記スキャン画像内の複数の画素の画素値の空間分布状況に基づいて、前記スキャン画像全体に所定程度以上のグラデーションが存在するか否かを判定し、前記領域判別手段は、前記スキャン画像全体における前記所定程度以上のグラデーションが存在することを条件として、前記第3判別手法を前記最適手法として決定し、前記スキャン画像全体における前記所定程度以上のグラデーションが存在しないことを条件として、前記第1判別手法を前記最適手法として決定することを特徴とする。 In order to solve the above problems, the invention of claim 1 is an image processing apparatus, which comprises an analysis means for analyzing the distribution of pixel values of a plurality of pixels in a scanned image of a document placed on a platen. Based on the analysis result by the analysis means, from among a plurality of discrimination methods for discriminating between the manuscript area, which is the region where the manuscript exists in the image, and the extra-manuscript region, which is the region where the manuscript does not exist. The plurality of discrimination methods are provided with an area discriminating means for determining an optimum method which is the most suitable method for the scanned image and discriminating between the original area and the non-manuscript area by using the determined optimum method. Includes a first discrimination method and a third discrimination method, and the first discrimination method is a method of determining the peak position of a plurality of peaks existing in a frequency distribution relating to pixel values of a plurality of pixels in the entire scanned image. The peak having the smallest pixel value is determined as the peak outside the original region, which is the peak corresponding to the outer region of the original, and the remaining peak is determined as the peak in the original region, which is the peak corresponding to the outer region of the original. A value between the pixel value of the outer region peak and the pixel value of the original document region peak is set as a threshold value, and the original document region and the outer document region are discriminated based on the threshold value. , The scanned image is divided into one of the vertical direction and the horizontal direction and divided into a plurality of divided areas, and the frequency distribution for each divided area is the pixel value of a plurality of pixels in the divided area. Of the plurality of peaks existing in the frequency distribution with respect to, the value between the pixel value of the out-of-manuscript region peak and the pixel value of the manuscript region peak is set as the threshold value for each division region, and the threshold value for each division region is used as the threshold value. This is a method of discriminating between the original area and the outer area of the original for each divided area, and the analysis means determines the entire scanned image to a predetermined degree based on the spatial distribution of the pixel values of a plurality of pixels in the scanned image. It is determined whether or not the above gradation exists, and the area determination means determines the third determination method as the optimum method on condition that the gradation of the predetermined degree or more exists in the entire scanned image. The first discriminating method is determined as the optimum method on condition that there is no gradation of the predetermined degree or more in the entire scanned image.

請求項2の発明は、請求項1の発明に係る画像処理装置において、前記分析手段は、前記スキャン画像に前記所定程度以上のグラデーションが存在する場合、前記空間分布状況に基づいて、前記所定程度以上のグラデーションの変化方向をさらに判定し、前記領域判別手段は、前記スキャン画像全体における前記所定程度以上のグラデーションが存在し且つ前記変化方向が前記スキャン画像における縦方向と横方向とのいずれかである旨が判定されることを条件として、前記第3判別手法を前記最適手法として決定するとともに、前記所定程度以上のグラデーションの前記変化方向を前記第3判別手法における前記一の方向として決定することを特徴とする。 The invention of claim 2 is the image processing apparatus according to the invention of claim 1, wherein when the scanned image has a gradation of the predetermined degree or more, the analysis means has the predetermined degree based on the spatial distribution situation. Further determining the change direction of the above gradation, the area determination means has a gradation of a predetermined degree or more in the entire scanned image and the change direction is either the vertical direction or the horizontal direction in the scanned image. On condition that it is determined that there is, the third discrimination method is determined as the optimum method, and the change direction of the gradation of a predetermined degree or more is determined as the one direction in the third discrimination method. It is characterized by.

請求項3の発明は、請求項2の発明に係る画像処理装置において、前記複数の判別手法は、第4判別手法をも含み、前記第4判別手法は、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法とのいずれかであり、前記領域判別手段は、前記スキャン画像全体における前記所定程度以上のグラデーションが存在し且つ前記変化方向が前記スキャン画像における斜め方向である旨が判定されることを条件として、前記第4判別手法を前記最適手法として決定することを特徴とする。 The invention of claim 3 is the image processing apparatus according to the invention of claim 2, wherein the plurality of discrimination methods also include a fourth discrimination method, and the fourth discrimination method is provisional with respect to the scanned image. Edge candidates in the manuscript area are extracted by performing binarization processing and edge extraction processing based on a threshold value, and the manuscript area and the outside manuscript area are discriminated based on the positions of four orthogonal points where the edge candidates are orthogonal to each other. When it is determined that at least one of the four orthogonal points is not detected, the four points are based on the positional relationship and the geometrical relationship of the detection positions of the remaining orthogonal points. The positions of at least one orthogonal point are estimated so that the closed region formed by connecting the orthogonal points of the above points with a straight line has a rectangular shape, the closed region is determined as the document region, and other than the closed region. The edge candidate of the document area is extracted by performing the method of discriminating the area as the outside area of the document and the binarization process and the edge extraction process based on a provisional threshold on the scanned image, and the extracted edge. Among the candidates, a straight line portion having a length equal to or longer than a predetermined value is specified as a regular edge portion of the document region, and a portion other than the straight line portion is specified as a false detection portion, and complement processing based on the regular edge portion is performed. Is performed to correct the erroneous detection portion, the closed region formed by the corrected edge candidate is determined as the document region, and the region other than the closed region is determined as the outside region. The fourth determination means, provided that the region determination means has a gradation of a predetermined degree or more in the entire scanned image and it is determined that the change direction is an oblique direction in the scanned image. The method is determined as the optimum method.

請求項4の発明は、画像処理装置であって、原稿台に載置された原稿に関するスキャン画像内の複数の画素の画素値の分布状況を分析する分析手段と、前記分析手段による分析結果に基づいて、画像内にて前記原稿が存在する領域である原稿領域と前記原稿が存在しない領域である原稿外領域とを判別するための複数の判別手法の中から、前記スキャン画像に最も適した手法である最適手法を決定し、決定された最適手法を用いて、前記原稿領域と前記原稿外領域とを判別する領域判別手段と、を備え、前記複数の判別手法は、第1判別手法と第3判別手法とを含み、前記第1判別手法は、前記スキャン画像の全体における複数の画素の画素値に関する度数分布に存在する複数のピークのうち、そのピーク位置の画素値が最も小さなピークを、前記原稿外領域に対応するピークである原稿外領域ピークとして推定し、残余のピークを、前記原稿領域に対応するピークである原稿領域ピークとして推定するとともに、前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法であり、前記第3判別手法は、前記スキャン画像を縦方向と横方向とのうちの一の方向に区分して複数の分割領域に分割するとともに、分割領域ごとの度数分布であってその分割領域内の複数の画素の画素値に関する度数分布に存在する複数のピークのうち前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を分割領域ごとの閾値とし、分割領域ごとの当該閾値に基づいて前記原稿領域と前記原稿外領域とを分割領域ごとに判別する手法であり、前記分析手段は、前記スキャン画像の全体における複数の画素の画素値に関する度数分布において、前記原稿外領域ピークと前記原稿領域ピークとの距離が一定程度よりも大きいか否かを判定し、前記領域判別手段は、前記度数分布において、前記原稿外領域ピークと前記原稿領域ピークとの距離が前記一定程度よりも大きい旨が判定されることを条件として、前記第1判別手法を前記最適手法として決定し、前記分析手段は、前記スキャン画像内の複数の画素の画素値の空間分布状況に基づいて、前記スキャン画像全体に所定程度以上のグラデーションが存在するか否かを判定し、前記領域判別手段は、前記スキャン画像全体における前記所定程度以上のグラデーションが存在することを条件として、前記第3判別手法を前記最適手法として決定することを特徴とする。 The invention of claim 4 is an image processing apparatus, which comprises an analysis means for analyzing the distribution of pixel values of a plurality of pixels in a scanned image of a document placed on a platen, and an analysis result by the analysis means. Based on this, the most suitable for the scanned image is among a plurality of discrimination methods for discriminating between a document area in which the document exists and an area outside the document in which the document does not exist in the image. The optimum method, which is a method, is determined, and the determined optimum method is used to provide an area discriminating means for discriminating between the manuscript area and the non-manuscript area. Including the third discrimination method, the first discrimination method selects the peak having the smallest pixel value at the peak position among a plurality of peaks existing in the frequency distribution regarding the pixel values of the plurality of pixels in the entire scanned image. , Estimate as the peak of the extra-manuscript region, which is the peak corresponding to the extra-manuscript region, and estimate the residual peak as the peak of the manuscript region, which is the peak corresponding to the extra-manuscript region. A method of discriminating between the manuscript area and the extra-manuscript region based on a value between the pixel values of the document region peak as a threshold, and the third discriminating method is a method of discriminating the scanned image in the vertical direction. It is divided into a plurality of divided regions by dividing it into one of the horizontal direction and the horizontal direction, and is a frequency distribution for each divided region and exists in the frequency distribution relating to the pixel values of a plurality of pixels in the divided region. The value between the pixel value of the out-of-manuscript region peak and the pixel value of the out-of-manuscript region peak is set as the threshold value for each division region, and the manuscript region and the out-of-manuscript region are based on the threshold value for each division region. Is a method of discriminating between the two for each divided region, and the analysis means has a constant distance between the out-of-manuscript region peak and the manuscript region peak in the frequency distribution relating to the pixel values of a plurality of pixels in the entire scanned image. The region determination means determines that the distance between the extra-manuscript region peak and the manuscript region peak is larger than a certain degree in the frequency distribution, provided that the region determination means is larger than the above-mentioned constant. The first discrimination method is determined as the optimum method, and the analysis means has a gradation of a predetermined degree or more in the entire scanned image based on the spatial distribution of pixel values of a plurality of pixels in the scanned image. The area determination means has a gradation of a predetermined degree or more in the entire scanned image. Is a condition, and the third discrimination method is determined as the optimum method.

請求項5の発明は、請求項4の発明に係る画像処理装置において、前記複数の判別手法は、第2判別手法をも含み、前記第2判別手法は、スキャン処理における受光素子での受光量を示すアナログ入力値と出力画素値を示すデジタル出力値との間の入出力特性を調整する入出力特性調整処理であって前記入出力特性調整処理前の入出力特性における出力範囲の一部の範囲がより広い出力範囲となるように入出力特性を調整する入出力特性調整処理が施された後に得られる第2スキャン画像の全体における複数の画素の画素値に関する度数分布において、新たに求められる前記原稿外領域ピークの画素値と新たに求められる前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法と、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法とのいずれかであり、前記領域判別手段は、前記原稿外領域ピークと前記原稿領域ピークとの距離が前記一定程度よりも小さい旨が判定されることを条件として前記第2判別手法を前記最適手法として決定することを特徴とする。 The invention of claim 5 is the image processing apparatus according to the invention of claim 4, wherein the plurality of discrimination methods also include a second discrimination method, and the second discrimination method is the amount of light received by the light receiving element in the scanning process. This is an input / output characteristic adjustment process for adjusting the input / output characteristics between the analog input value indicating the output pixel value and the digital output value indicating the output pixel value, and is a part of the output range in the input / output characteristics before the input / output characteristic adjustment process. Adjusting the input / output characteristics so that the range becomes a wider output range Newly required in the frequency distribution regarding the pixel values of a plurality of pixels in the entire second scan image obtained after the input / output characteristic adjustment processing is performed. A method of discriminating between the manuscript area and the out-of-manuscript region based on a value between the pixel value of the out-of-manuscript region peak and the newly obtained pixel value of the manuscript region peak as a threshold, and the above The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold to extract edge candidates of the document area, and the document area is based on the positions of four orthogonal points where the edge candidates are orthogonal to each other. When it is determined that at least one of the four orthogonal points is not detected, the positional relationship and the geometrical relationship of the detection positions of the remaining orthogonal points are determined. Based on the above, the positions of the at least one orthogonal point are estimated so that the closed region formed by connecting the four orthogonal points with a straight line has a rectangular shape, and the closed region is used as the manuscript region. The edge candidate of the document region is subjected to a method of discriminating the region other than the closed region as the outside region of the document, and binarization processing and edge extraction processing based on a provisional threshold value on the scanned image. Is extracted, and among the extracted edge candidates, a straight line portion having a length equal to or longer than a predetermined value is specified as a regular edge portion of the original document region, and a portion other than the straight line portion is specified as a false detection portion. Complementary processing based on the regular edge portion is performed to correct the false detection portion, the closed region formed by the corrected edge candidate is determined as the document region, and the region other than the closed region is the outside region of the document. The second determination means on the condition that it is determined that the distance between the out-of-manuscript region peak and the manuscript region peak is smaller than a certain degree. The method is determined as the optimum method.

請求項6の発明は、請求項4の発明に係る画像処理装置において、前記分析手段は、前記スキャン画像に前記所定程度以上のグラデーションが存在する場合、前記空間分布状況に基づいて、前記所定程度以上のグラデーションの変化方向をさらに判定し、前記領域判別手段は、前記スキャン画像全体における前記所定程度以上のグラデーションが存在し且つ前記変化方向が前記スキャン画像における縦方向と横方向とのいずれかである旨が判定されることを条件として、前記第3判別手法を前記最適手法として決定するとともに、前記所定程度以上のグラデーションの前記変化方向を前記第3判別手法における前記一の方向として決定することを特徴とする。 The invention of claim 6 is the image processing apparatus according to the invention of claim 4, wherein when the scanned image has a gradation of the predetermined degree or more, the analysis means has the predetermined degree based on the spatial distribution situation. Further determining the change direction of the above gradation, the area determination means has a gradation of a predetermined degree or more in the entire scanned image and the change direction is either the vertical direction or the horizontal direction in the scanned image. On condition that it is determined that there is, the third discrimination method is determined as the optimum method, and the change direction of the gradation of a predetermined degree or more is determined as the one direction in the third discrimination method. It is characterized by.

請求項7の発明は、請求項6の発明に係る画像処理装置において、前記複数の判別手法は、第4判別手法をも含み、前記第4判別手法は、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法とのいずれかであり、前記領域判別手段は、前記スキャン画像全体における前記所定程度以上のグラデーションが存在し且つ前記変化方向が前記スキャン画像における斜め方向である旨が判定されることを条件として、前記第4判別手法を前記最適手法として決定することを特徴とする。 The invention of claim 7 is the image processing apparatus according to the invention of claim 6, wherein the plurality of discrimination methods also include a fourth discrimination method, and the fourth discrimination method is provisional with respect to the scanned image. Edge candidates in the manuscript area are extracted by performing binarization processing and edge extraction processing based on a threshold value, and the manuscript area and the outside manuscript area are discriminated based on the positions of four orthogonal points where the edge candidates are orthogonal to each other. When it is determined that at least one of the four orthogonal points is not detected, the four points are based on the positional relationship and the geometrical relationship of the detection positions of the remaining orthogonal points. The positions of at least one orthogonal point are estimated so that the closed region formed by connecting the orthogonal points of the above points with a straight line has a rectangular shape, the closed region is determined as the document region, and other than the closed region. The edge candidate of the document area is extracted by performing the method of discriminating the area as the outside area of the document and the binarization process and the edge extraction process based on a provisional threshold on the scanned image, and the extracted edge. Among the candidates, a straight line portion having a length equal to or longer than a predetermined value is specified as a regular edge portion of the document region, and a portion other than the straight line portion is specified as a false detection portion, and complementary processing based on the regular edge portion is performed. Is performed to correct the erroneous detection portion, the closed region formed by the corrected edge candidate is determined as the document region, and the region other than the closed region is determined as the outside region. The fourth determination means, provided that the region determination means has a gradation of a predetermined degree or more in the entire scanned image and it is determined that the change direction is an oblique direction in the scanned image. The method is determined as the optimum method.

請求項8の発明は、請求項7の発明に係る画像処理装置において、前記複数の判別手法は、第2判別手法をも含み、前記第2判別手法は、スキャン処理における受光素子での受光量を示すアナログ入力値と出力画素値を示すデジタル出力値との間の入出力特性を調整する入出力特性調整処理であって前記入出力特性調整処理前の入出力特性における出力範囲の一部の範囲がより広い出力範囲となるように入出力特性を調整する入出力特性調整処理が施された後に得られる第2スキャン画像の全体における複数の画素の画素値に関する度数分布において、新たに求められる前記原稿外領域ピークの画素値と新たに求められる前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法と、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法とのいずれかであり、前記領域判別手段は、前記原稿外領域ピークと前記原稿領域ピークとの距離が前記一定程度よりも小さい旨が判定されることを条件として前記第2判別手法を前記最適手法として決定することを特徴とする。 The invention of claim 8 is the image processing apparatus according to the invention of claim 7, wherein the plurality of discrimination methods also include a second discrimination method, and the second discrimination method is the amount of light received by the light receiving element in the scanning process. This is an input / output characteristic adjustment process for adjusting the input / output characteristics between the analog input value indicating the output pixel value and the digital output value indicating the output pixel value, and is a part of the output range in the input / output characteristics before the input / output characteristic adjustment process. Adjusting the input / output characteristics so that the range becomes a wider output range Newly required in the frequency distribution regarding the pixel values of a plurality of pixels in the entire second scan image obtained after the input / output characteristic adjustment processing is performed. A method of discriminating between the manuscript area and the out-of-manuscript region based on a value between the pixel value of the out-of-manuscript region peak and the newly obtained pixel value of the out-of-manuscript region peak as a threshold, and the above. The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold to extract edge candidates of the document area, and the document area is based on the positions of four orthogonal points where the edge candidates are orthogonal to each other. When it is determined that at least one of the four orthogonal points is not detected, the positional relationship and the geometrical relationship of the detection positions of the remaining orthogonal points are determined. Based on the above, the positions of the at least one orthogonal point are estimated so that the closed region formed by connecting the four orthogonal points with a straight line has a rectangular shape, and the closed region is used as the manuscript region. The edge candidate of the document region is subjected to a method of discriminating the region other than the closed region as the outside region of the document, and binarization processing and edge extraction processing based on a provisional threshold value on the scanned image. Is extracted, and among the extracted edge candidates, a straight line portion having a length equal to or longer than a predetermined value is specified as a regular edge portion of the original document region, and a portion other than the straight line portion is specified as a false detection portion. Complementary processing based on the regular edge portion is performed to correct the false detection portion, the closed region formed by the corrected edge candidate is determined as the document region, and the region other than the closed region is the outside region of the document. The second determination means on the condition that it is determined that the distance between the out-of-manuscript region peak and the manuscript region peak is smaller than a certain degree. The method is determined as the optimum method.

請求項9の発明は、請求項8の発明に係る画像処理装置において、前記第2判別手法は、前記第4判別手法と同じ手法であることを特徴とする。 The invention of claim 9 is characterized in that, in the image processing apparatus according to the invention of claim 8, the second discrimination method is the same as the fourth discrimination method.

請求項10の発明は、請求項8の発明に係る画像処理装置において、前記第2判別手法は、前記第4判別手法とは異なる手法であることを特徴とする。 The invention of claim 10 is characterized in that, in the image processing apparatus according to the invention of claim 8, the second discrimination method is different from the fourth discrimination method.

請求項11の発明は、画像処理装置であって、原稿台に載置された原稿に関するスキャン画像内の複数の画素の画素値の分布状況を分析する分析手段と、前記分析手段による分析結果に基づいて、画像内にて前記原稿が存在する領域である原稿領域と前記原稿が存在しない領域である原稿外領域とを判別するための複数の判別手法の中から、前記スキャン画像に最も適した手法である最適手法を決定し、決定された最適手法を用いて、前記原稿領域と前記原稿外領域とを判別する領域判別手段と、を備え、前記複数の判別手法は、第3判別手法と第4判別手法とを含み、前記第3判別手法は、前記スキャン画像を縦方向と横方向とのうちの一の方向に区分して複数の分割領域に分割するとともに、分割領域ごとの度数分布であってその分割領域内の複数の画素の画素値に関する度数分布に存在する複数のピークのうち前記原稿外領域に対応するピークである原稿外領域ピークの画素値と前記原稿領域に対応するピークである原稿領域ピークの画素値との間の値を分割領域ごとの閾値とし、分割領域ごとの当該閾値に基づいて前記原稿領域と前記原稿外領域とを分割領域ごとに判別する手法であり、前記第4判別手法は、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法とのいずれかであり、前記分析手段は、前記スキャン画像内の複数の画素の画素値の空間分布状況に基づいて、前記スキャン画像全体に所定程度以上のグラデーションが存在するか否かを判定し、前記スキャン画像に前記所定程度以上のグラデーションが存在する場合、前記空間分布状況に基づいて、前記所定程度以上のグラデーションの変化方向をさらに判定し、前記領域判別手段は、前記スキャン画像全体における前記所定程度以上のグラデーションが存在し且つ前記変化方向が前記スキャン画像における縦方向と横方向とのいずれかである旨が判定されることを条件として、前記第3判別手法を前記最適手法として決定するとともに、前記所定程度以上のグラデーションの前記変化方向を前記第3判別手法における前記一の方向として決定し、前記スキャン画像全体における前記所定程度以上のグラデーションが存在し且つ前記変化方向が前記スキャン画像における斜め方向である旨が判定されることを条件として、前記第4判別手法を前記最適手法として決定することを特徴とする。 The invention of claim 11 is an image processing apparatus, which comprises an analysis means for analyzing the distribution of pixel values of a plurality of pixels in a scanned image of a document placed on a platen, and an analysis result by the analysis means. Based on this, the most suitable for the scanned image is among a plurality of discrimination methods for discriminating between a document area in which the document exists and an area outside the document in which the document does not exist in the image. The optimum method, which is a method, is determined, and the determined optimum method is used to provide an area discriminating means for discriminating between the manuscript area and the non-manuscript area. Including the fourth discrimination method, the third discrimination method divides the scanned image into one of the vertical direction and the horizontal direction, divides the scanned image into a plurality of divided regions, and distributes the frequency for each divided region. Of the plurality of peaks existing in the frequency distribution relating to the pixel values of the plurality of pixels in the divided region, the pixel value of the extra-manuscript region peak, which is the peak corresponding to the extra-manuscript region, and the peak corresponding to the manuscript region. This is a method in which a value between the pixel value of the original document area peak and the pixel value of the original document area peak is set as a threshold value for each divided area, and the original document area and the outer document area are discriminated for each divided area based on the threshold value for each divided area. In the fourth discrimination method, edge candidates in the manuscript region are extracted by performing binarization processing and edge extraction processing based on a provisional threshold on the scanned image, and the edge candidates are orthogonal to each other at four points. When it is determined that at least one of the four orthogonal points is not detected in distinguishing the original region from the outer region based on the position of the points, the remaining orthogonal points are detected. Based on the positional relationship and the geometric relationship of the positions, the positions of the at least one orthogonal point are estimated so that the closed region formed by connecting the four orthogonal points with a straight line has a rectangular shape. , A method of discriminating the closed area as the original area and determining an area other than the closed area as the outer area of the original, and binarization processing and edge extraction processing based on a provisional threshold value for the scanned image. The edge candidates of the manuscript area are extracted, and among the extracted edge candidates, a straight line portion having a length equal to or longer than a predetermined value is specified as a regular edge portion of the manuscript region, and a portion other than the straight line portion is specified. It is specified as a false detection portion, complementary processing based on the regular edge portion is performed to correct the false detection portion, a closed region formed by the corrected edge candidate is determined as the original document region, and the closed region is determined. Other than It is one of the methods of discriminating the region as the region outside the original document, and the analysis means has a predetermined degree or more over the entire scanned image based on the spatial distribution of the pixel values of a plurality of pixels in the scanned image. It is determined whether or not there is a gradation, and if the scanned image has a gradation of the predetermined degree or more, the change direction of the gradation of the predetermined degree or more is further determined based on the spatial distribution situation, and the region. The discriminating means is the first on the condition that it is determined that there is a gradation of a predetermined degree or more in the entire scanned image and the change direction is either the vertical direction or the horizontal direction in the scanned image. The three discrimination methods are determined as the optimum method, and the change direction of the gradation of the predetermined degree or more is determined as the one direction in the third discrimination method, and the gradation of the predetermined degree or more exists in the entire scanned image. Moreover, the fourth determination method is determined as the optimum method on condition that it is determined that the change direction is the oblique direction in the scanned image.

請求項12の発明は、請求項1から請求項11のいずれかの発明に係る画像処理装置において、前記第3判別手法は、前記スキャン画像を縦方向と横方向とのうちの前記一の方向に区分して前記複数の分割領域に分割するとともに、前記複数の分割領域のうちの2以上の分割領域であって各分割領域内の複数の画素の画素値に関する度数分布が2以上のピークを有する2以上の分割領域に関して、それぞれの度数分布に存在する複数のピークのうち、前記2以上の分割領域に関する2以上の度数分布における共通の位置にそのピーク位置を有するピークである共通位置ピークを前記原稿領域ピークとして判定し、前記共通位置ピーク以外のピークである非共通位置ピークのうち特定の非共通位置ピークを前記原稿外領域ピークとして判定するとともに、前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を分割領域ごとの閾値とし、分割領域ごとの当該閾値に基づいて前記原稿領域と前記原稿外領域とを分割領域ごとに判別する手法であることを特徴とする。 The invention of claim 12 is the image processing apparatus according to any one of claims 1 to 11, wherein the third discrimination method uses the scanned image in one of the vertical direction and the horizontal direction. In addition to dividing into the plurality of divided regions, peaks having a frequency distribution of 2 or more with respect to pixel values of a plurality of pixels in each of the divided regions in two or more divided regions are defined as Of the plurality of peaks existing in each frequency distribution with respect to the two or more divided regions having the common position peak, which is a peak having the peak position at the common position in the two or more frequency distributions related to the two or more divided regions. It is determined as the original region peak, and a specific non-common position peak among the non-common position peaks other than the common position peak is determined as the extra-manuscript region peak, and the pixel value of the extra-manuscript region peak and the said A feature of this method is that a value between the pixel value of the peak of the document area is set as a threshold value for each divided area, and the document area and the outside area of the document are discriminated for each divided area based on the threshold value for each divided area. And.

請求項13の発明は、請求項12の発明に係る画像処理装置において、前記第3判別手法において、前記複数の分割領域のうち、その複数の画素の画素値に関する度数分布が2以上のピークを有しない分割領域の閾値は、他の分割領域の閾値に基づいて求められることを特徴とする。 According to a thirteenth aspect of the present invention, in the image processing apparatus according to the twelfth aspect of the present invention, in the third discrimination method, the frequency distribution relating to the pixel values of the plurality of pixels of the plurality of divided regions has a peak of 2 or more. The threshold value of the divided region that does not have is obtained based on the threshold value of the other divided region.

請求項14の発明は、画像処理装置であって、原稿台に載置された原稿に関するスキャン画像内の複数の画素の画素値の分布状況を分析する分析手段と、前記分析手段による分析結果に基づいて、画像内にて前記原稿が存在する領域である原稿領域と前記原稿が存在しない領域である原稿外領域とを判別するための複数の判別手法の中から、前記スキャン画像に最も適した手法である最適手法を決定し、決定された最適手法を用いて、前記原稿領域と前記原稿外領域とを判別する領域判別手段と、を備え、前記複数の判別手法は、第1判別手法と第2判別手法とを含み、前記第1判別手法は、前記スキャン画像の全体における複数の画素の画素値に関する度数分布に存在する複数のピークのうち、そのピーク位置の画素値が最も小さなピークを、前記原稿外領域に対応するピークである原稿外領域ピークとして推定し、残余のピークを、前記原稿領域に対応するピークである原稿領域ピークとして推定するとともに、前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法であり、前記第2判別手法は、スキャン処理における受光素子での受光量を示すアナログ入力値と出力画素値を示すデジタル出力値との間の入出力特性を調整する入出力特性調整処理であって前記入出力特性調整処理前の入出力特性における出力範囲の一部の範囲がより広い出力範囲となるように入出力特性を調整する入出力特性調整処理が施された後に得られる第2スキャン画像の全体における複数の画素の画素値に関する度数分布において、新たに求められる前記原稿外領域ピークの画素値と新たに求められる前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法と、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法とのいずれかであり、前記領域判別手段は、前記スキャン画像の全体における複数の画素の画素値に関する度数分布において、前記原稿外領域ピークと前記原稿領域ピークとの距離が一定程度よりも大きい旨が判定されることを条件として前記第1判別手法を前記最適手法として決定し、前記原稿外領域ピークと前記原稿領域ピークとの距離が前記一定程度よりも小さい旨が判定されることを条件として前記第2判別手法を前記最適手法として決定することを特徴とする。 The invention of claim 14 is an image processing apparatus, which comprises an analysis means for analyzing the distribution of pixel values of a plurality of pixels in a scanned image of a document placed on a platen, and an analysis result by the analysis means. Based on this, the most suitable for the scanned image is among a plurality of discrimination methods for discriminating between a document area in which the document exists and an area outside the document in which the document does not exist in the image. The optimum method, which is a method, is determined, and the determined optimum method is used to provide an area discriminating means for discriminating between the manuscript area and the non-manuscript area. Including the second discrimination method, the first discrimination method selects the peak having the smallest pixel value at the peak position among a plurality of peaks existing in the frequency distribution regarding the pixel values of the plurality of pixels in the entire scanned image. , It is estimated as the peak of the extra-manuscript region, which is the peak corresponding to the extra-manuscript region, and the residual peak is estimated as the peak of the manuscript region, which is the peak corresponding to the extra-manuscript region. A method of discriminating between the manuscript region and the non-manuscript region based on a value between the pixel values of the document region peak as a threshold, and the second discriminating method is a light receiving element in the scanning process. It is an input / output characteristic adjustment process that adjusts the input / output characteristics between the analog input value indicating the amount of light received and the digital output value indicating the output pixel value, and is the output range in the input / output characteristics before the input / output characteristic adjustment process. Adjusting the input / output characteristics so that a part of the range becomes a wider output range New in the frequency distribution regarding the pixel values of multiple pixels in the entire second scan image obtained after the input / output characteristic adjustment processing is performed. A method of discriminating between the manuscript area and the out-of-manuscript region based on a value between the pixel value of the out-of-manuscript region peak obtained in 1 and the newly obtained pixel value of the out-of-manuscript region peak as a threshold value. Then, the scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold to extract edge candidates in the original area, and based on the positions of four orthogonal points where the edge candidates are orthogonal to each other. When it is determined that at least one of the four orthogonal points is not detected in distinguishing the original area from the outer area of the original, the positional relationship between the detection positions of the remaining orthogonal points and the residual orthogonal points. Based on the geometrical relationship, the at least one orthogonal point has a rectangular shape so that the closed region formed by connecting the four orthogonal points with a straight line has a rectangular shape. A method of estimating the position, determining the closed area as the original area, and determining an area other than the closed area as the outer area of the original, and binarization processing based on a provisional threshold value for the scanned image. Edge extraction processing is performed to extract edge candidates of the manuscript area, and among the extracted edge candidates, a straight line portion having a length equal to or longer than a predetermined value is specified as a regular edge portion of the manuscript region, and the straight line portion is specified. A portion other than the false detection portion is specified as a false detection portion, the false detection portion is corrected by performing complementary processing based on the normal edge portion, and a closed region formed by the corrected edge candidate is determined as the original document region. It is one of the methods of discriminating the region other than the closed region as the extra-manuscript region, and the region discriminating means is the extra-manuscript region in the frequency distribution relating to the pixel values of a plurality of pixels in the entire scanned image. The first discrimination method is determined as the optimum method on condition that it is determined that the distance between the peak and the original document area peak is larger than a certain degree, and the distance between the outer document area peak and the original document area peak is determined. Is determined as the optimum method on the condition that it is determined that is smaller than a certain degree.

請求項15の発明は、画像処理装置であって、原稿台に載置された原稿に関するスキャン画像内の複数の画素の画素値の分布状況を分析する分析手段と、前記分析手段による分析結果に基づいて、画像内にて前記原稿が存在する領域である原稿領域と前記原稿が存在しない領域である原稿外領域とを判別するための複数の判別手法の中から、前記スキャン画像に最も適した手法である最適手法を決定し、決定された最適手法を用いて、前記原稿領域と前記原稿外領域とを判別する領域判別手段と、を備え、前記複数の判別手法は、第1判別手法と第4判別手法とを含み、前記第1判別手法は、前記スキャン画像の全体における複数の画素の画素値に関する度数分布に存在する複数のピークのうち、そのピーク位置の画素値が最も小さなピークを、前記原稿外領域に対応するピークである原稿外領域ピークとして判定し、残余のピークを、前記原稿領域に対応するピークである原稿領域ピークとして判定するとともに、前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法であり、前記第4判別手法は、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法とのいずれかであり、前記分析手段は、前記スキャン画像内の複数の画素の画素値の空間分布状況に基づいて、前記スキャン画像全体に所定程度以上のグラデーションが存在するか否かを判定し、前記領域判別手段は、前記スキャン画像全体における前記所定程度以上のグラデーションが存在することを条件として、前記第4判別手法を前記最適手法として決定し、前記スキャン画像全体における前記所定程度以上のグラデーションが存在しないことを条件として、前記第1判別手法を前記最適手法として決定することを特徴とする。 The invention of claim 15 is an image processing apparatus, which comprises an analysis means for analyzing the distribution of pixel values of a plurality of pixels in a scanned image of a document placed on a platen, and an analysis result by the analysis means. Based on this, the most suitable for the scanned image is among a plurality of discrimination methods for discriminating between a document area in which the document exists and an area outside the document in which the document does not exist in the image. The optimum method, which is a method, is determined, and the determined optimum method is used to provide an area discriminating means for discriminating between the manuscript area and the non-manuscript area. Including the fourth discrimination method, the first discrimination method selects the peak having the smallest pixel value at the peak position among a plurality of peaks existing in the frequency distribution relating to the pixel values of the plurality of pixels in the entire scanned image. , It is determined as the peak of the extra-manuscript region, which is the peak corresponding to the extra-manuscript region, and the residual peak is determined as the peak of the original region, which is the peak corresponding to the extra-manuscript region. A method of discriminating between the manuscript region and the extra-manuscript region based on a value between the pixel values of the document region peak as a threshold, and the fourth discriminating method is for the scanned image. Edge candidates in the manuscript area are extracted by performing binarization processing and edge extraction processing based on a provisional threshold, and the manuscript area and the outer manuscript area are based on the positions of four orthogonal points where the edge candidates are orthogonal to each other. When it is determined that at least one of the four orthogonal points is not detected, based on the positional relationship and the geometric relationship of the detection positions of the remaining orthogonal points, The positions of the at least one orthogonal point are estimated so that the closed region formed by connecting the four orthogonal points with a straight line has a rectangular shape, and the closed region is determined as the manuscript region. Edge candidates of the original area are extracted and extracted by performing a method of discriminating an area other than the closed area as the outer area of the original, and performing binarization processing and edge extraction processing based on a provisional threshold on the scanned image. Of the edge candidates, a straight line portion having a length equal to or longer than a predetermined value is specified as a regular edge portion of the document region, and a portion other than the straight line portion is specified as a false detection portion, and the regular edge portion is used. Complementing processing based on the above is performed to correct the false detection portion, a closed region formed by the corrected edge candidate is determined as the original document region, and an region other than the closed region is the original document. It is one of the methods of discriminating as an outer region, and the analysis means has a gradation of a predetermined degree or more in the entire scanned image based on the spatial distribution of the pixel values of a plurality of pixels in the scanned image. The area determination means determines whether or not the fourth determination method is the optimum method on condition that a gradation of a predetermined degree or more is present in the entire scan image, and the region determination means is used in the entire scan image. It is characterized in that the first determination method is determined as the optimum method on condition that a gradation of a predetermined degree or more does not exist.

請求項16の発明は、画像処理装置であって、原稿台に載置された原稿に関するスキャン画像内の複数の画素の画素値の分布状況を分析する分析手段と、前記分析手段による分析結果に基づいて、画像内にて前記原稿が存在する領域である原稿領域と前記原稿が存在しない領域である原稿外領域とを判別するための複数の判別手法の中から、前記スキャン画像に最も適した手法である最適手法を決定し、決定された最適手法を用いて、前記原稿領域と前記原稿外領域とを判別する領域判別手段と、を備え、前記複数の判別手法は、第1判別手法と第4判別手法とを含み、前記第1判別手法は、前記スキャン画像の全体における複数の画素の画素値に関する度数分布に存在する複数のピークのうち、そのピーク位置の画素値が最も小さなピークを、前記原稿外領域に対応するピークである原稿外領域ピークとして推定し、残余のピークを、前記原稿領域に対応するピークである原稿領域ピークとして推定するとともに、前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法であり、前記第4判別手法は、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法とのいずれかであり、前記分析手段は、前記スキャン画像の全体における複数の画素の画素値に関する度数分布において、前記原稿外領域ピークと前記原稿領域ピークとの距離が一定程度よりも大きいか否かを判定し、前記領域判別手段は、前記度数分布において、前記原稿外領域ピークと前記原稿領域ピークとの距離が前記一定程度よりも大きい旨が判定されることを条件として、前記第1判別手法を前記最適手法として決定し、前記分析手段は、前記スキャン画像内の複数の画素の画素値の空間分布状況に基づいて、前記スキャン画像全体に所定程度以上のグラデーションが存在するか否かを判定し、前記領域判別手段は、前記スキャン画像全体における前記所定程度以上のグラデーションが存在することを条件として、前記第4判別手法を前記最適手法として決定することを特徴とする。 The invention of claim 16 is an image processing apparatus, which comprises an analysis means for analyzing the distribution of pixel values of a plurality of pixels in a scanned image of a document placed on a platen, and an analysis result by the analysis means. Based on this, the most suitable for the scanned image is among a plurality of discrimination methods for discriminating between a document area in which the document exists and an area outside the document in which the document does not exist in the image. The optimum method, which is a method, is determined, and the determined optimum method is used to provide an area discriminating means for discriminating between the manuscript area and the non-manuscript area. Including the fourth discrimination method, the first discrimination method selects the peak having the smallest pixel value at the peak position among a plurality of peaks existing in the frequency distribution relating to the pixel values of the plurality of pixels in the entire scanned image. , It is estimated as the peak of the extra-manuscript region, which is the peak corresponding to the extra-manuscript region, and the residual peak is estimated as the peak of the manuscript region, which is the peak corresponding to the extra-manuscript region. A method of discriminating between the manuscript region and the extra-manuscript region based on a value between the pixel values of the document region peak as a threshold, and the fourth discriminating method is for the scanned image. Edge candidates in the manuscript area are extracted by performing binarization processing and edge extraction processing based on a provisional threshold, and the manuscript area and the outer manuscript area are based on the positions of four orthogonal points where the edge candidates are orthogonal to each other. When it is determined that at least one of the four orthogonal points is not detected, based on the positional relationship and the geometric relationship of the detection positions of the remaining orthogonal points, The positions of the at least one orthogonal point are estimated so that the closed region formed by connecting the four orthogonal points with a straight line has a rectangular shape, and the closed region is determined as the manuscript region. Edge candidates of the original area are extracted and extracted by performing a method of discriminating an area other than the closed area as the outer area of the original, and performing binarization processing and edge extraction processing based on a provisional threshold on the scanned image. Of the edge candidates, a straight line portion having a length equal to or longer than a predetermined value is specified as a regular edge portion of the document region, and a portion other than the straight line portion is specified as a false detection portion, and the regular edge portion is used. Complementing processing based on the above is performed to correct the false detection portion, a closed region formed by the corrected edge candidate is determined as the original document region, and an region other than the closed region is the original document. It is one of the methods of discriminating as an outer region, and the analysis means has a constant distance between the outer region peak of the original document and the peak of the original document in the frequency distribution regarding the pixel values of a plurality of pixels in the entire scanned image. It is a condition that the area determination means determines in the frequency distribution that the distance between the extra-manuscript region peak and the manuscript region peak is larger than the certain degree. The first discrimination method is determined as the optimum method, and the analysis means has a gradation of a predetermined degree or more over the entire scanned image based on the spatial distribution of pixel values of a plurality of pixels in the scanned image. The area determination means determines whether or not it exists, and determines the fourth determination method as the optimum method on condition that a gradation of a predetermined degree or more exists in the entire scanned image. To do.

請求項17の発明は、画像処理装置であって、原稿台に載置された原稿に関するスキャン画像内の複数の画素の画素値の分布状況を分析する分析手段と、前記分析手段による分析結果に基づいて、画像内にて前記原稿が存在する領域である原稿領域と前記原稿が存在しない領域である原稿外領域とを判別するための複数の判別手法の中から、前記スキャン画像に最も適した手法である最適手法を決定し、決定された最適手法を用いて、前記原稿領域と前記原稿外領域とを判別する領域判別手段と、を備え、前記複数の判別手法は、第2判別手法と第4判別手法とを含み、前記第2判別手法は、スキャン処理における受光素子での受光量を示すアナログ入力値と出力画素値を示すデジタル出力値との間の入出力特性を調整する入出力特性調整処理であって前記入出力特性調整処理前の入出力特性における出力範囲の一部の範囲がより広い出力範囲となるように入出力特性を調整する入出力特性調整処理が施された後に得られる第2スキャン画像の全体における複数の画素の画素値に関する度数分布において、複数のピークのうち、そのピーク位置の画素値が最も小さなピークを、前記原稿外領域に対応するピークである原稿外領域ピークとして判定し、残余のピークを、前記原稿領域に対応するピークである原稿領域ピークとして判定するとともに、前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法であり、前記第4判別手法は、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法とのいずれかであり、前記分析手段は、前記スキャン画像内の複数の画素の画素値の空間分布状況に基づいて、前記スキャン画像全体に所定程度以上のグラデーションが存在するか否かを判定し、前記領域判別手段は、前記スキャン画像全体における前記所定程度以上のグラデーションが存在することを条件として、前記第4判別手法を前記最適手法として決定し、前記スキャン画像全体における前記所定程度以上のグラデーションが存在しないことを条件として、前記第2判別手法を前記最適手法として決定することを特徴とする。 The invention of claim 17 is an image processing apparatus, which comprises an analysis means for analyzing the distribution of pixel values of a plurality of pixels in a scanned image of a document placed on a platen, and an analysis result by the analysis means. Based on this, the most suitable for the scanned image is among a plurality of discrimination methods for discriminating between a document area in which the document exists and an area outside the document in which the document does not exist in the image. The optimum method, which is a method, is determined, and the determined optimum method is used to provide an area discriminating means for discriminating between the manuscript area and the non-manuscript area. Including the fourth discrimination method, the second discrimination method adjusts the input / output characteristics between the analog input value indicating the amount of light received by the light receiving element in the scanning process and the digital output value indicating the output pixel value. After the input / output characteristic adjustment processing that adjusts the input / output characteristics so that a part of the output range in the input / output characteristics before the input / output characteristic adjustment processing becomes a wider output range in the characteristic adjustment processing In the frequency distribution relating to the pixel values of a plurality of pixels in the entire obtained second scan image, the peak having the smallest pixel value at the peak position among the plurality of peaks is the peak corresponding to the out-of-manuscript region. It is determined as a region peak, the residual peak is determined as the original region peak which is the peak corresponding to the original region, and the value between the pixel value of the extra-manuscript region peak and the pixel value of the original region peak is determined. It is a method of discriminating between the manuscript area and the extra-manuscript area based on the threshold value, and the fourth discriminating method is a binarization process and edge extraction based on a provisional threshold value for the scanned image. In performing the process to extract the edge candidates of the manuscript region and discriminating between the manuscript region and the outer region of the manuscript based on the positions of the four orthogonal points where the edge candidates are orthogonal to each other, the four orthogonal points When it is determined that at least one of the orthogonal points is not detected, the four orthogonal points are connected by a straight line based on the positional relationship and the geometric relationship of the detection positions of the remaining orthogonal points. The positions of the at least one orthogonal point are estimated so that the closed region to be formed has a rectangular shape, the closed region is determined as the document region, and the region other than the closed region is determined as the outside region. The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold value to extract edge candidates in the original area, and the extracted edge candidates are extracted. Then, a straight line portion having a length equal to or longer than a predetermined value is specified as a regular edge portion of the document region, and a portion other than the straight line portion is specified as a false detection portion, and complement processing is performed based on the regular edge portion. It is one of the methods of correcting the erroneous detection portion, determining the closed region formed by the corrected edge candidate as the document region, and determining the region other than the closed region as the outer region of the document. The analysis means determines whether or not there is a gradation of a predetermined degree or more in the entire scan image based on the spatial distribution of the pixel values of the plurality of pixels in the scan image, and the area determination means The fourth discrimination method is determined as the optimum method on the condition that the gradation of the predetermined degree or more exists in the entire scanned image, and the condition that the gradation of the predetermined degree or more does not exist in the entire scanned image. The second discrimination method is determined as the optimum method.

請求項18の発明は、コンピュータに、a)原稿台に載置された原稿に関するスキャン画像内の複数の画素の画素値の分布状況を分析するステップと、b)前記ステップa)における分析結果に基づいて、画像内にて前記原稿が存在する領域である原稿領域と前記原稿が存在しない領域である原稿外領域とを判別するための複数の判別手法の中から、前記スキャン画像に最も適した手法である最適手法を決定するステップと、c)前記ステップb)にて決定された最適手法を用いて、前記原稿領域と前記原稿外領域とを判別するステップと、を実行させるためのプログラムであって、前記複数の判別手法は、第1判別手法と第3判別手法とを含み、前記第1判別手法は、前記スキャン画像の全体における複数の画素の画素値に関する度数分布に存在する複数のピークのうち、そのピーク位置の画素値が最も小さなピークを、前記原稿外領域に対応するピークである原稿外領域ピークとして推定し、残余のピークを、前記原稿領域に対応するピークである原稿領域ピークとして推定するとともに、前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法であり、前記第3判別手法は、前記スキャン画像を縦方向と横方向とのうちの一の方向に区分して複数の分割領域に分割するとともに、分割領域ごとの度数分布であってその分割領域内の複数の画素の画素値に関する度数分布に存在する複数のピークのうち前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を分割領域ごとの閾値とし、分割領域ごとの当該閾値に基づいて前記原稿領域と前記原稿外領域とを分割領域ごとに判別する手法であり、前記ステップa)は、a−1)前記スキャン画像内の複数の画素の画素値の空間分布状況に基づいて、前記スキャン画像全体に所定程度以上のグラデーションが存在するか否かを判定するステップ、を有し、前記ステップb)は、b−1)前記スキャン画像全体における前記所定程度以上のグラデーションが存在することを条件として、前記第3判別手法を前記最適手法として決定するステップと、b−2)前記スキャン画像全体における前記所定程度以上のグラデーションが存在しないことを条件として、前記第1判別手法を前記最適手法として決定するステップと、を有することを特徴とする。 The invention of claim 18 is based on a) a step of analyzing the distribution of pixel values of a plurality of pixels in a scanned image of a document placed on a platen, and b) an analysis result in the step a). Based on this, the most suitable for the scanned image is among a plurality of discrimination methods for discriminating between a document area in which the document exists and an area outside the document in which the document does not exist in the image. A program for executing a step of determining the optimum method, which is a method, and a step of c) discriminating between the manuscript area and the non-manuscript area using the optimum method determined in step b). The plurality of discrimination methods include a first discrimination method and a third discrimination method, and the first discrimination method includes a plurality of discrimination methods existing in a frequency distribution relating to pixel values of a plurality of pixels in the entire scanned image. Of the peaks, the peak with the smallest pixel value at the peak position is estimated as the peak outside the document, which is the peak corresponding to the outside region, and the remaining peak is the peak corresponding to the outside region, which is the original region. In addition to estimating as a peak, a value between the pixel value of the extra-manuscript region peak and the pixel value of the manuscript region peak is used as a threshold, and the manuscript region and the extra-manuscript region are discriminated based on the threshold. In the third discrimination method, the scanned image is divided into one of the vertical direction and the horizontal direction and divided into a plurality of divided regions, and the frequency distribution for each divided region is the divided region. Of the plurality of peaks existing in the frequency distribution relating to the pixel values of the plurality of pixels, the value between the pixel value of the out-of-manuscript region peak and the pixel value of the manuscript region peak is set as the threshold value for each division region, and the division region. It is a method of discriminating the original area and the outer area of the original for each divided area based on the threshold value for each, and the step a) is a-1) the space of the pixel values of a plurality of pixels in the scanned image. A step of determining whether or not a predetermined degree or more of gradation exists in the entire scanned image based on a distribution situation, and the step b) is b-1) the predetermined degree or more in the entire scanned image. The step of determining the third determination method as the optimum method on condition that the above-mentioned gradation is present, and b-2) the first, on condition that there is no gradation of the predetermined degree or more in the entire scanned image. 1 It is characterized by having a step of determining a discrimination method as the optimum method.
請求項19の発明は、請求項18の発明に係るプログラムにおいて、前記ステップa)は、a−2)前記スキャン画像に前記所定程度以上のグラデーションが存在する場合、前記空間分布状況に基づいて、前記所定程度以上のグラデーションの変化方向をさらに判定するステップ、をさらに有し、前記ステップb−1)において、前記スキャン画像全体における前記所定程度以上のグラデーションが存在し且つ前記変化方向が前記スキャン画像における縦方向と横方向とのいずれかである旨が判定されることを条件として、前記第3判別手法が前記最適手法として決定されるとともに、前記所定程度以上のグラデーションの前記変化方向が前記第3判別手法における前記一の方向として決定されることを特徴とする。 According to the invention of claim 19, in the program according to the invention of claim 18, the step a) is a-2) when the scanned image has a gradation of a predetermined degree or more, based on the spatial distribution situation. Further comprising a step of further determining the change direction of the gradation of the predetermined degree or more, and in the step b-1), the gradation of the predetermined degree or more exists in the entire scanned image and the change direction is the scan image. The third discrimination method is determined as the optimum method on condition that it is determined to be either the vertical direction or the horizontal direction in the above, and the change direction of the gradation of a predetermined degree or more is the first. 3 It is characterized in that it is determined as the one direction in the discrimination method.
請求項20の発明は、請求項19の発明に係るプログラムにおいて、前記複数の判別手法は、第4判別手法をも含み、前記第4判別手法は、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法とのいずれかであり、前記ステップb)は、b−3)前記スキャン画像全体における前記所定程度以上のグラデーションが存在し且つ前記変化方向が前記スキャン画像における斜め方向である旨が判定されることを条件として、前記第4判別手法を前記最適手法として決定するステップ、をさらに有することを特徴とする。 The invention of claim 20 is the program according to the invention of claim 19, wherein the plurality of discrimination methods also include a fourth discrimination method, and the fourth discrimination method sets a provisional threshold value for the scanned image. In extracting edge candidates of the manuscript region by performing binarization processing and edge extraction processing based on the above, and discriminating between the manuscript region and the outer region of the manuscript based on the positions of four orthogonal points where the edge candidates are orthogonal to each other. When it is determined that at least one of the four orthogonal points is not detected, the four points are orthogonal based on the positional relationship and the geometrical relationship of the detection positions of the remaining orthogonal points. The positions of the at least one orthogonal point are estimated so that the closed region formed by connecting the points with a straight line has a rectangular shape, the closed region is determined as the document region, and the region other than the closed region is determined. Is extracted as an edge candidate of the document area by performing a method of discriminating as the outside area of the document and a binarization process and an edge extraction process based on a provisional threshold on the scanned image, and the extracted edge candidate Of these, a straight line portion having a length equal to or longer than a predetermined value is specified as a regular edge portion of the document region, and a portion other than the straight line portion is specified as a false detection portion, and complement processing is performed based on the regular edge portion. It is one of the methods of correcting the erroneous detection portion, determining the closed region formed by the corrected edge candidate as the document region, and determining the region other than the closed region as the outside region. The step b) is the first on the condition that it is determined that there is a gradation of a predetermined degree or more in the entire scanned image and the change direction is an oblique direction in the scanned image. 4 It is characterized by further having a step of determining the discrimination method as the optimum method.
請求項21の発明は、コンピュータに、a)原稿台に載置された原稿に関するスキャン画像内の複数の画素の画素値の分布状況を分析するステップと、b)前記ステップa)における分析結果に基づいて、画像内にて前記原稿が存在する領域である原稿領域と前記原稿が存在しない領域である原稿外領域とを判別するための複数の判別手法の中から、前記スキャン画像に最も適した手法である最適手法を決定するステップと、c)前記ステップb)にて決定された最適手法を用いて、前記原稿領域と前記原稿外領域とを判別するステップと、を実行させるためのプログラムであって、前記複数の判別手法は、第1判別手法と第3判別手法とを含み、前記第1判別手法は、前記スキャン画像の全体における複数の画素の画素値に関する度数分布に存在する複数のピークのうち、そのピーク位置の画素値が最も小さなピークを、前記原稿外領域に対応するピークである原稿外領域ピークとして推定し、残余のピークを、前記原稿領域に対応するピークである原稿領域ピークとして推定するとともに、前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法であり、前記第3判別手法は、前記スキャン画像を縦方向と横方向とのうちの一の方向に区分して複数の分割領域に分割するとともに、分割領域ごとの度数分布であってその分割領域内の複数の画素の画素値に関する度数分布に存在する複数のピークのうち前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を分割領域ごとの閾値とし、分割領域ごとの当該閾値に基づいて前記原稿領域と前記原稿外領域とを分割領域ごとに判別する手法であり、前記ステップa)は、a−1)前記スキャン画像の全体における複数の画素の画素値に関する度数分布において、前記原稿外領域ピークと前記原稿領域ピークとの距離が一定程度よりも大きいか否かを判定するステップと、a−2)前記スキャン画像内の複数の画素の画素値の空間分布状況に基づいて、前記スキャン画像全体に所定程度以上のグラデーションが存在するか否かを判定するステップと、を有し、前記ステップb)は、b−1)前記度数分布において、前記原稿外領域ピークと前記原稿領域ピークとの距離が前記一定程度よりも大きい旨が判定されることを条件として、前記第1判別手法を前記最適手法として決定するステップと、b−2)前記スキャン画像全体における前記所定程度以上のグラデーションが存在することを条件として、前記第3判別手法を前記最適手法として決定するステップと、を有することを特徴とする。 The invention of claim 21 is based on a) a step of analyzing the distribution of pixel values of a plurality of pixels in a scanned image of a document placed on a platen, and b) an analysis result in the step a). Based on this, the most suitable for the scanned image is among a plurality of discrimination methods for discriminating between a document area in which the document exists and an area outside the document in which the document does not exist in the image. A program for executing a step of determining the optimum method, which is a method, and a step of c) discriminating between the manuscript area and the non-manuscript area using the optimum method determined in step b). The plurality of discrimination methods include a first discrimination method and a third discrimination method, and the first discrimination method includes a plurality of discrimination methods existing in a frequency distribution relating to pixel values of a plurality of pixels in the entire scanned image. Among the peaks, the peak having the smallest pixel value at the peak position is estimated as the extra-manuscript region peak which is the peak corresponding to the extra-manuscript region, and the remaining peak is the manuscript region which is the peak corresponding to the extra-manuscript region. In addition to estimating as a peak, a value between the pixel value of the extra-manuscript region peak and the pixel value of the manuscript region peak is used as a threshold, and the manuscript region and the extra-manuscript region are discriminated based on the threshold. In the third discrimination method, the scanned image is divided into one of the vertical direction and the horizontal direction and divided into a plurality of divided regions, and the frequency distribution for each divided region is the divided region. Of the plurality of peaks existing in the frequency distribution relating to the pixel values of the plurality of pixels, the value between the pixel value of the out-of-manuscript region peak and the pixel value of the manuscript region peak is set as the threshold value for each division region, and the division region. It is a method of discriminating the original area and the outer area of the original for each divided area based on the threshold value for each, and the step a) relates to a-1) pixel values of a plurality of pixels in the entire scanned image. In the frequency distribution, a step of determining whether or not the distance between the out-of-manuscript region peak and the manuscript region peak is larger than a certain degree, and a-2) spatial distribution of pixel values of a plurality of pixels in the scanned image. Based on the situation, the scan image has a step of determining whether or not there is a gradation of a predetermined degree or more in the entire scanned image, and the step b) is b-1) the extra-manuscript region in the frequency distribution. The first determination method is performed on condition that it is determined that the distance between the peak and the original region peak is larger than the certain degree. It has a step of determining as the optimum method, and b-2) a step of determining the third discrimination method as the optimum method on condition that a gradation of a predetermined degree or more exists in the entire scanned image. It is a feature.
請求項22の発明は、請求項21の発明に係るプログラムにおいて、前記複数の判別手法は、第2判別手法をも含み、前記第2判別手法は、スキャン処理における受光素子での受光量を示すアナログ入力値と出力画素値を示すデジタル出力値との間の入出力特性を調整する入出力特性調整処理であって前記入出力特性調整処理前の入出力特性における出力範囲の一部の範囲がより広い出力範囲となるように入出力特性を調整する入出力特性調整処理が施された後に得られる第2スキャン画像の全体における複数の画素の画素値に関する度数分布において、新たに求められる前記原稿外領域ピークの画素値と新たに求められる前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法と、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法とのいずれかであり、前記ステップb)は、b−3)前記原稿外領域ピークと前記原稿領域ピークとの距離が前記一定程度よりも小さい旨が判定されることを条件として前記第2判別手法を前記最適手法として決定するステップ、をさらに有することを特徴とする。 The invention of claim 22 is the program according to the invention of claim 21, wherein the plurality of discrimination methods also include a second discrimination method, and the second discrimination method indicates the amount of light received by the light receiving element in the scanning process. It is an input / output characteristic adjustment process that adjusts the input / output characteristics between the analog input value and the digital output value indicating the output pixel value, and a part of the output range in the input / output characteristics before the input / output characteristic adjustment process is The manuscript newly obtained in the frequency distribution relating to the pixel values of a plurality of pixels in the entire second scan image obtained after the input / output characteristic adjustment processing for adjusting the input / output characteristics so as to have a wider output range is performed. A method of discriminating between the original region and the outer region of the original based on a value between the pixel value of the peak of the outer region and the newly obtained pixel value of the peak of the original region as a threshold, and the scanned image. The edge candidates of the manuscript area are extracted by performing binarization processing and edge extraction processing based on a provisional threshold value, and the manuscript area and the above are based on the positions of four orthogonal points where the edge candidates are orthogonal to each other. When it is determined that at least one of the four orthogonal points is not detected in distinguishing the area from the outside of the document, the positional relationship and the geometric relationship of the detection positions of the remaining orthogonal points are determined. Based on this, the positions of the at least one orthogonal point are estimated so that the closed region formed by connecting the four orthogonal points with a straight line has a rectangular shape, and the closed region is determined as the manuscript region. Then, an edge candidate of the document area is extracted by performing a method of discriminating the area other than the closed area as the outside area of the document, and performing binarization processing and edge extraction processing based on a provisional threshold value on the scanned image. Then, among the extracted edge candidates, a straight line portion having a length equal to or longer than a predetermined value is specified as a regular edge portion of the original document region, and a portion other than the straight line portion is specified as a false detection portion, and the normal portion is specified. Complementing processing based on the edge portion is performed to correct the false detection portion, the closed region formed by the corrected edge candidate is determined as the original region, and the region other than the closed region is determined as the outer region of the original. In step b), it is determined that the distance between the out-of-manuscript region peak and the manuscript region peak is smaller than a certain level. 2. It is characterized by further having a step of determining the discrimination method as the optimum method.
請求項23の発明は、請求項21の発明に係るプログラムにおいて、前記ステップa)は、a−3)前記スキャン画像に前記所定程度以上のグラデーションが存在する場合、前記空間分布状況に基づいて、前記所定程度以上のグラデーションの変化方向をさらに判定するステップ、をさらに有し、前記ステップb−2)において、前記スキャン画像全体における前記所定程度以上のグラデーションが存在し且つ前記変化方向が前記スキャン画像における縦方向と横方向とのいずれかである旨が判定されることを条件として、前記第3判別手法が前記最適手法として決定されるとともに、前記所定程度以上のグラデーションの前記変化方向が前記第3判別手法における前記一の方向として決定されることを特徴とする。 The invention of claim 23 is based on the spatial distribution situation in the program according to the invention of claim 21, when the step a) is a-3) the scan image has a gradation of a predetermined degree or more. Further comprising a step of further determining the change direction of the gradation of the predetermined degree or more, and in the step b-2), the gradation of the predetermined degree or more exists in the entire scanned image and the change direction is the scanned image. The third discrimination method is determined as the optimum method on condition that it is determined to be either the vertical direction or the horizontal direction in the above, and the change direction of the gradation of a predetermined degree or more is the first. 3 It is characterized in that it is determined as the one direction in the discrimination method.
請求項24の発明は、請求項23の発明に係るプログラムにおいて、前記複数の判別手法は、第4判別手法をも含み、前記第4判別手法は、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法とのいずれかであり、前記ステップb)は、b−4)前記スキャン画像全体における前記所定程度以上のグラデーションが存在し且つ前記変化方向が前記スキャン画像における斜め方向である旨が判定されることを条件として、前記第4判別手法を前記最適手法として決定するステップ、をさらに有することを特徴とする。 The invention of claim 24 is the program according to the invention of claim 23, wherein the plurality of discrimination methods also include a fourth discrimination method, and the fourth discrimination method sets a provisional threshold value for the scanned image. In extracting edge candidates in the manuscript area by performing binarization processing and edge extraction processing based on the above, and discriminating between the manuscript area and the outside manuscript area based on the positions of four orthogonal points where the edge candidates are orthogonal to each other. When it is determined that at least one of the four orthogonal points is not detected, the four points are orthogonal based on the positional relationship and the geometric relationship of the detection positions of the remaining orthogonal points. The positions of the at least one orthogonal point are estimated so that the closed region formed by connecting the points with a straight line has a rectangular shape, the closed region is determined as the document region, and the region other than the closed region is determined. Is extracted as an edge candidate of the document area by performing a method of discriminating as the outside area of the document and a binarization process and an edge extraction process based on a provisional threshold on the scanned image, and the extracted edge candidate Of these, a straight line portion having a length equal to or longer than a predetermined value is specified as a regular edge portion of the document region, and a portion other than the straight line portion is specified as a false detection portion, and complement processing is performed based on the regular edge portion. It is one of the methods of correcting the erroneous detection portion, determining the closed region formed by the corrected edge candidate as the original document region, and determining the region other than the closed region as the outer document region. In step b), the first step is b-4) on condition that it is determined that a gradation of a predetermined degree or more exists in the entire scanned image and the change direction is an oblique direction in the scanned image. 4 It is characterized by further having a step of determining the discrimination method as the optimum method.
請求項25の発明は、請求項24の発明に係るプログラムにおいて、前記複数の判別手法は、第2判別手法をも含み、前記第2判別手法は、スキャン処理における受光素子での受光量を示すアナログ入力値と出力画素値を示すデジタル出力値との間の入出力特性を調整する入出力特性調整処理であって前記入出力特性調整処理前の入出力特性における出力範囲の一部の範囲がより広い出力範囲となるように入出力特性を調整する入出力特性調整処理が施された後に得られる第2スキャン画像の全体における複数の画素の画素値に関する度数分布において、新たに求められる前記原稿外領域ピークの画素値と新たに求められる前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法と、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法とのいずれかであり、前記ステップb)は、b−5)前記原稿外領域ピークと前記原稿領域ピークとの距離が前記一定程度よりも小さい旨が判定されることを条件として前記第2判別手法を前記最適手法として決定するステップ、をさらに有することを特徴とする。 The invention of claim 25 includes the second discrimination method in the program according to the invention of claim 24, and the second discrimination method indicates the amount of light received by the light receiving element in the scanning process. It is an input / output characteristic adjustment process that adjusts the input / output characteristics between the analog input value and the digital output value indicating the output pixel value, and a part of the output range in the input / output characteristics before the input / output characteristic adjustment process is The manuscript newly obtained in the frequency distribution relating to the pixel values of a plurality of pixels in the entire second scan image obtained after the input / output characteristic adjustment processing for adjusting the input / output characteristics so as to have a wider output range is performed. A method of discriminating between the original region and the outer region of the original based on a value between the pixel value of the peak of the outer region and the newly obtained pixel value of the peak of the original region as a threshold, and the scanned image. The edge candidates of the manuscript area are extracted by performing binarization processing and edge extraction processing based on a provisional threshold value, and the manuscript area and the above are based on the positions of four orthogonal points where the edge candidates are orthogonal to each other. When it is determined that at least one of the four orthogonal points is not detected in distinguishing the area from the outside of the document, the positional relationship and the geometric relationship of the detection positions of the remaining orthogonal points are determined. Based on this, the positions of the at least one orthogonal point are estimated so that the closed region formed by connecting the four orthogonal points with a straight line has a rectangular shape, and the closed region is determined as the manuscript region. Then, an edge candidate of the document area is extracted by performing a method of discriminating the area other than the closed area as the outside area of the document, and performing binarization processing and edge extraction processing based on a provisional threshold value on the scanned image. Then, among the extracted edge candidates, a straight line portion having a length equal to or longer than a predetermined value is specified as a regular edge portion of the original document region, and a portion other than the straight line portion is specified as a false detection portion, and the normal portion is specified. Complementing processing based on the edge portion is performed to correct the false detection portion, the closed region formed by the corrected edge candidate is determined as the original region, and the region other than the closed region is determined as the outer region of the original. In step b), it is determined that the distance between the out-of-manuscript region peak and the manuscript region peak is smaller than a certain level. 2. It is characterized by further having a step of determining the discrimination method as the optimum method.
請求項26の発明は、請求項25の発明に係るプログラムにおいて、前記第2判別手法は、前記第4判別手法と同じ手法であることを特徴とする。 The invention of claim 26 is characterized in that, in the program according to the invention of claim 25, the second discrimination method is the same method as the fourth discrimination method.
請求項27の発明は、請求項25の発明に係るプログラムにおいて、前記第2判別手法は、前記第4判別手法とは異なる手法であることを特徴とする。 The invention of claim 27 is characterized in that, in the program according to the invention of claim 25, the second discrimination method is a method different from the fourth discrimination method.
請求項28の発明は、コンピュータに、a)原稿台に載置された原稿に関するスキャン画像内の複数の画素の画素値の分布状況を分析するステップと、b)前記ステップa)における分析結果に基づいて、画像内にて前記原稿が存在する領域である原稿領域と前記原稿が存在しない領域である原稿外領域とを判別するための複数の判別手法の中から、前記スキャン画像に最も適した手法である最適手法を決定するステップと、c)前記ステップb)にて決定された最適手法を用いて、前記原稿領域と前記原稿外領域とを判別するステップと、を実行させるためのプログラムであって、前記複数の判別手法は、第3判別手法と第4判別手法とを含み、前記第3判別手法は、前記スキャン画像を縦方向と横方向とのうちの一の方向に区分して複数の分割領域に分割するとともに、分割領域ごとの度数分布であってその分割領域内の複数の画素の画素値に関する度数分布に存在する複数のピークのうち前記原稿外領域に対応するピークである原稿外領域ピークの画素値と前記原稿領域に対応するピークである原稿領域ピークの画素値との間の値を分割領域ごとの閾値とし、分割領域ごとの当該閾値に基づいて前記原稿領域と前記原稿外領域とを分割領域ごとに判別する手法であり、前記第4判別手法は、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法とのいずれかであり、前記ステップa)は、a−1)前記スキャン画像内の複数の画素の画素値の空間分布状況に基づいて、前記スキャン画像全体に所定程度以上のグラデーションが存在するか否かを判定するステップと、a−2)前記スキャン画像に前記所定程度以上のグラデーションが存在する場合、前記空間分布状況に基づいて、前記所定程度以上のグラデーションの変化方向をさらに判定するステップと、を有し、前記ステップb)は、b−1)前記スキャン画像全体における前記所定程度以上のグラデーションが存在し且つ前記変化方向が前記スキャン画像における縦方向と横方向とのいずれかである旨が判定されることを条件として、前記第3判別手法を前記最適手法として決定するとともに、前記所定程度以上のグラデーションの前記変化方向を前記第3判別手法における前記一の方向として決定するステップと、b−2)前記スキャン画像全体における前記所定程度以上のグラデーションが存在し且つ前記変化方向が前記スキャン画像における斜め方向である旨が判定されることを条件として、前記第4判別手法を前記最適手法として決定するステップと、を有することを特徴とする。 The invention of claim 28 is based on a) a step of analyzing the distribution of pixel values of a plurality of pixels in a scanned image of a document placed on a platen, and b) an analysis result in the step a). Based on this, the most suitable for the scanned image is among a plurality of discrimination methods for discriminating between a document area in which the document exists and an area outside the document in which the document does not exist in the image. A program for executing a step of determining the optimum method, which is a method, and a step of c) discriminating between the manuscript area and the non-manuscript area using the optimum method determined in step b). The plurality of discrimination methods include a third discrimination method and a fourth discrimination method, and the third discrimination method divides the scanned image into one of a vertical direction and a horizontal direction. It is divided into a plurality of divided regions, and is a peak corresponding to the extra-manuscript region among a plurality of peaks existing in the frequency distribution related to the pixel values of a plurality of pixels in the divided region, which is a frequency distribution for each divided region. The value between the pixel value of the peak outside the document area and the pixel value of the peak document area, which is the peak corresponding to the document area, is set as the threshold value for each divided area, and the document area and the document area are based on the threshold value for each divided area. It is a method of discriminating the outer region of the original for each divided region, and the fourth discriminating method performs a binarization process and an edge extraction process based on a provisional threshold value on the scanned image to perform an edge extraction process of the document region. In extracting candidates and discriminating between the manuscript region and the outside-manuscript region based on the positions of the four orthogonal points where the edge candidates are orthogonal to each other, at least one of the four orthogonal points is the orthogonal point. When it is determined that the detection is not detected, the closed region formed by connecting the four orthogonal points with a straight line has a rectangular shape based on the positional relationship and the geometric relationship of the detection positions of the remaining orthogonal points. As described above, a method of estimating the positions of at least one orthogonal point, determining the closed region as the original region, and determining an region other than the closed region as the outer region of the original, and the scanned image. Edge candidates of the manuscript area are extracted by performing binarization processing and edge extraction processing based on a provisional threshold, and among the extracted edge candidates, a straight line portion having a length equal to or longer than a predetermined value is a normal part of the manuscript area. The part other than the straight line part is specified as an erroneous detection part, and the complement processing based on the regular edge part is performed to correct the erroneous detection part, and the corrected d. It is one of the methods of discriminating a closed region formed by a gradation candidate as the manuscript region and discriminating a region other than the closed region as the outer region of the manuscript. Based on the spatial distribution of the pixel values of a plurality of pixels in the scanned image, a step of determining whether or not there is a gradation of a predetermined degree or more in the entire scanned image, and a-2) the predetermined in the scanned image. When there is a gradation of a degree or more, the step b) includes a step of further determining the change direction of the gradation of the predetermined degree or more based on the spatial distribution situation, and the step b) is b-1) the scanned image. The third discrimination method is the optimum method on condition that it is determined that there is a gradation of a predetermined degree or more in the whole and that the change direction is either the vertical direction or the horizontal direction in the scanned image. There are a step of determining the change direction of the gradation of the predetermined degree or more as the one direction in the third discrimination method, and b-2) the gradation of the predetermined degree or more in the entire scanned image. Further, it is characterized by having a step of determining the fourth determination method as the optimum method on condition that it is determined that the change direction is an oblique direction in the scanned image.
請求項29の発明は、請求項18から請求項28のいずれかの発明に係るプログラムにおいて、前記第3判別手法は、前記スキャン画像を縦方向と横方向とのうちの一の方向に区分して複数の分割領域に分割するとともに、前記複数の分割領域のうちの2以上の分割領域であって各分割領域内の複数の画素の画素値に関する度数分布が2以上のピークを有する2以上の分割領域に関して、それぞれの度数分布に存在する複数のピークのうち、前記2以上の分割領域に関する2以上の度数分布における共通の位置にそのピーク位置を有するピークである共通位置ピークを前記原稿領域ピークとして判定し、前記共通位置ピーク以外のピークである非共通位置ピークのうち特定の非共通位置ピークを前記原稿外領域ピークとして判定するとともに、前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を分割領域ごとの閾値とし、分割領域ごとの当該閾値に基づいて前記原稿領域と前記原稿外領域とを分割領域ごとに判別する手法であることを特徴とする。 The invention of claim 29 is a program according to any one of claims 18 to 28, wherein the third discrimination method classifies the scanned image into one of a vertical direction and a horizontal direction. In addition to being divided into a plurality of divided regions, two or more divided regions of the plurality of divided regions having a frequency distribution of two or more peaks with respect to pixel values of a plurality of pixels in each divided region. Regarding the divided region, among the plurality of peaks existing in each frequency distribution, the common position peak which is the peak having the peak position at the common position in the two or more frequency distributions related to the two or more divided regions is the document region peak. Of the non-common position peaks that are peaks other than the common position peak, a specific non-common position peak is determined as the extra-manuscript region peak, and the pixel value of the extra-manuscript region peak and the original document region peak. A value between the pixel value and the pixel value is set as a threshold value for each divided region, and the method is characterized in that the document region and the outer region of the document are discriminated for each divided region based on the threshold value for each divided region.
請求項30の発明は、請求項29の発明に係るプログラムにおいて、前記第3判別手法において、前記複数の分割領域のうち、その複数の画素の画素値に関する度数分布が2以上のピークを有しない分割領域の閾値は、他の分割領域の閾値に基づいて求められることを特徴とする。 According to the invention of claim 30, in the program according to the invention of claim 29, in the third discrimination method, the frequency distribution relating to the pixel values of the plurality of pixels of the plurality of divided regions does not have two or more peaks. The threshold value of the divided region is obtained based on the threshold value of another divided region.
請求項31の発明は、コンピュータに、a)原稿台に載置された原稿に関するスキャン画像内の複数の画素の画素値の分布状況を分析するステップと、b)前記ステップa)における分析結果に基づいて、画像内にて前記原稿が存在する領域である原稿領域と前記原稿が存在しない領域である原稿外領域とを判別するための複数の判別手法の中から、前記スキャン画像に最も適した手法である最適手法を決定するステップと、c)前記ステップb)にて決定された最適手法を用いて、前記原稿領域と前記原稿外領域とを判別するステップと、を実行させるためのプログラムであって、前記複数の判別手法は、第1判別手法と第2判別手法とを含み、前記第1判別手法は、前記スキャン画像の全体における複数の画素の画素値に関する度数分布に存在する複数のピークのうち、そのピーク位置の画素値が最も小さなピークを、前記原稿外領域に対応するピークである原稿外領域ピークとして推定し、残余のピークを、前記原稿領域に対応するピークである原稿領域ピークとして推定するとともに、前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法であり、前記第2判別手法は、スキャン処理における受光素子での受光量を示すアナログ入力値と出力画素値を示すデジタル出力値との間の入出力特性を調整する入出力特性調整処理であって前記入出力特性調整処理前の入出力特性における出力範囲の一部の範囲がより広い出力範囲となるように入出力特性を調整する入出力特性調整処理が施された後に得られる第2スキャン画像の全体における複数の画素の画素値に関する度数分布において、新たに求められる前記原稿外領域ピークの画素値と新たに求められる前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法と、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法とのいずれかであり、前記ステップa)は、a−1)前記スキャン画像の全体における複数の画素の画素値に関する度数分布において、前記原稿外領域ピークと前記原稿領域ピークとの距離が一定程度よりも大きいか否かを判定するステップ、を有し、前記ステップb)は、b−1)前記原稿外領域ピークと前記原稿領域ピークとの距離が前記一定程度よりも大きい旨が判定されることを条件として前記第1判別手法を前記最適手法として決定するステップと、b−2)前記原稿外領域ピークと前記原稿領域ピークとの距離が前記一定程度よりも小さい旨が判定されることを条件として前記第2判別手法を前記最適手法として決定するステップと、を有することを特徴とする。 The invention of claim 31 is based on a) a step of analyzing the distribution of pixel values of a plurality of pixels in a scanned image of a document placed on a platen, and b) an analysis result in the step a). Based on this, the most suitable for the scanned image is among a plurality of discrimination methods for discriminating between a document area in which the document exists and an area outside the document in which the document does not exist in the image. A program for executing a step of determining the optimum method, which is a method, and a step of c) discriminating between the manuscript area and the non-manuscript area using the optimum method determined in step b). The plurality of discrimination methods include a first discrimination method and a second discrimination method, and the first discrimination method includes a plurality of discrimination methods existing in a frequency distribution relating to pixel values of a plurality of pixels in the entire scanned image. Among the peaks, the peak having the smallest pixel value at the peak position is estimated as the extra-manuscript region peak which is the peak corresponding to the extra-manuscript region, and the remaining peak is the manuscript region which is the peak corresponding to the extra-manuscript region. In addition to estimating as a peak, a value between the pixel value of the extra-manuscript region peak and the pixel value of the manuscript region peak is used as a threshold, and the manuscript region and the extra-manuscript region are discriminated based on the threshold. The second discrimination method is an input / output characteristic adjustment process for adjusting an input / output characteristic between an analog input value indicating the amount of light received by the light receiving element and a digital output value indicating an output pixel value in the scan process. The second scan image obtained after the input / output characteristic adjustment process for adjusting the input / output characteristics so that a part of the output range in the input / output characteristics before the input / output characteristic adjustment process becomes a wider output range. In the frequency distribution related to the pixel values of a plurality of pixels in the whole, a value between the newly obtained pixel value of the extra-manuscript region peak and the newly obtained pixel value of the manuscript region peak is set as a threshold value, and the threshold value is used as the threshold value. Based on the method of discriminating between the original area and the outer area of the original, the scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold to extract edge candidates of the original area. In discriminating between the manuscript region and the outer region of the manuscript based on the positions of the four orthogonal points where the edge candidates are orthogonal to each other, it is determined that at least one of the four orthogonal points is not detected. If so, the four orthogonal points are connected by a straight line based on the positional relationship and the geometrical relationship of the detection positions of the remaining orthogonal points. The positions of the at least one orthogonal point are estimated so that the closed region to be formed has a rectangular shape, the closed region is discriminated as the manuscript region, and the region other than the closed region is discriminated as the outer region of the manuscript. The scan image is subjected to binarization processing and edge extraction processing based on a provisional threshold to extract edge candidates in the original area, and the length of the extracted edge candidates is longer than a predetermined value. The straight line portion is specified as a regular edge portion of the original document area, a portion other than the straight line portion is specified as a false detection portion, and complementary processing based on the regular edge portion is performed to correct the false detection portion. Then, one of the methods of discriminating the closed region formed by the corrected edge candidate as the document region and determining the region other than the closed region as the outside region of the document. a-1) In the frequency distribution relating to the pixel values of a plurality of pixels in the entire scanned image, there is a step of determining whether or not the distance between the extra-manuscript region peak and the manuscript region peak is larger than a certain degree. Then, in step b), b-1) the first determination method is the optimum method on condition that it is determined that the distance between the out-of-manuscript region peak and the manuscript region peak is larger than the certain degree. The second determination method is determined as the optimum method on condition that it is determined that the distance between the extra-manuscript region peak and the manuscript region peak is smaller than a certain degree. It is characterized by having a step to perform.
請求項32の発明は、コンピュータに、a)原稿台に載置された原稿に関するスキャン画像内の複数の画素の画素値の分布状況を分析するステップと、b)前記ステップa)における分析結果に基づいて、画像内にて前記原稿が存在する領域である原稿領域と前記原稿が存在しない領域である原稿外領域とを判別するための複数の判別手法の中から、前記スキャン画像に最も適した手法である最適手法を決定するステップと、c)前記ステップb)にて決定された最適手法を用いて、前記原稿領域と前記原稿外領域とを判別するステップと、を実行させるためのプログラムであって、前記複数の判別手法は、第1判別手法と第4判別手法とを含み、前記第1判別手法は、前記スキャン画像の全体における複数の画素の画素値に関する度数分布に存在する複数のピークのうち、そのピーク位置の画素値が最も小さなピークを、前記原稿外領域に対応するピークである原稿外領域ピークとして推定し、残余のピークを、前記原稿領域に対応するピークである原稿領域ピークとして推定するとともに、前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法であり、前記第4判別手法は、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法とのいずれかであり、前記ステップa)は、a−1)前記スキャン画像内の複数の画素の画素値の空間分布状況に基づいて、前記スキャン画像全体に所定程度以上のグラデーションが存在するか否かを判定するステップ、を有し、前記ステップb)は、b−1)前記スキャン画像全体における前記所定程度以上のグラデーションが存在することを条件として、前記第4判別手法を前記最適手法として決定するステップと、b−2)前記スキャン画像全体における前記所定程度以上のグラデーションが存在しないことを条件として、前記第1判別手法を前記最適手法として決定するステップと、を有することを特徴とする。 The invention of claim 32 is based on a) a step of analyzing the distribution of pixel values of a plurality of pixels in a scanned image of a document placed on a platen, and b) an analysis result in the step a). Based on this, the most suitable for the scanned image is among a plurality of discrimination methods for discriminating between a document area in which the document exists and an area outside the document in which the document does not exist in the image. A program for executing a step of determining the optimum method, which is a method, and a step of c) discriminating between the manuscript area and the non-manuscript area using the optimum method determined in step b). The plurality of discrimination methods include a first discrimination method and a fourth discrimination method, and the first discrimination method includes a plurality of discrimination methods existing in a frequency distribution relating to pixel values of a plurality of pixels in the entire scanned image. Of the peaks, the peak with the smallest pixel value at the peak position is estimated as the peak outside the document, which is the peak corresponding to the outside region, and the remaining peak is the peak corresponding to the outside region, which is the original region. In addition to estimating as a peak, a value between the pixel value of the extra-manuscript region peak and the pixel value of the manuscript region peak is used as a threshold, and the manuscript region and the extra-manuscript region are discriminated based on the threshold. In the fourth discrimination method, edge candidates in the original region are extracted by performing binarization processing and edge extraction processing based on a provisional threshold on the scanned image, and the edge candidates are orthogonal to each other at four points. When it is determined that at least one of the four orthogonal points is not detected in distinguishing the original region from the outer region based on the position of the orthogonal point, the remaining orthogonal points Based on the positional relationship and the geometrical relationship of the detection positions of the above four points, the positions of the at least one orthogonal point are set so that the closed region formed by connecting the four orthogonal points with a straight line has a rectangular shape. A method of estimating, determining the closed area as the original area, and determining an area other than the closed area as the outer area of the original, and binarization processing and edge extraction based on a provisional threshold value for the scanned image. Processing is performed to extract edge candidates of the manuscript area, and among the extracted edge candidates, a straight line portion having a length equal to or longer than a predetermined value is specified as a regular edge portion of the manuscript area, and other than the straight line portion. A portion is specified as a false detection portion, complement processing based on the regular edge portion is performed to correct the false detection portion, and the corrected edge candidate is formed. It is one of the methods of discriminating the closed area to be processed as the original area and determining the area other than the closed area as the outer area of the document. In the step a), a-1) a plurality of the scanned images. The step b) includes a step of determining whether or not a gradation of a predetermined degree or more exists in the entire scanned image based on the spatial distribution of the pixel values of the pixels of the above, and the step b) is b-1) the scan. The step of determining the fourth discrimination method as the optimum method on condition that the gradation of the predetermined degree or more exists in the entire image, and b-2) The gradation of the predetermined degree or more does not exist in the entire scanned image. The present invention is characterized in that it has a step of determining the first determination method as the optimum method, provided that
請求項33の発明は、コンピュータに、a)原稿台に載置された原稿に関するスキャン画像内の複数の画素の画素値の分布状況を分析するステップと、b)前記ステップa)における分析結果に基づいて、画像内にて前記原稿が存在する領域である原稿領域と前記原稿が存在しない領域である原稿外領域とを判別するための複数の判別手法の中から、前記スキャン画像に最も適した手法である最適手法を決定するステップと、c)前記ステップb)にて決定された最適手法を用いて、前記原稿領域と前記原稿外領域とを判別するステップと、を実行させるためのプログラムであって、前記複数の判別手法は、第1判別手法と第4判別手法とを含み、前記第1判別手法は、前記スキャン画像の全体における複数の画素の画素値に関する度数分布に存在する複数のピークのうち、そのピーク位置の画素値が最も小さなピークを、前記原稿外領域に対応するピークである原稿外領域ピークとして推定し、残余のピークを、前記原稿領域に対応するピークである原稿領域ピークとして推定するとともに、前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法であり、前記第4判別手法は、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法とのいずれかであり、前記ステップa)は、a−1)前記スキャン画像の全体における複数の画素の画素値に関する度数分布において、前記原稿外領域ピークと前記原稿領域ピークとの距離が一定程度よりも大きいか否かを判定するステップと、a−2)前記スキャン画像内の複数の画素の画素値の空間分布状況に基づいて、前記スキャン画像全体に所定程度以上のグラデーションが存在するか否かを判定するステップと、を有し、前記ステップb)は、b−1)前記度数分布において、前記原稿外領域ピークと前記原稿領域ピークとの距離が前記一定程度よりも大きい旨が判定されることを条件として、前記第1判別手法を前記最適手法として決定するステップと、b−2)前記スキャン画像全体における前記所定程度以上のグラデーションが存在することを条件として、前記第4判別手法を前記最適手法として決定するステップと、を有することを特徴とする。 The invention of claim 33 is based on a) a step of analyzing the distribution of pixel values of a plurality of pixels in a scanned image of a document placed on a platen, and b) an analysis result in the step a). Based on this, the most suitable for the scanned image is among a plurality of discrimination methods for discriminating between a document area in which the document exists and an area outside the document in which the document does not exist in the image. A program for executing a step of determining the optimum method, which is a method, and a step of c) discriminating between the manuscript area and the non-manuscript area using the optimum method determined in step b). The plurality of discrimination methods include a first discrimination method and a fourth discrimination method, and the first discrimination method includes a plurality of discrimination methods existing in a frequency distribution relating to pixel values of a plurality of pixels in the entire scanned image. Of the peaks, the peak with the smallest pixel value at the peak position is estimated as the peak outside the document, which is the peak corresponding to the outside region, and the remaining peak is the peak corresponding to the outside region, which is the original region. In addition to estimating as a peak, a value between the pixel value of the extra-manuscript region peak and the pixel value of the manuscript region peak is used as a threshold, and the original region and the extra-manuscript region are discriminated based on the threshold. In the fourth discrimination method, edge candidates in the original region are extracted by performing binarization processing and edge extraction processing based on a provisional threshold on the scanned image, and the edge candidates are orthogonal to each other at four points. When it is determined that at least one of the four orthogonal points is not detected in distinguishing the original region from the outer region based on the position of the orthogonal point, the remaining orthogonal points Based on the positional relationship and the geometrical relationship of the detection positions of the above four points, the positions of the at least one orthogonal point are set so that the closed region formed by connecting the four orthogonal points with a straight line has a rectangular shape. A method of estimating, determining the closed area as the original area, and determining an area other than the closed area as the outer area of the original, and binarization processing and edge extraction based on a provisional threshold value for the scanned image. Processing is performed to extract edge candidates of the manuscript area, and among the extracted edge candidates, a straight line portion having a length equal to or longer than a predetermined value is specified as a regular edge portion of the manuscript area, and other than the straight line portion. The portion is specified as a false detection portion, the false detection portion is corrected by performing complementary processing based on the regular edge portion, and the corrected edge candidate is formed. It is one of the methods of discriminating the closed area to be processed as the original area and determining the area other than the closed area as the outer area of the original, and the step a) is a-1) the entire scanned image. In the frequency distribution related to the pixel values of a plurality of pixels, a step of determining whether or not the distance between the extra-manuscript region peak and the manuscript region peak is larger than a certain degree, and a-2) a plurality of scan images. The step b) includes a step of determining whether or not a gradation of a predetermined degree or more exists in the entire scanned image based on the spatial distribution of the pixel values of the pixels, and the step b) is b-1) the frequency. The step of determining the first determination method as the optimum method on condition that the distance between the out-of-manuscript region peak and the original document region peak is determined to be larger than a certain degree in the distribution, and b- 2) It is characterized by having a step of determining the fourth discrimination method as the optimum method on condition that a gradation of a predetermined degree or more is present in the entire scanned image.
請求項34の発明は、コンピュータに、a)原稿台に載置された原稿に関するスキャン画像内の複数の画素の画素値の分布状況を分析するステップと、b)前記ステップa)における分析結果に基づいて、画像内にて前記原稿が存在する領域である原稿領域と前記原稿が存在しない領域である原稿外領域とを判別するための複数の判別手法の中から、前記スキャン画像に最も適した手法である最適手法を決定するステップと、c)前記ステップb)にて決定された最適手法を用いて、前記原稿領域と前記原稿外領域とを判別するステップと、を実行させるためのプログラムであって、前記複数の判別手法は、第2判別手法と第4判別手法とを含み、前記第2判別手法は、スキャン処理における受光素子での受光量を示すアナログ入力値と出力画素値を示すデジタル出力値との間の入出力特性を調整する入出力特性調整処理であって前記入出力特性調整処理前の入出力特性における出力範囲の一部の範囲がより広い出力範囲となるように入出力特性を調整する入出力特性調整処理が施された後に得られる第2スキャン画像の全体における複数の画素の画素値に関する度数分布において、複数のピークのうち、そのピーク位置の画素値が最も小さなピークを、前記原稿外領域に対応するピークである原稿外領域ピークとして判定し、残余のピークを、前記原稿領域に対応するピークである原稿領域ピークとして判定するとともに、前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法であり、前記第4判別手法は、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法とのいずれかであり、前記ステップa)は、a−1)前記スキャン画像内の複数の画素の画素値の空間分布状況に基づいて、前記スキャン画像全体に所定程度以上のグラデーションが存在するか否かを判定するステップ、を有し、前記ステップb)は、b−1)前記スキャン画像全体における前記所定程度以上のグラデーションが存在することを条件として、前記第4判別手法を前記最適手法として決定するステップと、b−2)前記スキャン画像全体における前記所定程度以上のグラデーションが存在しないことを条件として、前記第2判別手法を前記最適手法として決定するステップと、を有することを特徴とする。 The invention of claim 34 is based on a) a step of analyzing the distribution of pixel values of a plurality of pixels in a scanned image of a document placed on a platen, and b) an analysis result in the step a). Based on this, the most suitable for the scanned image is among a plurality of discrimination methods for discriminating between a document area in which the document exists and an area outside the document in which the document does not exist in the image. A program for executing a step of determining the optimum method, which is a method, and a step of c) discriminating between the manuscript area and the non-manuscript area using the optimum method determined in step b). The plurality of discrimination methods include a second discrimination method and a fourth discrimination method, and the second discrimination method shows an analog input value and an output pixel value indicating the amount of light received by the light receiving element in the scan process. It is an input / output characteristic adjustment process that adjusts the input / output characteristics with the digital output value, and is entered so that a part of the output range in the input / output characteristics before the input / output characteristic adjustment process becomes a wider output range. In the frequency distribution related to the pixel values of a plurality of pixels in the entire second scan image obtained after the input / output characteristic adjustment process for adjusting the output characteristics, the pixel value at the peak position is the smallest among the plurality of peaks. The peak is determined as the extra-manuscript region peak which is the peak corresponding to the extra-manuscript region, the residual peak is determined as the original region peak which is the peak corresponding to the extra-manuscript region, and the pixels of the extra-manuscript region peak are determined. A value between the value and the pixel value of the original document area peak is set as a threshold value, and the original document area and the outer document area are discriminated based on the threshold value. The fourth discriminating method is a method for discriminating the scanned image. On the other hand, edge candidates of the manuscript area are extracted by performing binarization processing and edge extraction processing based on a provisional threshold value, and the manuscript area and the manuscript are based on the positions of four orthogonal points where the edge candidates are orthogonal to each other. When it is determined that at least one of the four orthogonal points is not detected in distinguishing from the outer region, it is based on the positional relationship and the geometric relationship of the detection positions of the remaining orthogonal points. Therefore, the positions of the at least one orthogonal point are estimated so that the closed region formed by connecting the four orthogonal points with a straight line has a rectangular shape, and the closed region is determined as the document region. , A method for discriminating an area other than the closed area as the extra document area, and binarization processing and edge extraction based on a provisional threshold value for the scanned image. Processing is performed to extract edge candidates of the manuscript area, and among the extracted edge candidates, a straight line portion having a length equal to or longer than a predetermined value is specified as a regular edge portion of the manuscript area, and other than the straight line portion. A portion is specified as a false detection portion, complementary processing based on the regular edge portion is performed to correct the false detection portion, and a closed region formed by the corrected edge candidate is determined as the original document region. It is one of the methods for discriminating an area other than the closed area as the area outside the original document, and the step a) is a-1) based on the spatial distribution of the pixel values of a plurality of pixels in the scanned image. The step b) includes a step of determining whether or not a gradation of a predetermined degree or more exists in the entire scanned image, and b-1) the gradation of the predetermined degree or more exists in the entire scanned image. The second discrimination method is optimized on the condition that the step of determining the fourth discrimination method as the optimum method and b-2) that there is no gradation of the predetermined degree or more in the entire scanned image. It is characterized by having a step to be determined as a method.

請求項1から請求項34に記載の発明によれば、原稿台に載置された原稿に関するスキャン画像内の複数の画素の画素値の分布状況が分析され、分析結果に基づいて、画像内にて原稿領域と原稿外領域とを判別するための複数の判別手法の中から、スキャン画像に最も適した手法である最適手法が決定される。そして、決定された最適手法を用いて、原稿領域と原稿外領域とが判別される。したがって、原稿台に載置された原稿に関するスキャン画像において、原稿領域と原稿外領域とをより正確に判別することが可能である。 According to the inventions of claims 1 to 34 , the distribution of pixel values of a plurality of pixels in a scanned image of a document placed on a platen is analyzed, and based on the analysis result, the image is included in the image. The optimum method, which is the most suitable method for the scanned image, is determined from a plurality of discrimination methods for discriminating between the document area and the area outside the document. Then, the manuscript area and the non-manuscript area are discriminated by using the determined optimum method. Therefore, in the scanned image of the document placed on the platen, the document area and the area outside the document can be more accurately discriminated.

画像形成装置(MFP)の外観を示す図である。It is a figure which shows the appearance of the image forming apparatus (MFP). MFPの機能ブロックを示す図である。It is a figure which shows the functional block of the MFP. MFPの動作を示すフローチャートである。It is a flowchart which shows the operation of the MFP. 全開状態の原稿カバー等を示す図である。It is a figure which shows the document cover etc. in the fully opened state. スキャン画像を示す図である。It is a figure which shows the scanned image. ヒストグラムを示す図である。It is a figure which shows the histogram. スキャン画像を示す図である。It is a figure which shows the scanned image. ヒストグラムを示す図である。It is a figure which shows the histogram. ゲイン調整に関して説明する図である。It is a figure explaining about gain adjustment. ゲイン調整後の画素値に関するヒストグラムを示す図である。It is a figure which shows the histogram about the pixel value after gain adjustment. 半開き状態の原稿カバー等を示す図である。It is a figure which shows the document cover etc. in a half-open state. 主走査方向のグラデーションを有するスキャン画像を示す図である。It is a figure which shows the scan image which has the gradation of the main scanning direction. 主走査方向のグラデーションを有するスキャン画像全体に関するヒストグラムを示す図である。It is a figure which shows the histogram about the whole scan image which has the gradation of the main scanning direction. 分割領域および分割領域毎のヒストグラムを示す図である。It is a figure which shows the division area and the histogram for each division area. 分割領域毎のヒストグラムを示す図である。It is a figure which shows the histogram for each division area. 斜め方向のグラデーションを有するスキャン画像を示す図である。It is a figure which shows the scan image which has the gradation in an oblique direction. 斜め方向のグラデーションを有するスキャン画像全体に関するヒストグラムを示す図である。It is a figure which shows the histogram about the whole scan image which has a gradation in an oblique direction. スキャン画像にて検出された直交点等を示す図である。It is a figure which shows the orthogonal point and the like detected in the scanned image. 直交点の補正等について説明する図である。It is a figure explaining the correction of an orthogonal point and the like. 抽出されたエッジ候補等を示す図である。It is a figure which shows the extracted edge candidate and the like. 誤検出部分の補正について説明する図である。It is a figure explaining the correction of the erroneous detection part. 変形例に係る誤検出部分の補正について説明する図である。It is a figure explaining the correction of the erroneous detection part which concerns on the modification. 原稿領域と原稿外領域との推定結果を示す図である。It is a figure which shows the estimation result of a manuscript area and an area outside a manuscript. 副走査方向のグラデーションを有するスキャン画像を示す図である。It is a figure which shows the scan image which has the gradation of the sub-scanning direction. ヒストグラムを示す図である。It is a figure which shows the histogram. 斜め方向のグラデーションを有するスキャン画像および分割領域を示す図である。It is a figure which shows the scanned image which has the gradation in an oblique direction, and the division area.

以下、本発明の実施形態を図面に基づいて説明する。 Hereinafter, embodiments of the present invention will be described with reference to the drawings.

<1−1.構成概要>
図1は、画像形成装置10の外観を示す図である。ここでは、画像形成装置10として、MFP(マルチ・ファンクション・ペリフェラル(Multi-Functional Peripheral))10を例示する。
<1-1. Configuration overview>
FIG. 1 is a diagram showing the appearance of the image forming apparatus 10. Here, as the image forming apparatus 10, the MFP (Multi-Functional Peripheral) 10 is illustrated.

このMFP10は、図4および図11に示されるように、原稿を載置するための原稿台140と、原稿カバー110とを備える。当該原稿カバー110は、回動式の開閉機構を有する(回動開閉式である)。具体的には、原稿カバー110は、開閉用のヒンジ部130によって原稿台140に取り付けられており、当該ヒンジ部130を回転軸として回動可能に設けられている。また、ここでは、ヒンジ部130は、原稿台140における奥行方向(Y方向)の一方端(ここでは奥側(操作パネル部6cの設置位置の反対側)の端部)にX方向に沿って配置されている。 As shown in FIGS. 4 and 11, the MFP 10 includes a document base 140 on which a document is placed and a document cover 110. The document cover 110 has a rotary opening / closing mechanism (rotary opening / closing type). Specifically, the document cover 110 is attached to the document base 140 by a hinge portion 130 for opening and closing, and is provided so as to be rotatable around the hinge portion 130 as a rotation axis. Further, here, the hinge portion 130 is formed along the X direction at one end in the depth direction (Y direction) of the platen 140 (here, the end portion on the back side (opposite the installation position of the operation panel portion 6c)). Have been placed.

図2は、MFP10の機能ブロックを示す図である。 FIG. 2 is a diagram showing a functional block of the MFP 10.

MFP10は、スキャン機能、コピー機能、ファクシミリ機能およびボックス格納機能などを備える装置(複合機とも称する)である。具体的には、MFP10は、図2の機能ブロック図に示すように、画像読取部2、印刷出力部3、通信部4、格納部5、操作部6およびコントローラ(制御部)9等を備えており、これらの各部を複合的に動作させることによって、各種の機能を実現する。なお、MFP10は、画像処理装置あるいは画像読取装置などとも称される。 The MFP 10 is a device (also referred to as a multifunction device) having a scanning function, a copying function, a facsimile function, a box storage function, and the like. Specifically, as shown in the functional block diagram of FIG. 2, the MFP 10 includes an image reading unit 2, a print output unit 3, a communication unit 4, a storage unit 5, an operation unit 6, a controller (control unit) 9, and the like. By operating each of these parts in a complex manner, various functions are realized. The MFP 10 is also referred to as an image processing device or an image reading device.

画像読取部2は、原稿台140の原稿載置用ガラス面に載置された原稿を光学的に読み取って(すなわちスキャンして)、原稿台140上の当該原稿に関するスキャン画像(読取画像とも称する)(詳細には画像データ)を生成する処理部である。この画像読取部2は、スキャン部であるとも称される。なお、このMFP10においては、原稿台140の原稿載置用ガラス面におけるY方向(奥行方向)(縦方向)が、スキャン動作における主走査方向であり、当該原稿載置用ガラス面におけるX方向(左右方向)(横方向)が、スキャン動作における副走査方向である(図1、図4等参照)。 The image scanning unit 2 optically scans (that is, scans) a document placed on the document mounting glass surface of the document table 140, and scans an image (also referred to as a scanned image) of the document on the document table 140. ) (Detailedly image data) is a processing unit. The image reading unit 2 is also referred to as a scanning unit. In the MFP 10, the Y direction (depth direction) (vertical direction) on the document mounting glass surface of the platen 140 is the main scanning direction in the scanning operation, and the X direction (X direction) on the document mounting glass surface. The (horizontal direction) (horizontal direction) is the sub-scanning direction in the scanning operation (see FIGS. 1, 4, etc.).

印刷出力部3は、印刷対象に関するデータに基づいて紙などの各種の媒体に画像を印刷出力する出力部である。 The print output unit 3 is an output unit that prints and outputs an image on various media such as paper based on data related to a print target.

通信部4は、公衆回線等を介したファクシミリ通信を行うことが可能な処理部である。さらに、通信部4は、ネットワークを介したネットワーク通信を行うことも可能である。このネットワーク通信では、たとえば、TCP/IP(Transmission Control Protocol / Internet Protocol)等の各種のプロトコルが利用される。当該ネットワーク通信を利用することによって、MFP10は、所望の相手先と連携して各種のデータを授受することが可能である。通信部4は、各種データを送信する送信部4aと各種データを受信する受信部4bとを有する。 The communication unit 4 is a processing unit capable of performing facsimile communication via a public line or the like. Further, the communication unit 4 can also perform network communication via the network. In this network communication, for example, various protocols such as TCP / IP (Transmission Control Protocol / Internet Protocol) are used. By using the network communication, the MFP 10 can send and receive various data in cooperation with a desired destination. The communication unit 4 has a transmission unit 4a for transmitting various data and a reception unit 4b for receiving various data.

格納部5は、ハードディスクドライブ(HDD)等の記憶装置で構成される。 The storage unit 5 is composed of a storage device such as a hard disk drive (HDD).

操作部6は、MFP10に対する操作入力を受け付ける操作入力部6aと、各種情報の表示出力を行う表示部6bとを備えている。 The operation unit 6 includes an operation input unit 6a that receives an operation input to the MFP 10 and a display unit 6b that displays and outputs various information.

このMFP10においては、略板状の操作パネル部6c(図1参照)が設けられている。また、操作パネル部6cは、その正面側にタッチパネル25(図1参照)を有している。タッチパネル25は、操作入力部6aの一部としても機能するとともに、表示部6bの一部としても機能する。タッチパネル25は、液晶表示パネルに各種センサ等が埋め込まれて構成され、各種情報を表示するとともに操作者(ユーザ)からの各種の操作入力を受け付けることが可能である。タッチパネル25には、たとえば操作画面が表示される。 The MFP 10 is provided with a substantially plate-shaped operation panel portion 6c (see FIG. 1). Further, the operation panel unit 6c has a touch panel 25 (see FIG. 1) on the front side thereof. The touch panel 25 functions as a part of the operation input unit 6a and also as a part of the display unit 6b. The touch panel 25 is configured by embedding various sensors and the like in a liquid crystal display panel, and can display various information and receive various operation inputs from an operator (user). For example, an operation screen is displayed on the touch panel 25.

コントローラ(制御部)9は、MFP10に内蔵され、MFP10を統括的に制御する制御装置である。コントローラ9は、CPUおよび各種の半導体メモリ(RAMおよびROM)等を備えるコンピュータシステムとして構成される。コントローラ9は、CPUにおいて、ROM(例えば、EEPROM(登録商標))内に格納されている所定のソフトウエアプログラム(以下、単にプログラムとも称する)を実行することによって、各種の処理部を実現する。なお、当該プログラム(詳細にはプログラムモジュール群)は、USBメモリなどの可搬性の記録媒体に記録され、当該記録媒体を介してMFP10にインストールされてもよい。あるいは、当該プログラムは、ネットワーク等を経由してダウンロードされてMFP10にインストールされるようにしてもよい。 The controller (control unit) 9 is a control device that is built in the MFP 10 and controls the MFP 10 in an integrated manner. The controller 9 is configured as a computer system including a CPU and various semiconductor memories (RAM and ROM). The controller 9 realizes various processing units by executing a predetermined software program (hereinafter, also simply referred to as a program) stored in a ROM (for example, EEPROM (registered trademark)) in the CPU. The program (specifically, a program module group) may be recorded on a portable recording medium such as a USB memory and installed on the MFP 10 via the recording medium. Alternatively, the program may be downloaded via a network or the like and installed in the MFP 10.

具体的には、図2に示すように、コントローラ9は、当該プログラムの実行により、通信制御部11と入力制御部12と表示制御部13と分析部14と領域判別部17と原稿外消去部18とを含む各種の処理部を実現する。 Specifically, as shown in FIG. 2, the controller 9 executes the program to execute the communication control unit 11, the input control unit 12, the display control unit 13, the analysis unit 14, the area determination unit 17, and the out-of-manuscript erasure unit. Various processing units including 18 are realized.

通信制御部11は、他の装置との間の通信動作を通信部4等と協働して制御する処理部である。 The communication control unit 11 is a processing unit that controls communication operations with other devices in cooperation with the communication unit 4 and the like.

入力制御部12は、操作入力部6a(タッチパネル25等)に対するユーザからの操作入力の受付動作等を制御する制御部である。 The input control unit 12 is a control unit that controls an operation of receiving an operation input from a user with respect to the operation input unit 6a (touch panel 25 or the like).

表示制御部13は、表示部6b(タッチパネル25等)における表示動作を制御する処理部である。 The display control unit 13 is a processing unit that controls the display operation on the display unit 6b (touch panel 25 or the like).

分析部14は、原稿台140に載置された原稿に関するスキャン画像300内の複数の画素の画素値の分布状況を分析する処理を実行する処理部である。たとえば、分析部14は、スキャン画像300(図5等参照)内の複数の画素の画素値の空間分布状況に基づいて、当該スキャン画像300全体に所定程度以上のグラデーション(階調変化)が存在するか否か判定する。また、分析部14は、スキャン画像300内に当該所定程度以上のグラデーションが存在する場合、当該空間分布状況に基づいて、当該所定程度以上のグラデーションの変化方向を分析(判定)する処理をさらに実行する。さらに、分析部14は、スキャン画像300全体における複数の画素の画素値に関するヒストグラム(度数分布)に基づいて、当該複数の画素の画素値の度数分布状況を分析(解析)する。 The analysis unit 14 is a processing unit that executes a process of analyzing the distribution state of the pixel values of a plurality of pixels in the scanned image 300 regarding the document placed on the platen 140. For example, the analysis unit 14 has a gradation (gradation change) of a predetermined degree or more in the entire scanned image 300 based on the spatial distribution of the pixel values of a plurality of pixels in the scanned image 300 (see FIG. 5 and the like). Determine whether or not to do so. Further, when the scanned image 300 has a gradation of the predetermined degree or more, the analysis unit 14 further executes a process of analyzing (determining) the change direction of the gradation of the predetermined degree or more based on the spatial distribution situation. To do. Further, the analysis unit 14 analyzes (analyzes) the frequency distribution of the pixel values of the plurality of pixels based on the histogram (frequency distribution) of the pixel values of the plurality of pixels in the entire scanned image 300.

領域判別部17は、スキャン画像400(図5等参照)において原稿領域(原稿が存在する領域)と原稿外領域(原稿が存在しない領域)とを判別する領域判別処理を実行する処理部である。領域判別部17は、分析部14による分析結果(分布状況の分析結果)に基づいて、画像内にて原稿領域と原稿外領域とを判別するための複数の判別手法(複数種類の判別手法)の中から、スキャン画像300に最も適した手法(最適手法)を決定する。換言すれば、当該分析結果に応じて、複数の判別手法が切り替えられる。そして、領域判別部17は、決定された最適手法を用いて、スキャン画像400において原稿領域と原稿外領域とを判別する。また、領域判別部17は、原稿領域のエッジ候補を抽出するための閾値(抽出用閾値)THを算出する閾値算出処理をも実行する。 The area determination unit 17 is a processing unit that executes an area determination process for discriminating between the original area (the area where the original exists) and the outer area (the area where the original does not exist) in the scanned image 400 (see FIG. 5 and the like). .. The area discrimination unit 17 is a plurality of discrimination methods (plural types of discrimination methods) for discriminating between the original region and the non-manuscript region in the image based on the analysis result (analysis result of the distribution status) by the analysis unit 14. From among them, the most suitable method (optimal method) for the scanned image 300 is determined. In other words, a plurality of discrimination methods can be switched according to the analysis result. Then, the area discrimination unit 17 discriminates between the original area and the non-manuscript area in the scanned image 400 by using the determined optimum method. In addition, the area determination unit 17 also executes a threshold value calculation process for calculating a threshold value (extraction threshold value) TH for extracting edge candidates in the document area.

原稿外消去部18は、原稿領域と原稿外領域との判別結果に基づいて、原稿外領域(原稿外領域として判別された領域)をスキャン画像400から消去する原稿外消去処理を実行する処理部である。具体的には、原稿外消去部18は、原稿外領域として判別された領域の画素値を白色データ(詳細には画素値「255」)に置換(補正)する(白色置換処理を実行する)。 The out-of-manuscript erasing unit 18 is a processing unit that executes an out-of-manuscript erasing process for erasing the out-of-manuscript area (the area determined as the out-of-manuscript area) from the scanned image 400 based on the discrimination result between the out-of-manuscript area and the out-of-manuscript area. Is. Specifically, the extra-manuscript erasing unit 18 replaces (corrects) the pixel value of the region determined as the extra-manuscript region with white data (specifically, the pixel value "255") (executes the white replacement processing). ..

<1−2.動作>
図3は、MFP10の動作を示すフローチャートである。
<1-2. Operation>
FIG. 3 is a flowchart showing the operation of the MFP 10.

MFP10は、原稿台140に載置された原稿に関するスキャン画像300内の複数の画素の画素値の分布状況を分析する(ステップS13〜S15)。そして、MFP10は、当該分布状況の分析結果に基づいて、原稿領域と原稿外領域とを判別するための複数の判別手法(ステップS16〜S19)の中から最適手法(スキャン画像300に最も適した手法)を決定し、決定された最適手法を用いて、原稿領域と原稿外領域とを判別する。原稿領域と原稿外領域とが判別されると、MFP10は、スキャン画像400から原稿外領域を消去する(ステップS20)。そして、原稿外領域の消去結果(原稿外消去結果)の印刷出力処理等が実行される。 The MFP 10 analyzes the distribution of pixel values of a plurality of pixels in the scanned image 300 regarding the document placed on the platen 140 (steps S13 to S15). Then, the MFP 10 is the most suitable method (most suitable for the scanned image 300) from among a plurality of discrimination methods (steps S16 to S19) for discriminating between the document region and the region outside the document based on the analysis result of the distribution situation. Method) is determined, and the original area and the non-manuscript area are discriminated by using the determined optimum method. When the document area and the document area are determined, the MFP 10 erases the document area from the scanned image 400 (step S20). Then, a print output process or the like of the erasing result of the area outside the document (erasing result outside the document) is executed.

以下では、図3の処理の概略について説明した後、各判別手法(ステップS16〜S19)の内容について説明する。 Hereinafter, after the outline of the process of FIG. 3 will be described, the contents of each discrimination method (steps S16 to S19) will be described.

まず、ユーザは、スキャン処理を伴うジョブ(たとえばコピージョブ)の実行に際して、MFP10の原稿カバー110(プラテンカバーとも称される)を開け、原稿台140の原稿載置用ガラス面(プラテンガラスとも称される)に原稿を載置する。そして、ユーザは、当該ジョブの実行指示をMFP10に付与する。 First, when executing a job involving scanning (for example, a copy job), the user opens the document cover 110 (also referred to as a platen cover) of the MFP 10 and opens the document table 140 glass surface (also referred to as platen glass) for placing documents. Place the manuscript in). Then, the user gives the execution instruction of the job to the MFP 10.

ユーザによる実行指示の付与に応答して、MFP10は、図3の処理を開始する。 In response to the user giving an execution instruction, the MFP 10 starts the process of FIG.

ステップS11においては、MFP10は、プレスキャン(原稿外消去処理の準備用画像を生成するためのスキャン処理)を実行する。具体的には、MFP10は、原稿台140の原稿載置用ガラス面の全面に亘ってスキャン動作を行うことによって、原稿台140に載置された原稿を読み取ってスキャン画像300(図5等参照)を生成する。当該スキャン画像300は、原稿外消去処理の準備用画像(分布状況の分析用画像等)として生成される。 In step S11, the MFP 10 executes a pre-scan (a scanning process for generating a preparatory image for the off-document erasing process). Specifically, the MFP 10 scans the original mounted on the platen 140 by performing a scanning operation over the entire surface of the platen 140 for placing the original, and scans the image 300 (see FIG. 5 and the like). ) Is generated. The scanned image 300 is generated as a preparatory image (an image for analyzing the distribution state, etc.) of the non-manuscript erasing process.

詳細には、ユーザによる実行指示の付与に応答して、原稿載置用ガラス面の下部に配置された光源150(図4参照)から光が出射されて、出射光が原稿載置用ガラス面を透過する。そして、当該出射光の一部は、原稿台140上の原稿に当たって反射し、原稿台140を再び透過して受光部(不図示)に入射するとともに、当該受光部によって検知される。その後、受光部によって検知された光の強度等に基づいて、スキャン画像300(図5等参照)が生成される。当該スキャン画像300においては、比較的強い光が検知された部分の画素(たとえば原稿領域内の画素)の画素値は比較的大きく(明るく)、比較的弱い光が検知された部分(あるいは光が検知されなかった部分)の画素の画素値は比較的小さい(暗い)。 Specifically, in response to the user giving an execution instruction, light is emitted from the light source 150 (see FIG. 4) arranged below the glass surface for placing the document, and the emitted light is emitted from the glass surface for placing the document. Is transparent. Then, a part of the emitted light hits the document on the platen 140, is reflected, passes through the platen 140 again, is incident on the light receiving portion (not shown), and is detected by the light receiving portion. After that, a scanned image 300 (see FIG. 5 and the like) is generated based on the intensity of light detected by the light receiving unit and the like. In the scanned image 300, the pixel value of the pixel (for example, the pixel in the document area) of the portion where relatively strong light is detected is relatively large (bright), and the portion (or light) where relatively weak light is detected is detected. The pixel value of the pixel (the undetected part) is relatively small (dark).

スキャン画像300が生成されると、MFP10は、当該スキャン画像300に基づいて、原稿領域のエッジ候補を抽出するための抽出用閾値THを暫定的に算出するとともに、暫定的に算出された抽出用閾値THに基づいて、原稿領域と原稿外領域とを推定する(ステップS12)。後述のように、ステップS12にて得られた結果は、スキャン画像300内の複数の画素の画素値の分布状況の分析(ステップS13〜S15)にて利用されるとともに、暫定的に算出された抽出用閾値THは、一部の判別手法にて利用される。 When the scanned image 300 is generated, the MFP 10 tentatively calculates the extraction threshold TH for extracting edge candidates in the document region based on the scanned image 300, and also tentatively calculates the tentatively calculated extraction threshold value TH. The original area and the outer area of the original are estimated based on the threshold value TH (step S12). As will be described later, the result obtained in step S12 is used in the analysis of the distribution of the pixel values of the plurality of pixels in the scanned image 300 (steps S13 to S15), and is tentatively calculated. The extraction threshold TH is used in some discriminating techniques.

具体的には、MFP10は、スキャン画像300全体における複数の画素の画素値に関してヒストグラム(度数分布)を生成し、当該ヒストグラムに基づいて、原稿領域のエッジ候補を抽出するための抽出用閾値THを暫定的に算出(仮設定)する。たとえば、当該ヒストグラムにおいて2つのピーク(そのピーク値(最大値)が一定程度以上の度数を有するピーク)が存在する場合(図6等参照)、原稿領域に対応するピークと原稿外領域に対応するピークとの間に暫定的な抽出用閾値THが設定(仮設定)される。あるいは、当該ヒストグラムにおいて単一のピークが存在する場合(図13参照)、当該単一のピークの裾野部分(たとえば左側の裾野部分)に暫定的な抽出用閾値THが設定(仮設定)される。 Specifically, the MFP 10 generates a histogram (frequency distribution) for the pixel values of a plurality of pixels in the entire scanned image 300, and sets an extraction threshold TH for extracting edge candidates in the document region based on the histogram. Temporarily calculate (temporarily set). For example, when two peaks (peaks whose peak value (maximum value) has a frequency of a certain degree or more) exist in the histogram (see FIG. 6 and the like), the peak corresponding to the manuscript area and the peak outside the manuscript area A provisional extraction threshold TH is set (temporarily set) between the peak and the peak. Alternatively, when a single peak exists in the histogram (see FIG. 13), a provisional extraction threshold TH is set (temporarily set) at the base portion (for example, the base portion on the left side) of the single peak. ..

そして、暫定的に算出(仮設定)された抽出用閾値THに基づいて、スキャン画像300内の各画素に対して二値化処理が実行され、処理結果に基づいて原稿領域のエッジ候補を抽出するエッジ抽出処理(微分フィルタ処理等)が実行される。その後、スキャン画像300において、抽出されたエッジ候補で形成される閉領域が原稿領域として推定されるとともに、当該閉領域以外の領域が原稿外領域として推定される。 Then, based on the provisionally calculated (temporarily set) extraction threshold value TH, binarization processing is executed for each pixel in the scanned image 300, and edge candidates of the original region are extracted based on the processing result. Edge extraction processing (differential filter processing, etc.) is executed. After that, in the scanned image 300, the closed region formed by the extracted edge candidates is estimated as the original region, and the region other than the closed region is estimated as the outer region of the original.

原稿領域と原稿外領域とが推定される(ステップS12)と、MFP10は、スキャン画像300内の複数の画素の画素値の分布状況を分析(解析)する(ステップS13〜S15)。そして、分析結果(解析結果)に基づいて、原稿領域と原稿外領域とを判別するための互いに異なる複数の判別手法(複数種類の判別手法)(ステップS16〜S17)の中から最適手法(最適判別手法)が決定される。換言すれば、当該複数の判別手法の中から、当該分布状況の分析結果に応じて異なる判別手法が最適手法として決定(採用)される。 When the document area and the area outside the document are estimated (step S12), the MFP 10 analyzes (analyzes) the distribution of the pixel values of the plurality of pixels in the scanned image 300 (steps S13 to S15). Then, based on the analysis result (analysis result), the optimum method (optimum) is selected from a plurality of different discrimination methods (plural types of discrimination methods) (steps S16 to S17) for discriminating between the manuscript area and the non-manuscript area. Discrimination method) is determined. In other words, from the plurality of discrimination methods, a different discrimination method is determined (adopted) as the optimum method according to the analysis result of the distribution situation.

まず、ステップS13においては、スキャン画像300内の複数の画素の画素値の空間分布状況に基づいて、スキャン画像300全体に所定程度以上のグラデーションが存在するか否か、が判定される。換言すれば、スキャン画像300全体における所定程度以上のグラデーションの存否判定処理が実行される。 First, in step S13, it is determined whether or not there is a gradation of a predetermined degree or more in the entire scanned image 300 based on the spatial distribution of the pixel values of the plurality of pixels in the scanned image 300. In other words, the presence / absence determination process of the gradation of a predetermined degree or more in the entire scanned image 300 is executed.

具体的には、MFP10は、スキャン画像300から縦方向画素列(縦方向に伸びる画素列)と横方向画素列(横方向に伸びる画素列)との少なくとも一方(ここでは双方)を抽出して、各画素列の画素値の分布状況(空間分布状況)を解析(分析)する。そして、MFP10は、当該少なくとも一方の画素列に関して所定の変化特性(次述)の有無を判定し、当該所定の変化特性の有無の判定結果に基づいて、スキャン画像300全体に所定程度以上のグラデーションが存在するか否か、を判定する。 Specifically, the MFP 10 extracts at least one (here, both) of the vertical pixel row (the pixel row extending in the vertical direction) and the horizontal pixel row (the pixel row extending in the horizontal direction) from the scanned image 300. , Analyze (analyze) the distribution status (spatial distribution status) of the pixel values of each pixel sequence. Then, the MFP 10 determines the presence / absence of a predetermined change characteristic (described below) with respect to the at least one pixel string, and based on the determination result of the presence / absence of the predetermined change characteristic, the entire scanned image 300 has a gradation of a predetermined degree or more. Determines if is present.

詳細には、MFP10は、スキャン画像300において、特定の縦方向画素列と特定の横方向画素列との双方を注目画素列としてそれぞれ抽出し、各注目画素列において所定の変化特性の有無を判定する。より詳細には、MFP10は、各注目画素列に関して、当該注目画素列の伸延方向における複数の画素の画素値が徐々に変化(増加あるいは減少)し且つ当該複数の画素の画素値の変化の幅(変動幅)が所定程度(たとえば画素値「50」)を超える所定の変化特性を有するか否か、を判定する。端的に言えば、MFP10は、縦方向画素列と横方向画素列との双方の画素列に注目し、縦方向画素列と横方向画素列との少なくとも一方に所定程度以上のグラデーションが存在するか否か、を判定する。 Specifically, the MFP 10 extracts both a specific vertical pixel sequence and a specific horizontal pixel sequence as the pixel strings of interest in the scanned image 300, and determines the presence or absence of a predetermined change characteristic in each pixel sequence of interest. To do. More specifically, in the MFP 10, the pixel values of the plurality of pixels in the extension direction of the pixel sequence of interest gradually change (increase or decrease) with respect to each pixel sequence of interest, and the width of change in the pixel values of the plurality of pixels. It is determined whether or not the (variation width) has a predetermined change characteristic exceeding a predetermined degree (for example, the pixel value “50”). In short, the MFP 10 pays attention to both the vertical pixel row and the horizontal pixel row, and whether at least one of the vertical pixel row and the horizontal pixel row has a gradation of a predetermined degree or more. Whether or not it is determined.

より具体的には、スキャン画像300において横方向に配列された複数の縦方向画素列のうちの特定の縦方向画素列(原稿外領域における縦方向の特定の画素列を含む縦方向画素列)が、注目画素列(注目縦方向画素列)として抽出される。たとえば、当該複数の縦方向画素列のうち、スキャン画像300における左端(および/あるいは右端)の縦方向画素列の全部または一部が原稿外領域に含まれる場合、当該左端の縦方向画素列が注目画素列(注目縦方向画素列)として抽出される。そして、当該注目縦方向画素列内の複数の画素の画素値の空間分布状況が解析され、当該注目縦方向画素列内の複数の画素に関して、所定の変化特性の有無が判定される。換言すれば、縦方向画素列に所定程度以上のグラデーションが存在するか否か、が判定される。 More specifically, a specific vertical pixel row among a plurality of vertical pixel trains arranged in the horizontal direction in the scanned image 300 (a vertical pixel row including a specific vertical pixel row in the outer region of the original document). Is extracted as a pixel sequence of interest (a pixel array in the vertical direction of attention). For example, when all or a part of the left end (and / or right end) vertical pixel row in the scanned image 300 is included in the outer region of the document among the plurality of vertical pixel rows, the leftmost vertical pixel row is included. It is extracted as a pixel sequence of interest (a pixel array in the vertical direction of attention). Then, the spatial distribution of the pixel values of the plurality of pixels in the attention vertical pixel array is analyzed, and the presence or absence of a predetermined change characteristic is determined for the plurality of pixels in the attention vertical pixel array. In other words, it is determined whether or not there is a gradation of a predetermined degree or more in the vertical pixel sequence.

また、スキャン画像300において縦方向に配列された複数の横方向画素列のうちの特定の画素列(原稿外領域における横方向の特定の画素列を含む横方向画素列)が、注目画素列(注目横方向画素列)として抽出される。たとえば、当該複数の横方向画素列のうち、スキャン画像300における上端(および/あるいは下端)の横方向画素列の全部または一部が原稿外領域に含まれる場合、当該上端の横方向画素列が注目画素列(注目横方向画素列)として抽出される。そして、当該注目横方向画素列内の複数の画素の画素値の空間分布状況が解析され、当該注目横方向画素列内の複数の画素に関して、所定の変化特性の有無が判定される。換言すれば、横方向画素列に所定程度以上のグラデーションが存在するか否か、が判定される。 Further, a specific pixel string (horizontal pixel string including a specific horizontal pixel string in the region outside the original document) among a plurality of horizontal pixel strings arranged in the vertical direction in the scanned image 300 is a pixel string of interest (a pixel string in the horizontal direction). It is extracted as a pixel sequence in the horizontal direction of interest). For example, when all or a part of the upper end (and / or lower end) horizontal pixel row in the scanned image 300 is included in the outer region of the document among the plurality of horizontal pixel rows, the upper end horizontal pixel row is included. It is extracted as a pixel sequence of interest (horizontal pixel array of interest). Then, the spatial distribution of the pixel values of the plurality of pixels in the attention horizontal pixel row is analyzed, and the presence or absence of a predetermined change characteristic is determined with respect to the plurality of pixels in the attention horizontal pixel row. In other words, it is determined whether or not there is a gradation of a predetermined degree or more in the horizontal pixel sequence.

そして、スキャン画像300全体に所定程度以上のグラデーションが存在するか否かの判定結果(分析結果)に応じて、互いに異なる判別手法が最適手法として決定(採用)される。換言すれば、スキャン画像300全体に所定程度以上のグラデーションが存在する場合とスキャン画像300全体に所定程度以上のグラデーションが存在しない場合とで、互いに異なる判別手法が最適手法として決定(採用)される。 Then, different discrimination methods are determined (adopted) as the optimum method according to the determination result (analysis result) of whether or not the entire scanned image 300 has a gradation of a predetermined degree or more. In other words, different discrimination methods are determined (adopted) as the optimum method depending on whether the entire scanned image 300 has a gradation of a predetermined degree or more and the entire scanned image 300 does not have a gradation of a predetermined degree or more. ..

たとえば、縦方向画素列(注目縦方向画素列)と横方向画素列(注目横方向画素列)との少なくとも一方に所定程度以上のグラデーションが存在する場合、スキャン画像300全体に所定程度以上のグラデーションが存在する旨がステップS13にて判定される。そして、処理はステップS15以降へと進み、第3の判別手法(ステップS18)と第4の判別手法(ステップS19)とのいずれかが最適手法として決定される。 For example, when at least one of the vertical pixel row (attention vertical pixel row) and the horizontal pixel row (attention horizontal pixel row) has a gradation of a predetermined degree or more, the entire scanned image 300 has a gradation of a predetermined degree or more. Is determined in step S13. Then, the process proceeds to step S15 or later, and either the third discrimination method (step S18) or the fourth discrimination method (step S19) is determined as the optimum method.

一方、縦方向画素列と横方向画素列とのいずれにおいても当該所定程度以上のグラデーションが存在しない場合、スキャン画像300全体に所定程度以上のグラデーションが存在しない旨がステップS13にて判定される。そして、処理はステップS14以降へと進み、第1の判別手法(ステップS16)と第2の判別手法(ステップS17)とのいずれかが最適手法として決定される。 On the other hand, when the gradation of the predetermined degree or more does not exist in both the vertical pixel row and the horizontal pixel row, it is determined in step S13 that the gradation of the predetermined degree or more does not exist in the entire scanned image 300. Then, the process proceeds to step S14 and subsequent steps, and either the first discrimination method (step S16) or the second discrimination method (step S17) is determined as the optimum method.

ステップS14においては、スキャン画像300全体における複数の画素の画素値に関する度数分布に基づいて、当該複数の画素の画素値の度数分布状況が分析(解析)される(度数分布状況の解析処理が実行される)。 In step S14, the frequency distribution status of the pixel values of the plurality of pixels is analyzed (analyzed) based on the frequency distribution relating to the pixel values of the plurality of pixels in the entire scanned image 300 (the frequency distribution status analysis process is executed). Will be).

具体的には、スキャン画像300全体における複数の画素の画素値に関してステップS12にて生成されたヒストグラム(度数分布)において原稿領域ピークと原稿外領域ピークとの距離が一定程度よりも大きい旨の条件が充足されるか否か、が判定される。換言すれば、当該ヒストグラムにおいて原稿領域ピークの画素値と原稿外領域ピークの画素値との差分が所定値(たとえば値「50」)よりも大きい旨の条件が充足されるか否か、が判定される。なお、原稿領域ピークは、ヒストグラムにおいて原稿領域に対応するピークであり、原稿外領域は、ヒストグラムにおいて原稿外領域に対応するピークである。 Specifically, a condition that the distance between the original region peak and the outer region peak is larger than a certain degree in the histogram (frequency distribution) generated in step S12 with respect to the pixel values of a plurality of pixels in the entire scanned image 300. Is determined whether or not is satisfied. In other words, it is determined whether or not the condition that the difference between the pixel value of the original region peak and the pixel value of the extra-manuscript region peak is larger than a predetermined value (for example, the value "50") is satisfied in the histogram. Will be done. The document area peak is a peak corresponding to the document area in the histogram, and the document area is a peak corresponding to the document area in the histogram.

そして、各ピーク間の距離が一定程度よりも大きい旨の条件が充足されるか否かに応じて、互いに異なる判別手法が最適手法として決定される。換言すれば、各ピーク間の距離が一定程度よりも大きい旨の条件が充足される場合と各ピーク間の距離が一定程度よりも大きい旨の条件が充足されない場合とで、互いに異なる判別手法が最適手法として決定される。 Then, different discrimination methods are determined as the optimum method depending on whether or not the condition that the distance between the peaks is larger than a certain degree is satisfied. In other words, there are different discrimination methods depending on whether the condition that the distance between each peak is larger than a certain degree is satisfied and the condition that the distance between each peak is larger than a certain degree is not satisfied. Determined as the optimal method.

たとえば、ヒストグラムにおいて2以上のピークが検出され且つ原稿領域ピークと原稿外領域ピークとの距離が一定程度よりも大きい場合、当該ヒストグラムにおいて原稿領域ピークと原稿外領域ピークとの距離が一定程度よりも大きい旨の条件が充足されると判定され、処理はステップS16へと進む。そして、第1の判別手法が最適手法として決定(採用)される。換言すれば、スキャン画像300全体に所定程度以上のグラデーションが存在せず、且つ当該スキャン画像300全体に関するヒストグラムにおいて原稿領域ピークと原稿外領域ピークとの距離が一定程度よりも大きい旨の条件が充足される場合、第1の判別手法を用いて原稿領域と原稿外領域とが判別される。ここでは、スキャン画像300全体における複数の画素の画素値に関するヒストグラムに基づき算出された抽出用閾値TH(TH10)に基づいて原稿領域と原稿外領域とを判別する手法(「基本判別手法」とも称する)が、当該第1の判別手法として用いられる。なお、第1の判別手法(基本判別手法)の詳細については、後述する。 For example, when two or more peaks are detected in the histogram and the distance between the original region peak and the extra-manuscript region peak is larger than a certain degree, the distance between the original region peak and the extra-manuscript region peak is larger than a certain degree in the histogram. It is determined that the condition of largeness is satisfied, and the process proceeds to step S16. Then, the first discrimination method is determined (adopted) as the optimum method. In other words, the condition that there is no gradation of a predetermined degree or more in the entire scanned image 300 and that the distance between the original region peak and the outer region peak in the original region is larger than a certain degree in the histogram for the entire scanned image 300 is satisfied. If so, the manuscript area and the non-manuscript area are discriminated using the first discrimination method. Here, a method of discriminating between the original region and the non-manuscript region based on the extraction threshold TH (TH10) calculated based on the histogram of the pixel values of a plurality of pixels in the entire scanned image 300 (also referred to as “basic discrimination method”). ) Is used as the first discrimination method. The details of the first discrimination method (basic discrimination method) will be described later.

一方、ヒストグラムにおいて原稿領域ピークと原稿外領域ピークとの距離が一定程度よりも大きい旨の条件が充足されない場合、処理はステップS17へと進み、第2の判別手法が最適手法として決定(採用)される。たとえば、ヒストグラムにおいて原稿領域ピークと原稿外領域ピークとが特定(検出)されない場合は、ヒストグラムにおいて原稿領域ピークと原稿外領域ピークとの距離が一定程度よりも大きい旨の条件は充足されず、第2の判別手法(ステップS17)が最適手法として決定される。また、原稿領域ピークと原稿外領域ピークとは検出されるものの、当該原稿領域ピークと原稿外領域ピークとの距離が一定程度よりも小さい場合も、ヒストグラムにおいて原稿領域ピークと原稿外領域ピークとの距離が一定程度よりも大きい旨の条件は充足されず、第2の判別手法(ステップS17)が最適手法として決定される。換言すれば、スキャン画像300全体に所定程度以上のグラデーションが存在せず、且つ当該スキャン画像300全体に関するヒストグラムにおいて原稿領域ピークと原稿外領域ピークとの距離が一定程度よりも大きい旨の条件が充足されない場合、第2の判別手法を用いて原稿領域と原稿外領域とが判別される。ここでは、スキャン画像300内の複数の画素の画素値に関して入出力特性調整処理を実行して、入出力特性調整処理後の入出力特性に基づき得られた画素値の新たなヒストグラムに基づき算出された抽出用閾値TH(TH20)を用いて原稿領域と原稿外領域とを特定する手法(「入出力特性調整手法」とも称する)が、第2の判別手法として用いられる。なお、第2の判別手法(入出力特性調整手法)の詳細については、後述する。 On the other hand, if the condition that the distance between the original region peak and the outer region peak is larger than a certain level is not satisfied in the histogram, the process proceeds to step S17, and the second discrimination method is determined (adopted) as the optimum method. Will be done. For example, if the original region peak and the extra-manuscript region peak are not specified (detected) in the histogram, the condition that the distance between the original region peak and the extra-manuscript region peak is larger than a certain level in the histogram is not satisfied. The discrimination method (step S17) of 2 is determined as the optimum method. Further, although the original region peak and the extra-manuscript region peak are detected, even if the distance between the original region peak and the extra-manuscript region peak is smaller than a certain degree, the original region peak and the extra-manuscript region peak are displayed in the histogram. The condition that the distance is larger than a certain degree is not satisfied, and the second discrimination method (step S17) is determined as the optimum method. In other words, the condition that there is no gradation of a predetermined degree or more in the entire scanned image 300 and that the distance between the original region peak and the outer region peak in the original region is larger than a certain degree in the histogram for the entire scanned image 300 is satisfied. If not, the manuscript area and the out-of-manuscript area are discriminated by using the second discrimination method. Here, the input / output characteristic adjustment processing is executed for the pixel values of a plurality of pixels in the scanned image 300, and the calculation is performed based on a new histogram of the pixel values obtained based on the input / output characteristics after the input / output characteristic adjustment processing. A method of specifying the original area and the outer area of the original using the extraction threshold TH (TH20) (also referred to as “input / output characteristic adjustment method”) is used as the second discrimination method. The details of the second discrimination method (input / output characteristic adjustment method) will be described later.

また、上述のように、縦方向画素列と横方向画素列との少なくとも一方に所定程度以上のグラデーションが存在する旨がステップS13にて判定される場合、処理はステップS15へと進む。 Further, as described above, when it is determined in step S13 that at least one of the vertical pixel array and the horizontal pixel array has a gradation of a predetermined degree or more, the process proceeds to step S15.

ステップS15においては、スキャン画像300内の複数の画素の画素値の空間分布状況に基づいて、スキャン画像300に存在する所定程度以上のグラデーションの変化方向がさらに分析(判定)される。換言すれば、スキャン画像全体における所定程度以上のグラデーションの変化方向を判定する方向判定処理が実行される。具体的には、スキャン画像300において、縦方向画素列と横方向画素列との双方における所定の変化特性の有無の判定結果に基づいて、当該所定程度以上のグラデーションの変化方向が判定される。 In step S15, the change direction of the gradation of a predetermined degree or more existing in the scan image 300 is further analyzed (determined) based on the spatial distribution of the pixel values of the plurality of pixels in the scan image 300. In other words, the direction determination process for determining the change direction of the gradation of a predetermined degree or more in the entire scanned image is executed. Specifically, in the scanned image 300, the change direction of the gradation of the predetermined degree or more is determined based on the determination result of the presence / absence of the predetermined change characteristic in both the vertical pixel row and the horizontal pixel row.

そして、当該変化方向が、スキャン画像300における縦方向あるいは横方向と、スキャン画像300における斜め方向とのいずれであるかに応じて、互いに異なる判別手法が最適手法として決定(採用)される。換言すれば、当該変化方向が縦方向あるいは横方向である場合と当該変化方向が斜め方向である場合とで、互いに異なる判別手法が最適手法として決定される。 Then, different discrimination methods are determined (adopted) as the optimum method depending on whether the change direction is the vertical direction or the horizontal direction in the scanned image 300 or the oblique direction in the scanned image 300. In other words, different discrimination methods are determined as the optimum method depending on whether the change direction is the vertical direction or the horizontal direction and the change direction is the diagonal direction.

たとえば、当該変化方向が縦方向あるいは横方向である旨がステップS15にて判定される場合、処理はステップS18へと進み、第3の判別手法が最適手法として決定(採用)される。換言すれば、スキャン画像300全体に所定程度以上のグラデーションが存在し、且つ当該所定程度以上のグラデーションの変化方向が縦方向あるいは横方向である場合、第3の判別手法を用いて原稿領域と原稿外領域とが判別される。ここでは、スキャン画像300を複数の分割領域380に分割し、分割領域毎に算出された抽出用閾値THに基づいて各分割領域において原稿領域と原稿外領域とを判別する手法(「領域分割手法」とも称する)が、当該第3の判別手法として用いられる。なお、当該第3の判別手法(領域分割手法)の詳細については、後述する。 For example, when it is determined in step S15 that the change direction is the vertical direction or the horizontal direction, the process proceeds to step S18, and the third determination method is determined (adopted) as the optimum method. In other words, when there is a gradation of a predetermined degree or more in the entire scanned image 300, and the change direction of the gradation of the predetermined degree or more is the vertical direction or the horizontal direction, the original area and the original are used by the third discrimination method. It is determined to be the outer area. Here, a method of dividing the scanned image 300 into a plurality of divided regions 380 and discriminating between the original region and the outer region of the original in each divided region based on the extraction threshold value TH calculated for each divided region (“region division method”). ”) Is used as the third discrimination method. The details of the third discrimination method (region division method) will be described later.

一方、当該所定程度以上のグラデーションの変化方向が斜め方向である旨がステップS15にて判定される場合、処理はステップS19へと進み、第3の判別手法とは異なる第4の判別手法が最適手法として決定(採用)される。換言すれば、スキャン画像300全体に所定程度以上のグラデーションが存在し、且つ当該所定程度以上のグラデーションの変化方向が斜め方向である場合、第4の判別手法を用いて原稿領域と原稿外領域とが判別される。ここでは、スキャン画像300において原稿領域のエッジ候補を抽出し、当該エッジ候補の4点の直交点のうち検出されなかった直交点の位置を残余の直交点の検出位置に基づき推定して、当該4点の直交点に基づき原稿領域と原稿外領域とを判別する手法(「直交点推定手法」とも称する)が、当該第4の判別手法として用いられる。なお、第4の判別手法(直交点推定手法)の詳細については、後述する。 On the other hand, when it is determined in step S15 that the change direction of the gradation of the predetermined degree or more is an oblique direction, the process proceeds to step S19, and the fourth discrimination method different from the third discrimination method is optimal. Determined (adopted) as a method. In other words, when there is a gradation of a predetermined degree or more in the entire scanned image 300 and the change direction of the gradation of the predetermined degree or more is an oblique direction, the original region and the outer region of the original are determined by using the fourth discrimination method. Is determined. Here, edge candidates in the document region are extracted from the scanned image 300, and the positions of the undetected orthogonal points among the four orthogonal points of the edge candidates are estimated based on the detection positions of the remaining orthogonal points. A method of discriminating between a manuscript area and a region outside the manuscript based on four orthogonal points (also referred to as an “orthogonal point estimation method”) is used as the fourth discriminating method. The details of the fourth discrimination method (orthogonal point estimation method) will be described later.

このように、スキャン画像300内の複数の画素の画素値の分布状況が分析され(ステップS13〜S15)、分析結果に基づいて、スキャン画像300に最も適した判別手法(最適手法)が、互いに異なる4種類の判別手法(ステップS16〜S19)の中から決定される。そして、決定された判別手法を用いて原稿領域と原稿外領域とが判別される。 In this way, the distribution of pixel values of a plurality of pixels in the scanned image 300 is analyzed (steps S13 to S15), and based on the analysis results, the most suitable discrimination methods (optimal methods) for the scanned image 300 are mutually It is determined from four different types of discrimination methods (steps S16 to S19). Then, the manuscript area and the non-manuscript area are discriminated by using the determined discrimination method.

その後、原稿領域と原稿外領域とが判別されると、処理はステップS20へと進み、スキャン画像400(後述)から原稿外領域を消去する原稿外消去処理が実行される。具体的には、原稿外領域として判別された領域の画素値が白色データ(詳細には画素値「255」)に置換(補正)される。なお、ここでは、スキャン画像300に関して最適手法として決定された判別手法は、スキャン画像400(後述)に最も適した判別手法でもあり、スキャン画像300に関して最適手法として決定された判別手法を用いて、スキャン画像400において原稿領域と原稿外領域とが判別される。当該スキャン画像400は、後述の本スキャンで生成されるスキャン画像であり、スキャン画像300(プレスキャンで生成されたスキャン画像)と同じ状況で撮像されたスキャン画像である。 After that, when the original area and the outer area are determined, the process proceeds to step S20, and the extra-manuscript erasing process for erasing the outer area from the scanned image 400 (described later) is executed. Specifically, the pixel value of the region determined as the region outside the original document is replaced (corrected) with white data (specifically, the pixel value "255"). Here, the discrimination method determined as the optimum method for the scanned image 300 is also the most suitable discrimination method for the scan image 400 (described later), and the discrimination method determined as the optimum method for the scan image 300 is used. In the scanned image 400, the document area and the area outside the document are discriminated. The scan image 400 is a scan image generated in the main scan described later, and is a scan image captured in the same situation as the scan image 300 (scan image generated by the pre-scan).

つぎに、4種類の判別手法(ステップS16〜S19)の内容について、以下に説明する。 Next, the contents of the four types of discrimination methods (steps S16 to S19) will be described below.

<第1の判別手法(基本判別手法)について>
後述するように、図5のようなスキャン画像300(310)が生成される場合は、複数の判別手法のうち第1の判別手法(基本判別手法)が最適手法として決定される。
<About the first discrimination method (basic discrimination method)>
As will be described later, when the scanned image 300 (310) as shown in FIG. 5 is generated, the first discrimination method (basic discrimination method) among the plurality of discrimination methods is determined as the optimum method.

ここでは、ユーザは、原稿を原稿載置用ガラス面に載置した後、原稿カバー110を全開状態(たとえば原稿カバー110が原稿台140に対して直交する程度に開放された状態)にして(図4も参照)、ジョブの実行指示を付与する。当該実行指示に応答して、MFP10においては、プレスキャンが実行されて(ステップS11)、スキャン画像300が生成される。 Here, after the original is placed on the glass surface for placing the original, the user sets the original cover 110 in the fully open state (for example, the original cover 110 is opened to the extent orthogonal to the original base 140) ( (See also FIG. 4), and a job execution instruction is given. In response to the execution instruction, the MFP 10 executes a pre-scan (step S11) to generate a scanned image 300.

ここにおいて、原稿カバー110が全開状態である場合、光源150から出射されて原稿載置用ガラス面を透過した光のうち、原稿台140上の原稿に当たらなかった光は、受光部に入射せず、当該受光部によって検知されない。この場合、ステップS11においては、受光部によって検知された光の強度等に基づいて、図5のようなスキャン画像310が生成される。当該スキャン画像310においては、原稿に反射した光(比較的強い光)が検知されたことによって、原稿領域内の画素の画素値は比較的大きく(明るく)、原稿外領域の画素の画素値は比較的小さい(暗い)。 Here, when the document cover 110 is in the fully open state, among the light emitted from the light source 150 and transmitted through the glass surface for placing the document, the light that does not hit the document on the platen 140 is incident on the light receiving portion. It is not detected by the light receiving unit. In this case, in step S11, the scanned image 310 as shown in FIG. 5 is generated based on the intensity of the light detected by the light receiving unit and the like. In the scanned image 310, since the light reflected on the document (relatively strong light) is detected, the pixel values of the pixels in the document area are relatively large (bright), and the pixel values of the pixels in the area outside the document are relatively large (bright). Relatively small (dark).

そして、プレスキャンによって生成されたスキャン画像310において、原稿領域と原稿外領域とが推定される(ステップS12)。具体的には、MFP10は、スキャン画像310全体における複数の画素の画素値に関してヒストグラムを生成し、当該ヒストグラムに基づいて、原稿領域のエッジ候補を抽出するための抽出用閾値TH10を暫定的に算出する。そして、暫定的に算出された抽出用閾値TH10に基づいて、スキャン画像310において原稿領域と原稿外領域とが推定される。図6は、スキャン画像310(図5)内の各画素の画素値に関するヒストグラムH10を示す図である。 Then, in the scanned image 310 generated by the pre-scan, the original area and the outer area of the original are estimated (step S12). Specifically, the MFP 10 generates a histogram for the pixel values of a plurality of pixels in the entire scanned image 310, and tentatively calculates an extraction threshold TH10 for extracting edge candidates in the original region based on the histogram. To do. Then, based on the tentatively calculated extraction threshold value TH10, the original region and the outer region of the original are estimated in the scanned image 310. FIG. 6 is a diagram showing a histogram H10 regarding the pixel value of each pixel in the scanned image 310 (FIG. 5).

原稿カバー110が全開状態である場合、スキャン画像310に関して生成されたヒストグラムH10においては、図6に示されるように、比較的大きい画素値(輝度値)Bを有するピークと比較的小さい輝度値Bを有するピークとの2つのピークが形成される。具体的には、ヒストグラムH10にて右側に存在するピークは、比較的強い光が検知された画素が比較的多いことを示し、ヒストグラムH10にて左側に存在するピークは、比較的弱い光が検知された画素が比較的多いことを示す。そして、MFP10は、当該ヒストグラムH10に存在する複数のピーク(ここでは2つのピーク)のうち、最も左側のピーク(最も小さいピーク位置を有するピーク)を、原稿外領域ピークとして検出する。また、MFP10は、当該ヒストグラムH10に存在する複数のピーク(ここでは2つのピーク)のうち、原稿外領域ピークを除く残余のピークを、原稿領域ピークとして検出する。 When the document cover 110 is in the fully open state, in the histogram H10 generated for the scanned image 310, as shown in FIG. 6, a peak having a relatively large pixel value (luminance value) B and a relatively small luminance value B Two peaks are formed with a peak having. Specifically, the peak existing on the right side in the histogram H10 indicates that there are relatively many pixels in which relatively strong light is detected, and the peak existing on the left side in the histogram H10 is detected by relatively weak light. It shows that the number of pixels is relatively large. Then, the MFP 10 detects the leftmost peak (the peak having the smallest peak position) among the plurality of peaks (here, two peaks) existing in the histogram H10 as the extra-manuscript region peak. Further, the MFP 10 detects the remaining peaks other than the peaks in the outer region of the original document as the original region peaks among the plurality of peaks (two peaks in this case) existing in the histogram H10.

そして、当該ヒストグラムH10における当該2つのピークに基づいて、原稿領域のエッジ候補を抽出するための抽出用閾値TH10が暫定的に算出される。たとえば、原稿領域ピークと原稿外領域ピークとの間において、原稿外領域ピークの裾野部分における特定の位置(たとえば、原稿外領域ピークの中腹から裾野にかけて原稿外領域ピークの曲線の傾きの絶対値が所定程度にまで低減した位置)に、当該抽出用閾値TH10が暫定的に設定(仮設定)される。 Then, based on the two peaks in the histogram H10, an extraction threshold value TH10 for extracting edge candidates in the document region is tentatively calculated. For example, between the manuscript region peak and the out-of-manuscript region peak, the absolute value of the slope of the curve of the out-of-manuscript region peak from the middle to the base of the out-of-manuscript region peak is The extraction threshold TH10 is tentatively set (temporarily set) at a position (position reduced to a predetermined degree).

その後、当該暫定的な抽出用閾値TH10に基づいて、スキャン画像310において原稿領域と原稿外領域とが推定される。 Then, based on the provisional extraction threshold TH10, the original region and the extra-manuscript region are estimated in the scanned image 310.

具体的には、スキャン画像310において、ヒストグラムH10(図6)で暫定的に算出された抽出用閾値TH10よりも大きい画素値を有する画素群が、原稿領域内の画素群として決定される。そして、スキャン画像310において、暫定的な抽出用閾値TH10との大小関係に基づいて、スキャン画像310内の各画素に対する二値化処理が実行される。さらに、二値化処理の処理結果に基づいて、原稿領域のエッジ候補を抽出するエッジ抽出処理が実行されて、当該エッジ候補が抽出される。そして、抽出されたエッジ候補で形成される閉領域が、スキャン画像310における原稿領域(仮の原稿領域)として推定され、当該閉領域以外の領域が、原稿外領域(仮の原稿外領域)として推定される。 Specifically, in the scanned image 310, a pixel group having a pixel value larger than the extraction threshold TH10 provisionally calculated by the histogram H10 (FIG. 6) is determined as a pixel group in the document region. Then, in the scan image 310, binarization processing is executed for each pixel in the scan image 310 based on the magnitude relationship with the provisional extraction threshold TH10. Further, an edge extraction process for extracting edge candidates in the original area is executed based on the processing result of the binarization process, and the edge candidates are extracted. Then, the closed region formed by the extracted edge candidates is estimated as the original region (temporary original region) in the scanned image 310, and the region other than the closed region is used as the outer region of the original (temporary outer region). Presumed.

原稿領域と原稿外領域とが推定される(ステップS12)と、スキャン画像300内の複数の画素の画素値の分布状況が分析される(ステップS13〜S15)。そして、原稿領域と原稿外領域とを判別するための4種類の判別手法(ステップS16〜S17)の中から、当該スキャン画像310(410(後述))に最も適した手法(最適手法)が決定される。 When the document area and the area outside the document are estimated (step S12), the distribution of the pixel values of the plurality of pixels in the scanned image 300 is analyzed (steps S13 to S15). Then, the most suitable method (optimal method) for the scanned image 310 (410 (described later)) is determined from the four types of discrimination methods (steps S16 to S17) for discriminating between the document area and the area outside the document. Will be done.

まず、ステップS13においては、スキャン画像310全体に所定程度以上のグラデーションが存在するか否か、が判定される。ここでは、スキャン画像310において、注目縦方向画素列(たとえば左端の縦方向画素列)に所定程度以上のグラデーションは存在しない旨が判定されるとともに、注目横方向画素列(たとえば上端の横方向画素列)においても所定程度以上のグラデーションは存在しない旨が判定される。上述のように、縦方向画素列と横方向画素列とのいずれにおいても所定程度以上のグラデーションが存在しない場合、スキャン画像300全体に所定程度以上のグラデーションが存在しない旨がステップS13にて判定される。そして、処理はステップS14へと進む。 First, in step S13, it is determined whether or not there is a gradation of a predetermined degree or more in the entire scanned image 310. Here, in the scanned image 310, it is determined that the attention vertical pixel row (for example, the leftmost vertical pixel row) does not have a gradation of a predetermined degree or more, and the attention horizontal pixel row (for example, the uppermost horizontal pixel row) is determined. It is determined that there is no gradation above a predetermined level even in the column). As described above, when there is no gradation of a predetermined degree or more in both the vertical pixel row and the horizontal pixel row, it is determined in step S13 that there is no gradation of a predetermined degree or more in the entire scanned image 300. To. Then, the process proceeds to step S14.

ステップS14においては、スキャン画像310(図5参照)全体に関する複数の画素の画素値に関してステップS12にて生成されたヒストグラムH10(図6参照)に基づいて、原稿領域ピークと原稿外領域ピークとの距離が一定程度よりも大きいか否か、が判定される。ここでは、ヒストグラムH10において、2以上のピークが検出され、且つ原稿領域ピークの画素値と原稿外領域ピークの画素値との差分が所定値(たとえば値「50」)よりも大きい。そのため、ヒストグラムH10において、原稿領域ピーク(右側のピーク)と原稿外領域ピーク(左側のピーク)との距離が一定程度よりも大きい旨の条件が充足されると判定される。そして、処理はステップS16へと進み、第1の判別手法(基本判別手法)が最適手法として決定(採用)される。 In step S14, based on the histogram H10 (see FIG. 6) generated in step S12 with respect to the pixel values of the plurality of pixels for the entire scanned image 310 (see FIG. 5), the original region peak and the extra-manuscript region peak are Whether or not the distance is larger than a certain degree is determined. Here, in the histogram H10, two or more peaks are detected, and the difference between the pixel value of the original region peak and the pixel value of the extra-manuscript region peak is larger than a predetermined value (for example, the value “50”). Therefore, in the histogram H10, it is determined that the condition that the distance between the document region peak (the peak on the right side) and the peak outside the document region (the peak on the left side) is larger than a certain degree is satisfied. Then, the process proceeds to step S16, and the first discrimination method (basic discrimination method) is determined (adopted) as the optimum method.

第1の判別手法(基本判別手法)では、ステップS12にて暫定的に算出された抽出用閾値TH10がそのまま用いられて、スキャン画像400(次述)において原稿領域と原稿外領域とが判別される。 In the first discrimination method (basic discrimination method), the extraction threshold value TH10 tentatively calculated in step S12 is used as it is, and the manuscript area and the non-manuscript area are discriminated in the scanned image 400 (described later). To.

具体的には、まず、MFP10は、本スキャン(原稿外消去処理の(本来の)処理対象画像を生成するためのスキャン処理)を実行して、スキャン画像400(ここでは410(図5))を、原稿外領域を消去するための原稿外消去用画像(原稿外消去処理の処理対象画像)として生成する。 Specifically, first, the MFP 10 executes the main scan (scan processing for generating the (original) processing target image of the non-original erasing process), and scan image 400 (here, 410 (FIG. 5)). Is generated as an image for erasing outside the document (image to be processed by the erasing process outside the document) for erasing the area outside the document.

そして、スキャン画像410において、ステップS12にて暫定的に算出(仮設定)された抽出用閾値TH10(スキャン画像310全体に関するヒストグラムH10に基づき算出された抽出用閾値)に基づいて原稿領域のエッジ候補が抽出され、原稿領域と原稿外領域とが判別される。 Then, in the scan image 410, the edge candidate of the document region is based on the extraction threshold value TH10 (extraction threshold value calculated based on the histogram H10 for the entire scan image 310) tentatively calculated (temporarily set) in step S12. Is extracted, and the manuscript area and the non-manuscript area are discriminated.

具体的には、スキャン画像410において、当該抽出用閾値TH10よりも大きい画素値を有する画素群が、原稿領域内の画素群として決定される。そして、スキャン画像410において、抽出用閾値TH10との大小関係に基づいて、スキャン画像410内の各画素に対する二値化処理が実行される。さらに、二値化処理の処理結果に基づいて、原稿領域のエッジ候補が抽出される。そして、抽出されたエッジ候補で形成される閉領域が、スキャン画像410における原稿領域として判別され、当該閉領域以外の領域が、原稿外領域として判別される。 Specifically, in the scanned image 410, a pixel group having a pixel value larger than the extraction threshold TH10 is determined as a pixel group in the document region. Then, in the scan image 410, binarization processing is executed for each pixel in the scan image 410 based on the magnitude relationship with the extraction threshold TH10. Further, edge candidates of the document area are extracted based on the processing result of the binarization process. Then, the closed region formed by the extracted edge candidates is determined as the original region in the scanned image 410, and the region other than the closed region is determined as the outer region of the original.

スキャン画像410にて原稿領域と原稿外領域とが判別されると、第1の判別手法(基本判別手法)は終了し、処理はステップS20へと進む。そして、スキャン画像410から原稿外領域が消去される(ステップS20)。 When the document area and the area outside the document are discriminated by the scanned image 410, the first discriminating method (basic discriminating method) ends, and the process proceeds to step S20. Then, the area outside the document is erased from the scanned image 410 (step S20).

このように、スキャン画像300に所定程度以上のグラデーションが存在せず、且つヒストグラムにおいて原稿領域ピークと原稿外領域ピークとの距離が一定程度よりも大きい旨の条件が充足される場合、スキャン画像300内の複数の画素の画素値に関するヒストグラムに基づき算出された抽出用閾値THに基づいて、原稿領域と原稿外領域とが判別される。 As described above, when the scan image 300 does not have a gradation of a predetermined degree or more and the condition that the distance between the document region peak and the document outer region peak is larger than a certain degree in the histogram is satisfied, the scan image 300 is satisfied. The original area and the outer area of the original are discriminated based on the extraction threshold value TH calculated based on the histogram of the pixel values of the plurality of pixels in the image.

<第2の判別手法(入出力特性調整手法)について>
さて、第1の判別手法(基本判別手法)では、ステップS12にて仮設定された抽出用閾値THがそのまま用いられて、原稿領域と原稿外領域とが判別されている。換言すれば、第1の判別手法では、スキャン画像300内の複数の画素の画素値をそのまま用いて生成されたヒストグラムに基づいて、原稿領域と原稿外領域とが判別されている。
<About the second discrimination method (input / output characteristic adjustment method)>
By the way, in the first discrimination method (basic discrimination method), the extraction threshold value TH tentatively set in step S12 is used as it is, and the document region and the region outside the document are discriminated. In other words, in the first discrimination method, the original region and the non-manuscript region are discriminated based on the histogram generated by using the pixel values of the plurality of pixels in the scanned image 300 as they are.

ここにおいて、スキャン画像300内の複数の画素の画素値がそのまま利用される場合、抽出用閾値THが正確に設定(算出)されないことがある。 Here, when the pixel values of the plurality of pixels in the scanned image 300 are used as they are, the extraction threshold value TH may not be set (calculated) accurately.

具体的には、スキャン画像300において原稿領域の画素の画素値と原稿外領域の画素の画素値との差分が(原稿領域と原稿外領域との境界の周辺領域において)比較的小さい場合、上記基本判別手法を用いて原稿領域と原稿外領域とを正確に判別することができないことがある。 Specifically, when the difference between the pixel value of the pixel in the original area and the pixel value of the pixel in the outer area of the original in the scanned image 300 is relatively small (in the peripheral area of the boundary between the original area and the outer area of the original), the above It may not be possible to accurately discriminate between the original area and the outer area using the basic discrimination method.

たとえば、比較的暗い下地の原稿(たとえば濃い灰色の原稿)は、比較的明るい下地の原稿(たとえば白色の原稿)と比べて、光の反射率が小さい。そのため、比較的暗い下地の原稿がスキャンされる場合、スキャン画像300(320)に関して生成されたヒストグラムH20(H21)(図8参照)において、原稿領域に対応するピークは、比較的小さい輝度値を有する。原稿外領域に対応するピーク(原稿領域ピーク)は、図6と比べると図の左側に大きくシフトし、原稿外領域に対応するピーク(原稿外領域ピーク)に近づく。その結果、たとえば、図8のように、原稿外領域ピークと原稿領域ピークとの両ピークを区別することができなくなり、原稿外領域の画素と原稿領域の画素との双方が混在する単一のピークが形成される。また、仮に、図25のヒストグラムH25のように、原稿外領域ピークと原稿領域ピークとの2つのピークが形成された場合(両ピークが区別できる場合)であっても、当該2つピークは、比較的近い位置に形成される。 For example, a document with a relatively dark background (for example, a dark gray document) has a lower light reflectance than a document with a relatively light background (for example, a white document). Therefore, when a relatively dark background document is scanned, in the histogram H20 (H21) (see FIG. 8) generated for the scanned image 300 (320), the peak corresponding to the document area has a relatively small luminance value. Have. The peak corresponding to the out-of-manuscript region (the peak in the out-of-manuscript region) is largely shifted to the left side of the figure as compared with FIG. As a result, for example, as shown in FIG. 8, it becomes impossible to distinguish between the peaks in the outer region of the original document and the peaks in the original region, and a single pixel in the outer region of the original document and the pixels in the original document region coexist. A peak is formed. Further, even if two peaks, an extra-manuscript region peak and a manuscript region peak, are formed (when both peaks can be distinguished) as in the histogram H25 of FIG. 25, the two peaks are still present. It is formed in a relatively close position.

ヒストグラムにおいて単一のピークが形成される場合(図8参照)、抽出用閾値THとして設定すべき位置(画素値)を特定することは困難である。また、ヒストグラムにおいて2つのピークが形成された場合(図25参照)であっても、当該2つのピーク間の距離が比較的近いときには、原稿外領域ピークの裾野部分における特定の位置に抽出用閾値TH20が精度良く設定されない。その結果、原稿領域と原稿外領域とが正確に判別されない(誤検出が生じてしまう)恐れがある。 When a single peak is formed in the histogram (see FIG. 8), it is difficult to specify the position (pixel value) to be set as the extraction threshold TH. Further, even when two peaks are formed in the histogram (see FIG. 25), when the distance between the two peaks is relatively short, the extraction threshold value is set at a specific position in the foot portion of the peak outside the document. TH20 is not set accurately. As a result, the document area and the area outside the document may not be accurately discriminated (erroneous detection may occur).

この点を考慮して、原稿領域の画素値と原稿外領域の画素値との差が比較的小さいスキャン画像300が生成される場合は、第1の判別手法とは異なる第2の判別手法を最適手法として用いて、原稿領域と原稿外領域とが判別される。具体的には、後述するように、スキャン画像300(320)に関するヒストグラムにおいて原稿領域ピークと原稿外領域ピークとの距離が一定程度よりも大きい旨の条件が充足されない場合、スキャン画像300内の複数の画素の画素値に関して入出力特性調整処理を実行してヒストグラムにおいて各ピーク間の距離を広げることによって、正確な抽出用閾値THが算出される。 In consideration of this point, when the scanned image 300 in which the difference between the pixel value of the document area and the pixel value of the outside document area is relatively small is generated, a second discrimination method different from the first discrimination method is used. It is used as an optimum method to discriminate between the original area and the non-original area. Specifically, as will be described later, when the condition that the distance between the original region peak and the extra-manuscript region peak is larger than a certain degree is not satisfied in the histogram regarding the scanned image 300 (320), a plurality of the scanned image 300 An accurate extraction threshold value TH is calculated by executing input / output characteristic adjustment processing with respect to the pixel value of the pixel to increase the distance between each peak in the histogram.

ここでは、第1の判別手法(基本判別手法)の場合と同様に、原稿カバー110が全開状態でプレスキャンが実行される(ステップS11)ことを想定する。 Here, it is assumed that the prescan is executed with the document cover 110 fully open (step S11), as in the case of the first discrimination method (basic discrimination method).

そして、プレスキャン(ステップS11)にてスキャン画像320(321)(図7参照)が生成された後、当該スキャン画像321において原稿領域と原稿外領域とが推定される(ステップS12)。 Then, after the scanned image 320 (321) (see FIG. 7) is generated in the pre-scan (step S11), the original area and the extra-manuscript area are estimated in the scanned image 321 (step S12).

具体的には、スキャン画像321全体における複数の画素の画素値に関してヒストグラムH20(H21)(図8(あるいは図25)参照)が生成され、当該ヒストグラムH21に基づいて、原稿領域のエッジ候補を抽出するための抽出用閾値TH20(TH21)が暫定的に算出(仮設定)される。 Specifically, a histogram H20 (H21) (see FIG. 8 (or FIG. 25)) is generated for the pixel values of a plurality of pixels in the entire scanned image 321, and edge candidates of the document region are extracted based on the histogram H21. The extraction threshold TH20 (TH21) for this purpose is tentatively calculated (temporarily set).

たとえば、図8のヒストグラムH21が生成される場合には、2つのピークが検出されていないため、当該ヒストグラムH21の特定の位置(たとえば単一のピークの中腹部分において曲線の傾きの絶対値が所定程度にまで低減した位置)に抽出用閾値TH21が暫定的に設定される。 For example, when the histogram H21 of FIG. 8 is generated, since two peaks are not detected, the absolute value of the slope of the curve is predetermined at a specific position of the histogram H21 (for example, in the middle portion of a single peak). The extraction threshold TH21 is tentatively set at the position (position reduced to the extent).

また、図25のヒストグラムH21が生成される場合には、2つのピークが検出されているため、原稿外領域ピークと原稿領域ピークとの間において抽出用閾値TH21が暫定的に設定される。その後、第1の判別手法と同様にして、スキャン画像321にて原稿領域と原稿外領域とが推定される。 Further, when the histogram H21 of FIG. 25 is generated, since two peaks are detected, the extraction threshold TH21 is tentatively set between the peak outside the original region and the peak in the original region. After that, in the same manner as in the first discrimination method, the original region and the outer region of the original are estimated from the scanned image 321.

原稿領域と原稿外領域とが推定される(ステップS12)と、スキャン画像321内の複数の画素の画素値の分布状況が分析される(ステップS13〜S15)。 When the document area and the area outside the document are estimated (step S12), the distribution of pixel values of the plurality of pixels in the scanned image 321 is analyzed (steps S13 to S15).

ここでは、ステップS13において、スキャン画像310(図5)と同様に、スキャン画像321(図7)内に所定程度以上のグラデーションが存在しない旨が判定される。そして、処理はステップS14へと進む。 Here, in step S13, it is determined that, similarly to the scanned image 310 (FIG. 5), there is no gradation of a predetermined degree or more in the scanned image 321 (FIG. 7). Then, the process proceeds to step S14.

ステップS14においては、スキャン画像321(図7参照)全体における複数の画素の画素値に関してステップS12にて生成されたヒストグラムH21において原稿領域ピークと原稿外領域ピークとの距離が一定程度よりも大きい旨の条件が充足されるか否か、が判定される。 In step S14, the distance between the document region peak and the document outside region peak is larger than a certain level in the histogram H21 generated in step S12 with respect to the pixel values of the plurality of pixels in the entire scanned image 321 (see FIG. 7). It is determined whether or not the condition of is satisfied.

たとえば、図8のヒストグラムH21が生成される場合には、2以上のピークが検出されず当該2つのピーク間の距離を求めること自体ができないため、ヒストグラムH21において原稿領域ピークと原稿外領域ピークとの距離が一定程度よりも大きい旨の条件が充足されないと判定される。 For example, when the histogram H21 of FIG. 8 is generated, two or more peaks are not detected and the distance between the two peaks cannot be obtained. It is determined that the condition that the distance is larger than a certain degree is not satisfied.

また、図25のヒストグラムH21が生成される場合には、当該2つのピーク間の距離が求められるものの、ヒストグラムH21において原稿領域ピークと原稿外領域ピークとの距離が一定程度よりも小さい旨が判定される。そして、ヒストグラムH21において原稿領域ピークと原稿外領域ピークとの距離が一定程度よりも大きい旨の条件が充足されないと判定される。 Further, when the histogram H21 of FIG. 25 is generated, the distance between the two peaks is obtained, but it is determined in the histogram H21 that the distance between the original region peak and the outer region peak is smaller than a certain degree. Will be done. Then, in the histogram H21, it is determined that the condition that the distance between the document region peak and the document outer region peak is larger than a certain degree is not satisfied.

そして、処理はステップS17へと進み、第2の判別手法(入出力特性調整手法)が、スキャン画像321(420(後述))に最も適した最適手法として決定(採用)される。 Then, the process proceeds to step S17, and the second discrimination method (input / output characteristic adjustment method) is determined (adopted) as the most suitable optimum method for the scanned image 321 (420 (described later)).

第2の判別手法(入出力特性調整手法)では、ステップS12にて暫定的に算出された抽出用閾値TH20(TH21)は用いられず、入出力特性が調整されて新たな抽出用閾値TH20(TH25)(図9も参照)が算出される。そして、当該新たな抽出用閾値TH25に基づいて、原稿領域と原稿外領域とが判別される。 In the second discrimination method (input / output characteristic adjustment method), the extraction threshold value TH20 (TH21) tentatively calculated in step S12 is not used, and the input / output characteristics are adjusted to create a new extraction threshold value TH20 (TH20). TH25) (see also FIG. 9) is calculated. Then, the original region and the outer region of the original are discriminated based on the new extraction threshold TH25.

具体的には、MFP10は、プレスキャンを再度実行して(換言すれば、2回目のプレスキャンを実行し)、スキャン画像320(322)(不図示)を新たに生成する。当該スキャン画像322は、後述の入出力特性調整処理後の入出力特性に基づくA/D変換によって得られる画像である。そして、MFP10は、当該スキャン画像322に基づいて、当該新たな抽出用閾値TH25を算出する。 Specifically, the MFP 10 re-executes the pre-scan (in other words, executes the second pre-scan) to newly generate the scanned image 320 (322) (not shown). The scanned image 322 is an image obtained by A / D conversion based on the input / output characteristics after the input / output characteristic adjustment processing described later. Then, the MFP 10 calculates the new extraction threshold TH25 based on the scanned image 322.

詳細には、MFP10は、2回目のプレスキャンに先立って、スキャン画像321内の複数の画素の画素値を決定するための入出力特性を調整する入出力特性調整処理(いわゆるゲイン調整処理)を実行する。より詳細には、図9に示されるように、入出力特性調整処理前の入出力特性における出力範囲の一部の範囲R1(スキャン画像321に関するヒストグラムH21において一定程度以上の度数を有する画素値を含む部分的範囲(図8も参照))が、より広い出力範囲R2(ここでは全範囲)となるように、入出力特性が調整される。すなわち、入出力特性の調整処理によって、入力値(CCDの各画素(受光素子)で光電変換作用により生成された電荷量(アナログ値))と出力値(画素値(デジタル値))との対応関係が変更され、特定範囲W1の入力値に対応する出力値の範囲が範囲R1からR2に増大される(図9参照)。これにより、特定範囲W1の入力値に対してより適切に量子化が行われる。 Specifically, the MFP 10 performs input / output characteristic adjustment processing (so-called gain adjustment processing) for adjusting input / output characteristics for determining pixel values of a plurality of pixels in the scanned image 321 prior to the second prescan. Run. More specifically, as shown in FIG. 9, a part range R1 of the output range in the input / output characteristics before the input / output characteristic adjustment processing (pixel value having a frequency of a certain degree or more in the histogram H21 regarding the scanned image 321) is used. The input / output characteristics are adjusted so that the included partial range (see also FIG. 8) is the wider output range R2 (here, the entire range). That is, by adjusting the input / output characteristics, the correspondence between the input value (the amount of charge (analog value) generated by the photoelectric conversion action in each pixel (light receiving element) of the CCD) and the output value (pixel value (digital value)). The relationship is changed and the range of output values corresponding to the input values of the specific range W1 is increased from the range R1 to R2 (see FIG. 9). As a result, the input value in the specific range W1 is quantized more appropriately.

そして、2回目のプレスキャンが実行される。当該2回目のプレスキャンにおいては、入出力特性調整処理後の入出力特性に基づいて、スキャン画像322内の複数の画素の画素値がそれぞれ求められる。入出力特性調整処理後の入出力特性に基づき新たな画素値(階調値)が得られると、MFP10は、当該新たな画素値に関してヒストグラムH22(図10)を新たに生成する。 Then, the second prescan is executed. In the second pre-scan, the pixel values of the plurality of pixels in the scanned image 322 are obtained based on the input / output characteristics after the input / output characteristic adjustment processing. When a new pixel value (gradation value) is obtained based on the input / output characteristic after the input / output characteristic adjustment processing, the MFP 10 newly generates a histogram H22 (FIG. 10) with respect to the new pixel value.

図10は、新たなヒストグラムH22を示す図である。図10に示されるように、入出力特性が調整されたことによって、調整後の入出力特性に基づき得られた画素値に関するヒストグラムH22においては、原稿領域ピークと原稿外領域ピークとの2つのピークがより正確に形成される。 FIG. 10 is a diagram showing a new histogram H22. As shown in FIG. 10, in the histogram H22 regarding the pixel values obtained based on the adjusted input / output characteristics due to the adjustment of the input / output characteristics, there are two peaks, a document region peak and an outside document region peak. Is formed more accurately.

そして、MFP10は、新たなヒストグラムH22に基づいて仮の抽出用閾値TH22(図10参照)を算出するとともに、入出力特性調整処理前の入出力特性において当該仮の抽出用閾値TH22に対応する値を、スキャン画像321に関する新たな抽出用閾値TH25として算出する。 Then, the MFP 10 calculates a temporary extraction threshold value TH22 (see FIG. 10) based on the new histogram H22, and has a value corresponding to the temporary extraction threshold value TH22 in the input / output characteristics before the input / output characteristic adjustment processing. Is calculated as a new extraction threshold TH25 for the scanned image 321.

具体的には、入出力特性調整処理後の入出力特性に基づいて、仮の抽出用閾値TH22を出力するときの入力値V1(図9参照)が求められる。そして、入出力特性調整処理前の入出力特性に基づいて、当該入力値V1(図9)に対応する出力値が、スキャン画像321に関する新たな抽出用閾値TH25として算出される。 Specifically, the input value V1 (see FIG. 9) when the temporary extraction threshold value TH22 is output is obtained based on the input / output characteristics after the input / output characteristic adjustment processing. Then, based on the input / output characteristics before the input / output characteristic adjustment processing, the output value corresponding to the input value V1 (FIG. 9) is calculated as a new extraction threshold TH25 for the scanned image 321.

このように、原稿領域の画素値と原稿外領域の画素値との差が比較的小さいスキャン画像321(図7)が生成される場合は、入出力特性の調整処理が実行され、入出力特性調整処理後の入出力特性に基づいて得られた画素値の新たなヒストグラムH22に基づいて、新たな抽出用閾値TH25が算出される。 When the scanned image 321 (FIG. 7) in which the difference between the pixel value of the original area and the pixel value of the outer area of the original is relatively small is generated in this way, the input / output characteristic adjustment process is executed, and the input / output characteristic is adjusted. A new extraction threshold TH25 is calculated based on a new histogram H22 of pixel values obtained based on the input / output characteristics after the adjustment process.

ここにおいて、入出力特性調整処理前の入出力特性では、A/D変換に際して、2つの入力値が微少な相違を有していたとしても、量子化誤差によって同じ出力値(画素値)に変換される。換言すれば、特定範囲W1の入力値が適切な出力値(画素値)に変換されない。その結果、たとえば図8のように、入出力特性調整処理前の入出力特性に関するヒストグラムH21においては、「山」(原稿領域ピークおよび原稿外領域ピーク)および「谷」が出現せず、正確な抽出用閾値THが算出されないことがある。 Here, in the input / output characteristics before the input / output characteristic adjustment processing, even if the two input values have a slight difference in A / D conversion, they are converted to the same output value (pixel value) due to the quantization error. Will be done. In other words, the input value of the specific range W1 is not converted into an appropriate output value (pixel value). As a result, for example, as shown in FIG. 8, in the histogram H21 regarding the input / output characteristics before the input / output characteristic adjustment processing, “peaks” (manuscript region peaks and extra-manuscript region peaks) and “valleys” do not appear and are accurate. The extraction threshold TH may not be calculated.

これに対して、入出力特性の調整処理が行われることによって、入出力特性調整処理後の入出力特性では、微少な相違を有する2つの入力値が別異の出力値に変換される。換言すれば、量子化に伴う誤差等が軽減され、より適切に量子化が行われる。 On the other hand, by performing the input / output characteristic adjustment processing, in the input / output characteristics after the input / output characteristic adjustment processing, two input values having a slight difference are converted into different output values. In other words, errors and the like associated with quantization are reduced, and quantization is performed more appropriately.

その結果、図10のように、入出力特性調整処理後の入出力特性に関するヒストグラムH22においては、入出力特性調整処理前に現れていなかった「山」および「谷」が出現する。換言すれば、入出力特性の調整処理によって、当該ヒストグラムH22において、原稿領域ピークと原稿外領域ピークとが出現するとともに、両ピーク間に「谷」が出現する。そのため、当該ヒストグラムH22に基づいて正確な抽出用閾値TH25を算出することが可能である。 As a result, as shown in FIG. 10, in the histogram H22 regarding the input / output characteristics after the input / output characteristic adjustment processing, “mountains” and “valleys” that did not appear before the input / output characteristic adjustment processing appear. In other words, due to the input / output characteristic adjustment process, the original region peak and the extra-manuscript region peak appear in the histogram H22, and a “valley” appears between the two peaks. Therefore, it is possible to calculate an accurate extraction threshold TH25 based on the histogram H22.

新たな抽出用閾値TH25が算出されると、MFP10は、本スキャンを実行して、スキャン画像400(420)(図7)を生成する。そして、MFP10は、新たに算出された抽出用閾値TH25(スキャン画像320全体に関する抽出用閾値)に基づいて、原稿領域と原稿外領域とを判別する。具体的には、新たな抽出用閾値TH25との大小関係に基づいて、当該スキャン画像420内の各画素に関して二値化処理が実行され、処理結果に基づいて原稿領域のエッジ候補が抽出される。原稿領域のエッジ候補が抽出されると、スキャン画像420において当該エッジ候補で形成される閉領域が原稿領域として判別され、スキャン画像420において当該閉領域以外の領域が原稿外領域として判別される。 When the new extraction threshold TH25 is calculated, the MFP 10 executes the main scan to generate the scanned images 400 (420) (FIG. 7). Then, the MFP 10 discriminates between the manuscript area and the non-manuscript area based on the newly calculated extraction threshold value TH25 (extraction threshold value for the entire scanned image 320). Specifically, binarization processing is executed for each pixel in the scanned image 420 based on the magnitude relationship with the new extraction threshold TH25, and edge candidates of the original region are extracted based on the processing result. .. When the edge candidates of the document area are extracted, the closed area formed by the edge candidates is determined as the document area in the scanned image 420, and the area other than the closed area is determined as the outside document area in the scanned image 420.

スキャン画像420にて原稿領域と原稿外領域とが判別されると、第2の判別手法は終了し、処理はステップS20へと進む。そして、スキャン画像420から原稿外領域が消去される(ステップS20)。 When the document region and the region outside the document are discriminated by the scanned image 420, the second discriminating method ends, and the process proceeds to step S20. Then, the area outside the document is erased from the scanned image 420 (step S20).

このように、スキャン画像300内に所定程度以上のグラデーションが存在せず、且つ当該スキャン画像300に関するヒストグラムにおいて原稿領域ピークと原稿外領域ピークとの距離が一定程度よりも大きい旨の条件が充足されない場合、スキャン画像300内の複数の画素の画素値に関して入出力特性調整処理が実行される。そして、入出力特性調整処理後の入出力特性に基づいて得られた画素値の新たなヒストグラムH22に基づいて、新たな抽出用閾値TH25が算出される。端的に言えば、入出力特性の調整処理によってスキャン画像300に関してより正確なヒストグラムが生成され、当該ヒストグラムに基づいて、より正確な抽出用閾値TH25が算出される。したがって、スキャン画像300において原稿領域内の画素の画素値と原稿外領域の画素の画素値との差分が一定程度よりも小さい場合であっても、原稿領域と原稿外領域とをより正確に(良好に)判別することが可能である。 As described above, the condition that the gradation of a predetermined degree or more does not exist in the scanned image 300 and the distance between the original region peak and the extra-manuscript region peak is larger than a certain degree is not satisfied in the histogram related to the scanned image 300. In this case, the input / output characteristic adjustment process is executed for the pixel values of the plurality of pixels in the scanned image 300. Then, a new extraction threshold value TH25 is calculated based on the new histogram H22 of the pixel values obtained based on the input / output characteristics after the input / output characteristic adjustment processing. In short, the input / output characteristic adjustment process generates a more accurate histogram for the scanned image 300, and a more accurate extraction threshold TH25 is calculated based on the histogram. Therefore, even when the difference between the pixel value of the pixel in the document area and the pixel value of the pixel in the outside area of the document is smaller than a certain level in the scanned image 300, the document area and the outside area of the document can be more accurately determined. It is possible to discriminate (good).

<第3の判別手法(領域分割手法)について>
さて、第1および第2の判別手法では、スキャン画像300全体に関する抽出用閾値THに基づいて、原稿領域と原稿外領域とが判別されている。
<About the third discrimination method (area division method)>
By the way, in the first and second discrimination methods, the original region and the non-manuscript region are discriminated based on the extraction threshold value TH for the entire scanned image 300.

ここにおいて、原稿カバーが半開き状態(全開状態に対して半分程度閉じられた状態)である場合、上記課題欄にて説明したように、スキャン画像300内に所定程度以上のグラデーションが生じ、スキャン画像300全体に関する抽出用閾値THを正確に算出することができないことがある。その結果、原稿領域と原稿外領域とが正確に判別されないことがある。 Here, when the document cover is in the half-opened state (a state in which the document cover is closed by about half with respect to the fully opened state), as described in the above-mentioned problem column, a gradation of a predetermined degree or more is generated in the scanned image 300, and the scanned image is scanned. It may not be possible to accurately calculate the extraction threshold TH for the entire 300. As a result, the document area and the area outside the document may not be accurately discriminated.

具体的には、図11に示されるように、原稿カバー110が半開き状態である場合、光源150から出射されて原稿載置用ガラス面を透過した光の一部が原稿カバー110の反射板120に当たって反射し、反射光が原稿載置用ガラス面を再び透過して受光部に入射する。この場合、原稿台140の一方側(ここでは奥行方向の奥側(ヒンジ部130に近い側))に比較的多くの反射光が入射し、他方側(手前側)には反射光はほとんど入射しない。そのため、原稿に関するスキャン画像300(330)においては、図12に示されるように、縦方向(主走査方向)(ヒンジ部130(図11)の回転軸に対して直交する方向)のグラデーションが生じる。詳細には、スキャン画像330(図12参照)において、比較的多くの反射光が入射した部分(原稿載置用ガラス面の奥行方向における奥側(ヒンジ部130に近い側))の輝度値が大きく、縦方向(主走査方向)の位置が当該奥側から手前側(ヒンジ部130に近い側から操作パネル部6cに近い側)へと向かうにつれて画素値(輝度値)が徐々に減少するグラデーションが生じる。 Specifically, as shown in FIG. 11, when the document cover 110 is in the half-open state, a part of the light emitted from the light source 150 and transmitted through the glass surface for placing the document is partly transmitted through the reflector 120 of the document cover 110. The reflected light is transmitted again through the glass surface for placing the document and is incident on the light receiving portion. In this case, a relatively large amount of reflected light is incident on one side of the platen 140 (here, the back side in the depth direction (the side closer to the hinge portion 130)), and the reflected light is almost incident on the other side (front side). do not do. Therefore, in the scanned image 300 (330) relating to the original, as shown in FIG. 12, a gradation in the vertical direction (main scanning direction) (direction orthogonal to the rotation axis of the hinge portion 130 (FIG. 11)) occurs. .. Specifically, in the scanned image 330 (see FIG. 12), the brightness value of the portion where a relatively large amount of reflected light is incident (the back side in the depth direction of the glass surface for placing the document (the side closer to the hinge portion 130)) is measured. A large gradation in which the pixel value (luminance value) gradually decreases as the position in the vertical direction (main scanning direction) moves from the back side to the front side (from the side close to the hinge portion 130 to the side close to the operation panel portion 6c). Occurs.

このようなグラデーションを有するスキャン画像330全体に関するヒストグラムH30においては、原稿領域に対応するピークと原稿外領域に対応するピークとの2つのピークは形成されず、単一のピークが形成される(図13参照)。当該単一のピークを有するヒストグラムH30においては、抽出用閾値THとして設定すべき位置(画素値)を特定することは困難である。また、仮に暫定的な位置に閾値TH30が設定される場合、原稿領域と原稿外領域とが正確に判別されない。たとえば、単一のピークにおける左側の裾野部分に抽出用閾値TH30が暫定的に設定された場合(図13参照)、原稿領域と原稿外領域との双方の画素が当該単一のピークに混在することによって、スキャン画像においては、図23に示されるように、原稿領域と原稿外領域とが正確に判別されない。 In the histogram H30 for the entire scanned image 330 having such a gradation, two peaks, a peak corresponding to the document region and a peak corresponding to the outside region, are not formed, but a single peak is formed (FIG. 6). See 13). In the histogram H30 having the single peak, it is difficult to specify the position (pixel value) to be set as the extraction threshold TH. Further, if the threshold value TH30 is set at a provisional position, the original area and the outer area of the original cannot be accurately discriminated. For example, when the extraction threshold TH30 is tentatively set in the left foot portion of a single peak (see FIG. 13), both pixels of the manuscript area and the non-manuscript area are mixed in the single peak. As a result, in the scanned image, as shown in FIG. 23, the original area and the outer area of the original cannot be accurately discriminated.

この点を考慮して、スキャン画像300に所定程度以上のグラデーションが存在し、且つ当該所定程度以上のグラデーションの変化方向が縦方向あるいは横方向である場合は、第3の判別手法(領域分割手法)を用いて原稿領域と原稿外領域とが判別される。具体的には、後述するように、当該スキャン画像300(330)が当該グラデーションの変化方向に区分されて複数の分割領域380に分割され、分割領域380毎に抽出用閾値TH(TH30)が算出される。そして、分割領域380毎の抽出用閾値TH30に基づいて各分割領域380において原稿領域のエッジ候補が抽出されて、原稿領域と原稿外領域とが判別される。 In consideration of this point, when the scanned image 300 has a gradation of a predetermined degree or more and the change direction of the gradation of the predetermined degree or more is the vertical direction or the horizontal direction, a third discrimination method (region division method) ) Is used to distinguish between the original area and the outer area. Specifically, as will be described later, the scanned image 300 (330) is divided in the changing direction of the gradation and divided into a plurality of divided regions 380, and the extraction threshold value TH (TH30) is calculated for each divided region 380. Will be done. Then, edge candidates of the document region are extracted in each division region 380 based on the extraction threshold TH30 for each division region 380, and the document region and the region outside the document are discriminated.

ここでは、ユーザは、原稿を原稿載置用ガラス面に載置した後、原稿カバー110を半開き状態にしてジョブの実行指示を付与する。 Here, the user places the document on the glass surface for placing the document, and then opens the document cover 110 in a half-opened state to give a job execution instruction.

MFP10においては、当該実行指示に応答してプレスキャンが実行され(ステップS11)、スキャン画像330(図12)が生成される。 In the MFP 10, a pre-scan is executed in response to the execution instruction (step S11), and a scan image 330 (FIG. 12) is generated.

そして、当該スキャン画像330において原稿領域と原稿外領域とが推定される(ステップS12)。具体的には、スキャン画像330全体における複数の画素の画素値に関してヒストグラムH30(図13参照)が生成され、当該ヒストグラムH30に基づいて、原稿領域のエッジ候補を抽出するための抽出用閾値TH30が暫定的に設定される。ここでは、上述のように、単一のピークにおける左側の裾野部分に暫定的な抽出用閾値TH30が設定(仮設定)される。そして、スキャン画像330において、暫定的に算出された抽出用閾値TH30に基づいて、原稿領域と原稿外領域とが推定される(図23も参照)。 Then, the original area and the outer area of the original are estimated in the scanned image 330 (step S12). Specifically, a histogram H30 (see FIG. 13) is generated for the pixel values of a plurality of pixels in the entire scanned image 330, and an extraction threshold TH30 for extracting edge candidates in the document region is set based on the histogram H30. Temporarily set. Here, as described above, a provisional extraction threshold TH30 is set (temporarily set) at the left foot portion of a single peak. Then, in the scanned image 330, the original region and the extra-manuscript region are estimated based on the provisionally calculated extraction threshold TH30 (see also FIG. 23).

原稿領域と原稿外領域とが推定される(ステップS12)と、スキャン画像330内の複数の画素の画素値の分布状況が分析される(ステップS13〜S15)。 When the document area and the area outside the document are estimated (step S12), the distribution of pixel values of the plurality of pixels in the scanned image 330 is analyzed (steps S13 to S15).

まず、ステップS13においては、スキャン画像330全体に所定程度以上のグラデーションが存在するか否か、が判定される。具体的には、スキャン画像330における縦方向画素列と横方向画素列との少なくとも一方に所定程度以上のグラデーションが存在するか否か、が判定される。 First, in step S13, it is determined whether or not there is a gradation of a predetermined degree or more in the entire scanned image 330. Specifically, it is determined whether or not there is a gradation of a predetermined degree or more in at least one of the vertical pixel row and the horizontal pixel row in the scanned image 330.

ここでは、スキャン画像330(図12)にて推定された原稿外領域における縦方向の特定の画素列を含む注目縦方向画素列(たとえば左端の縦方向画素列)に関して、当該注目縦方向画素列の伸延方向における複数の画素の画素値が徐々に変化し且つ当該複数の画素の画素値の変動幅が所定程度を超えている旨(所定の変化特性を有する旨)、が判定される。換言すれば、スキャン画像330の縦方向画素列に所定程度以上のグラデーションが存在する旨が判定される。なお、ここでは、スキャン画像330にて推定された原稿外領域における横方向の特定の画素列を含む注目横方向画素列(たとえば上端の横方向画素列)に関しては、当該所定の変化特性を有しない旨が判定される。換言すれば、スキャン画像330の横方向画素列には所定程度以上のグラデーションは存在しない旨が判定される。 Here, with respect to the vertical pixel sequence of interest (for example, the vertical pixel string at the left end) including a specific pixel array in the vertical direction in the region outside the document estimated from the scanned image 330 (FIG. 12), the vertical pixel array of interest. It is determined that the pixel values of the plurality of pixels in the extension direction gradually change and the fluctuation range of the pixel values of the plurality of pixels exceeds a predetermined degree (meaning that the plurality of pixels have a predetermined change characteristic). In other words, it is determined that the vertical pixel sequence of the scanned image 330 has a gradation of a predetermined degree or more. Here, the attention horizontal pixel sequence (for example, the horizontal pixel sequence at the upper end) including the specific pixel sequence in the horizontal direction in the region outside the document estimated by the scanned image 330 has the predetermined change characteristic. It is determined not to do so. In other words, it is determined that there is no gradation of a predetermined degree or more in the horizontal pixel sequence of the scanned image 330.

そして、スキャン画像330における縦方向画素列と横方向画素列との少なくとも一方(ここでは縦方向画素列)に所定程度以上のグラデーションが存在する場合、スキャン画像330全体に所定程度以上のグラデーションが存在する旨がステップS13にて判定され、処理はステップS15へと進む。 When at least one of the vertical pixel row and the horizontal pixel row (here, the vertical pixel row) in the scanned image 330 has a gradation of a predetermined degree or more, the entire scanned image 330 has a gradation of a predetermined degree or more. It is determined in step S13 that the process is to be performed, and the process proceeds to step S15.

ステップS15においては、スキャン画像300(330)における縦方向画素列と横方向画素列との双方における所定程度以上のグラデーションの存否判定の判定結果に基づいて、当該所定程度以上のグラデーションの変化方向が分析(判定)される。具体的には、スキャン画像330全体における所定程度以上のグラデーションの変化方向が縦方向と横方向と斜め方向とのいずれであるか、が判定される。 In step S15, the change direction of the gradation of the predetermined degree or more is determined based on the determination result of the presence / absence determination of the gradation of the predetermined degree or more in both the vertical pixel row and the horizontal pixel row in the scanned image 300 (330). It is analyzed (judged). Specifically, it is determined whether the change direction of the gradation of a predetermined degree or more in the entire scanned image 330 is the vertical direction, the horizontal direction, or the diagonal direction.

ここでは、上述のように、スキャン画像330(図12)の縦方向画素列に所定程度以上のグラデーションが存在しているものの、横方向画素列には当該所定程度以上のグラデーションは存在していない。この場合、MFP10は、スキャン画像330全体における所定程度以上のグラデーションの変化方向は縦方向であると判定する。そして、スキャン画像330全体における当該所定程度以上のグラデーションの変化方向が縦方向である旨がステップS15にて判定され、処理はステップS18へと進み、第3の判別手法(領域分割手法)が、スキャン画像330(430(後述))に最も適した最適手法として決定(採用)される。 Here, as described above, although the vertical pixel array of the scanned image 330 (FIG. 12) has a gradation of a predetermined degree or more, the horizontal pixel array does not have a gradation of a predetermined degree or more. .. In this case, the MFP 10 determines that the change direction of the gradation of a predetermined degree or more in the entire scanned image 330 is the vertical direction. Then, it is determined in step S15 that the change direction of the gradation of the predetermined degree or more in the entire scanned image 330 is the vertical direction, the process proceeds to step S18, and the third determination method (region division method) is performed. It is determined (adopted) as the most suitable optimum method for the scanned image 330 (430 (described later)).

第3の判別手法(領域分割手法)では、スキャン画像300(330)が複数の分割領域380に分割され、分割領域380毎に抽出用閾値TH(TH30)が算出される。そして、分割領域380毎の抽出用閾値TH30に基づいて、各分割領域380において原稿領域と原稿外領域とが判別される。 In the third discrimination method (region division method), the scanned image 300 (330) is divided into a plurality of division regions 380, and the extraction threshold value TH (TH30) is calculated for each division region 380. Then, based on the extraction threshold value TH30 for each division area 380, the original area and the non-manuscript area are discriminated in each division area 380.

具体的には、MFP10は、スキャン画像330全体における所定程度以上のグラデーションの方向が縦方向である場合、当該スキャン画像330を、当該グラデーションの方向(すなわち縦方向)に区分して複数の分割領域380(たとえば予め定められた分割数の分割領域381〜384)に分割する(図14参照)。ここでは、予め定められた分割数(たとえば4つ)に基づいて、スキャン画像330が4分割される。 Specifically, when the direction of the gradation of a predetermined degree or more in the entire scanned image 330 is the vertical direction, the MFP 10 divides the scanned image 330 into the direction of the gradation (that is, the vertical direction) and divides the scanned image 330 into a plurality of divided regions. It is divided into 380 (for example, a predetermined number of division areas 381 to 384) (see FIG. 14). Here, the scanned image 330 is divided into four based on a predetermined number of divisions (for example, four).

なお、スキャン画像300全体におけるグラデーションの変化方向が横方向である場合は、当該スキャン画像300は横方向に分割される。たとえば、原稿カバー110の開閉用のヒンジ部130が原稿台140における左右方向のいずれかの端部(たとえば左端部)に設けられている場合(すなわちヒンジ部130の回転軸が主走査方向に対して平行に設けられている場合)、原稿カバー110が半開き状態でスキャンされて生成されたスキャン画像300(335)は、横方向のグラデーションを有する(図24参照)。この場合、当該スキャン画像335は、当該グラデーションの方向(ここでは横方向)に区分されて複数の分割領域に分割される(図24参照)。 When the gradation change direction in the entire scanned image 300 is the horizontal direction, the scanned image 300 is divided in the horizontal direction. For example, when the hinge portion 130 for opening and closing the document cover 110 is provided at either end (for example, the left end) in the left-right direction of the platen 140 (that is, the rotation axis of the hinge 130 is relative to the main scanning direction). The scanned image 300 (335) generated by scanning the document cover 110 in a half-opened state has a lateral gradation (see FIG. 24). In this case, the scanned image 335 is divided in the direction of the gradation (here, the horizontal direction) and divided into a plurality of divided areas (see FIG. 24).

スキャン画像330が分割されると、MFP10は、各分割領域381〜384内の各画素の画素値に関するヒストグラムH31〜H34(図14、図15参照)をそれぞれ生成し、分割領域381〜384毎に抽出用閾値TH31〜TH34を算出する。 When the scanned image 330 is divided, the MFP 10 generates histograms H31 to H34 (see FIGS. 14 and 15) relating to the pixel values of each pixel in each of the divided areas 381 to 384, and for each of the divided areas 381 to 384. The extraction thresholds TH31 to TH34 are calculated.

ここにおいて、分割領域381〜384のいずれにおいても、原稿領域内の画素(原稿の下地の画素)の画素値は、(基本的には)変動しない(一定である)。 Here, in any of the divided regions 381 to 384, the pixel value of the pixels (the pixels on the base of the original) in the original region does not (basically) change (is constant).

この点を考慮して、MFP10は、2以上のヒストグラムにおける共通の位置(画素値)にそのピーク位置(ピーク値に対応する位置(画素値))を有するピーク(共通位置ピークとも称する)を、原稿領域に対応するピーク(原稿領域ピーク)として判定する。また、MFP10は、当該共通位置ピーク以外のピーク(当該共通の位置とは異なる位置にそのピーク位置を有するピーク)(非共通位置ピークとも称する)のうち、最も大きい度数(最大度数)を有する非共通位置ピークを、原稿外領域に対応するピーク(原稿外領域ピーク)として判定する。 In consideration of this point, the MFP 10 uses a peak (also referred to as a common position peak) having its peak position (position corresponding to the peak value (pixel value)) at a common position (pixel value) in two or more histograms. Judged as a peak corresponding to the original area (original area peak). Further, the MFP 10 has the highest frequency (maximum frequency) among the peaks other than the common position peak (peaks having the peak position at a position different from the common position) (also referred to as non-common position peaks). The common position peak is determined as a peak corresponding to the region outside the document (peak outside the document).

具体的には、図15に示されるように、ヒストグラムH31,H33,H34においては、それぞれ、共通の位置にピークが存在している。この場合、MFP10は、当該共通の位置に存在するピーク(共通位置ピーク)を検出し、当該共通位置ピークを、ヒストグラムH31,H33,H34において、原稿領域ピークとして判定する。また、複数のピークのうち共通位置ピーク以外のピークが非共通位置ピークとして検出され、当該非共通位置ピークのうち最も大きい度数(最大度数)を有するピークが、原稿外領域ピークとして判定される。 Specifically, as shown in FIG. 15, in the histograms H31, H33, and H34, peaks exist at common positions, respectively. In this case, the MFP 10 detects a peak existing at the common position (common position peak), and determines the common position peak as a document region peak in the histograms H31, H33, and H34. Further, among the plurality of peaks, peaks other than the common position peak are detected as non-common position peaks, and the peak having the highest frequency (maximum frequency) among the non-common position peaks is determined as the out-of-manuscript region peak.

たとえば、ヒストグラムH33,H34においては、2つのピークのうちの右側のピークが原稿領域ピークとして判定され、左側のピークが原稿外領域ピークとして判定される。また、ヒストグラムH31においては、2つのピークのうちの左側のピークが原稿領域ピークとして判定され、右側のピークが原稿外領域ピークとして判定される。 For example, in the histograms H33 and H34, the peak on the right side of the two peaks is determined as the original region peak, and the peak on the left side is determined as the extra-manuscript region peak. Further, in the histogram H31, the peak on the left side of the two peaks is determined as the peak in the document region, and the peak on the right side is determined as the peak in the region outside the document.

そして、ヒストグラムH31,H33,H34(2以上のピークが存在するヒストグラム)のそれぞれに基づいて、各ヒストグラムH31,H33,H34に対応する各分割領域381,383,384に関する各抽出用閾値TH31,TH33,TH34が算出される。具体的には、各ヒストグラムH31,H33,H34における共通位置ピークと非共通位置ピークとの間において、共通位置ピークの裾野部分における特定の位置が、分割領域381,383,384に関する抽出用閾値TH31,TH33,TH34として算出される。 Then, based on each of the histograms H31, H33, and H34 (histograms having two or more peaks), the extraction thresholds TH31, TH33 for each division region 381, 383, 384 corresponding to each histogram H31, H33, H34. , TH34 is calculated. Specifically, between the common position peak and the non-common position peak in each histogram H31, H33, H34, the specific position in the foot portion of the common position peak is the extraction threshold TH31 for the divided regions 381, 383, 384. , TH33, TH34.

また、分割領域382に関するヒストグラムH32においては、原稿領域の画素と原稿外領域の画素との差分が小さいことに起因して、2以上のピークが存在しない(図15参照)。この場合、MFP10は、2以上のピークが存在しないヒストグラムH32に関する抽出用閾値TH32について、当該ヒストグラムH32に対応する分割領域382に隣接する分割領域380(ここでは381,383)の抽出用閾値TH31,TH33に基づき算出(推定)する。たとえば、分割領域381,383に関して算出された抽出用閾値TH31,TH33の平均値が求められ、当該平均値が、分割領域382に関する抽出用閾値TH32として算出(推定)される。 Further, in the histogram H32 relating to the divided region 382, there are no two or more peaks due to the small difference between the pixels in the document region and the pixels in the region outside the document (see FIG. 15). In this case, the MFP 10 refers to the extraction threshold TH32 for the histogram H32 in which two or more peaks do not exist, and the extraction threshold TH31, for the division region 380 (here, 381, 383) adjacent to the division region 382 corresponding to the histogram H32. Calculate (estimate) based on TH33. For example, the average values of the extraction thresholds TH31 and TH33 calculated for the divided regions 381 and 383 are obtained, and the average values are calculated (estimated) as the extraction thresholds TH32 for the divided regions 382.

全ての分割領域380(381〜384)について抽出用閾値TH31〜TH34が算出されると、MFP10は、本スキャンを実行してスキャン画像400(430)(図14参照)を生成する。 When the extraction thresholds TH31 to TH34 are calculated for all the divided regions 380 (381 to 384), the MFP 10 executes the main scan to generate the scanned image 400 (430) (see FIG. 14).

そして、当該スキャン画像430内の各分割領域380(381〜384)において、分割領域380毎の抽出用閾値TH31〜TH34に基づいて、原稿領域と原稿外領域とを判別する。具体的には、スキャン画像430内の各分割領域380において、各ヒストグラム(図15)で算出された抽出用閾値THよりも大きい画素値を有する画素群と当該抽出用閾値THよりも小さい画素値を有する画素群との両画素群のうち、共通位置ピークを含む一方の画素群が、原稿領域内の画素群として決定される。 Then, in each of the divided regions 380 (381 to 384) in the scanned image 430, the original region and the non-manuscript region are discriminated based on the extraction thresholds TH31 to TH34 for each divided region 380. Specifically, in each divided region 380 in the scanned image 430, a pixel group having a pixel value larger than the extraction threshold TH calculated in each histogram (FIG. 15) and a pixel value smaller than the extraction threshold TH. Of the two pixel groups with the pixel group having the above, one pixel group including the common position peak is determined as the pixel group in the document region.

たとえば、分割領域384のヒストグラムH34(図15)においては、ヒストグラムH34で算出された抽出用閾値TH34よりも右側に共通位置ピークが存在している。そのため、スキャン画像430内の分割領域384においては、当該抽出用閾値TH34よりも大きい画素値を有する画素群(共通位置ピークを含む画素群)が、原稿領域内の画素群として決定される。そして、スキャン画像430内の分割領域384(図14参照)においては、当該抽出用閾値TH34との大小関係に基づいて分割領域384内の各画素に対する二値化処理が実行される。さらに、当該二値化処理の処理結果等に基づいて、エッジ抽出処理が実行されて、分割領域384内の原稿領域のエッジ候補が抽出される。 For example, in the histogram H34 (FIG. 15) of the divided region 384, a common position peak exists on the right side of the extraction threshold TH34 calculated by the histogram H34. Therefore, in the divided region 384 in the scanned image 430, a pixel group having a pixel value larger than the extraction threshold TH34 (a pixel group including a common position peak) is determined as a pixel group in the document region. Then, in the divided region 384 (see FIG. 14) in the scanned image 430, binarization processing is executed for each pixel in the divided region 384 based on the magnitude relationship with the extraction threshold TH34. Further, the edge extraction process is executed based on the processing result of the binarization process and the like, and edge candidates of the document area in the divided area 384 are extracted.

同様に、分割領域383のヒストグラムH33(図15)においても、ヒストグラムH33で算出された抽出用閾値TH33よりも右側に共通位置ピークが存在している。そのため、スキャン画像430内の分割領域383においても、当該抽出用閾値TH33よりも大きい画素値を有する画素群が、原稿領域内の画素群として決定される。そして、スキャン画像430内の分割領域383(図14参照)において、抽出用閾値TH33との大小関係に基づいて、分割領域383内の各画素に対する二値化処理がそれぞれ実行され、当該二値化処理の処理結果等に基づいて、分割領域383内の原稿領域のエッジ候補がそれぞれ抽出される。 Similarly, in the histogram H33 (FIG. 15) of the divided region 383, the common position peak exists on the right side of the extraction threshold TH33 calculated by the histogram H33. Therefore, even in the divided region 383 in the scanned image 430, a pixel group having a pixel value larger than the extraction threshold TH33 is determined as a pixel group in the document region. Then, in the divided region 383 (see FIG. 14) in the scanned image 430, binarization processing is executed for each pixel in the divided region 383 based on the magnitude relationship with the extraction threshold TH33, and the binarization is performed. Edge candidates of the original area in the divided area 383 are extracted based on the processing result of the processing and the like.

一方、図15に示されるように、分割領域381のヒストグラムH31においては、ヒストグラムH31で算出された抽出用閾値TH31よりも左側に共通位置ピークが存在している。そのため、スキャン画像430内の分割領域381においては、当該抽出用閾値TH31よりも小さい画素値を有する画素群が、原稿領域内の画素群として決定される。そして、スキャン画像430内の分割領域381(図14参照)において、抽出用閾値TH31との大小関係に基づいて分割領域381内の各画素に対する二値化処理が実行され、当該二値化処理の処理結果等に基づいて、分割領域381内の原稿領域のエッジ候補が抽出される。 On the other hand, as shown in FIG. 15, in the histogram H31 of the divided region 381, the common position peak exists on the left side of the extraction threshold TH31 calculated by the histogram H31. Therefore, in the divided region 381 in the scanned image 430, a pixel group having a pixel value smaller than the extraction threshold TH31 is determined as a pixel group in the document region. Then, in the divided region 381 (see FIG. 14) in the scanned image 430, a binarization process is executed for each pixel in the divided region 381 based on the magnitude relationship with the extraction threshold TH31, and the binarization process is performed. Edge candidates of the document area in the division area 381 are extracted based on the processing result and the like.

なお、分割領域382に関しては、他の分割領域380の各ヒストグラムにて特定された共通位置ピークの位置が、当該分割領域382に関して算出(推定)された抽出用閾値TH32よりも右側に存在する(図15参照)。そのため,スキャン画像430内の分割領域382においては、当該抽出用閾値TH32よりも大きい画素の画素値を有する画素群が、原稿領域内の画素群として決定される。そして、スキャン画像430内の分割領域382(図14参照)において、抽出用閾値TH32との大小関係に基づいて当該分割領域382内の画素に対する二値化処理が実行され、当該二値化処理の処理結果等に基づいて、分割領域382内の原稿領域のエッジ候補が抽出される。 Regarding the divided region 382, the position of the common position peak specified in each histogram of the other divided regions 380 exists on the right side of the extraction threshold TH32 calculated (estimated) for the divided region 382 (). (See FIG. 15). Therefore, in the divided region 382 in the scanned image 430, a pixel group having a pixel value of a pixel larger than the extraction threshold TH32 is determined as a pixel group in the document region. Then, in the divided region 382 (see FIG. 14) in the scanned image 430, a binarization process is executed for the pixels in the divided region 382 based on the magnitude relationship with the extraction threshold TH32, and the binarization process is performed. Edge candidates of the document area in the division area 382 are extracted based on the processing result and the like.

このようにして、スキャン画像430内の各分割領域380において、原稿領域のエッジ候補が抽出される。そして、分割領域380毎に抽出されたエッジ候補に基づいて、スキャン画像430において原稿領域と原稿外領域とが判別される。具体的には、分割領域380毎に抽出されたエッジ候補で形成される閉領域が原稿領域として判別され、当該閉領域外の領域が原稿外領域として判別される。 In this way, edge candidates of the document region are extracted in each divided region 380 in the scanned image 430. Then, based on the edge candidates extracted for each of the divided regions 380, the original region and the outer region of the original are discriminated in the scanned image 430. Specifically, the closed region formed by the edge candidates extracted for each division region 380 is determined as the original region, and the region outside the closed region is determined as the outer region.

スキャン画像430にて原稿領域と原稿外領域とが判別されると、第3の判別手法は終了し、処理はステップS20へと進む。そして、スキャン画像430から原稿外領域が消去される(ステップS20)。 When the document region and the region outside the document are discriminated by the scanned image 430, the third discriminating method ends, and the process proceeds to step S20. Then, the area outside the document is erased from the scanned image 430 (step S20).

このように、スキャン画像300全体に所定程度以上のグラデーションが存在し、且つ当該所定程度以上のグラデーションの方向が縦方向と横方向とのいずれかである場合、スキャン画像300が当該グラデーションの変化方向に区分されて複数の分割領域380に分割される。そして、分割領域380毎に抽出用閾値TH30が算出され、分割領域380毎の抽出用閾値TH30に基づいて、原稿領域と原稿外領域とが判別される。したがって、スキャン画像300に所定程度以上のグラデーション(詳細には縦方向あるいは横方向のグラデーション)が存在する場合であっても、原稿領域と原稿外領域とをより正確に(良好に)判別することが可能である。 As described above, when the entire scanned image 300 has a gradation of a predetermined degree or more and the direction of the gradation of the predetermined degree or more is either the vertical direction or the horizontal direction, the scanned image 300 changes the gradation direction. It is divided into a plurality of division areas 380. Then, the extraction threshold value TH30 is calculated for each division area 380, and the original area and the non-manuscript area are discriminated based on the extraction threshold value TH30 for each division area 380. Therefore, even when the scanned image 300 has a gradation of a predetermined degree or more (specifically, a gradation in the vertical direction or the horizontal direction), the original area and the outer area of the original can be discriminated more accurately (goodly). Is possible.

<第4の判別手法(直交点推定手法)について>
ここにおいて、原稿カバー110が全開状態であっても、スキャン画像300全体に所定程度以上のグラデーションが生じることもある。
<About the fourth discrimination method (orthogonal point estimation method)>
Here, even when the document cover 110 is fully opened, a gradation of a predetermined degree or more may occur in the entire scanned image 300.

たとえば、ユーザが原稿載置用ガラス面を覗き込んだ状態でスキャン動作が行われた場合、光源150から出射されて原稿載置用ガラス面を透過した光の一部が、当該ユーザの衣類等に当たることがある。この場合、ユーザの位置等によっては、比較的多くの反射光(当該ユーザの衣類等に当たった光)が、原稿載置用ガラス面を再び透過して、原稿台140の手前側における両端の角部分の一方に入射して受光部によって検知されることもある。たとえば、ユーザが原稿台140の左手前側(奥行方向において手前側且つ左右方向において左側)から原稿載置用ガラス面を覗き込んでいる場合、原稿台140の左手前側の角部分において、比較的多くの反射光(当該ユーザの衣類等に当たった光)が検知される。このような状況において原稿に関して生成されたスキャン画像300(340)には、図16に示されるように、斜め方向のグラデーションが生じ得る。詳細には、スキャン画像340(図16)において、原稿載置用ガラス面の左手前側の部分の輝度値が大きく、画素の位置が当該左手前側から右奥側(原稿載置用ガラス面の奥行方向において奥側且つ左右方向において右側)へと向かうにつれて輝度値が徐々に減少する(暗くなる)グラデーション(斜め方向のグラデーション)が生じ得る。 For example, when the scanning operation is performed while the user is looking into the glass surface for placing a document, a part of the light emitted from the light source 150 and transmitted through the glass surface for placing the document is part of the user's clothing or the like. May hit. In this case, depending on the position of the user, a relatively large amount of reflected light (light that hits the user's clothing or the like) passes through the glass surface for placing the document again, and both ends on the front side of the platen 140. It may be incident on one of the corners and detected by the light receiving part. For example, when the user is looking into the glass surface for placing a document from the left front side of the platen 140 (the front side in the depth direction and the left side in the left-right direction), there are relatively many in the corner portion on the left front side of the platen 140. (Light that hits the user's clothing, etc.) is detected. In such a situation, the scanned image 300 (340) generated with respect to the document may have an oblique gradation as shown in FIG. Specifically, in the scanned image 340 (FIG. 16), the brightness value of the left front side portion of the document mounting glass surface is large, and the pixel positions are from the left front side to the right back side (depth of the document mounting glass surface). A gradation (diagonal gradation) in which the brightness value gradually decreases (darkens) may occur as the brightness value gradually decreases (darkens) toward the back side in the direction and the right side in the left-right direction.

このようなグラデーションを有するスキャン画像340(図16)において、仮にスキャン画像340が縦方向あるいは横方向に分割される場合、比較的多くの分割領域において原稿領域と原稿外領域とが正確に判別されないことがある。 In the scanned image 340 (FIG. 16) having such a gradation, if the scanned image 340 is divided in the vertical direction or the horizontal direction, the original area and the outer area of the original cannot be accurately discriminated in a relatively large number of divided areas. Sometimes.

ここにおいて、上述したように、スキャン画像300全体における所定程度以上のグラデーションの変化方向が縦方向あるいは横方向である場合、当該スキャン画像300全体に関するヒストグラムにおいては2つのピークが検出されず、当該ヒストグラムに基づいて正確な抽出用閾値THが算出されない、という問題が生じ得る。 Here, as described above, when the change direction of the gradation of a predetermined degree or more in the entire scanned image 300 is the vertical direction or the horizontal direction, two peaks are not detected in the histogram of the entire scanned image 300, and the histogram is the same. There may be a problem that an accurate extraction threshold TH is not calculated based on the above.

スキャン画像300全体における所定程度以上のグラデーションの変化方向が斜め方向である場合、当該スキャン画像300がたとえば縦方向に分割されたとしても、比較的多くの分割領域内においては、横方向に所定程度以上のグラデーションが未だ存在し得る。たとえば、斜め方向に所定程度以上のグラデーションが存在するスキャン画像340が縦方向に区分されて4つの分割領域391〜394に分割されたとしても、たとえば3つの分割領域392〜394においては、図26のように、横方向に所定程度以上のグラデーションが存在する。 When the change direction of the gradation of a predetermined degree or more in the entire scanned image 300 is an oblique direction, even if the scanned image 300 is divided in the vertical direction, for example, in a relatively large number of divided regions, a predetermined degree in the horizontal direction. The above gradation can still exist. For example, even if the scanned image 340 having a gradation of a predetermined degree or more in the diagonal direction is vertically divided and divided into four divided areas 391-394, for example, in the three divided areas 392-394, FIG. 26 As shown above, there is a gradation of a predetermined degree or more in the horizontal direction.

そのため、分割領域392〜394内において所定程度以上のグラデーションが横方向に存在することに起因して、当該分割領域392〜394のそれぞれにおいて、上記の問題と同様の問題が生じ得る。たとえば、分割領域392〜394に関するヒストグラムのそれぞれにおいては、2つのピークが検出されず、正確な抽出用閾値THが算出されない。その結果、各分割領域392〜394において、原稿領域と原稿外領域とが正確に判別されない恐れがある。 Therefore, due to the presence of a gradation of a predetermined degree or more in the lateral direction in the divided regions 392 to 394, the same problem as the above problem may occur in each of the divided regions 392 to 394. For example, in each of the histograms for the divided regions 392-394, two peaks are not detected and an accurate extraction threshold TH is not calculated. As a result, in each of the divided regions 392 to 394, the document region and the region outside the document may not be accurately discriminated.

この点を考慮して、スキャン画像300全体に所定程度以上のグラデーションが存在し、且つ当該所定程度以上のグラデーションの変化方向が斜め方向である場合は、第3の判別手法(領域分割手法)とは異なる第4の判別手法(直交点推定手法)(後述)を用いて、原稿領域と原稿外領域とが判別される。 In consideration of this point, when there is a gradation of a predetermined degree or more in the entire scanned image 300 and the change direction of the gradation of the predetermined degree or more is an oblique direction, the third discrimination method (region division method) is used. Uses a different fourth discrimination method (orthogonal point estimation method) (described later) to discriminate between the manuscript area and the non-manuscript area.

具体的には、プレスキャン(ステップS11)にてスキャン画像340(図16)が生成された後、当該スキャン画像340において原稿領域と原稿外領域とが推定される(ステップS12)。図17は、スキャン画像340全体の各画素の画素値に関して生成されたヒストグラムH40を示す図である。そして、当該ヒストグラムH40に基づいて、抽出用閾値TH(TH40)が暫定的に設定される。そして、暫定的に設定された抽出用閾値TH40に基づいて、原稿領域と原稿外領域とが推定される。 Specifically, after the scan image 340 (FIG. 16) is generated in the pre-scan (step S11), the original area and the non-manuscript area are estimated in the scanned image 340 (step S12). FIG. 17 is a diagram showing a histogram H40 generated with respect to the pixel value of each pixel of the entire scanned image 340. Then, the extraction threshold TH (TH40) is tentatively set based on the histogram H40. Then, the manuscript area and the out-of-manuscript area are estimated based on the tentatively set extraction threshold value TH40.

原稿領域と原稿外領域とが推定される(ステップS12)と、スキャン画像340内の各画素の画素値の分布状況が分析される(ステップS13〜S15)。 When the document area and the area outside the document are estimated (step S12), the distribution of the pixel values of each pixel in the scanned image 340 is analyzed (steps S13 to S15).

まず、ステップS13においては、スキャン画像340全体に所定程度以上のグラデーションが存在するか否か、が判定される。具体的には、スキャン画像330における縦方向画素列と横方向画素列との少なくとも一方に所定程度以上のグラデーションが存在するか否か、が判定される。 First, in step S13, it is determined whether or not there is a gradation of a predetermined degree or more in the entire scanned image 340. Specifically, it is determined whether or not there is a gradation of a predetermined degree or more in at least one of the vertical pixel row and the horizontal pixel row in the scanned image 330.

ここでは、スキャン画像340(図16参照)における注目縦方向画素列(たとえば左端の縦方向画素列)に関して、当該注目縦方向画素列の伸延方向における複数の画素の画素値が徐々に変化し且つ当該複数の画素の画素値の変動幅が所定程度を超えている旨(所定の変化特性を有する旨)、が判定される。換言すれば、スキャン画像340の注目縦方向画素列に所定程度以上のグラデーションが存在する旨が判定される。また、スキャン画像340における注目横方向画素列(たとえば下端の横方向画素列)に関しても、当該所定の変化特性を有する旨が判定される。換言すれば、スキャン画像340の注目横方向画素列においても所定程度以上のグラデーションが存在する旨が判定される。 Here, with respect to the vertical pixel sequence of interest (for example, the vertical pixel array at the left end) in the scanned image 340 (see FIG. 16), the pixel values of the plurality of pixels in the extension direction of the vertical pixel array of interest gradually change. It is determined that the fluctuation range of the pixel values of the plurality of pixels exceeds a predetermined degree (meaning that the plurality of pixels have a predetermined change characteristic). In other words, it is determined that the attention vertical pixel sequence of the scanned image 340 has a gradation of a predetermined degree or more. Further, it is determined that the attention lateral pixel array (for example, the lateral pixel array at the lower end) in the scanned image 340 also has the predetermined change characteristic. In other words, it is determined that there is a gradation of a predetermined degree or more even in the attention horizontal pixel sequence of the scanned image 340.

そして、スキャン画像340における縦方向画素列と横方向画素列との少なくとも一方(ここでは双方)に所定程度以上のグラデーションが存在する場合、スキャン画像340全体に所定程度以上のグラデーションが存在する旨がステップS13にて判定され、処理はステップS15へと進む。 Then, when at least one (here, both) of the vertical pixel row and the horizontal pixel row in the scanned image 340 has a gradation of a predetermined degree or more, it means that the entire scanned image 340 has a gradation of a predetermined degree or more. The determination is made in step S13, and the process proceeds to step S15.

ステップS15においては、スキャン画像340における縦方向画素列と横方向画素列との双方における所定程度以上のグラデーションの存否判定の判定結果に基づいて、当該所定程度以上のグラデーションの変化方向が判定される。具体的には、スキャン画像340全体における所定程度以上のグラデーションの変化方向が縦方向と横方向と斜め方向とのいずれであるか、が判定される。 In step S15, the change direction of the gradation of the predetermined degree or more is determined based on the determination result of the presence / absence determination of the gradation of the predetermined degree or more in both the vertical pixel row and the horizontal pixel row in the scanned image 340. .. Specifically, it is determined whether the change direction of the gradation of a predetermined degree or more in the entire scanned image 340 is the vertical direction, the horizontal direction, or the diagonal direction.

ここでは、上述のように、スキャン画像340(図16)の縦方向画素列と横方向画素列との双方に所定程度以上のグラデーションが存在している。この場合、MFP10は、スキャン画像340全体における所定程度以上のグラデーションの変化方向は斜め方向であると判定する。そして、当該変化方向が斜め方向である旨がステップS15にて判定され、処理はステップS19へと進み、第3の判別手法とは異なる第4の判別手法(直交点推定手法)が、スキャン画像340(440(後述))に最も適した最適手法として決定(採用)される。 Here, as described above, a gradation of a predetermined degree or more exists in both the vertical pixel array and the horizontal pixel array of the scanned image 340 (FIG. 16). In this case, the MFP 10 determines that the change direction of the gradation of a predetermined degree or more in the entire scanned image 340 is an oblique direction. Then, it is determined in step S15 that the change direction is an oblique direction, the process proceeds to step S19, and a fourth discrimination method (orthogonal point estimation method) different from the third discrimination method is used for the scanned image. It is determined (adopted) as the most suitable optimum method for 340 (440 (described later)).

第4の判別手法(直交点推定手法)では、原稿領域のエッジ候補が直交する4点の直交点P1〜P4の位置に基づき原稿領域と原稿外領域とが判別されるにあたって、当該4点の直交点P1〜P4のうちの少なくとも1点の直交点が検出されない旨が判定される場合、当該1点の直交点の位置が、残余の直交点の検出位置に基づき求められる。そして、直交点P1〜P4を接続する直線で形成される閉領域に基づいて、原稿領域と原稿外領域とが判別される。 In the fourth discrimination method (orthogonal point estimation method), when the document region and the outer region of the document are discriminated based on the positions of the four orthogonal points P1 to P4 where the edge candidates of the document region are orthogonal to each other, the four points are used. When it is determined that at least one of the orthogonal points P1 to P4 is not detected, the position of the one orthogonal point is determined based on the detection position of the remaining orthogonal points. Then, the original region and the outer region of the original are discriminated based on the closed region formed by the straight line connecting the orthogonal points P1 to P4.

具体的には、まず、MFP10は、本スキャンを実行してスキャン画像400(440)(図18参照)を生成する。そして、MFP10は、ステップS12にて暫定的に算出(仮設定)された抽出用閾値TH40(スキャン画像340全体に関して算出された抽出用閾値TH40)をそのまま用いて、スキャン画像440において原稿領域のエッジ候補を抽出する。エッジ候補が抽出されると、MFP10は、抽出されたエッジ候補が直交する直交点Pを検出する直交点検出処理を実行する。 Specifically, first, the MFP 10 executes the main scan to generate a scanned image 400 (440) (see FIG. 18). Then, the MFP 10 uses the extraction threshold value TH40 (extraction threshold value TH40 calculated for the entire scanned image 340) tentatively calculated (temporarily set) in step S12 as it is, and uses the edge of the document region in the scanned image 440 as it is. Extract candidates. When the edge candidates are extracted, the MFP 10 executes an orthogonal point detection process for detecting the orthogonal points P to which the extracted edge candidates are orthogonal to each other.

ここにおいて、斜め方向のグラデーションがスキャン画像400に存在する場合、エッジ候補の4点の直交点のうちの3点は検出される可能性が比較的高いものの、当該4点の直交点のうちの1点は検出されない可能性が比較的高い。具体的には、スキャン画像440(図18参照)の原稿外領域のうち反射光がほとんど検知されていない領域においては、直交点(ここでは直交点P1〜P3)は検出される。一方、スキャン画像440の原稿領域のうち、比較的多くの反射光(ユーザの衣類等に当たって反射した光)が入射した部分(ここでは原稿載置用ガラス面の奥行方向における手前側の左の角)に近い領域においては、直交点(ここでは直交点P4)が検出されない。 Here, when a diagonal gradation is present in the scanned image 400, three of the four orthogonal points of the edge candidates are relatively likely to be detected, but among the four orthogonal points. It is relatively likely that one point will not be detected. Specifically, the orthogonal points (here, orthogonal points P1 to P3) are detected in the region outside the document of the scanned image 440 (see FIG. 18) where the reflected light is hardly detected. On the other hand, of the document area of the scanned image 440, the portion where a relatively large amount of reflected light (light reflected by the user's clothing or the like) is incident (here, the left corner on the front side in the depth direction of the glass surface for placing the document). ) Is not detected at the orthogonal point (here, the orthogonal point P4).

この点を考慮して、斜め方向のグラデーションがスキャン画像440に存在する場合において、4点の直交点P1〜P4のうち少なくとも1点の直交点(ここではP4)が検出されない旨が判定されるときには、当該直交点P4の位置が、残余の直交点P1〜P3の検出位置に基づいて求められる(推定される)。 In consideration of this point, it is determined that at least one orthogonal point (here, P4) among the four orthogonal points P1 to P4 is not detected when the scanned image 440 has a gradient in the oblique direction. Occasionally, the position of the orthogonal point P4 is determined (estimated) based on the detection position of the remaining orthogonal points P1 to P3.

具体的には、当該直交点P1〜P3の検出位置の位置関係と幾何学的関係とに基づいて、直交点P1〜P4が直線で接続されて形成される閉領域が矩形形状を有するように、直交点P4の位置が推定される(図19参照)。 Specifically, the closed region formed by connecting the orthogonal points P1 to P4 with a straight line has a rectangular shape based on the positional relationship and the geometrical relationship of the detection positions of the orthogonal points P1 to P3. , The position of the orthogonal point P4 is estimated (see FIG. 19).

そして、スキャン画像440において、直交点P1〜P3の検出位置と直交点P4の推定位置とに基づいて閉領域が形成され、当該閉領域が原稿領域として判別されるとともに、当該閉領域以外の領域が原稿外領域として判別される。 Then, in the scanned image 440, a closed region is formed based on the detection positions of the orthogonal points P1 to P3 and the estimated position of the orthogonal points P4, the closed region is determined as the original region, and the region other than the closed region is determined. Is determined as the area outside the document.

スキャン画像440にて原稿領域と原稿外領域とが判別されると、第4の判別手法(直交点推定手法)は終了し、処理はステップS20へと進む。そして、スキャン画像440から原稿外領域が消去される(ステップS20)。 When the document region and the region outside the document are discriminated by the scanned image 440, the fourth discrimination method (orthogonal point estimation method) ends, and the process proceeds to step S20. Then, the area outside the document is erased from the scanned image 440 (step S20).

このように、スキャン画像300全体に所定程度以上のグラデーションが存在し、且つ当該所定程度以上のグラデーションの変化方向が斜め方向である場合は、原稿領域のエッジ候補の直交点の位置に基づいて原稿領域と原稿外領域とが判別される。ただし、このような判別が行われるにあたって、当該検出されない直交点(ここでは直交点P4)が存在する場合は、当該直交点P4の位置が残余の直交点(ここでは直交点P1〜P3)の検出位置に基づいて推定される。したがって、スキャン画像300内において斜め方向のグラデーションが存在する場合であっても、原稿領域と原稿外領域とをより正確に(良好に)判別することが可能である。 As described above, when the entire scanned image 300 has a gradation of a predetermined degree or more and the change direction of the gradation of the predetermined degree or more is an oblique direction, the document is based on the position of the orthogonal point of the edge candidate in the document area. The area and the area outside the document are discriminated. However, when such a determination is made, if the undetected orthogonal point (here, the orthogonal point P4) exists, the position of the orthogonal point P4 is the remaining orthogonal point (here, the orthogonal points P1 to P3). Estimated based on the detection position. Therefore, even when there is a gradation in the oblique direction in the scanned image 300, it is possible to more accurately (satisfy) discriminate between the document region and the region outside the document.

以上のように、本実施形態においては、原稿台140に載置された原稿に関するスキャン画像内の複数の画素の画素値の分布状況が分析され(ステップS13〜S15)、分析結果に基づいて、原稿領域と原稿外領域とを判別するための複数の判別手法(ステップS16〜S19)の中から最適手法が決定される。そして、決定された最適手法を用いて、原稿領域と原稿外領域とが判別される。したがって、原稿台に載置された原稿に関するスキャン画像において、原稿領域と原稿外領域とをより正確に判別することが可能である。 As described above, in the present embodiment, the distribution of the pixel values of the plurality of pixels in the scanned image of the document placed on the platen 140 is analyzed (steps S13 to S15), and based on the analysis result, the distribution state is analyzed. The optimum method is determined from a plurality of discrimination methods (steps S16 to S19) for discriminating between the document area and the area outside the document. Then, the manuscript area and the non-manuscript area are discriminated by using the determined optimum method. Therefore, in the scanned image of the document placed on the platen, the document area and the area outside the document can be more accurately discriminated.

<1−3.変形例等>
以上、この発明の実施の形態について説明したが、この発明は上記内容のものに限定されるものではない。
<1-3. Deformation example, etc.>
Although the embodiments of the present invention have been described above, the present invention is not limited to the above contents.

<各判別手法の実行是非等に関する変形例>
たとえば、上記実施形態においては、スキャン画像300における所定程度以上のグラデーションの存否判定処理(ステップS13)が行われた後に、スキャン画像300全体に関するヒストグラムにおける度数分布状況の解析処理(ステップS14)が行われているが、これに限定されない。たとえば、度数分布状況の解析処理が行われた後に、グラデーションの存否判定処理が行われてもよい。
<Examples of modifications related to the pros and cons of executing each discrimination method>
For example, in the above embodiment, after the presence / absence determination process (step S13) of the gradation of a predetermined degree or more in the scanned image 300 is performed, the frequency distribution state analysis process (step S14) in the histogram of the entire scanned image 300 is performed. However, it is not limited to this. For example, the presence / absence determination process of the gradation may be performed after the analysis process of the frequency distribution situation is performed.

また、上記実施形態等においては、グラデーションの存否判定処理(ステップS13)と度数分布状況の解析処理(ステップS14)とグラデーションの方向判定処理(ステップS15)との3つの処理の全てが行われているが、これに限定されず、当該3つの処理の一部のみが行われるようにしてもよい。 Further, in the above embodiment and the like, all three processes of the presence / absence determination process of the gradation (step S13), the analysis process of the frequency distribution status (step S14), and the direction determination process of the gradation (step S15) are performed. However, the present invention is not limited to this, and only a part of the three processes may be performed.

たとえば、度数分布状況の解析処理(ステップS14)は行われずに、グラデーションの存否判定処理(ステップS13)とグラデーションの方向判定処理(ステップS15)とが行われるようにしてもよい。 For example, the frequency distribution status analysis process (step S14) may not be performed, but the gradation presence / absence determination process (step S13) and the gradation direction determination process (step S15) may be performed.

具体的には、スキャン画像300に所定程度以上のグラデーションが存在しない場合、度数分布状況の解析処理は行われず、第1の判別手法(基本判別手法)と第2の判別手法(入出力特性調整手法)とのいずれか一方の判別手法が最適手法として一律に決定(採用)されるようにしてもよい。なお、スキャン画像300全体に所定程度以上のグラデーションが存在する場合は、上記実施形態と同様に、グラデーションの方向判定処理が実行され、判定結果に応じて、第3の判別手法(領域分割手法)と第4の判別手法(直交点推定手法)とのいずれか一方が最適手法として決定される。 Specifically, when the scanned image 300 does not have a gradation of a predetermined degree or more, the frequency distribution status analysis process is not performed, and the first discrimination method (basic discrimination method) and the second discrimination method (input / output characteristic adjustment) are performed. The discrimination method of either one of the method) may be uniformly determined (adopted) as the optimum method. If the entire scanned image 300 has a gradation of a predetermined degree or more, the gradation direction determination process is executed in the same manner as in the above embodiment, and a third determination method (region division method) is performed according to the determination result. And one of the fourth discrimination method (orthogonal point estimation method) is determined as the optimum method.

あるいは、グラデーションの存否判定処理(ステップS13)とグラデーションの方向判定処理(ステップS15)とは行われずに、度数分布状況の解析処理(ステップS14)のみが行われてもよい。具体的には、スキャン画像300内における所定程度以上のグラデーションの存否は判定されず、スキャン画像300全体に関するヒストグラムにて原稿領域ピークと原稿外領域ピークとの距離が一定程度よりも大きい旨の条件が充足されるか否かのみが判定されてもよい。 Alternatively, the presence / absence determination process of the gradation (step S13) and the direction determination process of the gradation (step S15) may not be performed, but only the analysis process of the frequency distribution status (step S14) may be performed. Specifically, the presence or absence of a gradation of a predetermined degree or more in the scanned image 300 is not determined, and the condition that the distance between the original region peak and the outer region peak in the original region is larger than a certain degree in the histogram of the entire scanned image 300. May only be determined whether or not is satisfied.

また、グラデーションの方向判定処理(ステップS15)は行われず、グラデーションの存否判定処理(ステップS13)と度数分布状況の解析処理(ステップS14)とが行われるようにしてもよい。具体的には、スキャン画像300に所定程度以上のグラデーションが存在する旨が判定される場合、当該グラデーションの方向判定処理は行われず、第3の判別手法(領域分割手法)と第4の判別手法(直交点推定手法)とのいずれか一方が最適手法として一律に決定(採用)されるようにしてもよい。 Further, the gradation direction determination process (step S15) may not be performed, but the gradation existence / absence determination process (step S13) and the frequency distribution status analysis process (step S14) may be performed. Specifically, when it is determined that the scanned image 300 has a gradation of a predetermined degree or more, the direction determination process of the gradation is not performed, and the third discrimination method (region division method) and the fourth discrimination method Either one of (orthogonal point estimation method) may be uniformly determined (adopted) as the optimum method.

このように、グラデーションの存否判定処理(ステップS13)と度数分布状況の解析処理(ステップS14)とグラデーションの方向判定処理(ステップS15)との3つの処理の一部のみが行われるようにしてもよい。 In this way, even if only a part of the three processes of the gradation existence / absence determination process (step S13), the frequency distribution status analysis process (step S14), and the gradation direction determination process (step S15) is performed. Good.

<第2の判別手法(ステップS17)に関する変形例>
また、上記実施形態等においては、ヒストグラムにおいて原稿領域ピークと原稿外領域ピークとの距離が一定程度よりも大きい旨の条件が充足されない場合、入出力特性調整手法が第2の判別手法(ステップS17)として用いられているが、これに限定されない。たとえば、ヒストグラムにおいて原稿領域ピークと原稿外領域ピークとの距離が一定程度よりも大きい旨の条件が充足されない場合、次のような判別手法が第2の判別手法として用いられてもよい。
<Modification example of the second discrimination method (step S17)>
Further, in the above-described embodiment or the like, when the condition that the distance between the document region peak and the document outside region peak is larger than a certain level is not satisfied in the histogram, the input / output characteristic adjustment method is the second discrimination method (step S17). ), But is not limited to this. For example, when the condition that the distance between the original region peak and the outer region peak is larger than a certain degree is not satisfied in the histogram, the following discrimination method may be used as the second discrimination method.

具体的には、抽出されたエッジ候補のうちの正規のエッジ部分(後述)に基づく補完処理を行って当該エッジ候補の誤検出部分(後述)を補正して、原稿領域と原稿外領域とを判別する手法(「エッジ補完手法」)が、第2の判別手法(ステップS17)として用いられてもよい。 Specifically, the complement processing based on the regular edge portion (described later) of the extracted edge candidates is performed to correct the false detection portion (described later) of the edge candidate, and the manuscript area and the non-manuscript area are set. The discriminating method (“edge complementing method”) may be used as the second discriminating method (step S17).

詳細には、MFP10は、ステップS12にて暫定的に算出された抽出用閾値THに基づいて原稿領域のエッジ候補を抽出するとともに、抽出されたエッジ候補のうち原稿領域の正規のエッジ部分と誤検出部分とを特定する。そして、MFP10は、正規のエッジ部分に基づく補完処理を行って当該誤検出部分を補正し、原稿領域と原稿外領域とを判別する。 Specifically, the MFP 10 extracts edge candidates of the manuscript area based on the extraction threshold value TH tentatively calculated in step S12, and mistakenly mistakes the extracted edge candidates as the normal edge portion of the manuscript area. Identify the detection part. Then, the MFP 10 performs complementary processing based on the regular edge portion to correct the false detection portion, and discriminates between the original region and the outer region of the original.

より詳細には、ステップS17において、MFP10は、本スキャンを実行してスキャン画像420(図7参照)を生成する。そして、MFP10は、ステップS12にて暫定的に算出された抽出用閾値TH21(スキャン画像320内の複数の画素の画素値のヒストグラムH21に基づき算出された抽出用閾値)(図8)をそのまま用いて、スキャン画像425にて原稿領域のエッジ候補を抽出する。 More specifically, in step S17, the MFP 10 executes the main scan to generate a scanned image 420 (see FIG. 7). Then, the MFP 10 uses the extraction threshold value TH21 (extraction threshold value calculated based on the histogram H21 of the pixel values of the plurality of pixels in the scanned image 320) (FIG. 8) tentatively calculated in step S12 as it is. Then, the edge candidates of the document area are extracted from the scanned image 425.

ただし、原稿領域ピークと原稿外領域ピークとの距離が一定程度よりも大きい旨の条件が充足されない場合、抽出用閾値THが正確に算出されず、たとえば図20のように、エッジ候補の一部が正確に抽出されないこともある。なお、図20では、図示の都合上、原稿領域と原稿外領域との双方とも白色で表示しているが、実際は、図7のように、原稿外領域の画素の画素値は比較的小さく(ほぼ値「0」に近く)、原稿領域の画素の画素値は、原稿外領域の画素の画素値よりも若干大きいものとする。 However, if the condition that the distance between the original region peak and the outer region peak is larger than a certain level is not satisfied, the extraction threshold TH is not calculated accurately, and a part of the edge candidates is shown, for example, as shown in FIG. May not be extracted accurately. In FIG. 20, for convenience of illustration, both the original area and the outer area of the original are displayed in white, but in reality, as shown in FIG. 7, the pixel values of the pixels in the outer area of the original are relatively small (as shown in FIG. 7). (Almost close to the value "0"), it is assumed that the pixel value of the pixel in the document region is slightly larger than the pixel value of the pixel in the region outside the document.

この点を考慮して、MFP10は、原稿領域ピークと原稿外領域ピークとの距離が一定程度よりも大きい旨の条件が充足されない場合は、抽出されたエッジ候補のうちの正規のエッジ部分に基づく補完処理を行って当該エッジ候補の誤検出部分を補正して、原稿領域と原稿外領域とを判別する手法(「エッジ補完手法」)を最適手法として決定(採用)する。 In consideration of this point, the MFP 10 is based on the regular edge portion of the extracted edge candidates when the condition that the distance between the original region peak and the outer region peak is larger than a certain degree is not satisfied. A method (“edge complementation method”) for discriminating between the original area and the non-manuscript area by performing the complement processing to correct the erroneously detected portion of the edge candidate is determined (adopted) as the optimum method.

具体的には、MFP10は、抽出されたエッジ候補のうち、所定値以上の長さの直線部分(線分)を、原稿領域の正規のエッジ部分(正しく検出されたているとみなす部分)として特定する(図21参照)。ここでは、直線部分M1〜M7(図21参照)が正規のエッジ部分として特定される。また、MFP10は、当該所定値以上の長さの直線部分(正規のエッジ部分)以外の部分(直線性を有しない部分あるいは所定値未満の長さの直線線分)を誤検出部分として抽出する。ここでは、4箇所の誤検出部分N1〜N4(図21参照)が特定される。 Specifically, the MFP 10 sets a straight line portion (line segment) having a length equal to or longer than a predetermined value among the extracted edge candidates as a regular edge portion (a portion deemed to be correctly detected) in the document area. Identify (see FIG. 21). Here, the straight line portions M1 to M7 (see FIG. 21) are specified as regular edge portions. Further, the MFP 10 extracts a portion (a portion having no linearity or a linear line segment having a length less than the predetermined value) other than the linear portion (regular edge portion) having a length equal to or longer than the predetermined value as an erroneous detection portion. .. Here, four false detection portions N1 to N4 (see FIG. 21) are specified.

そして、MFP10は、正規のエッジ部分として特定された直線部分M1〜M7に基づく補完処理を行って、誤検出部分N1〜N4を補正する(図21参照)。たとえば、直線部分M1(および/あるいはM2)が延長されて、誤検出部分N1が補正される。また、直線部分M3(および/あるいはM4)が延長されて、誤検出部分N2が補正される。また、直線部分M5および直線部分M6が延長されて、誤検出部分N3が補正される。さらに、直線部分M6(および/あるいはM7)が延長されて、誤検出部分N4が補正される。 Then, the MFP 10 performs complementary processing based on the straight line portions M1 to M7 specified as the regular edge portions to correct the false detection portions N1 to N4 (see FIG. 21). For example, the straight line portion M1 (and / or M2) is extended to correct the false positive portion N1. Further, the straight line portion M3 (and / or M4) is extended to correct the false detection portion N2. Further, the straight line portion M5 and the straight line portion M6 are extended to correct the erroneous detection portion N3. Further, the linear portion M6 (and / or M7) is extended to correct the false positive portion N4.

全ての誤検出部分N1〜N4が補正されると、MFP10は、スキャン画像420において、補正後のエッジ候補で形成される閉領域を原稿領域として判別し、当該閉領域以外の領域を原稿外領域として判別する。 When all the false detection portions N1 to N4 are corrected, the MFP 10 determines in the scanned image 420 that the closed region formed by the corrected edge candidates is the original region, and the region other than the closed region is the outer region of the original. To determine as.

このように、ヒストグラムにおいて原稿領域ピークと原稿外領域ピークとの距離が一定程度よりも大きい旨の条件が充足されない場合は、原稿領域の正規のエッジ部分に基づく補完処理によって誤検出部分を補正する手法(エッジ補完手法)が、第2の判別手法(ステップS17)として用いられてもよい。 In this way, when the condition that the distance between the original region peak and the outer region peak is larger than a certain level is not satisfied in the histogram, the false detection portion is corrected by the complement processing based on the regular edge portion of the original region. The method (edge complementation method) may be used as the second discrimination method (step S17).

<第4の判別手法(ステップS19)に関する変形例>
また、上記実施形態等においては、スキャン画像300全体における所定程度以上のグラデーションの変化方向が当該スキャン画像300における斜め方向である場合、直交点推定手法が第4の判別手法(ステップS19)として用いられているが、これに限定されない。たとえば、スキャン画像300全体における所定程度以上のグラデーションの変化方向が斜め方向である場合、上記のエッジ補完手法が第4の判別手法として用いられてもよい。
<Modification example of the fourth discrimination method (step S19)>
Further, in the above-described embodiment or the like, when the change direction of the gradation of a predetermined degree or more in the entire scanned image 300 is the oblique direction in the scanned image 300, the orthogonal point estimation method is used as the fourth determination method (step S19). However, it is not limited to this. For example, when the change direction of the gradation of a predetermined degree or more in the entire scanned image 300 is an oblique direction, the above edge complementing method may be used as the fourth determination method.

具体的には、ステップS19において、MFP10は、本スキャンを実行してスキャン画像440(図16参照)を生成する。そして、MFP10は、ステップS12にて暫定的に算出された抽出用閾値TH40(スキャン画像340内の複数の画素の画素値のヒストグラムH40に基づき算出された抽出用閾値)(図17)をそのまま用いて、スキャン画像440において原稿領域のエッジ候補を抽出する(図22参照)。 Specifically, in step S19, the MFP 10 executes the main scan to generate a scanned image 440 (see FIG. 16). Then, the MFP 10 uses the extraction threshold value TH40 (extraction threshold value calculated based on the histogram H40 of the pixel values of the plurality of pixels in the scanned image 340) tentatively calculated in step S12 (FIG. 17) as it is. Then, edge candidates of the document region are extracted from the scanned image 440 (see FIG. 22).

エッジ候補が抽出されると、MFP10は、抽出されたエッジ候補のうち正規のエッジ部分(所定値以上の長さの直線部分)を特定するとともに、誤検出部分(正規のエッジ部分以外の部分)(ここでは誤検出部分N10)を特定する。 When the edge candidates are extracted, the MFP 10 identifies a normal edge portion (a straight line portion having a length equal to or longer than a predetermined value) among the extracted edge candidates, and a false detection portion (a portion other than the regular edge portion). (Here, the false detection portion N10) is specified.

そして、MFP10は、正規のエッジ部分に基づく補完処理を行って、誤検出部分N10を補正する。具体的には、直線部分M11および直線部分M12が延長されて、誤検出部分N10が補正される(図22参照)。当該誤検出部分N10が補正されると、MFP10は、スキャン画像440において、補正後のエッジ候補で形成される閉領域を原稿領域として判別するとともに、当該閉領域以外の領域を原稿外領域として判別する。 Then, the MFP 10 corrects the erroneous detection portion N10 by performing complementary processing based on the regular edge portion. Specifically, the straight line portion M11 and the straight line portion M12 are extended to correct the false detection portion N10 (see FIG. 22). When the erroneous detection portion N10 is corrected, the MFP 10 determines in the scanned image 440 the closed region formed by the corrected edge candidate as the original region, and determines the region other than the closed region as the outer region of the original. To do.

このように、スキャン画像300全体におけるグラデーションの変化方向が斜め方向である場合は、エッジ補完手法が第4の判別手法(ステップS19)として用いられてもよい。 As described above, when the change direction of the gradation in the entire scanned image 300 is an oblique direction, the edge complementing method may be used as the fourth determination method (step S19).

<その他>
また、上記実施形態等においては、第1〜第4の判別手法(ステップS16〜S19)は互いに異なる判別手法であるが、これに限定されず、第1〜第4の判別手法のうちの一部が同じ判別手法であってもよい。たとえば、第2の判別手法と第4の判別手法とが同じ判別手法であってもよい。具体的には、ステップS17とステップS19とにおいては、同じ判別手法(上記のエッジ補完手法あるいは直交点推定処理等)が最適手法として決定されるようにしてもよい。
<Others>
Further, in the above-described embodiment and the like, the first to fourth discrimination methods (steps S16 to S19) are different discrimination methods from each other, but the present invention is not limited to this, and one of the first to fourth discrimination methods. The parts may be the same discrimination method. For example, the second discrimination method and the fourth discrimination method may be the same discrimination method. Specifically, in step S17 and step S19, the same discrimination method (the above-mentioned edge complementation method, orthogonal point estimation process, etc.) may be determined as the optimum method.

さらに、上記各実施形態等においては、プレスキャンによって生成されたスキャン画像300が、当該スキャン画像300内の複数の画素の画素値の分布状況の分析用画像として利用され、本スキャンによって生成されたスキャン画像400が、原稿外消去処理の処理対象画像として利用されているが、これに限定されない。たとえば、プレスキャンにて生成されたスキャン画像300が、当該分布状況の分析用画像として利用されるとともに、原稿外消去処理の処理対象画像としても利用されるようにしてもよい。 Further, in each of the above embodiments, the scan image 300 generated by the pre-scan is used as an image for analyzing the distribution of pixel values of a plurality of pixels in the scan image 300, and is generated by the main scan. The scanned image 400 is used as a processing target image for the non-manuscript erasing process, but is not limited thereto. For example, the scanned image 300 generated by the pre-scan may be used not only as an image for analysis of the distribution state but also as a processing target image of the non-manuscript erasing process.

10 画像形成装置(MFP)
110 原稿カバー
140 原稿台
300,310,320,330,340 スキャン画像(プレスキャン時)
380〜384 分割領域
400,410,420,430,440 スキャン画像(本スキャン時)
10 Image forming apparatus (MFP)
110 Original cover 140 Original stand 300, 310, 320, 330, 340 Scanned image (during pre-scan)
380 to 384 divided areas 400, 410, 420, 430, 440 Scanned image (at the time of main scan)

Claims (34)

画像処理装置であって、
原稿台に載置された原稿に関するスキャン画像内の複数の画素の画素値の分布状況を分析する分析手段と、
前記分析手段による分析結果に基づいて、画像内にて前記原稿が存在する領域である原稿領域と前記原稿が存在しない領域である原稿外領域とを判別するための複数の判別手法の中から、前記スキャン画像に最も適した手法である最適手法を決定し、決定された最適手法を用いて、前記原稿領域と前記原稿外領域とを判別する領域判別手段と、
を備え、
前記複数の判別手法は、第1判別手法と第3判別手法とを含み、
前記第1判別手法は、前記スキャン画像の全体における複数の画素の画素値に関する度数分布に存在する複数のピークのうち、そのピーク位置の画素値が最も小さなピークを、前記原稿外領域に対応するピークである原稿外領域ピークとして判定し、残余のピークを、前記原稿領域に対応するピークである原稿領域ピークとして判定するとともに、前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法であり、
前記第3判別手法は、前記スキャン画像を縦方向と横方向とのうちの一の方向に区分して複数の分割領域に分割するとともに、分割領域ごとの度数分布であってその分割領域内の複数の画素の画素値に関する度数分布に存在する複数のピークのうち前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を分割領域ごとの閾値とし、分割領域ごとの当該閾値に基づいて前記原稿領域と前記原稿外領域とを分割領域ごとに判別する手法であり、
前記分析手段は、前記スキャン画像内の複数の画素の画素値の空間分布状況に基づいて、前記スキャン画像全体に所定程度以上のグラデーションが存在するか否かを判定し、
前記領域判別手段は、
前記スキャン画像全体における前記所定程度以上のグラデーションが存在することを条件として、前記第3判別手法を前記最適手法として決定し、
前記スキャン画像全体における前記所定程度以上のグラデーションが存在しないことを条件として、前記第1判別手法を前記最適手法として決定することを特徴とする画像処理装置。
It is an image processing device
An analytical means for analyzing the distribution of pixel values of a plurality of pixels in a scanned image of a document placed on a platen, and an analysis means.
Based on the analysis result by the analysis means, from among a plurality of discrimination methods for discriminating between the manuscript area which is the region where the manuscript exists and the region outside the manuscript which is the region where the manuscript does not exist in the image. An area determination means for determining an optimum method, which is the most suitable method for the scanned image, and using the determined optimum method to discriminate between the original area and the outer area.
With
The plurality of discrimination methods include a first discrimination method and a third discrimination method.
In the first discrimination method, among a plurality of peaks existing in the frequency distribution relating to the pixel values of a plurality of pixels in the entire scanned image, the peak having the smallest pixel value at the peak position corresponds to the out-of-manuscript region. It is determined as the peak outside the original region, and the residual peak is determined as the peak in the original region corresponding to the original region, and the pixel value of the peak outside the original and the pixel value of the peak in the original region. It is a method of discriminating between the manuscript area and the out-of-manuscript area based on the threshold value.
In the third discrimination method, the scanned image is divided into one of the vertical direction and the horizontal direction and divided into a plurality of divided regions, and the frequency distribution for each divided region is within the divided region. Of the plurality of peaks existing in the frequency distribution relating to the pixel values of the plurality of pixels, the value between the pixel value of the out-of-manuscript region peak and the pixel value of the manuscript region peak is set as the threshold value for each division region, and for each division region. It is a method of discriminating between the original area and the outer area of the original for each divided area based on the threshold value.
The analysis means determines whether or not there is a gradation of a predetermined degree or more in the entire scanned image based on the spatial distribution of the pixel values of the plurality of pixels in the scanned image.
The area determination means
The third discrimination method is determined as the optimum method on condition that a gradation of a predetermined degree or more is present in the entire scanned image.
An image processing apparatus characterized in that the first discrimination method is determined as the optimum method on condition that a gradation of a predetermined degree or more does not exist in the entire scanned image.
請求項1に記載の画像処理装置において、
前記分析手段は、
前記スキャン画像に前記所定程度以上のグラデーションが存在する場合、前記空間分布状況に基づいて、前記所定程度以上のグラデーションの変化方向をさらに判定し、
前記領域判別手段は、
前記スキャン画像全体における前記所定程度以上のグラデーションが存在し且つ前記変化方向が前記スキャン画像における縦方向と横方向とのいずれかである旨が判定されることを条件として、前記第3判別手法を前記最適手法として決定するとともに、前記所定程度以上のグラデーションの前記変化方向を前記第3判別手法における前記一の方向として決定することを特徴とする画像処理装置。
In the image processing apparatus according to claim 1,
The analysis means
When the scanned image has a gradation of the predetermined degree or more, the change direction of the gradation of the predetermined degree or more is further determined based on the spatial distribution situation.
The area determination means
The third determination method is performed on condition that it is determined that there is a gradation of a predetermined degree or more in the entire scanned image and that the changing direction is either the vertical direction or the horizontal direction in the scanned image. An image processing apparatus characterized in that it is determined as the optimum method and the change direction of the gradation of a predetermined degree or more is determined as the one direction in the third discrimination method.
請求項2に記載の画像処理装置において、
前記複数の判別手法は、第4判別手法をも含み、
前記第4判別手法は、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法
とのいずれかであり、
前記領域判別手段は、前記スキャン画像全体における前記所定程度以上のグラデーションが存在し且つ前記変化方向が前記スキャン画像における斜め方向である旨が判定されることを条件として、前記第4判別手法を前記最適手法として決定することを特徴とする画像処理装置。
In the image processing apparatus according to claim 2,
The plurality of discrimination methods also include a fourth discrimination method.
The fourth discrimination method is
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold to extract edge candidates in the document region, and the document is based on the positions of four orthogonal points where the edge candidates are orthogonal to each other. When it is determined that at least one of the four orthogonal points is not detected in distinguishing the region from the extra-manuscript region, the positional relationship and geometry of the detection positions of the remaining orthogonal points. Based on the relationship, the positions of at least one orthogonal point are estimated so that the closed region formed by connecting the four orthogonal points with a straight line has a rectangular shape, and the closed region is used as the original document. A method of discriminating as an area and determining an area other than the closed area as the extra document area,
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold value to extract edge candidates in the original area, and among the extracted edge candidates, a straight line portion having a length equal to or longer than a predetermined value. Is specified as a regular edge portion of the original document area, a portion other than the straight line portion is specified as a false detection portion, and complementary processing based on the regular edge portion is performed to correct the false detection portion and correct it. It is one of the methods of discriminating the closed region formed by the later edge candidate as the document region and determining the region other than the closed region as the outer region of the document.
The area discrimination means uses the fourth discrimination method on the condition that a gradation of a predetermined degree or more is present in the entire scanned image and it is determined that the change direction is an oblique direction in the scan image. An image processing device characterized in that it is determined as an optimum method.
画像処理装置であって、
原稿台に載置された原稿に関するスキャン画像内の複数の画素の画素値の分布状況を分析する分析手段と、
前記分析手段による分析結果に基づいて、画像内にて前記原稿が存在する領域である原稿領域と前記原稿が存在しない領域である原稿外領域とを判別するための複数の判別手法の中から、前記スキャン画像に最も適した手法である最適手法を決定し、決定された最適手法を用いて、前記原稿領域と前記原稿外領域とを判別する領域判別手段と、
を備え、
前記複数の判別手法は、第1判別手法と第3判別手法とを含み、
前記第1判別手法は、前記スキャン画像の全体における複数の画素の画素値に関する度数分布に存在する複数のピークのうち、そのピーク位置の画素値が最も小さなピークを、前記原稿外領域に対応するピークである原稿外領域ピークとして推定し、残余のピークを、前記原稿領域に対応するピークである原稿領域ピークとして推定するとともに、前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法であり、
前記第3判別手法は、前記スキャン画像を縦方向と横方向とのうちの一の方向に区分して複数の分割領域に分割するとともに、分割領域ごとの度数分布であってその分割領域内の複数の画素の画素値に関する度数分布に存在する複数のピークのうち前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を分割領域ごとの閾値とし、分割領域ごとの当該閾値に基づいて前記原稿領域と前記原稿外領域とを分割領域ごとに判別する手法であり、
前記分析手段は、前記スキャン画像の全体における複数の画素の画素値に関する度数分布において、前記原稿外領域ピークと前記原稿領域ピークとの距離が一定程度よりも大きいか否かを判定し、
前記領域判別手段は、前記度数分布において、前記原稿外領域ピークと前記原稿領域ピークとの距離が前記一定程度よりも大きい旨が判定されることを条件として、前記第1判別手法を前記最適手法として決定し、
前記分析手段は、前記スキャン画像内の複数の画素の画素値の空間分布状況に基づいて、前記スキャン画像全体に所定程度以上のグラデーションが存在するか否かを判定し、
前記領域判別手段は、前記スキャン画像全体における前記所定程度以上のグラデーションが存在することを条件として、前記第3判別手法を前記最適手法として決定することを特徴とする画像処理装置。
It is an image processing device
An analytical means for analyzing the distribution of pixel values of a plurality of pixels in a scanned image of a document placed on a platen, and an analysis means.
Based on the analysis result by the analysis means, from among a plurality of discrimination methods for discriminating between the manuscript area which is the region where the manuscript exists and the region outside the manuscript which is the region where the manuscript does not exist in the image. An area determination means for determining an optimum method, which is the most suitable method for the scanned image, and using the determined optimum method to discriminate between the original area and the outer area.
With
The plurality of discrimination methods include a first discrimination method and a third discrimination method.
In the first discrimination method, among a plurality of peaks existing in the frequency distribution relating to the pixel values of a plurality of pixels in the entire scanned image, the peak having the smallest pixel value at the peak position corresponds to the out-of-manuscript region. It is estimated as the peak of the extra-manuscript region peak, and the residual peak is estimated as the peak of the original region, which is the peak corresponding to the manuscript region, and the pixel value of the peak of the extra-manuscript region and the pixel value of the peak of the manuscript region. It is a method of discriminating between the manuscript area and the out-of-manuscript area based on the threshold value.
In the third discrimination method, the scanned image is divided into one of the vertical direction and the horizontal direction and divided into a plurality of divided regions, and the frequency distribution for each divided region is within the divided region. Of the plurality of peaks existing in the frequency distribution relating to the pixel values of the plurality of pixels, the value between the pixel value of the out-of-manuscript region peak and the pixel value of the manuscript region peak is set as the threshold value for each division region, and for each division region. It is a method of discriminating between the original area and the outer area of the original for each divided area based on the threshold value.
The analysis means determines whether or not the distance between the extra-manuscript region peak and the manuscript region peak is larger than a certain degree in the frequency distribution relating to the pixel values of the plurality of pixels in the entire scanned image.
The region discriminating means uses the first discriminating method as the optimum method on condition that it is determined in the frequency distribution that the distance between the out-of-manuscript region peak and the manuscript region peak is larger than a certain level. Determined as
The analysis means determines whether or not there is a gradation of a predetermined degree or more in the entire scanned image based on the spatial distribution of the pixel values of the plurality of pixels in the scanned image.
The image processing apparatus is characterized in that the area discrimination means determines the third discrimination method as the optimum method on condition that a gradation of a predetermined degree or more is present in the entire scanned image.
請求項4に記載の画像処理装置において、
前記複数の判別手法は、第2判別手法をも含み、
前記第2判別手法は、
スキャン処理における受光素子での受光量を示すアナログ入力値と出力画素値を示すデジタル出力値との間の入出力特性を調整する入出力特性調整処理であって前記入出力特性調整処理前の入出力特性における出力範囲の一部の範囲がより広い出力範囲となるように入出力特性を調整する入出力特性調整処理が施された後に得られる第2スキャン画像の全体における複数の画素の画素値に関する度数分布において、新たに求められる前記原稿外領域ピークの画素値と新たに求められる前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法と、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法
とのいずれかであり、
前記領域判別手段は、前記原稿外領域ピークと前記原稿領域ピークとの距離が前記一定程度よりも小さい旨が判定されることを条件として前記第2判別手法を前記最適手法として決定することを特徴とする画像処理装置。
In the image processing apparatus according to claim 4,
The plurality of discrimination methods also include a second discrimination method.
The second discrimination method is
This is an input / output characteristic adjustment process that adjusts the input / output characteristics between the analog input value that indicates the amount of light received by the light receiving element in the scan process and the digital output value that indicates the output pixel value, and is the input before the input / output characteristic adjustment process. Pixel values of a plurality of pixels in the entire second scan image obtained after the input / output characteristic adjustment processing for adjusting the input / output characteristics so that a part of the output range in the output characteristics becomes a wider output range. In the frequency distribution with respect to, the value between the newly obtained pixel value of the extra-manuscript region peak and the newly obtained pixel value of the manuscript region peak is set as a threshold, and the manuscript region and the outside of the manuscript are based on the threshold. The method of distinguishing from the area and
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold to extract edge candidates in the document region, and the document is based on the positions of four orthogonal points where the edge candidates are orthogonal to each other. When it is determined that at least one of the four orthogonal points is not detected in distinguishing the region from the extra-manuscript region, the positional relationship and geometry of the detection positions of the remaining orthogonal points. Based on the relationship, the positions of at least one orthogonal point are estimated so that the closed region formed by connecting the four orthogonal points with a straight line has a rectangular shape, and the closed region is used as the original document. A method of discriminating as an area and determining an area other than the closed area as the extra document area,
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold value to extract edge candidates in the original area, and among the extracted edge candidates, a straight line portion having a length equal to or longer than a predetermined value. Is specified as a regular edge portion of the original document area, a portion other than the straight line portion is specified as a false detection portion, and complementary processing based on the regular edge portion is performed to correct the false detection portion and correct it. It is one of the methods of discriminating the closed region formed by the later edge candidate as the document region and determining the region other than the closed region as the outer region of the document.
The area discrimination means is characterized in that the second discrimination method is determined as the optimum method on condition that it is determined that the distance between the document outer region peak and the document region peak is smaller than a certain degree. Image processing device.
請求項4に記載の画像処理装置において、
前記分析手段は、
前記スキャン画像に前記所定程度以上のグラデーションが存在する場合、前記空間分布状況に基づいて、前記所定程度以上のグラデーションの変化方向をさらに判定し、
前記領域判別手段は、
前記スキャン画像全体における前記所定程度以上のグラデーションが存在し且つ前記変化方向が前記スキャン画像における縦方向と横方向とのいずれかである旨が判定されることを条件として、前記第3判別手法を前記最適手法として決定するとともに、前記所定程度以上のグラデーションの前記変化方向を前記第3判別手法における前記一の方向として決定することを特徴とする画像処理装置。
In the image processing apparatus according to claim 4,
The analysis means
When the scanned image has a gradation of the predetermined degree or more, the change direction of the gradation of the predetermined degree or more is further determined based on the spatial distribution situation.
The area determination means
The third determination method is performed on condition that it is determined that there is a gradation of a predetermined degree or more in the entire scanned image and that the changing direction is either the vertical direction or the horizontal direction in the scanned image. An image processing apparatus characterized in that it is determined as the optimum method and the change direction of the gradation of a predetermined degree or more is determined as the one direction in the third discrimination method.
請求項6に記載の画像処理装置において、
前記複数の判別手法は、第4判別手法をも含み、
前記第4判別手法は、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法
とのいずれかであり、
前記領域判別手段は、前記スキャン画像全体における前記所定程度以上のグラデーションが存在し且つ前記変化方向が前記スキャン画像における斜め方向である旨が判定されることを条件として、前記第4判別手法を前記最適手法として決定することを特徴とする画像処理装置。
In the image processing apparatus according to claim 6,
The plurality of discrimination methods also include a fourth discrimination method.
The fourth discrimination method is
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold to extract edge candidates in the document region, and the document is based on the positions of four orthogonal points where the edge candidates are orthogonal to each other. When it is determined that at least one of the four orthogonal points is not detected in distinguishing the region from the extra-manuscript region, the positional relationship and geometry of the detection positions of the remaining orthogonal points. Based on the relationship, the positions of at least one orthogonal point are estimated so that the closed region formed by connecting the four orthogonal points with a straight line has a rectangular shape, and the closed region is used as the original document. A method of discriminating as an area and determining an area other than the closed area as the extra document area,
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold value to extract edge candidates in the original area, and among the extracted edge candidates, a straight line portion having a length equal to or longer than a predetermined value. Is specified as a regular edge portion of the original document area, a portion other than the straight line portion is specified as a false detection portion, and complementary processing based on the regular edge portion is performed to correct the false detection portion and correct it. It is one of the methods of discriminating the closed region formed by the later edge candidate as the document region and determining the region other than the closed region as the outer region of the document.
The area discrimination means uses the fourth discrimination method on the condition that a gradation of a predetermined degree or more is present in the entire scanned image and it is determined that the change direction is an oblique direction in the scan image. An image processing device characterized in that it is determined as an optimum method.
請求項7に記載の画像処理装置において、
前記複数の判別手法は、第2判別手法をも含み、
前記第2判別手法は、
スキャン処理における受光素子での受光量を示すアナログ入力値と出力画素値を示すデジタル出力値との間の入出力特性を調整する入出力特性調整処理であって前記入出力特性調整処理前の入出力特性における出力範囲の一部の範囲がより広い出力範囲となるように入出力特性を調整する入出力特性調整処理が施された後に得られる第2スキャン画像の全体における複数の画素の画素値に関する度数分布において、新たに求められる前記原稿外領域ピークの画素値と新たに求められる前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法と、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法
とのいずれかであり、
前記領域判別手段は、前記原稿外領域ピークと前記原稿領域ピークとの距離が前記一定程度よりも小さい旨が判定されることを条件として前記第2判別手法を前記最適手法として決定することを特徴とする画像処理装置。
In the image processing apparatus according to claim 7,
The plurality of discrimination methods also include a second discrimination method.
The second discrimination method is
This is an input / output characteristic adjustment process that adjusts the input / output characteristics between the analog input value that indicates the amount of light received by the light receiving element in the scan process and the digital output value that indicates the output pixel value, and is the input before the input / output characteristic adjustment process. Pixel values of a plurality of pixels in the entire second scan image obtained after the input / output characteristic adjustment processing for adjusting the input / output characteristics so that a part of the output range in the output characteristics becomes a wider output range. In the frequency distribution with respect to, the value between the newly obtained pixel value of the extra-manuscript region peak and the newly obtained pixel value of the manuscript region peak is set as a threshold, and the manuscript region and the outside of the manuscript are based on the threshold. The method of distinguishing from the area and
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold to extract edge candidates in the document region, and the document is based on the positions of four orthogonal points where the edge candidates are orthogonal to each other. When it is determined that at least one of the four orthogonal points is not detected in distinguishing the region from the extra-manuscript region, the positional relationship and geometry of the detection positions of the remaining orthogonal points. Based on the relationship, the positions of at least one orthogonal point are estimated so that the closed region formed by connecting the four orthogonal points with a straight line has a rectangular shape, and the closed region is used as the original document. A method of discriminating as an area and determining an area other than the closed area as the extra document area,
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold value to extract edge candidates in the original area, and among the extracted edge candidates, a straight line portion having a length equal to or longer than a predetermined value. Is specified as a regular edge portion of the original document area, a portion other than the straight line portion is specified as a false detection portion, and complementary processing based on the regular edge portion is performed to correct the false detection portion and correct it. It is one of the methods of discriminating the closed region formed by the later edge candidate as the document region and determining the region other than the closed region as the outer region of the document.
The area discrimination means is characterized in that the second discrimination method is determined as the optimum method on condition that it is determined that the distance between the document outer region peak and the document region peak is smaller than a certain degree. Image processing device.
請求項8に記載の画像処理装置において、
前記第2判別手法は、前記第4判別手法と同じ手法であることを特徴とする画像処理装置。
In the image processing apparatus according to claim 8,
The image processing apparatus, wherein the second discrimination method is the same method as the fourth discrimination method.
請求項8に記載の画像処理装置において、
前記第2判別手法は、前記第4判別手法とは異なる手法であることを特徴とする画像処理装置。
In the image processing apparatus according to claim 8,
An image processing apparatus characterized in that the second discrimination method is a method different from the fourth discrimination method.
画像処理装置であって、
原稿台に載置された原稿に関するスキャン画像内の複数の画素の画素値の分布状況を分析する分析手段と、
前記分析手段による分析結果に基づいて、画像内にて前記原稿が存在する領域である原稿領域と前記原稿が存在しない領域である原稿外領域とを判別するための複数の判別手法の中から、前記スキャン画像に最も適した手法である最適手法を決定し、決定された最適手法を用いて、前記原稿領域と前記原稿外領域とを判別する領域判別手段と、
を備え、
前記複数の判別手法は、第3判別手法と第4判別手法とを含み、
前記第3判別手法は、前記スキャン画像を縦方向と横方向とのうちの一の方向に区分して複数の分割領域に分割するとともに、分割領域ごとの度数分布であってその分割領域内の複数の画素の画素値に関する度数分布に存在する複数のピークのうち前記原稿外領域に対応するピークである原稿外領域ピークの画素値と前記原稿領域に対応するピークである原稿領域ピークの画素値との間の値を分割領域ごとの閾値とし、分割領域ごとの当該閾値に基づいて前記原稿領域と前記原稿外領域とを分割領域ごとに判別する手法であり、
前記第4判別手法は、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法
とのいずれかであり、
前記分析手段は、
前記スキャン画像内の複数の画素の画素値の空間分布状況に基づいて、前記スキャン画像全体に所定程度以上のグラデーションが存在するか否かを判定し、
前記スキャン画像に前記所定程度以上のグラデーションが存在する場合、前記空間分布状況に基づいて、前記所定程度以上のグラデーションの変化方向をさらに判定し、
前記領域判別手段は、
前記スキャン画像全体における前記所定程度以上のグラデーションが存在し且つ前記変化方向が前記スキャン画像における縦方向と横方向とのいずれかである旨が判定されることを条件として、前記第3判別手法を前記最適手法として決定するとともに、前記所定程度以上のグラデーションの前記変化方向を前記第3判別手法における前記一の方向として決定し、
前記スキャン画像全体における前記所定程度以上のグラデーションが存在し且つ前記変化方向が前記スキャン画像における斜め方向である旨が判定されることを条件として、前記第4判別手法を前記最適手法として決定することを特徴とする画像処理装置。
It is an image processing device
An analytical means for analyzing the distribution of pixel values of a plurality of pixels in a scanned image of a document placed on a platen, and an analysis means.
Based on the analysis result by the analysis means, from among a plurality of discrimination methods for discriminating between the manuscript area, which is the region where the manuscript exists in the image, and the outer region, which is the region where the manuscript does not exist, An area determination means for determining an optimum method, which is the most suitable method for the scanned image, and using the determined optimum method to discriminate between the original area and the outer area.
With
The plurality of discrimination methods include a third discrimination method and a fourth discrimination method.
In the third discrimination method, the scanned image is divided into one of the vertical direction and the horizontal direction and divided into a plurality of divided regions, and the frequency distribution for each divided region is within the divided region. Of the plurality of peaks existing in the frequency distribution relating to the pixel values of a plurality of pixels, the pixel value of the extra-manuscript region peak, which is the peak corresponding to the extra-manuscript region, and the pixel value of the manuscript region peak, which is the peak corresponding to the manuscript region It is a method of discriminating between the original area and the outer area of the original for each divided area based on the threshold value for each divided area as the value between and.
The fourth discrimination method is
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold to extract edge candidates in the document region, and the document is based on the positions of four orthogonal points where the edge candidates are orthogonal to each other. When it is determined that at least one of the four orthogonal points is not detected in distinguishing the region from the extra-manuscript region, the positional relationship and geometry of the detection positions of the remaining orthogonal points. Based on the relationship, the positions of at least one orthogonal point are estimated so that the closed region formed by connecting the four orthogonal points with a straight line has a rectangular shape, and the closed region is used as the original document. A method of discriminating as an area and determining an area other than the closed area as the extra document area,
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold value to extract edge candidates in the original area, and among the extracted edge candidates, a straight line portion having a length equal to or longer than a predetermined value. Is specified as a regular edge portion of the original document area, a portion other than the straight line portion is specified as a false detection portion, and complementary processing based on the regular edge portion is performed to correct the false detection portion and correct it. It is one of the methods of discriminating the closed region formed by the later edge candidate as the document region and determining the region other than the closed region as the outer region of the document.
The analysis means
Based on the spatial distribution of the pixel values of the plurality of pixels in the scanned image, it is determined whether or not there is a gradation of a predetermined degree or more in the entire scanned image.
When the scanned image has a gradation of the predetermined degree or more, the change direction of the gradation of the predetermined degree or more is further determined based on the spatial distribution situation.
The area determination means
The third determination method is performed on condition that it is determined that there is a gradation of a predetermined degree or more in the entire scanned image and that the changing direction is either the vertical direction or the horizontal direction in the scanned image. It is determined as the optimum method, and the change direction of the gradation of a predetermined degree or more is determined as the one direction in the third discrimination method.
The fourth determination method is determined as the optimum method on condition that a gradation of a predetermined degree or more is present in the entire scanned image and it is determined that the change direction is an oblique direction in the scanned image. An image processing device characterized by.
請求項1から請求項11のいずれかに記載の画像処理装置において、
前記第3判別手法は、前記スキャン画像を縦方向と横方向とのうちの前記一の方向に区分して前記複数の分割領域に分割するとともに、前記複数の分割領域のうちの2以上の分割領域であって各分割領域内の複数の画素の画素値に関する度数分布が2以上のピークを有する2以上の分割領域に関して、それぞれの度数分布に存在する複数のピークのうち、前記2以上の分割領域に関する2以上の度数分布における共通の位置にそのピーク位置を有するピークである共通位置ピークを前記原稿領域ピークとして判定し、前記共通位置ピーク以外のピークである非共通位置ピークのうち特定の非共通位置ピークを前記原稿外領域ピークとして判定するとともに、前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を分割領域ごとの閾値とし、分割領域ごとの当該閾値に基づいて前記原稿領域と前記原稿外領域とを分割領域ごとに判別する手法であることを特徴とする画像処理装置。
In the image processing apparatus according to any one of claims 1 to 11.
In the third discrimination method, the scanned image is divided into the one direction of the vertical direction and the horizontal direction and divided into the plurality of divided regions, and two or more of the plurality of divided regions are divided. Of the plurality of peaks existing in each frequency distribution, the two or more divisions of the two or more division regions having a frequency distribution of two or more peaks with respect to the pixel values of the plurality of pixels in each division region. A common position peak, which is a peak having its peak position at a common position in a frequency distribution of two or more with respect to a region, is determined as the document region peak, and a specific non-common position peak among non-common position peaks other than the common position peak is determined. The common position peak is determined as the extra-manuscript region peak, and the value between the pixel value of the extra-manuscript region peak and the pixel value of the manuscript region peak is set as the threshold value for each division region, and the threshold value for each division region is set. An image processing apparatus characterized in that it is a method of discriminating between the document area and the area outside the document for each divided area based on the method.
請求項12に記載の画像処理装置において、
前記第3判別手法において、前記複数の分割領域のうち、その複数の画素の画素値に関する度数分布が2以上のピークを有しない分割領域の閾値は、他の分割領域の閾値に基づいて求められることを特徴とする画像処理装置。
In the image processing apparatus according to claim 12,
In the third discrimination method, the threshold value of the divided region in which the frequency distribution regarding the pixel values of the plurality of pixels does not have a peak of 2 or more is obtained based on the threshold value of the other divided regions. An image processing device characterized by the fact that.
画像処理装置であって、
原稿台に載置された原稿に関するスキャン画像内の複数の画素の画素値の分布状況を分析する分析手段と、
前記分析手段による分析結果に基づいて、画像内にて前記原稿が存在する領域である原稿領域と前記原稿が存在しない領域である原稿外領域とを判別するための複数の判別手法の中から、前記スキャン画像に最も適した手法である最適手法を決定し、決定された最適手法を用いて、前記原稿領域と前記原稿外領域とを判別する領域判別手段と、
を備え、
前記複数の判別手法は、第1判別手法と第2判別手法とを含み、
前記第1判別手法は、前記スキャン画像の全体における複数の画素の画素値に関する度数分布に存在する複数のピークのうち、そのピーク位置の画素値が最も小さなピークを、前記原稿外領域に対応するピークである原稿外領域ピークとして推定し、残余のピークを、前記原稿領域に対応するピークである原稿領域ピークとして推定するとともに、前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法であり、
前記第2判別手法は、
スキャン処理における受光素子での受光量を示すアナログ入力値と出力画素値を示すデジタル出力値との間の入出力特性を調整する入出力特性調整処理であって前記入出力特性調整処理前の入出力特性における出力範囲の一部の範囲がより広い出力範囲となるように入出力特性を調整する入出力特性調整処理が施された後に得られる第2スキャン画像の全体における複数の画素の画素値に関する度数分布において、新たに求められる前記原稿外領域ピークの画素値と新たに求められる前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法と、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法
とのいずれかであり、
前記分析手段は、前記スキャン画像の全体における複数の画素の画素値に関する度数分布において、前記原稿外領域ピークと前記原稿領域ピークとの距離が一定程度よりも大きいか否かを判定し
前記領域判別手段は、前記スキャン画像の全体における複数の画素の画素値に関する度数分布において、
前記原稿外領域ピークと前記原稿領域ピークとの距離が一定程度よりも大きい旨が判定されることを条件として前記第1判別手法を前記最適手法として決定し、
前記原稿外領域ピークと前記原稿領域ピークとの距離が前記一定程度よりも小さい旨が判定されることを条件として前記第2判別手法を前記最適手法として決定することを特徴とする画像処理装置。
It is an image processing device
An analytical means for analyzing the distribution of pixel values of a plurality of pixels in a scanned image of a document placed on a platen, and an analysis means.
Based on the analysis result by the analysis means, from among a plurality of discrimination methods for discriminating between the manuscript area which is the region where the manuscript exists and the region outside the manuscript which is the region where the manuscript does not exist in the image. An area determination means for determining an optimum method, which is the most suitable method for the scanned image, and using the determined optimum method to discriminate between the original area and the outer area.
With
The plurality of discrimination methods include a first discrimination method and a second discrimination method.
In the first discrimination method, among a plurality of peaks existing in the frequency distribution relating to the pixel values of a plurality of pixels in the entire scanned image, the peak having the smallest pixel value at the peak position corresponds to the out-of-manuscript region. It is estimated as the peak of the extra-manuscript region peak, and the residual peak is estimated as the peak of the original region, which is the peak corresponding to the manuscript region, and the pixel value of the peak of the extra-manuscript region and the pixel value of the peak of the manuscript region. It is a method of discriminating between the manuscript area and the out-of-manuscript area based on the threshold value.
The second discrimination method is
This is an input / output characteristic adjustment process that adjusts the input / output characteristics between the analog input value that indicates the amount of light received by the light receiving element in the scan process and the digital output value that indicates the output pixel value, and is the input before the input / output characteristic adjustment process. Pixel values of a plurality of pixels in the entire second scan image obtained after the input / output characteristic adjustment processing for adjusting the input / output characteristics so that a part of the output range in the output characteristics becomes a wider output range. In the frequency distribution with respect to, the value between the newly obtained pixel value of the extra-manuscript region peak and the newly obtained pixel value of the manuscript region peak is set as a threshold, and the manuscript region and the outside of the manuscript are based on the threshold. The method of distinguishing from the area and
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold to extract edge candidates in the document region, and the document is based on the positions of four orthogonal points where the edge candidates are orthogonal to each other. When it is determined that at least one of the four orthogonal points is not detected in distinguishing the region from the extra-manuscript region, the positional relationship and geometry of the detection positions of the remaining orthogonal points. Based on the relationship, the positions of at least one orthogonal point are estimated so that the closed region formed by connecting the four orthogonal points with a straight line has a rectangular shape, and the closed region is used as the original document. A method of discriminating as an area and determining an area other than the closed area as the extra document area,
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold value to extract edge candidates in the original area, and among the extracted edge candidates, a straight line portion having a length equal to or longer than a predetermined value. Is specified as a regular edge portion of the original document area, a portion other than the straight line portion is specified as a false detection portion, and complementary processing based on the regular edge portion is performed to correct the false detection portion and correct it. It is one of the methods of discriminating the closed region formed by the later edge candidate as the document region and determining the region other than the closed region as the outer region of the document.
The analysis means determines whether or not the distance between the extra-manuscript region peak and the manuscript region peak is larger than a certain degree in the frequency distribution relating to the pixel values of the plurality of pixels in the entire scanned image .
The area determination means has a frequency distribution relating to pixel values of a plurality of pixels in the entire scanned image.
The first discrimination method is determined as the optimum method on condition that it is determined that the distance between the peak of the outer region of the original document and the peak of the original document region is larger than a certain degree.
An image processing apparatus, characterized in that the second determination method is determined as the optimum method on condition that it is determined that the distance between the out-of-manuscript region peak and the original document region peak is smaller than a certain degree.
画像処理装置であって、
原稿台に載置された原稿に関するスキャン画像内の複数の画素の画素値の分布状況を分析する分析手段と、
前記分析手段による分析結果に基づいて、画像内にて前記原稿が存在する領域である原稿領域と前記原稿が存在しない領域である原稿外領域とを判別するための複数の判別手法の中から、前記スキャン画像に最も適した手法である最適手法を決定し、決定された最適手法を用いて、前記原稿領域と前記原稿外領域とを判別する領域判別手段と、
を備え、
前記複数の判別手法は、第1判別手法と第4判別手法とを含み、
前記第1判別手法は、前記スキャン画像の全体における複数の画素の画素値に関する度数分布に存在する複数のピークのうち、そのピーク位置の画素値が最も小さなピークを、前記原稿外領域に対応するピークである原稿外領域ピークとして判定し、残余のピークを、前記原稿領域に対応するピークである原稿領域ピークとして判定するとともに、前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法であり、
前記第4判別手法は、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法
とのいずれかであり、
前記分析手段は、前記スキャン画像内の複数の画素の画素値の空間分布状況に基づいて、前記スキャン画像全体に所定程度以上のグラデーションが存在するか否かを判定し、
前記領域判別手段は、
前記スキャン画像全体における前記所定程度以上のグラデーションが存在することを条件として、前記第4判別手法を前記最適手法として決定し、
前記スキャン画像全体における前記所定程度以上のグラデーションが存在しないことを条件として、前記第1判別手法を前記最適手法として決定することを特徴とする画像処理装置。
It is an image processing device
An analytical means for analyzing the distribution of pixel values of a plurality of pixels in a scanned image of a document placed on a platen, and an analysis means.
Based on the analysis result by the analysis means, from among a plurality of discrimination methods for discriminating between the manuscript area which is the region where the manuscript exists and the region outside the manuscript which is the region where the manuscript does not exist in the image. An area determination means for determining an optimum method, which is the most suitable method for the scanned image, and using the determined optimum method to discriminate between the original area and the outer area.
With
The plurality of discrimination methods include a first discrimination method and a fourth discrimination method.
In the first discrimination method, among a plurality of peaks existing in the frequency distribution relating to the pixel values of a plurality of pixels in the entire scanned image, the peak having the smallest pixel value at the peak position corresponds to the out-of-manuscript region. It is determined as the peak outside the original region, and the residual peak is determined as the peak in the original region corresponding to the original region, and the pixel value of the peak outside the original and the pixel value of the peak in the original region. It is a method of discriminating between the manuscript area and the out-of-manuscript area based on the threshold value.
The fourth discrimination method is
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold to extract edge candidates in the document region, and the document is based on the positions of four orthogonal points where the edge candidates are orthogonal to each other. When it is determined that at least one of the four orthogonal points is not detected in distinguishing the region from the extra-manuscript region, the positional relationship and geometry of the detection positions of the remaining orthogonal points. Based on the relationship, the positions of at least one orthogonal point are estimated so that the closed region formed by connecting the four orthogonal points with a straight line has a rectangular shape, and the closed region is used as the original document. A method of discriminating as an area and determining an area other than the closed area as the extra document area,
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold value to extract edge candidates in the original area, and among the extracted edge candidates, a straight line portion having a length equal to or longer than a predetermined value. Is specified as a regular edge portion of the original document area, a portion other than the straight line portion is specified as a false detection portion, and complementary processing based on the regular edge portion is performed to correct the false detection portion and correct it. It is one of the methods of discriminating the closed region formed by the later edge candidate as the document region and determining the region other than the closed region as the outer region of the document.
The analysis means determines whether or not there is a gradation of a predetermined degree or more in the entire scanned image based on the spatial distribution of the pixel values of the plurality of pixels in the scanned image.
The area determination means
The fourth discrimination method is determined as the optimum method on condition that a gradation of a predetermined degree or more is present in the entire scanned image.
An image processing apparatus characterized in that the first discrimination method is determined as the optimum method on condition that a gradation of a predetermined degree or more does not exist in the entire scanned image.
画像処理装置であって、
原稿台に載置された原稿に関するスキャン画像内の複数の画素の画素値の分布状況を分析する分析手段と、
前記分析手段による分析結果に基づいて、画像内にて前記原稿が存在する領域である原稿領域と前記原稿が存在しない領域である原稿外領域とを判別するための複数の判別手法の中から、前記スキャン画像に最も適した手法である最適手法を決定し、決定された最適手法を用いて、前記原稿領域と前記原稿外領域とを判別する領域判別手段と、
を備え、
前記複数の判別手法は、第1判別手法と第4判別手法とを含み、
前記第1判別手法は、前記スキャン画像の全体における複数の画素の画素値に関する度数分布に存在する複数のピークのうち、そのピーク位置の画素値が最も小さなピークを、前記原稿外領域に対応するピークである原稿外領域ピークとして推定し、残余のピークを、前記原稿領域に対応するピークである原稿領域ピークとして推定するとともに、前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法であり、
前記第4判別手法は、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法
とのいずれかであり、
前記分析手段は、前記スキャン画像の全体における複数の画素の画素値に関する度数分布において、前記原稿外領域ピークと前記原稿領域ピークとの距離が一定程度よりも大きいか否かを判定し、
前記領域判別手段は、前記度数分布において、前記原稿外領域ピークと前記原稿領域ピークとの距離が前記一定程度よりも大きい旨が判定されることを条件として、前記第1判別手法を前記最適手法として決定し、
前記分析手段は、前記スキャン画像内の複数の画素の画素値の空間分布状況に基づいて、前記スキャン画像全体に所定程度以上のグラデーションが存在するか否かを判定し、
前記領域判別手段は、前記スキャン画像全体における前記所定程度以上のグラデーションが存在することを条件として、前記第4判別手法を前記最適手法として決定することを特徴とする画像処理装置。
It is an image processing device
An analytical means for analyzing the distribution of pixel values of a plurality of pixels in a scanned image of a document placed on a platen, and an analysis means.
Based on the analysis result by the analysis means, from among a plurality of discrimination methods for discriminating between the manuscript area which is the region where the manuscript exists and the region outside the manuscript which is the region where the manuscript does not exist in the image. An area determination means for determining an optimum method, which is the most suitable method for the scanned image, and using the determined optimum method to discriminate between the original area and the outer area.
With
The plurality of discrimination methods include a first discrimination method and a fourth discrimination method.
In the first discrimination method, among a plurality of peaks existing in the frequency distribution relating to the pixel values of a plurality of pixels in the entire scanned image, the peak having the smallest pixel value at the peak position corresponds to the out-of-manuscript region. It is estimated as the peak of the extra-manuscript region peak, and the residual peak is estimated as the peak of the original region, which is the peak corresponding to the manuscript region, and the pixel value of the peak of the extra-manuscript region and the pixel value of the peak of the manuscript region. It is a method of discriminating between the manuscript area and the out-of-manuscript area based on the threshold value.
The fourth discrimination method is
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold to extract edge candidates in the document region, and the document is based on the positions of four orthogonal points where the edge candidates are orthogonal to each other. When it is determined that at least one of the four orthogonal points is not detected in distinguishing the region from the extra-manuscript region, the positional relationship and geometry of the detection positions of the remaining orthogonal points. Based on the relationship, the positions of at least one orthogonal point are estimated so that the closed region formed by connecting the four orthogonal points with a straight line has a rectangular shape, and the closed region is used as the original document. A method of discriminating as an area and determining an area other than the closed area as the extra document area,
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold value to extract edge candidates in the original area, and among the extracted edge candidates, a straight line portion having a length equal to or longer than a predetermined value. Is specified as a regular edge portion of the original document area, a portion other than the straight line portion is specified as a false detection portion, and complementary processing based on the regular edge portion is performed to correct the false detection portion and correct it. It is one of the methods of discriminating the closed region formed by the later edge candidate as the document region and determining the region other than the closed region as the outer region of the document.
The analysis means determines whether or not the distance between the extra-manuscript region peak and the manuscript region peak is larger than a certain degree in the frequency distribution relating to the pixel values of the plurality of pixels in the entire scanned image.
The region discriminating means uses the first discriminating method as the optimum method on condition that it is determined in the frequency distribution that the distance between the out-of-manuscript region peak and the manuscript region peak is larger than a certain level. Determined as
The analysis means determines whether or not there is a gradation of a predetermined degree or more in the entire scanned image based on the spatial distribution of the pixel values of the plurality of pixels in the scanned image.
The image processing apparatus is characterized in that the area discriminating means determines the fourth discriminating method as the optimum method on condition that a gradation of a predetermined degree or more is present in the entire scanned image.
画像処理装置であって、
原稿台に載置された原稿に関するスキャン画像内の複数の画素の画素値の分布状況を分析する分析手段と、
前記分析手段による分析結果に基づいて、画像内にて前記原稿が存在する領域である原稿領域と前記原稿が存在しない領域である原稿外領域とを判別するための複数の判別手法の中から、前記スキャン画像に最も適した手法である最適手法を決定し、決定された最適手法を用いて、前記原稿領域と前記原稿外領域とを判別する領域判別手段と、
を備え、
前記複数の判別手法は、第2判別手法と第4判別手法とを含み、
前記第2判別手法は、スキャン処理における受光素子での受光量を示すアナログ入力値と出力画素値を示すデジタル出力値との間の入出力特性を調整する入出力特性調整処理であって前記入出力特性調整処理前の入出力特性における出力範囲の一部の範囲がより広い出力範囲となるように入出力特性を調整する入出力特性調整処理が施された後に得られる第2スキャン画像の全体における複数の画素の画素値に関する度数分布において、複数のピークのうち、そのピーク位置の画素値が最も小さなピークを、前記原稿外領域に対応するピークである原稿外領域ピークとして判定し、残余のピークを、前記原稿領域に対応するピークである原稿領域ピークとして判定するとともに、前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法であり、
前記第4判別手法は、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法
とのいずれかであり、
前記分析手段は、前記スキャン画像内の複数の画素の画素値の空間分布状況に基づいて、前記スキャン画像全体に所定程度以上のグラデーションが存在するか否かを判定し、
前記領域判別手段は、
前記スキャン画像全体における前記所定程度以上のグラデーションが存在することを条件として、前記第4判別手法を前記最適手法として決定し、
前記スキャン画像全体における前記所定程度以上のグラデーションが存在しないことを条件として、前記第2判別手法を前記最適手法として決定することを特徴とする画像処理装置。
It is an image processing device
An analytical means for analyzing the distribution of pixel values of a plurality of pixels in a scanned image of a document placed on a platen, and an analysis means.
Based on the analysis result by the analysis means, from among a plurality of discrimination methods for discriminating between the manuscript area which is the region where the manuscript exists and the region outside the manuscript which is the region where the manuscript does not exist in the image. An area determination means for determining an optimum method, which is the most suitable method for the scanned image, and using the determined optimum method to discriminate between the original area and the outer area.
With
The plurality of discrimination methods include a second discrimination method and a fourth discrimination method.
The second discrimination method is an input / output characteristic adjustment process for adjusting an input / output characteristic between an analog input value indicating the amount of light received by the light receiving element and a digital output value indicating an output pixel value in the scan process. The entire second scan image obtained after the input / output characteristic adjustment processing is performed to adjust the input / output characteristics so that a part of the output range in the input / output characteristics before the output characteristic adjustment processing becomes a wider output range. In the frequency distribution relating to the pixel values of a plurality of pixels in the above, the peak having the smallest pixel value at the peak position among the plurality of peaks is determined as the peak in the extra-manuscript region, which is the peak corresponding to the extra-manuscript region, and the remainder is determined. The peak is determined as a manuscript region peak which is a peak corresponding to the manuscript region, and a value between the pixel value of the out-of-manuscript region peak and the pixel value of the manuscript region peak is set as a threshold, and is based on the threshold. It is a method of discriminating between the original area and the outer area of the original.
The fourth discrimination method is
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold to extract edge candidates in the document region, and the document is based on the positions of four orthogonal points where the edge candidates are orthogonal to each other. When it is determined that at least one of the four orthogonal points is not detected in distinguishing the region from the extra-manuscript region, the positional relationship and geometry of the detection positions of the remaining orthogonal points. Based on the relationship, the positions of at least one orthogonal point are estimated so that the closed region formed by connecting the four orthogonal points with a straight line has a rectangular shape, and the closed region is used as the original document. A method of discriminating as an area and determining an area other than the closed area as the extra document area,
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold value to extract edge candidates in the original area, and among the extracted edge candidates, a straight line portion having a length equal to or longer than a predetermined value. Is specified as a regular edge portion of the original document area, a portion other than the straight line portion is specified as a false detection portion, and complementary processing based on the regular edge portion is performed to correct the false detection portion and correct it. It is one of the methods of discriminating the closed region formed by the later edge candidate as the document region and determining the region other than the closed region as the outer region of the document.
The analysis means determines whether or not there is a gradation of a predetermined degree or more in the entire scanned image based on the spatial distribution of the pixel values of the plurality of pixels in the scanned image.
The area determination means
The fourth discrimination method is determined as the optimum method on condition that a gradation of a predetermined degree or more is present in the entire scanned image.
An image processing apparatus characterized in that the second discrimination method is determined as the optimum method on condition that a gradation of a predetermined degree or more does not exist in the entire scanned image.
コンピュータに、
a)原稿台に載置された原稿に関するスキャン画像内の複数の画素の画素値の分布状況を分析するステップと、
b)前記ステップa)における分析結果に基づいて、画像内にて前記原稿が存在する領域である原稿領域と前記原稿が存在しない領域である原稿外領域とを判別するための複数の判別手法の中から、前記スキャン画像に最も適した手法である最適手法を決定するステップと、
c)前記ステップb)にて決定された最適手法を用いて、前記原稿領域と前記原稿外領域とを判別するステップと、
を実行させるためのプログラムであって、
前記複数の判別手法は、第1判別手法と第3判別手法とを含み、
前記第1判別手法は、前記スキャン画像の全体における複数の画素の画素値に関する度数分布に存在する複数のピークのうち、そのピーク位置の画素値が最も小さなピークを、前記原稿外領域に対応するピークである原稿外領域ピークとして推定し、残余のピークを、前記原稿領域に対応するピークである原稿領域ピークとして推定するとともに、前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法であり、
前記第3判別手法は、前記スキャン画像を縦方向と横方向とのうちの一の方向に区分して複数の分割領域に分割するとともに、分割領域ごとの度数分布であってその分割領域内の複数の画素の画素値に関する度数分布に存在する複数のピークのうち前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を分割領域ごとの閾値とし、分割領域ごとの当該閾値に基づいて前記原稿領域と前記原稿外領域とを分割領域ごとに判別する手法であり、
前記ステップa)は、
a−1)前記スキャン画像内の複数の画素の画素値の空間分布状況に基づいて、前記スキャン画像全体に所定程度以上のグラデーションが存在するか否かを判定するステップ、
を有し、
前記ステップb)は、
b−1)前記スキャン画像全体における前記所定程度以上のグラデーションが存在することを条件として、前記第3判別手法を前記最適手法として決定するステップと、
b−2)前記スキャン画像全体における前記所定程度以上のグラデーションが存在しないことを条件として、前記第1判別手法を前記最適手法として決定するステップと、
を有することを特徴とするプログラム。
On the computer
a) Steps to analyze the distribution of pixel values of multiple pixels in the scanned image of the document placed on the platen, and
b) Based on the analysis result in step a), a plurality of discrimination methods for discriminating between a manuscript area in which the manuscript exists and a non-manuscript area in which the manuscript does not exist in the image. From the steps, the step of determining the optimum method, which is the most suitable method for the scanned image, and
c) A step of discriminating between the manuscript area and the non-manuscript area using the optimum method determined in step b).
It is a program to execute
The plurality of discrimination methods include a first discrimination method and a third discrimination method.
In the first discrimination method, among a plurality of peaks existing in the frequency distribution relating to the pixel values of a plurality of pixels in the entire scanned image, the peak having the smallest pixel value at the peak position corresponds to the out-of-manuscript region. It is estimated as the peak of the extra-manuscript region peak, and the residual peak is estimated as the peak of the original region, which is the peak corresponding to the manuscript region, and the pixel value of the peak of the extra-manuscript region and the pixel value of the peak of the manuscript region. It is a method of discriminating between the manuscript area and the out-of-manuscript area based on the threshold value.
In the third discrimination method, the scanned image is divided into one of the vertical direction and the horizontal direction and divided into a plurality of divided regions, and the frequency distribution for each divided region is within the divided region. Of the plurality of peaks existing in the frequency distribution relating to the pixel values of the plurality of pixels, the value between the pixel value of the out-of-manuscript region peak and the pixel value of the manuscript region peak is set as the threshold value for each division region, and for each division region. It is a method of discriminating between the original area and the outer area of the original for each divided area based on the threshold value.
In step a),
a-1) A step of determining whether or not there is a gradation of a predetermined degree or more in the entire scanned image based on the spatial distribution of pixel values of a plurality of pixels in the scanned image.
Have,
In step b),
b-1) A step of determining the third discrimination method as the optimum method on condition that a gradation of a predetermined degree or more is present in the entire scanned image.
b-2) A step of determining the first discrimination method as the optimum method on condition that there is no gradation of the predetermined degree or more in the entire scanned image.
A program characterized by having.
請求項18に記載のプログラムにおいて、
前記ステップa)は、
a−2)前記スキャン画像に前記所定程度以上のグラデーションが存在する場合、前記空間分布状況に基づいて、前記所定程度以上のグラデーションの変化方向をさらに判定するステップ、
をさらに有し、
前記ステップb−1)において、前記スキャン画像全体における前記所定程度以上のグラデーションが存在し且つ前記変化方向が前記スキャン画像における縦方向と横方向とのいずれかである旨が判定されることを条件として、前記第3判別手法が前記最適手法として決定されるとともに、前記所定程度以上のグラデーションの前記変化方向が前記第3判別手法における前記一の方向として決定されることを特徴とするプログラム。
In the program of claim 18.
In step a),
a-2) When the scanned image has a gradation of the predetermined degree or more, the step of further determining the change direction of the gradation of the predetermined degree or more based on the spatial distribution situation.
Have more
In step b-1), it is a condition that it is determined that the gradation of the predetermined degree or more exists in the entire scanned image and the change direction is either the vertical direction or the horizontal direction in the scanned image. The program is characterized in that the third discrimination method is determined as the optimum method, and the change direction of the gradation of a predetermined degree or more is determined as the one direction in the third discrimination method.
請求項19に記載のプログラムにおいて、
前記複数の判別手法は、第4判別手法をも含み、
前記第4判別手法は、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法
とのいずれかであり、
前記ステップb)は、
b−3)前記スキャン画像全体における前記所定程度以上のグラデーションが存在し且つ前記変化方向が前記スキャン画像における斜め方向である旨が判定されることを条件として、前記第4判別手法を前記最適手法として決定するステップ、
をさらに有することを特徴とするプログラム。
In the program of claim 19.
The plurality of discrimination methods also include a fourth discrimination method.
The fourth discrimination method is
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold to extract edge candidates in the document region, and the document is based on the positions of four orthogonal points where the edge candidates are orthogonal to each other. When it is determined that at least one of the four orthogonal points is not detected in distinguishing the region from the extra-manuscript region, the positional relationship and geometry of the detection positions of the remaining orthogonal points. Based on the relationship, the positions of at least one orthogonal point are estimated so that the closed region formed by connecting the four orthogonal points with a straight line has a rectangular shape, and the closed region is used as the original document. A method of discriminating as an area and determining an area other than the closed area as the extra document area,
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold value to extract edge candidates in the original area, and among the extracted edge candidates, a straight line portion having a length equal to or longer than a predetermined value. Is specified as a regular edge portion of the original document area, a portion other than the straight line portion is specified as a false detection portion, and complementary processing based on the regular edge portion is performed to correct the false detection portion and correct it. It is one of the methods of discriminating the closed region formed by the later edge candidate as the document region and determining the region other than the closed region as the outer region of the document.
In step b),
b-3) The fourth discrimination method is the optimum method on condition that it is determined that the gradation of the predetermined degree or more is present in the entire scanned image and the change direction is the oblique direction in the scanned image. Steps to determine as,
A program characterized by having more.
コンピュータに、
a)原稿台に載置された原稿に関するスキャン画像内の複数の画素の画素値の分布状況を分析するステップと、
b)前記ステップa)における分析結果に基づいて、画像内にて前記原稿が存在する領域である原稿領域と前記原稿が存在しない領域である原稿外領域とを判別するための複数の判別手法の中から、前記スキャン画像に最も適した手法である最適手法を決定するステップと、
c)前記ステップb)にて決定された最適手法を用いて、前記原稿領域と前記原稿外領域とを判別するステップと、
を実行させるためのプログラムであって、
前記複数の判別手法は、第1判別手法と第3判別手法とを含み、
前記第1判別手法は、前記スキャン画像の全体における複数の画素の画素値に関する度数分布に存在する複数のピークのうち、そのピーク位置の画素値が最も小さなピークを、前記原稿外領域に対応するピークである原稿外領域ピークとして推定し、残余のピークを、前記原稿領域に対応するピークである原稿領域ピークとして推定するとともに、前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法であり、
前記第3判別手法は、前記スキャン画像を縦方向と横方向とのうちの一の方向に区分して複数の分割領域に分割するとともに、分割領域ごとの度数分布であってその分割領域内の複数の画素の画素値に関する度数分布に存在する複数のピークのうち前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を分割領域ごとの閾値とし、分割領域ごとの当該閾値に基づいて前記原稿領域と前記原稿外領域とを分割領域ごとに判別する手法であり、
前記ステップa)は、
a−1)前記スキャン画像の全体における複数の画素の画素値に関する度数分布において、前記原稿外領域ピークと前記原稿領域ピークとの距離が一定程度よりも大きいか否かを判定するステップと、
a−2)前記スキャン画像内の複数の画素の画素値の空間分布状況に基づいて、前記スキャン画像全体に所定程度以上のグラデーションが存在するか否かを判定するステップと、
を有し、
前記ステップb)は、
b−1)前記度数分布において、前記原稿外領域ピークと前記原稿領域ピークとの距離が前記一定程度よりも大きい旨が判定されることを条件として、前記第1判別手法を前記最適手法として決定するステップと、
b−2)前記スキャン画像全体における前記所定程度以上のグラデーションが存在することを条件として、前記第3判別手法を前記最適手法として決定するステップと、
を有することを特徴とするプログラム。
On the computer
a) Steps to analyze the distribution of pixel values of multiple pixels in the scanned image of the document placed on the platen, and
b) Based on the analysis result in step a), a plurality of discrimination methods for discriminating between a manuscript area in which the manuscript exists and a non-manuscript area in which the manuscript does not exist in the image. From the steps, the step of determining the optimum method, which is the most suitable method for the scanned image, and
c) A step of discriminating between the manuscript area and the non-manuscript area using the optimum method determined in step b).
It is a program to execute
The plurality of discrimination methods include a first discrimination method and a third discrimination method.
In the first discrimination method, among a plurality of peaks existing in the frequency distribution relating to the pixel values of a plurality of pixels in the entire scanned image, the peak having the smallest pixel value at the peak position corresponds to the out-of-manuscript region. It is estimated as the peak of the extra-manuscript region peak, and the residual peak is estimated as the peak of the original region, which is the peak corresponding to the manuscript region, and the pixel value of the peak of the extra-manuscript region and the pixel value of the peak of the manuscript region. It is a method of discriminating between the manuscript area and the out-of-manuscript area based on the threshold value.
In the third discrimination method, the scanned image is divided into one of the vertical direction and the horizontal direction and divided into a plurality of divided regions, and the frequency distribution for each divided region is within the divided region. Of the plurality of peaks existing in the frequency distribution relating to the pixel values of the plurality of pixels, the value between the pixel value of the out-of-manuscript region peak and the pixel value of the manuscript region peak is set as the threshold value for each division region, and for each division region. It is a method of discriminating between the original area and the outer area of the original for each divided area based on the threshold value.
In step a),
a-1) A step of determining whether or not the distance between the extra-manuscript region peak and the manuscript region peak is larger than a certain degree in the frequency distribution relating to the pixel values of a plurality of pixels in the entire scanned image.
a-2) A step of determining whether or not there is a gradation of a predetermined degree or more in the entire scanned image based on the spatial distribution of pixel values of a plurality of pixels in the scanned image.
Have,
In step b),
b-1) The first discrimination method is determined as the optimum method on the condition that it is determined in the frequency distribution that the distance between the outer-manuscript region peak and the manuscript region peak is larger than the certain degree. Steps to do and
b-2) A step of determining the third discrimination method as the optimum method on condition that a gradation of a predetermined degree or more is present in the entire scanned image.
A program characterized by having.
請求項21に記載のプログラムにおいて、
前記複数の判別手法は、第2判別手法をも含み、
前記第2判別手法は、
スキャン処理における受光素子での受光量を示すアナログ入力値と出力画素値を示すデジタル出力値との間の入出力特性を調整する入出力特性調整処理であって前記入出力特性調整処理前の入出力特性における出力範囲の一部の範囲がより広い出力範囲となるように入出力特性を調整する入出力特性調整処理が施された後に得られる第2スキャン画像の全体における複数の画素の画素値に関する度数分布において、新たに求められる前記原稿外領域ピークの画素値と新たに求められる前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法と、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法
とのいずれかであり、
前記ステップb)は、
b−3)前記原稿外領域ピークと前記原稿領域ピークとの距離が前記一定程度よりも小さい旨が判定されることを条件として前記第2判別手法を前記最適手法として決定するステップ、
をさらに有することを特徴とするプログラム。
In the program of claim 21,
The plurality of discrimination methods also include a second discrimination method.
The second discrimination method is
This is an input / output characteristic adjustment process that adjusts the input / output characteristics between the analog input value that indicates the amount of light received by the light receiving element in the scan process and the digital output value that indicates the output pixel value, and is the input before the input / output characteristic adjustment process. Pixel values of a plurality of pixels in the entire second scan image obtained after the input / output characteristic adjustment processing for adjusting the input / output characteristics so that a part of the output range in the output characteristics becomes a wider output range. In the frequency distribution with respect to, the value between the newly obtained pixel value of the extra-manuscript region peak and the newly obtained pixel value of the manuscript region peak is set as a threshold, and the manuscript region and the outside of the manuscript are based on the threshold. The method of distinguishing from the area and
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold to extract edge candidates in the document region, and the document is based on the positions of four orthogonal points where the edge candidates are orthogonal to each other. When it is determined that at least one of the four orthogonal points is not detected in distinguishing the region from the extra-manuscript region, the positional relationship and geometry of the detection positions of the remaining orthogonal points. Based on the relationship, the positions of at least one orthogonal point are estimated so that the closed region formed by connecting the four orthogonal points with a straight line has a rectangular shape, and the closed region is used as the original document. A method of discriminating as an area and determining an area other than the closed area as the extra document area,
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold value to extract edge candidates in the original area, and among the extracted edge candidates, a straight line portion having a length equal to or longer than a predetermined value. Is specified as a regular edge portion of the original document area, a portion other than the straight line portion is specified as a false detection portion, and complementary processing based on the regular edge portion is performed to correct the false detection portion and correct it. It is one of the methods of discriminating the closed region formed by the later edge candidate as the document region and determining the region other than the closed region as the outer region of the document.
In step b),
b-3) A step of determining the second discrimination method as the optimum method on condition that it is determined that the distance between the outer-manuscript region peak and the manuscript region peak is smaller than a certain degree.
A program characterized by having more.
請求項21に記載のプログラムにおいて、
前記ステップa)は、
a−3)前記スキャン画像に前記所定程度以上のグラデーションが存在する場合、前記空間分布状況に基づいて、前記所定程度以上のグラデーションの変化方向をさらに判定するステップ、
をさらに有し、
前記ステップb−2)において、前記スキャン画像全体における前記所定程度以上のグラデーションが存在し且つ前記変化方向が前記スキャン画像における縦方向と横方向とのいずれかである旨が判定されることを条件として、前記第3判別手法が前記最適手法として決定されるとともに、前記所定程度以上のグラデーションの前記変化方向が前記第3判別手法における前記一の方向として決定されることを特徴とするプログラム。
In the program of claim 21,
In step a),
a-3) When the scanned image has a gradation of the predetermined degree or more, the step of further determining the change direction of the gradation of the predetermined degree or more based on the spatial distribution situation.
Have more
In step b-2), it is a condition that it is determined that the gradation of the predetermined degree or more exists in the entire scanned image and the change direction is either the vertical direction or the horizontal direction in the scanned image. The program is characterized in that the third discrimination method is determined as the optimum method, and the change direction of the gradation of a predetermined degree or more is determined as the one direction in the third discrimination method.
請求項23に記載のプログラムにおいて、
前記複数の判別手法は、第4判別手法をも含み、
前記第4判別手法は、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法
とのいずれかであり、
前記ステップb)は、
b−4)前記スキャン画像全体における前記所定程度以上のグラデーションが存在し且つ前記変化方向が前記スキャン画像における斜め方向である旨が判定されることを条件として、前記第4判別手法を前記最適手法として決定するステップ、
をさらに有することを特徴とするプログラム。
In the program of claim 23
The plurality of discrimination methods also include a fourth discrimination method.
The fourth discrimination method is
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold to extract edge candidates in the document region, and the document is based on the positions of four orthogonal points where the edge candidates are orthogonal to each other. When it is determined that at least one of the four orthogonal points is not detected in distinguishing the region from the extra-manuscript region, the positional relationship and geometry of the detection positions of the remaining orthogonal points. Based on the relationship, the positions of at least one orthogonal point are estimated so that the closed region formed by connecting the four orthogonal points with a straight line has a rectangular shape, and the closed region is used as the original document. A method of discriminating as an area and determining an area other than the closed area as the extra document area,
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold value to extract edge candidates in the original area, and among the extracted edge candidates, a straight line portion having a length equal to or longer than a predetermined value. Is specified as a regular edge portion of the original document area, a portion other than the straight line portion is specified as a false detection portion, and complementary processing based on the regular edge portion is performed to correct the false detection portion and correct it. It is one of the methods of discriminating the closed region formed by the later edge candidate as the document region and determining the region other than the closed region as the outer region of the document.
In step b),
b-4) The fourth discrimination method is the optimum method on condition that it is determined that the gradation of the predetermined degree or more is present in the entire scanned image and the change direction is the oblique direction in the scanned image. Steps to determine as,
A program characterized by having more.
請求項24に記載のプログラムにおいて、
前記複数の判別手法は、第2判別手法をも含み、
前記第2判別手法は、
スキャン処理における受光素子での受光量を示すアナログ入力値と出力画素値を示すデジタル出力値との間の入出力特性を調整する入出力特性調整処理であって前記入出力特性調整処理前の入出力特性における出力範囲の一部の範囲がより広い出力範囲となるように入出力特性を調整する入出力特性調整処理が施された後に得られる第2スキャン画像の全体における複数の画素の画素値に関する度数分布において、新たに求められる前記原稿外領域ピークの画素値と新たに求められる前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法と、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法
とのいずれかであり、
前記ステップb)は、
b−5)前記原稿外領域ピークと前記原稿領域ピークとの距離が前記一定程度よりも小さい旨が判定されることを条件として前記第2判別手法を前記最適手法として決定するステップ、
をさらに有することを特徴とするプログラム。
In the program of claim 24
The plurality of discrimination methods also include a second discrimination method.
The second discrimination method is
This is an input / output characteristic adjustment process that adjusts the input / output characteristics between the analog input value that indicates the amount of light received by the light receiving element in the scan process and the digital output value that indicates the output pixel value, and is the input before the input / output characteristic adjustment process. Pixel values of a plurality of pixels in the entire second scan image obtained after the input / output characteristic adjustment processing for adjusting the input / output characteristics so that a part of the output range in the output characteristics becomes a wider output range. In the frequency distribution with respect to, the value between the newly obtained pixel value of the extra-manuscript region peak and the newly obtained pixel value of the manuscript region peak is set as a threshold, and the manuscript region and the outside of the manuscript are based on the threshold. The method of distinguishing from the area and
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold to extract edge candidates in the document region, and the document is based on the positions of four orthogonal points where the edge candidates are orthogonal to each other. When it is determined that at least one of the four orthogonal points is not detected in distinguishing the region from the extra-manuscript region, the positional relationship and geometry of the detection positions of the remaining orthogonal points. Based on the relationship, the positions of at least one orthogonal point are estimated so that the closed region formed by connecting the four orthogonal points with a straight line has a rectangular shape, and the closed region is used as the original document. A method of discriminating as an area and determining an area other than the closed area as the extra document area,
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold value to extract edge candidates in the original area, and among the extracted edge candidates, a straight line portion having a length equal to or longer than a predetermined value. Is specified as a regular edge portion of the original document area, a portion other than the straight line portion is specified as a false detection portion, and complementary processing based on the regular edge portion is performed to correct the false detection portion and correct it. It is one of the methods of discriminating the closed region formed by the later edge candidate as the document region and determining the region other than the closed region as the outer region of the document.
In step b),
b-5) A step of determining the second discrimination method as the optimum method on condition that it is determined that the distance between the outer document region peak and the document region peak is smaller than a certain degree.
A program characterized by having more.
請求項25に記載のプログラムにおいて、
前記第2判別手法は、前記第4判別手法と同じ手法であることを特徴とするプログラム。
In the program of claim 25
The program characterized in that the second discrimination method is the same method as the fourth discrimination method.
請求項25に記載のプログラムにおいて、
前記第2判別手法は、前記第4判別手法とは異なる手法であることを特徴とするプログラム。
In the program of claim 25
The program characterized in that the second discrimination method is a method different from the fourth discrimination method.
コンピュータに、
a)原稿台に載置された原稿に関するスキャン画像内の複数の画素の画素値の分布状況を分析するステップと、
b)前記ステップa)における分析結果に基づいて、画像内にて前記原稿が存在する領域である原稿領域と前記原稿が存在しない領域である原稿外領域とを判別するための複数の判別手法の中から、前記スキャン画像に最も適した手法である最適手法を決定するステップと、
c)前記ステップb)にて決定された最適手法を用いて、前記原稿領域と前記原稿外領域とを判別するステップと、
を実行させるためのプログラムであって、
前記複数の判別手法は、第3判別手法と第4判別手法とを含み、
前記第3判別手法は、前記スキャン画像を縦方向と横方向とのうちの一の方向に区分して複数の分割領域に分割するとともに、分割領域ごとの度数分布であってその分割領域内の複数の画素の画素値に関する度数分布に存在する複数のピークのうち前記原稿外領域に対応するピークである原稿外領域ピークの画素値と前記原稿領域に対応するピークである原稿領域ピークの画素値との間の値を分割領域ごとの閾値とし、分割領域ごとの当該閾値に基づいて前記原稿領域と前記原稿外領域とを分割領域ごとに判別する手法であり、
前記第4判別手法は、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法
とのいずれかであり、
前記ステップa)は、
a−1)前記スキャン画像内の複数の画素の画素値の空間分布状況に基づいて、前記スキャン画像全体に所定程度以上のグラデーションが存在するか否かを判定するステップと、
a−2)前記スキャン画像に前記所定程度以上のグラデーションが存在する場合、前記空間分布状況に基づいて、前記所定程度以上のグラデーションの変化方向をさらに判定するステップと、
を有し、
前記ステップb)は、
b−1)前記スキャン画像全体における前記所定程度以上のグラデーションが存在し且つ前記変化方向が前記スキャン画像における縦方向と横方向とのいずれかである旨が判定されることを条件として、前記第3判別手法を前記最適手法として決定するとともに、前記所定程度以上のグラデーションの前記変化方向を前記第3判別手法における前記一の方向として決定するステップと、
b−2)前記スキャン画像全体における前記所定程度以上のグラデーションが存在し且つ前記変化方向が前記スキャン画像における斜め方向である旨が判定されることを条件として、前記第4判別手法を前記最適手法として決定するステップと、
を有することを特徴とするプログラム。
On the computer
a) Steps to analyze the distribution of pixel values of multiple pixels in the scanned image of the document placed on the platen, and
b) Based on the analysis result in step a), a plurality of discrimination methods for discriminating between a manuscript area in which the manuscript exists and a non-manuscript area in which the manuscript does not exist in the image. From the steps, the step of determining the optimum method, which is the most suitable method for the scanned image, and
c) A step of discriminating between the manuscript area and the non-manuscript area using the optimum method determined in step b).
It is a program to execute
The plurality of discrimination methods include a third discrimination method and a fourth discrimination method.
In the third discrimination method, the scanned image is divided into one of the vertical direction and the horizontal direction and divided into a plurality of divided regions, and the frequency distribution for each divided region is within the divided region. Of the plurality of peaks existing in the frequency distribution relating to the pixel values of a plurality of pixels, the pixel value of the extra-manuscript region peak, which is the peak corresponding to the extra-manuscript region, and the pixel value of the manuscript region peak, which is the peak corresponding to the manuscript region. It is a method of discriminating between the original area and the outer area of the original for each divided area based on the threshold value for each divided area as the value between and.
The fourth discrimination method is
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold to extract edge candidates in the document region, and the document is based on the positions of four orthogonal points where the edge candidates are orthogonal to each other. When it is determined that at least one of the four orthogonal points is not detected in distinguishing the region from the extra-manuscript region, the positional relationship and geometry of the detection positions of the remaining orthogonal points. Based on the relationship, the positions of at least one orthogonal point are estimated so that the closed region formed by connecting the four orthogonal points with a straight line has a rectangular shape, and the closed region is used as the original document. A method of discriminating as an area and determining an area other than the closed area as the extra document area,
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold value to extract edge candidates in the original area, and among the extracted edge candidates, a straight line portion having a length equal to or longer than a predetermined value. Is specified as a regular edge portion of the original document area, a portion other than the straight line portion is specified as a false detection portion, and complementary processing based on the regular edge portion is performed to correct the false detection portion and correct it. It is one of the methods of discriminating the closed region formed by the later edge candidate as the document region and determining the region other than the closed region as the outer region of the document.
In step a),
a-1) A step of determining whether or not there is a gradation of a predetermined degree or more in the entire scanned image based on the spatial distribution of pixel values of a plurality of pixels in the scanned image.
a-2) When the scanned image has a gradation of the predetermined degree or more, a step of further determining the change direction of the gradation of the predetermined degree or more based on the spatial distribution situation, and
Have,
In step b),
b-1) The first condition is that it is determined that there is a gradation of a predetermined degree or more in the entire scanned image and the change direction is either the vertical direction or the horizontal direction in the scanned image. A step of determining the three discrimination methods as the optimum method and determining the change direction of the gradation of a predetermined degree or more as the one direction in the third discrimination method.
b-2) The fourth discrimination method is the optimum method on condition that it is determined that the gradation of the predetermined degree or more is present in the entire scanned image and the change direction is the oblique direction in the scanned image. And the steps to decide as
A program characterized by having.
請求項18から請求項28のいずれかに記載のプログラムにおいて、
前記第3判別手法は、前記スキャン画像を縦方向と横方向とのうちの一の方向に区分して複数の分割領域に分割するとともに、前記複数の分割領域のうちの2以上の分割領域であって各分割領域内の複数の画素の画素値に関する度数分布が2以上のピークを有する2以上の分割領域に関して、それぞれの度数分布に存在する複数のピークのうち、前記2以上の分割領域に関する2以上の度数分布における共通の位置にそのピーク位置を有するピークである共通位置ピークを前記原稿領域ピークとして判定し、前記共通位置ピーク以外のピークである非共通位置ピークのうち特定の非共通位置ピークを前記原稿外領域ピークとして判定するとともに、前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を分割領域ごとの閾値とし、分割領域ごとの当該閾値に基づいて前記原稿領域と前記原稿外領域とを分割領域ごとに判別する手法であることを特徴とするプログラム。
In the program according to any one of claims 18 to 28.
In the third discrimination method, the scanned image is divided into one of the vertical direction and the horizontal direction and divided into a plurality of divided regions, and two or more of the plurality of divided regions are used. With respect to two or more divided regions in which the frequency distributions related to the pixel values of the plurality of pixels in each divided region have two or more peaks, among the plurality of peaks existing in each frequency distribution, the two or more divided regions are related. A common position peak, which is a peak having its peak position at a common position in a frequency distribution of two or more, is determined as the document region peak, and a specific non-common position among non-common position peaks other than the common position peak is determined. The peak is determined as the extra-manuscript region peak, and the value between the pixel value of the extra-manuscript region peak and the pixel value of the manuscript region peak is set as the threshold value for each division region, and is based on the threshold value for each division region. A program characterized in that it is a method of discriminating between the document area and the area outside the document for each divided area.
請求項29に記載のプログラムにおいて、
前記第3判別手法において、前記複数の分割領域のうち、その複数の画素の画素値に関する度数分布が2以上のピークを有しない分割領域の閾値は、他の分割領域の閾値に基づいて求められることを特徴とするプログラム。
In the program of claim 29
In the third discrimination method, the threshold value of the divided region in which the frequency distribution regarding the pixel values of the plurality of pixels does not have a peak of 2 or more is obtained based on the threshold value of the other divided regions. A program characterized by that.
コンピュータに、
a)原稿台に載置された原稿に関するスキャン画像内の複数の画素の画素値の分布状況を分析するステップと、
b)前記ステップa)における分析結果に基づいて、画像内にて前記原稿が存在する領域である原稿領域と前記原稿が存在しない領域である原稿外領域とを判別するための複数の判別手法の中から、前記スキャン画像に最も適した手法である最適手法を決定するステップと、
c)前記ステップb)にて決定された最適手法を用いて、前記原稿領域と前記原稿外領域とを判別するステップと、
を実行させるためのプログラムであって、
前記複数の判別手法は、第1判別手法と第2判別手法とを含み、
前記第1判別手法は、前記スキャン画像の全体における複数の画素の画素値に関する度数分布に存在する複数のピークのうち、そのピーク位置の画素値が最も小さなピークを、前記原稿外領域に対応するピークである原稿外領域ピークとして推定し、残余のピークを、前記原稿領域に対応するピークである原稿領域ピークとして推定するとともに、前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法であり、
前記第2判別手法は、
スキャン処理における受光素子での受光量を示すアナログ入力値と出力画素値を示すデジタル出力値との間の入出力特性を調整する入出力特性調整処理であって前記入出力特性調整処理前の入出力特性における出力範囲の一部の範囲がより広い出力範囲となるように入出力特性を調整する入出力特性調整処理が施された後に得られる第2スキャン画像の全体における複数の画素の画素値に関する度数分布において、新たに求められる前記原稿外領域ピークの画素値と新たに求められる前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法と、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法
とのいずれかであり、
前記ステップa)は、
a−1)前記スキャン画像の全体における複数の画素の画素値に関する度数分布において、前記原稿外領域ピークと前記原稿領域ピークとの距離が一定程度よりも大きいか否かを判定するステップ、
を有し、
前記ステップb)は、
b−1)前記原稿外領域ピークと前記原稿領域ピークとの距離が前記一定程度よりも大きい旨が判定されることを条件として前記第1判別手法を前記最適手法として決定するステップと、
b−2)前記原稿外領域ピークと前記原稿領域ピークとの距離が前記一定程度よりも小さい旨が判定されることを条件として前記第2判別手法を前記最適手法として決定するステップと、
を有することを特徴とするプログラム。
On the computer
a) Steps to analyze the distribution of pixel values of multiple pixels in the scanned image of the document placed on the platen, and
b) Based on the analysis result in step a), a plurality of discrimination methods for discriminating between a manuscript area in which the manuscript exists and a non-manuscript area in which the manuscript does not exist in the image. From the steps, the step of determining the optimum method, which is the most suitable method for the scanned image, and
c) A step of discriminating between the manuscript area and the non-manuscript area using the optimum method determined in step b).
It is a program to execute
The plurality of discrimination methods include a first discrimination method and a second discrimination method.
In the first discrimination method, among a plurality of peaks existing in the frequency distribution relating to the pixel values of a plurality of pixels in the entire scanned image, the peak having the smallest pixel value at the peak position corresponds to the out-of-manuscript region. It is estimated as the peak of the extra-manuscript region peak, and the residual peak is estimated as the peak of the original region, which is the peak corresponding to the manuscript region, and the pixel value of the peak of the extra-manuscript region and the pixel value of the peak of the manuscript region. It is a method of discriminating between the manuscript area and the out-of-manuscript area based on the threshold value.
The second discrimination method is
This is an input / output characteristic adjustment process that adjusts the input / output characteristics between the analog input value that indicates the amount of light received by the light receiving element in the scan process and the digital output value that indicates the output pixel value, and is the input before the input / output characteristic adjustment process. Pixel values of a plurality of pixels in the entire second scan image obtained after the input / output characteristic adjustment processing for adjusting the input / output characteristics so that a part of the output range in the output characteristics becomes a wider output range. In the frequency distribution with respect to, the value between the newly obtained pixel value of the extra-manuscript region peak and the newly obtained pixel value of the manuscript region peak is set as a threshold, and the manuscript region and the outside of the manuscript are based on the threshold. The method of distinguishing from the area and
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold to extract edge candidates in the document region, and the document is based on the positions of four orthogonal points where the edge candidates are orthogonal to each other. When it is determined that at least one of the four orthogonal points is not detected in distinguishing the region from the extra-manuscript region, the positional relationship and geometry of the detection positions of the remaining orthogonal points. Based on the relationship, the positions of at least one orthogonal point are estimated so that the closed region formed by connecting the four orthogonal points with a straight line has a rectangular shape, and the closed region is used as the original document. A method of discriminating as an area and determining an area other than the closed area as the extra document area,
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold value to extract edge candidates in the original area, and among the extracted edge candidates, a straight line portion having a length equal to or longer than a predetermined value. Is specified as a regular edge portion of the original document area, a portion other than the straight line portion is specified as a false detection portion, and complementary processing based on the regular edge portion is performed to correct the false detection portion and correct it. It is one of the methods of discriminating the closed region formed by the later edge candidate as the document region and determining the region other than the closed region as the outer region of the document.
In step a),
a-1) A step of determining whether or not the distance between the out-of-manuscript region peak and the manuscript region peak is larger than a certain degree in the frequency distribution relating to the pixel values of a plurality of pixels in the entire scanned image.
Have,
In step b),
b-1) A step of determining the first determination method as the optimum method on condition that it is determined that the distance between the out-of-manuscript region peak and the original document region peak is larger than a certain degree.
b-2) A step of determining the second discrimination method as the optimum method on condition that it is determined that the distance between the outer-manuscript region peak and the manuscript region peak is smaller than a certain degree.
A program characterized by having.
コンピュータに、
a)原稿台に載置された原稿に関するスキャン画像内の複数の画素の画素値の分布状況を分析するステップと、
b)前記ステップa)における分析結果に基づいて、画像内にて前記原稿が存在する領域である原稿領域と前記原稿が存在しない領域である原稿外領域とを判別するための複数の判別手法の中から、前記スキャン画像に最も適した手法である最適手法を決定するステップと、
c)前記ステップb)にて決定された最適手法を用いて、前記原稿領域と前記原稿外領域とを判別するステップと、
を実行させるためのプログラムであって、
前記複数の判別手法は、第1判別手法と第4判別手法とを含み、
前記第1判別手法は、前記スキャン画像の全体における複数の画素の画素値に関する度数分布に存在する複数のピークのうち、そのピーク位置の画素値が最も小さなピークを、前記原稿外領域に対応するピークである原稿外領域ピークとして推定し、残余のピークを、前記原稿領域に対応するピークである原稿領域ピークとして推定するとともに、前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法であり、
前記第4判別手法は、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法
とのいずれかであり、
前記ステップa)は、
a−1)前記スキャン画像内の複数の画素の画素値の空間分布状況に基づいて、前記スキャン画像全体に所定程度以上のグラデーションが存在するか否かを判定するステップ、
を有し、
前記ステップb)は、
b−1)前記スキャン画像全体における前記所定程度以上のグラデーションが存在することを条件として、前記第4判別手法を前記最適手法として決定するステップと、
b−2)前記スキャン画像全体における前記所定程度以上のグラデーションが存在しないことを条件として、前記第1判別手法を前記最適手法として決定するステップと、
を有することを特徴とするプログラム。
On the computer
a) Steps to analyze the distribution of pixel values of multiple pixels in the scanned image of the document placed on the platen, and
b) Based on the analysis result in step a), a plurality of discrimination methods for discriminating between a manuscript area in which the manuscript exists and a non-manuscript area in which the manuscript does not exist in the image. From the steps, the step of determining the optimum method, which is the most suitable method for the scanned image, and
c) A step of discriminating between the manuscript area and the non-manuscript area using the optimum method determined in step b).
It is a program to execute
The plurality of discrimination methods include a first discrimination method and a fourth discrimination method.
In the first discrimination method, among a plurality of peaks existing in the frequency distribution relating to the pixel values of a plurality of pixels in the entire scanned image, the peak having the smallest pixel value at the peak position corresponds to the out-of-manuscript region. It is estimated as the peak of the extra-manuscript region peak, and the residual peak is estimated as the peak of the original region, which is the peak corresponding to the manuscript region, and the pixel value of the peak of the extra-manuscript region and the pixel value of the peak of the manuscript region. It is a method of discriminating between the manuscript area and the out-of-manuscript area based on the threshold value.
The fourth discrimination method is
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold to extract edge candidates in the document region, and the document is based on the positions of four orthogonal points where the edge candidates are orthogonal to each other. When it is determined that at least one of the four orthogonal points is not detected in distinguishing the region from the extra-manuscript region, the positional relationship and geometry of the detection positions of the remaining orthogonal points. Based on the relationship, the positions of at least one orthogonal point are estimated so that the closed region formed by connecting the four orthogonal points with a straight line has a rectangular shape, and the closed region is used as the original document. A method of discriminating as an area and determining an area other than the closed area as the extra document area,
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold value to extract edge candidates in the original area, and among the extracted edge candidates, a straight line portion having a length equal to or longer than a predetermined value. Is specified as a regular edge portion of the original document area, a portion other than the straight line portion is specified as a false detection portion, and complementary processing based on the regular edge portion is performed to correct the false detection portion and correct it. It is one of the methods of discriminating the closed region formed by the later edge candidate as the document region and determining the region other than the closed region as the outer region of the document.
In step a),
a-1) A step of determining whether or not there is a gradation of a predetermined degree or more in the entire scanned image based on the spatial distribution of pixel values of a plurality of pixels in the scanned image.
Have,
In step b),
b-1) A step of determining the fourth discrimination method as the optimum method on condition that a gradation of a predetermined degree or more is present in the entire scanned image.
b-2) A step of determining the first discrimination method as the optimum method on condition that there is no gradation of the predetermined degree or more in the entire scanned image.
A program characterized by having.
コンピュータに、
a)原稿台に載置された原稿に関するスキャン画像内の複数の画素の画素値の分布状況を分析するステップと、
b)前記ステップa)における分析結果に基づいて、画像内にて前記原稿が存在する領域である原稿領域と前記原稿が存在しない領域である原稿外領域とを判別するための複数の判別手法の中から、前記スキャン画像に最も適した手法である最適手法を決定するステップと、
c)前記ステップb)にて決定された最適手法を用いて、前記原稿領域と前記原稿外領域とを判別するステップと、
を実行させるためのプログラムであって、
前記複数の判別手法は、第1判別手法と第4判別手法とを含み、
前記第1判別手法は、前記スキャン画像の全体における複数の画素の画素値に関する度数分布に存在する複数のピークのうち、そのピーク位置の画素値が最も小さなピークを、前記原稿外領域に対応するピークである原稿外領域ピークとして推定し、残余のピークを、前記原稿領域に対応するピークである原稿領域ピークとして推定するとともに、前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法であり、
前記第4判別手法は、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法
とのいずれかであり、
前記ステップa)は、
a−1)前記スキャン画像の全体における複数の画素の画素値に関する度数分布において、前記原稿外領域ピークと前記原稿領域ピークとの距離が一定程度よりも大きいか否かを判定するステップと、
a−2)前記スキャン画像内の複数の画素の画素値の空間分布状況に基づいて、前記スキャン画像全体に所定程度以上のグラデーションが存在するか否かを判定するステップと、
を有し、
前記ステップb)は、
b−1)前記度数分布において、前記原稿外領域ピークと前記原稿領域ピークとの距離が前記一定程度よりも大きい旨が判定されることを条件として、前記第1判別手法を前記最適手法として決定するステップと、
b−2)前記スキャン画像全体における前記所定程度以上のグラデーションが存在することを条件として、前記第4判別手法を前記最適手法として決定するステップと、
を有することを特徴とするプログラム。
On the computer
a) Steps to analyze the distribution of pixel values of multiple pixels in the scanned image of the document placed on the platen, and
b) Based on the analysis result in step a), a plurality of discrimination methods for discriminating between a manuscript area in which the manuscript exists and a non-manuscript area in which the manuscript does not exist in the image. From the steps, the step of determining the optimum method, which is the most suitable method for the scanned image, and
c) A step of discriminating between the manuscript area and the non-manuscript area using the optimum method determined in step b).
It is a program to execute
The plurality of discrimination methods include a first discrimination method and a fourth discrimination method.
In the first discrimination method, among a plurality of peaks existing in the frequency distribution relating to the pixel values of a plurality of pixels in the entire scanned image, the peak having the smallest pixel value at the peak position corresponds to the out-of-manuscript region. It is estimated as the peak of the extra-manuscript region peak, and the residual peak is estimated as the peak of the original region, which is the peak corresponding to the manuscript region, and the pixel value of the peak of the extra-manuscript region and the pixel value of the peak of the manuscript region. It is a method of discriminating between the manuscript area and the out-of-manuscript area based on the threshold value.
The fourth discrimination method is
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold to extract edge candidates in the document region, and the document is based on the positions of four orthogonal points where the edge candidates are orthogonal to each other. When it is determined that at least one of the four orthogonal points is not detected in distinguishing the region from the extra-manuscript region, the positional relationship and geometry of the detection positions of the remaining orthogonal points. Based on the relationship, the positions of at least one orthogonal point are estimated so that the closed region formed by connecting the four orthogonal points with a straight line has a rectangular shape, and the closed region is used as the original document. A method of discriminating as an area and determining an area other than the closed area as the extra document area,
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold value to extract edge candidates in the original area, and among the extracted edge candidates, a straight line portion having a length equal to or longer than a predetermined value. Is specified as a regular edge portion of the original document area, a portion other than the straight line portion is specified as a false detection portion, and complementary processing based on the regular edge portion is performed to correct the false detection portion and correct it. It is one of the methods of discriminating the closed region formed by the later edge candidate as the document region and determining the region other than the closed region as the outer region of the document.
In step a),
a-1) A step of determining whether or not the distance between the extra-manuscript region peak and the manuscript region peak is larger than a certain degree in the frequency distribution relating to the pixel values of a plurality of pixels in the entire scanned image.
a-2) A step of determining whether or not there is a gradation of a predetermined degree or more in the entire scanned image based on the spatial distribution of pixel values of a plurality of pixels in the scanned image.
Have,
In step b),
b-1) The first discrimination method is determined as the optimum method on the condition that it is determined in the frequency distribution that the distance between the outer-manuscript region peak and the manuscript region peak is larger than the certain degree. Steps to do and
b-2) A step of determining the fourth discrimination method as the optimum method on condition that a gradation of a predetermined degree or more is present in the entire scanned image.
A program characterized by having.
コンピュータに、
a)原稿台に載置された原稿に関するスキャン画像内の複数の画素の画素値の分布状況を分析するステップと、
b)前記ステップa)における分析結果に基づいて、画像内にて前記原稿が存在する領域である原稿領域と前記原稿が存在しない領域である原稿外領域とを判別するための複数の判別手法の中から、前記スキャン画像に最も適した手法である最適手法を決定するステップと、
c)前記ステップb)にて決定された最適手法を用いて、前記原稿領域と前記原稿外領域とを判別するステップと、
を実行させるためのプログラムであって、
前記複数の判別手法は、第2判別手法と第4判別手法とを含み、
前記第2判別手法は、
スキャン処理における受光素子での受光量を示すアナログ入力値と出力画素値を示すデジタル出力値との間の入出力特性を調整する入出力特性調整処理であって前記入出力特性調整処理前の入出力特性における出力範囲の一部の範囲がより広い出力範囲となるように入出力特性を調整する入出力特性調整処理が施された後に得られる第2スキャン画像の全体における複数の画素の画素値に関する度数分布において、複数のピークのうち、そのピーク位置の画素値が最も小さなピークを、前記原稿外領域に対応するピークである原稿外領域ピークとして判定し、残余のピークを、前記原稿領域に対応するピークである原稿領域ピークとして判定するとともに、前記原稿外領域ピークの画素値と前記原稿領域ピークの画素値との間の値を閾値とし、当該閾値に基づいて前記原稿領域と前記原稿外領域とを判別する手法であり、
前記第4判別手法は、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、前記エッジ候補が直交する4点の直交点の位置に基づき前記原稿領域と前記原稿外領域とを判別するにあたって、前記4点の直交点のうちの少なくとも1点の直交点が検出されない旨が判定される場合、残余の直交点の検出位置の位置関係と幾何学関係とに基づいて、前記4点の直交点が直線で接続されて形成される閉領域が矩形形状を有するように、前記少なくとも1点の直交点の位置を推定し、前記閉領域を前記原稿領域として判別し、前記閉領域以外の領域を前記原稿外領域として判別する手法と、
前記スキャン画像に対して暫定的な閾値に基づく二値化処理およびエッジ抽出処理を施して前記原稿領域のエッジ候補を抽出し、抽出されたエッジ候補のうち、所定値以上の長さの直線部分を前記原稿領域の正規のエッジ部分として特定するとともに、前記直線部分以外の部分を誤検出部分として特定し、前記正規のエッジ部分に基づく補完処理を行って前記誤検出部分を補正して、補正後のエッジ候補で形成される閉領域を前記原稿領域として判別し、当該閉領域以外の領域を前記原稿外領域として判別する手法
とのいずれかであり、
前記ステップa)は、
a−1)前記スキャン画像内の複数の画素の画素値の空間分布状況に基づいて、前記スキャン画像全体に所定程度以上のグラデーションが存在するか否かを判定するステップ、
を有し、
前記ステップb)は、
b−1)前記スキャン画像全体における前記所定程度以上のグラデーションが存在することを条件として、前記第4判別手法を前記最適手法として決定するステップと、
b−2)前記スキャン画像全体における前記所定程度以上のグラデーションが存在しないことを条件として、前記第2判別手法を前記最適手法として決定するステップと、
を有することを特徴とするプログラム。
On the computer
a) Steps to analyze the distribution of pixel values of multiple pixels in the scanned image of the document placed on the platen, and
b) Based on the analysis result in step a), a plurality of discrimination methods for discriminating between a manuscript area in which the manuscript exists and a non-manuscript area in which the manuscript does not exist in the image. From the steps, the step of determining the optimum method, which is the most suitable method for the scanned image, and
c) A step of discriminating between the manuscript area and the non-manuscript area using the optimum method determined in step b).
It is a program to execute
The plurality of discrimination methods include a second discrimination method and a fourth discrimination method.
The second discrimination method is
This is an input / output characteristic adjustment process that adjusts the input / output characteristics between the analog input value that indicates the amount of light received by the light receiving element in the scan process and the digital output value that indicates the output pixel value, and is the input before the input / output characteristic adjustment process. Pixel values of a plurality of pixels in the entire second scan image obtained after the input / output characteristic adjustment processing for adjusting the input / output characteristics so that a part of the output range in the output characteristics becomes a wider output range. Of the plurality of peaks, the peak having the smallest pixel value at the peak position is determined as the extra-manuscript region peak, which is the peak corresponding to the extra-manuscript region, and the remaining peak is set in the manuscript region. It is determined as the original area peak which is the corresponding peak, and the value between the pixel value of the extra document area peak and the pixel value of the original document area peak is set as a threshold, and the original area and the outside of the original are based on the threshold. It is a method to distinguish from the area,
The fourth discrimination method is
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold to extract edge candidates in the document region, and the document is based on the positions of four orthogonal points where the edge candidates are orthogonal to each other. When it is determined that at least one of the four orthogonal points is not detected in distinguishing the region from the extra-manuscript region, the positional relationship and geometry of the detection positions of the remaining orthogonal points. Based on the relationship, the positions of at least one orthogonal point are estimated so that the closed region formed by connecting the four orthogonal points with a straight line has a rectangular shape, and the closed region is used as the original document. A method of discriminating as an area and determining an area other than the closed area as the extra document area,
The scanned image is subjected to binarization processing and edge extraction processing based on a provisional threshold value to extract edge candidates in the original area, and among the extracted edge candidates, a straight line portion having a length equal to or longer than a predetermined value. Is specified as a regular edge portion of the original document area, a portion other than the straight line portion is specified as a false detection portion, and complementary processing based on the regular edge portion is performed to correct the false detection portion and correct it. It is one of the methods of discriminating the closed region formed by the later edge candidate as the document region and determining the region other than the closed region as the outer region of the document.
In step a),
a-1) A step of determining whether or not there is a gradation of a predetermined degree or more in the entire scanned image based on the spatial distribution of pixel values of a plurality of pixels in the scanned image.
Have,
In step b),
b-1) A step of determining the fourth discrimination method as the optimum method on condition that a gradation of a predetermined degree or more is present in the entire scanned image.
b-2) A step of determining the second discrimination method as the optimum method on condition that there is no gradation of the predetermined degree or more in the entire scanned image.
A program characterized by having.
JP2016183040A 2016-09-20 2016-09-20 Image forming device and program Active JP6848290B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016183040A JP6848290B2 (en) 2016-09-20 2016-09-20 Image forming device and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016183040A JP6848290B2 (en) 2016-09-20 2016-09-20 Image forming device and program

Publications (2)

Publication Number Publication Date
JP2018050114A JP2018050114A (en) 2018-03-29
JP6848290B2 true JP6848290B2 (en) 2021-03-24

Family

ID=61767823

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016183040A Active JP6848290B2 (en) 2016-09-20 2016-09-20 Image forming device and program

Country Status (1)

Country Link
JP (1) JP6848290B2 (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4057223B2 (en) * 2000-06-30 2008-03-05 セイコーエプソン株式会社 Digital image binarization threshold selection method
JP3829667B2 (en) * 2001-08-21 2006-10-04 コニカミノルタホールディングス株式会社 Image processing apparatus, image processing method, program for executing image processing method, and storage medium storing program
JP4952576B2 (en) * 2007-12-28 2012-06-13 ブラザー工業株式会社 Image reading device
JP2010225047A (en) * 2009-03-25 2010-10-07 Seiko Epson Corp Noise component removing device, and medium with noise component removing program recorded thereon
JP5701182B2 (en) * 2011-08-18 2015-04-15 株式会社Pfu Image processing apparatus, image processing method, and computer program

Also Published As

Publication number Publication date
JP2018050114A (en) 2018-03-29

Similar Documents

Publication Publication Date Title
US7768676B2 (en) Image reading apparatus
JP6122260B2 (en) Image processing apparatus and method and program thereof
US8149478B2 (en) Image processing apparatus and method of controlling same
US20080137153A1 (en) Image processing apparatus and method
US20050280849A1 (en) Correcting background color of a scanned image
CN110691172B (en) Image processing apparatus, image processing method, and recording medium
KR20120132314A (en) Image processing apparatus, image processing method, and computer readable medium
AU2011200831B8 (en) Dynamic thresholds for document tamper detection
JP4502001B2 (en) Image processing apparatus and image processing method
JP5531464B2 (en) Image processing program, image processing apparatus, and image processing method
US8330997B2 (en) Image processing apparatus, image forming apparatus and image processing method
JP2004260523A (en) Document type discriminating device
JP6848290B2 (en) Image forming device and program
JP2009272994A (en) Image reader and image forming apparatus equipped with the same
US8494272B2 (en) Image processing device, image processing method, and computer readable medium for judging if images are matched
JP5222127B2 (en) Image processing apparatus, image processing method, and program
US20080181534A1 (en) Image processing method, image processing apparatus, image reading apparatus, image forming apparatus and recording medium
JP2002084409A (en) Image forming device
JP4810614B2 (en) Image processing apparatus, image forming apparatus, determination method, program, and computer-readable storage medium
JP6714859B2 (en) Image forming apparatus and program
JP2003134322A (en) Picture processor, picture processing method, program for executing picture processing method and recording medium with recorded program
US8488138B2 (en) Method for composing a reflectivity histogram and reprographic apparatus using this method
US20240244154A1 (en) Information processing system, method, and non-transitory computer-executable medium
JP4257708B2 (en) Shadow area determination method, image processing method, shadow area determination apparatus, image processing apparatus, image forming apparatus, image reading apparatus, computer program, and recording medium
JP6270054B2 (en) Image processing apparatus, image forming apparatus, image processing method, and image processing program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20190614

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20200228

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20200407

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20200515

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20201110

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20210108

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20210215

R150 Certificate of patent or registration of utility model

Ref document number: 6848290

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150