JP2023017562A - Image processing device, control method, and program - Google Patents

Image processing device, control method, and program Download PDF

Info

Publication number
JP2023017562A
JP2023017562A JP2021121906A JP2021121906A JP2023017562A JP 2023017562 A JP2023017562 A JP 2023017562A JP 2021121906 A JP2021121906 A JP 2021121906A JP 2021121906 A JP2021121906 A JP 2021121906A JP 2023017562 A JP2023017562 A JP 2023017562A
Authority
JP
Japan
Prior art keywords
document
image
control unit
edge
pixels
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.)
Pending
Application number
JP2021121906A
Other languages
Japanese (ja)
Inventor
純平 坂本
Jumpei Sakamoto
泰崇 平山
Yasutaka Hirayama
章人 吉田
Akito Yoshida
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.)
Sharp Corp
Original Assignee
Sharp Corp
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 Sharp Corp filed Critical Sharp Corp
Priority to JP2021121906A priority Critical patent/JP2023017562A/en
Publication of JP2023017562A publication Critical patent/JP2023017562A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Facsimile Scanning Arrangements (AREA)
  • Editing Of Facsimile Originals (AREA)
  • Facsimile Image Signal Circuits (AREA)

Abstract

To provide an image processing device, etc. capable of properly executing processing based on a document conveyed obliquely when it is conveyed.SOLUTION: The device comprises: an image input unit for reading a document and inputting an image of the document, and a control unit. In a case where the document inputted by the image input unit is oblique, the control unit executes processing on the image on the basis of the distribution of the pixel values of pixels included in a rectangular region whose one edge is made of pixels constituting an edge in each edge of the image.SELECTED DRAWING: Figure 1

Description

本開示は、画像処理装置等に関する。 The present disclosure relates to an image processing device and the like.

従来、自動原稿送り装置(ADF:Auto Document Feeder)に載置された原稿を読み取り、読み取った原稿の画像を出力したり保存したりする複合機(MFP;Multi-Function Peripheral/Printer)が広く利用されている。また、読み取った原稿が無地(白紙)であるか否かを判定する技術も提案されている。 Traditionally, MFPs (Multi-Function Peripherals/Printers) have been widely used to read documents placed on an automatic document feeder (ADF) and output or save the images of the scanned documents. It is Techniques for determining whether or not a read document is plain (blank) have also been proposed.

例えば、原稿が無地であるか否かを判定するために読み取られる原稿の領域を、原稿全体の領域よりも内側の領域とする技術が提案されている(例えば、特許文献1及び特許文献2参照)。また、原稿を読み取ることで得られる画像データを複数の領域に分割し、分割した各領域の画像データに含まれた輝度の分散値を取得し、該分散値を用いて前記各領域に対してコンテンツが含まれるか否かを判定し、各領域の判定結果に基づいて原稿にコンテンツが含まれているか否かを判定する技術が提案されている(例えば、特許文献3参照)。 For example, a technique has been proposed in which the area of the document read to determine whether the document is plain is an area inside the area of the entire document (see, for example, Patent Documents 1 and 2). ). Further, image data obtained by reading a document is divided into a plurality of regions, a luminance variance value included in the image data of each divided region is obtained, and the variance value is used for each region. A technique has been proposed for determining whether or not content is included in a document, and determining whether or not a document includes content based on the determination result of each area (see, for example, Patent Document 3).

特開2006-279094号公報JP 2006-279094 A 特開2015-128288号公報JP 2015-128288 A 特開2014-215775号公報JP 2014-215775 A

ここで、特許文献1や特許文献2に記載された方法では、原稿が無地であるか否かを判定するために読み取られる原稿の領域の外に文字や図が記載されているにも関わらず、当該領域に何も記載がないとき、当該原稿が無地と誤って判定されるおそれがある。 Here, in the methods described in Patent Literature 1 and Patent Literature 2, even though characters and figures are described outside the area of the document that is read to determine whether the document is blank, , there is a possibility that the document is erroneously determined to be blank when there is no description in the area.

また、原稿の下に位置する部材の色と原稿の用紙の色とが異なる場合において、無地の原稿が斜めに搬送されたとき、複合機は、図27(a)に示すような画像を取得する。この場合、図27(b)に示すように、原稿のエッジ部分とエッジ以外の部分との間で、輝度の変化が生じる。ここで、特許文献3に記載された技術を用いると、図27(c)に示すように、分割された各領域の輝度値の分散が大きくなるため、それぞれの領域においてコンテンツが含まれると判定される。その結果、無地の原稿にも関わらず、コンテンツを含む原稿と判定されてしまう恐れがある。 Also, when the color of the member positioned under the document is different from the color of the paper of the document, when the plain document is conveyed obliquely, the multifunction device obtains an image as shown in FIG. 27(a). do. In this case, as shown in FIG. 27(b), a change in luminance occurs between the edge portion of the document and the portion other than the edge. Here, if the technology described in Patent Document 3 is used, as shown in FIG. be done. As a result, there is a risk that the document will be determined to contain content even though the document is blank.

本開示は上述した課題に鑑み、原稿が斜めに搬送された場合、当該原稿の画像に基づき適切に処理を実行することが可能な画像処理装置等を提供することを目的とする。 SUMMARY An advantage of some aspects of the disclosure is to provide an image processing apparatus and the like capable of appropriately executing processing based on an image of a document when the document is conveyed obliquely.

上述した課題を解決するために、本開示に係る画像処理装置は、原稿を読み取って当該原稿の画像を入力する画像入力部と、制御部とを備え、前記制御部は、前記画像入力部によって入力された原稿が斜めである場合、前記画像の各辺において当該辺を構成する画素を一辺とした矩形領域に含まれる画素の画素値の分布に基づき、前記画像に対する処理を実行することを特徴とする。 In order to solve the above-described problems, an image processing apparatus according to the present disclosure includes an image input unit that reads a document and inputs an image of the document, and a control unit. characterized in that, when an input document is oblique, processing is performed on each side of the image based on the distribution of pixel values of pixels included in a rectangular area having pixels constituting the side as one side. and

本開示に係る制御方法は、原稿を読み取って当該原稿の画像を入力する画像処理装置の制御方法であって、前記原稿が斜めである場合、前記画像の各辺において当該辺を構成する画素を一辺とした矩形領域に含まれる画素の画素値の分布に基づき、前記画像に対する処理を実行するステップを含むことを特徴とする。 A control method according to the present disclosure is a control method for an image processing apparatus for reading a document and inputting an image of the document, wherein when the document is oblique, pixels forming each side of the image are The method is characterized by including a step of performing processing on the image based on a distribution of pixel values of pixels included in a rectangular area with one side.

本開示に係るプログラムは、原稿を読み取って当該原稿の画像を入力する画像処理装置のコンピュータに、前記原稿が斜めである場合、前記画像の各辺において当該辺を構成する画素を一辺とした矩形領域に含まれる画素の画素値の分布に基づき、前記画像に対する処理を実行する機能を実現させることを特徴とする。 A program according to the present disclosure reads a document and inputs an image of the document into a computer of an image processing apparatus. It is characterized by realizing a function of executing processing on the image based on the distribution of pixel values of pixels included in the area.

本開示によれば、原稿が斜めに搬送された場合、当該原稿の画像に基づき適切に処理を実行することが可能となる。 According to the present disclosure, when a document is conveyed obliquely, it is possible to appropriately execute processing based on the image of the document.

第1実施形態における画像処理装置の外観斜視図である。1 is an external perspective view of an image processing apparatus according to a first embodiment; FIG. 第1実施形態における画像処理装置の機能構成を説明するための図である。2 is a diagram for explaining the functional configuration of the image processing apparatus according to the first embodiment; FIG. 第1実施形態における画像処理装置が実行する主な処理の流れを説明するためのフロー図である。FIG. 2 is a flowchart for explaining the flow of main processing executed by the image processing apparatus according to the first embodiment; 第1実施形態における原稿色・背景色判定処理の流れを説明するためのフロー図である。FIG. 5 is a flowchart for explaining the flow of document color/background color determination processing in the first embodiment; 第1実施形態における原稿色・背景色判定処理を説明するための図である。FIG. 7 is a diagram for explaining document color/background color determination processing in the first embodiment; 第1実施形態における原稿色・背景色判定処理を説明するための図である。FIG. 7 is a diagram for explaining document color/background color determination processing in the first embodiment; 第1実施形態における原稿色・背景色判定処理を説明するための図である。FIG. 7 is a diagram for explaining document color/background color determination processing in the first embodiment; 第1実施形態における原稿色・背景色判定処理を説明するための図である。FIG. 7 is a diagram for explaining document color/background color determination processing in the first embodiment; 第1実施形態における原稿色・背景色判定処理を説明するための図である。FIG. 7 is a diagram for explaining document color/background color determination processing in the first embodiment; 第1実施形態における原稿色・背景色判定処理を説明するための図である。FIG. 7 is a diagram for explaining document color/background color determination processing in the first embodiment; 第1実施形態におけるエッジ検出・エッジキャンセル処理の流れを説明するためのフロー図である。FIG. 5 is a flowchart for explaining the flow of edge detection/edge cancellation processing in the first embodiment; 第1実施形態におけるエッジ検出・エッジキャンセル処理を説明するための図である。FIG. 4 is a diagram for explaining edge detection/edge cancellation processing in the first embodiment; 第1実施形態における無地判定処理の流れを説明するためのフロー図である。FIG. 5 is a flow chart for explaining the flow of blank area determination processing in the first embodiment; 第1実施形態における無地判定処理を説明するための図である。FIG. 7 is a diagram for explaining blank area determination processing in the first embodiment; 第1実施形態におけるスキュー補正処理の流れを説明するためのフロー図である。FIG. 5 is a flow chart for explaining the flow of skew correction processing in the first embodiment; 第1実施形態におけるスキュー補正処理を説明するための図である。FIG. 5 is a diagram for explaining skew correction processing in the first embodiment; 第1実施形態における動作例を説明するための図である。It is a figure for explaining an example of operation in a 1st embodiment. 第1実施形態における動作例を説明するための図である。It is a figure for explaining an example of operation in a 1st embodiment. 第1実施形態における動作例を説明するための図である。It is a figure for explaining an example of operation in a 1st embodiment. 第1実施形態における動作例を説明するための図である。It is a figure for explaining an example of operation in a 1st embodiment. 第2実施形態における概要を説明するための図である。It is a figure for demonstrating the outline|summary in 2nd Embodiment. 第2実施形態における概要を説明するための図である。It is a figure for demonstrating the outline|summary in 2nd Embodiment. 第2実施形態における画像処理装置が実行する主な処理の流れを説明するためのフロー図である。FIG. 11 is a flowchart for explaining the flow of main processing executed by an image processing apparatus according to the second embodiment; 第2実施形態における原稿色・背景色判定処理の流れを説明するためのフロー図である。FIG. 11 is a flowchart for explaining the flow of document color/background color determination processing in the second embodiment; 第3実施形態における画像処理装置が実行する主な処理の流れを説明するためのフロー図である。FIG. 11 is a flowchart for explaining the flow of main processing executed by an image processing apparatus according to the third embodiment; 第3実施形態における第2の無地判定処理の流れを説明するためのフロー図である。FIG. 11 is a flow chart for explaining the flow of second blank area determination processing in the third embodiment; 従来の例を説明するための図である。It is a figure for demonstrating the conventional example.

以下、図面を参照して、本開示を実施するための一実施形態について説明する。なお、以下の実施形態は、本開示を説明するための一例であり、特許請求の範囲に記載した発明の技術的範囲が、以下の記載に限定されるものではない。 An embodiment for carrying out the present disclosure will be described below with reference to the drawings. The following embodiments are examples for explaining the present disclosure, and the technical scope of the invention described in the claims is not limited to the following descriptions.

[1.第1実施形態]
[1.1 機能構成]
第1実施形態について図面を参照して説明する。図1は第1実施形態に係る画像処理装置10の外観斜視図、図2は、画像処理装置10の機能的構成を示すブロック図である。
[1. First Embodiment]
[1.1 Functional configuration]
A first embodiment will be described with reference to the drawings. FIG. 1 is an external perspective view of an image processing apparatus 10 according to the first embodiment, and FIG. 2 is a block diagram showing the functional configuration of the image processing apparatus 10. As shown in FIG.

画像処理装置10は、コピー機能、印刷機能、スキャン機能、メール送信機能等を有するデジタル複合機(MFP;Multi-Function Peripheral/Printer)である。また、画像処理装置10は、画像を記録用紙に形成することが可能な画像形成装置であってもよい。本実施形態における画像処理装置10は、図2に示すように、制御部100と、画像入力部120と、画像形成部130と、表示部140と、操作部150と、記憶部160と、通信部190とを備えて構成される。 The image processing apparatus 10 is a digital multifunction peripheral (MFP: Multi-Function Peripheral/Printer) having a copy function, a print function, a scan function, an e-mail transmission function, and the like. Further, the image processing apparatus 10 may be an image forming apparatus capable of forming an image on recording paper. As shown in FIG. 2, the image processing apparatus 10 according to the present embodiment includes a control unit 100, an image input unit 120, an image forming unit 130, a display unit 140, an operation unit 150, a storage unit 160, and a communication unit. 190 .

制御部100は、画像処理装置10の全体を制御するための機能部である。制御部100は、記憶部160に記憶された各種プログラムを読み出して実行することにより各種機能を実現しており、例えば、1又は複数の演算装置(CPU(Central Processing Unit))等により構成される。また、制御部100は、以下に説明する機能のうち、複数の機能を有するSoC(System on a Chip)として構成してもよい。 The control unit 100 is a functional unit for controlling the image processing apparatus 10 as a whole. The control unit 100 implements various functions by reading and executing various programs stored in the storage unit 160, and is configured by, for example, one or more arithmetic units (CPU (Central Processing Unit)). . Also, the control unit 100 may be configured as an SoC (System on a Chip) having a plurality of functions among the functions described below.

また、制御部100は、記憶部160に記憶されたプログラム実行することにより、画像処理部102として機能する。画像処理部102は、各種画像に関する処理を行う。例えば、画像処理部102は、画像入力部120によって読み取られた画像に対して、鮮鋭化処理や、階調変換処理を実行する。 The control unit 100 also functions as an image processing unit 102 by executing a program stored in the storage unit 160 . The image processing unit 102 performs processing related to various images. For example, the image processing unit 102 executes sharpening processing and gradation conversion processing on the image read by the image input unit 120 .

