JP2019050466A - Image reader image reading program - Google Patents

Image reader image reading program Download PDF

Info

Publication number
JP2019050466A
JP2019050466A JP2017172821A JP2017172821A JP2019050466A JP 2019050466 A JP2019050466 A JP 2019050466A JP 2017172821 A JP2017172821 A JP 2017172821A JP 2017172821 A JP2017172821 A JP 2017172821A JP 2019050466 A JP2019050466 A JP 2019050466A
Authority
JP
Japan
Prior art keywords
edge
scanning direction
reading
image
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
JP2017172821A
Other languages
Japanese (ja)
Inventor
謙太郎 岩塚
Kentaro Iwatsuka
謙太郎 岩塚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Brother Industries Ltd
Original Assignee
Brother Industries Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Brother Industries Ltd filed Critical Brother Industries Ltd
Priority to JP2017172821A priority Critical patent/JP2019050466A/en
Publication of JP2019050466A publication Critical patent/JP2019050466A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

To provide an image reader and image reading program, capable of preventing an image reading section from moving excessively from a right end of a spread document to a region in which no document exists.SOLUTION: An image reader 1 includes an original platen 2, a reading section 4, a driving section 5, an edge image formation section 103 and a control section 90. The control section 90 executes reading processing (S3-S7), edge determination processing (S201 and S205-S209), concentration determination processing (S301 and S304-S306) and movement stopping processing (S215) which makes the driving section stop the reading section when the concentration determination processing determines a percentage of a concentration determination object range to total pixel number is at least a third threshold value.SELECTED DRAWING: Figure 7

Description

本発明は、画像読取装置、及び画像読取プログラムに関する。   The present invention relates to an image reading apparatus and an image reading program.

従来、特許文献1に記載の通り、コンタクトガラスの下方に設けられた複数の光学センサの検出結果に基づいて、コンタクトガラス上に載置された原稿の用紙長さを検出し、画像読取部への入射光に基づいて原稿の用紙幅を検出し、検出された用紙長さ及び用紙幅の原稿サイズの画像データを、画像読取部に読み取らせる画像読取装置が知られている。   Conventionally, as described in Patent Document 1, based on the detection results of a plurality of optical sensors provided below the contact glass, the sheet length of the document placed on the contact glass is detected, and the image reading unit is detected. There is known an image reading apparatus which detects the sheet width of an original based on incident light and causes the image reading unit to read image data of an original size of the detected sheet length and sheet width.

特開2014−30078号公報JP, 2014-30078, A

特許文献1に記載された画像読取装置において、見開き原稿の各頁の画像をそれぞれ読み取り、各頁の画像データを管理する使い方が考えられる。   In the image reading apparatus described in Patent Document 1, it is conceivable to read the image of each page of the spread original and manage the image data of each page.

特許文献1に記載された画像読取装置において、コンタクトガラス上に見開き原稿を載置する場合、見開き原稿の中綴じ部が撓み、コンタクトガラス上に接する見開き原稿の左頁の左端から右頁の右端までの用紙長さ(左端から右端までの用紙長さ)は本来の用紙長さより短くなる。   In the image reading apparatus described in Patent Document 1, when placing a spread original on contact glass, the saddle-stitched portion of the spread original is bent and the left end of the left page of the spread original in contact with the contact glass is the right end of the right page. The paper length up to (paper length from the left end to the right end) is shorter than the original paper length.

上記画像読取装置において、ユーザが、見開き原稿を、見開き原稿の中綴じ部が主走査方向と平行となる向きに載置した場合、上記画像読取装置は、本来の用紙長さより長い定形サイズの用紙長さとして検出する。上記画像読取装置は、見開き原稿の画像を読み取るために、画像読取部を、原稿の左端から定形サイズの用紙長さまで副走査方向に移動させながら画像を読み取ることになり、画像読取部を原稿の右端において原稿が存在しない領域まで余分に移動させてしまう問題が発生する。   In the above image reading device, when the user places the double-page spread original in a direction in which the saddle-stitched part of the double-page spread original is parallel to the main scanning direction, the image reading device is a sheet of fixed size longer than the original sheet length. Detect as a length. The image reading apparatus reads an image while moving the image reading unit in the sub-scanning direction from the left end of the document to the sheet length of the fixed size in order to read the image of the double-page spread document. There is a problem that an extra portion is moved to the area where the document does not exist at the right end.

本発明は、上述した問題点を解決するためになされたものであり、画像読取部を見開き原稿の右端から原稿が存在しない領域まで余分に移動させることを防止可能な画像読取装置、及び画像読取プログラムを提供することができる。   The present invention has been made to solve the above-mentioned problems, and an image reading apparatus capable of preventing an extra movement from the right end of the image reading unit to the area where the document is not present, and the image reading unit The program can be provided.

上記目的を達成するために、請求項1に記載の発明態様では、画像読取装置は、原稿を支持する原稿台と、主走査方向に原稿のライン画像を読み取る読取部と、前記主走査方向と直交する副走査方向に、読取開始位置から読取終了位置に向けて前記読取部を移動させる駆動部と、前記読取部によって読み取られた前記ライン画像に係る画像データにエッジ強調処理を行い、エッジ画像データを生成するエッジ画像生成部と、制御部と、を備え、前記制御部は、前記駆動部に前記副走査方向の前記読取開始位置から前記読取終了位置に向けて前記読取部を移動させながら、前記読取部に前記ライン画像を読み取らせる読取処理と、前記エッジ画像生成部により生成された前記エッジ画像データから、前記副走査方向に複数の画素および前記主走査方向に複数の画素からなるエッジ判断対象範囲のエッジ画素値を取得し、取得した前記エッジ判断対象範囲の前記エッジ画素値について、前記副走査方向に沿った前記複数の画素に係る前記エッジ画素値のいずれかが第1閾値以上であるか否かの判断を、前記主走査方向に沿った前記複数の画素毎に行うエッジ判断処理と、前記エッジ判断処理により、前記主走査方向に沿った前記複数の画素全てにおいて、前記副走査方向に沿った前記複数の画素に係る前記エッジ画素値のいずれかが第1閾値以上であると判断した場合、前記画像データのうち前記エッジ判断対象範囲に対応する位置よりも前記副走査方向において前記読取終了位置に近い画像データから、前記副走査方向に複数の画素および前記主走査方向に複数の画素からなる濃度判断対象範囲の画素値を取得し、取得した前記濃度判断対象範囲の前記画素値について、前記画素値の取り得る最小値及び最大値を除いて第2閾値以下である画素値となる前記濃度判断対象範囲の全画素数に対応する割合が第3閾値以上であるか否かの判断を行う濃度判断処理と、前記濃度判断処理により、前記割合が前記第3閾値以上であると判断した場合、前記駆動部に前記副走査方向に移動している前記読取部を停止させる移動停止処理と、を実行する。   In order to achieve the above object, according to the first aspect of the present invention, an image reading apparatus comprises: a document holder for supporting a document; a reading unit for reading a line image of the document in the main scanning direction; An edge emphasizing process is performed on image data relating to the line image read by the reading unit and a driving unit that moves the reading unit from the reading start position to the reading end position in the sub scanning direction orthogonal to each other; The control unit includes an edge image generation unit that generates data, and a control unit, and the control unit causes the drive unit to move the reading unit from the reading start position in the sub scanning direction toward the reading end position. A reading process for causing the reading unit to read the line image, and a plurality of pixels and the main running in the sub scanning direction from the edge image data generated by the edge image generating unit The edge pixel value of the edge determination target range including a plurality of pixels in the direction is acquired, and the edge pixel value of the plurality of pixels along the sub-scanning direction is acquired for the acquired edge pixel value of the edge determination target range Edge determination processing for determining whether any one of the plurality of pixels is greater than or equal to the first threshold value for each of the plurality of pixels along the main scanning direction; If it is determined that any one of the edge pixel values of the plurality of pixels along the sub scanning direction is equal to or greater than the first threshold value in all the plurality of pixels, the image data corresponds to the edge determination target range From the image data closer to the reading end position in the sub scanning direction than the scanning position, the density determination including a plurality of pixels in the sub scanning direction and a plurality of pixels in the main scanning direction A pixel value of a target range is acquired, and the concentration judgment target which becomes a pixel value equal to or less than a second threshold except for the obtainable minimum value and the maximum value of the pixel value of the acquired concentration judgment target range When it is determined that the ratio is equal to or more than the third threshold value by the density determination process of determining whether the ratio corresponding to the total number of pixels in the range is equal to or more than the third threshold value; And moving stop processing for causing the drive unit to stop the reading unit moving in the sub scanning direction.

本発明態様によれば、原稿トレイに支持された原稿を自動的に搬送して読み取る画像読取装置において、制御部が移動停止処理を実行することにより、画像読取部を見開き原稿の右端から見開き原稿が存在しない領域まで余分に移動させることを防止可能である。   According to the aspect of the present invention, in the image reading apparatus which automatically conveys and reads the document supported by the document tray, the control unit executes the movement stop process to open the document from the right end of the image reading unit It is possible to prevent extra movement to an area where there is no

請求項2に記載の具体的態様では、制御部は、前記エッジ判断処理により、前記主走査方向に沿った前記複数の画素のうち少なくとも1つ以上の画素において、前記副走査方向に沿った前記複数の画素全てにそれぞれ係る全ての前記エッジ画素値が第1閾値未満であると判断した場合、前記エッジ判断対象範囲から前記副走査方向の前記読取終了位置に向かって所定数の画素まで離れたエッジ判断対象範囲を新たなエッジ判断対象範囲として前記エッジ判断処理を再度実行するエッジ判断制御処理と、前記濃度判断処理により、前記割合が前記第3閾値未満であると判断した場合、前記エッジ判断対象範囲に対応する位置から前記副走査方向の前記読取終了位置に向かって所定数の画素まで離れた位置を新たなエッジ判断対象範囲に対応する位置として前記濃度判断処理を再度実行する濃度判断制御処理と、を実行する。   According to a specific aspect of the present invention, the control unit is configured to execute the edge determination processing in at least one or more pixels among the plurality of pixels along the main scanning direction along the sub scanning direction. When it is determined that all the edge pixel values related to all the plurality of pixels are less than the first threshold value, a predetermined number of pixels are separated from the edge determination target range toward the reading end position in the sub scanning direction When it is determined that the ratio is less than the third threshold value by the edge determination control processing of re-executing the edge determination processing with the edge determination target range as a new edge determination target range and the density determination processing, the edge determination A position away from a position corresponding to the target range to a predetermined number of pixels toward the reading end position in the sub scanning direction corresponds to a new edge determination target range And density determination control process for executing the concentration determination process as location again, to run.

制御部が、エッジ判断制御処理および濃度判断制御処理を実行することにより、例えば、先回のエッジ判断処理の結果、主走査方向に沿った複数の画素のうち少なくとも1つ以上の画素において、副走査方向に沿った複数の画素全てにそれぞれ係る全てのエッジ画素値が第1閾値未満であると判断した場合、または先回の濃度判断処理の結果、濃度判断対象範囲の画素値について、画素値の取り得る最小値及び最大値を除いて第2閾値以下である画素値となる濃度判断対象範囲の全画素数に対応する割合が第3閾値未満である場合であっても、移動停止処理の実行を可能にする。   The control unit executes the edge determination control process and the density determination control process, for example, as a result of the previous edge determination process, at least one of the plurality of pixels along the main scanning direction as a result of the edge determination process. When it is determined that all edge pixel values pertaining to all the plurality of pixels along the scanning direction are less than the first threshold, or as a result of the previous density determination processing, pixel values for pixel values in the density determination target range Of the movement stop process even if the ratio corresponding to the total number of pixels in the density determination target range which is a pixel value equal to or less than the second threshold except for the possible minimum value and maximum value is less than the third threshold Make it possible to do it.

請求項3に記載の具体的態様では、制御部は、前記読取処理の開始後、前記エッジ画像データにおける前記原稿の先端エッジまたは側端エッジを検出することにより前記原稿の主走査原稿幅および前記原稿の主走査原稿傾きを決定する原稿決定処理を実行し、前記エッジ判断対象範囲は、前記制御部により前記主走査原稿幅に基づいて決められる前記主走査方向に複数の画素および前記主走査原稿幅と前記主走査原稿傾きとに基づいて決められる前記副走査方向に複数の画素からなる範囲であり、前記新たなエッジ判断対象範囲は、前記エッジ判断対象範囲から前記副走査方向の前記読取終了位置に向かって1つの画素まで離れたエッジ判断対象範囲である。   According to a specific aspect of the present invention, after the start of the reading process, the control unit detects the leading edge or the side edge of the document in the edge image data to thereby detect the main scanning document width of the document and An original determination process for determining the main scanning original inclination of the original is executed, and the edge determination target range is determined by the control unit based on the main scanning original width and a plurality of pixels in the main scanning direction and the main scanning original It is a range consisting of a plurality of pixels in the sub scanning direction determined based on the width and the main scanning document inclination, and the new edge determination target range is the end of reading in the sub scanning direction from the edge determination target range This is an edge determination target range separated by one pixel toward the position.

制御部が原稿決定処理を実行し、エッジ判断対象範囲を主走査原稿幅に基づいて決められる主走査方向に複数の画素および主走査原稿幅と、主走査原稿傾きと、に基づいて決められる副走査方向に複数の画素からなる範囲とし、新たなエッジ判断対象範囲をエッジ判断対象範囲から副走査方向の読取終了位置に向かって1つの画素まで離れたエッジ判断対象範囲とすることにより、原稿が主走査方向に対して傾いた場合であっても、主走査方向に沿った複数の画素全てにおいて、副走査方向に沿った複数の画素に係るエッジ画素値のいずれかが第1閾値以上となるので、エッジ取得判断処理における判断精度を向上することができる。   The control unit executes document determination processing, and the edge determination target range is determined based on the plurality of pixels in the main scanning direction determined based on the main scanning document width, the main scanning document width, and the main scanning document inclination. The original is determined by setting the range including a plurality of pixels in the scanning direction and setting the new edge determination target range as an edge determination target range separated from the edge determination target range to the reading end position in the sub scanning direction up to one pixel. Even when tilted with respect to the main scanning direction, one of the edge pixel values of a plurality of pixels along the sub-scanning direction is equal to or greater than the first threshold in all of the plurality of pixels along the main scanning direction. Therefore, the determination accuracy in the edge acquisition determination process can be improved.

請求項4に記載の具体的態様では、画像読取装置において、前記濃度判断対象範囲は、前記副走査方向の前記読取終了位置に向かう方向の前記原稿の側端部の前記原稿台に対する傾きおよび前記読取部の焦点深度に基づいて予め決められた前記副走査方向に複数の画素および前記主走査方向に複数の画素からなる範囲である。   According to a fourth aspect of the present invention, in the image reading apparatus, the density determination target range is an inclination of the side end portion of the document in the sub scanning direction toward the reading end position with respect to the document table It is a range including a plurality of pixels in the sub-scanning direction and a plurality of pixels in the main scanning direction which are predetermined based on the depth of focus of the reading unit.

濃度判断対象範囲が、原稿の側端部の原稿台に対する傾きおよび読取部の焦点深度に基づいて予め決められた副走査方向に複数の画素および主走査方向に複数の画素からなる範囲とすることにより、濃度判断対象範囲において、画素値の取り得る最小値及び最大値を除いて第2閾値以下である画素値となる画素数を増やし、濃度判断制御処理を実行することなく、濃度判断対象範囲の全画素数に対応する割合を第3閾値以上となる可能性を高め、移動停止処理を早期に実行する可能性を高めることができる。   The density judgment target range is a range consisting of a plurality of pixels in the sub-scanning direction and a plurality of pixels in the main scanning direction, which are determined in advance based on the inclination of the side edge of the document to the document table and the focal depth of the reading unit. In the density determination target range, the number of pixels having the pixel value equal to or less than the second threshold is increased except for the possible minimum and maximum values of the pixel value, and the density determination target range is performed without executing the density determination control process. It is possible to increase the possibility that the ratio corresponding to the total number of pixels of the pixel becomes equal to or higher than the third threshold, and to increase the possibility to execute the movement stopping process early.

請求項5に記載の具体的態様では、画像読取装置において、前記エッジ判断対象範囲は、前記エッジ解析画像データにおいて、前記主走査方向の1つの画素データである特定画素データを基準として、当該特定画素データから前記移動方向に前記エッジ副走査幅の範囲まで含まれる画素データで構成されたエッジ判断対象ブロックを1つの単位として、前記特定画素データから前記主走査原稿幅の範囲の画素データの数だけ前記主走査方向に沿って構成された複数の前記エッジ判断対象ブロックからなる範囲であり、前記エッジ判断処理は、前記エッジ判断対象ブロック毎に、前記エッジ画素データをそれぞれ取得し、前記取得されたエッジ画素データが、前記エッジ判断対象ブロック毎に前記第1閾値以上存在するか否かを全てのエッジ判断対象ブロックに対して判断し、前記エッジ判断制御処理は、前記エッジ判断処理の結果、前記全てのエッジ判断対象ブロックのうち、1つのエッジ判断対象ブロックにおいて、前記取得されたエッジ画素データが、前記第1閾値以上存在しないと判断した場合、前記特定画素データを前記移動方向に所定数の画素データだけ離れた画素データを新たな特定画素データとして前記エッジ判断処理を再度実行する。   In a specific aspect according to claim 5, in the image reading apparatus, the edge determination target range is specified based on specific pixel data which is one pixel data in the main scanning direction in the edge analysis image data. The number of pixel data in the range from the specific pixel data to the main scanning document width from the pixel data to the edge determination target block composed of pixel data from the pixel data to the movement direction and including the range of the edge sub-scanning width in one unit The edge determination process is a range including a plurality of the edge determination target blocks configured along the main scanning direction, and the edge determination process acquires the edge pixel data for each of the edge determination target blocks, and acquires the edge pixel data. All edge judgments are made as to whether or not the edge pixel data exists for each of the edge judgment target blocks at least the first threshold value. The edge judgment control processing determines that the edge pixel data acquired in the one edge judgment target block among the all the edge judgment target blocks is the edge pixel data obtained as a result of the edge judgment processing. If it is determined that the first threshold value or more does not exist, the edge determination process is performed again using pixel data in which the specific pixel data is separated by a predetermined number of pixel data in the movement direction as new specific pixel data.

制御部が、全てのエッジ判断対象ブロックで、各エッジ判断対象ブロックにエッジ画素データが第1閾値以上存在しないと判断した後、新たな特定画素データを基準としてエッジ判断処理を実行する場合より、早期に読取制御処理の実行後、エッジ判断処理を実行することができる。   After the control unit determines that edge pixel data does not exist in each edge determination target block for all edge determination target blocks, the edge determination process is performed based on new specific pixel data, Edge determination processing can be performed after execution of the read control processing at an early stage.

請求項6に記載の具体的態様では、画像読取装置において、前記読取部は、前記主走査方向のライン毎に原稿の画像を読み取り、前記エッジ画像生成部は、前記主走査方向のライン毎に、前記解析画像データに対してエッジ強調処理を行い、前記主走査方向のライン毎に、画素単位で各画素の画素値が所定の閾値以上となる画素をエッジ画素としてエッジ画像データを生成し、前記主走査方向のライン数をカウントするラインカウンタを備え、前記制御部は、前記原稿決定処理によって決定された主走査原稿幅に基づいて、前記主走査方向の特定ラインのライン数を決定する特定ライン決定処理と、前記ラインカウンタによってカウントされた前記主走査方向のライン数が前記特定ラインのライン数と等しいか否かを判断するライン数判断処理と、を実行し、前記ライン数判断処理の結果、前記カウントされた主走査方向のライン数が前記特定ラインのライン数と等しいと判断した場合、前記特定ラインにおける特定画素を基準として前記エッジ取得判断処理を実行する。   According to a specific aspect of the present invention, in the image reading apparatus, the reading unit reads an image of a document for each line in the main scanning direction, and the edge image generator for each line in the main scanning direction. Edge enhancement processing is performed on the analysis image data, and edge image data is generated with an edge pixel as a pixel having a pixel value of each pixel equal to or more than a predetermined threshold in pixel units, for each line in the main scanning direction. The control unit may include a line counter that counts the number of lines in the main scanning direction, and the control unit may determine the number of lines in the main scanning direction based on the main scanning document width determined by the original determination process. Line determination processing and line number determination processing for determining whether the number of lines in the main scanning direction counted by the line counter is equal to the number of lines of the specific line And when it is determined that the counted number of lines in the main scanning direction is equal to the number of lines of the specific line, the edge acquisition is performed based on the specific pixel in the specific line. Execute judgment processing.

制御部が、ライン数判断処理を実行することにより、原稿に記載された情報によってエッジ取得判断処理で生じる誤判断を防止することができる。   When the control unit executes the line number determination process, it is possible to prevent an erroneous determination that occurs in the edge acquisition determination process based on the information described in the document.

請求項7に記載の具体的態様では、画像読取装置は、画像データを所定の出力範囲で出力する画像出力部を備え、前記制御部は、前記読取終了処理の実行後、前記ラインカウンタによってカウントされた読取終了ラインのライン数を記憶する読取終了ライン記憶処理と、前記エッジ画像データにおいて前記原稿の後端エッジを検出する後端エッジ検出処理と、前記検出された原稿の後端エッジおよび前記読取終了ラインのライン数に基づいて、前記後端エッジのライン数を決定する後端ライン決定処理と、前記後端エッジに基づいて、前記読取部によって読み取られた画像データを抽出する画像抽出処理と、前記主走査原稿幅に基づいて、前記出力範囲を決定する出力範囲決定処理と、前記特定ラインおよび前記後端エッジのライン数に基づいて、前記抽出された読取画像データを、前記決定された出力範囲内に配置する画像出力処理と、を実行する。   According to a specific aspect of the present invention, the image reading apparatus comprises an image output unit for outputting image data in a predetermined output range, and the control unit counts the line counter after execution of the reading end processing. Reading end line storing processing for storing the number of read end lines, rear end edge detecting processing for detecting the rear end edge of the original in the edge image data, rear end edge of the detected original, and Rear end line determination processing of determining the number of lines of the rear end edge based on the number of reading end lines, and image extraction processing of extracting image data read by the reading unit based on the rear end edge And an output range determination process of determining the output range based on the main scanning document width, and based on the number of lines of the specific line and the rear end edge. Te, the scanned image data the extracted, and the image output process of placing in the output range the determined, to run.

制御部が、画像出力処理を実行することにより、読取画像を出力範囲における主走査方向の中心に配置することができる。   The control unit can arrange the read image at the center of the output range in the main scanning direction by executing the image output process.

請求項8に記載の発明態様では、画像読取プログラムは、原稿を支持する原稿台と、主走査方向に原稿のライン画像を読み取る読取部と、前記主走査方向と直交する副走査方向に、読取開始位置から読取終了位置に向けて前記読取部を移動させる駆動部と、前記読取部によって読み取られた前記ライン画像に係る画像データにエッジ強調処理を行い、エッジ画像データを生成するエッジ画像生成部と、を備える画像読取装置の制御部が、実行する画像読取プログラムであって、前記駆動部に前記副走査方向の前記読取開始位置から前記読取終了位置に向けて前記読取部を移動させながら、前記読取部に前記ライン画像を読み取らせる読取処理と、前記エッジ画像生成部により生成された前記エッジ画像データから、前記副走査方向に複数の画素および前記主走査方向に複数の画素からなるエッジ判断対象範囲のエッジ画素値を取得し、取得した前記エッジ判断対象範囲の前記エッジ画素値について、前記副走査方向に沿った前記複数の画素に係る前記エッジ画素値のいずれかが第1閾値以上であるか否かの判断を、前記主走査方向に沿った前記複数の画素毎に行うエッジ判断処理と、前記エッジ判断処理により、前記主走査方向に沿った前記複数の画素全てにおいて、前記副走査方向に沿った前記複数の画素に係る前記エッジ画素値のいずれかが第1閾値以上であると判断した場合、前記画像データのうち前記エッジ判断対象範囲に対応する位置よりも前記副走査方向において前記読取終了位置に近い画像データから、前記副走査方向に複数の画素および前記主走査方向に複数の画素からなる濃度判断対象範囲の画素値を取得し、取得した前記濃度判断対象範囲の前記画素値について、前記画素値の取り得る最小値及び最大値を除いて第2閾値以下である画素値となる前記濃度判断対象範囲の全画素数に対応する割合が第3閾値以上であるか否かの判断を行う濃度判断処理と、前記濃度判断処理により、前記割合が前記第3閾値以上であると判断した場合、前記駆動部に前記副走査方向に移動している前記読取部を停止させる移動停止処理と、
を実行する画像読取プログラム。
In the aspect of the invention according to claim 8, the image reading program reads in a sub scanning direction orthogonal to the main scanning direction, a reading unit for reading a line image of the document in a main scanning direction, a document table supporting the document A driving unit that moves the reading unit from a start position to a reading end position, and an edge image generation unit that performs edge enhancement processing on image data related to the line image read by the reading unit and generates edge image data And an image reading program executed by the control unit of the image reading apparatus, wherein the driving unit moves the reading unit from the reading start position in the sub scanning direction to the reading end position. A reading process for causing the reading unit to read the line image, and a plurality of images in the sub-scanning direction from the edge image data generated by the edge image generation unit And acquiring an edge pixel value of an edge determination target range including a plurality of pixels in the main scanning direction, and regarding the edge pixel value of the acquired edge determination target range, the plurality of pixels in the sub scanning direction The main scanning direction is determined by an edge determining process for determining whether any one of the edge pixel values is equal to or more than a first threshold value for each of the plurality of pixels along the main scanning direction, and the edge determining process. When it is determined that any one of the edge pixel values of the plurality of pixels along the sub-scanning direction is equal to or greater than a first threshold value in all of the plurality of pixels along the sub-scanning direction, the edge determination among the image data From the image data closer to the reading end position in the sub scanning direction than the position corresponding to the target range, a plurality of pixels in the sub scanning direction and a plurality of images in the main scanning direction The pixel value of the density determination target range consisting of is obtained, and the obtained pixel value of the density determination target range becomes a pixel value equal to or less than the second threshold except for the minimum value and the maximum value that can be taken of the pixel value. Judgment that the ratio is equal to or more than the third threshold value by the concentration judgment process of judging whether the ratio corresponding to the total number of pixels of the concentration judgment target range is equal to or more than the third threshold value Moving stop processing for causing the drive unit to stop the reading unit moving in the sub-scanning direction;
An image reading program that executes

本発明態様によれば、原稿トレイに支持された原稿を自動的に搬送して読み取る画像読取装置の制御部が実行する画像読取プログラムにおいて、送信制御処理を実行することにより、特定原稿以外の原稿の読取画像がユーザの意図しない画像送信先へ送信されることを防止可能である。   According to the aspect of the present invention, in the image reading program executed by the control unit of the image reading apparatus which automatically conveys and reads the document supported on the document tray, the document other than the specific document is executed by executing the transmission control process. Can be prevented from being transmitted to an image transmission destination not intended by the user.

本発明によれば、画像読取部を見開き原稿の右端から見開き原稿が存在しない領域まで余分に移動させることを防止可能な画像読取装置、及び画像読取プログラムを提供することができる。   According to the present invention, it is possible to provide an image reading apparatus and an image reading program that can prevent extra movement from the right end of the image reading unit to the area where the spread document is not present.

本実施形態の複合機1の概略断面図である。1 is a schematic cross-sectional view of a multifunction machine 1 of the present embodiment. 図2(A)は、本実施形態の複合機1の上面図である。図2(B)は、本実施形態の複合機1の原稿載置面2aに載置された見開き原稿BKの左端部BLAを前後方向から見た俯瞰図である。FIG. 2A is a top view of the multifunction device 1 of the present embodiment. FIG. 2B is a bird's-eye view of the left end portion BLA of the spread original BK placed on the original placement surface 2a of the multifunction machine 1 according to the present embodiment as viewed from the front and rear direction. 図3(A)は、本実施形態の複合機1の電気的構成を概略的に示すブロック図である。図3(B)は、本実施形態の複合機1が備える画像処理部94の電気的構成を概略的に示すブロック図である。FIG. 3A is a block diagram schematically showing an electrical configuration of the multifunction machine 1 of the present embodiment. FIG. 3B is a block diagram schematically showing an electrical configuration of the image processing unit 94 provided in the multifunction machine 1 of the present embodiment. 本実施形態の複合機1による判断開始ライン決定処理で用いられるテーブルを示す図である。It is a figure which shows the table used by the judgment start line determination process by the multifunctional device 1 of this embodiment. 本実施形態の複合機1によるメイン処理を示すフローチャートである。5 is a flowchart showing main processing by the MFP 1 of the present embodiment. 本実施形態の複合機1による原稿決定処理を示すフローチャートである。5 is a flowchart showing an original determination process by the MFP 1 of the present embodiment. 本実施形態の複合機1による読取終了判断処理を示すフローチャートである。5 is a flowchart showing a reading end determination process by the MFP 1 of the present embodiment. 本実施形態の複合機1による読取終了判断処理のサブルーチン処理を示すフローチャートである。5 is a flowchart showing a subroutine process of reading end determination processing by the MFP 1 of the present embodiment. 本実施形態の複合機1による画像出力処理を示すフローチャートである。5 is a flowchart showing image output processing by the MFP 1 of the present embodiment. 図10(A)は、本実施形態の原稿決定処理が実行されるエッジ画像データを概略的に説明する図である。図10(B)は、本実施形態の複合機1の原稿載置面2aに載置された見開き原稿BKの右端部BRAを前後方向から見た俯瞰図である。図10(C)は、本実施形態の複合機1によって取得されたエッジ画素値及び濃度画素値に対する副走査方向のライン数の関係を示す説明図である。FIG. 10A is a diagram schematically illustrating edge image data for which the document determination process of the present embodiment is performed. FIG. 10B is a bird's-eye view of the right end portion BRA of the spread original BK placed on the original placement surface 2a of the multifunction device 1 of the present embodiment as viewed from the front and rear direction. FIG. 10C is an explanatory view showing the relationship between the number of lines in the sub-scanning direction and the edge pixel value and the density pixel value acquired by the multifunction device 1 of the present embodiment. 図11は、本実施形態の複合機1によって実行される読取終了判断処理を概略的に説明する図である。FIG. 11 is a diagram schematically illustrating the reading end determination process performed by the multifunction device 1 according to the present embodiment. 図12は、本実施形態の複合機1によって実行される画像出力処理を概略的に説明する図である。FIG. 12 is a diagram schematically illustrating an image output process performed by the multifunction machine 1 according to the present embodiment.

以下、本発明を具体化した実施例について図面を参照しつつ説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

<実施形態>
以下、本実施形態の複合機1は、本発明の複合機の具体的態様の一例である。まず、図1及び図2を参照しつつ、複合機1の構成について説明する。図1及び図2において、前後、左右及び上下の各方向を表示する。図2に示す各方向は、全て図1に示す各方向に対応させて表示する。また、図9に示す各方向についても、全て図1に示す各方向に対応させて表示する。
Embodiment
Hereinafter, the multifunction peripheral 1 of the present embodiment is an example of a specific aspect of the multifunction peripheral of the present invention. First, the configuration of the multifunction device 1 will be described with reference to FIGS. 1 and 2. In FIG. 1 and FIG. 2, the front, rear, left, right, upper and lower directions are displayed. Each direction shown in FIG. 2 is displayed corresponding to each direction shown in FIG. Further, each direction shown in FIG. 9 is also displayed corresponding to each direction shown in FIG.

[複合機の外観構成]
複合機1は、図1に示すように、プラテンガラス2、カバー部3、読取部4、及び駆動部5などを備えている。プラテンガラス2は、複合機1の直方体形状の筐体11の上部に形成された開口11aを、筐体11の内側から閉塞している。プラテンガラス2の上面において、開口11aから露出している部分は、読取対象の見開き原稿BKが載置される原稿載置面2aを構成する。カバー部3は、その一端部が筐体11の上面に回動可能に支持されており、原稿載置面2aを覆う閉位置(図1の破線で示す位置)と原稿載置面2aを露出させる開位置(図1の実線で示す位置)とを取り得る。なお、図2(A)は、カバー部3が開位置にある状態で複合機1を上方から見たときの読取部4の位置を示すものであり、原稿載置面2aの上方に位置するカバー部3と駆動部5の図示は省略している。
[Appearance configuration of MFP]
As shown in FIG. 1, the multifunction device 1 includes a platen glass 2, a cover 3, a reading unit 4, and a driving unit 5. The platen glass 2 closes an opening 11 a formed in the upper portion of the rectangular parallelepiped housing 11 of the multifunction machine 1 from the inside of the housing 11. A portion of the upper surface of the platen glass 2 exposed from the opening 11a constitutes a document placement surface 2a on which the spread document BK to be read is placed. One end of the cover portion 3 is rotatably supported on the upper surface of the housing 11, and a closed position (position indicated by a broken line in FIG. 1) covering the document placement surface 2a and the document placement surface 2a are exposed. And an open position (indicated by a solid line in FIG. 1). FIG. 2A shows the position of the reading unit 4 when the MFP 1 is viewed from above with the cover 3 in the open position, and is positioned above the document placement surface 2a. Illustration of the cover part 3 and the drive part 5 is omitted.

見開き原稿BKは、図2(A)に示すように、見開き中央の中心線CL(一点鎖線)を基準として、左方に左頁BKL、右方に右頁BKRを有する。左頁BKLは、左方の頁端部に左端部BLA(左頁BKLの二点鎖線で囲まれた範囲)を有し、右頁BKRは、右方の頁端部に右端部BRA(右頁BKRの二点鎖線で囲まれた範囲)を有する。具体的には、左端部BLAは、図2(B)に示すように、原稿載置面2a上に接する左頁BKLの1頁目から上方に積み上がった最終頁目までの左方の頁端部(左頁BKLの二点鎖線で囲まれた範囲)である。右端部BRAは、左端部BLAと同様に、原稿載置面2a上に接する右頁BKRの1頁目から上方に積み上がった最終頁までの右方の頁端部(図2(B)において図示省略)である。   As shown in FIG. 2A, the spread original BK has a left page BKL on the left and a right page BKR on the right with reference to a center line CL (one-dot chain line) at the center of the spread. The left page BKL has a left edge BLA (a range surrounded by a two-dot chain line on the left page BKL) at the left page edge, and the right page BKR has a right edge BRA (right page) at the right page edge. The page BKR has a range enclosed by a two-dot chain line). Specifically, as shown in FIG. 2B, the left end BLA is a left page from the first page of the left page BKL in contact with the original placement surface 2a to the final page stacked upward. It is an end (a range surrounded by a two-dot chain line on the left page BKL). The right end portion BRA is the same as the left end portion BLA in the right side page end portion (FIG. 2B) from the first page of the right page BKR in contact with the document placement surface 2a to the final page stacked upward. Not shown).

図1及び図2(A)に示すように、原稿載置面2a上の左後方に筐体11の開口11aによって構成された位置合わせ壁部11bを設ける。位置合わせ壁部11bの左後方の端点は、図2(A)に示す見開き原稿BKの位置合わせ点Pである。ユーザは、原稿載置面2a上に見開き原稿BKを載置する際に、原稿載置面2aの上面に接する見開き原稿BKの見開き頁の左後方端部を位置合わせ壁部11bに突き当てることで、原稿載置面2a上の見開き原稿BKの位置合わせをすることができる。本実施形態では、図2(B)に示すように、ユーザが、左頁BKLの1頁目の左後方端部を位置あわせ点Pに合わせることで、見開き原稿BKが位置合わせされて載置されているものとする。   As shown in FIGS. 1 and 2A, an alignment wall 11b constituted by an opening 11a of the housing 11 is provided on the left rear side of the document placement surface 2a. The left rear end point of the alignment wall 11b is the alignment point P of the spread original BK shown in FIG. 2A. When placing the spread original BK on the original placement surface 2a, the user abuts the left rear end of the spread page of the spread original BK in contact with the upper surface of the original placement surface 2a against the alignment wall 11b. Thus, the spread original BK on the original placement surface 2a can be aligned. In this embodiment, as shown in FIG. 2B, the user opens the left rear end of the first page of the left page BKL to the alignment point P, whereby the spread original BK is aligned and placed. It shall be done.