画像入力部120は、画像処理装置10に画像データを入力する。例えば、画像入力部120は、原稿の画像を読み取って、当該原稿の画像データを生成し、画像処理装置10に入力することが可能なスキャナ装置等により構成される。スキャナ装置は、例えば、CCD(Charge Coupled Device)やCIS(Contact Image Sensor)等のイメージセンサによって画像を電気信号に変換し、電気信号を量子化及び符号化することでデジタルデータを生成する。 The image input unit 120 inputs image data to the image processing apparatus 10 . For example, the image input unit 120 is configured by a scanner device or the like capable of reading an image of a document, generating image data of the document, and inputting the data to the image processing apparatus 10 . The scanner device converts an image into an electrical signal using an image sensor such as a CCD (Charge Coupled Device) or CIS (Contact Image Sensor), and quantizes and encodes the electrical signal to generate digital data.

画像形成部130は、記録用紙等の記録媒体に対して画像を形成(印刷)する。画像形成部130は、例えば、電子写真方式を利用したレーザプリンタ等の印刷装置により構成される。画像形成部130は、例えば、図1の給紙トレイ132から記録用紙を給紙し、記録用紙の表面に画像を形成し、記録用紙を排紙トレイ134から排紙する。 The image forming unit 130 forms (prints) an image on a recording medium such as recording paper. The image forming unit 130 is configured by, for example, a printing device such as a laser printer using an electrophotographic method. For example, the image forming unit 130 feeds recording paper from the paper feed tray 132 in FIG. 1, forms an image on the surface of the recording paper, and discharges the recording paper from the paper discharge tray 134 .

表示部140は、各種情報を表示する。表示部140は、例えば、LCD(Liquid crystal display)、有機EL(electro-luminescence)ディスプレイ、マイクロLED(Light Emitting Diode)ディスプレイ等の表示装置により構成される。 The display unit 140 displays various information. The display unit 140 is configured by a display device such as an LCD (Liquid crystal display), an organic EL (electro-luminescence) display, a micro LED (Light Emitting Diode) display, or the like.

操作部150は、ユーザからの操作指示を受け付ける。操作部150は、各種キースイッチや、接触(タッチ)による入力を検出するタッチセンサといった入力装置により構成されている。タッチセンサにおいて入力を検出する方式は、例えば、抵抗膜方式、赤外線方式、電磁誘導方式、静電容量方式といった、一般的な検出方式であればよい。なお、画像処理装置10には、表示部140と、操作部150とが一体に形成されたタッチパネルが搭載されてもよい。 The operation unit 150 receives operation instructions from the user. The operation unit 150 includes input devices such as various key switches and touch sensors that detect input by contact (touch). A general detection method such as a resistive film method, an infrared method, an electromagnetic induction method, or an electrostatic capacitance method may be used as a method for detecting an input in the touch sensor. Note that the image processing apparatus 10 may be equipped with a touch panel in which the display unit 140 and the operation unit 150 are integrally formed.

記憶部160は、画像処理装置10の動作に必要な各種プログラムや、各種データを記憶する。記憶部160は、例えば、半導体メモリであるSSD(Solid State Drive)や、HDD(Hard Disk Drive)等の記憶装置により構成される。 The storage unit 160 stores various programs and data necessary for the operation of the image processing apparatus 10 . The storage unit 160 is configured by, for example, a storage device such as an SSD (Solid State Drive), which is a semiconductor memory, or an HDD (Hard Disk Drive).

通信部190は、LAN(Local Area Network)やWAN(Wide Area Network)を介して外部の装置と通信を行う。通信部190は、例えば、有線/無線LANで利用されるNIC(Network Interface Card)等の通信装置や通信モジュールにより構成される。 The communication unit 190 communicates with an external device via a LAN (Local Area Network) or a WAN (Wide Area Network). The communication unit 190 is configured by, for example, a communication device such as a NIC (Network Interface Card) used in a wired/wireless LAN, and a communication module.

[1.2 処理の流れ]
本実施形態における画像処理装置10の制御部100が実行する主な処理について、図3を参照して説明する。図3に示した処理は、例えば、制御部100が、記憶部160に記憶されたプログラムを読み出すことにより実行される。
[1.2 Flow of processing]
Main processing executed by the control unit 100 of the image processing apparatus 10 in this embodiment will be described with reference to FIG. The processing shown in FIG. 3 is executed by the control unit 100 reading out a program stored in the storage unit 160, for example.

特に、図3に示した処理は、コピー機能、スキャン機能、メール送信機能といった、原稿を読み取って、当該読み取られた原稿の画像を、印刷用紙やファイルに出力する機能が使用される場合に実行される。 In particular, the processing shown in FIG. 3 is executed when a function such as a copy function, a scan function, or an e-mail transmission function that reads an original and outputs the image of the read original to print paper or a file is used. be done.

はじめに、制御部100は、入力画像を取得する(ステップS100)。入力画像とは、画像処理装置10に入力された画像であり、例えば、原稿のスキャン画像である。ステップS100において、制御部100は、自動原稿送り装置(ADF:Auto Document Feeder)によって画像入力部120に送られ、当該画像入力部120によって読み取られた原稿のうち、1の原稿の画像を取得する。 First, the control unit 100 acquires an input image (step S100). An input image is an image input to the image processing apparatus 10, for example, a scanned image of a document. In step S100, control unit 100 acquires an image of one of the documents sent to image input unit 120 by an automatic document feeder (ADF) and read by image input unit 120. .

つづいて、制御部100は、原稿が斜めに搬送されたか否かを判定する(ステップS102)。原稿が斜めに搬送されたことを判定する方法としては、例えば、画像処理装置10に、原稿搬送方向と直角をなす原稿幅方向に沿って複数の原稿検知センサを配置し、各々の原稿検知センサによって原稿が検知されたか否かを判定する方法を用いることができる。例えば、制御部100は、2つの原稿検知センサが配置されている場合において、一方の原稿検知センサが原稿を検知し、他方の原稿検知センサが原稿を検知していないとき、原稿が斜めに搬送されたことを判定する。なお、原稿が斜めに搬送されたか否かを判定する方法は、上述した方法以外の既存の方法を用いてもよく、例えば、特開2009-51585号公報に記載された方法を用いることができる。 Subsequently, the control unit 100 determines whether or not the document has been conveyed obliquely (step S102). As a method of determining whether a document is conveyed obliquely, for example, a plurality of document detection sensors are arranged in the image processing apparatus 10 along the document width direction forming a right angle to the document conveyance direction, and each document detection sensor can be used to determine whether or not the document has been detected. For example, in the case where two document detection sensors are arranged, the control unit 100 controls that the document is conveyed obliquely when one of the document detection sensors detects the document and the other document detection sensor does not detect the document. It is determined that It should be noted that existing methods other than the method described above may be used as a method for determining whether or not the document has been conveyed obliquely. For example, the method described in JP-A-2009-51585 can be used. .

制御部100は、原稿が斜めに搬送されていない場合は、所定の方法により無地判定を行う(ステップS102;No)。一方、原稿が斜めに搬送された場合、原稿の色(原稿色、原稿の下地の色)と、当該原稿が読み取られるときにおける当該原稿の背面の部材の色(背景色)とが異なるか否かを判定する処理(原稿色・背景色判定処理)を実行する(ステップS102;Yes→ステップS104)。なお、本実施形態では、原稿の色を原稿色と記載し、原稿の背面の部材の色を背景色と記載する。原稿色・背景色判定処理については、図4を参照して説明する。 If the document is not conveyed obliquely, the control unit 100 performs blank determination by a predetermined method (step S102; No). On the other hand, if the document is fed at an angle, whether the color of the document (document color, background color of the document) differs from the color of the material on the back of the document (background color) when the document is read (document color/background color determination process) is executed (step S102; Yes→step S104). In this embodiment, the color of the document is referred to as the document color, and the color of the member behind the document is referred to as the background color. The document color/background color determination process will be described with reference to FIG.

はじめに、制御部100は、入力画像をモノクロ画像(グレースケール画像)に変換し、変換後の入力画像の上端(上辺)、右端(右辺)、下端(下辺)、左端(左辺)のうち、1辺の画素値ヒストグラムを生成する(ステップS120)。1辺の画素値ヒストグラムとは、入力画像の上端、右端、下端、左端のうちの1辺の辺部分を構成する画素の画素値に基づくヒストグラムである。 First, the control unit 100 converts an input image into a monochrome image (grayscale image), and selects one of the top edge (top edge), right edge (right edge), bottom edge (bottom edge), and left edge (left edge) of the converted input image. A pixel value histogram of the side is generated (step S120). A pixel value histogram of one side is a histogram based on pixel values of pixels forming a side portion of one of the top edge, right edge, bottom edge, and left edge of the input image.

例えば、制御部100は、原稿(入力画像)の長辺の長さに所定の割合α(例えば、α=3%)を乗じることで得られる長さ(領域幅)を算出する。つづいて、制御部100は、注目する辺と、当該辺から領域幅だけ離れた位置までに含まれる画素を囲む矩形領域を設定する。さらに、制御部100は、設定した矩形領域に含まれる画素の画素値(例えば、輝度値)を取得し、画素値毎の画素数を示すヒストグラムを生成する。 For example, the control unit 100 calculates the length (region width) obtained by multiplying the length of the long side of the document (input image) by a predetermined ratio α (eg, α=3%). Subsequently, the control unit 100 sets a side of interest and a rectangular area surrounding pixels included up to a position separated from the side by the area width. Furthermore, the control unit 100 acquires pixel values (for example, luminance values) of pixels included in the set rectangular area, and generates a histogram indicating the number of pixels for each pixel value.

例えば、原稿がA4の用紙であれば、制御部100は、長辺の長さ(29.7cm)の3%の長さである0.89cmを領域幅とする。また、例えば、原稿がA3の用紙であれば、制御部100は、長辺の長さ(42.0cm)の3%の長さである1.26cmを領域幅とする。 For example, if the document is an A4 sheet, the control unit 100 sets the area width to 0.89 cm, which is 3% of the length of the long side (29.7 cm). Further, for example, if the document is an A3 sheet, the control unit 100 sets the region width to 1.26 cm, which is 3% of the length of the long side (42.0 cm).

さらに、制御部100は、領域幅に相当する画素数を算出する。例えば、原稿がA4の用紙で、入力画像の解像度が300dpi(dots per inch)である場合、領域幅である0.89cmは約105画素分に相当する。この場合、制御部100は、モノクロ画像に変換した後の入力画像のそれぞれの辺毎に、辺から105画素離れた位置までに含まれる画素を囲む矩形領域を設定する。 Furthermore, the control unit 100 calculates the number of pixels corresponding to the area width. For example, if the document is A4 paper and the resolution of the input image is 300 dpi (dots per inch), the area width of 0.89 cm corresponds to about 105 pixels. In this case, the control unit 100 sets, for each side of the input image after conversion into a monochrome image, a rectangular area surrounding pixels included up to a position 105 pixels away from the side.

図5及び図6を参照して、上述したステップS120の処理について、具体的に説明する。図5(a)は、背景色と原稿色とが異なる場合における入力画像の一例を示した図である。なお、背景色と原稿色とが異なる場合とは、原稿色と背景色との濃度のレベルが、同レベルであるとはいえない場合をいう。 The processing of step S120 described above will be specifically described with reference to FIGS. 5 and 6. FIG. FIG. 5A is a diagram showing an example of an input image when the background color and the document color are different. Note that the case where the background color and the document color are different means the case where the density levels of the document color and the background color cannot be said to be the same level.

図5(a)に示した入力画像は、斜めに搬送された原稿の画像であって、原稿を読み取った領域E100と、原稿の背面の部材を読み取った領域E101(左上)、領域E102(右上)、領域E103(左下)、領域E104(右下)とが含まれる。 The input image shown in FIG. 5A is an image of a document conveyed obliquely, and includes an area E100 where the document is read, an area E101 (upper left) and an area E102 (upper right) where the member on the back of the document is read. ), area E103 (lower left), and area E104 (lower right).

図5(b)は、モノクロ画像に変換した後の入力画像の各辺から、領域幅に相当する画素数だけ離れた位置までに含まれる画素を囲む矩形領域を示した図である。 FIG. 5(b) is a diagram showing a rectangular area surrounding pixels included up to a position separated by the number of pixels corresponding to the area width from each side of the input image after conversion into a monochrome image.

図5(b)は、矩形領域として、上辺に基づいて設定される上端の矩形領域E110と、左辺に基づいて設定される左端の矩形領域E111と、右辺に基づいて設定される右端の矩形領域E112と、下辺に基づいて設定される下端の矩形領域E113とを示した図である。 FIG. 5B shows, as rectangular areas, an upper rectangular area E110 set based on the upper edge, a left rectangular area E111 set based on the left edge, and a right edge rectangular area E111 set based on the right edge. FIG. 11 is a diagram showing E112 and a bottom rectangular area E113 set based on the bottom side;

ここで、入力画像の縦の画素数をr、横の画素数をc、長辺の長さに対して乗じる割合をαとする。図5(b)の場合、入力画像は横に長いため、長辺は横方向となる。したがって、各辺に対応する矩形領域は、各辺と、長辺である横方向の画素数であるcに所定の割合αを乗じたc×α画素まで離れた位置とを囲む領域に対応する。 Let r be the number of pixels in the vertical direction of the input image, c be the number of pixels in the horizontal direction, and α be the ratio of the length of the long side to be multiplied. In the case of FIG. 5B, since the input image is horizontally long, the long side is the horizontal direction. Therefore, the rectangular area corresponding to each side corresponds to the area surrounding each side and a position separated by c×α pixels obtained by multiplying c, which is the number of pixels in the horizontal direction of the long side, by a predetermined ratio α. .