読取部4及び駆動部5は、図1に示すように、筐体11の内部に配置されている。読取部4は、CIS(Contact Image Sensor)44、及びキャリッジ47で構成される。CIS44は、イメージセンサ41、光源43、及びロッドレンズアレイ45で構成され、キャリッジ47に搭載されている。なお、図2(A)に示す読取部4においては、イメージセンサ41のみを図示している。イメージセンサ41は、図示しない複数の受光素子が図2(A)に示す主走査方向(図2(A)の前後方向)に配列されたリニアイメージセンサである。光源43は、発光ダイオードなどで構成されており、プラテンガラス2に向けて光を出射する。ロッドレンズアレイ45は、光源43から出射され被照射物により反射された光線をイメージセンサ41の各受光素子(図示せず)に結像させる。これにより、被照射物の画像が主走査方向に1ライン分読み取られる。   The reading unit 4 and the drive unit 5 are disposed inside the housing 11 as shown in FIG. The reading unit 4 includes a CIS (Contact Image Sensor) 44 and a carriage 47. The CIS 44 includes an image sensor 41, a light source 43, and a rod lens array 45, and is mounted on the carriage 47. In the reading unit 4 shown in FIG. 2A, only the image sensor 41 is shown. The image sensor 41 is a linear image sensor in which a plurality of light receiving elements (not shown) are arrayed in the main scanning direction (front and back direction in FIG. 2A) shown in FIG. The light source 43 is configured of a light emitting diode or the like, and emits light toward the platen glass 2. The rod lens array 45 focuses the light beam emitted from the light source 43 and reflected by the irradiated object on each light receiving element (not shown) of the image sensor 41. Thereby, the image of the object to be irradiated is read by one line in the main scanning direction.

駆動部5は、図1に示すように、読取部4を主走査方向と直交する副走査方向(図1の左右方向)に移動させるものである。駆動部5は、正逆回転可能なモータ59によって駆動される駆動プーリ51と、従動プーリ53と、駆動プーリ51及び従動プーリ53に架け渡されたエンドレスのベルト55などで構成されている。駆動プーリ51は、筐体11の内部における副走査方向の一端側に配置され、一方で、従動プーリ53は、筐体11の内部における副走査方向の他端側に配置されている。ベルト55には、キャリッジ47が取り付けられており、駆動プーリ51(モータ59)の回転によりベルト55が移動することでキャリッジ47に搭載されたCIS44が副走査方向に往復移動できるように構成されている。   As shown in FIG. 1, the drive unit 5 moves the reading unit 4 in a sub-scanning direction (left and right direction in FIG. 1) orthogonal to the main scanning direction. The drive unit 5 includes a drive pulley 51 driven by a motor 59 capable of rotating in the forward and reverse directions, a driven pulley 53, and an endless belt 55 stretched around the drive pulley 51 and the driven pulley 53. The drive pulley 51 is disposed on one end side in the sub scanning direction inside the housing 11, while the driven pulley 53 is disposed on the other end side in the sub scanning direction inside the housing 11. A carriage 47 is attached to the belt 55, and the CIS 44 mounted on the carriage 47 can be reciprocated in the sub scanning direction by moving the belt 55 by rotation of the drive pulley 51 (motor 59). There is.

プラテンガラス2の左方には、図1に示す調整基準板13が配置されている。この調整基準板13は、副走査方向に並べられる白テープ13a及び黒テープ13bから構成されている。読取部4によって、白テープ13a及び黒テープ13bの画像は読み取られ、その画像データに対応する白画素から黒画素へ変化する位置、または黒画素から白画素へ変化する位置が、図1及び図2(A)に示す読取部4の待機位置HPである。待機位置HPは、読取部4の副走査方向移動における基準位置となる。CPU90(図3参照)は、複合機1に電源が投入された後、駆動部5によって読取部4を待機位置HPに待機させる。さらに、CPU90は、後述する読取処理を実行する前に、読取部4に白テープ13aの画像を読み取らせ、シェーディング補正で使用する白基準データの取得等の補正処理(以下、読取前補正処理と称す)を実行する。   An adjustment reference plate 13 shown in FIG. 1 is disposed on the left side of the platen glass 2. The adjustment reference plate 13 is composed of a white tape 13a and a black tape 13b arranged in the sub-scanning direction. The images on the white tape 13a and the black tape 13b are read by the reading unit 4, and the position at which the white pixel changes to black pixel or the position at which the black pixel changes to white pixel corresponding to the image data is shown in FIGS. It is a standby position HP of the reading unit 4 shown in 2 (A). The standby position HP is a reference position in the movement of the reading unit 4 in the sub scanning direction. The CPU 90 (see FIG. 3) causes the drive unit 5 to cause the reading unit 4 to stand by at the standby position HP after the MFP 1 is powered on. Furthermore, the CPU 90 causes the reading unit 4 to read the image of the white tape 13a before executing the reading process described later, and performs correction processing such as acquisition of white reference data used in shading correction (hereinafter referred to as pre-reading correction processing Execute).

CPU90は、後述する読取処理において、図1及び図2(A)に示す読取開始位置PSの位置で読取部4の光源43を点灯開始させる。CPU90は、読取部4を、読取開始位置PSから読取終了位置PEへ副走査方向に移動させながら、主走査方向に1ラインずつ画像を読み取る。以下に、読取開始位置PS、読取終了位置PEについて説明する。   The CPU 90 starts lighting of the light source 43 of the reading unit 4 at the position of the reading start position PS shown in FIGS. 1 and 2A in the reading process described later. The CPU 90 reads an image line by line in the main scanning direction while moving the reading unit 4 from the reading start position PS to the reading end position PE in the sub scanning direction. The reading start position PS and the reading end position PE will be described below.

読取開始位置PSは、図1及び図2(A)に示すように、読取部4が原稿載置面2aの左端に対向する位置である。読取終了位置PEは、図1及び図2(A)に示すように、読取部4が原稿載置面2aの右端に対向する位置である。なお、読取終了位置PEは、操作部7からユーザによって入力された見開き原稿BKの定形サイズ(A5判等の定形サイズ)に基づいて、CPU90が決定してもよい。   As shown in FIGS. 1 and 2A, the reading start position PS is a position at which the reading unit 4 faces the left end of the document placement surface 2a. As shown in FIGS. 1 and 2A, the reading end position PE is a position at which the reading unit 4 faces the right end of the document placement surface 2a. The reading end position PE may be determined by the CPU 90 based on a fixed size (a fixed size such as A5 size) of the double-page spread document BK input by the user from the operation unit 7.

複合機1の筐体11の前面には、液晶や有機EL等の表示部6、及びスタートキー、ストップキー、テンキー等の各種のボタンによって構成される操作部7が設けられている(図3(A)参照)。この表示部6及び操作部7により、複合機1の動作状況の表示やユーザによる操作の入力が可能となっている。なお、表示部6及び操作部7は、表示部6による表示機能、及び操作部7による入力機能を兼ね備えたタッチパネルであってもよい。後述する図3(A)に示す画像形成部10については、図示を省略する。   A display unit 6 such as a liquid crystal display and an organic EL, and an operation unit 7 including various buttons such as a start key, a stop key, and a numeric keypad are provided on the front surface of the housing 11 of the multifunction device 1 (FIG. 3) (A)). The display unit 6 and the operation unit 7 make it possible to display the operation status of the MFP 1 and to input an operation by the user. The display unit 6 and the operation unit 7 may be a touch panel having a display function by the display unit 6 and an input function by the operation unit 7. The image forming unit 10 shown in FIG. 3A described later is not shown.

[複合機の電気的構成]
本実施形態の複合機1の電気的構成について説明する。複合機1は、図3(A)に示すように、CPU(Central Processing Unit)90、ROM(Read Only Memory)92、RAM(Random Access Memory)93、画像処理部94、読取部4、及び駆動部5を構成の一部として備える。これらの構成要素は、バス9を介して、表示部6、操作部7、及び画像形成部10に接続される。
[Electric configuration of multifunction machine]
The electrical configuration of the multifunction device 1 according to the present embodiment will be described. As illustrated in FIG. 3A, the multifunction device 1 includes a central processing unit (CPU) 90, a read only memory (ROM) 92, a random access memory (RAM) 93, an image processing unit 94, a reading unit 4, and a drive. The unit 5 is provided as part of the configuration. These components are connected to the display unit 6, the operation unit 7, and the image forming unit 10 via the bus 9.

CPU90は、ROM92に記憶された制御プログラムに従って、複合機1の各部の制御を行う。ROM92には、後述する読取処理等の複合機1の各種動作を実行するためのプログラムを記憶する。   The CPU 90 controls each part of the multifunction device 1 in accordance with the control program stored in the ROM 92. The ROM 92 stores programs for executing various operations of the multifunction device 1 such as reading processing described later.

ROM92は、後述する読取処理における読取解像度、及びモノクロ読取(Green1色)またはカラー読取(RGB3色)等の読取設定に関する情報を記憶する。読取解像度は、600dpi、及び1200dpiのうちいずれかの読取解像度である。また、ROM92は、待機位置HPを基準として読取部4が読取開始位置PS及び読取終了位置PEまで移動するために必要な移動量を表すデータを記憶する。なお、読取設定は、操作部7からユーザによって入力された設定に基づいて、CPU90が決定してもよい。読取部4を構成するCIS44の主走査方向における解像度は、CPU90からの指示によって、600dpi、及び1200dpiのうち、いずれかの解像度に切替可能である。   The ROM 92 stores information relating to reading resolution in reading processing to be described later and reading settings such as monochrome reading (one green color) or color reading (three RGB colors). The reading resolution is any of 600 dpi and 1200 dpi. The ROM 92 also stores data representing the amount of movement required for the reading unit 4 to move to the reading start position PS and the reading end position PE with reference to the standby position HP. Note that the reading setting may be determined by the CPU 90 based on the setting input by the user from the operation unit 7. The resolution in the main scanning direction of the CIS 44 constituting the reading unit 4 can be switched to any resolution among 600 dpi and 1200 dpi according to an instruction from the CPU 90.

また、ROM92は、図4に示すように、見開き原稿の定形サイズを示すテーブルを記憶する。本実施形態では、見開き原稿の定形サイズを示すテーブルは、A6判、A5判、及びB5判毎に、図2(A)に示す1頁分の長辺幅LW及び1頁分の短辺幅SWを示すデータで構成されたテーブルとする。上記テーブルを構成するデータは、具体的には、A6判に対して、1頁分の長辺幅LWとして148mm、1頁分の短辺幅SWとして105mmにそれぞれ対応する画素数とする。A5判に対して、1頁分の長辺幅LWとして210mm、1頁分の短辺幅SWとして148mmにそれぞれ対応する画素数とする。B5判に対して、1頁分の長辺幅LWとして257mm、1頁分の短辺幅SWとして182mmにそれぞれ対応する画素数とする。本実施形態では、図4に示すように、A6判、A5判、及びB5判毎に、1頁分の長辺幅LW及び1頁分の短辺幅SWをそれぞれ300dpiの解像度における画素数とするテーブルとしてROM92に記憶する。   Further, as shown in FIG. 4, the ROM 92 stores a table indicating the standard size of the double-page spread original. In the present embodiment, the table showing the fixed size of the spread original is a long side width LW of one page and a short side width of one page shown in FIG. 2A for each of A6 size, A5 size and B5 size. It is a table composed of data indicating SW. More specifically, the data constituting the above-described table has the number of pixels corresponding to 148 mm as the long side width LW for one page and 105 mm as the short side width SW for one page with respect to A6 size. For the A5 size, the number of pixels corresponds to 210 mm as the long side width LW for one page, and to 148 mm as the short side width SW for one page. For the B5 size, the number of pixels corresponds to 257 mm as the long side width LW for one page, and to 182 mm as the short side width SW for one page. In the present embodiment, as shown in FIG. 4, the long side width LW for one page and the short side width SW for one page are respectively set for the number of pixels at a resolution of 300 dpi for each of A6 size, A5 size and B5 size. Are stored in the ROM 92 as a table to be stored.

画像処理部94は、画像処理専用のハード回路であり、図3(B)に示すように、画像加工処理部100、解像度変換部101、色変換部102、エッジ画像生成部103、及びカウンタ104を含んで構成されている。   The image processing unit 94 is a hardware circuit dedicated to image processing, and as shown in FIG. 3B, the image processing unit 100, the resolution conversion unit 101, the color conversion unit 102, the edge image generation unit 103, and the counter 104. Is composed including.

画像加工処理部100は、読取部4によって読み取られたRGB各色それぞれのラインデータに各種の画像加工処理を施し、RAM93に記憶する。画像加工処理は、例えば、画像データを90度等の所定角度に回転する回転処理や、画像データから所定範囲の画像を抽出する画像抽出処理等である。   The image processing unit 100 performs various image processing on the line data of each of the RGB colors read by the reading unit 4, and stores the line data in the RAM 93. The image processing process is, for example, a rotation process of rotating image data to a predetermined angle such as 90 degrees, an image extraction process of extracting an image in a predetermined range from image data, and the like.

解像度変換部101は、読取部4によって読み取られたRGB各色それぞれのラインデータに対し、公知の間引き処理により、300dpiの低解像度に変換する。解像度変換部101は、例えば、RGB各色それぞれのラインデータにおける先頭画素から最終画素までの全画素について設定された複数の間引き画素を間引く処理により、600dpiまたは1200dpiのラインデータから300dpiのラインデータへ変換する。解像度変換部101は、低解像度に変換したRGB各色それぞれのライン画像データを後述する濃度判断処理で判断するための濃度画像データとしてそれぞれRAM93に記憶する。   The resolution conversion unit 101 converts the line data of each of the RGB colors read by the reading unit 4 into a low resolution of 300 dpi by known thinning processing. The resolution conversion unit 101 converts 600 dpi or 1200 dpi line data into 300 dpi line data, for example, by thinning out a plurality of thinning pixels set for all pixels from the first pixel to the last pixel in line data of each RGB color. Do. The resolution conversion unit 101 stores the line image data of each of the RGB colors converted to the low resolution in the RAM 93 as density image data to be determined in the density determination processing described later.

色変換部102は、解像度変換部101によって低解像度に変換されたRGB各色それぞれのラインデータに対し、YCbCr変換やYIQ変換等の色変換処理を実行し、色ごとの輝度値や色差値などを示す色変換後データを生成する。   The color conversion unit 102 performs color conversion processing such as YCbCr conversion and YIQ conversion on the line data of each of the RGB colors converted to low resolution by the resolution conversion unit 101, and calculates luminance values and color difference values for each color. Generate data after color conversion to show.

エッジ画像生成部103は、色変換部102によって生成された色変換後データに対し、各種のエッジ強調処理を実行し、エッジ画像データを生成可能である。本実施形態では、エッジ画像生成部103は、公知の差分フィルタであるラプラシアンフィルタを用いるエッジ強調処理を実行するものとする。具体的には、エッジ画像生成部103は、色変換後データに対して、ラプラシアンフィルタ係数を適用して各画素のエッジ強度値を算出する。エッジ画像生成部103は、各画素の算出したエッジ強度値が予め定められたエッジ強度閾値以上であれば、「1」とし、エッジ強度閾値未満であれば、「0」としてエッジ強度値からエッジ画素値に置き換えてエッジ画像データを生成し、RAM93に記憶する。エッジ強度閾値は、例えば色変換後データに対応する画像上の線画像部分(例えば文字)の画素のエッジ強度値を「1」のエッジ画素値としてデータを置き換えできる程度の値である。   The edge image generation unit 103 can execute various types of edge enhancement processing on the data after color conversion generated by the color conversion unit 102 to generate edge image data. In this embodiment, the edge image generation unit 103 executes edge enhancement processing using a Laplacian filter, which is a known difference filter. Specifically, the edge image generation unit 103 applies the Laplacian filter coefficient to the data after color conversion to calculate an edge intensity value of each pixel. The edge image generation unit 103 sets “1” if the calculated edge strength value of each pixel is equal to or more than a predetermined edge strength threshold, and “0” if the calculated edge strength value is less than the edge strength threshold. The edge image data is generated by replacing the pixel value and stored in the RAM 93. The edge intensity threshold value is a value such that data can be replaced with an edge intensity value of a pixel of a line image portion (for example, a character) on an image corresponding to data after color conversion as an edge pixel value of “1”.

ラインカウンタ104は、エッジ画像生成部103からRAM93へ出力されるエッジ画像データのライン数をカウントする。ラインカウンタ104のカウント開始、カウント終了、及びカウントリセットは、CPU90からの指示により実行される。   The line counter 104 counts the number of lines of edge image data output from the edge image generation unit 103 to the RAM 93. The start of counting, the end of counting, and the counting reset of the line counter 104 are executed by an instruction from the CPU 90.

駆動部5は、駆動制御部54、ドライバ52、及びモータ59を含んで構成されている。駆動制御部54は、PWMによってドライバ52へパルス制御信号を送信してモータ59を回転させるためのハードウェアである。また、駆動制御部54は、ドライバ52へモータ59の正回転または逆回転を制御する信号を送信し、モータ59の回転方向を変えられるように構成されている。ドライバ52は、駆動制御部54から入力されるパルス制御信号及びモータ回転方向の制御信号に従って、モータ59の各相の巻線に流す電流のタイミング及び各相の巻線に流す電流の順序を制御可能となるように構成されたハードウェアである。モータ59は、本実施形態では、ステッピングモータである。   The drive unit 5 includes a drive control unit 54, a driver 52, and a motor 59. The drive control unit 54 is hardware for transmitting a pulse control signal to the driver 52 by PWM to rotate the motor 59. Further, the drive control unit 54 is configured to transmit a signal for controlling forward rotation or reverse rotation of the motor 59 to the driver 52, and to change the rotation direction of the motor 59. The driver 52 controls the timing of the current flowing in the winding of each phase of the motor 59 and the sequence of the current flowing in the winding of each phase according to the pulse control signal and the control signal of the motor rotation direction input from the drive control unit 54 It is hardware configured to be possible. The motor 59 is a stepping motor in the present embodiment.

パルスカウンタ95は、駆動制御部54が1パルスのパルス制御信号を送信する度に送信パルス数を1カウントする。CPU90が、駆動制御部54にモータ59の回転開始を指示すると、パルスカウンタ95を初期化し、駆動制御部54の送信パルス数のカウントを開始する。CPU90が、駆動制御部54にモータ59の回転停止を指示すると、パルスカウンタ95は、駆動制御部54の送信パルス数のカウントを終了する。   The pulse counter 95 counts the number of transmission pulses by one each time the drive control unit 54 transmits a pulse control signal of one pulse. When the CPU 90 instructs the drive control unit 54 to start the rotation of the motor 59, the pulse counter 95 is initialized, and the drive control unit 54 starts counting the number of transmission pulses. When the CPU 90 instructs the drive control unit 54 to stop the rotation of the motor 59, the pulse counter 95 ends the count of the transmission pulse number of the drive control unit 54.

モータ59は、駆動部5の駆動制御部54が1パルス制御信号をドライバ52へ送信する毎に、所定の回転角度分だけ回転する。モータ59の回転量は、駆動制御部54が送信するパルス数によって決まる。駆動制御部54の送信パルス数と、読取部4の副走査方向への移動量との関係は、予め決められており、駆動制御部54の送信パルス数から読取部4の副走査方向の移動量を算出するためのデータがROM92に記憶されている。本実施形態では、送信パルス数1パルスあたり、600dpiの1ライン分(25.4mm/600=0.042mm)に相当する移動量である。ROM92には、パルスカウンタ95によってカウントされる送信パルス数1パルスあたり、読取部4が600dpiの1ライン移動することを表す送信パルス数当たりの移動量データが記憶されている。なお、モータ59は、本実施形態では、ステッピングモータであるが、この構成に限定されない。モータ59をエンコーダ付きのDCモータにして、パルスカウンタ95がエンコーダによるパルス信号の信号数をカウントするような構成にしてもよい。   The motor 59 is rotated by a predetermined rotation angle each time the drive control unit 54 of the drive unit 5 transmits a one-pulse control signal to the driver 52. The amount of rotation of the motor 59 is determined by the number of pulses transmitted by the drive control unit 54. The relationship between the transmission pulse number of the drive control unit 54 and the movement amount of the reading unit 4 in the sub scanning direction is determined in advance, and the movement of the reading unit 4 in the sub scanning direction is determined from the transmission pulse number of the drive control unit 54. Data for calculating the amount is stored in the ROM 92. In this embodiment, the amount of movement corresponds to one line of 600 dpi (25.4 mm / 600 = 0.042 mm) per one transmission pulse number. The ROM 92 stores movement amount data per transmission pulse number indicating that the reading unit 4 moves by one line of 600 dpi per one transmission pulse number counted by the pulse counter 95. The motor 59 is a stepping motor in the present embodiment, but is not limited to this configuration. The motor 59 may be a DC motor with an encoder, and the pulse counter 95 may count the number of pulse signals from the encoder.

CPU90は、モータ59の回転開始の指示において、駆動制御部54に、ドライバ52へ送信させる送信パルス周波数及び送信パルス数を設定する。駆動制御部54は、送信パルス周波数及び送信パルス数の設定に従って、パルス制御信号を送信することで、モータ59の回転速度及び回転数が制御される。CPU90は、駆動制御部54に、モータ59の正回転または逆回転の回転方向を設定する。駆動制御部54は、回転方向の設定に従って、正回転または逆回転に対応する制御信号をドライバ52へ送信することで、モータ59の回転方向が制御される。CPU90は、モータ59の回転停止の指示において、駆動制御部54の上記送信パルス数等の設定をクリアする。   The CPU 90 sets the transmission pulse frequency and the number of transmission pulses to be transmitted to the driver 52 in the drive control unit 54 in the rotation start instruction of the motor 59. The drive control unit 54 controls the rotational speed and rotational speed of the motor 59 by transmitting a pulse control signal according to the setting of the transmission pulse frequency and the number of transmission pulses. The CPU 90 sets the rotation direction of the motor 59 in the forward rotation or the reverse rotation in the drive control unit 54. The drive control unit 54 controls the rotation direction of the motor 59 by transmitting a control signal corresponding to forward rotation or reverse rotation to the driver 52 according to the setting of the rotation direction. The CPU 90 clears the setting of the transmission pulse number and the like of the drive control unit 54 in the instruction to stop the rotation of the motor 59.

RAM93は、各種制御プログラムが読み出される作業領域、制御部9の制御処理によって算出された算出結果、及び読取部4によって読み取られた画像データを一時的に記憶する記憶領域として利用される。   The RAM 93 is used as a storage area for temporarily storing a work area in which various control programs are read, a calculation result calculated by control processing of the control unit 9, and image data read by the reading unit 4.

画像形成部10は、インクジェット方式又は電子写真方式等により記録紙に画像を形成する。   The image forming unit 10 forms an image on a recording sheet by an inkjet method, an electrophotographic method, or the like.

[本実施形態の複合機の動作]
本実施形態では、ユーザが、見開き原稿BKの画像を記録紙にコピーしたい場合、図2(A)に示すように、複合機1の原稿載置面2a上に、見開き原稿BKを載置する。複合機1は、図10(B)に示すように、見開き原稿BKの定形サイズに基づいて決定したライン数NSWより副走査方向の読取開始位置PSに近い側の読取終了ライン数LEで、読取部4を停止させることができる。
[Operation of MFP according to this embodiment]
In the present embodiment, when the user wants to copy the image of the spread original BK onto the recording sheet, the spread original BK is placed on the original placement surface 2 a of the multifunction machine 1 as shown in FIG. . As shown in FIG. 10B, the multi-function device 1 performs reading with the number of reading end lines LE on the side closer to the reading start position PS in the sub scanning direction than the number of lines NSW determined based on the fixed size of the spread original BK. Part 4 can be stopped.

複合機1は、メイン処理と、原稿決定処理と、読取終了判断処理と、画像出力処理とを主に実行する。図5に示すメイン処理中のS1〜S9の処理、図6に示す原稿決定処理中のS100〜S107の処理、図7に示す読取終了判断処理のS200〜S218の処理及び図8に示すサブルーチン処理中のS300〜S306の処理、及び図9に示す画像出力処理中のS400〜S412の処理は、第1CPU90が実行する処理である。   The multifunction device 1 mainly executes main processing, document determination processing, reading end determination processing, and image output processing. The processes of S1 to S9 in the main process shown in FIG. 5, the processes of S100 to S107 in the document determination process shown in FIG. 6, the processes of S200 to S218 in the reading end determination process shown in FIG. 7 and the subroutine process shown in FIG. The processes of S300 to S306 and the processes of S400 to S412 in the image output process shown in FIG. 9 are processes executed by the first CPU 90.

[メイン処理]
本実施形態の複合機1におけるメイン処理について、図5のフローチャートを参照して説明する。複合機1の操作部7によってスタートキーが押下されると、CPU90により、図5に示すメイン処理が実行される。CPU90は、正回転開始を駆動部5に指示し、モータ59を正回転させて、読取部4を待機位置HPから読取開始位置PSへ移動させる(S1)。
[Main processing]
The main processing in the MFP 1 of the present embodiment will be described with reference to the flowchart in FIG. When the start key is pressed by the operation unit 7 of the multifunction device 1, the CPU 90 executes main processing shown in FIG. The CPU 90 instructs the drive unit 5 to start forward rotation, rotates the motor 59 forward, and moves the reading unit 4 from the standby position HP to the reading start position PS (S1).

CPU90は、パルスカウンタ95によって送信パルス数を取得することで、読取部4の副走査方向の移動量を算出し、読取部4が、図1及び図2に示す読取開始位置PSに位置するか否かを判断する(S2)。読取部4が読取開始位置PSに位置しないと判断した場合(S2:NO)、CPU90は、S2の判断処理を繰り返す。読取部4が読取開始位置PSに位置すると判断した場合(S2:YES)、CPU90は、読取部4に画像の読み取りを開始させる(S3)。   The CPU 90 calculates the amount of movement of the reading unit 4 in the sub-scanning direction by acquiring the number of transmission pulses with the pulse counter 95, and determines whether the reading unit 4 is located at the reading start position PS shown in FIGS. It is determined whether or not (S2). When it is determined that the reading unit 4 is not located at the reading start position PS (S2: NO), the CPU 90 repeats the determination process of S2. If it is determined that the reading unit 4 is located at the reading start position PS (S2: YES), the CPU 90 causes the reading unit 4 to start reading an image (S3).

CPU90は、後述する原稿決定処理によって、見開き原稿BKの主走査方向の幅である原稿幅に対応する画素数(以降、原稿幅画素数Mと称す)及び主走査方向に対する原稿傾きθkを決定する(S4)。CPU90は、後述する読取終了判断処理の実行を開始するライン数である判断開始ライン数LSWを、原稿幅画素数M、原稿傾きθk及び見開き原稿の定形サイズを示すテーブルに基いて決定する(S5)。具体的には、CPU90は、図10(A)に示すように、後述する原稿決定処理によって検出された原稿幅画素数Mに原稿傾きθkによるcosθkを乗算して、見開き原稿BKの1頁分の長辺幅に対応する画素数LWを算出し、ROM92に記憶された見開き原稿の定形サイズを示すテーブルに基づいて、1頁分の短辺幅に対応する画素数SWを決定する。CPU90は、1頁分の短辺幅に対応する画素数SWを2倍し、画素数SWの2倍の画素数に対して見開き原稿BKの左端部BLAの左端から読取開始位置PSまでの画素数ΔSWを減算し、画素数NSWを算出する。CPU90は、図2(A)に示すように、画素数NSWから見開き原稿BKの右端部BRAの短辺幅に対応する画素数RSWを減算した画素数LSWを算出する。CPU90は、画素数LSWを、判断開始ライン数として決定し、RAM93に記憶する。CPU90は、後述するS305の処理において、算出した画素数NSWを利用するため、画素数NSWをRAM93に記憶する。なお、CPU90は、画素数ΔSWを、実験で事前に確認した画素数でROM92に記憶する構成であってもよい。もしくは、CPU90は、公知技術で見開き中央の中心線CLを、見開き原稿BKの綴じ部の濃度によって検出し、画素数SWに対して読取開始位置PSから見開き中央の中心線CLまでのライン数で減算し、画素数ΔSWを算出してRAM93に記憶する構成であってもよい。   The CPU 90 determines the number of pixels corresponding to the document width which is the width in the main scanning direction of the spread document BK (hereinafter referred to as document width pixel number M) and the document inclination θk in the main scanning direction by document determination processing described later. (S4). The CPU 90 determines the determination start line number LSW, which is the line number at which execution of the reading end determination process described later is started, based on a table showing the document width pixel number M, the document inclination θk, and the fixed size of the spread document (S5) ). Specifically, as shown in FIG. 10A, the CPU 90 multiplies the document width pixel number M detected by the document determination process described later by cos θ k according to the document inclination θ k to generate one page of the spread document BK. The number of pixels LW corresponding to the long side width is calculated, and the number of pixels SW corresponding to the short side width of one page is determined based on the table indicating the standard size of the spread original stored in the ROM 92. The CPU 90 doubles the number of pixels SW corresponding to the short side width for one page, and the pixel from the left end of the left end portion BLA of the spread original BK to the reading start position PS with respect to the number of pixels twice the number of pixels SW. The number ΔSW is subtracted to calculate the number of pixels NSW. As shown in FIG. 2A, the CPU 90 calculates the number of pixels LSW by subtracting the number of pixels RSW corresponding to the short side width of the right end portion BRA of the spread original BK from the number of pixels NSW. The CPU 90 determines the number of pixels LSW as the number of judgment start lines, and stores the number of pixels LSW in the RAM 93. The CPU 90 stores the number of pixels NSW in the RAM 93 in order to use the calculated number of pixels NSW in the process of S305 described later. The CPU 90 may store the number of pixels ΔSW in the ROM 92 as the number of pixels previously confirmed in an experiment. Alternatively, the CPU 90 detects the center line CL of the spread center in the known manner according to the density of the bound portion of the spread original BK, and the number of lines from the reading start position PS to the center line CL of the spread center with respect to the number of pixels SW. The configuration may be such that the number of pixels ΔSW is calculated by subtraction and stored in the RAM 93.

CPU90は、ラインカウンタ104によって読取部4が読取開始位置PSから現在位置へ移動するまでにカウントされたライン数Lgを取得し、取得したライン数Lgが判断開始ライン数LSW以上であるか否かを判断する(S6)。取得したライン数Lgが判断開始ライン数LSW以上ではないと判断した場合(S6:NO)、CPU90は、S6の判断処理を繰り返す。   The CPU 90 acquires the number Lg of lines counted by the line counter 104 until the reading unit 4 moves from the reading start position PS to the current position by the line counter 104, and whether the acquired number Lg of lines is equal to or more than the determination start line number LSW. (S6). If it is determined that the acquired line number Lg is not equal to or more than the determination start line number LSW (S6: NO), the CPU 90 repeats the determination process of S6.

取得したライン数Lgが判断開始ライン数LSW以上であると判断した場合(S6:YES)、CPU90は、後述する読取終了判断処理を実行する(S7)。CPU90は、逆回転開始を駆動部5に指示し、モータ59を逆回転させて、読取部4を後述する読取終了ラインLEに対応する位置から待機位置HPへ移動させる(S8)。CPU90は、後述する画像出力処理を実行する(S9)。   If it is determined that the acquired line number Lg is greater than or equal to the determination start line number LSW (S6: YES), the CPU 90 executes a reading end determination process described later (S7). The CPU 90 instructs the drive unit 5 to start reverse rotation, and reversely rotates the motor 59 to move the reading unit 4 from the position corresponding to the reading end line LE described later to the standby position HP (S8). The CPU 90 executes an image output process described later (S9).

[原稿決定処理]
本実施形態の複合機1は、図6のフローチャートに示す原稿決定処理によって、図10(A)に示す見開き原稿BKの左頁BKLに対応する左頁画像GLの原稿幅画素数M及び原稿傾きθkを決定する。
[Original determination process]
The MFP 1 according to the present embodiment determines the number M of document width pixels of the left page image GL corresponding to the left page BKL of the spread document BK shown in FIG. 10A and the document inclination by the document determination process shown in the flowchart of FIG. Determine θk.

複合機1における原稿決定処理について、図6のフローチャートを参照して説明する。CPU90は、検索変数iを初期化して、RAM93に記憶する(S100)。CPU90は、RAM93に記憶されたエッジ画像データにおいて、検索変数iに対応する検索開始点を始点として、見開き原稿BKの左頁BKLの側端エッジ点を検索開始する(S101)。CPU90は、検索した側端エッジ点の位置情報をRAM93に記憶する(S102)。CPU90は、検索変数iが検索終了変数N以上であるか否かを判断する(S103)。検索変数iが検索終了変数N以上ではないと判断した場合(S103:NO)、CPU90は、検索変数iに1を加算して検索変数iに代入し(S107)、S101以降の処理を繰り返す。   The document determination process in the multifunction machine 1 will be described with reference to the flowchart of FIG. The CPU 90 initializes the search variable i and stores it in the RAM 93 (S100). The CPU 90 starts searching the side edge point of the left page BKL of the spread original BK in the edge image data stored in the RAM 93, with the search start point corresponding to the search variable i as the start point (S101). The CPU 90 stores the position information of the retrieved side end edge point in the RAM 93 (S102). The CPU 90 determines whether the search variable i is equal to or more than the search end variable N (S103). If it is determined that the search variable i is not equal to or more than the search end variable N (S103: NO), the CPU 90 adds 1 to the search variable i and substitutes it for the search variable i (S107), and repeats the processing from S101.

具体的には、図10(A)を参照して説明する。図10(A)において、原稿決定処理を視覚的に説明するために、RAM93に記憶されたエッジ画像データにおいて「1」のデータを実線で示したエッジ画像のうち、見開き原稿BKの左頁BKLに対応する画像GLのみを含む先端エッジ画像EG1を示す図である。説明簡略化のため、エッジ画像データにおける見開き原稿BKに記載された原稿情報は図示を省略する。図10(A)において、先端エッジ画像EG1の外周を一点鎖線で示す。図10(A)において、複数の点線矢印は、各検索開始点SR(0)、SR(1)・・・SR(N)、及びSL(0)、SL(1)、・・・SL(N)からの検索方向を示す。CPU90は、図10(A)に示すように、RAM93に記憶された先端エッジ画像EG1の側端点である検索変数i=0に対応する検索開始点SL(0)及びSR(0)をそれぞれ左頁画像GLの側端エッジ点の検索開始点とする(S101)。CPU90は、主走査方向に沿って、それぞれの検索開始点から離れる方向に検索点を移動させながら、左頁画像GLの境界線となる側端エッジ点Dを検索する(S101)。CPU90は、検索した側端エッジ点Dの先端エッジ画像EG1における位置情報をRAM93に記憶する(S102)。CPU90は、先端エッジ画像EG1における検索変数i=0に対応する読取開始位置PSから副走査方向の読取終了位置PEに近づく方向に所定距離の分だけ離れた検索終了変数Nに対応する位置までの左頁画像GLの側端エッジ点をそれぞれ検索する。上記所定距離及び検索変数Nの数値は、実験で事前に原稿幅画素数M及び原稿傾きθkを精度良く決定可能な数値として決定し、ROM92に記憶しておくものとする。CPU90は、検索変数iが検索終了変数N以上ではないと判断した場合(S103:NO)、S107の処理によって、図10(A)に示すように、検索開始点SL(0)及びSR(0)から副走査方向の読取終了位置PEに近づく方向に所定間隔離れた検索変数i=1に対応する検索開始点SL(1)及びSR(1)を始点としてS101以降の処理を繰り返す。本実施形態では、上記所定距離を30mmとする。検索変数Nは、原稿決定処理の精度に関わる変数であり、実験によって決定され、決定された検索変数Nは、ROM92に記憶されるものとする。上記所定間隔は、上記所定距離に検索変数Nの数値を除算することで自動的に決まる間隔である。   Specifically, this will be described with reference to FIG. In FIG. 10A, in order to visually explain the original determination process, the left page BKL of the spread original BK of the edge image in which the data of “1” is indicated by the solid line in the edge image data stored in RAM 93. Is a diagram showing a tip edge image EG1 including only an image GL corresponding to. For simplification of the description, the document information described in the spread document BK in the edge image data is not shown. In FIG. 10A, the outer periphery of the leading edge image EG1 is indicated by an alternate long and short dash line. In FIG. 10A, a plurality of dotted arrows indicate search start points SR (0), SR (1)... SR (N), and SL (0), SL (1),. Indicates the search direction from N). As shown in FIG. 10A, the CPU 90 sets the search start points SL (0) and SR (0) corresponding to the search variable i = 0 which is the side end point of the tip edge image EG1 stored in the RAM 93 to the left. It is set as a search start point of the side end edge point of the page image GL (S101). The CPU 90 searches for the side end edge point D serving as the boundary line of the left page image GL while moving the search point in the direction away from each search start point along the main scanning direction (S101). The CPU 90 stores, in the RAM 93, positional information in the leading edge image EG1 of the retrieved side end edge point D (S102). The CPU 90 extends from the reading start position PS corresponding to the search variable i = 0 in the leading edge image EG1 to a position corresponding to the search end variable N separated by a predetermined distance in the direction approaching the reading end position PE in the sub scanning direction. The side end edge points of the left page image GL are respectively searched. It is assumed that the predetermined distance and the numerical value of the search variable N are determined in advance as a numerical value which can accurately determine the document width pixel number M and the document inclination θk by an experiment and stored in the ROM 92. When the CPU 90 determines that the search variable i is not the search end variable N or more (S103: NO), as shown in FIG. 10A, the search start points SL (0) and SR (0) are obtained by the processing of S107. The processing from S101 is repeated starting from the search start points SL (1) and SR (1) corresponding to the search variable i = 1 which is separated by a predetermined interval in the direction approaching the reading end position PE in the sub scanning direction. In the present embodiment, the predetermined distance is 30 mm. The search variable N is a variable relating to the accuracy of the document determination process, and the search variable N determined by the experiment is assumed to be stored in the ROM 92. The predetermined interval is an interval automatically determined by dividing the numerical value of the search variable N by the predetermined distance.