入力画像の上端(上辺)に対応する矩形領域E110及び下端(下辺)に対応する矩形領域E113は、縦がc×α画素、横がc画素の矩形領域となる。矩形領域E110及び矩形領域E113に含まれる画素数は、c×c×αである。一方、入力画像の左端(左辺)に対応する矩形領域E111及び右端(右辺)に対応する矩形領域E112は、縦がr画素、横がc×α画素の矩形領域となる。矩形領域E111及び矩形領域E112に含まれる画素数は、r×c×αである。なお、αの値は予め定められていてもよいし、ユーザによって設定されてもよい。 A rectangular area E110 corresponding to the upper end (upper side) of the input image and a rectangular area E113 corresponding to the lower end (lower side) of the input image are c×α pixels long and c pixels wide. The number of pixels included in the rectangular regions E110 and E113 is c×c×α. On the other hand, a rectangular area E111 corresponding to the left edge (left side) and a rectangular area E112 corresponding to the right edge (right side) of the input image are rectangular areas of r pixels in the vertical direction and c×α pixels in the horizontal direction. The number of pixels included in the rectangular regions E111 and E112 is r×c×α. Note that the value of α may be determined in advance or may be set by the user.

図5(c)は、図5(b)に示した矩形領域E110、矩形領域E111、矩形領域E112、矩形領域E113のうちの1の領域に含まれる画素の画素値に基づいて生成されたヒストグラムを示す図である。図5(c)に示すように、ヒストグラムは、横軸を画素値とし、縦軸を画素数とする。 FIG. 5(c) is a histogram generated based on pixel values of pixels included in one of the rectangular regions E110, E111, E112, and E113 shown in FIG. 5(b). It is a figure which shows. As shown in FIG. 5C, the histogram has the pixel value on the horizontal axis and the number of pixels on the vertical axis.

例えば、制御部100は、入力画像の辺縁部を構成する画素の輝度値の分布を示すヒストグラムを生成する。図5(c)に示したヒストグラムの例では、中程度の輝度値の部分E120と、高い輝度値の部分E121とにおいて画素数が多いことを示す。この場合、入力画像の周縁部は、主に、中程度の輝度値の画素と高い輝度値の画素とによって構成されていることを示す。 For example, the control unit 100 generates a histogram indicating the distribution of luminance values of pixels forming the edge of the input image. In the example of the histogram shown in FIG. 5(c), the number of pixels is large in the middle luminance value portion E120 and the high luminance value portion E121. In this case, it indicates that the peripheral portion of the input image is mainly composed of pixels with medium luminance values and pixels with high luminance values.

図6(a)は、背景色と原稿色とが異ならない場合(同じであると見做せる場合)における入力画像に対して、図5(b)と同様に矩形領域が設定された場合における、各矩形領域(E130、E131、E132、E133)を示した図である。図6(b)は、図6(a)に示した矩形領域E130、矩形領域E131、矩形領域E132、矩形領域E133ののうちの1の領域に含まれる画素の画素値(輝度値)に基づいて生成されたヒストグラムを示す図である。図6(b)に示したヒストグラムの例では、高い輝度値の部分E140において画素数が多い。この場合、入力画像の周縁部は、主に、高い輝度値の画素によって構成されていることを示す。 FIG. 6A shows a case where a rectangular area is set in the same manner as in FIG. , and each rectangular area (E130, E131, E132, E133). FIG. 6B is based on pixel values (luminance values) of pixels included in one of the rectangular regions E130, E131, E132, and E133 shown in FIG. 6A. FIG. 10 is a diagram showing a histogram generated by In the example of the histogram shown in FIG. 6B, the number of pixels is large in the portion E140 with high luminance values. In this case, the peripheral portion of the input image is mainly composed of pixels with high luminance values.

図4に戻り、制御部100は、ステップS120において生成した辺部分のヒストグラムから、最大かつ閾値以上の値を持つ画素値を含む区間(ビン)があるか否かを判定する(ステップS122)。閾値とは、例えば、ヒストグラム毎に対応する矩形領域に含まれる画素数に所定の割合を乗じることで得られる画素数の値である。 Returning to FIG. 4, the control unit 100 determines whether or not there is an interval (bin) including a pixel value having a maximum value equal to or greater than a threshold from the histogram of the side portion generated in step S120 (step S122). A threshold is, for example, a value of the number of pixels obtained by multiplying the number of pixels included in a rectangular area corresponding to each histogram by a predetermined ratio.

例えば、入力画像の縦の画素数をr、横の画素数をcとし、原稿(入力画像)の長辺の長さに対する所定の割合をαとする。また、上端及び下端矩形領域に含まれる画素数に対する所定の割合をβ1、右辺及び左辺に対応する矩形領域に含まれる画素数に対する所定の割合をβ2とする。長辺の方向が横方向である場合、制御部100は、上端の矩形領域及び下端の矩形領域に対する閾値であるTH1又は右端の矩形領域及び左端の矩形領域に対する閾値をTH2を、以下の計算によって求める。
TH1=c×c×α×β1
TH2=r×c×α×β2
For example, let r be the number of pixels in the vertical direction of the input image, c be the number of pixels in the horizontal direction, and let α be a predetermined ratio to the length of the long side of the document (input image). Let β1 be a predetermined ratio to the number of pixels included in the upper and lower rectangular areas, and β2 be a predetermined ratio to the number of pixels included in the rectangular areas corresponding to the right and left sides. When the direction of the long side is the horizontal direction, the control unit 100 sets a threshold value TH1 for the upper rectangular area and the lower rectangular area or a threshold value TH2 for the right rectangular area and the left rectangular area by the following calculation. demand.
TH1=c×c×α×β1
TH2=r×c×α×β2

ここで、β1及びβ2は、例えば、β1=10%、β2=10%といった値である。なお、β1及びβ2は、予め設定されていてもよいし、ユーザにより設定可能であってもよい。また、β1とβ2とは、異なる値であってもよい。 Here, β1 and β2 are values such as β1=10% and β2=10%, for example. Note that β1 and β2 may be set in advance, or may be set by the user. Also, β1 and β2 may be different values.

制御部100は、最大かつ閾値以上の値を持つ画素値を含む区間ある場合、ステップS120において生成したヒストグラムから、当該区間に対応する画素値の前後数画素分(例えば、5画素)の区間の値を除去する(ステップS122;Yes→ステップS124)。例えば、最大かつ閾値以上の値を持つ画素値が128であれば、制御部100は、画素値が123から133までの何れかである区間の値を0にする。 When there is a section including a pixel value having a maximum value equal to or greater than the threshold, the control unit 100 selects a section of several pixels (for example, 5 pixels) before and after the pixel value corresponding to the section from the histogram generated in step S120. Remove the value (step S122; Yes→step S124). For example, if the maximum pixel value that is equal to or greater than the threshold value is 128, the control unit 100 sets the value of any interval between 123 and 133 to zero.

つづいて、制御部100は、最大の値を持つ画素値の前後数画素分の値が除去されたヒストグラムに、最大かつ閾値以上の値を持つ画素値を含む区間の数があるか否かを判定する(ステップS126)。制御部100は、最大かつ閾値以上の値を持つ画素値を含む区間がある場合、ヒストグラムのピークが複数あるとして、原稿色と背景色が異なると判定する(ステップS126;Yes→ステップS128)。つまり、制御部100は、上端、下端、左端、右端でピークが複数あると判定されたヒストグラムが1つでもあれば、原稿色と背景色とが異なると判定する。 Subsequently, the control unit 100 determines whether or not there is a number of sections including a pixel value having a maximum value equal to or greater than the threshold value in the histogram from which the values of several pixels before and after the pixel value having the maximum value are removed. Determine (step S126). When there is a section including a pixel value having a maximum value equal to or greater than the threshold value, the control unit 100 judges that the document color and the background color are different because there are multiple peaks in the histogram (step S126; Yes→step S128). In other words, the control unit 100 determines that the document color and the background color are different if there is even one histogram determined to have multiple peaks at the top, bottom, left, and right ends.

一方、制御部100は、ステップS122又はステップS126において、最大かつ閾値以上の値を持つ画素値を含む区間がないと判定した場合、入力画像の4辺とも、ピークが複数あるか否かの判定を行ったか否かを判定する(ステップS122;No→ステップS130、ステップS126;No→ステップS130)。制御部100は、4辺とも判定した場合は、原稿色と背景色とは異ならないと判定する(ステップS130;Yes→ステップS132)。一方、制御部100は、4辺とも判定していない場合は、ステップS120へ戻る(ステップS130;No→ステップS120)。この場合、制御部100は、未判定の辺のうち、1辺を選択して、画素値ヒストグラムを生成する。 On the other hand, if the control unit 100 determines in step S122 or step S126 that there is no section including a pixel value having a maximum pixel value equal to or greater than the threshold value, it determines whether all four sides of the input image have a plurality of peaks. (step S122; No→step S130, step S126; No→step S130). If all four sides are determined, the control unit 100 determines that the document color and the background color are not different (step S130; Yes→step S132). On the other hand, if the controller 100 has not determined any of the four sides, it returns to step S120 (step S130; No→step S120). In this case, the control unit 100 selects one of the undetermined sides and generates a pixel value histogram.

このように、制御部100は、上述したステップS120からステップS132までの処理を実行することで、ピーク(山)が複数あるヒストグラムが存在するか否かを判定する。 In this way, the control unit 100 determines whether or not there is a histogram with multiple peaks (mountains) by executing the processes from step S120 to step S132 described above.

ここで、制御部100は、ステップS122において、最大かつ閾値以上の値を持つ画素値を含む区間がないと判定することで、ヒストグラムにはピークが存在しないことを判定することができる。また、制御部100は、ステップS126において、最大かつ閾値以上の値を持つ画素値を含む区間がないと判定することで、ヒストグラムにはピークが1つしか存在しないことを判定することができる。このように、ヒストグラム内のピークの数が1以下の場合、制御部100は、当該ヒストグラムに対応する辺において、原稿色と背景色とは異ならないと判定する。さらに、制御部100は、全ての辺においてピークの数が1以下である場合、入力画像の原稿色と背景色とは異ならないと判定する。 Here, in step S122, the control unit 100 can determine that there is no peak in the histogram by determining that there is no section containing a pixel value that is the maximum value equal to or greater than the threshold. Also, in step S126, the control unit 100 can determine that there is only one peak in the histogram by determining that there is no section including a pixel value having a maximum value equal to or greater than the threshold value. Thus, when the number of peaks in the histogram is 1 or less, the control unit 100 determines that the document color and the background color do not differ on the side corresponding to the histogram. Furthermore, when the number of peaks is 1 or less on all sides, the control unit 100 determines that the document color and the background color of the input image are not different.

図7及び図8を参照して、上述したステップS122からステップS132までの処理について、具体的に説明する。図7(a)は、図5(c)に示したヒストグラムと同じ図である。図7(a)におけるT150は、図7(a)に示したヒストグラムに対する閾値(画素数)である。また、図7(a)におけるE150は、最大の値を持つ画素値の区間及び当該区間の前後数画素分の区間の範囲を示している。ここで、最大の値を持つ画素値は閾値T150以上であるため、図7(a)に示したヒストグラムは、最大かつ閾値以上の値を持つ画素値を含むヒストグラムである。 The processing from step S122 to step S132 described above will be specifically described with reference to FIGS. 7 and 8. FIG. FIG. 7(a) is the same diagram as the histogram shown in FIG. 5(c). T150 in FIG. 7A is the threshold (the number of pixels) for the histogram shown in FIG. 7A. Further, E150 in FIG. 7A indicates the range of the section of the pixel value having the maximum value and the section of several pixels before and after the section. Here, since the pixel value having the maximum value is equal to or greater than the threshold value T150, the histogram shown in FIG. 7A is a histogram including pixel values having the maximum value equal to or greater than the threshold value.

図7(b)は、図7(a)に示したヒストグラムから、E150に含まれる値を除去した後のヒストグラムである。なお、図7(b)における閾値T152は、図7(a)における閾値T150と同じ値である。図7(b)において、矢印A152で示した画素値は、図7(b)に示したヒストグラムにおいて、最大かつ閾値以上の値を持つ画素値である。つまり、図7(a)に示したヒストグラムは、ピークが2つある。この場合、制御部100は、入力画像の原稿色と背景色とが異なる判定する。 FIG. 7(b) is a histogram after removing the values included in E150 from the histogram shown in FIG. 7(a). Note that the threshold T152 in FIG. 7B is the same value as the threshold T150 in FIG. 7A. In FIG. 7B, the pixel value indicated by the arrow A152 is the pixel value having the maximum value equal to or greater than the threshold value in the histogram shown in FIG. 7B. That is, the histogram shown in FIG. 7(a) has two peaks. In this case, the control unit 100 determines that the document color and the background color of the input image are different.

図8(a)は、図6(b)に示したヒストグラムと同じ図である。図8(a)におけるT160は、図8(a)に示したヒストグラムに対する閾値(画素数)である。また、図7(a)におけるE160は、最大の値を持つ画素値の区間及び当該区間の前後数画素分の区間の範囲を示している。ここで、最大の値を持つ画素値は閾値T160以上であるため、図8(a)に示したヒストグラムは、最大かつ閾値以上の値を持つ画素値を含むヒストグラムである。 FIG. 8(a) is the same diagram as the histogram shown in FIG. 6(b). T160 in FIG. 8A is the threshold (the number of pixels) for the histogram shown in FIG. 8A. Further, E160 in FIG. 7A indicates the range of the pixel value section having the maximum value and the section of several pixels before and after the section. Here, since the pixel value having the maximum value is equal to or greater than the threshold value T160, the histogram shown in FIG. 8A is a histogram including pixel values having the maximum value equal to or greater than the threshold value.

図8(b)は、図8(a)に示したヒストグラムから、E160に含まれる値を除去した後のヒストグラムである。なお、図8(b)における閾値T162は、図8(a)における閾値T160と同じ値である。ここで、図8(b)に含まれる画素値のうち、閾値T162以上の値を持つ閾値は存在しない。つまり、図8(a)に示したヒストグラムは、ピークは2つない。この場合、制御部100は、このヒストグラムに対応する辺について、原稿色と背景色とは異ならないと判定する。 FIG. 8(b) is a histogram after removing the values included in E160 from the histogram shown in FIG. 8(a). Note that the threshold T162 in FIG. 8B is the same value as the threshold T160 in FIG. 8A. Here, among the pixel values included in FIG. 8B, there is no threshold having a value equal to or greater than the threshold T162. That is, the histogram shown in FIG. 8A does not have two peaks. In this case, the control unit 100 determines that the document color and the background color do not differ for the sides corresponding to this histogram.