検索変数iが検索終了変数N以上であると判断した場合(S103:YES)、CPU90は、検索した側端エッジ点に対して公知技術である最小二乗法による直線式をそれぞれ算出する(S104)。CPU90は、算出した直線式による直線のうち、平行となる2つの直線の間の主走査方向と平行な間隔を見開き原稿BKの原稿幅画素数Mとして決定する(S105)。CPU90は、公知技術である余弦定理を利用して算出した左頁画像GLの主走査方向に対する傾きθkを、見開き原稿BKの主走査方向に対する原稿傾きθkとして決定する(S106)。   When it is determined that the search variable i is equal to or more than the search end variable N (S103: YES), the CPU 90 calculates a linear equation by the least square method which is a known technique for each of the searched side end edge points (S104) . The CPU 90 determines, as a document width pixel number M of the document BK, an interval parallel to the main scanning direction between two straight lines which are parallel among the straight lines calculated (S105). The CPU 90 determines the inclination θk of the left page image GL with respect to the main scanning direction calculated using the cosine theorem, which is a known technique, as the document inclination θk with respect to the main scanning direction of the spread original BK (S106).

具体的には、CPU90は、図10(A)に示す検索変数i=0・・・Nに対応するそれぞれの側端エッジ点に対する最小二乗法により、直線AB、直線BC、直線CD、及び直線DAの直線式をそれぞれ算出する(S104)。CPU90は、互いに平行となる2つの直線AB及び直線CDの間の主走査方向と平行な間隔Mを算出し、算出した間隔Mを見開き原稿BKの原稿幅画素数Mとして決定する(S105)。CPU90は、余弦定理を利用して、図10(A)に示す直線AD、直線AE、及び直線EDのそれぞれの線分の間隔に基づいて、cosθkを算出し、θkを見開き原稿BKの主走査方向に対する原稿傾きθkとして決定する(S106)。   Specifically, the CPU 90 executes the straight line AB, the straight line BC, the straight line CD, and the straight line by the least squares method for each side end edge point corresponding to the search variable i = 0 to N shown in FIG. Each linear equation of DA is calculated (S104). The CPU 90 calculates an interval M parallel to the main scanning direction between the two straight lines AB and CD parallel to each other, and determines the calculated interval M as the document width pixel number M of the spread original BK (S105). The CPU 90 calculates cos θ k based on the interval between line segments AD, AE, and ED shown in FIG. 10A using the cosine theorem to obtain θ k, and the main scanning of the document BK with a spread of θ k The document inclination θk with respect to the direction is determined (S106).

[読取終了判断処理]
本実施形態の複合機1は、図7及び図8のフローチャートに示す読取終了判断処理によって、エッジ画像データ及び濃度画像データにおけるそれぞれの画素値と閾値を比較することで読取終了を判断し、読取部4による画像の読取を終了させ、モータ59の回転を停止させる。
[Reading end judgment processing]
The MFP 1 according to the present embodiment determines the end of reading by comparing the respective pixel values in the edge image data and the density image data with the threshold value by the reading end determination processing illustrated in the flowcharts of FIGS. 7 and 8. The reading of the image by the unit 4 is ended, and the rotation of the motor 59 is stopped.

複合機1における読取終了判断処理について、図7及び図8のフローチャートを参照して説明する。CPU90は、図7に示すように、エッジ検出フラグをオフして、RAM93に記憶し、エッジ検出フラグを初期化する(S200)。CPU90は、副走査変数nを初期化して、RAM93に記憶する(S201)。CPU90は、ラインカウンタ104によってカウントされたライン数を基準ライン数Lkとして取得する(S202)。CPU90は、ラインカウンタ104によってカウントされたライン数Lgを取得し、取得したライン数Lgが基準ライン数Lkに所定ライン数LNを加算したライン数(Lk+LN)以上であるか否かを判断する(S203)。取得したライン数Lgがライン数(Lk+LN)以上ではないと判断した場合(S203:NO)、CPU90は、S203の判断処理を繰り返す。具体的には、所定ライン数LNは、後述するエッジ判断対象ブロックの副走査エッジ判断画素数N1及び濃度判断対象範囲の副走査方向の画素数である副走査濃度判断画素数N2以上となるライン数としてROM92に記憶されているものとする。   The reading end determination process in the MFP 1 will be described with reference to the flowcharts of FIGS. 7 and 8. As shown in FIG. 7, the CPU 90 turns off the edge detection flag, stores it in the RAM 93, and initializes the edge detection flag (S200). The CPU 90 initializes the sub scanning variable n and stores it in the RAM 93 (S201). The CPU 90 acquires the number of lines counted by the line counter 104 as the reference line number Lk (S202). The CPU 90 acquires the line number Lg counted by the line counter 104, and determines whether the acquired line number Lg is equal to or more than the number of lines (Lk + LN) obtained by adding the predetermined line number LN to the reference line number Lk S203). When it is determined that the acquired line number Lg is not equal to or more than the line number (Lk + LN) (S203: NO), the CPU 90 repeats the determination process of S203. Specifically, a line in which the predetermined line number LN is equal to or more than the subscanning edge judgment pixel number N1 of the edge judgment target block described later and the subscanning density judgment pixel number N2 which is the pixel number in the subscanning direction of the density judgment object range. It is assumed that the numbers are stored in the ROM 92.

取得したライン数Lgがライン数(Lk+LN)以上であると判断した場合(S203:YES)、CPU90は、RAM93に記憶されたエッジ検出フラグがオフであるか否かを判断する(S204)。エッジ検出フラグがオフではないと判断した場合(S204:NO)、CPU90は、図8に示す後述する濃度判断処理におけるS301以降の処理を実行する。エッジ検出フラグがオフであると判断した場合(S204:YES)、CPU90は、主走査変数mを初期化して、RAM93に記憶する(S205)。CPU90は、図11(A)に示すように、RAM93に記憶されたエッジ画像データ110においてエッジ判断対象ブロックである画素P(m,n)から副走査方向の読取終了位置PEに向かう方向に沿って副走査エッジ判断画素数N1の分だけ離れた画素P(m,n+N1)までのエッジ画素値を取得する(S206)。CPU90は、取得した画素P(m,n)から画素P(m,n+N1)までのエッジ画素値がそれぞれエッジ閾値Eh以上となるか否かを判断する(S207)。取得した画素P(m,n)から画素P(m,n+N1)までのエッジ画素値がそれぞれエッジ閾値Eh以上ではないと判断した場合(S207:NO)、CPU90は、副走査変数nに副走査エッジ判断画素数N1を加えた変数(n+N1)が所定ライン数LN以上であるか否かを判断する(S217)。変数(n+N1)が所定ライン数LN以上ではないと判断した場合(S217:NO)、CPU90は、主走査変数mを初期化し、副走査変数nに所定の定数nsを加算した変数(n+ns)を、副走査変数nに代入し(S218)、S206以降の処理を繰り返す。変数(n+N1)が所定ライン数LN以上であると判断した場合(S217:YES)、CPU90は、S202以降の処理を繰り返す。   If it is determined that the acquired line number Lg is equal to or more than the line number (Lk + LN) (S203: YES), the CPU 90 determines whether the edge detection flag stored in the RAM 93 is off (S204). If it is determined that the edge detection flag is not off (S204: NO), the CPU 90 executes the processing of S301 and later in the concentration determination processing described later shown in FIG. If it is determined that the edge detection flag is off (S204: YES), the CPU 90 initializes the main scanning variable m and stores it in the RAM 93 (S205). As shown in FIG. 11A, in the edge image data 110 stored in the RAM 93, the CPU 90 follows the direction from the pixel P (m, n) which is the edge determination target block to the reading end position PE in the sub scanning direction. Edge pixel values up to the pixel P (m, n + N1) separated by the sub-scanning edge determination pixel count N1 are acquired (S206). The CPU 90 determines whether or not the edge pixel value from the acquired pixel P (m, n) to the pixel P (m, n + N1) is equal to or more than the edge threshold Eh (S207). When it is determined that the edge pixel values from the acquired pixel P (m, n) to the pixel P (m, n + N1) are not each equal to or more than the edge threshold Eh (S207: NO), the CPU 90 performs subscanning to the subscanning variable n It is determined whether a variable (n + N1) obtained by adding the edge determination pixel number N1 is equal to or more than a predetermined line number LN (S217). If it is determined that the variable (n + N1) is not equal to or more than the predetermined line number LN (S217: NO), the CPU 90 initializes the main scanning variable m and adds a predetermined constant ns to the subscanning variable n. , Sub-scanning variable n (S218), and the processing after S206 is repeated. When it is determined that the variable (n + N1) is equal to or more than the predetermined line number LN (S217: YES), the CPU 90 repeats the processing of S202 and thereafter.

取得した画素P(m,n)から画素P(m,n+N1)までのエッジ画素値がそれぞれエッジ閾値Eh以上であると判断した場合(S207:YES)、CPU90は、主走査変数mが原稿幅画素数M以上であるか否かを判断する(S208)。主走査変数mが原稿幅画素数M以上ではないと判断した場合(S208:NO)、CPU90は、主走査変数mに1を加算して主走査変数mに代入し(S216)、S206以降の処理を繰り返す。主走査変数mが原稿幅画素数M以上であると判断した場合(S208:YES)、CPU90は、エッジ検出フラグをオンにする(S209)。CPU90は、ラインカウンタ104によってカウントしたライン数を後端エッジライン数EEとしてRAM93に記憶する(S210)。   When it is determined that the edge pixel values from the acquired pixel P (m, n) to the pixel P (m, n + N1) are each equal to or greater than the edge threshold Eh (S207: YES), the CPU 90 determines that the main scanning variable m is the document width It is determined whether the number of pixels is equal to or more than M (S208). When it is determined that the main scanning variable m is not the document width pixel number M or more (S208: NO), the CPU 90 adds 1 to the main scanning variable m and substitutes it into the main scanning variable m (S216). Repeat the process. If it is determined that the main scanning variable m is equal to or more than the document width pixel number M (S208: YES), the CPU 90 turns on the edge detection flag (S209). The CPU 90 stores the number of lines counted by the line counter 104 in the RAM 93 as the number EE of trailing edge lines (S210).

具体的には、副走査エッジ判断画素数N1=4、所定の定数ns=1、エッジ閾値Eh=1、原稿幅画素数M=2480、及び所定ライン数LN=32である場合について、図11(A)及び図11(B)を参照して説明する。CPU90は、図11(A)に示すエッジ画像データ110における画素P(0,0)〜画素P(0,4)のエッジ画素値をそれぞれ取得する(S206)。CPU90は、画素P(0,0)〜画素P(0,4)のエッジ画素値(=0)は、それぞれエッジ閾値Eh(=1)以上ではないと判断する(S207:NO)。CPU90は、変数(n+N1)(=4)が所定ライン数LN(=32)以上ではないと判断し(S217:NO)、CPU90は、主走査変数mを初期化し、副走査変数n(=0)に1を加算してnに代入する(S218)。CPU90は、図11(B)に示すエッジ画像データ110における画素P(0,1)〜画素P(0,5)のエッジ画素値をそれぞれ取得する(S206)。CPU90は、画素P(0,5)のエッジ画素値(=1)が、エッジ閾値Eh(=1)以上であると判断する(S207:YES)。CPU90は、主走査変数m(=0)が、原稿幅画素数M(=2480)以上ではないと判断し(S208:NO)、主走査変数m(=0)に1を加算して主走査変数mに代入し(S216)、図11(B)に示すエッジ画像データ110における画素P(1,1)〜画素P(1,5)のエッジ画素値をそれぞれ取得する(S206)。CPU90は、画素P(1,5)のエッジ画素値が1であるため、画素P(0,5)と同様に、エッジ閾値Eh(=1)以上であると判断し(S207:YES)、S208、S216、及びS206以降の処理を、主走査変数mが原稿幅画素数Mである2480と等しくなるまで繰り返す。なお、エッジ閾値Ehは0より大きく、1以下である所定の数値である。エッジ閾値Ehは、事前に実験で確認して決定し、ROM92に記憶するものとする。   Specifically, in the case of sub-scanning edge determination pixel number N1 = 4, predetermined constant ns = 1, edge threshold value Eh = 1, document width pixel number M = 2480, and predetermined line number LN = 32, as shown in FIG. This will be described with reference to (A) and FIG. 11 (B). The CPU 90 acquires edge pixel values of the pixels P (0, 0) to P (0, 4) in the edge image data 110 shown in FIG. 11A (S206). The CPU 90 determines that the edge pixel values (= 0) of the pixels P (0, 0) to the pixels P (0, 4) are not equal to or more than the edge threshold Eh (= 1) (S207: NO). The CPU 90 determines that the variable (n + N1) (= 4) is not the predetermined line number LN (= 32) or more (S217: NO), the CPU 90 initializes the main scanning variable m, and the sub scanning variable n (= 0 1) is added and substituted for n (S218). The CPU 90 acquires edge pixel values of the pixels P (0, 1) to P (0, 5) in the edge image data 110 shown in FIG. 11B (S206). The CPU 90 determines that the edge pixel value (= 1) of the pixel P (0, 5) is equal to or greater than the edge threshold Eh (= 1) (S207: YES). The CPU 90 determines that the main scanning variable m (= 0) is not equal to or more than the document width pixel number M (= 2480) (S208: NO), adds 1 to the main scanning variable m (= 0), and performs main scanning Substituting into a variable m (S216), edge pixel values of pixels P (1,1) to P (1,5) in the edge image data 110 shown in FIG. 11B are obtained (S206). Since the edge pixel value of the pixel P (1, 5) is 1, the CPU 90 determines that it is equal to or higher than the edge threshold Eh (= 1) as in the pixel P (0, 5) (S207: YES) The processes from S208, S216, and S206 are repeated until the main scanning variable m becomes equal to 2480, which is the document width pixel number M. The edge threshold Eh is a predetermined numerical value which is greater than 0 and less than or equal to 1. The edge threshold value Eh is confirmed in advance by experiment and determined, and stored in the ROM 92.

CPU90は、S209の処理を実行後、RAM93に記憶されたR色の濃度画像データに対して、後述する濃度判断処理を実行し(S211)、同様に、RAM93に記憶されたG色の濃度画像データ及びB色の濃度画像データに対して、後述する濃度判断処理をそれぞれ実行する。(S212、S213)。CPU90は、読取部4に画像の読み取りを終了させ(S214)、駆動部5にモータ59の回転を停止させる(S215)。   After executing the processing of S209, the CPU 90 executes density determination processing to be described later on the density image data of R color stored in the RAM 93 (S211), and similarly, the density image of G color stored in the RAM 93 A density determination process described later is executed on the data and the density image data of B color. (S212, S213). The CPU 90 causes the reading unit 4 to finish reading the image (S214), and causes the drive unit 5 to stop the rotation of the motor 59 (S215).

複合機1における読取終了判断処理のサブルーチン処理である濃度判断処理について、図8のフローチャートを参照して説明する。CPU90は、主走査変数mを初期化し、副走査変数nを副走査基準変数Nkに代入する(S300)。CPU90は、濃度判断対象範囲として、濃度画像データにおいて、画素P(m,n)から副走査方向の読取終了位置PEに向かう方向に沿って副走査濃度判断画素数N2の分だけ離れ、かつ、原稿幅画素数Mの分だけ離れた画素P(M,n+N2)までの範囲の濃度画素値を取得する(S301)。CPU90は、濃度画像データにおいて、画素P(m,n)から画素P(M,n+N2)までの範囲の全体の画素数に対して、灰色濃度閾値Gh以下となる濃度画素値の割合が割合閾値Wh以上であるか否かを判断する(S302)。   The density determination process, which is a subroutine process of the reading end determination process in the MFP 1, will be described with reference to the flowchart of FIG. The CPU 90 initializes the main scanning variable m and substitutes the sub scanning variable n into the sub scanning reference variable Nk (S300). As the density judgment target range, the CPU 90 is separated from the pixel P (m, n) by the number N2 of sub-scanning density judgment pixels along the direction from the pixel P (m, n) to the reading end position PE in the sub-scanning direction. The density pixel values in the range up to the pixel P (M, n + N2) separated by the document width pixel number M are acquired (S301). In the density image data, the CPU 90 sets the ratio of the density pixel value equal to or less than the gray density threshold Gh to the total number of pixels in the range from the pixel P (m, n) to the pixel P (M, n + N2) It is determined whether it is Wh or more (S302).