また、図9は、原稿色と背景色とが異なる場合における、(a)入力画像と各辺に対応する矩形領域、(b)上端の矩形領域のヒストグラム、(c)下端の矩形領域のヒストグラム、(d)左端の矩形領域のヒストグラム、(e)右端の矩形領域のヒストグラムを示した図である。ここで、TH1は上端の矩形領域及び下端の矩形領域に対する閾値であり、TH2は左端の矩形領域及び右端の矩形領域に対する閾値である。図9の(b)から(e)までに示すように、原稿色と背景色とが異なる場合、各辺に対応する矩形領域のヒストグラムには、いずれもピークが複数存在する。 FIG. 9 shows (a) a rectangular area corresponding to the input image and each side, (b) a histogram of the upper rectangular area, and (c) a histogram of the lower rectangular area when the document color and the background color are different. , (d) a histogram of the rectangular area at the left end, and (e) a histogram of the rectangular area at the right end. Here, TH1 is the threshold for the upper rectangular area and the lower rectangular area, and TH2 is the threshold for the left rectangular area and the right rectangular area. As shown in (b) to (e) of FIG. 9, when the document color and the background color are different, the histogram of the rectangular area corresponding to each side has a plurality of peaks.

図10は、原稿色と背景色とが異ならない場合における、(a)入力画像と各辺に対応する矩形領域、(b)上端の矩形領域のヒストグラム、(c)下端の矩形領域のヒストグラム、(d)左端の矩形領域のヒストグラム、(e)右端の矩形領域のヒストグラムを示した図である。ここで、TH1は上端の矩形領域及び下端の矩形領域に対する閾値であり、TH2は左端の矩形領域及び右端の矩形領域に対する閾値である。図10の(b)から(e)までに示すように、原稿色と背景色とが異ならない場合、各辺に対応する矩形領域のヒストグラムには、いずれもピークが1つしか存在しない。 FIG. 10 shows (a) the rectangular area corresponding to the input image and each side, (b) the histogram of the upper rectangular area, (c) the histogram of the lower rectangular area, when the document color and the background color do not differ. (d) A histogram of the rectangular area at the left end, and (e) a histogram of the rectangular area at the right end. Here, TH1 is the threshold for the upper rectangular area and the lower rectangular area, and TH2 is the threshold for the left rectangular area and the right rectangular area. As shown in (b) to (e) of FIG. 10, when the document color and the background color are not different, the histogram of the rectangular area corresponding to each side has only one peak.

図3に戻り、制御部100は、ステップS104における判定結果が、原稿色と背景色とが異なるといった判定結果であるか否かを判定する(ステップS106)。 Returning to FIG. 3, the control unit 100 determines whether or not the determination result in step S104 indicates that the document color and the background color are different (step S106).

制御部100は、ステップS104における判定結果が、原稿色と背景色とが異なるという判定結果である場合、入力画像から原稿の境界線に生じるエッジを削除する処理(エッジ検出・エッジキャンセル処理)を実行する(ステップS106;Yes→ステップS108)。エッジ検出・エッジキャンセル処理については、図11を参照して説明する。 If the determination result in step S104 is that the document color and the background color are different, the control unit 100 performs processing (edge detection/edge cancellation processing) for deleting edges generated on the boundary line of the document from the input image. Execute (step S106; Yes→step S108). Edge detection/edge cancellation processing will be described with reference to FIG.

はじめに、制御部100は、入力画像からエッジを検出した画像(エッジ抽出画像、微分画像)を取得する(ステップS140)。例えば、制御部100は、以下のようにして、エッジを検出した画像を取得する。 First, the control unit 100 acquires an image (edge-extracted image, differential image) in which edges are detected from the input image (step S140). For example, the control unit 100 acquires an image in which edges are detected as follows.

(1)制御部100は、入力画像をモノクロ画像(グレースケール画像)に変換する。
(2)制御部100は、入力画像のモノクロ画像(グレースケール画像)に対して、エッジ検出オペレータを適用する。
(3)制御部100は、エッジ検出オペレータを適用した画像に対して、2値化処理を実行する。
(1) The control unit 100 converts the input image into a monochrome image (grayscale image).
(2) The control unit 100 applies an edge detection operator to the monochrome image (grayscale image) of the input image.
(3) The control unit 100 executes binarization processing on the image to which the edge detection operator is applied.

(2)において、制御部100は、エッジ検出オペレータとして、例えば、Prewittのエッジ検出オペレータや、Sobelのエッジ検出オペレータを用いる。また、制御部100は、エッジ検出オペレータのサイズとして、例えば、3×3のマトリクスサイズを用いる。(2)の処理を行うことにより、入力画像のエッジの部分が白く表現された画像が取得できる。 In (2), the control unit 100 uses, for example, a Prewitt edge detection operator or a Sobel edge detection operator as the edge detection operator. Also, the control unit 100 uses, for example, a 3×3 matrix size as the size of the edge detection operator. By performing the processing of (2), an image in which the edge portion of the input image is expressed in white can be obtained.

さらに、(3)において、制御部100は、(2)の処理を実行することによって取得した画像に対して、2値化処理(例えば、単純2値化処理)を実行する。これにより、制御部100は、(2)の処理を実行することによって取得した画像を、白(画素値が1)又は黒(画素値が0)の何れかの画素を有する画像に変換することができる。制御部100は、このように、上述した(1)から(3)の処理を実行することに得られる白又は黒のみを含む画像を、エッジ抽出画像(微分画像)として取得する。 Furthermore, in (3), the control unit 100 executes binarization processing (for example, simple binarization processing) on the image obtained by executing the processing of (2). Thereby, the control unit 100 converts the image acquired by executing the process (2) into an image having either white (pixel value is 1) or black (pixel value is 0) pixels. can be done. The control unit 100 thus acquires an image containing only white or black obtained by executing the processes (1) to (3) described above as an edge extraction image (differential image).

つづいて、制御部100は、変数Rに1を代入することで初期化する(ステップS142)。変数Rは、微分画像における注目画素の縦位置を示す変数であり、1≦R≦R_MAXの値を取る。ただし、R_MAXは、入力画像の高さ(入力画像の縦方向の画素数)である。 Subsequently, the control unit 100 initializes the variable R by substituting 1 (step S142). The variable R is a variable indicating the vertical position of the pixel of interest in the differential image, and takes a value of 1≤R≤R_MAX. However, R_MAX is the height of the input image (the number of pixels in the vertical direction of the input image).

また、制御部100は、変数Cに1を代入し、変数countの0を代入することで、それぞれの変数を初期化する(ステップS144)。変数Cは、微分画像における注目画素の横位置を示す変数であり、1≦C≦C_MAXの値を取る。ただし、C_MAXは、入力画像の幅(入力画像の横方向の画素数)である。 Further, the control unit 100 assigns 1 to the variable C and 0 to the variable count, thereby initializing each variable (step S144). A variable C is a variable indicating the horizontal position of the pixel of interest in the differential image, and takes a value of 1≦C≦C_MAX. However, C_MAX is the width of the input image (the number of pixels in the horizontal direction of the input image).

つづいて、制御部100は微分画像のR行目にアクセスする(ステップS146)。つまり、制御部100が注目する微分画像の縦位置(行)を、R行目にする。さらに、制御部100は微分画像のR行目のC列目にアクセスする(ステップS148)。つまり、制御部100が注目する微分画像の横位置(列)を、C列目にする。これにより、制御部100は、微分画像を構成する画素のうち、R行目のC列目に位置する画素を注目画素とする。 Subsequently, the control unit 100 accesses the Rth row of the differential image (step S146). That is, the vertical position (row) of the differential image that the control unit 100 pays attention to is the R-th row. Further, the control unit 100 accesses the R-th row and the C-th column of the differential image (step S148). That is, the horizontal position (row) of the differential image that the control unit 100 pays attention to is the C-th row. As a result, the control unit 100 sets the pixel located in the R-th row and the C-th column among the pixels forming the differential image as the pixel of interest.

つづいて、制御部100は、注目画素の画素値が1(注目画素が白)であるか否かを判定する(ステップS150)。制御部100は、画素値が1ではない場合は、後述するステップS160遷移する(ステップS150;No)。一方、制御部100は、画素値が1である場合、変数countの値をcount+1にする(変数countをインクリメントする)(ステップS150;Yes→ステップS152)。 Subsequently, the control unit 100 determines whether or not the pixel value of the pixel of interest is 1 (the pixel of interest is white) (step S150). If the pixel value is not 1, the control unit 100 transitions to step S160, which will be described later (step S150; No). On the other hand, when the pixel value is 1, the control unit 100 sets the value of the variable count to count+1 (increments the variable count) (step S150; Yes→step S152).

さらに、制御部100は、変数countの値が1であれば、現在の画素の位置を、一端の画素の位置として、記憶部160に一時的に記憶する(ステップS154;Yes→ステップS156)。なお、制御部100は、変数countの値が1でなければ、現在の画素の位置を、他端の画素の位置として、記憶部160に一時的に記憶する(ステップS154;No→ステップS158)。すなわち、制御部100は、画素値が1である画素を検知するたびに、他端のエッジの位置を更新する。 Furthermore, if the value of the variable count is 1, the control unit 100 temporarily stores the current pixel position in the storage unit 160 as the position of the one end pixel (step S154; Yes→step S156). If the value of the variable count is not 1, the control unit 100 temporarily stores the current pixel position in the storage unit 160 as the other end pixel position (step S154; No→step S158). . That is, the control unit 100 updates the position of the other edge each time a pixel with a pixel value of 1 is detected.

つづいて、制御部100は、変数Cの値をC+1にすることで、変数Cをインクリメントし(ステップS160)、変数Cの値がC_MAXと一致するか否かを判定する(ステップS162)。制御部100は、変数Cの値がC_MAXと一致しない場合、ステップS148に戻る(ステップS162;No→ステップS148)。 Subsequently, the control unit 100 increments the variable C by setting the value of the variable C to C+1 (step S160), and determines whether or not the value of the variable C matches C_MAX (step S162). If the value of variable C does not match C_MAX, control unit 100 returns to step S148 (step S162; No→step S148).

このように、ステップS148からステップS162までの処理が繰り返されることにより、一端の画素の位置が記憶され、また、他端の画素の位置が更新される。 By repeating the processing from step S148 to step S162 in this way, the position of the pixel at one end is stored and the position of the pixel at the other end is updated.

一方、制御部100は、変数Cの値がC_MAXと一致する場合、エッジを削除(キャンセル)する(ステップS162;Yes→ステップS164)。エッジを削除する処理とは、エッジの画素を、周囲の画素と同じような画素に置き換える処理である。これにより、制御部100は、ユーザに対して、エッジを認識されないようにすることができる。 On the other hand, when the value of the variable C matches C_MAX, the control unit 100 deletes (cancels) the edge (step S162; Yes→step S164). Edge deletion processing is processing for replacing edge pixels with pixels similar to surrounding pixels. Thereby, the control unit 100 can prevent the edge from being recognized by the user.

なお、制御部100は、エッジを削除する場合の条件を設けてもよい。例えば、制御部100は、R行目における一端側の画素の位置と、R-1行目における一端側の画素の位置とが隣接している場合に、R行目における一端側のエッジを削除してもよい。同様にして、制御部100は、R行目における他端側の画素の位置と、R-1行目における他端側の画素の位置とが隣接している場合に、R行目における一端側のエッジを削除してもよい。このようにして、制御部100は、矩形の読み取り範囲の各辺から一番近いエッジ群(くっついたエッジ)を削除することができる。 Note that the control unit 100 may provide a condition for deleting edges. For example, when the position of the pixel on the one end side in the R-th row is adjacent to the position of the pixel on the one end side in the R-1-th row, the control unit 100 deletes the edge on the one end side in the R-th row. You may Similarly, when the position of the pixel on the other end side in the R-th row is adjacent to the position of the pixel on the other end side in the (R−1)-th row, the control unit 100 edge can be deleted. In this way, the control unit 100 can delete the closest edge group (adjacent edges) from each side of the rectangular reading range.

例えば、制御部100は、記憶部160から、一端の画素の位置と他端の画素の位置とを取得し、入力画像のうち、対応する位置の画素を、当該画素の周囲の画素の色(例えば、周囲上下左右及び斜め8画素の平均の画素値)に置き換える。さらに、制御部100は、微分画像のうち、一端の画素の位置と他端の画素の位置とに対応する位置の画素の画素値を0(黒い画素)にする。このようにすることで、制御部100は、入力画像においてエッジが存在する各行のうち、列番号が最小・最大のエッジをキャンセルすることができる。 For example, the control unit 100 acquires the position of the pixel at one end and the position of the pixel at the other end from the storage unit 160, and converts the pixel at the corresponding position in the input image to the color of the pixels surrounding the pixel ( For example, the average pixel value of 8 pixels in the surrounding top, bottom, left, right, and diagonal). Furthermore, the control unit 100 sets the pixel values of pixels at positions corresponding to the position of the pixel at one end and the position of the pixel at the other end in the differential image to 0 (black pixels). By doing so, the control unit 100 can cancel edges with the smallest and largest column numbers among the rows in which edges exist in the input image.

なお、制御部100は、注目している行(R行目)において、画素値が1である画素が0又は1である場合は、ステップS164における処理を省略してもよい。 Note that the control unit 100 may omit the process in step S164 when the pixel value of 1 is 0 or 1 in the row of interest (R-th row).

つづいて、制御部100は、変数Rの値をR+1にすることで、変数Rをインクリメントし(ステップS166)、変数Rの値がR_MAXと一致するか否かを判定する(ステップS168)。制御部100は、変数Rの値がR_MAXと一致しない場合、ステップS144に戻る(ステップS168;No→ステップS144)。一方、制御部100は、Rの値がR_MAXと一致する場合、エッジ検出・エッジキャンセル処理を終了する(ステップS168;Yes)。 Subsequently, the control unit 100 increments the variable R by setting the value of the variable R to R+1 (step S166), and determines whether or not the value of the variable R matches R_MAX (step S168). If the value of the variable R does not match R_MAX, the controller 100 returns to step S144 (step S168; No→step S144). On the other hand, when the value of R matches R_MAX, the control unit 100 ends the edge detection/edge cancellation processing (step S168; Yes).

ステップS148からステップS168までの処理について、図12を参照して、具体的に説明する。図12(a)は、入力画像及び入力画像中のうちの3行分の領域R180を示した図である。また、図12(b)は、図12(a)において示した領域R180を拡大した図である。ステップS148からステップS162における処理は、入力画像の画素を、図12(b)の領域E181内の横方向の矢印で示したように、注目している行の画素を1列ずつ取得し、その行において、最も外側に位置するエッジの位置を取得する処理である。最も外側に位置するエッジとは、その行において、最も左側に位置するエッジと、最も右側に位置するエッジである。本実施形態では、最も外側に位置するエッジの位置を取得するとき、入力画像が用いられるのではなく、微分画像が用いられる。 The processing from step S148 to step S168 will be specifically described with reference to FIG. FIG. 12A is a diagram showing an input image and an area R180 for three lines in the input image. FIG. 12(b) is an enlarged view of the region R180 shown in FIG. 12(a). In the processing from step S148 to step S162, the pixels of the input image are acquired column by column in the row of interest as indicated by the horizontal arrows in the region E181 in FIG. This is the process of obtaining the position of the outermost edge in the row. The outermost edges are the leftmost edge and the rightmost edge in the row. In this embodiment, when obtaining the position of the outermost edge, a differential image is used instead of the input image.

図12(c)は、入力画像の微分画像及び微分画像中のうちの3行分の領域R182を示した図である。また、図12(d)は、図12(c)において示した領域R182を拡大した図である。微分画像においては、入力画像におけるエッジの画素は白い画素(画素値が1の画素)として示され、入力画像におけるエッジ以外の画素は黒い画素(画素値が0の画素)として示される。 FIG. 12(c) is a diagram showing a differential image of the input image and a region R182 for three lines in the differential image. Moreover, FIG.12(d) is the figure which expanded area|region R182 shown in FIG.12(c). In the differential image, edge pixels in the input image are shown as white pixels (pixels with a pixel value of 1), and pixels other than the edge in the input image are shown as black pixels (pixels with a pixel value of 0).

制御部100は、図12(d)の領域E183内の横方向の矢印で示したように、注目している行の画素を1列ずつ取得し、その行において、最も外側に位置するエッジの位置を取得する。例えば、制御部100は、r行目の1列目からr行目のC_MAX列目まで、順番に注目画素を移動させ、注目画素の画素値が1であるか否かを判定する。 The control unit 100 acquires the pixels of the row of interest one by one, as indicated by the horizontal arrows in the area E183 of FIG. Get position. For example, the control unit 100 sequentially moves the pixel of interest from the first column of the r-th row to the C_MAX-th column of the r-th row, and determines whether the pixel value of the pixel of interest is 1 or not.

図12(d)において、r行目4列目はエッジの画素である。したがって、制御部100は、一端の画素の位置として、r行目4列目という位置を記憶する。また、図12(d)において、r行目(C_MAX-3)列目は、r行目において最後に検出されるエッジの画素である。したがって、制御部100は、他端の画素の位置として、r行目(C_MAX-3)列目という位置を記憶する。そして、制御部100は、r行目4列目とr行目(C_MAX-3)列目に位置するエッジ、つまり、入力画像におけるエッジのうち、最も外側に位置するエッジだけを削除(キャンセル)する。 In FIG. 12D, the r-th row, fourth column is the edge pixel. Therefore, the control unit 100 stores the position of the r-th row and the fourth column as the position of the pixel at one end. In FIG. 12D, the r-th row (C_MAX−3)-th column is the edge pixel detected last in the r-th row. Therefore, the control unit 100 stores the position of the r-th row (C_MAX−3)-th column as the position of the pixel at the other end. Then, the control unit 100 deletes (cancels) only the edges located in the r-th row, the fourth column and the r-th row (C_MAX−3)-th column, that is, the outermost edge among the edges in the input image. do.

さらに、制御部100は、r+1行目、r+2行目と、他の行でも同様の処理を行うことにより、入力画像及び微分画像のすべての行に対して、最も外側に位置するエッジを削除する。 Further, the control unit 100 deletes the outermost edges for all rows of the input image and the differential image by performing similar processing on the r+1th row, the r+2th row, and other rows. .

なお、制御部100は、図3のステップS104における判定結果が、原稿色と背景色が異ならないという判定結果であれば、ステップS108におけるエッジ検出・エッジキャンセル処理を省略する(実行しない)(ステップS106;No)。 If the determination result in step S104 in FIG. 3 is that the document color and the background color do not differ, the control unit 100 omits (does not execute) the edge detection/edge cancellation process in step S108 (step S106; No).

図3に戻り、制御部100は、原稿が無地であるか否かを判定する処理(無地判定処理)を実行する(ステップS110)。無地判定処理については、図13を参照して説明する。 Returning to FIG. 3, the control unit 100 executes processing for determining whether or not the document is plain (blank determination processing) (step S110). The blank area determination processing will be described with reference to FIG. 13 .

はじめに、制御部100は、エッジの個数をカウントする(ステップS180)。例えば、制御部100は、微分画像に含まれる白い画素の個数を計数することにより、エッジの個数をカウントする。 First, the control unit 100 counts the number of edges (step S180). For example, the control unit 100 counts the number of edges by counting the number of white pixels included in the differential image.

ここで、制御部100は、ステップS108においてエッジ検出・エッジキャンセル処理を実行している場合、エッジをキャンセルした後の微分画像に含まれる白い画素(画素値が1の画素)を計数する。一方、制御部100は、エッジ検出・エッジキャンセル処理を実行していない場合、入力画像に基づく微分画像を取得し、当該微分画像に含まれる白い画素(画素値が1の画素)を計数する。 Here, when edge detection/edge cancellation processing is being performed in step S108, the control unit 100 counts white pixels (pixels with a pixel value of 1) included in the differential image after edge cancellation. On the other hand, when the edge detection/edge cancellation processing is not executed, the control unit 100 acquires a differential image based on the input image, and counts white pixels (pixels with a pixel value of 1) included in the differential image.

つづいて、制御部100は、エッジの個数が所定の閾値以下であるか否かを判定する(ステップS182)。エッジの個数に対する閾値は、予め定められた値であってもよいし、入力画像の画素数に応じた画素数(例えば、入力画像の画素数の1%)であってもよい。また、エッジの個数に対する閾値は、ユーザによって設定可能であってもよい。 Subsequently, the control unit 100 determines whether or not the number of edges is equal to or less than a predetermined threshold (step S182). The threshold for the number of edges may be a predetermined value, or may be the number of pixels corresponding to the number of pixels of the input image (for example, 1% of the number of pixels of the input image). Also, the threshold for the number of edges may be configurable by the user.

制御部100は、エッジの個数が閾値以下であれば、入力された原稿が無地の原稿と判定する(ステップS182;Yes→ステップS184)。一方、制御部100は、エッジの個数が閾値より大きければ、入力された原稿がコンテンツを含む原稿(無地ではない原稿)と判定する(ステップS182;No→ステップS186)。 If the number of edges is equal to or less than the threshold, the controller 100 determines that the input document is a plain document (step S182; Yes→step S184). On the other hand, if the number of edges is greater than the threshold, the control unit 100 determines that the input document includes content (document not plain) (step S182; No→step S186).

ステップS180からステップS186までの処理について、図14を参照して、具体的に説明する。図14(a)は、原稿色と背景色とが異なり、また、原稿が無地である場合における入力画像の微分画像を示した図である。本実施形態では、エッジ検出・エッジキャンセル処理により、最も外側に位置するエッジが削除される。したがって、本実施形態では、最も外側に位置するエッジが削除された図14(b)に示した微分画像に基づき、エッジが係数される。図14(b)に示すように、エッジが削除された後の微分画像には、ほとんどエッジが残っていない。したがって、制御部100は、原稿の原稿色と背景色とが異なる場合において、原稿が無地であるとき、読み取った原稿が無地であると判定する可能性が高くなる。 The processing from step S180 to step S186 will be specifically described with reference to FIG. FIG. 14(a) is a diagram showing a differential image of an input image when the document color is different from the background color and the document is plain. In this embodiment, the outermost edge is deleted by edge detection/edge cancellation processing. Therefore, in this embodiment, the edges are calculated based on the differential image shown in FIG. As shown in FIG. 14(b), almost no edges remain in the differential image after the edges have been removed. Therefore, when the document color and the background color of the document are different and the document is plain, there is a high possibility that the control unit 100 determines that the read document is plain.

図14(c)は、原稿色と背景色とが異なり、また、原稿がコンテンツを含む場合における入力画像の微分画像を示した図である。また、図14(d)は、図14(c)に示した微分画像から、最も外側に位置するエッジが削除された微分画像を示した図である。図14(d)に示すように、最も外側に位置するエッジが削除されても、コンテンツのエッジは残る。したがって、制御部100は、原稿色と背景色とが異なる場合において、原稿にコンテンツを含まれるとき、読み取った原稿を、コンテンツを含む原稿であると判定する可能性が高くなる。 FIG. 14(c) is a diagram showing a differential image of the input image when the document color is different from the background color and the document contains content. FIG. 14(d) is a diagram showing a differential image obtained by deleting the outermost edge from the differential image shown in FIG. 14(c). As shown in FIG. 14(d), even if the outermost edge is removed, the edge of the content remains. Therefore, in the case where the document color and the background color are different and the document contains the content, the control unit 100 is more likely to determine that the read document is the document containing the content.

図3に戻り、制御部100は、ステップS110における判定結果が、原稿が無地であることを示す判定結果である場合、スキュー補正処理を省略する(ステップS112;Yes)。一方、制御部100は、ステップS110における判定結果が、コンテンツを含む原稿であることを示す判定結果である場合、スキュー補正処理を実行する(ステップS112;No→ステップS114)。スキュー補正処理とは、入力画像に現れた原稿の傾きを補正する処理である。スキュー補正処理については、図15を参照して説明する。 Returning to FIG. 3, when the determination result in step S110 indicates that the document is plain, the control unit 100 omits the skew correction process (step S112; Yes). On the other hand, when the determination result in step S110 indicates that the document includes content, the control unit 100 executes skew correction processing (step S112; No→step S114). The skew correction process is a process of correcting the skew of the document appearing in the input image. The skew correction processing will be described with reference to FIG.

制御部100は、最も外側に位置するエッジを削除する前の微分画像を取得する(ステップS190)。例えば、制御部100は、図11のステップS140や図13のステップS180において微分画像を取得している場合は、当該取得した微分画像を再度取得すればよい。なお、制御部100は、再度、入力画像にエッジ検出オペレータを適用することで、微分画像を取得してもよい。 The control unit 100 acquires a differential image before deleting the outermost edge (step S190). For example, when the differential image is acquired in step S140 of FIG. 11 or step S180 of FIG. 13, the control unit 100 may acquire the acquired differential image again. Note that the control unit 100 may obtain a differential image by applying the edge detection operator to the input image again.

つづいて、制御部100は、微分画像に含まれるエッジのうち、上端のエッジ、下端のエッジ、左端のエッジ、右端のエッジが接するような矩形を設定し、当該矩形の位置に基づき、入力画像をクロップ(切り抜き)する(ステップS192)。 Subsequently, the control unit 100 sets a rectangle such that the top edge, the bottom edge, the left edge, and the right edge of the edges included in the differential image are in contact, and based on the position of the rectangle, the input image is cropped (step S192).

さらに、制御部100は、クロップした入力画像に対してスキュー補正を行う(ステップS192)。例えば、制御部100は、微分画像に含まれるエッジから、直線を構成するエッジを検出し、当該直線と、主走査方向又は副走査方向とによって成す角度を求めることにより、搬送された原稿の角度を求める。さらに、制御部100は、原稿の傾きを0°にするために、原稿が傾いている方向とは逆の方向に、原稿の角度だけ回転せる。これにより、原稿の画像は、主走査方向又は副走査方向の方向に沿った角度の画像となる。 Furthermore, the control unit 100 performs skew correction on the cropped input image (step S192). For example, the control unit 100 detects an edge forming a straight line from the edges included in the differential image, and obtains the angle formed by the straight line and the main scanning direction or the sub-scanning direction, thereby determining the angle of the conveyed document. Ask for Further, the control unit 100 rotates the document by the angle of the document in the direction opposite to the direction in which the document is tilted so that the document is tilted at 0°. As a result, the image of the document becomes an image of an angle along the direction of the main scanning direction or the sub-scanning direction.

ステップS190からステップS194までの処理について、図16を参照して、具体的に説明する。図16(a)は、最も外側に位置するエッジを削除する前の入力画像の微分画像を示した図である。また、図16(b)は、図16(a)に示した微分画像に基づき入力画像をクロップした後の入力画像である。図16(b)に示す点線E190は、図16(a)に示した微分画像のうち、上端のエッジ、下端のエッジ、左端のエッジ、右端のエッジが接する矩形を示す。また、図16(c)は、図16(b)に示したクロップ後の入力画像の傾きを補正した画像である。このように、制御部100は、原稿の画像の傾きを補正することができる。 The processing from step S190 to step S194 will be specifically described with reference to FIG. FIG. 16A is a diagram showing a differential image of the input image before removing the outermost edge. FIG. 16(b) is an input image after cropping the input image based on the differential image shown in FIG. 16(a). A dotted line E190 shown in FIG. 16(b) indicates a rectangle in which the top edge, the bottom edge, the left edge, and the right edge of the differential image shown in FIG. 16(a) are in contact. FIG. 16(c) is an image obtained by correcting the tilt of the cropped input image shown in FIG. 16(b). Thus, the control unit 100 can correct the skew of the image of the document.

なお、上述した処理は、自動原稿送り装置によって搬送された原稿毎に実行される。したがって、自動原稿送り装置により無地の原稿やコンテンツを含む原稿が斜めに搬送された場合であっても、原稿毎に無地の判定や、スキュー補正処理が実行される。 Note that the above-described processing is executed for each document conveyed by the automatic document feeder. Therefore, even when a blank document or a document containing content is conveyed obliquely by the automatic document feeder, blank determination and skew correction processing are executed for each document.

[1.3 動作例]
つづいて、図17から図20までを参照して、本実施形態における動作例を説明する。図17は、原稿色と背景色とが異なる場合において、斜めに搬送された無地の原稿が読み取られたときの動作例を示す図である。
[1.3 Operation example]
Next, an operation example in this embodiment will be described with reference to FIGS. 17 to 20. FIG. 17A and 17B are diagrams showing an operation example when a blank document conveyed obliquely is read when the color of the document and the background color are different.