全体の画素数に対して、灰色濃度閾値Gh以下となる濃度画素値の割合が割合閾値Wh以上ではないと判断した場合(S302:NO)、CPU90は、副走査変数nに副走査濃度判断画素数N2を加えた変数(n+N2)が所定ライン数LN以上であるか否かを判断する(S304)。変数(n+N2)が所定ライン数LN以上ではないと判断した場合(S304:NO)、CPU90は、副走査変数nに所定の定数nsを加算した変数(n+ns)を、副走査変数nに代入し(S306)、S301以降の処理を繰り返す。変数(n+N2)が所定ライン数LN以上であると判断した場合(S304:YES)、CPU90は、ラインカウンタ104によってカウントされたライン数Lgを取得し、取得したライン数Lgが、RAM93に記憶された画素数NSW以上であるか否かを判断する(S305)。取得したライン数Lgが、RAM93に記憶された画素数NSW以上ではないと判断した場合(S305:NO)、CPU90は、図7に示すS202以降の処理を繰り返す。取得したライン数Lgが、RAM93に記憶された画素数NSW以上であると判断した場合(S305:YES)、CPU90は、図7に示すS214以降の処理を実行する。全体の画素数に対して、灰色濃度閾値Gh以下となる濃度画素値の割合が割合閾値Wh以上であると判断した場合(S302:YES)、CPU90は、副走査変数nに副走査基準変数Nkを代入し(S303)、濃度判断処理を終了する。   When it is determined that the ratio of the density pixel value which is equal to or less than the gray density threshold Gh is not equal to or more than the ratio threshold Wh with respect to the total number of pixels (S302: NO), the CPU 90 sets the subscanning density determination pixel to the subscanning variable n. It is determined whether the variable (n + N2) obtained by adding the number N2 is equal to or more than the predetermined line number LN (S304). When it is determined that the variable (n + N2) is not the predetermined line number LN or more (S304: NO), the CPU 90 substitutes a variable (n + ns) obtained by adding a predetermined constant ns to the subscanning variable n into the subscanning variable n. (S306), repeat the processing after S301. If it is determined that the variable (n + N2) is equal to or larger than the predetermined line number LN (S304: YES), the CPU 90 acquires the line number Lg counted by the line counter 104, and the acquired line number Lg is stored in the RAM 93. It is determined whether the number of pixels NSW or more is equal to or greater than the number of pixels NSW (S305). If it is determined that the acquired line number Lg is not equal to or more than the pixel number NSW stored in the RAM 93 (S305: NO), the CPU 90 repeats the process from S202 shown in FIG. When it is determined that the acquired line number Lg is equal to or more than the pixel number NSW stored in the RAM 93 (S305: YES), the CPU 90 executes the processing of S214 and later shown in FIG. When it is determined that the ratio of the density pixel value which is equal to or less than the gray density threshold Gh is equal to or higher than the ratio threshold Wh with respect to the total number of pixels (S302: YES), the CPU 90 sets the subscanning Is substituted (S303), and the concentration determination processing is ended.

具体的には、副走査濃度判断画素数N2=3、原稿幅画素数M=2480、所定の定数ns=1、灰色濃度閾値Gh=180、割合閾値Wh=30%、及び所定ライン数LN=32である場合であって、かつ、CPU90が、副走査変数n=n+1でS207(YES)、S208(YES)、S209、及びS210の処理を実行した場合について、図11(C)及び図11(D)を参照して説明する。CPU90は、図11(C)に示すR色の濃度画像データ111における画素P(0,n+1)と、画素P(0,n+1)から副走査方向の読取終了位置PEに向かう方向に沿って副走査濃度判断画素数N2の分だけ離れた画素P(0,n+4)と、主走査方向に原稿幅画素数M(=2480)の分だけ離れた画素P(2480,n+1)と、画素P(2480,n+4)とで囲まれた濃度判断対象範囲における濃度画素値をそれぞれ取得する(S301)。CPU90は、濃度判断対象範囲である画素P(0,n+1)〜画素P(2480,n+4)の濃度画素値は、最小値でも190であるため、灰色濃度閾値Gh(=180)以下である濃度画素値の割合は0%であるため、割合閾値Wh(=30%)以上ではないと判断する(S302:NO)。CPU90は、変数(n+1+N2)(=4)が所定ライン数LN(=32)以上ではないと判断し(S304:NO)、CPU90は、副走査変数n(=n+1)に1を加算してnに代入する(S306)。CPU90は、図11(D)に示すR色の濃度画像データ111における濃度判断対象範囲である画素P(0,n+2)〜画素P(2480,n+5)の濃度画素値をそれぞれ取得する(S301)。CPU90は、濃度判断対象範囲である画素P(0,n+2)〜画素P(2480,n+5)の濃度画素値は最小値が180であり、灰色濃度閾値Gh(=180)以下である濃度画素値の割合は33%であるため、割合閾値Wh(=30%)以上であると判断する(S302:YES)。CPU90は、S303の処理を実行後、上記と同様に、G色及びB色の濃度画像データについても濃度判断処理を実行し(S212及びS213)、S214及びS215の処理を実行する。   Specifically, subscanning density determination pixel count N2 = 3, document width pixel count M = 2480, predetermined constant ns = 1, gray density threshold Gh = 180, ratio threshold Wh = 30%, and predetermined line count LN = 11C and 11 for the case where the CPU 90 executes the processing of S207 (YES), S208 (YES), S209, and S210 with the sub scanning variable n = n + 1. This will be described with reference to (D). The CPU 90 performs sub-scanning along the direction from the pixel P (0, n + 1) in the density image data 111 of R color shown in FIG. 11C and the pixel P (0, n + 1) to the reading end position PE in the sub scanning direction. Pixel P (0, n + 4) separated by the scanning density determination pixel number N2, pixel P (2480, n + 1) separated by the document width pixel number M (= 2480) in the main scanning direction, and pixel P (2 The density pixel values in the density determination target range surrounded by 2480, n + 4) are respectively acquired (S301). Since the density pixel value of pixel P (0, n + 1) to pixel P (2480, n + 4) which is the density determination target range is 190 at the minimum value, the CPU 90 is a density which is less than the gray density threshold Gh (= 180). Since the percentage of pixel values is 0%, it is determined that the percentage is not equal to or greater than the percentage threshold Wh (= 30%) (S302: NO). The CPU 90 determines that the variable (n + 1 + N2) (= 4) is not greater than or equal to the predetermined line number LN (= 32) (S304: NO), and the CPU 90 adds 1 to the sub scanning variable n (= n + 1). (S306). The CPU 90 acquires density pixel values of the pixel P (0, n + 2) to the pixel P (2480, n + 5) which are the density determination target range in the density image data 111 of R color shown in FIG. . The CPU 90 determines that the density pixel values of pixel P (0, n + 2) to pixel P (2 480, n + 5) in the density determination target range have a minimum value of 180 and a gray density threshold Gh (= 180) or less. Since the percentage of is 33%, it is determined that the percentage threshold Wh (= 30%) or more (S302: YES). After executing the process of S303, the CPU 90 executes the density determination process on the G and B color density image data as described above (S212 and S213), and executes the processes of S214 and S215.

灰色濃度閾値Ghについて、読取部4が、図10(B)に示す副走査方向の右方へ移動しながら見開き原稿BKの右頁BKR及び右頁BKRの右端部BRAの画像を読み取る場合を例に挙げて、図10(B)及び図10(C)を参照して説明する。図10(B)に示すように、読取部4と右端部BRAとの上下方向距離Wzが、読取部4の焦点深度以上となることにより、読取部4で読み取られた画像の濃度画素値は灰色の濃度画素値となる。灰色濃度閾値Ghは、図10(C)に示すように、後端エッジライン数EEより副走査方向のライン数NSW(S5の処理で算出したライン数NSW)に向かう方向における画素値の中で最大値BKG(max)及び最小値BKG(min)を除いた画素値のうちのいずれかの画素値である。灰色濃度閾値Ghを図10(C)示すように設定して、CPU90が上記読取終了判断処理を実行することにより、従来、見開き原稿BKの定形サイズに基づいて算出したライン数NSWの位置よりも副走査方向の読取開始位置に近いライン数である読取終了ライン数LEで読取部4の画像の読み取りを終了し、モータ59を停止させることができる。割合閾値Whは、1%以上の所定の閾値であり、実験で事前に確認して決定し、ROM92に記憶しておくものとする。   For the gray density threshold Gh, the reading unit 4 reads the image of the right page BRA of the right page BKR of the spread original BK and the right page BRA of the right page BKR while moving to the right in the sub scanning direction shown in FIG. And will be described with reference to FIGS. 10 (B) and 10 (C). As shown in FIG. 10B, when the vertical distance Wz between the reading unit 4 and the right end portion BRA becomes equal to or more than the focal depth of the reading unit 4, the density pixel value of the image read by the reading unit 4 is It becomes a gray density pixel value. As shown in FIG. 10C, the gray density threshold Gh is a pixel value in the direction from the number EE of the trailing edge lines to the number NSW of lines in the sub scanning direction (the number NSW of lines calculated in the processing of S5). The pixel value is any one of pixel values excluding the maximum value BKG (max) and the minimum value BKG (min). The gray density threshold value Gh is set as shown in FIG. 10C, and the CPU 90 executes the above-described reading end determination processing, whereby the position of the line number NSW calculated based on the fixed size of the spread original BK is The reading of the image of the reading unit 4 can be ended with the reading end line number LE which is the number of lines close to the reading start position in the sub scanning direction, and the motor 59 can be stopped. The ratio threshold value Wh is a predetermined threshold value of 1% or more, and is confirmed in advance by experiments and determined, and stored in the ROM 92.

[画像出力処理]
本実施形態の複合機1が実行する画像出力処理について、図9のフローチャート及び図12(A)を参照して説明する。図12(A)において、図10(A)と同様に、視覚的に説明するために、RAM93に記憶されたエッジ画像データにおいて「1」のデータを実線で示したエッジ画像のうち、見開き原稿BKの右頁BKRに対応する画像GRのみを含む後端エッジ画像EG2を示す図である。説明簡略化のため、エッジ画像データにおける見開き原稿BKに記載された原稿情報は図示を省略する。図12(A)において、後端エッジ画像EG2の外周を一点鎖線で示す。図12(A)において、複数の点線矢印は、各検索開始点SP(0)、SP(1)・・・SP(N)からの後端エッジ点の検索方向を示す。図9のフローチャートに示す画像出力処理によって、図12(A)に示す後端エッジ画像EG2において、見開き原稿BKの右頁BKRに対応する右頁画像GRの後端エッジ点を検出して、左頁画像GL及び右頁画像GRの画像を抽出し、記録紙の中央に出力する。本実施形態では、説明簡略化のため、原稿の傾きθkが0、またはCPU90がS214の処理実行後で画像出力処理の実行前に、画像処理部94によって読取画像GA及び後端エッジ画像EG2の原稿の傾きθkを補正した場合について説明する。
[Image output processing]
The image output process performed by the multifunction device 1 according to the present embodiment will be described with reference to the flowchart of FIG. 9 and FIG. In FIG. 12A, as in FIG. 10A, in the edge image data stored in the RAM 93, the spread original of the edge image in which the data of “1” is indicated by a solid line for visual explanation. FIG. 17 is a view showing a trailing edge image EG2 including only the image GR corresponding to the right page BKR of BK. For simplification of the description, the document information described in the spread document BK in the edge image data is not shown. In FIG. 12A, the outer periphery of the rear end edge image EG2 is indicated by an alternate long and short dash line. In FIG. 12A, a plurality of dotted arrows indicate search directions of rear end edge points from the search start points SP (0), SP (1)... SP (N). By the image output processing shown in the flowchart of FIG. 9, the trailing edge point of the right page image GR corresponding to the right page BKR of the spread original BK is detected in the trailing edge image EG2 shown in FIG. Images of the page image GL and the right page image GR are extracted and output to the center of the recording sheet. In the present embodiment, for simplification of the explanation, the inclination θk of the document is 0 or the CPU 90 executes the process of S214 and before the image output process, the read image GA and the trailing edge image EG2 are processed. The case where the inclination θk of the document is corrected will be described.

複合機1における画像出力処理について、図9のフローチャートを参照して説明する。CPU90は、ラインカウンタ104によってカウントされたライン数を取得し、読取終了ライン数LEとしてRAM93に記憶する(S400)。CPU90は、後端変数pを初期化して、RAM93に記憶する(S401)。CPU90は、RAM93に記憶されたエッジ画像データにおいて、後端変数pに対応する検索開始点を始点として、見開き原稿BKの右頁BKRに対応する右頁画像GRの後端エッジ点を検索開始する(S402)。CPU90は、読取終了ライン数LEから後端エッジライン数EEを減算したライン数までの画素数を検索したか否かを判断する(S403)。読取終了ライン数LEから後端エッジライン数EEを減算したライン数までの画素数を検索しなかったと判断した場合(S403:NO)、CPU90は、S403の判断処理を繰り返す。読取終了ライン数LEから後端エッジライン数EEを減算したライン数までの画素数を検索したと判断した場合(S403:YES)、CPU90は、検索した後端エッジ点の位置情報をRAM93に記憶する(S404)。CPU90は、後端変数pが検索終了変数PF以上であるか否かを判断する(S405)。後端変数pが検索終了変数PF以上ではないと判断した場合(S405:NO)、CPU90は、後端変数pに1を加算して後端変数pに代入し(S412)、S403以降の処理を繰り返す。   Image output processing in the multifunction device 1 will be described with reference to the flowchart in FIG. The CPU 90 acquires the number of lines counted by the line counter 104, and stores it in the RAM 93 as the reading end line number LE (S400). The CPU 90 initializes the rear end variable p and stores it in the RAM 93 (S401). The CPU 90 starts searching for the rear end edge point of the right page image GR corresponding to the right page BKR of the spread original BK from the search start point corresponding to the rear end variable p in the edge image data stored in the RAM 93 (S402). The CPU 90 determines whether or not the number of pixels up to the number of lines obtained by subtracting the number of rear end edge lines EE from the number of end lines of reading LE is searched (S403). When it is determined that the number of pixels up to the number of lines obtained by subtracting the number of rear end edge lines EE from the number LE of read completion lines is not searched (S403: NO), the CPU 90 repeats the determination process of S403. When it is determined that the number of pixels up to the number of lines obtained by subtracting the number EE of the trailing edge lines from the number LE of reading completion lines is searched (S403: YES), the CPU 90 stores the position information of the retrieved trailing edge points in the RAM 93 To do (S404). The CPU 90 determines whether the rear end variable p is equal to or more than the search end variable PF (S405). If it is determined that the rear end variable p is not equal to or more than the search end variable PF (S405: NO), the CPU 90 adds 1 to the rear end variable p and substitutes it into the rear end variable p (S412). repeat.

具体的には、CPU90は、図12(A)に示すように、RAM93に記憶された後端エッジ画像EG2の読取終了ライン数LE上の後端点である後端変数p=0に対応する検索開始点SP(0)を右頁画像GRの側端エッジ点の検索開始点とする(S402)。CPU90は、後端エッジ画像EG2において、副走査方向に沿って、読取開始位置PSに近づく方向に検索点を移動させながら、エッジ点を検索する(S402)。CPU90は、読取終了ライン数LEから後端エッジライン数EEを減算したライン数まで検索点を移動させたと判断した場合(S403:YES)、検索した複数のエッジ点のうち、読取開始位置PSに最も近いエッジ点の位置情報を、後端エッジ点EP(0)の位置情報としてRAM93に記憶する(S404)。見開き原稿BKの右端部BRAは、複数の頁端部で構成されているので、後端エッジ画像EG2のうち、右端部BRAに対応する画像GRAには、エッジ画素値が「1」であるエッジ画素が主走査方向に沿って複数存在する。S402の処理によって、エッジ点を検索していくと副走査方向に複数のエッジ点が検索されるため、読取開始位置PS及び後端エッジライン数EEにおけるエッジ画素に最も近いエッジ点を後端エッジ点とする。CPU90は、後端変数pが検索終了変数PF以上ではないと判断した場合(S405:NO)、S412の処理によって、図10(A)に示すように、検索開始点SP(0)から主走査方向の検索開始点SP(0)から所定間隔離れた検索変数p=1に対応する検索開始点SP(1)を始点としてS403以降の処理を繰り返す。検索終了変数PFは、原稿幅画素数Mに対応する数値である。上記所定間隔は、原稿幅画素数Mに検索変数PFの数値を除算することで自動的に決まる間隔である。   Specifically, as shown in FIG. 12A, the CPU 90 performs a search corresponding to the rear end variable p = 0 which is the rear end point on the read end line number LE of the rear end edge image EG2 stored in the RAM 93. The start point SP (0) is set as the search start point of the side end edge point of the right page image GR (S402). The CPU 90 searches the edge point in the trailing edge image EG2 while moving the search point in the direction approaching the reading start position PS along the sub-scanning direction (S402). If the CPU 90 determines that the search point has been moved to the line number obtained by subtracting the rear end edge line number EE from the reading end line number LE (S403: YES), the reading start position PS The position information of the closest edge point is stored in the RAM 93 as the position information of the rear end edge point EP (0) (S404). The right end portion BRA of the spread original BK is composed of a plurality of page end portions, so in the image GRA corresponding to the right end portion BRA in the rear end edge image EG2, the edge whose edge pixel value is “1” There are a plurality of pixels along the main scanning direction. Since a plurality of edge points are searched in the sub scanning direction as the edge point is searched by the processing of S402, the edge point closest to the edge pixel in the reading start position PS and the number of rear end edge lines EE is the rear end edge It will be a point. When the CPU 90 determines that the rear end variable p is not equal to or more than the search end variable PF (S405: NO), the main scanning is performed from the search start point SP (0) as shown in FIG. The processing from S403 onward is repeated with the search start point SP (1) corresponding to the search variable p = 1 which is separated from the direction search start point SP (0) by a predetermined interval as a start point. The search end variable PF is a numerical value corresponding to the document width pixel number M. The predetermined interval is an interval automatically determined by dividing the document width pixel number M by the numerical value of the search variable PF.

後端変数pが検索終了変数PF以上であると判断した場合(S405:YES)、CPU90は、検索した後端エッジ点EP(0)、EP(1)・・・・EP(PF)に対して公知技術である最小二乗法による直線式を算出する(S406)。CPU90は、RAM93に記憶された後端エッジライン数EEを、読取開始位置PSから副走査方向の算出した直線式までの画素数としてRAM93に記憶し直す(S407)。CPU90は、図12(B)に示すように、画像処理部94によって、RAM93に記憶された読取画像GAから見開き原稿BKに対応する画像GKを画像抽出する(S408)。CPU90は、図12(C)に示すように、画像処理部94によって、出力範囲OAにおいて、抽出した見開き原稿BKに対応する画像GKを、副走査方向の出力範囲OAの右端ライン数SEに近づく方向に、(SE−EE)/2だけ移動して画像配置し、RAM93に記憶する(S409)。CPU90は、画像形成部によって出力範囲OAにおける画像データを記録紙に出力する(S410)。なお、出力範囲OAは、定形サイズのうちのいずれかのサイズに対応する出力範囲としてROM92に記憶してもよいし、もしくは操作部7によって、ユーザから入力された定形サイズに対応する出力範囲であってもよい。   If it is determined that the rear end variable p is equal to or more than the search end variable PF (S405: YES), the CPU 90 executes a search for the rear end edge points EP (0), EP (1),. A linear equation is calculated by the least squares method which is a known technique (S406). The CPU 90 re-stores the number EE of rear end edge lines stored in the RAM 93 in the RAM 93 as the number of pixels from the reading start position PS to the linear formula calculated in the sub-scanning direction (S407). As shown in FIG. 12B, the CPU 90 causes the image processing unit 94 to extract an image GK corresponding to the spread original BK from the read image GA stored in the RAM 93 (S408). As shown in FIG. 12C, the CPU 90 causes the image processing unit 94 to bring the image GK corresponding to the spread document BK extracted in the output range OA closer to the right end line number SE of the output range OA in the sub scanning direction. The image is moved by (SE-EE) / 2 in the direction, and stored in the RAM 93 (S409). The CPU 90 causes the image forming unit to output the image data in the output range OA onto a recording sheet (S410). The output range OA may be stored in the ROM 92 as an output range corresponding to any of the fixed sizes, or in the output range corresponding to the fixed size input from the user by the operation unit 7 It may be.