図17(a)は、入力画像を示した図である。図17(a)に示すように、原稿色と背景色とが異なる場合、入力画像には、原稿色が現れる領域E1000と、背景色が現れる領域E1001(左上)、領域E1002(右上)、領域E1003(左下)、領域E1004(右下)とが含まれる。 FIG. 17A is a diagram showing an input image. As shown in FIG. 17A, when the original color and the background color are different, the input image includes an area E1000 where the original color appears, an area E1001 where the background color appears, an area E1001 where the background color appears (upper left), an area E1002 (upper right), and an area E1003 (bottom left) and area E1004 (bottom right) are included.

図17(b)は、入力画像からエッジを検出した場合の図(微分画像)である。原稿色と背景色とが異なる場合、図17(b)に示すように、原稿色と背景色との境目の部分がエッジとして検出される。また、図17(c)は、微分画像から最も外側にあるエッジをキャンセル(削除)した微分画像を示した図である。図17(c)による微分画像に基づき、原稿が無地か否かが判定される。 FIG. 17B is a diagram (differential image) when edges are detected from the input image. When the document color and the background color are different, the boundary portion between the document color and the background color is detected as an edge, as shown in FIG. 17(b). FIG. 17C is a diagram showing a differential image obtained by canceling (deleting) the outermost edge from the differential image. Based on the differential image shown in FIG. 17(c), it is determined whether or not the document is plain.

エッジの画素の数を比較すると、図17(b)に示した微分画像に比べ、図17(c)に示した微分画像のほうが少ない。図17(c)による微分画像に基づき、原稿が無地か否かが判定されることにより、原稿色と背景色とが異なる場合において、無地の原稿が無地の原稿であると正しく判定される可能性が高くなる。 Comparing the number of edge pixels, the differential image shown in FIG. 17(c) has fewer pixels than the differential image shown in FIG. 17(b). By determining whether or not the document is plain based on the differential image shown in FIG. become more sexual.

図18は、原稿色と背景色とが異なる場合において、斜めに搬送されたコンテンツを含む原稿が読み取られた場合についての動作例を示す図である。 18A and 18B are diagrams showing an operation example when a document including content conveyed obliquely is read when the color of the document and the background color are different.

図18(a)は、入力画像を示した図である。図18(a)に示すように、原稿色と背景色とが異なる場合、入力画像には、原稿色が現れる領域E1010と、背景色が現れる領域E1011(左上)、領域E1012(右上)、領域E1013(左下)、領域E1014(右下)とが含まれる。 FIG. 18(a) is a diagram showing an input image. As shown in FIG. 18A, when the original color and the background color are different, the input image includes an area E1010 where the original color appears, an area E1011 where the background color appears (upper left), an area E1012 (upper right), and an area E1012 (upper right). E1013 (bottom left) and area E1014 (bottom right) are included.

図18(b)は、図18(a)に示した入力画像の微分画像を示した図である。また、図18(c)は、図18(b)に示した微分画像から、最も外側に位置するエッジを削除した微分画像である。図18(c)による微分画像に基づき、原稿が無地か否かが判定されるが、図18(c)に示すように、最も外側に位置するエッジが削除されても、微分画像には依然としてエッジが含まれている。図18(c)による微分画像に基づき、原稿が無地か否かが判定されることにより、原稿色と背景色とが異なる場合において、コンテンツを含む原稿がコンテンツを含む原稿であると正しく判定される可能性が高くなる。 FIG. 18(b) is a diagram showing a differential image of the input image shown in FIG. 18(a). FIG. 18(c) is a differential image obtained by deleting the outermost edge from the differential image shown in FIG. 18(b). Based on the differential image according to FIG. 18(c), it is determined whether the document is plain or not, but as shown in FIG. Includes edges. By determining whether or not the document is plain based on the differentiated image shown in FIG. more likely to

また、図18(d)は、図18(a)に示した入力画像をクロップした後の入力画像である。図18(d)における点線L1010は、エッジを削除する前の微分画像において、上端のエッジ、下端のエッジ、左端のエッジ、右端のエッジが接する矩形を示している。また、図18(d)に示したクロップ後の入力画像に対してスキュー補正処理がされることにより、図18(e)に示した入力画像に補正され、当該スキュー補正処理後の入力画像が出力される。 FIG. 18(d) is an input image after cropping the input image shown in FIG. 18(a). A dotted line L1010 in FIG. 18D indicates a rectangle in which the top edge, the bottom edge, the left edge, and the right edge are in contact with each other in the differential image before edge deletion. Further, by subjecting the input image after cropping shown in FIG. 18D to the skew correction process, the input image shown in FIG. output.

図19は、原稿色と背景色とが異ならない場合において、斜めに搬送された無地の原稿が読み取られた場合についての動作例を示す図である。図19(a)は入力画像を示した図である。図19(a)のL1020は、原稿が置かれていた範囲を示す。図19(a)に示すように、入力画像のL1020の位置には、原稿の縁(境界線)に相当する線等はほとんど含まれない。 19A and 19B are diagrams showing an operation example when a blank document conveyed obliquely is read when the color of the document and the background color are the same. FIG. 19(a) is a diagram showing an input image. L1020 in FIG. 19A indicates the range where the document was placed. As shown in FIG. 19A, the position of L1020 of the input image hardly includes lines corresponding to edges (boundary lines) of the document.

図19(b)は、図19(a)に示した入力画像の微分画像を示した図である。原稿色と背景色とが異ならない場合は、微分画像から、最も外側に位置するエッジを削除しないため、図19(b)に示した微分画像に基づき、無地か否かが判定される。図19(b)に示した微分画像は、エッジがほとんど含まれていないため、読み取られた原稿が無地の原稿であると正しく判定される可能性が高くなる。 FIG. 19(b) is a diagram showing a differential image of the input image shown in FIG. 19(a). If the document color and the background color do not differ, since the outermost edge is not deleted from the differential image, it is determined whether or not it is solid based on the differential image shown in FIG. 19(b). Since the differential image shown in FIG. 19B contains almost no edges, there is a high possibility that the read document is correctly determined to be a blank document.

図20は、原稿色と背景色とが異ならない場合において、斜めに搬送されたコンテンツを含む原稿が読み取られた場合についての動作例を示す図である。図20(a)は入力画像を示した図である。図20(b)は、図20(a)に示した入力画像の微分画像を示した図である。原稿色と背景色とが異ならない場合は、微分画像から、最も外側に位置するエッジを削除しないため、図20(b)に示した微分画像に基づき、無地か否かが判定される。図20(b)に示した微分画像は、コンテンツ部分のエッジが含まるため、読み取られた原稿がコンテンツを含む原稿であると正しく判定される可能性が高くなる。 FIG. 20 is a diagram showing an operation example when a document containing content conveyed obliquely is read when the color of the document and the background color do not differ. FIG. 20(a) is a diagram showing an input image. FIG. 20(b) is a diagram showing a differential image of the input image shown in FIG. 20(a). If the document color and the background color do not differ, since the outermost edge is not deleted from the differential image, it is determined whether or not it is plain based on the differential image shown in FIG. 20(b). Since the differential image shown in FIG. 20(b) includes the edge of the content portion, there is a high possibility that the read document is correctly determined as the document containing the content.

図20(c)は、図20(a)に示した入力画像をクロップした後の入力画像である。図20(c)における点線L1030は、図20(b)に示した微分画像において、上端のエッジ、下端のエッジ、左端のエッジ、右端のエッジが接する矩形を示している。また、図20(c)に示したクロップ後の入力画像に対してスキュー補正処理がされることにより、図20(d)に示した入力画像(領域E1030に含まれる画像)に補正され、当該スキュー補正処理後の入力画像が出力される。 FIG. 20(c) is the input image after cropping the input image shown in FIG. 20(a). A dotted line L1030 in FIG. 20(c) indicates a rectangle in which the upper edge, the lower edge, the left edge, and the right edge touch in the differential image shown in FIG. 20(b). Further, by subjecting the input image after cropping shown in FIG. 20C to skew correction processing, the input image shown in FIG. An input image after skew correction processing is output.

なお、上述した説明以外であっても、矛盾のない範囲においてステップの順番を変更したりしてもよいし、処理を実行するための条件を加えてもよい。 In addition to the above description, the order of steps may be changed within a consistent range, and conditions for executing processing may be added.

例えば、図11に示したエッジ検出・エッジキャンセル処理は、1行ずつエッジを削除する処理として示したが、制御部100は、全ての行に対して一端の画素の位置と他端の画素の位置とを検出した後に、エッジを削除する処理を実行してもよい。このようにすることで、制御部100は、入力画像全体に対して、最も外側に位置するエッジであって、連続性を持つエッジを判定し、当該エッジのグループを削除することができる。 For example, the edge detection/edge cancellation processing shown in FIG. 11 is shown as processing for deleting edges row by row, but the control unit 100 determines the positions of the pixels at one end and the pixels at the other end for all rows. After detecting the position, the process of deleting edges may be performed. By doing so, the control unit 100 can determine the edge that is the outermost edge and has continuity with respect to the entire input image, and delete the group of the edge.

また、図11に示したエッジ検出・エッジキャンセル処理は、1行ずつエッジを削除する処理として示したが、1列ずつエッジを削除する処理であってもよい。この場合、制御部100は、入力画像のエッジが存在する各列のうち、行番号が最小・最大のエッジをキャンセルする。 Further, the edge detection/edge cancellation processing shown in FIG. 11 is shown as processing for deleting edges row by row, but may be processing for deleting edges column by column. In this case, the control unit 100 cancels the edges with the minimum and maximum row numbers among the columns in which the edges of the input image exist.

このように、本実施形態の画像処理装置によれば、原稿色と背景色とが異なる場合は、入力画像のエッジを削除する処理を実行し、原稿色と背景色とが異ならない場合は、入力画像のエッジを削除する処理を実行しない。また、本実施形態の画像処理装置によれば、原稿色と背景色とが異なるか否かに応じて、入力画像のエッジを削除する処理を実行するか否かが切り替えられるため、結果として、入力された原稿が無地であるか否かを適切に判定することができる。 As described above, according to the image processing apparatus of the present embodiment, when the document color and the background color are different, the process of deleting the edge of the input image is executed, and when the document color and the background color are not different, Do not remove edges from the input image. Further, according to the image processing apparatus of the present embodiment, it is possible to switch whether or not to execute processing for deleting edges of an input image depending on whether or not the document color and the background color are different. Thus, it is possible to appropriately determine whether or not the input document is blank.

[2.第2実施形態]
つづいて第2実施形態について説明する。第2実施形態は、第1実施形態とは異なり、原稿を読み取るときに、原稿が配置された範囲よりも更に外側の範囲を含めて余分に読み取ることで、無地判定の誤検知を抑制する実施形態である。本実施形態は、第1実施形態の図3を図23に、第1実施形態の図4を図24にそれぞれ置き換えたものである。なお、同一の処理には同一の符号を付し、説明については省略する。
[2. Second Embodiment]
Next, a second embodiment will be described. Unlike the first embodiment, the second embodiment suppresses erroneous detection of blank determination by reading an extra range outside the range in which the document is arranged when reading the document. form. In this embodiment, FIG. 3 of the first embodiment is replaced with FIG. 23, and FIG. 4 of the first embodiment is replaced with FIG. Note that the same processes are denoted by the same reference numerals, and the description thereof is omitted.

一般的に、原稿が読み取られる場合、原稿の大きさや原稿が載置された領域が画像処理装置によって検出され、当該検出された領域が読み取られる。しかし、原稿が斜めに搬送された場合、正しく原稿の大きさや原稿が載置された領域が検出されない場合がある。 Generally, when a document is read, the size of the document and the area where the document is placed are detected by an image processing device, and the detected area is read. However, when the document is conveyed obliquely, the size of the document and the area where the document is placed may not be detected correctly.

図21を参照して、具体例について説明する。図21(a)は、枠線のコンテンツC200を含む原稿の一部が読み取られなかった場合について示す図である。図21(a)における線L200は、画像入力部120によって読み取られた範囲、すなわち、入力画像の範囲を示す。図21(a)における線L201は、原稿の縁を示す。ここで、図21(a)における領域E200のように、読み取った範囲(線L200)よりも外側に、原稿の領域が存在する場合がある。しかし、領域E200のような領域は、入力画像には含まれず、結果として、原稿の縁L201の一部が入力画像に含まれないこととなる。 A specific example will be described with reference to FIG. FIG. 21(a) is a diagram showing a case where a portion of the document containing the framed content C200 is not read. A line L200 in FIG. 21A indicates the range read by the image input unit 120, that is, the range of the input image. A line L201 in FIG. 21A indicates the edge of the document. Here, there may be an area of the document outside the read range (line L200), such as area E200 in FIG. 21(a). However, an area such as the area E200 is not included in the input image, and as a result, part of the edge L201 of the document is not included in the input image.

図21(b)は、図21(a)に示した状態における入力画像を示す。また、図21(c)は、図21(b)に示した入力画像の微分画像を示す。図21(c)に示す(A)の範囲は、図21(a)に示した枠線のコンテンツC200が含まれる範囲を示す。 FIG. 21(b) shows the input image in the state shown in FIG. 21(a). Moreover, FIG.21(c) shows the differential image of the input image shown in FIG.21(b). A range (A) shown in FIG. 21(c) indicates a range that includes the framed content C200 shown in FIG. 21(a).

ここで、図21(c)に示すように、枠線のコンテンツC200がエッジの画素として検出された場合であって、枠線のコンテンツC200が微分画像において、最も外側に位置するエッジである場合がある。このような場合、エッジを削除する処理が実行されることにより、図21(d)に示すように、枠線のコンテンツC200を構成するエッジは削除され、微分画像に含まれるエッジの数は少なくなる。その結果、枠線のコンテンツC200が含まれる原稿であっても、無地の原稿と判断される可能性がある。 Here, as shown in FIG. 21(c), when the frame line content C200 is detected as an edge pixel and the frame line content C200 is the outermost edge in the differential image. There is In such a case, the edges forming the content C200 of the frame line are deleted as shown in FIG. Become. As a result, even a document containing content C200 with a frame line may be determined to be a blank document.

そこで、本実施形態では、原稿を読み取るときに、原稿が配置された範囲よりも更に外側の範囲を含めて読み取る。本実施形態の概要について、図22を参照して説明する。図22(a)は、図21(a)に示した状態において、原稿が配置された範囲よりも更に外側の範囲を含めて読み取られた場合における入力画像を示す。原稿が配置された範囲よりも更に外側の範囲を含めて読み取られることにより、原稿全体の画像が入力画像に含まれることとなる。 Therefore, in the present embodiment, when reading a document, the range further outside the range in which the document is arranged is also read. An overview of this embodiment will be described with reference to FIG. FIG. 22(a) shows an input image in the state shown in FIG. 21(a) when a range outside the range where the document is arranged is read. An image of the entire document is included in the input image by reading a range outside the range in which the document is arranged.

図22(b)は、図22(a)に示した入力画像の微分画像を示す。また、図22(c)は、図22(b)に示した微分画像のうち、最も外側に位置するエッジを削除した後の微分画像を示す。 FIG. 22(b) shows a differential image of the input image shown in FIG. 22(a). FIG. 22(c) shows a differential image after deleting the outermost edge of the differential image shown in FIG. 22(b).

図22(b)に示した微分画像のうち、最も外側に位置するエッジは、原稿の縁に基づくエッジ(原稿の境界線に生じるエッジ)である。したがって、最も外側に位置するエッジが削除されても、図22(c)に示すように、枠線のコンテンツによるエッジは削除されない。そのため、無地の原稿と判断される可能性が低くなる。 In the differential image shown in FIG. 22B, the outermost edge is an edge based on the edge of the document (edge generated at the boundary line of the document). Therefore, even if the outermost edge is removed, the edge due to the content of the border is not removed, as shown in FIG. 22(c). Therefore, it is less likely that the document is determined to be a blank document.

このように、画像処理装置10は、原稿が配置された範囲よりも更に外側の範囲を含めて余分にスキャンする(読み取る)ことで、無地判定の誤検知を抑制することができる。 In this manner, the image processing apparatus 10 can suppress erroneous detection of blank determination by additionally scanning (reading) the range outside the range in which the document is arranged.

図23及び図24を参照して、本実施形態における画像処理装置10が実行する処理について説明する。まず、図23を参照して、本実施形態における画像処理装置10の制御部100が実行する主な処理について説明する。 Processing executed by the image processing apparatus 10 according to the present embodiment will be described with reference to FIGS. 23 and 24. FIG. First, main processing executed by the control unit 100 of the image processing apparatus 10 according to the present embodiment will be described with reference to FIG.

本実施形態では、画像処理装置10の制御部100は、原稿の読み取り範囲を、原稿の外側まで拡張したうえで、入力画像を取得する(ステップS200→ステップS100)。例えば、制御部100は、画像入力部120に搬送された原稿のサイズや原稿が載置された領域を検出し、検出結果に基づき、原稿の読み取り範囲を設定する。さらに、制御部100は、設定した原稿の読み取り範囲を、当該読み取り範囲の外側に(例えば、外側に5mm程度)広げる。これにより、制御部100は、画像入力部120に対して、原稿の周囲(原稿の外側の部分)を余分に読み取らせることが可能となる。 In this embodiment, the control unit 100 of the image processing apparatus 10 acquires an input image after extending the reading range of the document to the outside of the document (step S200→step S100). For example, the control unit 100 detects the size of the document conveyed to the image input unit 120 and the area where the document is placed, and sets the reading range of the document based on the detection result. Furthermore, the control unit 100 expands the set reading range of the document to the outside of the reading range (for example, about 5 mm outside). This allows the control unit 100 to cause the image input unit 120 to additionally read the periphery of the document (outer portion of the document).

次に、図24を参照して、本実施形態における原稿色・背景色判定処理について説明する。本実施形態では、制御部100は、入力画像を切り出した画像を取得し、当該切り出した画像の1辺の画素値ヒストグラムを生成する(ステップS220→ステップS222)。なお、制御部100は、図4のステップS120と同様に、入力画像をモノクロ画像(グレースケール画像)に変換し、当該入力画像を切り出した画像の上端、右端、下端、左端のうちの1辺の辺部分を構成する画素の画素値に基づくヒストグラムを生成する。 Next, document color/background color determination processing in this embodiment will be described with reference to FIG. In this embodiment, the control unit 100 obtains an image obtained by clipping the input image, and generates a pixel value histogram of one side of the clipped image (step S220→step S222). 4, the control unit 100 converts the input image into a monochrome image (grayscale image), and converts the input image into one of the upper edge, right edge, lower edge, and left edge of the clipped image. A histogram is generated based on the pixel values of the pixels forming the side portions of .

本実施形態では、ステップS200において原稿の読み取り範囲が拡張されているため、入力画像の辺部分は、主に背景色の画素を含んでいる。したがって、このままの状態で画素値ヒストグラムを生成しても、原稿色の画素の画素値が、ヒストグラムにほとんど含まれない可能性がある。 In this embodiment, since the reading range of the document is expanded in step S200, the sides of the input image mainly include pixels of the background color. Therefore, even if the pixel value histogram is generated in this state, there is a possibility that the pixel values of the original color pixels are hardly included in the histogram.

そこで、制御部100は、入力画像を切り出し、当該切り出した入力画像に基づくヒストグラムを生成することで、原稿色の画素値がヒストグラムに含まれるようにする。例えば、制御部100は、ステップS200において広げた領域を除いた入力画像となるように、ステップS220において入力画像を切り出す。具体例として、制御部100は、ステップS200において、当初の読み取り範囲より外側に5mm広げた読み取り範囲を設定していた場合、ステップS220では、入力画像の周囲5mmを切り出した画像を取得する。なお、制御部100は、第1実施形態と同様に、生成したヒストグラムに対してピークが複数あるか否かを判定する。 Therefore, the control unit 100 cuts out the input image and generates a histogram based on the cut out input image so that the pixel values of the document colors are included in the histogram. For example, the control unit 100 cuts out the input image in step S220 so that the input image excludes the area expanded in step S200. As a specific example, if the control unit 100 has set a reading range that is 5 mm wider than the initial reading range in step S200, then in step S220 an image obtained by cutting out a 5 mm periphery of the input image is acquired. As in the first embodiment, the control unit 100 determines whether or not the generated histogram has multiple peaks.

また、図23のステップS108におけるエッジ検出・エッジキャンセル処理においては、制御部100は、原稿が配置された範囲よりも更に外側の範囲を含めて余分にスキャンした入力画像(例えば、図22(a)に示した画像)を処理対象とする。入力画像は、原稿の縁を全て含んでいるため、制御部100は、ステップS108におけるエッジ検出・エッジキャンセル処理において、原稿の縁のエッジの画素を削除することができる。これにより、制御部100は、コンテンツの削除を回避できる。また、制御部100は、ステップS114におけるスキュー補正処理において、原稿の縁のエッジの画素に基づいて入力画像をクロップする。これにより、制御部100は、原稿の縁のエッジに基づき、適切に入力画像をクロップすることが可能となる。 Further, in the edge detection/edge cancellation processing in step S108 of FIG. 23, the control unit 100 scans an extra input image including a range outside the range in which the document is arranged (for example, FIG. 22(a) ) is to be processed. Since the input image includes all the edges of the document, the control unit 100 can delete edge pixels of the document in the edge detection/edge cancellation processing in step S108. Thereby, the control unit 100 can avoid deleting the content. Also, in the skew correction processing in step S114, the control unit 100 crops the input image based on the edge pixels of the edge of the document. This allows the control unit 100 to appropriately crop the input image based on the edge of the document.

このように、本実施形態によれば、原稿の周辺を余分にスキャンすることで、枠線を含むコンテンツが含まれる原稿であっても、適切に無地判定を行うことができる。 As described above, according to the present embodiment, by additionally scanning the periphery of the document, it is possible to appropriately perform blank determination even for a document containing content including a frame line.

[3.第3実施形態]
つづいて第3実施形態について説明する。第3実施形態は、第1実施形態とは異なる無地判定の方法を用いる実施形態である。本実施形態は、第1実施形態の図3を図25に置き換えたものである。なお、同一の処理には同一の符号を付し、説明については省略する。
[3. Third Embodiment]
Next, a third embodiment will be described. The third embodiment is an embodiment using a blank area determination method different from that of the first embodiment. This embodiment replaces FIG. 3 of the first embodiment with FIG. Note that the same processes are denoted by the same reference numerals, and the description thereof is omitted.

図25及び図26を参照して、本実施形態における処理の流れを説明する。まず、図25を参照して、本実施形態における画像処理装置10の制御部100が実行する主な処理について説明する。 The flow of processing in this embodiment will be described with reference to FIGS. 25 and 26. FIG. First, with reference to FIG. 25, main processing executed by the control unit 100 of the image processing apparatus 10 in this embodiment will be described.

本実施形態では、制御部100は、ステップS106において原稿色と背景色とが異なるか否かを判定し、原稿色と背景色とが異ならない場合は、第1実施形態と同様に、無地判定処理を実行する(ステップS106;No→ステップS110)。 In this embodiment, the control unit 100 determines whether or not the document color and the background color are different in step S106. Processing is executed (step S106; No→step S110).

一方、制御部100は、原稿色と背景色とが異なると判定した場合は、第2の無地判定処理を実行する(ステップS106;Yes→ステップS300)。第2の無地判定処理について、図26を参照して説明する。 On the other hand, when the control unit 100 determines that the document color and the background color are different, it executes a second plain color determination process (step S106; Yes→step S300). The second blank area determination process will be described with reference to FIG.

はじめに、制御部100は、入力画像からエッジを検出した画像(エッジ抽出画像、微分画像)を取得する(ステップS320)。ステップS320における処理は、図8におけるステップS140と同様の処理である。 First, the control unit 100 acquires an image (edge-extracted image, differential image) in which edges are detected from the input image (step S320). The process in step S320 is the same process as step S140 in FIG.

つづいて、制御部100は、微分画像における注目画素の縦位置を示す変数Rに1を代入することで初期化し、さらに、コンテンツを含む行を計数するための変数contents_tmpに0を代入することで初期化する(ステップS322)。また、制御部100は、微分画像における注目画素の横位置を示す変数Cに1を代入することで初期化し、さらに、変数countに0を代入することで初期化する(ステップS324)。変数R及び変数Cが取り得る範囲については、第1実施形態における変数R及び変数Cと同様である。 Subsequently, the control unit 100 assigns 1 to the variable R indicating the vertical position of the pixel of interest in the differential image for initialization, and assigns 0 to the variable contents_tmp for counting rows containing content. Initialize (step S322). The control unit 100 also assigns 1 to a variable C indicating the horizontal position of the pixel of interest in the differential image for initialization, and assigns 0 to a variable count (step S324). The possible ranges of the variable R and the variable C are the same as those of the variable R and the variable C in the first embodiment.

つづいて、制御部100は微分画像のR行目にアクセスし(ステップS326)、さらに、R行目のC列目にアクセスする(ステップS328)。 Subsequently, the control unit 100 accesses the Rth row of the differential image (step S326), and further accesses the Cth column of the Rth row (step S328).

つづいて、制御部100は、注目画素の画素値が1であるか否かを判定する(ステップS330)。制御部100は、注目画素の画素値が1である場合、変数countの値をcount+1にする(変数countをインクリメントする)(ステップS330;Yes→ステップS332)。 Subsequently, the control unit 100 determines whether the pixel value of the pixel of interest is 1 (step S330). When the pixel value of the target pixel is 1, the control unit 100 sets the value of the variable count to count+1 (increments the variable count) (step S330; Yes→step S332).

つづいて、制御部100は、変数countの値が3であるか否かを判定する(ステップS334)。変数countの値が3である場合とは、微分画像のR行目において、原稿の縁に基づくエッジの画素の他に、コンテンツによるエッジの画素があると考えられる場合である。変数countの値が3であることは、入力画像のR行目には、エッジが3以上(エッジの画素が3画素以上)含まれることに対応する。 Subsequently, the control unit 100 determines whether or not the value of the variable count is 3 (step S334). A case where the value of the variable count is 3 is a case in which it is considered that there are edge pixels due to content in addition to edge pixels based on the edge of the document in the R-th row of the differential image. The fact that the value of the variable count is 3 corresponds to the fact that the R-th row of the input image includes 3 or more edges (3 or more edge pixels).

変数countの値が3ではない場合、変数Cの値をC+1にすることで、変数Cをインクリメントし(ステップS334;No→ステップS336)、変数Cの値がC_MAXと一致するか否かを判定する(ステップS338)。なお、制御部100は、ステップS330において、画素値が1ではないと判定した場合も、ステップS336及びステップS338の処理を実行する(ステップS330;No→ステップS336→ステップS338)。 If the value of the variable count is not 3, the value of the variable C is set to C+1 to increment the variable C (step S334; No → step S336), and it is determined whether the value of the variable C matches C_MAX. (step S338). Even if the control unit 100 determines in step S330 that the pixel value is not 1, it also executes the processing in steps S336 and S338 (step S330; No→step S336→step S338).

制御部100は、変数Cの値がC_MAXと一致しない場合、ステップS328に戻る(ステップS338;No→ステップS328)。一方、変数Cの値がC_MAXと一致する場合、制御部100は、変数Rの値をR+1にすることで、変数Rをインクリメントし(ステップS338;Yes→ステップS344)、変数Rの値がR_MAXと一致するか否かを判定する(ステップS346)。制御部100は、変数Rの値がR_MAXと一致しない場合、ステップS324に戻る(ステップS346;No→ステップS324)。一方、制御部100は、Rの値がR_MAXと一致する場合、原稿は無地の原稿であると判定する(ステップS346;Yes→ステップS348)。 If the value of variable C does not match C_MAX, control unit 100 returns to step S328 (step S338; No→step S328). On the other hand, when the value of the variable C matches C_MAX, the control unit 100 increments the variable R by setting the value of the variable R to R+1 (step S338; Yes→step S344), and the value of the variable R becomes R_MAX. (step S346). If the value of the variable R does not match R_MAX, the control unit 100 returns to step S324 (step S346; No→step S324). On the other hand, when the value of R matches R_MAX, the control unit 100 determines that the document is a blank document (step S346; Yes→step S348).

制御部100は、ステップS334において変数countの値が3であると判定した場合、変数contents_tmpの値をcontents_tmp+1にすることで、変数contents_tmpをインクリメントする(ステップS334;Yes→ステップS340)。さらに、制御部100は、変数contents_tmpが予め定められた変数contentsと一致するか否かを判定する(ステップS342)。 When determining that the value of the variable count is 3 in step S334, the control unit 100 sets the value of the variable contents_tmp to contents_tmp+1, thereby incrementing the variable contents_tmp (step S334; Yes→step S340). Furthermore, the control unit 100 determines whether or not the variable contents_tmp matches the predetermined variable contents (step S342).