[作用効果]
本実施形態における複合機1は、見開き原稿BKを支持するプラテンガラス2と、主走査方向に見開き原稿BKのラインデータを読み取る読取部4と、副走査方向に、読取開始位置PSから読取終了位置PEに向けて読取部4を移動させる駆動部5と、読取部4によって読み取られたライン画像に係る画像データにエッジ強調処理を行い、エッジ画像データを生成するエッジ画像生成部103と、主走査方向のラインをカウントするラインカウンタ104と、画像データを所定の出力範囲OAで出力する画像形成部10と、CPU90と、を備えている。CPU90は、S3の処理によって、読取部4に見開き原稿BKのラインデータを読み取らせ、S7の処理によって、読取部4による読取終了を判断し、S401〜S405の処理によって見開き原稿BKの右頁BKRに対応する画像GRの後端エッジを検出し、S400、S406〜S410の処理によって、出力範囲OAにおいて、見開き原稿BKの画像GKを、副走査方向に(SE−EE)/2だけ移動させて配置し、S411の処理によって、出力範囲OAにおける画像を記録紙に出力する。
[Function effect]
The multi-function device 1 according to the present embodiment includes the platen glass 2 supporting the spread original BK, the reading unit 4 reading line data of the spread original BK in the main scanning direction, and the reading end position from the reading start position PS in the sub scanning direction. A driving unit 5 for moving the reading unit 4 toward the PE, an edge image generation unit 103 for performing edge enhancement processing on image data related to a line image read by the reading unit 4 to generate edge image data, and main scanning A line counter 104 that counts lines in the direction, an image forming unit 10 that outputs image data in a predetermined output range OA, and a CPU 90 are provided. The CPU 90 causes the reading unit 4 to read the line data of the spread original BK by the process of S3, determines the end of reading by the reading unit 4 by the process of S7, and processes the right page BKR of the spread original BK by the processes of S401 to S405. Is detected, and the image GK of the double-page spread original BK is moved by (SE-EE) / 2 in the subscanning direction in the output range OA by the processing of S400 and S406 to S410. Then, the image in the output range OA is output to a recording sheet by the processing of S411.

これにより、ユーザは、見開き原稿の画像の中心位置を記録紙の中心位置に合わせて、見開き原稿の画像を記録紙に画像形成することができる。   Thus, the user can form the image of the spread original on the recording sheet by aligning the center position of the image of the spread original with the center position of the recording sheet.

[実施形態と発明との対応関係]
複合機1が、本発明の画像読取装置の一例である。CPU90が、本発明の制御部の一例である。プラテンガラス2が、本発明の原稿台の一例である。S3〜S7が、本発明の読取処理の一例である。エッジ閾値Ehが、本発明の第1閾値の一例である。S201及びS205〜S209が、本発明のエッジ判断処理の一例である。灰色濃度閾値Ghが、本発明の第2閾値の一例である。割合閾値Whが、本発明の第3閾値の一例である。S211〜S213、及びS300〜S303が、本発明の濃度判断処理の一例である。S215が、本発明の移動停止処理の一例である。S206、S207、及びS216〜S218が、本発明のエッジ判断制御処理の一例である。S301、及びS304〜S306が、本発明の濃度判断制御処理の一例である。原稿幅画素数Mが、本発明の主走査原稿幅の一例である。原稿傾きθkが、本発明の主走査原稿傾きの一例である。S100〜S107が、本発明の原稿決定処理の一例である。S5が、本発明の特定ライン決定処理の一例である。S6が、本発明のライン数判断処理の一例である。画像形成部10が、本発明の画像出力部の一例である。S400が、本発明の読取終了ライン記憶処理の一例である。S401〜S405、S412が、本発明の後端エッジ検出処理の一例である。S406及びS407が、本発明の後端ライン決定処理の一例である。S408が、本発明の画像抽出処理の一例である。S409が、本発明の画像出力範囲決定処理の一例である。S410が、本発明の画像出力処理の一例である。
[Correspondence between embodiment and invention]
The multifunction device 1 is an example of the image reading apparatus of the present invention. The CPU 90 is an example of the control unit of the present invention. The platen glass 2 is an example of the document table of the present invention. S3 to S7 are an example of the reading process of the present invention. The edge threshold Eh is an example of the first threshold of the present invention. S201 and S205 to S209 are an example of the edge determination process of the present invention. The gray density threshold Gh is an example of the second threshold of the present invention. The ratio threshold value Wh is an example of the third threshold value of the present invention. S211 to S213 and S300 to S303 are examples of the concentration determination process of the present invention. S215 is an example of the movement stop process of the present invention. S206, S207, and S216 to S218 are examples of the edge determination control process of the present invention. S301 and S304 to S306 are examples of the concentration determination control process of the present invention. The document width pixel number M is an example of the main scanning document width of the present invention. The document inclination θk is an example of the main scanning document inclination of the present invention. S100 to S107 are an example of the document determination process of the present invention. S5 is an example of the specific line determination process of the present invention. S6 is an example of the line number determination process of the present invention. The image forming unit 10 is an example of the image output unit of the present invention. S400 is an example of the reading end line storage process of the present invention. S <b> 401 to S <b> 405 and S <b> 412 are examples of the trailing edge detection process of the present invention. S406 and S407 are an example of the rear end line determination process of the present invention. S408 is an example of the image extraction process of the present invention. S409 is an example of the image output range determination process of the present invention. S410 is an example of the image output process of the present invention.

[変形例]
本発明は上記記述及び図面によって説明した実施形態に限定されるものではなく、例えば、次のように本実施形態を変更してもよい。
[Modification]
The present invention is not limited to the embodiments described above with reference to the drawings. For example, the present embodiment may be modified as follows.

(1)本実施形態では、エッジ判断対象範囲の主走査方向の画素数を、原稿幅エッジ画素数Mで構成しているが、この構成に限定されない。エッジ判断対象範囲の主走査方向の画素数を所定の複数の画素数で構成してもよい。また、本実施形態では、エッジ判断対象範囲の副走査方向の画素数を、所定の複数の画素数である副走査エッジ判断画素数N1で構成しているが、この構成に限定されない。S4の処理によって、決定された原稿幅画素数M及び原稿傾きθkに基づいて、M×sinθkで表される副走査方向の画素数を、エッジ判断対象範囲の副走査方向の画素数とする構成であってもよい。   (1) In the present embodiment, the number of pixels in the main scanning direction of the edge determination target range is configured by the document width edge pixel number M, but the present invention is not limited to this configuration. The number of pixels in the main scanning direction of the edge determination target range may be configured with a predetermined number of pixels. Further, in the present embodiment, the number of pixels in the sub-scanning direction of the edge determination target range is configured with the number N1 of sub-scanning edge determination pixels, which is a predetermined plurality of pixels, but is not limited to this configuration. A configuration in which the number of pixels in the subscanning direction represented by M × sin θk is the number of pixels in the subscanning direction of the edge determination target range based on the document width pixel number M and the document inclination θk determined by the process of S4. It may be

(2)実施形態では、エッジ判断対象範囲P(m,n)〜P(M,n+N1)を、エッジ判断対象ブロックに分割する構成としているが、この構成に限定されない。エッジ判断対象範囲P(m,n)〜P(M,n+N1)をエッジ判断対象ブロックに分割しない構成であってもよい。この場合、CPU90は、S206の処理において、エッジ判断対象範囲P(m,n)〜P(M,n+N1)におけるエッジ画素値を取得する。CPU90は、S207の処理において、S206の処理によって取得したエッジ画素値について、副走査方向に沿った複数のエッジ画素値のいずれかがエッジ閾値Eh以上であるか否かの判断を、エッジ判断対象範囲の主走査方向の複数の画素毎に行う。   (2) In the embodiment, the edge determination target ranges P (m, n) to P (M, n + N1) are divided into edge determination target blocks, but the present invention is not limited to this configuration. The edge determination target ranges P (m, n) to P (M, n + N1) may not be divided into edge determination target blocks. In this case, the CPU 90 acquires edge pixel values in the edge determination target range P (m, n) to P (M, n + N1) in the process of S206. In the process of S207, the CPU 90 determines whether the edge pixel value acquired in the process of S206 is one of a plurality of edge pixel values in the sub-scanning direction being equal to or greater than the edge threshold Eh. This is performed for each of a plurality of pixels in the main scanning direction of the range.

(3)本実施形態では、濃度判断対象範囲の主走査方向の画素数を、原稿幅エッジ画素数Mで構成しているが、この構成に限定されない。濃度判断対象範囲の主走査方向の画素数を所定の複数の画素数で構成してもよい。また、本実施形態では、濃度判断対象範囲の副走査方向の画素数を、所定の複数の画素数である副走査濃度判断画素数N2で構成しているが、この構成に限定されない。図10(B)に示す原稿載置面2aに対するブック原稿BKの右端部BRAの傾きθwと、読取部4の焦点深度Wkとに基づいて、Wk/tanθwで算出される副走査方向の距離に対応する画素数を、副走査濃度判断画素数N2とする構成であってもよい。これにより、CPU90が、S207及びS208の処理によって、エッジ検出フラグがオンとなった後(S207:YES、S208:YES、S209)、濃度判断対象範囲に灰色濃度閾値以下となる画素数の割合が、割合閾値以上となる確率を高め、CPU90は、S214及びS215の処理を早期に実行することが可能となる。   (3) In the present embodiment, the number of pixels in the main scanning direction of the density determination target range is configured by the document width edge pixel number M, but the present invention is not limited to this configuration. The number of pixels in the main scanning direction of the density determination target range may be configured with a predetermined number of pixels. Further, in the present embodiment, the number of pixels in the sub-scanning direction of the density determination target range is configured with the number N2 of sub-scanning density determination pixels, which is a predetermined plurality of pixels, but is not limited to this configuration. Based on the inclination θw of the right end portion BRA of the book document BK with respect to the document placement surface 2a shown in FIG. 10B and the depth of focus Wk of the reading unit 4, the distance in the sub scanning direction calculated by Wk / tan θw The corresponding pixel number may be set to the sub-scanning density determination pixel number N2. As a result, after the edge detection flag is turned on by the process of S207 and S208 by the CPU 90 (S207: YES, S208: YES, S209), the ratio of the number of pixels having the gray density threshold or less in the density determination target range is As a result, the CPU 90 can execute the processing of S214 and S215 early.

(4)本実施形態では、画像処理部94に解像度変換部101が含まれる構成としているが、この構成に限定されない。読取部4によって読み取られたRGB各色それぞれのラインデータを解像度変換部101に接続することなく、色変換部102に接続するとともに、濃度画像データとしてRAM93に出力して記憶する構成であってもよい。   (4) In the present embodiment, the resolution conversion unit 101 is included in the image processing unit 94, but the present invention is not limited to this configuration. The line data of each of the RGB colors read by the reading unit 4 may be connected to the color conversion unit 102 without being connected to the resolution conversion unit 101, and may be output and stored in the RAM 93 as density image data. .

(5)本実施形態では、濃度判断対象範囲において、灰色濃度閾値以下である濃度画素値となる濃度判断対象範囲の全画素数に対する割合を、灰色濃度閾値以下である濃度画素値に対して濃度判断対象範囲の全画素数を除算して算出する構成としたが、この構成に限定されない。灰色濃度閾値以下の濃度画素値となる濃度判断対象範囲の全画素数に対する割合を、灰色濃度閾値以下である濃度画素値となる濃度画素数とする構成であってもよい。   (5) In the present embodiment, in the density determination target range, the ratio to the total number of pixels of the density determination target range which is the density pixel value equal to or less than the gray density threshold is the density relative to the density pixel value equal to or less than the gray density threshold Although the configuration is such that calculation is performed by dividing the total number of pixels in the determination target range, the present invention is not limited to this configuration. The ratio of the density determination target range in which the density pixel value is equal to or less than the gray density threshold to the total number of pixels may be set as the number of density pixels in which the density pixel value is equal to or less than the gray density threshold.

(6)本実施形態では、所定の変数nsを1とする構成としているが、この構成に限定されない。所定の変数nsを、2以上で、かつ、所定ライン数LN未満である数値とする構成であってもよい。   (6) Although the predetermined variable ns is set to 1 in the present embodiment, the present invention is not limited to this structure. The predetermined variable ns may be a numerical value which is 2 or more and less than the predetermined line number LN.

(7)本実施形態では、図5に示すS5及びS6の処理を実行する構成としたが、この構成に限定されない。CPU90は、S4の処理を実行後、S7の処理を実行する構成であってもよい。   (7) Although this embodiment is configured to execute the processes of S5 and S6 shown in FIG. 5, the present invention is not limited to this configuration. The CPU 90 may be configured to execute the process of S7 after performing the process of S4.

(8)本実施形態では、S5の処理において、CPU90は、画素数2SWから見開き原稿BKの右端部BRAの短辺幅に対応する画素数RSWを減算した画素数LSWを算出し、画素数LSWを、判断開始ライン数として決定する構成としたが、この構成に限定されない。画素数2SWから見開き原稿BKの右端部BRAの短辺幅に対応する画素数RSWを減算し、さらに所定の画素数を減算して画素数LSWを算出し、判断開始ライン数として決定する構成であってもよい。所定の画素数は、判断開始ライン数LSWを、見開き原稿BKの右端部BRAより副走査方向の読取開始位置PSに近づけるための画素数である。所定の画素数は、S4の処理によって、決定された原稿幅画素数M及び原稿傾きθkに基づいて、M×sinθkで表される副走査方向の画素数としてもよい。これにより、見開き原稿BKが、主走査方向に対して原稿傾きθkだけ傾いていた場合であっても、エッジ閾値Eh以上となるエッジ画素値の検出精度を向上させることができる。   (8) In the present embodiment, in the process of S5, the CPU 90 calculates the number of pixels LSW obtained by subtracting the number of pixels RSW corresponding to the short side width of the right edge portion BRA of the spread document BK from the number of pixels 2SW. Although it is set as a structure which determines as a judgment start line number, it is not limited to this structure. The number of pixels RSW corresponding to the short side width of the right end portion BRA of the spread original BK is subtracted from the number of pixels 2SW, and the predetermined number of pixels is further subtracted to calculate the number of pixels LSW. It may be. The predetermined number of pixels is the number of pixels for bringing the determination start line number LSW closer to the reading start position PS in the sub scanning direction from the right end portion BRA of the double-page spread original BK. The predetermined number of pixels may be the number of pixels in the sub-scanning direction represented by M × sin θk, based on the document width pixel number M and the document inclination θk determined in the process of S4. As a result, even when the double-page spread original BK is inclined with respect to the main scanning direction by the original inclination θk, it is possible to improve the detection accuracy of the edge pixel value which is equal to or higher than the edge threshold Eh.

(9)本実施形態では、解像度変換部101の後段で、かつ色変換部102の手前でRGB各色それぞれのライン画像データを濃度画像データとしてそれぞれRAM93に記憶する構成としたが、この構成に限定されない。色変換部102の後段で、かつエッジ画像生成部103の手前で、各画素の輝度値のデータを濃度画像データとしてRAM93に記憶する構成であってもよい。この場合、CPU90は、S211の処理を各画素の輝度値のデータで構成された濃度画像データに対して実行し、S212及びS213の処理を実行しなくてもよい。   (9) In the present embodiment, the line image data of each of the RGB colors is stored in the RAM 93 as density image data after the resolution conversion unit 101 and before the color conversion unit 102. However, the present invention is limited to this configuration. I will not. The data of the luminance value of each pixel may be stored as the density image data in the RAM 93 after the color conversion unit 102 and before the edge image generation unit 103. In this case, the CPU 90 may execute the process of S211 on density image data configured of data of the luminance value of each pixel, and may not execute the processes of S212 and S213.

(10)本実施形態では、S214の処理を実行する構成としたが、これに限定されない。CPU90は、S213の処理を実行後、S214の処理を実行することなく、S215の処理を実行する構成であってもよい。この場合、CPU90は、S8の処理を実行後、S214の処理を実行し、S214の処理の実行後、S9の処理を実行する。   (10) In the present embodiment, the processing of S214 is performed, but the present invention is not limited to this. After executing the processing of S213, the CPU 90 may execute the processing of S215 without executing the processing of S214. In this case, the CPU 90 executes the process of S <b> 8 and then executes the process of S <b> 214, and executes the process of S <b> 9 after the process of S <b> 214.

2…プラテンガラス、4…読取部、5…駆動部、103…エッジ画像生成部、
90…CPU、1…複合機
2 ... platen glass, 4 ... reading unit, 5 ... driving unit, 103 ... edge image generating unit,
90 CPU, 1 multifunction machine

Claims (8)