変数contentsは、0<=contents<=R_MAXを満たす、予め定められた閾値である。例えば、変数contentsの値は、R_MAXの値や、原稿のサイズから自動的に算出される(例えば、制御部100は、変数contentsをR_MAX×0.1の値とする)。なお、変数contentsは、画像処理装置10の管理者等により予め定められてもよい。また、変数contentsは、画像処理装置10のユーザによって設定可能であってもよい。 The variable contents is a predetermined threshold that satisfies 0<=contents<=R_MAX. For example, the value of the variable contents is automatically calculated from the value of R_MAX and the document size (for example, the control unit 100 sets the variable contents to the value of R_MAX×0.1). Note that the variable contents may be determined in advance by an administrator or the like of the image processing apparatus 10 . Also, the variable contents may be settable by the user of the image processing apparatus 10 .

制御部100は、変数contents_tmpが変数contentsと一致する場合、原稿はコンテンツを含む原稿であると判定する(ステップS342;Yes→ステップS350)。一方、制御部100は、変数contents_tmpが変数contentsと一致しない場合、ステップS344における処理を実行する(ステップS342;No→ステップS344)。このような処理により、制御部100は、R行目に原稿の縁に基づくエッジ以外のエッジがあることを判定した段階で、次の行の処理に移行することができる。結果として、制御部100は、処理のステップ数や処理時間を削減することができる。 If the variable contents_tmp matches the variable contents, the control unit 100 determines that the document contains content (step S342; Yes→step S350). On the other hand, when the variable contents_tmp does not match the variable contents, the control unit 100 executes the process in step S344 (step S342; No → step S344). With such processing, the control unit 100 can shift to the processing of the next line at the stage of determining that there is an edge other than the edge based on the edge of the document in the R-th line. As a result, the control unit 100 can reduce the number of processing steps and processing time.

このように、本実施形態における画像処理装置は、原稿色と背景色が異なるか否かに応じて、原稿が無地であるか否かを判定する処理を切り替える。特に、本実施形態における第2の無地判定処理は、エッジを削除することなく、微分画像において注目されている行に含まれるエッジの画素の数を計数するだけで、原稿が無地の原稿であるか否かを判定する処理である。エッジを削除する処理が実行されないため、画像処理装置、無地判定の処理量を抑えることができる。そのため、ユーザは、画像形成装置に必要な性能を抑えることが可能となる。 As described above, the image processing apparatus according to the present embodiment switches the process of determining whether or not the document is plain depending on whether or not the color of the document and the background color are different. In particular, the second plain color determination process in the present embodiment counts the number of edge pixels included in the line of interest in the differential image without deleting the edges, and determines whether the document is a plain document. This is the process of determining whether or not. Since the process of deleting edges is not executed, the processing amount of the image processing apparatus and the blank area determination can be suppressed. Therefore, the user can reduce the performance required for the image forming apparatus.

[4.変形例]
本発明は上述した各実施の形態に限定されるものではなく、種々の変更が可能である。すなわち、本発明の要旨を逸脱しない範囲内において適宜変更した技術的手段を組み合わせて得られる実施の形態についても本発明の技術的範囲に含まれる。
[4. Modification]
The present invention is not limited to the embodiments described above, and various modifications are possible. That is, the technical scope of the present invention also includes embodiments obtained by combining technical means appropriately modified within the scope of the present invention.

また、上述した実施形態は、説明の都合上、それぞれ別に説明している部分があるが、技術的に可能な範囲で組み合わせて実行してもよいことは勿論である。例えば、第2実施形態と第3実施形態とを組み合わせてもよい。この場合、原稿の周囲が余分に読み取られた上で、エッジを削除する処理が実行されることなく、原稿が無地であるか否かを判定させることができる。 In addition, although the above-described embodiments are described separately for convenience of explanation, it is of course possible to combine them within the technically possible range. For example, the second embodiment and the third embodiment may be combined. In this case, it is possible to determine whether or not the document is blank without reading the periphery of the document in excess and without executing the process of deleting the edges.

また、上述の実施形態において、ヒストグラムの算出に用いられる矩形領域を設定するときに、各辺と、長辺の長さに所定の割合αを乗じた位置とを囲む領域として説明した。これにより、辺からの距離が長辺の長さに所定の割合αまでの位置に存在する画素の画素値に基づき、ヒストグラムが生成される。なお、矩形領域を設定する場合における辺からの距離は、長辺・短辺それぞれの長さに基づき算出されてもよい。この場合、注目している辺に対応する矩形領域として、注目している辺と、注目している辺の長さに所定の割合αを乗じた位置とを囲む領域が設定される。 Further, in the above-described embodiment, when setting the rectangular area used for calculating the histogram, the area surrounding each side and the position obtained by multiplying the length of the long side by the predetermined ratio α has been described. As a result, a histogram is generated based on the pixel values of the pixels present at positions where the distance from the side is up to a predetermined ratio α to the length of the long side. Note that the distance from the side when setting the rectangular area may be calculated based on the length of each of the long side and the short side. In this case, as a rectangular area corresponding to the side of interest, an area surrounding the side of interest and a position obtained by multiplying the length of the side of interest by a predetermined ratio α is set.

また、実施形態において各装置で動作するプログラムは、上述した実施形態の機能を実現するように、CPU等を制御するプログラム(コンピュータを機能させるプログラム)である。そして、これら装置で取り扱われる情報は、その処理時に一時的に一時記憶装置(例えば、RAM)に蓄積され、その後、各種ROM(Read Only Memory)やHDD等の記憶装置に格納され、必要に応じてCPUによって読み出し、修正・書き込みが行なわれる。 In addition, the program that operates in each device in the embodiment is a program that controls the CPU and the like (a program that causes the computer to function) so as to implement the functions of the above-described embodiments. Information handled by these devices is temporarily stored in a temporary storage device (for example, RAM) during processing, and then stored in storage devices such as various ROMs (Read Only Memory) and HDDs. The data is read, corrected, and written by the CPU.

ここで、プログラムを格納する記録媒体としては、半導体媒体(例えば、ROMや、不揮発性のメモリカード等)、光記録媒体・光磁気記録媒体(例えば、DVD(Digital Versatile Disc)、MO(Magneto Optical Disc)、MD(Mini Disc)、CD(Compact Disc)、BD (Blu-ray(登録商標) Disk) 等)、磁気記録媒体(例えば、磁気テープ、フレキシブルディスク等)等の何れであってもよい。また、ロードしたプログラムを実行することにより、上述した実施形態の機能が実現されるだけでなく、そのプログラムの指示に基づき、オペレーティングシステムあるいは他のアプリケーションプログラム等と共同して処理することにより、本発明の機能が実現される場合もある。 Examples of recording media for storing programs include semiconductor media (eg, ROM, non-volatile memory cards, etc.), optical recording media/magneto-optical recording media (eg, DVD (Digital Versatile Disc), MO (Magneto Optical Disc), MD (Mini Disc), CD (Compact Disc), BD (Blu-ray (registered trademark) Disc), etc.), magnetic recording media (e.g., magnetic tape, flexible disc, etc.), etc. . By executing the loaded program, the functions of the above-described embodiments are realized. In some cases, inventive features are realized.

また、市場に流通させる場合には、可搬型の記録媒体にプログラムを格納して流通させたり、インターネット等のネットワークを介して接続されたサーバコンピュータに転送したりすることができる。この場合、サーバコンピュータの記憶装置も本発明に含まれるのは勿論である。 When distributed to the market, the program can be stored in a portable recording medium for distribution, or transferred to a server computer connected via a network such as the Internet. In this case, of course, the storage device of the server computer is also included in the present invention.

10 画像処理装置
100 制御部
102 画像処理部
120 画像入力部
130 画像形成部
140 表示部
150 操作部
160 記憶部
190 通信部
10 image processing apparatus 100 control unit 102 image processing unit 120 image input unit 130 image forming unit 140 display unit 150 operation unit 160 storage unit 190 communication unit

Claims (8)

原稿を読み取って当該原稿の画像を入力する画像入力部と、制御部とを備え、
前記制御部は、
前記画像入力部によって入力された原稿が斜めである場合、前記画像の各辺において当該辺を構成する画素を一辺とした矩形領域に含まれる画素の画素値の分布に基づき、前記画像に対する処理を実行する
ことを特徴とする画像処理装置。
An image input unit for reading a document and inputting an image of the document, and a control unit,
The control unit
When the document input by the image input unit is oblique, processing is performed on each side of the image based on the distribution of pixel values of pixels included in a rectangular area having pixels constituting the side as one side. An image processing device characterized by:
前記制御部は、
前記分布に基づき、前記原稿の色と、当該原稿が読み取られるときにおける当該原稿の背面の部材の色とが異なるか否かを判定し、
前記原稿の色と、前記背面の部材の色とが異なる場合、前記処理を実行する
ことを特徴とする請求項1に記載の画像処理装置。
The control unit
determining whether the color of the document differs from the color of the member on the back of the document when the document is read, based on the distribution;
2. The image processing apparatus according to claim 1, wherein the processing is executed when the color of the document and the color of the member on the back surface are different.
前記制御部は、前記原稿の色と、前記背面の部材の色とが異ならない場合は、前記処理を実行しないことを特徴とする請求項2に記載の画像処理装置。 3. The image processing apparatus according to claim 2, wherein the control unit does not execute the processing when the color of the document and the color of the back member do not differ. 前記画像入力部は、前記原稿の外側の部分も含めて読み取り、
前記制御部は、前記分布を、前記原稿の外側の部分を切り出した画像の各辺において当該辺を構成する画素を一辺とした矩形領域に含まれる画素の画素値の分布とする
ことを特徴とする請求項1から3の何れか一項に記載の画像処理装置。
The image input unit reads the document including the outer portion,
The control unit is characterized in that the distribution is a distribution of pixel values of pixels included in a rectangular area of which one side is a pixel composing each side of an image obtained by cutting out an outer portion of the document. The image processing apparatus according to any one of claims 1 to 3.
前記処理は、前記画像から前記原稿の境界線に生じるエッジを削除する処理であることを特徴とする請求項1から4の何れか一項に記載の画像処理装置。 5. The image processing apparatus according to any one of claims 1 to 4, wherein the process is a process of deleting an edge generated on a boundary line of the document from the image. 前記処理は、前記画像において、エッジが3画素以上現れる行の数に基づき、前記原稿が無地であるか否かを判定する処理であることを特徴とする請求項1から4の何れか一項に記載の画像処理装置。 5. The processing according to any one of claims 1 to 4, wherein the processing determines whether or not the document is plain based on the number of lines in which edges appear in three or more pixels in the image. The image processing device according to . 原稿を読み取って当該原稿の画像を入力する画像処理装置の制御方法であって、
前記原稿が斜めである場合、前記画像の各辺において当該辺を構成する画素を一辺とした矩形領域に含まれる画素の画素値の分布に基づき、前記画像に対する処理を実行するステップ
を含むことを特徴とする制御方法。
A control method for an image processing device that reads an original and inputs an image of the original, comprising:
performing processing on each side of the image based on a distribution of pixel values of pixels included in a rectangular area having pixels constituting the side as one side when the document is slanted. Characterized control method.
原稿を読み取って当該原稿の画像を入力する画像処理装置のコンピュータに、
前記原稿が斜めである場合、前記画像の各辺において当該辺を構成する画素を一辺とした矩形領域に含まれる画素の画素値の分布に基づき、前記画像に対する処理を実行する機能
を実現させることを特徴とするプログラム。
In the computer of the image processing device that reads the document and inputs the image of the document,
When the document is slanted, each side of the image is processed on the basis of the pixel value distribution of the pixels included in the rectangular area with the pixels forming the side as one side. A program characterized by
JP2021121906A 2021-07-26 2021-07-26 Image processing device, control method, and program Pending JP2023017562A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2021121906A JP2023017562A (en) 2021-07-26 2021-07-26 Image processing device, control method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2021121906A JP2023017562A (en) 2021-07-26 2021-07-26 Image processing device, control method, and program

Publications (1)

Publication Number Publication Date
JP2023017562A true JP2023017562A (en) 2023-02-07

Family

ID=85158020

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2021121906A Pending JP2023017562A (en) 2021-07-26 2021-07-26 Image processing device, control method, and program

Country Status (1)

Country Link
JP (1) JP2023017562A (en)

Similar Documents

Publication Publication Date Title
US8494304B2 (en) Punched hole detection and removal
US8064721B2 (en) Method and apparatus for removing noise from a digital image
US7773776B2 (en) Image processing apparatus, image forming apparatus, image reading process apparatus, image processing method, image processing program, and computer-readable storage medium
JP4912270B2 (en) Image processing apparatus and control method thereof
US10999473B2 (en) Image processing apparatus, image processing method, and recording medium to correct characteristic amount of target pixel using brightness at two pixels in set target area
US8345310B2 (en) Halftone frequency determination method and printing apparatus
JP2005318593A (en) Reformatting of image data for further compressed image data size
US9565338B2 (en) Image processing apparatus, method, and medium to perform image smoothing and brightness correction to remove show through
JP2006025139A (en) Image processor, image processing method and program
US20060152765A1 (en) Image processing apparatus, image forming apparatus, image reading process apparatus, image processing method, image processing program, and computer-readable storage medium
JP4502001B2 (en) Image processing apparatus and image processing method
JP2023017562A (en) Image processing device, control method, and program
CN101610340B (en) Image processing method and image processing apparatus
JP4861506B2 (en) Image processing apparatus and control method thereof
JP6558094B2 (en) Image processing apparatus and computer program
US7418138B2 (en) Image processor for and method of performing tonal transformation on image data
JP7531374B2 (en) Image processing device, control method and program
JP6681033B2 (en) Image processing device
JP4084537B2 (en) Image processing apparatus, image processing method, recording medium, and image forming apparatus
US12003685B2 (en) Image processing apparatus, control method, and non-transitory computer-readable medium
JP2011253068A (en) Image forming device and control method thereof
JP2023114852A (en) Image processing apparatus, image processing method, and program
CN102377895B (en) Image cropping method
JP2002290727A (en) Image processing method, its apparatus, its storage medium, and its program
JP2023114848A (en) Image processing apparatus, image processing method, and program