原稿を支持する原稿台と、
主走査方向に原稿のライン画像を読み取る読取部と、
前記主走査方向と直交する副走査方向に、読取開始位置から読取終了位置に向けて前記読取部を移動させる駆動部と、
前記読取部によって読み取られた前記ライン画像に係る画像データにエッジ強調処理を行い、エッジ画像データを生成するエッジ画像生成部と、
制御部と、を備え、
前記制御部は、
前記駆動部に前記副走査方向の前記読取開始位置から前記読取終了位置に向けて前記読取部を移動させながら、前記読取部に前記ライン画像を読み取らせる読取処理と、
前記エッジ画像生成部により生成された前記エッジ画像データから、前記副走査方向に複数の画素および前記主走査方向に複数の画素からなるエッジ判断対象範囲のエッジ画素値を取得し、取得した前記エッジ判断対象範囲の前記エッジ画素値について、前記副走査方向に沿った前記複数の画素に係る前記エッジ画素値のいずれかが第1閾値以上であるか否かの判断を、前記主走査方向に沿った前記複数の画素毎に行うエッジ判断処理と、
前記エッジ判断処理により、前記主走査方向に沿った前記複数の画素全てにおいて、前記副走査方向に沿った前記複数の画素に係る前記エッジ画素値のいずれかが第1閾値以上であると判断した場合、前記画像データのうち前記エッジ判断対象範囲に対応する位置よりも前記副走査方向において前記読取終了位置に近い画像データから、前記副走査方向に複数の画素および前記主走査方向に複数の画素からなる濃度判断対象範囲の画素値を取得し、取得した前記濃度判断対象範囲の前記画素値について、前記画素値の取り得る最小値及び最大値を除いて第2閾値以下である画素値となる前記濃度判断対象範囲の全画素数に対応する割合が第3閾値以上であるか否かの判断を行う濃度判断処理と、
前記濃度判断処理により、前記割合が前記第3閾値以上であると判断した場合、前記駆動部に前記副走査方向に移動している前記読取部を停止させる移動停止処理と、
を実行する、画像読取装置。
A manuscript support for supporting the manuscript,
A reading unit that reads a line image of a document in the main scanning direction;
A driving unit for moving the reading unit from a reading start position toward a reading end position in a sub-scanning direction orthogonal to the main scanning direction;
An edge image generation unit that performs edge enhancement processing on image data relating to the line image read by the reading unit to generate edge image data;
And a control unit,
The control unit
Reading processing for causing the reading unit to read the line image while moving the reading unit from the reading start position in the sub scanning direction to the reading end position in the driving unit;
An edge pixel value of an edge determination target range including a plurality of pixels in the sub scanning direction and a plurality of pixels in the main scanning direction is acquired from the edge image data generated by the edge image generation unit, and the acquired edge With respect to the edge pixel value in the determination target range, it is determined whether or not any of the edge pixel values of the plurality of pixels along the sub scanning direction is equal to or greater than a first threshold, along the main scanning direction. Edge determination processing performed for each of the plurality of pixels;
In the edge determination processing, it is determined that, in all the plurality of pixels along the main scanning direction, any of the edge pixel values of the plurality of pixels along the sub scanning direction is equal to or greater than a first threshold In this case, from the image data closer to the reading end position in the sub scanning direction than the position corresponding to the edge determination target range in the image data, a plurality of pixels in the sub scanning direction and a plurality of pixels in the main scanning direction The pixel value of the density determination target range consisting of is obtained, and the obtained pixel value of the density determination target range becomes a pixel value equal to or less than the second threshold except for the minimum value and the maximum value that can be taken of the pixel value. Density determination processing for determining whether a ratio corresponding to the total number of pixels in the density determination target range is equal to or greater than a third threshold;
Movement stop processing for causing the drive unit to stop the reading unit moving in the sub scanning direction when it is determined by the density determination processing that the ratio is equal to or more than the third threshold;
Perform an image reader.
請求項1に記載の画像読取装置において、
前記制御部は、
前記エッジ判断処理により、前記主走査方向に沿った前記複数の画素のうち少なくとも1つ以上の画素において、前記副走査方向に沿った前記複数の画素全てにそれぞれ係る全ての前記エッジ画素値が第1閾値未満であると判断した場合、前記エッジ判断対象範囲から前記副走査方向の前記読取終了位置に向かって所定数の画素まで離れたエッジ判断対象範囲を新たなエッジ判断対象範囲として前記エッジ判断処理を再度実行するエッジ判断制御処理と、
前記濃度判断処理により、前記割合が前記第3閾値未満であると判断した場合、前記エッジ判断対象範囲に対応する位置から前記副走査方向の前記読取終了位置に向かって所定数の画素まで離れた位置を新たなエッジ判断対象範囲に対応する位置として前記濃度判断処理を再度実行する濃度判断制御処理と、を実行する、画像読取装置。
In the image reading apparatus according to claim 1,
The control unit
According to the edge determination processing, in at least one or more pixels among the plurality of pixels along the main scanning direction, all the edge pixel values respectively related to all the plurality of pixels along the sub scanning direction If it is determined that the value is less than one threshold, the edge determination range is determined as a new edge determination range, which is a predetermined number of pixels away from the edge determination range toward the reading end position in the sub scanning direction. Edge determination control processing that executes the processing again;
When it is determined by the density determination process that the ratio is less than the third threshold, a predetermined number of pixels are separated from the position corresponding to the edge determination target range toward the reading end position in the sub scanning direction An image reading apparatus that executes density determination control processing that executes the density determination processing again as a position corresponding to a new edge determination target range;
請求項2に記載の画像読取装置において、
前記制御部は、
前記読取処理の開始後、前記エッジ画像データにおける前記原稿の先端エッジまたは側端エッジを検出することにより前記原稿の主走査原稿幅および前記原稿の主走査原稿傾きを決定する原稿決定処理を実行し、
前記エッジ判断対象範囲は、
前記制御部により前記主走査原稿幅に基づいて決められる前記主走査方向に複数の画素および前記主走査原稿幅と前記主走査原稿傾きとに基づいて決められる前記副走査方向に複数の画素からなる範囲であり、
前記新たなエッジ判断対象範囲は、
前記エッジ判断対象範囲から前記副走査方向の前記読取終了位置に向かって1つの画素まで離れたエッジ判断対象範囲である、画像読取装置。
In the image reading apparatus according to claim 2,
The control unit
After the start of the reading process, an original determination process is performed to determine the main scanning original width of the original and the main scanning inclination of the original by detecting the leading edge or the side edge of the original in the edge image data. ,
The edge judgment target range is
The control unit comprises a plurality of pixels in the main scanning direction determined based on the main scanning document width, and a plurality of pixels in the sub scanning direction determined based on the main scanning document width and the main scanning document inclination. Range,
The new edge judgment target range is
An image reading apparatus, which is an edge determination target range separated from the edge determination target range by one pixel toward the reading end position in the sub scanning direction.
請求項2に記載の画像読取装置において、
前記濃度判断対象範囲は、
前記副走査方向の前記読取終了位置に向かう方向の前記原稿の側端部の前記原稿台に対する傾きおよび前記読取部の焦点深度に基づいて予め決められた前記副走査方向に複数の画素および前記主走査方向に複数の画素からなる範囲である、画像読取装置。
In the image reading apparatus according to claim 2,
The concentration judgment target range is
A plurality of pixels and the main in the sub-scanning direction predetermined based on the inclination of the side end of the document in the sub-scanning direction toward the reading end position with respect to the document table and the focal depth of the reading unit An image reading apparatus which is a range consisting of a plurality of pixels in a scanning direction.
請求項4に記載の画像読取装置において、
前記エッジ判断対象範囲は、
前記エッジ解析画像データにおいて、前記主走査方向の1つの画素データである特定画素データを基準として、当該特定画素データから前記移動方向に前記エッジ副走査幅の範囲まで含まれる画素データで構成されたエッジ判断対象ブロックを1つの単位として、前記特定画素データから前記主走査原稿幅の範囲の画素データの数だけ前記主走査方向に沿って構成された複数の前記エッジ判断対象ブロックからなる範囲であり、
前記エッジ判断処理は、
前記エッジ判断対象ブロック毎に、前記エッジ画素データをそれぞれ取得し、前記取得されたエッジ画素データが、前記エッジ判断対象ブロック毎に前記第1閾値以上存在するか否かを全てのエッジ判断対象ブロックに対して判断し、
前記エッジ判断制御処理は、
前記エッジ判断処理の結果、前記全てのエッジ判断対象ブロックのうち、1つのエッジ判断対象ブロックにおいて、前記取得されたエッジ画素データが、前記第1閾値以上存在しないと判断した場合、前記特定画素データを前記移動方向に所定数の画素データだけ離れた画素データを新たな特定画素データとして前記エッジ判断処理を再度実行する、画像読取装置。
In the image reading apparatus according to claim 4,
The edge judgment target range is
In the edge analysis image data, it is constituted by pixel data including the specific pixel data which is one pixel data in the main scanning direction as a reference to the range of the edge sub-scanning width in the moving direction from the specific pixel data. The edge determination target block is a range consisting of a plurality of the edge determination target blocks configured along the main scanning direction by the number of pixel data in the range of the main scanning document width from the specific pixel data as one unit ,
The edge determination process is
The edge pixel data is acquired for each of the edge determination target blocks, and all the edge determination target blocks have the acquired first edge threshold data or more for each of the edge determination target blocks. Judge against
The edge determination control process is
When it is determined that the acquired edge pixel data does not exist in the one edge determination target block among all the edge determination target blocks as the result of the edge determination processing, the specific pixel data is not present An image reading apparatus that executes again the edge determination processing as new specified pixel data with pixel data separated by a predetermined number of pixel data in the movement direction.
請求項2に記載の画像読取装置において、
前記読取部は、
前記主走査方向のライン毎に原稿の画像を読み取り、
前記エッジ画像生成部は、
前記主走査方向のライン毎に、前記解析画像データに対してエッジ強調処理を行い、前記主走査方向のライン毎に、画素単位で各画素の画素値が所定の閾値以上となる画素をエッジ画素としてエッジ画像データを生成し、
前記主走査方向のライン数をカウントするラインカウンタを備え、
前記制御部は、
前記原稿決定処理によって決定された主走査原稿幅に基づいて、前記主走査方向の特定ラインのライン数を決定する特定ライン決定処理と、
前記ラインカウンタによってカウントされた前記主走査方向のライン数が前記特定ラインのライン数と等しいか否かを判断するライン数判断処理と、を実行し、
前記ライン数判断処理の結果、前記カウントされた主走査方向のライン数が前記特定ラインのライン数と等しいと判断した場合、前記特定ラインにおける特定画素を基準として前記エッジ取得判断処理を実行する、画像読取装置。
In the image reading apparatus according to claim 2,
The reading unit is
Reading an image of a document for each line in the main scanning direction;
The edge image generation unit
Edge enhancement processing is performed on the analysis image data for each line in the main scanning direction, and pixels for which the pixel value of each pixel is equal to or more than a predetermined threshold in each pixel in the main scanning direction are edge pixels Generate edge image data as
A line counter for counting the number of lines in the main scanning direction;
The control unit
A specific line determination process of determining the number of lines of a specific line in the main scanning direction based on the main scanning document width determined by the original determination process;
Performing a line number determination process of determining whether the number of lines in the main scanning direction counted by the line counter is equal to the number of lines of the particular line;
When it is determined that the counted number of lines in the main scanning direction is equal to the number of lines of the specific line as a result of the line number determination process, the edge acquisition determination process is executed based on a specific pixel in the specific line. Image reader.
請求項6に記載の画像読取装置において、
画像データを所定の出力範囲で出力する画像出力部を備え、
前記制御部は、
前記読取終了処理の実行後、前記ラインカウンタによってカウントされた読取終了ラインのライン数を記憶する読取終了ライン記憶処理と、前記エッジ画像データにおいて前記原稿の後端エッジを検出する後端エッジ検出処理と、前記検出された原稿の後端エッジおよび前記読取終了ラインのライン数に基づいて、前記後端エッジのライン数を決定する後端ライン決定処理と、前記後端エッジに基づいて、前記読取部によって読み取られた画像データを抽出する画像抽出処理と、前記主走査原稿幅に基づいて、前記出力範囲を決定する出力範囲決定処理と、前記特定ラインおよび前記後端エッジのライン数に基づいて、前記抽出された読取画像データを、前記決定された出力範囲内に配置する画像出力処理と、を実行する、画像読取装置。
In the image reading apparatus according to claim 6,
An image output unit for outputting image data in a predetermined output range;
The control unit
Reading end line storing processing for storing the line number of reading ending lines counted by the line counter after execution of the reading end processing, and rear end edge detection processing for detecting the rear end edge of the document in the edge image data And, on the basis of the rear end edge, the rear end line determination processing for determining the number of lines of the rear end edge based on the detected rear end edge of the document and the number of lines of the reading completion line. And an output range determining process for determining the output range based on the main scanning document width based on an image extracting process for extracting image data read by a copy unit, and based on the number of lines of the specific line and the rear end edge. An image output process of arranging the extracted read image data within the determined output range.
原稿を支持する原稿台と、主走査方向に原稿のライン画像を読み取る読取部と、前記主走査方向と直交する副走査方向に、読取開始位置から読取終了位置に向けて前記読取部を移動させる駆動部と、前記読取部によって読み取られた前記ライン画像に係る画像データにエッジ強調処理を行い、エッジ画像データを生成するエッジ画像生成部と、を備える画像読取装置の制御部が、実行する画像読取プログラムであって、
前記駆動部に前記副走査方向の前記読取開始位置から前記読取終了位置に向けて前記読取部を移動させながら、前記読取部に前記ライン画像を読み取らせる読取処理と、
前記エッジ画像生成部により生成された前記エッジ画像データから、前記副走査方向に複数の画素および前記主走査方向に複数の画素からなるエッジ判断対象範囲のエッジ画素値を取得し、取得した前記エッジ判断対象範囲の前記エッジ画素値について、前記副走査方向に沿った前記複数の画素に係る前記エッジ画素値のいずれかが第1閾値以上であるか否かの判断を、前記主走査方向に沿った前記複数の画素毎に行うエッジ判断処理と、
前記エッジ判断処理により、前記主走査方向に沿った前記複数の画素全てにおいて、前記副走査方向に沿った前記複数の画素に係る前記エッジ画素値のいずれかが第1閾値以上であると判断した場合、前記画像データのうち前記エッジ判断対象範囲に対応する位置よりも前記副走査方向において前記読取終了位置に近い画像データから、前記副走査方向に複数の画素および前記主走査方向に複数の画素からなる濃度判断対象範囲の画素値を取得し、取得した前記濃度判断対象範囲の前記画素値について、前記画素値の取り得る最小値及び最大値を除いて第2閾値以下である画素値となる前記濃度判断対象範囲の全画素数に対応する割合が第3閾値以上であるか否かの判断を行う濃度判断処理と、
前記濃度判断処理により、前記割合が前記第3閾値以上であると判断した場合、前記駆動部に前記副走査方向に移動している前記読取部を停止させる移動停止処理と、
を実行する画像読取プログラム。
An original support plate for supporting an original, a reading unit for reading a line image of the original in the main scanning direction, and the reading unit from the reading start position to the reading end position in the sub scanning direction orthogonal to the main scanning direction An image to be executed by a control unit of an image reading apparatus including a driving unit, and an edge image generation unit that performs edge enhancement processing on image data related to the line image read by the reading unit and generates edge image data A reading program,
Reading processing for causing the reading unit to read the line image while moving the reading unit from the reading start position in the sub scanning direction to the reading end position in the driving unit;
An edge pixel value of an edge determination target range including a plurality of pixels in the sub scanning direction and a plurality of pixels in the main scanning direction is acquired from the edge image data generated by the edge image generation unit, and the acquired edge With respect to the edge pixel value in the determination target range, it is determined whether or not any of the edge pixel values of the plurality of pixels along the sub scanning direction is equal to or greater than a first threshold, along the main scanning direction. Edge determination processing performed for each of the plurality of pixels;
In the edge determination processing, it is determined that, in all the plurality of pixels along the main scanning direction, any of the edge pixel values of the plurality of pixels along the sub scanning direction is equal to or greater than a first threshold In this case, from the image data closer to the reading end position in the sub scanning direction than the position corresponding to the edge determination target range in the image data, a plurality of pixels in the sub scanning direction and a plurality of pixels in the main scanning direction The pixel value of the density determination target range consisting of is obtained, and the obtained pixel value of the density determination target range becomes a pixel value equal to or less than the second threshold except for the minimum value and the maximum value that can be taken of the pixel value. Density determination processing for determining whether a ratio corresponding to the total number of pixels in the density determination target range is equal to or greater than a third threshold;
Movement stop processing for causing the drive unit to stop the reading unit moving in the sub scanning direction when it is determined by the density determination processing that the ratio is equal to or more than the third threshold;
An image reading program that executes
JP2017172821A 2017-09-08 2017-09-08 Image reader image reading program Pending JP2019050466A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2017172821A JP2019050466A (en) 2017-09-08 2017-09-08 Image reader image reading program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017172821A JP2019050466A (en) 2017-09-08 2017-09-08 Image reader image reading program

Publications (1)

Publication Number Publication Date
JP2019050466A true JP2019050466A (en) 2019-03-28

Family

ID=65905980

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017172821A Pending JP2019050466A (en) 2017-09-08 2017-09-08 Image reader image reading program

Country Status (1)

Country Link
JP (1) JP2019050466A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2021195258A (en) * 2020-06-18 2021-12-27 株式会社Pfu Medium conveying apparatus, control method, and control program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2021195258A (en) * 2020-06-18 2021-12-27 株式会社Pfu Medium conveying apparatus, control method, and control program

Similar Documents

Publication Publication Date Title
JP4752605B2 (en) Image reading device
JP4792926B2 (en) Image reading device
US20100315689A1 (en) Image processing apparatus, image processing method, and image processing program recorded recording medium
JP6338554B2 (en) Image processing apparatus, image processing method, and program
JP2007208617A (en) Image reading apparatus and image reading method
JP2019050466A (en) Image reader image reading program
JP5939017B2 (en) Image reading apparatus and document presence / absence determination program
JP2015198327A (en) Image reading device, image reading method, and computer program
JP2021158562A (en) Image reader
JP6590991B2 (en) Information processing apparatus, information processing apparatus control method, and program
US20150381846A1 (en) Image reading apparatus, image forming apparatus and computer readable medium storing program
JP5768752B2 (en) Image reading apparatus and original arrangement determination program
JP2009135730A (en) Image reader
JP5915256B2 (en) Image reading apparatus and document area determination program
JP2018148445A (en) Image reader, image reading system, and image reading program
JP6561732B2 (en) Reader and program
JP2019080092A (en) Image reader
JP2009111692A (en) Image reader
JP5885766B2 (en) Image processing device
JP2009038429A (en) Image reader
JP2010041595A (en) Image reader, image forming apparatus, image reading method, and computer program
JP6115804B2 (en) Image reading device
JP2020167515A (en) Image reading device, method for controlling image reading device, and program
JP2018026729A (en) Imaging apparatus, imaging method and imaging program
JP6501125B2 (en) Image reading apparatus, image reading method, image forming apparatus, and image reading program