JP2015170128A - Image processor - Google Patents

Image processor Download PDF

Info

Publication number
JP2015170128A
JP2015170128A JP2014044336A JP2014044336A JP2015170128A JP 2015170128 A JP2015170128 A JP 2015170128A JP 2014044336 A JP2014044336 A JP 2014044336A JP 2014044336 A JP2014044336 A JP 2014044336A JP 2015170128 A JP2015170128 A JP 2015170128A
Authority
JP
Japan
Prior art keywords
area
target
target area
image processing
specific object
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2014044336A
Other languages
Japanese (ja)
Other versions
JP6323075B2 (en
Inventor
良平 小澤
Ryohei Ozawa
良平 小澤
長谷川 智彦
Tomohiko Hasegawa
智彦 長谷川
近藤 真樹
Maki Kondo
真樹 近藤
良幸 田中
Yoshiyuki Tanaka
良幸 田中
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 JP2014044336A priority Critical patent/JP6323075B2/en
Publication of JP2015170128A publication Critical patent/JP2015170128A/en
Application granted granted Critical
Publication of JP6323075B2 publication Critical patent/JP6323075B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

PROBLEM TO BE SOLVED: To provide a technology capable of properly generating processed image data representing a processed image obtained by enlargingly expressing a specific object.SOLUTION: An image processing server executes image processing of scan image data including a plurality of objects, and generates processed image data representing a processed image including the plurality of objects. The image processing server determines a margin area BA1 including a text object area OA1, and determines a target area on the basis of the text object area OA1 and the margin area BA1. The target area is an area in which a text object that is enlarged and represented is arranged. The image processing server determines the position of the target area, an aspect ratio, and a size on the basis of two horizontal margin lengths and two vertical margin lengths between the text object area OA1 and the margin area BA1.

Description

本明細書では、原画像データに対して画像処理を実行して、処理済み画像を表わす処理済み画像データを生成する画像処理装置を開示する。   The present specification discloses an image processing apparatus that performs image processing on original image data to generate processed image data representing a processed image.

特許文献5には、画像形成支援装置であるBEP装置が開示されている。BEP装置は、イメージデータ内の文字領域をページ中央に移動するセンタリング処理を実行し、移動後の文字領域の周囲の余白部分に基づいて文字領域の拡大率を算出し、文字領域を拡大する。そして、BEP装置は、拡大前の文字領域の上端と拡大後の文字領域の上端とが一致するように拡大後の文字領域をレイアウトすると共に、元と同じ位置に非文字領域をレイアウトする。これにより、レイアウトがほぼ維持された状態で、文字領域が拡大される。   Patent Document 5 discloses a BEP device that is an image formation support device. The BEP device executes centering processing for moving the character area in the image data to the center of the page, calculates the enlargement ratio of the character area based on the margin around the moved character area, and enlarges the character area. Then, the BEP device lays out the character region after enlargement so that the upper end of the character region before enlargement matches the upper end of the character region after enlargement, and lays out the non-character region at the same position as the original. As a result, the character area is enlarged while the layout is substantially maintained.

特開2012−108750号公報JP 2012-108750 A 特開2012−230623号公報JP 2012-230623 A 特開2011−242987号公報JP 2011-242987 A 特開2010−183484号公報JP 2010-183484 A 特開2005−223824号公報JP-A-2005-223824 特開平5−94511号公報JP-A-5-94511 特開2000−137801号公報JP 2000-137801 A 特開平11−25283号公報Japanese Patent Laid-Open No. 11-25283

“画面サイズに合わせ自動的に改行!文書ファイルをスマートフォン上で読みやすく表示 レイアウト再構築技術「GT-Layout」 オンラインストレージ「Dropbox」向けのサービスをスタート 新開発”、[online]、2012年5月30日、富士フィルム株式会社、[2014年1月24日検索]、インターネット<http://www.fujifilm.co.jp/corporate/news/articleffnr_0647.html>“Automatic line breaks according to screen size! Displaying document files in an easy-to-read format on smartphones Layout reconstruction technology“ GT-Layout ”Online storage“ Dropbox ”service newly developed”, [online], May 2012 30th, Fuji Film Co., Ltd. [Search January 24, 2014], Internet <http://www.fujifilm.co.jp/corporate/news/articleffnr_0647.html>

本明細書では、上記の手法とは異なる手法を利用して、特定オブジェクトが拡大されて表現されている処理済み画像を表わす処理済み画像データを適切に生成し得る技術を提供する。   The present specification provides a technique capable of appropriately generating processed image data representing a processed image in which a specific object is enlarged and expressed using a method different from the above method.

本明細書によって開示される画像処理装置は、取得部と、画像処理実行部と、を備える。取得部は、特定オブジェクトを含む複数個のオブジェクトを含む原画像を表わす原画像データを取得する。画像処理実行部は、原画像データに対して画像処理を実行して、複数個のオブジェクトを含む処理済み画像を表わす処理済み画像データを生成する。処理済み画像では、原画像と比べて、特定オブジェクトが拡大されて表現されている。画像処理実行部は、オブジェクト領域決定部と、スペース領域決定部と、目標領域決定部と、を備える。オブジェクト領域決定部は、原画像内において、複数個のオブジェクトのそれぞれについて、当該オブジェクトを含むオブジェクト領域を決定する。スペース領域決定部は、原画像内において、特定オブジェクトについて決定された特定オブジェクト領域を含むスペース領域を決定する。スペース領域は、複数個のオブジェクトのうちの他のオブジェクトについて決定された他のオブジェクト領域に重複しない。目標領域決定部は、原画像内の特定オブジェクト領域とスペース領域とに基づいて、処理済み画像内の目標領域を決定する。目標領域は、拡大されて表現される特定オブジェクトが配置されるべき領域である。   The image processing apparatus disclosed in this specification includes an acquisition unit and an image processing execution unit. The acquisition unit acquires original image data representing an original image including a plurality of objects including a specific object. The image processing execution unit executes image processing on the original image data, and generates processed image data representing a processed image including a plurality of objects. In the processed image, the specific object is expressed in an enlarged manner as compared with the original image. The image processing execution unit includes an object region determination unit, a space region determination unit, and a target region determination unit. The object area determination unit determines an object area including the object for each of the plurality of objects in the original image. The space area determination unit determines a space area including the specific object area determined for the specific object in the original image. The space area does not overlap with other object areas determined for other objects of the plurality of objects. The target area determination unit determines a target area in the processed image based on the specific object area and the space area in the original image. The target area is an area in which a specific object expressed in an enlarged manner is to be placed.

本明細書によって開示される技術の一つの側面では、目標領域決定部は、特定オブジェクト領域とスペース領域との間の第1方向に沿った2個の余白の長さと、第1方向に直交する第2方向に沿った2個の余白の長さと、に基づいて、処理済み画像内の目標領域の位置を決定する。この構成によると、画像処理装置は、目標領域の位置を適切に決定し得るので、原画像内の複数個のオブジェクトの位置関係をほぼ維持しながら、特定オブジェクトが拡大されて表現されている処理済み画像を表わす処理済み画像データを適切に生成し得る。   In one aspect of the technology disclosed in this specification, the target area determination unit is orthogonal to the length of two margins along the first direction between the specific object area and the space area, and the first direction. Based on the lengths of the two margins along the second direction, the position of the target area in the processed image is determined. According to this configuration, since the image processing apparatus can appropriately determine the position of the target area, the process in which the specific object is expressed in an enlarged manner while substantially maintaining the positional relationship between the plurality of objects in the original image. Processed image data representing a completed image can be appropriately generated.

本明細書によって開示される技術の他の側面では、目標領域決定部は、特定オブジェクト領域とスペース領域との間の第1方向に沿った2個の余白の長さと、第1方向に直交する第2方向に沿った2個の余白の長さと、に基づいて、処理済み画像内の目標領域のアスペクト比を決定する。この構成によると、画像処理装置は、目標領域のアスペクト比を適切に決定し得るので、特定オブジェクトが拡大されて表現されている処理済み画像を表わす処理済み画像データを適切に生成し得る。   In another aspect of the technology disclosed in the present specification, the target area determination unit is orthogonal to the length of two margins along the first direction between the specific object area and the space area, and the first direction. The aspect ratio of the target area in the processed image is determined based on the lengths of the two margins along the second direction. According to this configuration, the image processing apparatus can appropriately determine the aspect ratio of the target area, and thus can appropriately generate processed image data representing the processed image in which the specific object is enlarged and expressed.

上記の画像処理装置を実現するための制御方法、コンピュータプログラム、及び、当該コンピュータプログラムを格納するコンピュータ読取可能記録媒体も新規で有用である。   A control method, a computer program, and a computer-readable recording medium storing the computer program for realizing the image processing apparatus are also novel and useful.

通信システムの構成を示す。1 shows a configuration of a communication system. 画像処理サーバの処理のフローチャートを示す。3 shows a flowchart of processing of an image processing server. 文字列解析処理のフローチャートを示す。The flowchart of a character string analysis process is shown. 結合処理のフローチャートを示す。The flowchart of a joint process is shown. 目標領域決定処理のフローチャートを示す。The flowchart of a target area | region determination process is shown. 余白領域決定処理のフローチャートを示す。The flowchart of a blank area | region determination process is shown. 領域拡大処理のフローチャートを示す。The flowchart of an area expansion process is shown. アスペクト比を維持して目標領域を決定するための処理を説明するための説明図を示す。An explanatory view for explaining processing for determining a target area while maintaining an aspect ratio is shown. アスペクト比を無視して目標領域を決定するための処理を説明するための説明図を示す。An explanatory view for explaining processing for deciding a target area ignoring an aspect ratio is shown. 再配置処理のフローチャートを示す。The flowchart of a rearrangement process is shown. 行数決定処理のフローチャートを示す。The flowchart of a line number determination process is shown. 各文字が再配置されて拡大されるケースAを説明するための説明図を示す。Explanatory drawing for demonstrating the case A where each character is rearranged and expanded is shown. 各文字が再配置されて拡大されるケースBを説明するための説明図を示す。Explanatory drawing for demonstrating the case B where each character is rearranged and expanded is shown. アスペクト比を無視して目標領域を決定するための第2実施例の処理を説明するための説明図を示す。An explanatory view for explaining processing of a 2nd example for ignoring an aspect ratio and determining a target field is shown.

(第1実施例)
(通信システム2の構成)
図1に示されるように、通信システム2は、多機能機10と画像処理サーバ50とを備える。多機能機10と画像処理サーバ50とは、インターネット4を介して、相互に通信可能である。多機能機10は、印刷機能、スキャン機能、コピー機能、FAX機能等を含む多機能を実行可能な周辺機器(即ち図示省略のPC(Personal Computerの略)等の周辺機器)である。画像処理サーバ50は、多機能機10のベンダによってインターネット4上に設けられるサーバである。
(First embodiment)
(Configuration of communication system 2)
As shown in FIG. 1, the communication system 2 includes a multi-function device 10 and an image processing server 50. The multi-function device 10 and the image processing server 50 can communicate with each other via the Internet 4. The multi-function device 10 is a peripheral device that can execute a multi-function including a print function, a scan function, a copy function, a FAX function, etc. (that is, a peripheral device such as a PC (abbreviation of personal computer) not shown). The image processing server 50 is a server provided on the Internet 4 by the vendor of the multi-function device 10.

(多機能機10によって実行される各処理の概要)
多機能機10が実行可能なコピー機能は、モノクロコピー機能とカラーコピー機能とに分類されるが、本実施例では、カラーコピー機能に着目して説明する。カラーコピー機能は、通常カラーコピー機能と文字拡大カラーコピー機能とに分類される。多機能機10は、どちらのカラーコピー機能の実行指示がユーザから与えられる場合でも、まず、スキャン対象の画像を表わすシート(以下では「スキャン対象シート」と呼ぶ)をカラースキャンして、スキャン画像データSIDを生成する。スキャン画像データSIDは、多階調(例えば256階調)のRGBビットマップデータである。
(Outline of each process executed by the multi-function device 10)
Copy functions that can be executed by the multi-function device 10 are classified into a monochrome copy function and a color copy function. In the present embodiment, the description will be made focusing on the color copy function. The color copy function is classified into a normal color copy function and a character enlargement color copy function. Regardless of which color copy function execution instruction is given by the user, the multi-function device 10 first performs color scanning on a sheet representing an image to be scanned (hereinafter referred to as a “scanning sheet”) to obtain a scanned image. A data SID is generated. The scanned image data SID is RGB bitmap data having multiple gradations (for example, 256 gradations).

スキャン画像データSIDによって表わされるスキャン画像SI(即ちスキャン対象シートに表現されている画像)は、白色の背景を有すると共に、2個のテキストオブジェクトOB1,OB2と1個の写真オブジェクトOB3とを含む。テキストオブジェクトOB1は、黒色の複数個の文字「A〜M」によって構成される3行の文字列を含む。テキストオブジェクトOB2は、黒色の複数個の文字「N〜W」によって構成される2行の文字列を含む。なお、文字の色は、黒色とは異なる色(例えば赤色)でもよい。写真オブジェクトOB3は、文字を含まず、複数色によって構成される写真を含む。   The scan image SI represented by the scan image data SID (that is, the image represented on the scan target sheet) has a white background and includes two text objects OB1 and OB2 and one photo object OB3. The text object OB1 includes a three-line character string composed of a plurality of black characters “A to M”. The text object OB2 includes a two-line character string composed of a plurality of black characters “N to W”. The character color may be a color different from black (for example, red). The photo object OB3 does not include characters and includes a photo composed of a plurality of colors.

なお、本実施例の各図では、便宜上、各テキストオブジェクトOB1,OB2を構成する各文字列が、規則的な順序で並ぶアルファベット「A〜W」によって表現されているが、実際には、各文字列は、センテンスを構成している。各文字列(即ち1行の文字列)では、スキャン画像SI内の横方向の左側から右側に向かってセンテンスが進む。また、3行の文字列「A〜M」及び2行の文字列「N〜W」では、スキャン画像SI内の縦方向の上側から下側に向かってセンテンスが進む。なお、以下のいずれの画像(例えば後述の処理済み画像PI)においても、1行の文字列を構成する複数個の文字が並ぶ方向、当該方向に直交する方向を、それぞれ、「横方向」、「縦方向」と呼ぶ。また、左側から右側に向かってセンテンスが進むことから、横方向の左端、横方向の右端のことを、それぞれ、「先端」、「後端」と呼ぶ。   In each figure of this embodiment, for convenience, each character string constituting each text object OB1, OB2 is represented by alphabets “A to W” arranged in a regular order. The character string constitutes a sentence. In each character string (that is, one line of character string), the sentence advances from the left side in the horizontal direction in the scan image SI toward the right side. In the three-line character string “A to M” and the two-line character string “N to W”, sentences progress from the upper side to the lower side in the vertical direction in the scan image SI. In any of the following images (for example, a processed image PI described later), a direction in which a plurality of characters constituting one line of character string are arranged and a direction orthogonal to the direction are respectively referred to as “lateral direction”, This is called “vertical direction”. Since sentences progress from the left side to the right side, the left end in the horizontal direction and the right end in the horizontal direction are referred to as “front end” and “rear end”, respectively.

多機能機10は、ユーザから通常カラーコピー機能の実行指示が与えられる場合には、スキャン画像データSIDを利用して、ユーザによって設定されるコピー倍率に応じて、画像をシート(以下では「印刷対象シート」と呼ぶ)に印刷する。例えば、コピー倍率が等倍である場合には、多機能機10は、スキャン対象シートに表現されている画像と同じサイズを有する画像を印刷対象シートに印刷する。また、例えば、コピー倍率が画像の拡大を示す倍率である場合には、多機能機10は、スキャン対象シートに表現されている画像よりも大きいサイズを有する画像を印刷対象シートに印刷する。この場合、例えば、A4サイズのスキャン対象シートに表現されている画像が拡大されて、A3サイズの印刷対象シートに印刷される。この結果、3個のオブジェクトOB1,OB2,OB3の全てが拡大されて表現されている画像が印刷対象シートに印刷される。   When a normal color copy function execution instruction is given from the user, the multi-function device 10 uses the scanned image data SID to print an image on a sheet (hereinafter “print”) according to the copy magnification set by the user. To the target sheet). For example, when the copy magnification is equal, the multi-function device 10 prints an image having the same size as the image expressed on the scan target sheet on the print target sheet. Further, for example, when the copy magnification is a magnification indicating the enlargement of the image, the multi-function device 10 prints an image having a size larger than the image expressed on the scan target sheet on the print target sheet. In this case, for example, the image expressed on the A4 size scan target sheet is enlarged and printed on the A3 size print target sheet. As a result, an image in which all the three objects OB1, OB2, and OB3 are enlarged and printed is printed on the print target sheet.

一方、多機能機10は、ユーザから文字拡大カラーコピー機能の実行指示が与えられる場合には、インターネット4を介して、スキャン画像データSIDを画像処理サーバ50に送信する。これにより、多機能機10は、インターネット4を介して、画像処理サーバ50から処理済み画像データPIDを受信し、処理済み画像データPIDによって表わされる処理済み画像PIを印刷対象シートに印刷する。特に、多機能機10は、スキャン対象シートと同じサイズ(例えばA4サイズ)を有する印刷対象シートに処理済み画像PIを印刷する。   On the other hand, the multi-function device 10 transmits the scan image data SID to the image processing server 50 via the Internet 4 when an instruction to execute the character enlargement color copy function is given from the user. Accordingly, the multi-function device 10 receives the processed image data PID from the image processing server 50 via the Internet 4 and prints the processed image PI represented by the processed image data PID on the print target sheet. In particular, the multi-function device 10 prints the processed image PI on a print target sheet having the same size (for example, A4 size) as the scan target sheet.

処理済み画像PIでは、スキャン画像SIと比べて、写真オブジェクトOB3が拡大されずに、テキストオブジェクトOB1,OB2が拡大されて表現されている。従って、スキャン画像SI内の各文字のサイズが小さい場合でも、処理済み画像PIでは、各文字のサイズが大きくなるので、ユーザは、処理済み画像PI内の各文字を容易に認識することができる。また、処理済み画像PI内の3行の文字列「A〜M」のうちの先頭行の文字列「A〜F」の文字数(即ち「6」)は、スキャン画像SI内の3行の文字列「A〜M」のうちの先頭行の文字列「A〜E」の文字数(即ち「5」)とは異なる。また、処理済み画像PI内の各文字列の行間(例えば「A〜F」と「G〜L」の行間)の長さは、スキャン画像SI内の各文字列の行間(例えば「A〜E」と「F〜J」の行間)の長さよりも小さい。   In the processed image PI, the text objects OB1 and OB2 are enlarged and expressed without the photographic object OB3 being enlarged compared to the scanned image SI. Therefore, even if the size of each character in the scanned image SI is small, the size of each character is large in the processed image PI, so that the user can easily recognize each character in the processed image PI. . In addition, the number of characters (that is, “6”) of the character string “A to F” in the first line among the three lines of character strings “A to M” in the processed image PI is the number of characters in the three lines in the scanned image SI. It is different from the number of characters (namely, “5”) of the character string “A to E” in the first row of the column “A to M”. In addition, the length of the line between the character strings in the processed image PI (for example, the line space between “A to F” and “G to L”) is the length between the lines of each character string in the scanned image SI (for example, “A to E”). ”And“ F to J ”).

(画像処理サーバ50の構成)
画像処理サーバ50は、多機能機10から受信されるスキャン画像データSIDに対して画像処理を実行して、処理済み画像データPIDを生成し、当該処理済み画像データPIDを多機能機10に送信する。画像処理サーバ50は、ネットワークインターフェース52と、制御部60と、を備える。ネットワークインターフェース52は、インターネット4に接続される。制御部60は、CPU62とメモリ64とを備える。CPU62は、メモリ64に格納されているプログラム66に従って、様々な処理(即ち図2等の処理)を実行するプロセッサである。
(Configuration of the image processing server 50)
The image processing server 50 performs image processing on the scanned image data SID received from the multi-function device 10, generates processed image data PID, and transmits the processed image data PID to the multi-function device 10. To do. The image processing server 50 includes a network interface 52 and a control unit 60. The network interface 52 is connected to the Internet 4. The control unit 60 includes a CPU 62 and a memory 64. The CPU 62 is a processor that executes various processes (that is, the processes in FIG. 2 and the like) according to a program 66 stored in the memory 64.

(画像処理サーバ50によって実行される各処理;図2)
続いて、図2を参照して、画像処理サーバ50のCPU62によって実行される各処理の内容を説明する。CPU62は、インターネット4を介して、多機能機10からスキャン画像データSIDを受信する場合に、図2の処理を開始する。
(Each process executed by the image processing server 50; FIG. 2)
Next, the contents of each process executed by the CPU 62 of the image processing server 50 will be described with reference to FIG. When the CPU 62 receives the scan image data SID from the multi-function device 10 via the Internet 4, the CPU 62 starts the process of FIG.

S100では、CPU62は、文字列解析処理(後述の図3参照)を実行して、スキャン画像SI内の5行の文字列を含む5個の帯状領域LA11〜LA13,LA21,LA22を決定する。   In S100, the CPU 62 executes a character string analysis process (see FIG. 3 described later), and determines five belt-like areas LA11 to LA13, LA21, LA22 including five lines of character strings in the scan image SI.

S200では、CPU62は、結合処理(後述の図4参照)を実行して、2個の結合画像CI1,CI2を表わす2個の結合画像データを生成する。結合画像CI1は、3個の帯状領域LA11〜LA13に含まれる3行の文字列が横方向に沿って直線状に結合(即ち連結)された1行の結合文字列「A〜M」を含む。また、結合画像CI2は、2個の帯状領域LA22,LA23に含まれる2行の文字列が横方向に沿って直線状に結合された1行の結合文字列「N〜W」を含む。   In S200, the CPU 62 executes a combination process (see FIG. 4 described later), and generates two combined image data representing two combined images CI1 and CI2. The combined image CI1 includes one line of combined character strings “A to M” in which three lines of character strings included in the three belt-shaped areas LA11 to LA13 are linearly connected (ie, connected) along the horizontal direction. . The combined image CI2 includes a combined character string “N to W” in which two character strings included in the two strip regions LA22 and LA23 are linearly combined in the horizontal direction.

S300では、CPU62は、目標領域決定処理(後述の図5参照)を実行して、スキャン画像SI内において2個の目標領域TA1,TA2を決定する。スキャン画像SI内の2個の目標領域TA1,TA2は、処理済み画像PI内の2個の目標領域TA1,TA2(S500の処理済み画像PI参照)に一致する。従って、S300の処理は、処理済み画像PI内の2個の目標領域TA1,TA2を決定する処理に等しい。処理済み画像PI内の目標領域TA1、目標領域TA2は、それぞれ、拡大されて表現される文字列「A〜M」、文字列「N〜W」が配置されるべき領域である。   In S300, the CPU 62 executes target area determination processing (see FIG. 5 described later) to determine two target areas TA1 and TA2 in the scan image SI. The two target areas TA1 and TA2 in the scanned image SI coincide with the two target areas TA1 and TA2 in the processed image PI (see the processed image PI in S500). Therefore, the process of S300 is equivalent to the process of determining the two target areas TA1 and TA2 in the processed image PI. The target area TA1 and the target area TA2 in the processed image PI are areas in which the character strings “A to M” and the character strings “N to W” expressed in an enlarged manner are to be arranged, respectively.

S400では、CPU62は、再配置処理(後述の図10参照)を実行して、2個の目標領域TA1,TA2に対応する2個の再配置領域RA1,RA2を決定する。そして、CPU62は、結合画像CI1を表わす結合画像データを利用して、複数個の文字「A〜M」を再配置領域RA1内に再配置することによって、再配置画像RI1を表わす再配置画像データを生成する。CPU62は、さらに、結合画像CI2を表わす結合画像データを利用して、複数個の文字「N〜W」を再配置領域RA2内に再配置することによって、再配置画像RI2を表わす再配置画像データを生成する。   In S400, the CPU 62 executes rearrangement processing (see FIG. 10 described later) to determine two rearrangement areas RA1 and RA2 corresponding to the two target areas TA1 and TA2. Then, the CPU 62 uses the combined image data representing the combined image CI1 to rearrange a plurality of characters “A to M” in the rearrangement region RA1, thereby rearranging the rearranged image data representing the rearranged image RI1. Is generated. The CPU 62 further rearranges a plurality of characters “N to W” in the rearrangement area RA2 by using the combined image data representing the combined image CI2, thereby rearranging the rearranged image data representing the rearranged image RI2. Is generated.

S500では、CPU62は、2個の再配置画像RI1,RI2を表わす2個の再配置画像データを拡大して、2個の拡大画像データを生成する。そして、CPU62は、2個の拡大画像データを利用して、処理済み画像PIを表わす処理済み画像データPIDを生成する。処理済み画像PIでは各文字が拡大されて表現されるが、処理済み画像データPIDは、スキャンデータSIDと同じ画素数を有する。   In S500, the CPU 62 enlarges the two rearranged image data representing the two rearranged images RI1 and RI2, and generates two enlarged image data. Then, the CPU 62 generates processed image data PID representing the processed image PI using the two enlarged image data. In the processed image PI, each character is enlarged and expressed, but the processed image data PID has the same number of pixels as the scan data SID.

S600では、CPU62は、インターネット4を介して、処理済み画像データPIDを多機能機10に送信する。これにより、処理済み画像データPIDによって表わされる処理済み画像PIが対象印刷シートに印刷される。   In S <b> 600, the CPU 62 transmits the processed image data PID to the multi-function device 10 via the Internet 4. As a result, the processed image PI represented by the processed image data PID is printed on the target print sheet.

(文字列解析処理;図3)
続いて、図3を参照して、図2のS100で実行される文字列解析処理の内容を説明する。S110では、CPU62は、スキャン画像データSIDに対して二値化処理を実行して、スキャン画像データSIDと同じ画素数を有する二値データBD(図3では一部のみが示されている)を生成する。CPU62は、まず、スキャン画像データSIDを利用して、スキャン画像SIの背景色(本実施例では白色)を決定する。具体的には、CPU62は、スキャン画像データSID内の複数個の画素の画素値の頻度の分布を示すヒストグラムを生成する。そして、CPU62は、当該ヒストグラムを利用して、最高の頻度を有する画素値(以下では「最高頻度画素値」と呼ぶ)を特定することによって、背景色を決定する。次いで、CPU62は、スキャン画像データSID内の複数個の画素のそれぞれについて、当該画素の画素値が最高頻度画素値に一致する場合には、当該画素に対応する位置に存在する二値データBD内の画素の画素値として「0」を割り当て、当該画素の画素値が最高頻度画素値に一致しない場合には、当該画素に対応する位置に存在する二値データBD内の画素の画素値として「1」を割り当てる。この結果、二値データBDでは、各テキストオブジェクトOB1,OB2に含まれる各文字(例えば「A」,「B」)を表わす各画素が画素値「1」を示し、写真オブジェクトOB3を表わす各画素が画素値「1」を示し、それ以外の各画素(即ち背景を表わす画素)が画素値「0」を示す。なお、以下では、二値データBD内の画素値「1」を示す画素、画素値「0」を示す画素のことを、それぞれ、「ON画素」、「OFF画素」と呼ぶ。
(Character string analysis processing; Fig. 3)
Next, the contents of the character string analysis process executed in S100 of FIG. 2 will be described with reference to FIG. In S110, the CPU 62 executes binarization processing on the scanned image data SID, and outputs binary data BD (only part of which is shown in FIG. 3) having the same number of pixels as the scanned image data SID. Generate. The CPU 62 first determines the background color (white in the present embodiment) of the scan image SI using the scan image data SID. Specifically, the CPU 62 generates a histogram indicating the frequency distribution of pixel values of a plurality of pixels in the scan image data SID. Then, the CPU 62 determines the background color by specifying the pixel value having the highest frequency (hereinafter referred to as “the highest frequency pixel value”) using the histogram. Next, for each of the plurality of pixels in the scan image data SID, the CPU 62, when the pixel value of the pixel matches the highest frequency pixel value, in the binary data BD existing at the position corresponding to the pixel. When “0” is assigned as the pixel value of the pixel and the pixel value of the pixel does not match the highest frequency pixel value, the pixel value of the pixel in the binary data BD existing at the position corresponding to the pixel is “ 1 ”is assigned. As a result, in the binary data BD, each pixel representing each character (eg, “A”, “B”) included in each text object OB1, OB2 indicates a pixel value “1”, and each pixel representing the photographic object OB3. Indicates a pixel value “1”, and other pixels (that is, pixels representing the background) indicate a pixel value “0”. Hereinafter, the pixel indicating the pixel value “1” and the pixel indicating the pixel value “0” in the binary data BD are referred to as “ON pixel” and “OFF pixel”, respectively.

S120では、CPU62は、S110で生成された二値データBDに対してラべリング処理を実行して、二値データBDと同じ画素数を有するラベルデータLD(図3では一部のみが示されている)を生成する。具体的には、CPU62は、二値データBD内の複数個のON画素を2個以上のON画素群に分けて、当該2個以上のON画素群のそれぞれに異なる画素値(例えば「1」、「2」等)を割り当てる。1個のON画素群は、互いに隣接する2個以上のON画素によって構成される。即ち、CPU62は、ラべリング処理の対象の1個のON画素に隣接する8個の隣接画素の中に1個以上のON画素が含まれる場合には、当該対象の1個のON画素と、8個の隣接画素のうちの1個以上のON画素と、を同じON画素群として区分する(即ちグループ化する)。CPU62は、ラべリング処理の対象のON画素を変えながら各ON画素のグループ化を順次実行することによって、2個以上のON画素群を決定する。例えば、図3のラベルデータLDでは、文字「A」を表わす各ON画素(即ち1個のON画素群)に画素値「1」が割り当てられており、文字「B」を表わす各ON画素(即ち他の1個のON画素群)に画素値「2」が割り当てられている。   In S120, the CPU 62 performs a labeling process on the binary data BD generated in S110, and the label data LD having the same number of pixels as the binary data BD (only a part is shown in FIG. 3). Is generated). Specifically, the CPU 62 divides a plurality of ON pixels in the binary data BD into two or more ON pixel groups, and each of the two or more ON pixel groups has a different pixel value (for example, “1”). , “2”, etc.). One ON pixel group is composed of two or more ON pixels adjacent to each other. That is, when one or more ON pixels are included in eight adjacent pixels adjacent to one ON pixel to be labeled, the CPU 62 determines that the target ON pixel , One or more ON pixels among the eight adjacent pixels are divided (ie, grouped) into the same ON pixel group. The CPU 62 determines two or more ON pixel groups by sequentially executing grouping of each ON pixel while changing the ON pixels to be labeled. For example, in the label data LD of FIG. 3, the pixel value “1” is assigned to each ON pixel (that is, one ON pixel group) representing the character “A”, and each ON pixel representing the character “B” ( That is, the pixel value “2” is assigned to the other one ON pixel group).

S130では、CPU62は、S120で生成されたラベルデータLDを利用して、上記の各ON画素群に対応する各単位領域を決定する。各単位領域は、対応する1個のON画素群に外接する矩形の領域である。CPU62は、例えば、図3のラベルデータLDを利用する場合には、画素値「1」が割り当てられているON画素群に外接する単位領域(即ち文字「A」に対応する単位領域)と、画素値「2」が割り当てられているON画素群に外接する単位領域(即ち文字「B」に対応する単位領域)と、を決定する。より具体的には、CPU62は、スキャン画像SIの中から、23個の文字「A」〜「W」に対応する23個の単位領域と、1個の写真オブジェクトOB3に対応する1個の単位領域と、を決定する(即ち、合計で24個の単位領域を決定する)。上記の単位領域の決定は、当該単位領域の各頂点を構成する各画素の位置をメモリ64に記憶することによって実行される。ただし、以下では、「領域(又は位置)の決定」に関する説明において、画素の位置をメモリ64に記憶することに関する説明を省略する。   In S130, the CPU 62 determines each unit area corresponding to each of the ON pixel groups using the label data LD generated in S120. Each unit area is a rectangular area circumscribing one corresponding ON pixel group. For example, when using the label data LD of FIG. 3, the CPU 62 circumscribes the ON pixel group to which the pixel value “1” is assigned (that is, the unit region corresponding to the character “A”), A unit area circumscribing the ON pixel group to which the pixel value “2” is assigned (that is, a unit area corresponding to the letter “B”) is determined. More specifically, the CPU 62 selects 23 unit areas corresponding to 23 characters “A” to “W” and one unit corresponding to one photo object OB3 from the scanned image SI. (I.e., a total of 24 unit areas are determined). The determination of the unit area is executed by storing the position of each pixel constituting each vertex of the unit area in the memory 64. However, in the description below regarding “determination of region (or position)”, description regarding storing the pixel position in the memory 64 is omitted.

S140では、CPU62は、S130で決定された単位領域を利用して、スキャン画像SI内のオブジェクト領域を決定する。具体的には、CPU62は、24個の単位領域を複数個の単位領域群に区分し、各単位領域群に対応する各オブジェクト領域を決定する。1個の単位領域群は、近傍に存在する1個以上の単位領域によって構成される。CPU62は、2個の単位領域の間の距離(即ち画素数)が所定の距離未満である場合に、当該2個の単位領域を同じ単位領域群に区分する。上記の所定の距離は、スキャン画像データSIDの解像度に応じて予め決められている。例えば、本実施例では、スキャン画像データSIDが300dpiの解像度を有しており、300dpiの解像度に対応する上記の所定の距離は、10画素である。そして、図3のラベルデータLDでは、文字「A」に対応する単位領域RE1と、文字「B」に対応する単位領域RE2と、の間の距離は、3画素である。従って、CPU62は、単位領域RE1と単位領域RE2とを同じ単位領域群に区分する。これにより、CPU62は、近傍に存在する各文字(例えば「A」と「B」)、即ち、同じセンテンスを構成している各文字をグループ化することができる。より具体的には、CPU62は、スキャン画像SIについて、テキストオブジェクトOB1内の13個の文字「A」〜「M」に対応する13個の単位領域を含む単位領域群と、テキストオブジェクトOB2内の10個の文字「N」〜「W」に対応する10個の単位領域を含む単位領域群と、1個の写真オブジェクトOB3に対応する1個の単位領域を含む単位領域群と、を決定する(即ち、合計で3個の単位領域群を決定する)。そして、CPU62は、3個の単位領域群のそれぞれについて、当該単位領域群に外接する矩形の領域をオブジェクト領域として決定する。即ち、CPU62は、スキャン画像SIの中から、テキストオブジェクトOB1内の13個の文字「A」〜「M」を含むオブジェクト領域OA1と、テキストオブジェクトOB2内の10個の文字「N」〜「W」を含むオブジェクト領域OA2と、写真オブジェクトOB3を含むオブジェクト領域OA3と、を決定する(即ち、合計で3個のオブジェクト領域OA1〜OA3を決定する)。   In S140, the CPU 62 determines an object area in the scan image SI using the unit area determined in S130. Specifically, the CPU 62 divides the 24 unit areas into a plurality of unit area groups, and determines each object area corresponding to each unit area group. One unit region group is composed of one or more unit regions existing in the vicinity. When the distance (that is, the number of pixels) between the two unit areas is less than a predetermined distance, the CPU 62 divides the two unit areas into the same unit area group. The predetermined distance is determined in advance according to the resolution of the scan image data SID. For example, in this embodiment, the scan image data SID has a resolution of 300 dpi, and the predetermined distance corresponding to the resolution of 300 dpi is 10 pixels. In the label data LD of FIG. 3, the distance between the unit region RE1 corresponding to the character “A” and the unit region RE2 corresponding to the character “B” is 3 pixels. Therefore, the CPU 62 divides the unit area RE1 and the unit area RE2 into the same unit area group. Thereby, the CPU 62 can group each character (for example, “A” and “B”) existing in the vicinity, that is, each character constituting the same sentence. More specifically, for the scanned image SI, the CPU 62 includes a unit area group including 13 unit areas corresponding to 13 characters “A” to “M” in the text object OB1, and the text object OB2. A unit region group including ten unit regions corresponding to ten characters “N” to “W” and a unit region group including one unit region corresponding to one photo object OB3 are determined. (In other words, a total of three unit region groups are determined). Then, for each of the three unit area groups, the CPU 62 determines a rectangular area circumscribing the unit area group as an object area. That is, the CPU 62 selects, from the scanned image SI, the object area OA1 including 13 characters “A” to “M” in the text object OB1 and the 10 characters “N” to “W” in the text object OB2. ”And the object area OA3 including the photographic object OB3 (that is, a total of three object areas OA1 to OA3 are determined).

S150では、CPU62は、S140で決定された3個のオブジェクト領域OA1〜OA3のそれぞれについて、当該オブジェクト領域の種類を決定する。具体的には、CPU62は、各オブジェクト領域OA1〜OA3が、文字を含むテキストオブジェクト領域(以下では単に「テキスト領域」と呼ぶ)であるのか否かを判断する。CPU62は、まず、スキャン画像データSIDのうち、オブジェクト領域OA1を表わす部分画像データを構成する複数個の画素の画素値の頻度の分布を示すヒストグラムを生成する。そして、CPU62は、当該ヒストグラムを利用して、頻度がゼロより高い画素値の数(即ち、オブジェクト領域OA1で利用されている色の数)を算出する。CPU62は、算出済みの数が所定数(例えば「10」)未満である場合には、オブジェクト領域OA1がテキスト領域であると判断し、算出済みの数が上記の所定数以上である場合には、オブジェクト領域OA1がテキスト領域でないと判断する。オブジェクト領域OA1は、黒色の文字「A」〜「M」と、白色の背景と、を含む。従って、オブジェクト領域OA1に対応するヒストグラムでは、通常、黒色を示す画素値と白色を示す画素値とを含む2個の画素値のみの頻度がゼロより高い。従って、CPU62は、オブジェクト領域OA1がテキスト領域であると判断する。同様に、CPU62は、オブジェクト領域OA2に対応するヒストグラムを利用して、オブジェクト領域OA2がテキスト領域であると判断する。一方、例えば、写真オブジェクトOB3では、通常、10色以上の色が利用されている。従って、オブジェクト領域OA3に対応するヒストグラムでは、通常、頻度がゼロより高い画素値の数が上記の所定数以上になる。従って、CPU62は、オブジェクト領域OA3がテキスト領域でないと判断する(即ち写真オブジェクト領域であると判断する)。   In S150, the CPU 62 determines the type of the object area for each of the three object areas OA1 to OA3 determined in S140. Specifically, the CPU 62 determines whether each of the object areas OA1 to OA3 is a text object area including characters (hereinafter simply referred to as “text area”). First, the CPU 62 generates a histogram indicating the frequency distribution of the pixel values of a plurality of pixels constituting the partial image data representing the object area OA1 in the scanned image data SID. Then, the CPU 62 uses the histogram to calculate the number of pixel values having a frequency higher than zero (that is, the number of colors used in the object area OA1). When the calculated number is less than a predetermined number (for example, “10”), the CPU 62 determines that the object area OA1 is a text area, and when the calculated number is equal to or greater than the predetermined number. The object area OA1 is determined not to be a text area. The object area OA1 includes black characters “A” to “M” and a white background. Therefore, in the histogram corresponding to the object area OA1, the frequency of only two pixel values including the pixel value indicating black and the pixel value indicating white is usually higher than zero. Therefore, the CPU 62 determines that the object area OA1 is a text area. Similarly, the CPU 62 uses the histogram corresponding to the object area OA2 to determine that the object area OA2 is a text area. On the other hand, for example, in the photographic object OB3, ten or more colors are usually used. Therefore, in the histogram corresponding to the object area OA3, the number of pixel values having a frequency higher than zero is usually greater than or equal to the predetermined number. Therefore, the CPU 62 determines that the object area OA3 is not a text area (that is, determines that it is a photo object area).

S160では、CPU62は、S150で決定された2個のテキスト領域OA1,OA2に対して帯状領域決定処理を実行する。ただし、CPU62は、写真オブジェクト領域OA3に対して帯状領域決定処理を実行しない。具体的には、CPU62は、まず、テキスト領域OA1に対応する射影ヒストグラムを生成する。当該射影ヒストグラムは、二値データBD(S110参照)を構成する複数個の画素のうち、テキスト領域OA1を表わす各画素を横方向に射影する場合におけるON画素(即ち「1」を示す画素)の頻度の分布を示す。換言すると、当該射影ヒストグラムは、スキャン画像データSIDを構成する複数個の画素のうち、テキスト領域OA1を表わす各画素を横方向に射影する場合における文字構成画素の頻度の分布を示す。文字構成画素は、テキスト領域OA1に含まれる文字(例えば「A」)を構成する画素(即ち黒色を示す画素)である。射影ヒストグラムでは、1行の文字列(例えば「A〜E」)が、頻度がゼロより高い範囲(以下では「高頻度範囲」と呼ぶ)で表わされ、2行の文字列の間の行間(例えば「A〜E」と「F〜J」の間の行間)が、頻度がゼロである範囲で表わされる。そして、CPU62は、射影ヒストグラムを利用して、1個以上の高頻度範囲に対応する1個以上の帯状領域を決定する。1個の帯状領域の縦方向の長さ(即ち縦方向の画素数)は、当該帯状領域に対応する高頻度範囲の縦方向の長さに等しい。また、1個の帯状領域の横方向の長さ(即ち横方向の画素数)は、オブジェクト領域OA1の横方向の長さに等しい。より具体的には、CPU62は、テキスト領域OA1の中から、文字列「A〜E」を含む帯状領域LA11と、文字列「F〜J」を含む帯状領域LA12と、文字列「K〜M」を含む帯状領域LA13と、を決定する(即ち、合計で3個の帯状領域LA11〜LA13を決定する)。同様に、CPU62は、テキスト領域OA2の中から、文字列「N〜R」を含む帯状領域LA21(図2のS100参照)と、文字列「S〜W」を含む帯状領域LA22と、を決定する(即ち、合計で2個の帯状領域を決定する)。S160が終了すると、図3の処理が終了する。   In S160, the CPU 62 executes a band-shaped area determination process on the two text areas OA1 and OA2 determined in S150. However, the CPU 62 does not execute the band-shaped area determination process on the photo object area OA3. Specifically, the CPU 62 first generates a projection histogram corresponding to the text area OA1. The projection histogram is an ON pixel (that is, a pixel indicating “1”) when each pixel representing the text area OA1 is projected in the horizontal direction among a plurality of pixels constituting the binary data BD (see S110). Shows the frequency distribution. In other words, the projection histogram shows the distribution of the frequency of the character constituent pixels when each pixel representing the text area OA1 is projected in the horizontal direction among the plurality of pixels constituting the scan image data SID. The character composing pixel is a pixel (that is, a pixel indicating black) constituting a character (for example, “A”) included in the text area OA1. In the projection histogram, a character string of one line (for example, “A to E”) is represented by a range in which the frequency is higher than zero (hereinafter referred to as “high frequency range”). (For example, the line spacing between “A to E” and “F to J”) is expressed in a range where the frequency is zero. Then, the CPU 62 determines one or more band-like regions corresponding to one or more high-frequency ranges using the projection histogram. The length in the vertical direction (that is, the number of pixels in the vertical direction) of one band-like region is equal to the length in the vertical direction of the high-frequency range corresponding to the band-like region. Further, the length in the horizontal direction (that is, the number of pixels in the horizontal direction) of one band-like area is equal to the length in the horizontal direction of the object area OA1. More specifically, the CPU 62 selects, from the text area OA1, a band-shaped area LA11 including the character string “A to E”, a band-shaped area LA12 including the character string “F to J”, and the character string “K to M”. ”Including the band-like area LA13 (that is, a total of three band-like areas LA11 to LA13 are decided). Similarly, the CPU 62 determines, from the text area OA2, a band-shaped area LA21 (see S100 in FIG. 2) including the character string “N to R” and a band-shaped area LA22 including the character string “S to W”. (I.e., a total of two strip regions are determined). When S160 ends, the process of FIG. 3 ends.

(結合処理;図4)
続いて、図4を参照して、図2のS200で実行される結合処理の内容を説明する。S210では、CPU62は、2個のテキスト領域OA1,OA2のうちの1個のテキスト領域を処理対象として決定する。以下では、テキスト領域OA1が処理対象として決定される場合を例として説明する。
(Combining process; FIG. 4)
Next, the contents of the combining process executed in S200 of FIG. 2 will be described with reference to FIG. In S210, the CPU 62 determines one text area of the two text areas OA1 and OA2 as a processing target. Hereinafter, a case where the text area OA1 is determined as a processing target will be described as an example.

S220では、CPU62は、テキスト領域OA1に含まれる3行の文字列「A〜M」が結合されている結合画像CI1を表わす結合画像データを生成する。具体的には、CPU62は、スキャン画像データSIDの中から、テキスト領域OA1について決定された3個の帯状領域LA11〜LA13(図3のS160参照)を表わす3個の部分画像データを取得する。そして、CPU62は、3個の帯状領域LA11〜LA13内の3行の文字列「A〜M」が横方向に沿って直線状に結合されるように、取得済みの3個の部分画像データを結合して、結合画像CI1を表わす結合画像データを生成する。この際に、CPU62は、結合される2行の文字列の間に横方向の所定の長さの余白(即ち、「E」と「F」の間の余白、及び、「J」と「K」の間の余白)が形成されるように、当該余白を表わす画素、即ち、スキャン画像SIの背景色を有する画素を補充して、結合画像データを生成する。即ち、CPU62は、補充される画素を介して、3個の部分画像データを結合して、結合画像CI1を表わす結合画像データを生成する。なお、CPU62は、帯状領域LA13内の後端側の余白(即ち文字列「K〜M」よりも右側に存在する余白)が削除されるように、帯状領域LA13を表わす部分画像データのうちの当該余白を表わすデータを削除する。これにより、文字列「A〜M」よりも後端側に余白が存在しない結合画像CI1を表わす結合画像データが生成される。   In S220, the CPU 62 generates combined image data representing the combined image CI1 in which the three lines of character strings “A to M” included in the text area OA1 are combined. Specifically, the CPU 62 acquires three partial image data representing the three strip regions LA11 to LA13 (see S160 in FIG. 3) determined for the text region OA1 from the scanned image data SID. Then, the CPU 62 converts the acquired three partial image data so that the three character strings “A to M” in the three belt-like areas LA11 to LA13 are linearly combined along the horizontal direction. The combined image data representing the combined image CI1 is generated by combining. At this time, the CPU 62 determines a margin of a predetermined length in the horizontal direction between the two character strings to be combined (that is, a margin between “E” and “F”, and “J” and “K”. In order to form a blank space between “), pixels representing the blank space, that is, pixels having the background color of the scanned image SI are supplemented to generate combined image data. That is, the CPU 62 combines the three partial image data via the pixels to be supplemented, and generates combined image data representing the combined image CI1. It should be noted that the CPU 62 removes the margin on the rear end side in the strip area LA13 (that is, the margin on the right side of the character string “K to M”) from the partial image data representing the strip area LA13. Delete the data representing the margin. As a result, combined image data representing the combined image CI1 having no margin on the rear end side of the character string “A to M” is generated.

S230では、CPU62は、S220で生成された結合画像データに対して二値化処理を実行する。当該二値化処理の内容は、図3のS110と同様である。   In S230, the CPU 62 executes binarization processing on the combined image data generated in S220. The contents of the binarization process are the same as S110 in FIG.

S240では、CPU62は、S230で生成された二値データを利用して、S220で生成された結合画像データ内の複数個の分断候補位置を決定する。分断候補位置は、再配置処理(図2のS400、後述の図10参照)において、結合画像データを分断するための分断位置の候補である。CPU62は、まず、二値データを利用して、射影ヒストグラムを生成する。当該射影ヒストグラムは、二値データを構成する各画素を縦方向に射影する場合におけるON画素(即ち文字構成画素)の頻度の分布を示す。当該射影ヒストグラムでは、1個の文字(例えば「A」)が、頻度がゼロより高い範囲で表わされ、2個の文字の間の余白部分(例えば「A」と「B」の間の余白部分)が、頻度がゼロである範囲(以下では「ゼロ頻度範囲」と呼ぶ)で表わされる。そして、CPU62は、射影ヒストグラムを利用して、各ゼロ頻度範囲の右端を分断候補位置として決定する。このように、2個の文字の間の余白部分が分断候補位置として決定されるので、1個の文字(例えば「A」)の中間で分断されてしまうことを抑制することができる。なお、変形例では、CPU62は、各ゼロ頻度範囲の左端を分断候補位置として決定してもよいし、各ゼロ頻度範囲の中間位置を分断候補位置として決定してもよい。   In S240, the CPU 62 determines a plurality of division candidate positions in the combined image data generated in S220 using the binary data generated in S230. The division candidate positions are division position candidates for dividing the combined image data in the rearrangement process (S400 in FIG. 2, see FIG. 10 described later). First, the CPU 62 generates a projection histogram using the binary data. The projection histogram shows the frequency distribution of ON pixels (that is, character constituent pixels) when the pixels constituting the binary data are projected in the vertical direction. In the projection histogram, one character (for example, “A”) is represented in a range where the frequency is higher than zero, and a margin between two characters (for example, a margin between “A” and “B”). Portion) is represented by a range in which the frequency is zero (hereinafter referred to as “zero frequency range”). And CPU62 determines the right end of each zero frequency range as a division | segmentation candidate position using a projection histogram. Thus, since the blank portion between the two characters is determined as the division candidate position, it is possible to suppress the division between one character (for example, “A”). In the modification, the CPU 62 may determine the left end of each zero frequency range as the division candidate position, or may determine the intermediate position of each zero frequency range as the division candidate position.

S250では、CPU62は、全てのテキスト領域OA1,OA2について、S210〜S240の処理が終了したのか否かを判断する。CPU62は、処理が終了していないと判断する場合(S250でNO)には、S210において、未処理のテキスト領域(例えばOA2)を処理対象として決定する。この結果、上記と同様に、CPU62は、結合画像CI2(図2のS200参照)を表わす結合画像データを生成し(S220)、当該結合画像データの複数個の分断候補位置を決定する(S240)。そして、CPU62は、処理が終了したと判断する場合(S250でYES)には、図4の処理を終了する。   In S250, the CPU 62 determines whether or not the processing of S210 to S240 has been completed for all the text areas OA1 and OA2. If the CPU 62 determines that the process has not ended (NO in S250), the CPU 62 determines an unprocessed text area (for example, OA2) as a processing target in S210. As a result, as described above, the CPU 62 generates combined image data representing the combined image CI2 (see S200 in FIG. 2) (S220), and determines a plurality of division candidate positions of the combined image data (S240). . Then, if the CPU 62 determines that the process has ended (YES in S250), the process of FIG. 4 ends.

(目標領域決定処理;図5)
続いて、図5を参照して、図2のS300で実行される目標領域決定処理の内容を説明する。S310では、CPU62は、余白領域決定処理(後述の図6参照)を実行して、各テキスト領域OA1,OA2に対応する各余白領域を決定する。各余白領域は、対応するテキスト領域(例えばOA1)内の各文字を拡大して配置可能な最大の領域であり、当該対応するテキスト領域よりも大きいサイズを有し、当該対応するテキスト領域を含む。
(Target area determination processing; FIG. 5)
Next, the content of the target area determination process executed in S300 of FIG. 2 will be described with reference to FIG. In S310, the CPU 62 executes a blank area determination process (see FIG. 6 described later) to determine the blank areas corresponding to the text areas OA1 and OA2. Each margin area is the maximum area where each character in the corresponding text area (for example, OA1) can be enlarged and arranged, has a size larger than the corresponding text area, and includes the corresponding text area .

S330では、CPU62は、拡大率ERとして初期値「1.0」を設定すると共に、回数ポインタTPとして初期値「1」を設定する。拡大率ERは、後述のS350の領域拡大処理でテキスト領域を拡大するための面積拡大率である。回数ポインタTPは、後述のS350の領域拡大処理が実行された回数を示すポインタである。従って、以下では、「TP回目の領域拡大処理」又は「(TP−1)回目の領域拡大処理」という用語を使用することがある。   In S330, the CPU 62 sets an initial value “1.0” as the enlargement ratio ER and sets an initial value “1” as the number-of-times pointer TP. The enlargement ratio ER is an area enlargement ratio for enlarging the text area in the area enlargement process of S350 described later. The number pointer TP is a pointer that indicates the number of times that an area enlargement process of S350 described later has been executed. Therefore, hereinafter, the term “TP-th region expansion processing” or “(TP-1) -th region expansion processing” may be used.

S340では、CPU62は、拡大率ERの現在値(例えば「1.0」)に予め決められている固定値α(例えば「0.05」)を加えて、拡大率ERの新たな値(例えば「1.05」)を算出する。   In S340, the CPU 62 adds a predetermined fixed value α (for example, “0.05”) to the current value (for example, “1.0”) of the enlargement ratio ER to obtain a new value (for example, the enlargement ratio ER). “1.05”) is calculated.

S350では、CPU62は、領域拡大処理(後述の図7参照)を実行する。即ち、CPU62は、S340で算出された拡大率ERの現在値(例えば「1.05」)に従って、各テキスト領域OA1,OA2を拡大して、各拡大領域を決定する。   In S350, the CPU 62 executes a region enlargement process (see FIG. 7 described later). That is, the CPU 62 enlarges each text area OA1, OA2 according to the current value (for example, “1.05”) of the enlargement ratio ER calculated in S340, and determines each enlarged area.

S370では、CPU62は、S350で決定された拡大領域が所定の条件を満たすのか否かを判断する。本実施例では、上記の所定の条件は、以下のとおりである。例えば、余白領域のサイズが比較的に小さい場合には、拡大率ERに従ってテキスト領域を拡大すると、拡大領域が余白領域に収まらない可能性がある。この場合、CPU62は、後述の図9の数式に従って、拡大領域を適切に決定することができないので、拡大領域が所定の条件を満たさないと判断する(S370でNO)。また、例えば、S350で複数個の拡大領域が決定される場合には、当該複数個の拡大領域のうちの2個の拡大領域が互いに重複する可能性がある。この場合、CPU62は、拡大領域が所定の条件を満たさないと判断する(S370でNO)。一方、CPU62は、拡大領域が余白領域に収まり、かつ、2個の拡大領域が互いに重複しない場合には、拡大領域が所定の条件を満たすと判断する(S370でYES)。   In S370, the CPU 62 determines whether or not the enlarged region determined in S350 satisfies a predetermined condition. In the present embodiment, the predetermined condition is as follows. For example, when the size of the margin area is relatively small, if the text area is enlarged according to the enlargement ratio ER, the enlarged area may not fit in the margin area. In this case, the CPU 62 cannot determine the enlargement area appropriately according to the formula of FIG. 9 described later, and therefore determines that the enlargement area does not satisfy the predetermined condition (NO in S370). For example, when a plurality of enlargement areas are determined in S350, two enlargement areas of the plurality of enlargement areas may overlap each other. In this case, the CPU 62 determines that the enlarged area does not satisfy the predetermined condition (NO in S370). On the other hand, if the enlarged area fits in the blank area and the two enlarged areas do not overlap each other, the CPU 62 determines that the enlarged area satisfies a predetermined condition (YES in S370).

CPU62は、拡大領域が所定の条件を満たさないと判断する場合(S370でNO)には、S372において、(TP−1)回目の領域拡大処理で決定された各拡大領域を各目標領域TA1,TA2(図2のS300参照)として決定する。なお、回数ポインタTPの現在値が「1」である場合には、S372では、CPU62は、各テキスト領域OA1,OA2をそのまま各目標領域として決定する。S372が終了すると、図5の処理が終了する。   If the CPU 62 determines that the enlargement area does not satisfy the predetermined condition (NO in S370), the CPU 62 determines each enlargement area determined in the (TP-1) -th area enlargement process in S372 as each target area TA1, It is determined as TA2 (see S300 in FIG. 2). If the current value of the count pointer TP is “1”, in S372, the CPU 62 determines the text areas OA1 and OA2 as the target areas as they are. When S372 ends, the process of FIG. 5 ends.

一方、CPU62は、拡大領域が所定の条件を満たすと判断する場合(S370でYES)には、S380において、拡大率ERの現在値が所定値(例えば「1.4」)に一致するのか否かを判断する。上記の所定値は、目標領域を決定するための最大の拡大率を意味し、換言すると、スキャン画像SI内の各文字のサイズを拡大するための目標の拡大率を意味する。例えば、元の文字が小さいサイズであっても、当該文字のサイズが1.4倍になれば、ヒトは、通常、拡大後の文字を認識し易い。このように、ヒトが認識し易い拡大率が、上記の所定値(例えば「1.4」)として設定される。   On the other hand, if the CPU 62 determines that the enlargement area satisfies the predetermined condition (YES in S370), whether or not the current value of the enlargement ratio ER matches a predetermined value (eg, “1.4”) in S380. Determine whether. The predetermined value means the maximum enlargement ratio for determining the target area, in other words, the target enlargement ratio for enlarging the size of each character in the scan image SI. For example, even if the original character is a small size, if the size of the character is increased by 1.4 times, it is usually easy for a human to recognize the enlarged character. In this way, the enlargement ratio that is easy for humans to recognize is set as the predetermined value (for example, “1.4”).

CPU62は、拡大率ERの現在値が上記の所定値に一致すると判断する場合(S380でYES)には、S382において、TP回目の領域拡大処理で決定された各拡大領域を各目標領域(例えば図2のS300のTA1,TA2参照)として決定する。S382が終了すると、図5の処理が終了する。   If the CPU 62 determines that the current value of the enlargement rate ER matches the predetermined value (YES in S380), the CPU 62 determines each enlargement area determined in the TP-th area enlargement process in S382 as each target area (for example, (Refer to TA1 and TA2 in S300 of FIG. 2). When S382 ends, the process of FIG. 5 ends.

一方、CPU62は、拡大率ERの現在値が上記の所定値に一致しないと判断する場合(S380でNO)には、S390において、回数ポインタTPの現在値に「1」を加算して、回数ポインタTPの新たな値を算出する。そして、CPU62は、S340以降の各処理を再び実行する。   On the other hand, if the CPU 62 determines that the current value of the enlargement ratio ER does not match the predetermined value (NO in S380), in S390, “1” is added to the current value of the number pointer TP, and the number of times A new value of the pointer TP is calculated. And CPU62 performs each process after S340 again.

(余白領域決定処理;図6)
続いて、図6を参照して、図5のS310で実行される余白領域決定処理の内容を説明する。S311では、CPU62は、2個のテキスト領域OA1,OA2のうちの1個のテキスト領域を処理対象として決定する。以下では、テキスト領域OA1が処理対象として決定される場合を例として説明する。
(Blank area determination processing; FIG. 6)
Next, the contents of the blank area determination process executed in S310 of FIG. 5 will be described with reference to FIG. In S311, the CPU 62 determines one text area of the two text areas OA1 and OA2 as a processing target. Hereinafter, a case where the text area OA1 is determined as a processing target will be described as an example.

S312〜S319では、CPU62は、テキスト領域OA1を複数個の向きに順次拡大して、余白領域BA1を決定する。複数個の向きのうちの最初の拡大に利用されるべき向きは、左上向きである(S312)。その理由は、以下の通りである。上述したように、テキスト領域OA1内の各文字列「A〜M」では、左側から右側に向かってセンテンスが進むと共に、上側から下側に向かってセンテンスが進む。このような状況では、センテンスが開始される左側及び上側の中間である左上向きを最初の拡大に利用すれば、他の向きを最初の拡大に利用する場合と比べて、最終的な拡大結果として得られる余白領域(後述のS319の余白領域BA1)が大きくなり得る。ただし、変形例では、複数個の向きのうちの最初の拡大に利用されるべき向きは、左上向きでなくてもよく、S313〜S319のいずれの向きであってもよい。   In S312 to S319, the CPU 62 sequentially enlarges the text area OA1 in a plurality of directions to determine a blank area BA1. The direction to be used for the first enlargement among the plurality of directions is the upper left direction (S312). The reason is as follows. As described above, in each of the character strings “A to M” in the text area OA1, the sentence advances from the left side to the right side, and the sentence advances from the upper side to the lower side. In such a situation, if the upper left direction, which is the middle between the left side and the upper side where the sentence starts, is used for the first enlargement, the final enlargement result is compared to the case where the other direction is used for the first enlargement. The obtained blank area (the blank area BA1 in S319 described later) can be increased. However, in the modification, the direction to be used for the first enlargement among the plurality of directions may not be the upper left direction, and may be any one of S313 to S319.

S312の左上向きの拡大によって領域OA1’が得られる。領域OA1’の上端は、スキャン画像SIの上端に一致する。このために、領域OA1’を右上向きに拡大することができないので、S313は実行されない。また、領域OA1’の左端は、スキャン画像SIの左端に一致する。このために、領域OA1’を左下向きに拡大することができないので、S314は実行されない。次いで、S315において、CPU62は、領域OA1’を右下向きに拡大して、領域OA1’’を決定する。領域OA1’’の右端は、テキスト領域OA2の左端に一致する。このように、CPU62は、他のオブジェクト領域(例えばOA2,OA3)に重複しないように、テキスト領域OA1を複数個の向きに順次拡大する。なお、S312〜S315のいずれの向きも、横方向に沿って伸びる直線に対して45度の角度を成すと共に縦方向の沿って伸びる直線に対して45度の角度を成す向きである。また、領域OA1’’を左向き、上向き、及び、右向きに拡大することができないので、S316〜S318は実行されない。最後に、S319において、CPU62は、領域OA1’’を下向きに拡大して、余白領域BA1を決定する。   The area OA1 'is obtained by the upper left enlargement in S312. The upper end of the area OA1 'coincides with the upper end of the scan image SI. For this reason, since the area OA1 'cannot be enlarged in the upper right direction, S313 is not executed. Further, the left end of the area OA1 'coincides with the left end of the scan image SI. For this reason, since the area OA1 'cannot be enlarged to the lower left, S314 is not executed. Next, in S <b> 315, the CPU 62 enlarges the region OA <b> 1 ′ downward and determines the region OA <b> 1 ″. The right end of the area OA1 ″ coincides with the left end of the text area OA2. Thus, the CPU 62 sequentially enlarges the text area OA1 in a plurality of directions so as not to overlap with other object areas (for example, OA2 and OA3). In addition, any direction of S312 to S315 is an orientation that forms an angle of 45 degrees with respect to a straight line extending along the horizontal direction and an angle of 45 degrees with respect to a straight line that extends along the vertical direction. In addition, since the region OA1 ″ cannot be enlarged leftward, upward, and rightward, S316 to S318 are not executed. Finally, in S319, the CPU 62 enlarges the area OA1 ″ downward to determine a blank area BA1.

S320では、CPU62は、全てのテキスト領域OA1,OA2について、S311〜S319の処理が終了したのか否かを判断する。CPU62は、処理が終了していないと判断する場合(S320でNO)には、S311において、未処理のテキスト領域(例えばOA2)を処理対象として決定する。この結果、上記と同様に、CPU62は、テキスト領域OA2に対応する余白領域(後述の図7のBA2参照)を決定する。そして、CPU62は、処理が終了したと判断する場合(S320でYES)には、図6の処理を終了する。   In S320, the CPU 62 determines whether or not the processing of S311 to S319 has been completed for all the text areas OA1 and OA2. If the CPU 62 determines that the process has not ended (NO in S320), the CPU 62 determines an unprocessed text area (for example, OA2) as a processing target in S311. As a result, as described above, the CPU 62 determines a blank area (refer to BA2 in FIG. 7 described later) corresponding to the text area OA2. Then, when the CPU 62 determines that the process has been completed (YES in S320), the process of FIG. 6 is terminated.

テキスト領域OA1に対応する余白領域BA1は、横方向の右側及び左側のそれぞれおいて、テキスト領域OA1よりも大きいと共に、縦方向の上側及び上側のそれぞれおいて、テキスト領域OA1よりも大きい。従って、テキスト領域OA1と余白領域BA1との間には、横方向に沿った2個の余白が存在すると共に、縦方向に沿った2個の余白が存在する。テキスト領域OA2に対応する余白領域BA2(後述の図7参照)も同様である。また、各余白領域BA1,BA2は、他のオブジェクト領域に重複しない(例えば、余白領域BA1は、オブジェクト領域OA2,OA3に重複しない)。ただし、2個の余白領域BA1,BA2は、互いに重複し得る。   The margin area BA1 corresponding to the text area OA1 is larger than the text area OA1 on each of the right and left sides in the horizontal direction and larger than the text area OA1 on each of the upper side and the upper side in the vertical direction. Accordingly, between the text area OA1 and the margin area BA1, there are two margins along the horizontal direction and two margins along the vertical direction. The same applies to the blank area BA2 (see FIG. 7 described later) corresponding to the text area OA2. Further, the blank areas BA1 and BA2 do not overlap with other object areas (for example, the blank area BA1 does not overlap with the object areas OA2 and OA3). However, the two blank areas BA1 and BA2 may overlap each other.

(領域拡大処理;図7)
続いて、図7を参照して、図5のS350で実行される領域拡大処理の内容を説明する。S352では、CPU62は、2個のテキスト領域OA1,OA2のうちの1個のテキスト領域を処理対象として決定する。以下では、処理対象のテキスト領域の横方向の長さ(即ち横方向の画素数)、縦方向の長さ(即ち縦方向の画素数)として、それぞれ、符号OPx、符号OPyを利用する。また、処理対象のテキスト領域に対応する余白領域の横方向の長さ(即ち横方向の画素数)、縦方向の長さ(即ち縦方向の画素数)として、それぞれ、符号BPx、符号BPyを利用する。また、以下では、テキスト領域OA1が処理対象として決定される場合を例として説明する。
(Area enlargement processing; FIG. 7)
Next, the contents of the area expansion process executed in S350 of FIG. 5 will be described with reference to FIG. In S352, the CPU 62 determines one text area of the two text areas OA1 and OA2 as a processing target. In the following, the code OPx and the code OPy are used as the horizontal length (that is, the number of pixels in the horizontal direction) and the length in the vertical direction (that is, the number of pixels in the vertical direction), respectively. Further, as the horizontal length (that is, the number of pixels in the horizontal direction) and the vertical length (that is, the number of pixels in the vertical direction) of the margin area corresponding to the text area to be processed, the codes BPx and BPy are respectively set. Use. Hereinafter, a case where the text area OA1 is determined as a processing target will be described as an example.

S354では、CPU62は、テキスト領域OA1の横方向の長さOPxと、拡大率ER(図5のS340参照)の現在値の平方根(以下では「ルートER」と呼ぶ)と、を乗算して、決定されるべき拡大領域の候補である候補拡大領域の横方向の長さ(即ち横方向の画素数)CPxを算出する。また、CPU62は、テキスト領域OA1の縦方向の長さOPyと、ルートERと、を乗算して、候補拡大領域の縦方向の長さ(即ち縦方向の画素数)CPyを算出する。テキスト領域OA1の横方向及び縦方向の長さOPx,OPyに同じ値(即ちルートER)が乗算されて候補拡大領域の横方向及び縦方向の長さCPx,CPyが算出されるので、候補拡大領域のアスペクト比は、テキスト領域OA1のアスペクト比に等しい。   In S354, the CPU 62 multiplies the horizontal length OPx of the text area OA1 by the square root (hereinafter referred to as “root ER”) of the current value of the enlargement ratio ER (see S340 in FIG. 5). The horizontal length (that is, the number of pixels in the horizontal direction) CPx of the candidate enlarged region that is a candidate for the enlarged region to be determined is calculated. Further, the CPU 62 multiplies the vertical length OPy of the text area OA1 by the root ER to calculate the vertical length (that is, the number of pixels in the vertical direction) CPy of the candidate enlargement area. Since the horizontal and vertical lengths OPx and OPy of the text area OA1 are multiplied by the same value (that is, the root ER), the horizontal and vertical lengths CPx and CPy of the candidate expansion area are calculated. The aspect ratio of the area is equal to the aspect ratio of the text area OA1.

S356では、CPU62は、候補拡大領域の横方向の長さCPxが余白領域BA1の横方向の長さBPx以下であり、かつ、候補拡大領域の縦方向の長さCPyが余白領域BA1の縦方向の長さBPy以下であるのか否かを判断する。即ち、CPU62は、候補拡大領域が余白領域BA1内に収まるのか否かを判断する。   In S356, the CPU 62 determines that the horizontal length CPx of the candidate enlargement area is equal to or less than the horizontal length BPx of the blank area BA1, and the vertical length CPy of the candidate enlargement area is the vertical direction of the blank area BA1. It is determined whether or not the length is BPy or less. In other words, the CPU 62 determines whether or not the candidate enlargement area fits in the blank area BA1.

CPU62は、長さCPxが長さBPx以下であり、かつ、長さCPyが長さBPy以下である場合には、候補拡大領域が余白領域BA1内に収まると判断して(S356でYES)、S358に進む。S358では、CPU62は、テキスト領域OA1のアスペクト比を維持した状態で、拡大率ERに従ってテキスト領域OA1を拡大して、拡大領域を決定する。この結果、テキスト領域OA1のアスペクト比に等しいアスペクト比を有する拡大領域(以下では「単純拡大領域」と呼ぶ)が決定される。より具体的には、単純拡大領域の横方向の長さ、縦方向の長さは、それぞれ、S354で算出された候補拡大領域の横方向の長さCPx、縦方向の長さCPyに一致する。そして、単純拡大領域が目標領域として決定され得る(図5のS372,S382参照)。テキスト領域OA1のアスペクト比に等しいアスペクト比を有する目標領域が決定されると、詳しくは後述するが、CPU62は、図2のS400の再配置処理(図10参照)を容易に実行することができる。S358が終了すると、S362に進む。   When the length CPx is equal to or shorter than the length BPx and the length CPy is equal to or shorter than the length BPy, the CPU 62 determines that the candidate enlargement area falls within the blank area BA1 (YES in S356). The process proceeds to S358. In S <b> 358, the CPU 62 enlarges the text area OA <b> 1 according to the enlargement ratio ER while determining the enlargement area while maintaining the aspect ratio of the text area OA <b> 1. As a result, an enlarged area (hereinafter referred to as “simple enlarged area”) having an aspect ratio equal to the aspect ratio of the text area OA1 is determined. More specifically, the length in the horizontal direction and the length in the vertical direction of the simple enlargement area respectively match the length in the horizontal direction CPx and the length in the vertical direction CPy calculated in S354. . Then, the simple enlargement area can be determined as the target area (see S372 and S382 in FIG. 5). When a target area having an aspect ratio equal to the aspect ratio of the text area OA1 is determined, the CPU 62 can easily execute the rearrangement process (see FIG. 10) of S400 in FIG. . When S358 ends, the process proceeds to S362.

一方、CPU62は、長さCPxが長さBPxより大きい場合、又は、長さCPyが長さBPyより大きい場合には、候補拡大領域が余白領域BA1内に収まらないと判断して(S356でNO)、S360に進む。S360では、CPU62は、テキスト領域OA1のアスペクト比を維持することなく(即ち無視して)、テキスト領域OA1を拡大して、拡大領域を決定する。この結果、通常、テキスト領域OA1のアスペクト比とは異なるアスペクト比を有する拡大領域(以下では「変形拡大領域」と呼ぶ)が決定される。より具体的には、変形拡大領域の横方向の長さ、縦方向の長さは、それぞれ、候補拡大領域の横方向の長さCPx、縦方向の長さCPyとは異なる。そして、変形拡大領域が目標領域として決定され得る。このように、本実施例によると、CPU62は、テキスト領域OA1のアスペクト比に一致するアスペクト比を有する単純拡大領域を決定することができない場合でも、変形拡大領域を適切に決定することができる。S360が終了すると、S362に進む。   On the other hand, if the length CPx is greater than the length BPx, or if the length CPy is greater than the length BPy, the CPU 62 determines that the candidate enlargement area does not fit within the blank area BA1 (NO in S356). ), Go to S360. In S360, the CPU 62 enlarges the text area OA1 without maintaining the aspect ratio of the text area OA1 (that is, ignores it), and determines an enlarged area. As a result, an enlargement area (hereinafter referred to as a “deformation enlargement area”) having an aspect ratio different from the aspect ratio of the text area OA1 is usually determined. More specifically, the horizontal length and the vertical length of the deformation enlarged region are different from the horizontal length CPx and the vertical length CPy of the candidate enlarged region, respectively. And a deformation | transformation expansion area | region can be determined as a target area | region. Thus, according to the present embodiment, the CPU 62 can appropriately determine the deformation enlargement area even when the simple enlargement area having the aspect ratio that matches the aspect ratio of the text area OA1 cannot be determined. When S360 ends, the process proceeds to S362.

S362では、CPU62は、全てのテキスト領域OA1,OA2について、S352〜S360の処理が終了したのか否かを判断する。CPU62は、処理が終了していないと判断する場合(S362でNO)には、S352において、未処理のテキスト領域(例えばOA2)を処理対象として決定する。この結果、CPU62は、テキスト領域OA2に対応する拡大領域を決定する。そして、CPU62は、処理が終了したと判断する場合(S362でYES)には、図7の処理を終了する。   In S362, the CPU 62 determines whether or not the processes in S352 to S360 have been completed for all the text areas OA1 and OA2. If the CPU 62 determines that the processing has not ended (NO in S362), the CPU 62 determines an unprocessed text area (for example, OA2) as a processing target in S352. As a result, the CPU 62 determines an enlarged area corresponding to the text area OA2. Then, if the CPU 62 determines that the process is completed (YES in S362), the process of FIG.

(アスペクト比を維持して拡大;図8)
続いて、図8を参照して、図7のS358の処理の内容を説明する。図8内の各矩形は、テキスト領域OA1と余白領域BA1と拡大領域CAとを示す。テキスト領域OA1と余白領域BA1との間には、横方向の2個の余白(長さPx1,Px2)が存在すると共に、縦方向の2個の余白(長さPy1,Py2)が存在する。そして、図7のS358の処理では、CPU62は、4個の対象長さdx1,dx2,dy1,dy2を算出することによって、拡大領域(即ち単純拡大領域)CAの位置を決定する。具体的には、CPU62は、図8内の数式(1)〜(6)を利用して、4個の対象長さdx1,dx2,dy1,dy2を算出する。
(Enlarge while maintaining aspect ratio; Fig. 8)
Next, the contents of the process of S358 in FIG. 7 will be described with reference to FIG. Each rectangle in FIG. 8 shows a text area OA1, a blank area BA1, and an enlarged area CA. Between the text area OA1 and the margin area BA1, there are two horizontal margins (lengths Px1, Px2) and two vertical margins (lengths Py1, Py2). Then, in the process of S358 in FIG. 7, the CPU 62 determines the position of the enlarged area (that is, the simple enlarged area) CA by calculating the four target lengths dx1, dx2, dy1, and dy2. Specifically, the CPU 62 calculates the four target lengths dx1, dx2, dy1, and dy2 using the formulas (1) to (6) in FIG.

数式(1)は、拡大領域CAの横方向の長さCPx(図7のS354で算出済み)から、テキスト領域OA1の横方向の長さOPxを減算して、拡大領域CAとテキスト領域OA1との間の横方向の差分長さDxを算出することを示す。数式(2)は、拡大領域CAの縦方向の長さ(図7のS354で算出済み)から、テキスト領域OA1の縦方向の長さを減算して、拡大領域CAとテキスト領域OA1との間の縦方向の長さDyを算出することを示す。数式(3)は、横方向の差分長さDxが、横方向の2個の対象長さdx1,dx2の和であることを示す。数式(4)は、縦方向の差分長さDyが、縦方向の2個の対象長さdy1,dy2の和であることを示す。数式(5)は、横方向の2個の対象長さdx1,dx2の比率が、横方向の2個の余白の長さPx1,Px2の比率に一致することを示す。数式(6)は、縦方向の2個の対象長さdy1,dy2の比率が、縦方向の2個の余白の長さPy1,Py2の比率に一致することを示す。Dx、Px1、及び、Px2の各値がわかっているので、当該各値と数式(5)とを利用すれば、横方向の2個の対象長さdx1,dx2を算出ことができる。また、Dy、Py1、及び、Py2の各値がわかっているので、当該各値と数式(6)とを利用すれば、縦方向の2個の対象長さdy1,dy2を算出ことができる。   Expression (1) is obtained by subtracting the horizontal length OPx of the text area OA1 from the horizontal length CPx of the enlarged area CA (calculated in S354 of FIG. 7), and the enlarged area CA and the text area OA1. It shows that the difference length Dx in the horizontal direction between is calculated. Equation (2) is obtained by subtracting the vertical length of the text area OA1 from the vertical length of the enlarged area CA (calculated in S354 of FIG. 7) to obtain a distance between the enlarged area CA and the text area OA1. It shows that the length Dy in the vertical direction is calculated. Formula (3) indicates that the differential length Dx in the horizontal direction is the sum of the two target lengths dx1 and dx2 in the horizontal direction. Equation (4) indicates that the difference length Dy in the vertical direction is the sum of the two target lengths dy1 and dy2 in the vertical direction. Formula (5) indicates that the ratio between the two target lengths dx1 and dx2 in the horizontal direction matches the ratio between the two margin lengths Px1 and Px2 in the horizontal direction. Formula (6) indicates that the ratio of the two target lengths dy1 and dy2 in the vertical direction matches the ratio of the two margin lengths Py1 and Py2 in the vertical direction. Since each value of Dx, Px1, and Px2 is known, two target lengths dx1, dx2 in the horizontal direction can be calculated by using each value and Equation (5). Further, since each value of Dy, Py1, and Py2 is known, two target lengths dy1 and dy2 in the vertical direction can be calculated by using each value and Equation (6).

図8内の数式(1)〜(6)によると、以下の単純拡大領域CAが得られる。数式(5)では、横方向の2個の余白の長さPx1,Px2の比率に応じて、横方向の対象長さdx1,dx2が決定され、数式(6)では、縦方向の2個の余白の長さPy1,Py2の比率に応じて、横方向の対象長さdy1,dy2が決定される。従って、横方向の2個の余白の長さPx1,Px2と、縦方向の2個の余白の長さPy1,Py2と、に基づいて、テキスト領域OA1のアスペクト比に等しいアスペクト比を有する単純拡大領域の位置が決定される。そして、単純拡大領域が目標領域として決定され得る(図5のS372,S382参照)。   According to the mathematical expressions (1) to (6) in FIG. 8, the following simple enlarged area CA is obtained. In Formula (5), the target lengths dx1 and dx2 in the horizontal direction are determined according to the ratio of the lengths Px1 and Px2 of the two margins in the horizontal direction. In Formula (6), the two vertical lengths are determined. The target lengths dy1 and dy2 in the horizontal direction are determined according to the ratio of the margin lengths Py1 and Py2. Therefore, simple enlargement having an aspect ratio equal to the aspect ratio of the text area OA1 based on the lengths Px1 and Px2 of the two margins in the horizontal direction and the lengths Py1 and Py2 of the two margins in the vertical direction. The position of the region is determined. Then, the simple enlargement area can be determined as the target area (see S372 and S382 in FIG. 5).

(アスペクト比を無視して拡大;図9)
続いて、図9を参照して、図7のS360の処理の内容を説明する。図9内の各矩形は、図8内の各矩形と同様である。CPU62は、図9内の数式(1)〜(8)を利用して、4個の対象長さdx1,dx2,dy1,dy2を算出することによって、拡大領域((即ち変形拡大領域)CAの位置、アスペクト比、及び、サイズを決定する。
(Ignoring aspect ratio and expanding; Fig. 9)
Next, the contents of the process of S360 in FIG. 7 will be described with reference to FIG. Each rectangle in FIG. 9 is the same as each rectangle in FIG. The CPU 62 calculates the four target lengths dx1, dx2, dy1, dy2 by using the mathematical expressions (1) to (8) in FIG. Determine position, aspect ratio, and size.

数式(1)は、テキスト領域OA1の面積SOと拡大率ERの現在値とを乗算することによって得られる値が、拡大領域CAの面積SCに一致することを示す。数式(2)は、テキスト領域OA1の面積SOが、テキスト領域OA1の横方向の長さOPxと縦方向の長さOPyとを乗算することによって得られることを示す。数式(3)は、拡大領域CAの面積SCが、テキスト領域OA1の横方向の長さOPxと2個の対象長さdx1,dx2との和と、テキスト領域OA1の縦方向の長さOPyと2個の対象長さdy1,dy2との和と、を乗算することによって得られることを示す。数式(4)は、数式(2)の面積SOと数式(3)の面積SCとを数式(1)に代入することによって得られる数式を示す。数式(5)は、4個の対象長さdx1,dx2,dy1,dy2のそれぞれが、4個の余白の長さPx1,Px2,Py1,Py2のそれぞれと係数Kとを乗算することによって得られることを示す。数式(6)は、数式(5)の各対象長さdx1,dx2,dy1,dy2を数式(4)に代入することによって得られる数式を示す。数式(7)は、数式(6)を展開することによって得られる数式を示す。数式(8)は、数式(7)の係数a,b,cを利用して、係数Kを算出するための数式を示す。そして、係数Kを数式(5)に代入すれば、4個の対象長さdx1,dx2,dy1,dy2を算出することができる。   Equation (1) indicates that a value obtained by multiplying the area SO of the text area OA1 by the current value of the enlargement ratio ER matches the area SC of the enlargement area CA. Equation (2) indicates that the area SO of the text area OA1 is obtained by multiplying the horizontal length OPx and the vertical length OPy of the text area OA1. Formula (3) indicates that the area SC of the enlarged area CA is such that the horizontal length OPx of the text area OA1 and the two target lengths dx1 and dx2 are combined with the vertical length OPy of the text area OA1. It is obtained by multiplying the sum of two object lengths dy1 and dy2. Formula (4) represents a formula obtained by substituting the area SO of Formula (2) and the area SC of Formula (3) into Formula (1). Equation (5) is obtained by multiplying each of the four object lengths dx1, dx2, dy1, and dy2 by each of the four margin lengths Px1, Px2, Py1, and Py2 and the coefficient K. It shows that. Formula (6) represents a formula obtained by substituting each target length dx1, dx2, dy1, dy2 of Formula (5) into Formula (4). Formula (7) shows a formula obtained by expanding Formula (6). Formula (8) shows a formula for calculating the coefficient K using the coefficients a, b, and c of Formula (7). Then, if the coefficient K is substituted into Equation (5), four target lengths dx1, dx2, dy1, dy2 can be calculated.

図9内の数式(1)〜(8)によると、以下の変形拡大領域CAが得られる。数式(5)によると、「dx1+dx2=K×(Px1+Px2)」という関係と、「dy1+dy2=K×(Py1+Py2)」という関係と、が得られる。従って、横方向の2個の余白の長さの和(即ちPx1+Px2)が、縦方向の2個の余白の長さの和(即ちPy1+Py2)よりも大きい場合に、横方向の差分長さ(即ちdx1+dx2)が縦方向の差分長さ(即ちdy1+dy2)よりも大きくなり、横方向の2個の余白の長さの和(即ちPx1+Px2)が、縦方向の2個の余白の長さの和(即ちPy1+Py2)よりも小さい場合に、横方向の差分長さ(即ちdx1+dx2)が縦方向の差分長さ(即ちdy1+dy2)よりも小さくなる。このように、横方向の2個の余白の長さPx1,Px2と、縦方向の2個の余白の長さPy1,Py2と、に基づいて、テキスト領域OA1のアスペクト比とは異なる変形拡大領域のアスペクト比と、変形拡大領域のサイズ(即ち横方向の長さ及び縦方向の長さ)と、変形拡大領域の位置と、が決定される。そして、変形拡大領域が目標領域として決定され得る(図5のS372,S382参照)。   According to the mathematical expressions (1) to (8) in FIG. 9, the following deformation enlarged area CA is obtained. According to Equation (5), the relationship “dx1 + dx2 = K × (Px1 + Px2)” and the relationship “dy1 + dy2 = K × (Py1 + Py2)” are obtained. Accordingly, when the sum of the lengths of the two margins in the horizontal direction (ie, Px1 + Px2) is larger than the sum of the lengths of the two margins in the vertical direction (ie, Py1 + Py2), the difference length in the horizontal direction (ie, Py1 + Py2). dx1 + dx2) is greater than the longitudinal difference length (ie, dy1 + dy2), and the sum of the two horizontal margin lengths (ie, Px1 + Px2) is the sum of the two vertical margin lengths (ie, When the difference is smaller than Py1 + Py2), the difference length in the horizontal direction (ie, dx1 + dx2) is smaller than the difference length in the vertical direction (ie, dy1 + dy2). As described above, the deformation enlargement area different from the aspect ratio of the text area OA1 based on the two margin lengths Px1 and Px2 in the horizontal direction and the two margin lengths Py1 and Py2 in the vertical direction. The aspect ratio, the size of the deformation enlargement region (that is, the length in the horizontal direction and the length in the vertical direction), and the position of the deformation enlargement region are determined. And a deformation | transformation expansion area | region can be determined as a target area | region (refer S372, S382 of FIG. 5).

(再配置処理;図10)
続いて、図10を参照して、図2のS400で実行される再配置処理の内容を説明する。S410では、CPU62は、2個のテキスト領域OA1,OA2のうちの1個のテキスト領域(例えばOA1)を処理対象として決定する。以下では、S410で処理対象として決定されるテキスト領域のことを「対象テキスト領域」と呼ぶ。また、対象テキスト領域に含まれる各文字列が結合された結合画像(例えば図2のCI1)を表わす結合画像データのことを「対象結合画像データ」と呼ぶ。
(Relocation processing; FIG. 10)
Next, the content of the rearrangement process executed in S400 of FIG. 2 will be described with reference to FIG. In S410, the CPU 62 determines one text area (for example, OA1) out of the two text areas OA1 and OA2 as a processing target. Hereinafter, the text area determined as the processing target in S410 is referred to as “target text area”. The combined image data representing the combined image (for example, CI1 in FIG. 2) in which the character strings included in the target text area are combined is referred to as “target combined image data”.

S412では、CPU62は、対象テキスト領域のアスペクト比と、当該対象テキスト領域について決定された目標領域(以下では「対象目標領域」と呼ぶ)のアスペクト比と、が一致するのか否かを判断する。   In S412, the CPU 62 determines whether or not the aspect ratio of the target text area matches the aspect ratio of the target area determined for the target text area (hereinafter referred to as “target target area”).

対象テキスト領域について、図7のS358(即ち図8の手法)で得られる単純拡大領域が目標領域として決定された場合には、CPU62は、対象テキスト領域のアスペクト比と、対象目標領域のアスペクト比と、が一致すると判断して(S412でYES)、S414において、取得処理を実行する。具体的には、CPU62は、スキャン画像データSIDの中から、対象テキスト領域を表わす部分画像データを取得する。S414が終了すると、S490に進む。このように、対象テキスト領域のアスペクト比と、対象目標領域のアスペクト比と、が一致する場合には、CPU62は、S420〜S480の処理を実行せずに済むので、再配置処理を容易(即ち迅速)に実行することができる。   When the simple enlargement area obtained in S358 of FIG. 7 (that is, the method of FIG. 8) is determined as the target area for the target text area, the CPU 62 determines the aspect ratio of the target text area and the aspect ratio of the target target area. Are determined to match (YES in S412), and in S414, the acquisition process is executed. Specifically, the CPU 62 acquires partial image data representing the target text area from the scanned image data SID. When S414 ends, the process proceeds to S490. As described above, when the aspect ratio of the target text area matches the aspect ratio of the target target area, the CPU 62 does not need to execute the processes of S420 to S480, and thus the rearrangement process is easy (that is, Can be executed quickly).

一方、対象テキスト領域について、図7のS360(即ち図9の手法)で得られる変形拡大領域が目標領域として決定された場合には、CPU62は、対象テキスト領域のアスペクト比と、対象目標領域のアスペクト比と、が一致しないと判断して(S412でNO)、S420〜S480の各処理を実行して、再配置画像(例えば図2のS400のRI1参照)を表わす再配置画像データを生成する。   On the other hand, for the target text area, when the deformation enlargement area obtained in S360 of FIG. 7 (that is, the method of FIG. 9) is determined as the target area, the CPU 62 determines the aspect ratio of the target text area and the target target area. It is determined that the aspect ratio does not match (NO in S412), and each process of S420 to S480 is executed to generate rearranged image data representing the rearranged image (for example, refer to RI1 of S400 in FIG. 2). .

S420では、CPU62は、決定されるべき再配置領域(図2のRA1,RA2参照)の候補である候補再配置領域の横方向の長さW(即ち横方向の画素数W)として、初期値OPx(即ち対象テキスト領域の横方向の長さ)を設定すると共に、候補再配置領域の縦方向の長さH(即ち縦方向の画素数H)として、初期値OPy(即ち対象テキスト領域の縦方向の長さ)を設定する。   In S420, the CPU 62 sets the initial value as the horizontal length W (that is, the number of pixels W in the horizontal direction) of the candidate rearrangement region that is a candidate for the rearrangement region to be determined (see RA1 and RA2 in FIG. 2). OPx (that is, the horizontal length of the target text area) is set, and the initial value OPy (that is, the vertical length of the target text area) is set as the vertical length H (that is, the number of pixels H in the vertical direction) of the candidate rearrangement area. Set the direction length.

S430では、CPU62は、候補再配置領域の縦方向の長さHに対する横方向の長さWの比W/Hが、対象目標領域の縦方向の長さTHに対する横方向の長さTWの比TW/TH未満であるのか否かを判断する。   In S430, the CPU 62 determines that the ratio W / H of the horizontal length W to the vertical length H of the candidate rearrangement area is the ratio of the horizontal length TW to the vertical length TH of the target target area. It is determined whether it is less than TW / TH.

CPU62は、比W/Hが比TW/TH未満であると判断する場合(S430でYES)には、S432において、候補再配置領域の横方向の現在の長さWに予め決められている固定値β(例えば1画素)を加算して、候補再配置領域の横方向の新たな長さWを決定する。S432が終了すると、S440に進む。   When the CPU 62 determines that the ratio W / H is less than the ratio TW / TH (YES in S430), in S432, the fixed length predetermined to the current length W in the horizontal direction of the candidate rearrangement region is determined. The value β (for example, one pixel) is added to determine a new lateral length W of the candidate rearrangement region. When S432 ends, the process proceeds to S440.

一方、CPU62は、比W/Hが比TW/TH以上であると判断する場合(S430でNO)には、S434において、候補再配置領域の横方向の現在の長さWから予め決められている固定値β(例えば1画素)を減算して、候補再配置領域の横方向の新たな長さWを決定する。S434が終了すると、S440に進む。なお、本実施例では、S432及びS434において、同じ固定値βが利用されるが、変形例では、S432の固定値とS434の固定値とは異なる値であってもよい。   On the other hand, if the CPU 62 determines that the ratio W / H is greater than or equal to the ratio TW / TH (NO in S430), the CPU 62 determines in advance from the current length W in the horizontal direction of the candidate rearrangement region in S434. A fixed length β (for example, one pixel) is subtracted to determine a new horizontal length W of the candidate rearrangement region. When S434 ends, the process proceeds to S440. In the present embodiment, the same fixed value β is used in S432 and S434. However, in a modified example, the fixed value in S432 and the fixed value in S434 may be different values.

S440では、CPU62は、スキャン画像データSIDの解像度に応じて、縦方向に沿った行間の長さm(即ち行間の画素数m)を決定する。例えば、CPU62は、スキャン画像データSIDの解像度が300dpiである場合には、行間の長さmとして1画素を決定し、スキャン画像データSIDの解像度が600dpiである場合には、行間の長さmとして2画素を決定する。即ち、CPU62は、スキャン画像データSIDの解像度が高くなる程、大きい行間の長さmを決定する。この構成によると、CPU62は、スキャン画像データSIDの解像度に応じた適切な大きさを有する行間の長さmを決定することができる。なお、変形例では、スキャン画像データSIDの解像度に関わらず、行間の長さmとして同じ値が採用されてもよい。   In S440, the CPU 62 determines the length m between rows along the vertical direction (that is, the number m of pixels between rows) according to the resolution of the scan image data SID. For example, when the resolution of the scanned image data SID is 300 dpi, the CPU 62 determines one pixel as the length m between the rows, and when the resolution of the scanned image data SID is 600 dpi, the length m between the rows. 2 pixels are determined. That is, the CPU 62 determines a larger line length m as the resolution of the scanned image data SID increases. According to this configuration, the CPU 62 can determine the length m between lines having an appropriate size according to the resolution of the scanned image data SID. In the modified example, the same value may be adopted as the length m between lines regardless of the resolution of the scanned image data SID.

S450では、CPU62は、対象結合画像データと、S432又はS434で決定された候補再配置領域の横方向の新たな長さWと、に基づいて、行数決定処理を実行する(後述の図11参照)。行数決定処理では、CPU62は、対象結合画像(例えば図2のCI1)に含まれる複数個の文字(例えば「A〜M」)を候補再配置領域内に再配置する場合における行数を決定する。   In S450, the CPU 62 executes a row number determination process based on the target combined image data and the new horizontal length W of the candidate rearrangement region determined in S432 or S434 (FIG. 11 described later). reference). In the line number determination process, the CPU 62 determines the number of lines in the case where a plurality of characters (for example, “A to M”) included in the target combined image (for example, CI1 in FIG. 2) are rearranged in the candidate rearrangement region. To do.

(行数決定処理;図11)
図11に示されるように、S451では、CPU62は、対象結合画像(例えば図11内のCI1)の横方向の長さIWが、候補再配置領域の横方向の長さW以下であるのか否かを判断する。CPU62は、長さIWが長さW以下であると判断する場合(S451でYES)には、S452において、「1」を行数として決定する。対象結合画像CI1に含まれる全ての文字「A〜M」が横方向に沿って直線状に並んだ状態で、全ての文字「A〜M」が候補再配置領域内に収まるからである。S452が終了すると、図11の処理が終了する。
(Line number determination processing; FIG. 11)
As shown in FIG. 11, in S451, the CPU 62 determines whether or not the horizontal length IW of the target combined image (for example, CI1 in FIG. 11) is equal to or smaller than the horizontal length W of the candidate rearrangement region. Determine whether. If the CPU 62 determines that the length IW is less than or equal to the length W (YES in S451), the CPU 62 determines “1” as the number of rows in S452. This is because all the characters “A to M” are included in the candidate rearrangement region in a state where all the characters “A to M” included in the target combined image CI1 are linearly arranged in the horizontal direction. When S452 ends, the process of FIG. 11 ends.

一方、CPU62は、長さIWが長さWより大きいと判断する場合(S451でNO)には、対象結合画像CI1に含まれる複数個の文字「A〜M」を複数行に分断して配置する必要がある。このために、CPU62は、S453及び454を実行して、図4のS240で決定された複数個の分断候補位置(例えば図11内の対象結合画像CI1に付された複数個の矢印参照)の中から、1個以上の分断候補位置を選択する。   On the other hand, if the CPU 62 determines that the length IW is greater than the length W (NO in S451), the CPU 62 divides and arranges the plurality of characters “A to M” included in the target combined image CI1. There is a need to. For this purpose, the CPU 62 executes S453 and 454 to determine a plurality of division candidate positions determined in S240 of FIG. 4 (see, for example, a plurality of arrows attached to the target combined image CI1 in FIG. 11). One or more division candidate positions are selected from the inside.

S453では、CPU62は、選択長さSWが候補再配置領域の横方向の長さW以下の最大の長さになるように、複数個の分断候補位置の中から1個の分断候補位置を選択する。1個の分断候補位置も未だに選択されていない状態では、選択長さSWは、対象結合画像CI1の先端(即ち左端)と、選択されるべき分断候補位置と、の間の横方向の長さである。また、1個以上の分断候補位置が既に選択されている状態では、選択長さSWは、直近に選択された分断候補位置と、当該分断候補位置よりも後端側(即ち右側)に存在する新たに選択されるべき分断候補位置と、の間の横方向の長さである。図11の例では、文字「F」と文字「G」との間の分断候補位置が選択される。   In S453, the CPU 62 selects one division candidate position from among a plurality of division candidate positions so that the selection length SW becomes the maximum length not more than the horizontal length W of the candidate rearrangement area. To do. In a state where one division candidate position has not yet been selected, the selection length SW is the horizontal length between the leading end (that is, the left end) of the target combined image CI1 and the division candidate position to be selected. It is. In a state where one or more division candidate positions have already been selected, the selection length SW is present at the most recently selected division candidate position and the rear end side (that is, the right side) of the division candidate position. This is the length in the horizontal direction between the division candidate position to be newly selected. In the example of FIG. 11, the division candidate position between the character “F” and the character “G” is selected.

S454では、CPU62は、残存長さRWが候補再配置領域の横方向の長さW以下であるのか否かを判断する。残存長さRWは、直近に選択された分断候補位置と、対象結合画像の後端(即ち右端)と、の間の横方向の長さである。CPU62は、残存長さRWが長さWよりも大きいと判断する場合(S454でNO)には、S453に戻り、複数個の分断候補位置の中から。直近に選択された分断候補位置よりも後端側に存在する分断候補位置を新たに決定する。   In S454, the CPU 62 determines whether or not the remaining length RW is less than or equal to the horizontal length W of the candidate rearrangement region. The remaining length RW is a length in the horizontal direction between the most recently selected division candidate position and the rear end (that is, the right end) of the target combined image. If the CPU 62 determines that the remaining length RW is greater than the length W (NO in S454), the CPU 62 returns to S453 and selects from among a plurality of division candidate positions. A division candidate position that is present on the rear end side from the most recently selected division candidate position is newly determined.

一方、CPU62は、残存長さRWが長さW以下であると判断する場合(S454でYES)には、S455において、選択済みの分断候補位置の数に「1」を加算することによって得られる数を行数として決定する。S455が終了すると、図11の処理が終了する。   On the other hand, if the CPU 62 determines that the remaining length RW is less than or equal to the length W (YES in S454), it is obtained by adding “1” to the number of selected division candidate positions in S455. Determine the number as the number of rows. When S455 ends, the process of FIG. 11 ends.

(再配置処理の続き;図10)
図10のS460では、CPU62は、S460内の数式に従って、候補再配置領域の縦方向の新たな長さHを決定する。S460内の数式において、「m」はS440で決定された行間の長さであり、「n」はS450で決定された行数であり、「h」は対象結合画像データの縦方向の長さである(図11内の結合画像CI1のh参照)。
(Continuation of rearrangement processing; FIG. 10)
In S460 of FIG. 10, the CPU 62 determines a new length H in the vertical direction of the candidate rearrangement region according to the mathematical expression in S460. In the mathematical expression in S460, “m” is the length between lines determined in S440, “n” is the number of lines determined in S450, and “h” is the length in the vertical direction of the target combined image data. (Refer to h of the combined image CI1 in FIG. 11).

S470では、CPU62は、候補再配置領域のアスペクト比W/Hが対象目標領域のアスペクト比TW/THに近似するのか否かを判断する。具体的には、CPU62は、候補再配置領域のアスペクト比W/Hが、対象目標領域のアスペクト比TW/THに基づいて設定される所定範囲内に含まれるのか否かを判断する。上記の所定範囲は、対象目標領域のアスペクト比TW/THから値γを減算することによって得られる値と、対象目標領域のアスペクト比TW/THに値γを加算することによって得られる値と、の間の範囲である。なお、値γは、予め決められている固定値であってもよいし、TW/THに所定の係数(例えば0.05)を乗算することによって得られる値であってもよい。   In S470, the CPU 62 determines whether or not the aspect ratio W / H of the candidate rearrangement area approximates the aspect ratio TW / TH of the target target area. Specifically, the CPU 62 determines whether or not the aspect ratio W / H of the candidate rearrangement area is included within a predetermined range set based on the aspect ratio TW / TH of the target target area. The predetermined range includes a value obtained by subtracting the value γ from the aspect ratio TW / TH of the target target area, a value obtained by adding the value γ to the aspect ratio TW / TH of the target target area, The range between. Note that the value γ may be a predetermined fixed value, or may be a value obtained by multiplying TW / TH by a predetermined coefficient (for example, 0.05).

CPU62は、候補再配置領域のアスペクト比W/Hが対象目標領域のアスペクト比TW/THに近似しないと判断する場合(S470でNO)には、S430〜S460の各処理を再び実行する。これにより、CPU62は、候補再配置領域の横方向の新たな長さWと縦方向の新たな長さHとを決定して、S470の判断を再び実行する。   If the CPU 62 determines that the aspect ratio W / H of the candidate rearrangement area does not approximate the aspect ratio TW / TH of the target target area (NO in S470), the CPU 62 executes each process of S430 to S460 again. Thereby, the CPU 62 determines a new length W in the horizontal direction and a new length H in the vertical direction of the candidate rearrangement region, and executes the determination in S470 again.

一方、CPU62は、候補再配置領域のアスペクト比W/Hが対象目標領域のアスペクト比TW/THに近似すると判断する場合(S470でYES)には、S480において、まず、横方向の長さWと縦方向の長さHとを有する候補再配置領域を再配置領域(例えば図2のRA1)として決定する。そして、CPU62は、図11のS453で1個以上の分断候補位置を選択済みである場合には、当該1個以上の分断候補位置で対象結合画像データを分断して、2個以上の分断画像を表わす2個以上の分断画像データを生成する。次いで、CPU62は、2個以上の分断画像が縦方向に沿って並ぶように、2個以上の分断画像データを再配置領域内に配置する。この際に、CPU62は、縦方向に沿って隣接する2個の分断画像の間にS440で決定された行間が形成されるように、2個の分断画像データを配置する。この結果、例えば、図2のS400に示されるように、複数個の文字「A」〜「M」が再配置領域RA1内に再配置されている再配置画像RI1を表わす再配置画像データが生成される。再配置画像RI1内の複数個の文字「A」〜「M」のサイズは、スキャン画像SI内の複数個の文字「A」〜「M」のサイズに等しい。   On the other hand, if the CPU 62 determines that the aspect ratio W / H of the candidate rearrangement area is close to the aspect ratio TW / TH of the target target area (YES in S470), first, in S480, the horizontal length W And a candidate rearrangement region having a length H in the vertical direction is determined as a rearrangement region (for example, RA1 in FIG. 2). Then, when one or more division candidate positions have been selected in S453 of FIG. 11, the CPU 62 divides the target combined image data at the one or more division candidate positions, and two or more division images. Two or more pieces of divided image data representing are generated. Next, the CPU 62 arranges the two or more divided image data in the rearrangement region so that the two or more divided images are arranged in the vertical direction. At this time, the CPU 62 arranges the two pieces of divided image data so that the line spacing determined in S440 is formed between the two divided images adjacent in the vertical direction. As a result, for example, as shown in S400 of FIG. 2, rearranged image data representing a rearranged image RI1 in which a plurality of characters “A” to “M” are rearranged in the rearranged region RA1 is generated. Is done. The size of the plurality of characters “A” to “M” in the rearranged image RI1 is equal to the size of the plurality of characters “A” to “M” in the scan image SI.

S490では、CPU62は、全てのテキスト領域OA1,OA2について、S410〜S480の処理が終了したのか否かを判断する。CPU62は、処理が終了していないと判断する場合(S490でNO)には、S410において、未処理のテキスト領域(例えばOA2)を処理対象として決定して、S412以降の各処理を再び実行する。この結果、例えば、図2のS400に示されるように、複数個の文字「N」〜「W」が再配置領域RA2内に再配置されている再配置画像RI2を表わす再配置画像データが生成される。そして、CPU62は、処理が終了したと判断する場合(S490でYES)には、図10の処理を終了する。   In S490, the CPU 62 determines whether or not the processing of S410 to S480 has been completed for all the text areas OA1 and OA2. If the CPU 62 determines that the process has not ended (NO in S490), in S410, the CPU 62 determines an unprocessed text area (for example, OA2) as a processing target, and executes each process after S412 again. . As a result, for example, as shown in S400 of FIG. 2, rearranged image data representing a rearranged image RI2 in which a plurality of characters “N” to “W” are rearranged in the rearranged region RA2 is generated. Is done. Then, if the CPU 62 determines that the process is complete (YES in S490), the process of FIG. 10 is terminated.

(ケースA;図12)
続いて、図12を参照して、図2のS400の再配置処理(図10参照)とS500の拡大処理について、具体的なケースAを説明する。(A1)に示されるように、候補再配置領域の横方向の長さWの初期値、縦方向の長さHの初期値として、それぞれ、対象テキスト領域OA1の横方向の長さOPx、縦方向の長さOPyが設定される(図10のS420)。本ケースでは、W/HがTW/TH未満である。即ち、対象目標領域TA1は、対象テキスト領域OA1と比べると、横長の形状を有する。この場合、候補再配置領域を横長の形状にしていけば、候補再配置領域のアスペクト比が対象目標領域TA1のアスペクト比に近づくことになる。従って、(A2)に示されるように、候補再配置領域の横方向の現在の長さWに固定値βが加算されて、候補再配置領域の横方向の新たな長さWが決定される(S432)。この場合、行数として、文字列「A〜E」と文字列「F〜J」と文字列「K〜M」とを含む3行が決定される(S450)。そして、候補再配置領域の縦方向の新たな長さHが決定される(S460)。
(Case A; FIG. 12)
Next, with reference to FIG. 12, a specific case A will be described with respect to the rearrangement process in S400 (see FIG. 10) and the enlargement process in S500 in FIG. As shown in (A1), as the initial value of the horizontal length W and the initial value of the vertical length H of the candidate rearrangement area, the horizontal length OPx and the vertical length of the target text area OA1, respectively. The direction length OPy is set (S420 in FIG. 10). In this case, W / H is less than TW / TH. That is, the target target area TA1 has a horizontally long shape as compared with the target text area OA1. In this case, if the candidate rearrangement area has a horizontally long shape, the aspect ratio of the candidate rearrangement area approaches the aspect ratio of the target target area TA1. Therefore, as shown in (A2), the fixed value β is added to the current length W in the horizontal direction of the candidate rearrangement region to determine a new length W in the horizontal direction of the candidate rearrangement region. (S432). In this case, three lines including the character string “A to E”, the character string “F to J”, and the character string “K to M” are determined as the number of lines (S450). Then, a new vertical length H of the candidate rearrangement region is determined (S460).

(A2)の状態では、候補再配置領域のアスペクト比W/Hが対象目標領域TA1のアスペクト比TW/THに近似しないので(S470でNO)、(A3)に示されるように、候補再配置領域の横方向の現在の長さWに固定値βが再び加算されて、候補再配置領域の横方向の新たな長さWが再び決定される(S432)。この場合、行数として、文字列「A〜F」と文字列「G〜L」と文字列「M」とを含む3行が決定される(S450)。即ち、候補再配置領域の横方向の長さWが大きくなったことに起因して、候補再配置領域内の1行の文字列を構成することが可能な最大の文字数が増える。そして、候補再配置領域の縦方向の新たな長さHが決定される(S460)。   In the state of (A2), since the aspect ratio W / H of the candidate rearrangement area does not approximate the aspect ratio TW / TH of the target target area TA1 (NO in S470), as shown in (A3), the candidate rearrangement The fixed value β is added again to the current length W in the horizontal direction of the area, and the new horizontal length W of the candidate rearrangement area is determined again (S432). In this case, three lines including the character string “A to F”, the character string “G to L”, and the character string “M” are determined as the number of lines (S450). That is, the maximum number of characters that can form one line of character string in the candidate rearrangement area increases due to the increase in the horizontal length W of the candidate rearrangement area. Then, a new vertical length H of the candidate rearrangement region is determined (S460).

(A3)の状態では、候補再配置領域のアスペクト比W/Hが対象目標領域TA1のアスペクト比TW/THに近似する(S470でYES)。従って、(A4)に示されるように、(A3)の候補再配置領域が再配置領域RA1として決定される(S480)。この場合、再配置領域RA1のアスペクト比W/Hは、通常、対象テキスト領域OAのアスペクト比よりも対象目標領域TA1のアスペクト比TW/THに近い。次いで、対象結合画像CI1を表わす対象結合画像データが分断されて、3個の分断画像DI1〜DI3を表わす3個の分断画像データが生成される(S480)。そして、3個の分断画像DI1〜DI3が縦方向に沿って並び、かつ、隣接する2個の分断画像の間に長さmを有する行間が形成されるように、3個の分断画像データが再配置領域RA1内に配置される。この結果、再配置画像RI1を表わす再配置画像データが生成される(S480)。   In the state of (A3), the aspect ratio W / H of the candidate rearrangement area is close to the aspect ratio TW / TH of the target target area TA1 (YES in S470). Therefore, as shown in (A4), the candidate rearrangement region (A3) is determined as the rearrangement region RA1 (S480). In this case, the aspect ratio W / H of the rearrangement area RA1 is usually closer to the aspect ratio TW / TH of the target target area TA1 than the aspect ratio of the target text area OA. Next, the target combined image data representing the target combined image CI1 is divided, and three divided image data representing the three divided images DI1 to DI3 are generated (S480). Then, the three divided image data are arranged so that three divided images DI1 to DI3 are arranged in the vertical direction and a line space having a length m is formed between two adjacent divided images. Arranged in the rearrangement area RA1. As a result, rearranged image data representing the rearranged image RI1 is generated (S480).

次いで、再配置画像データが拡大されて、拡大画像を表わす拡大画像データが生成される(図2のS500)。具体的には、再配置画像RI1の対角線が伸びる方向に再配置画像RI1が拡大され、その結果、拡大画像を表わす拡大画像データが生成される。例えば、再配置領域RA1のアスペクト比W/Hが対象目標領域TA1のアスペクト比TW/THに等しい場合には、拡大画像の4個の辺の全てが、対象目標領域TA1の4個の辺に一致する。即ち、この場合、拡大画像のサイズが目標領域TA1のサイズに一致する。ただし、例えば、再配置領域RA1のアスペクト比W/Hが対象目標領域TA1のアスペクト比TW/THに等しくない場合には、再配置画像RI1を徐々に拡大していく過程において、拡大画像のいずれかの辺が対象目標領域TA1のいずれかの辺に一致した段階で、再配置画像RI1の拡大が終了する。即ち、この場合、拡大画像のサイズが目標領域TA1のサイズよりも小さくなる。   Next, the rearranged image data is enlarged, and enlarged image data representing the enlarged image is generated (S500 in FIG. 2). Specifically, the rearranged image RI1 is enlarged in the direction in which the diagonal line of the rearranged image RI1 extends, and as a result, enlarged image data representing the enlarged image is generated. For example, when the aspect ratio W / H of the rearrangement area RA1 is equal to the aspect ratio TW / TH of the target target area TA1, all four sides of the enlarged image are in the four sides of the target target area TA1. Match. In other words, in this case, the size of the enlarged image matches the size of the target area TA1. However, for example, when the aspect ratio W / H of the rearrangement area RA1 is not equal to the aspect ratio TW / TH of the target target area TA1, any of the enlarged images is gradually increased in the process of gradually expanding the rearrangement image RI1. The enlargement of the rearranged image RI1 is completed when the corresponding side matches any side of the target target area TA1. That is, in this case, the size of the enlarged image is smaller than the size of the target area TA1.

続いて、(A5)に示されるように、再配置画像RI1を表わす再配置画像データが拡大された拡大画像データが、スキャン画像データSIDの目標領域TA1内に上書きされる(図2のS500)。同様に、図2の再配置画像RI2を表わす再配置画像データが拡大された拡大画像を表わす拡大画像データが、スキャン画像データSIDの目標領域TA2内に上書きされる。この結果、処理済み画像PIを表わす処理済み画像データPIDが完成する。   Subsequently, as shown in (A5), the enlarged image data obtained by enlarging the rearranged image data representing the rearranged image RI1 is overwritten in the target area TA1 of the scanned image data SID (S500 in FIG. 2). . Similarly, enlarged image data representing an enlarged image obtained by enlarging the rearranged image data representing the rearranged image RI2 in FIG. 2 is overwritten in the target area TA2 of the scanned image data SID. As a result, processed image data PID representing the processed image PI is completed.

上述したように、本実施例では、図10のS440において、比較的に小さい行間の長さm(例えば1画素、2画素等)が決定され、当該行間の長さmが再配置画像RI1で採用される。従って、再配置画像RI1内の行間の長さmは、通常、スキャン画像SI内の行間の長さよりも小さい。この結果、再配置画像RI1が拡大されて得られる処理済み画像PI内の複数個の文字の縦方向の長さ(例えば文字「A」の縦方向の長さ)に対する行間の長さの比は、スキャン画像SI内の複数個の文字の縦方向の長さに対する行間の長さの比よりも小さくなる。このように、本実施例では、処理済み画像PI内の行間の長さを相対的に小さくすることができ、その分、処理済み画像PI内において、各文字を適切に拡大することができる。   As described above, in this embodiment, in S440 of FIG. 10, a relatively small line length m (for example, 1 pixel, 2 pixels, etc.) is determined, and the line length m is determined by the rearranged image RI1. Adopted. Therefore, the length m between the lines in the rearranged image RI1 is usually smaller than the length between the lines in the scan image SI. As a result, the ratio of the length between lines to the vertical length of a plurality of characters in the processed image PI obtained by enlarging the rearranged image RI1 (for example, the vertical length of the character “A”) is This is smaller than the ratio of the length between lines to the length in the vertical direction of a plurality of characters in the scanned image SI. As described above, in this embodiment, the length between lines in the processed image PI can be relatively reduced, and accordingly, each character can be appropriately enlarged in the processed image PI.

なお、図10のS412において、対象テキスト領域のアスペクト比と対象目標領域とのアスペクト比とが等しいと判断される場合には、S414において、対象テキスト領域を表わす部分画像データが取得される。この場合、図2のS500では、当該部分画像データが拡大されて、対象目標領域のサイズに一致する拡大画像を表わす拡大画像データが生成される。そして、当該拡大画像データが、スキャン画像データSIDの対象目標領域(例えばTA1)に上書きされる。   If it is determined in S412 of FIG. 10 that the aspect ratio of the target text area is equal to the aspect ratio of the target target area, partial image data representing the target text area is acquired in S414. In this case, in S500 of FIG. 2, the partial image data is enlarged, and enlarged image data representing an enlarged image that matches the size of the target target area is generated. Then, the enlarged image data is overwritten on the target target area (for example, TA1) of the scanned image data SID.

(ケースB;図13)
続いて、図13を参照して、ケースBを説明する。(B1)に示されるように、本ケースでは、比W/Hが比TW/THよりも大きい。即ち、対象目標領域TA1は、対象テキスト領域OA1と比べると、縦長の形状を有する。この場合、候補再配置領域を縦長の形状にしていけば、候補再配置領域のアスペクト比が対象目標領域TA1のアスペクト比に近づくことになる。従って、(B2)に示されるように、候補再配置領域の横方向の現在の長さWから固定値βが減算されて、候補再配置領域の横方向の新たな長さWが決定される(S434)。この場合、行数として、文字列「A〜D」と文字列「E〜H」と文字列「I〜L」と文字列「M」とを含む4行と決定される(S450)。即ち、この場合、候補再配置領域の横方向の長さWが小さくなったことに起因して、候補再配置領域内の1行の文字列を構成することが可能な最大の文字数が減る。そして、候補再配置領域の縦方向の新たな長さHが決定される(S460)。
(Case B; FIG. 13)
Subsequently, Case B will be described with reference to FIG. As shown in (B1), in this case, the ratio W / H is larger than the ratio TW / TH. That is, the target target area TA1 has a vertically long shape as compared with the target text area OA1. In this case, if the candidate rearrangement area has a vertically long shape, the aspect ratio of the candidate rearrangement area approaches the aspect ratio of the target target area TA1. Accordingly, as shown in (B2), the fixed value β is subtracted from the current length W in the horizontal direction of the candidate rearrangement region to determine a new length W in the horizontal direction of the candidate rearrangement region. (S434). In this case, the number of lines is determined as four lines including the character string “A to D”, the character string “E to H”, the character string “I to L”, and the character string “M” (S450). In other words, in this case, the maximum number of characters that can form one line of character string in the candidate rearrangement area is reduced due to the reduction in the horizontal length W of the candidate rearrangement area. Then, a new vertical length H of the candidate rearrangement region is determined (S460).

(B2)の状態では、候補再配置領域のアスペクト比W/Hが対象目標領域TA1のアスペクト比TW/THに近似する(S470でYES)。従って、(B3)に示されるように、(B2)の候補再配置領域が再配置領域RA1として決定される(S480)。次いで、対象結合画像CI1を表わす対象結合画像データが分断されて、4個の分断画像DI4〜DI7を表わす4個の分断画像データが生成される(S480)。そして、図12のケースAと同様に、再配置画像RI1を表わす再配置画像データが生成され(S480)、(B4)に示されるように、再配置画像データが拡大された拡大画像データが生成され、当該拡大画像データがスキャン画像データSIDの目標領域TA1内に上書きされる(図2のS500)。この結果、処理済み画像PIを表わす処理済み画像データPIDが完成する。   In the state of (B2), the aspect ratio W / H of the candidate rearrangement area approximates the aspect ratio TW / TH of the target target area TA1 (YES in S470). Accordingly, as shown in (B3), the candidate rearrangement region in (B2) is determined as the rearrangement region RA1 (S480). Next, the target combined image data representing the target combined image CI1 is divided to generate four divided image data representing the four divided images DI4 to DI7 (S480). Then, as in the case A of FIG. 12, rearranged image data representing the rearranged image RI1 is generated (S480), and enlarged image data obtained by enlarging the rearranged image data is generated as shown in (B4). Then, the enlarged image data is overwritten in the target area TA1 of the scanned image data SID (S500 in FIG. 2). As a result, processed image data PID representing the processed image PI is completed.

(第1実施例の効果)
本実施例によると、図8及び図9に示されるように、画像処理サーバ50は、テキスト領域OA1と余白領域BA1との間の横方向の2個の余白の長さPx1,Px2と、縦方向の2個の余白の長さPy1,Py2と、に基づいて、目標領域TA1(図2のS300参照)の位置を決定することができる。また、図9に示されるように、画像処理サーバ50は、横方向の2個の余白の長さPx1,Px2と、縦方向の2個の余白の長さPy1,Py2と、に基づいて、テキスト領域OA1のアスペクト比とは異なるアスペクト比を有する目標領域TA1のアスペクト比及びサイズを決定することができる。このために、画像処理サーバ50は、スキャン画像SI内の複数個のオブジェクトOB1〜OB3の位置関係がほぼ維持されるように、処理済み画像PI内の各目標領域TA1,TA2(図2のS300参照)を適切に決定することができる。また、図5に示されるように、画像処理サーバ50は、2個以上の目標領域TA1,TA2が重複しないように、各目標領域TA1,TA2を決定することができる(図5のS370,S372,S380,S382参照)。従って、画像処理サーバ50は、スキャン画像SI内の複数個のオブジェクトOB1〜OB3の位置関係をほぼ維持しながら、各テキストオブジェクトOB1,OB2が拡大されて表現されている処理済み画像PIを表わす処理済み画像データPIDを適切に生成することができる。
(Effects of the first embodiment)
According to the present embodiment, as shown in FIGS. 8 and 9, the image processing server 50 includes two margin lengths Px1 and Px2 in the horizontal direction between the text area OA1 and the margin area BA1. The position of the target area TA1 (see S300 in FIG. 2) can be determined based on the two margin lengths Py1 and Py2. Also, as shown in FIG. 9, the image processing server 50 is based on the two margin lengths Px1 and Px2 in the horizontal direction and the two margin lengths Py1 and Py2 in the vertical direction. The aspect ratio and size of the target area TA1 having an aspect ratio different from the aspect ratio of the text area OA1 can be determined. Therefore, the image processing server 50 sets the target areas TA1 and TA2 in the processed image PI (S300 in FIG. 2) so that the positional relationship between the plurality of objects OB1 to OB3 in the scan image SI is substantially maintained. Reference) can be appropriately determined. Further, as shown in FIG. 5, the image processing server 50 can determine each target area TA1, TA2 so that two or more target areas TA1, TA2 do not overlap (S370, S372 in FIG. 5). , S380, S382). Accordingly, the image processing server 50 performs processing representing the processed image PI in which the text objects OB1 and OB2 are enlarged and expressed while substantially maintaining the positional relationship between the plurality of objects OB1 to OB3 in the scan image SI. The completed image data PID can be appropriately generated.

また、本実施例によると、図10〜図13に示されるように、画像処理サーバ50は、目標領域TA1を決定した後に、目標領域TA1のアスペクト比に基づいて、再配置領域RA1を決定する。従って、画像処理サーバ50は、目標領域TA1のアスペクト比に近似するアスペクト比を有する再配置領域RA1を決定することができる。このために、画像処理サーバ50は、スキャン画像SI内の複数個の文字が再配置されるべき目標領域TA1が決定されている状態で、再配置領域RA1を適切に決定することができ、この結果、再配置領域RA1内に複数個の文字を再配置して、再配置画像RI1(図12及び図13参照)を表わす再配置画像データを適切に生成することができる。そして、再配置領域RA1のアスペクト比が目標領域TA1のアスペクト比に近似するので、画像処理サーバ50は、目標領域TA1のサイズに近似するサイズまで再配置画像RI1を適切に拡大することができる。この結果、画像処理サーバ50は、目標領域TA1内に複数個の文字が拡大されて表現されている処理済み画像PIを表わす処理済み画像データPIDを適切に生成することができる。   Further, according to the present embodiment, as illustrated in FIGS. 10 to 13, after determining the target area TA1, the image processing server 50 determines the rearrangement area RA1 based on the aspect ratio of the target area TA1. . Therefore, the image processing server 50 can determine the rearrangement region RA1 having an aspect ratio that approximates the aspect ratio of the target region TA1. For this reason, the image processing server 50 can appropriately determine the rearrangement region RA1 in a state where the target region TA1 in which a plurality of characters in the scan image SI are to be rearranged is determined. As a result, a plurality of characters can be rearranged in the rearrangement area RA1, and rearrangement image data representing the rearrangement image RI1 (see FIGS. 12 and 13) can be appropriately generated. Since the aspect ratio of the rearrangement area RA1 approximates the aspect ratio of the target area TA1, the image processing server 50 can appropriately expand the rearrangement image RI1 to a size that approximates the size of the target area TA1. As a result, the image processing server 50 can appropriately generate processed image data PID representing the processed image PI in which a plurality of characters are enlarged and expressed in the target area TA1.

(対応関係)
画像処理サーバ50が、「画像処理装置」の一例である。スキャン画像SI、テキストオブジェクトOB1,OB2、写真オブジェクトOB3が、それぞれ、「原画像」、「2個以上の特定オブジェクト」、「他のオブジェクト」の一例である。オブジェクト領域OA1,OA2、余白領域BA1,BA2が、それぞれ、「2個以上の特定オブジェクト領域」、「2個以上のスペース領域」の一例である。
(Correspondence)
The image processing server 50 is an example of an “image processing apparatus”. Scanned image SI, text objects OB1 and OB2, and photographic object OB3 are examples of “original image”, “two or more specific objects”, and “other objects”, respectively. The object areas OA1 and OA2 and the margin areas BA1 and BA2 are examples of “two or more specific object areas” and “two or more space areas”, respectively.

横方向、縦方向が、それぞれ、「第1方向」、「第2方向」の一例である。横方向の左側、右側が、それぞれ、「第1方向の第1側」、「第1方向の第2側」の一例である。縦方向の上側、下側が、それぞれ、「第2方向の第1側」、「第2方向の第2側」の一例である。図6のS312の拡大で利用される左上向きが、「最初の拡大に利用されるべき向き」の一例である。   The horizontal direction and the vertical direction are examples of the “first direction” and the “second direction”, respectively. The left side and the right side in the horizontal direction are examples of the “first side in the first direction” and the “second side in the first direction”, respectively. The upper side and the lower side in the vertical direction are examples of the “first side in the second direction” and the “second side in the second direction”, respectively. 6 is an example of the “direction to be used for the first enlargement”.

図8及び図9において、横方向の2個の余白の長さPx1,Px2、縦方向の2個の余白の長さPy1,Py2が、それぞれ、「第1方向に沿った2個の余白の長さ」、「第2方向に沿った2個の余白の長さ」の一例である。横方向の差分長さ(即ちdx1+dx2(図9参照))、縦方向の差分長さ(即ちdy1+dy2)が、それぞれ、「第1の差分長さ」、「第2の差分長さ」の一例である。図7のS354のルートER、CPx、CPyが、それぞれ、「目標値」、「第1の候補長さ」、「第2の候補長さ」の一例である。図7のS356において、CPx≦BPxかつCPy≦BPyを満たす場合が、「特定の条件が満たされる場合」の一例である。図5のS380の所定値(例えば1.4)が、「目標倍率」の一例である。   8 and 9, the lengths Px1 and Px2 of the two margins in the horizontal direction and the lengths Py1 and Py2 of the two margins in the vertical direction are “the two margins along the first direction, respectively. This is an example of “length” and “length of two margins along the second direction”. The difference length in the horizontal direction (ie, dx1 + dx2 (see FIG. 9)) and the difference length in the vertical direction (ie, dy1 + dy2) are examples of “first difference length” and “second difference length”, respectively. is there. The roots ER, CPx, and CPy of S354 in FIG. 7 are examples of “target value”, “first candidate length”, and “second candidate length”, respectively. In S356 of FIG. 7, the case of satisfying CPx ≦ BPx and CPy ≦ BPy is an example of “when a specific condition is satisfied”. A predetermined value (eg, 1.4) in S380 in FIG. 5 is an example of “target magnification”.

(第2実施例;図14)
本実施例では、図7のS360の処理の内容が第1実施例とは異なる。画像処理サーバ50のCPU62は、図9の手法に代えて、図14の手法を利用して、拡大領域CA(即ち後の目標領域TA1等)を決定する。図14内の各矩形は、図9内の各矩形と同様である。CPU62は、図14内の数式(1)〜(6)を利用して、4個の対象長さdx1,dx2,dy1,dy2を算出することによって、変形拡大領域CAの位置、アスペクト比、及び、サイズを決定する。
(Second embodiment; FIG. 14)
In the present embodiment, the content of the process of S360 in FIG. 7 is different from that of the first embodiment. The CPU 62 of the image processing server 50 determines the enlargement area CA (that is, the subsequent target area TA1 and the like) using the technique shown in FIG. 14 instead of the technique shown in FIG. Each rectangle in FIG. 14 is the same as each rectangle in FIG. The CPU 62 calculates the four target lengths dx1, dx2, dy1, dy2 by using the formulas (1) to (6) in FIG. Determine the size.

数式(1)は、各対象長さdx1,dx2,dy1,dy2を算出するための数式を示す。ここで、Exは、テキスト領域OA1の横方向の長さOPxに対する拡大領域CAの横方向の長さ(即ちOPx+dx1+dx2)の倍率(以下では「横方向の拡大率Ex」と呼ぶ)である。また、Eyは、テキスト領域OA1の縦方向の長さOPyに対する拡大領域CAの縦方向の長さ(即ちOPy+dy1+dy2)の倍率(以下では「縦方向の拡大率Ey」と呼ぶ)である。数式(2)は、テキスト領域OA1に対する拡大領域CAの面積の拡大率ER(図5のS340参照)が、横方向の拡大率Exと縦方向の拡大率Eyとを乗算することによって得られることを示す。数式(3)は、横方向の拡大率Exと縦方向の拡大率Eyとの比が、横方向の2個の余白の長さPx1,Px2の和と縦方向の2個の余白の長さPy1,Py2の和との比に等しいことを示す。数式(4)は、数式(2)のEyを数式(3)に代入することによって得られる数式を示す。数式(5)は、数式(4)を展開することによって得られる数式を示す。数式(6)は、数式(5)に基づいて算出される横方向の拡大率Ex及び縦方向の拡大率Eyを示す。そして、数式(6)で得られる横方向の拡大率Ex及び縦方向の拡大率Eyを数式(1)に代入すれば、4個の対象長さdx1,dx2,dy1,dy2を算出することができる。   Formula (1) represents a formula for calculating each target length dx1, dx2, dy1, dy2. Here, Ex is a magnification (hereinafter referred to as “horizontal enlargement ratio Ex”) of the lateral length of the enlarged area CA (that is, OPx + dx1 + dx2) with respect to the lateral length OPx of the text area OA1. Ey is a magnification (hereinafter, referred to as “vertical enlargement ratio Ey”) of the vertical length of the enlarged area CA (that is, OPy + dy1 + dy2) with respect to the vertical length OPy of the text area OA1. Expression (2) is obtained by multiplying the enlargement ratio ER (see S340 in FIG. 5) of the area of the enlargement area CA with respect to the text area OA1 by the horizontal enlargement ratio Ex and the vertical enlargement ratio Ey. Indicates. In the formula (3), the ratio of the horizontal expansion ratio Ex to the vertical expansion ratio Ey is the sum of the two horizontal lengths Px1 and Px2 and the two vertical lengths. It is equal to the ratio with the sum of Py1 and Py2. Formula (4) represents a formula obtained by substituting Ey of Formula (2) into Formula (3). Formula (5) shows a formula obtained by expanding Formula (4). Equation (6) shows the horizontal enlargement factor Ex and the vertical enlargement factor Ey calculated based on Equation (5). Then, by substituting the horizontal magnification rate Ex and the vertical magnification rate Ey obtained by Equation (6) into Equation (1), four target lengths dx1, dx2, dy1, dy2 can be calculated. it can.

図14内の数式(1)〜(6)によると、以下の変形拡大領域CAが得られる。数式(3)に示されるように、横方向の2個の余白の長さPx1,Px2の和が、縦方向の2個の余白の長さPy1,Py2の和よりも大きい場合に、横方向の拡大率Exが縦方向の拡大率Eyよりも大きくなるように、変形拡大領域CAのアスペクト比が決定される。また、横方向の2個の余白の長さPx1,Px2の和が、縦方向の2個の余白の長さPy1,Py2の和よりも小さい場合に、横方向の拡大率Exが縦方向の拡大率Eyよりも小さくなるように、変形拡大領域CAのアスペクト比が決定される。このように、横方向の2個の余白の長さPx1,Px2と、縦方向の2個の余白の長さPy1,Py2と、に基づいて、テキスト領域OA1のアスペクト比とは異なる変形拡大領域のアスペクト比と、変形拡大領域のサイズ(即ち横方向の長さ及び縦方向の長さ)と、変形拡大領域の位置と、が決定される。そして、変形拡大領域が目標領域として決定され得る(図5のS372,S382参照)。   According to the mathematical expressions (1) to (6) in FIG. 14, the following deformation enlarged area CA is obtained. When the sum of the two horizontal margin lengths Px1 and Px2 is larger than the sum of the two vertical margin lengths Py1 and Py2 as shown in Equation (3), the horizontal direction The aspect ratio of the deformation enlargement area CA is determined such that the enlargement ratio Ex is larger than the vertical enlargement ratio Ey. Further, when the sum of the two horizontal margin lengths Px1 and Px2 is smaller than the sum of the two vertical margin lengths Py1 and Py2, the horizontal enlargement ratio Ex is The aspect ratio of the deformation enlargement area CA is determined so as to be smaller than the enlargement ratio Ey. As described above, the deformation enlargement area different from the aspect ratio of the text area OA1 based on the two margin lengths Px1 and Px2 in the horizontal direction and the two margin lengths Py1 and Py2 in the vertical direction. The aspect ratio, the size of the deformation enlargement region (that is, the length in the horizontal direction and the length in the vertical direction), and the position of the deformation enlargement region are determined. And a deformation | transformation expansion area | region can be determined as a target area | region (refer S372, S382 of FIG. 5).

本実施例によっても、画像処理サーバ50は、テキスト領域(例えばOA1)と余白領域(例えばBA1)との間の横方向の2個の余白の長さPx1,Px2と、縦方向の2個の余白の長さPy1,Py2と、に基づいて、目標領域(例えばTA1)を適切に決定することができる。   Also according to this embodiment, the image processing server 50 includes two horizontal margin lengths Px1 and Px2 between the text area (for example, OA1) and the margin area (for example, BA1) and two vertical areas. Based on the margin lengths Py1 and Py2, the target area (for example, TA1) can be appropriately determined.

以上、本発明の具体例を詳細に説明したが、これらは例示にすぎず、特許請求の範囲を限定するものではない。特許請求の範囲に記載の技術には以上に例示した具体例を様々に変形、変更したものが含まれる。上記の実施例の変形例を以下に列挙する。   Specific examples of the present invention have been described in detail above, but these are merely examples and do not limit the scope of the claims. The technology described in the claims includes various modifications and changes of the specific examples illustrated above. The modifications of the above embodiment are listed below.

(変形例1)上記の実施例では、画像処理サーバ50が、スキャン画像データSIDに対して画像処理(即ち図2のS100〜S500の各処理)を実行して処理済み画像データPIDを生成し、当該処理済み画像データPIDを多機能機10に送信する(S600)。これに代えて、多機能機10が、スキャン画像データSIDに対して画像処理を実行して処理済み画像データPIDを生成してもよい(即ち画像処理サーバ50が存在しなくてもよい)。本変形例では、多機能機10が、「画像処理装置」の一例である。 (Modification 1) In the above embodiment, the image processing server 50 performs image processing on the scanned image data SID (that is, each processing of S100 to S500 in FIG. 2) to generate processed image data PID. Then, the processed image data PID is transmitted to the multi-function device 10 (S600). Alternatively, the multi-function device 10 may perform image processing on the scanned image data SID to generate processed image data PID (that is, the image processing server 50 may not exist). In the present modification, the multi-function device 10 is an example of an “image processing apparatus”.

(変形例2)画像処理サーバ50によって実行される画像処理の対象は、スキャン画像データSIDでなくてもよく、文書作成ソフト、表編集ソフト、描画作成ソフト等によって生成されるデータであってもよい。即ち、「原画像データ」は、スキャン対象シートのスキャンによって得られるデータに限られず、他の種類のデータであってもよい。 (Modification 2) The target of image processing executed by the image processing server 50 may not be scanned image data SID, but may be data generated by document creation software, table editing software, drawing creation software, or the like. Good. That is, the “original image data” is not limited to data obtained by scanning the scan target sheet, and may be other types of data.

(変形例3)上記の実施例では、画像処理サーバ50は、文字を含むテキストオブジェクトOB1,OB2が拡大されて表現されている処理済み画像PIを表わす処理済み画像データPIDを生成する。これに代えて、画像処理サーバ50は、写真オブジェクトOB3が拡大されて表現されている処理済み画像を表わす処理済み画像データを生成してもよい。また、画像処理サーバ50は、テキストオブジェクト及び写真オブジェクトとは異なるオブジェクト(例えばグラフ、図形等を含むオブジェクト)が拡大されて表現されている処理済み画像を表わす処理済み画像データを生成してもよい。即ち、「特定オブジェクト」は、テキストオブジェクトに限られず、他の種類のオブジェクトであってもよい。 (Modification 3) In the above embodiment, the image processing server 50 generates processed image data PID representing the processed image PI in which the text objects OB1 and OB2 including characters are enlarged and expressed. Instead, the image processing server 50 may generate processed image data representing a processed image in which the photographic object OB3 is enlarged and expressed. Further, the image processing server 50 may generate processed image data representing a processed image in which an object (for example, an object including a graph, a graphic, etc.) different from the text object and the photograph object is expressed in an enlarged manner. . That is, the “specific object” is not limited to the text object, but may be another type of object.

(変形例4)処理済み画像データPIDは、多機能機10での印刷に利用されるデータでなくてもよく、例えば、ディスプレイでの表示に利用されるデータであってもよい。一般的に言うと、処理済み画像データPIDによって表わされる処理済み画像PIは、出力(印刷、表示等)のための画像であればよい。 (Modification 4) The processed image data PID may not be data used for printing on the multi-function device 10, and may be data used for display on a display, for example. Generally speaking, the processed image PI represented by the processed image data PID may be an image for output (printing, display, etc.).

(変形例5)上記の実施例では、スキャン画像SIは、横方向の左側から右側に向かってセンテンスが進むと共に、縦方向の上側から下側に向かってセンテンスが進む文字列(即ち横書きの文字列)を含む。これに代えて、スキャン画像SIは、縦方向の上側から下側に向かってセンテンスが進むと共に、横方向の右側から左側に向かってセンテンスが進む文字列(即ち縦書きの文字列)を含んでいてもよい。この場合、画像処理サーバ50は、図3のS160において、横方向の射影ヒストグラムに基づいて、通常、帯状領域を決定することができない。このために、画像処理サーバ50は、さらに、縦方向の射影ヒストグラムを生成して、帯状領域を決定する。その後、画像処理サーバ50は、横方向の代わりに縦方向を利用し、縦方向の代わりに横方向を利用して、上記の実施例と同様の処理を実行すればよい。本変形例では、縦方向、横方向が、それぞれ、「第1方向」、「第2方向」の一例である。縦方向の上側、下側が、それぞれ、「第1方向の第1側」、「第1方向の第2側」の一例である。横方向の右側、左側が、それぞれ、「第2方向の第1側」、「第2方向の第2側」の一例である。そして、図6の余白領域決定処理では、センテンスが開始される上側及び右側の中間である右上向きが、最初の拡大に利用される。 (Modification 5) In the above embodiment, the scanned image SI is a character string in which the sentence advances from the left side in the horizontal direction to the right side and the sentence advances in the vertical direction from the upper side to the lower side (that is, horizontally written characters). Column). Instead, the scanned image SI includes a character string that progresses from the upper side to the lower side in the vertical direction and advances from the right side to the left side in the horizontal direction (that is, a vertically written character string). May be. In this case, the image processing server 50 normally cannot determine the band-like region based on the horizontal projection histogram in S160 of FIG. For this purpose, the image processing server 50 further generates a vertical projection histogram to determine a band-like region. Thereafter, the image processing server 50 may perform the same processing as in the above-described embodiment by using the vertical direction instead of the horizontal direction and using the horizontal direction instead of the vertical direction. In the present modification, the vertical direction and the horizontal direction are examples of “first direction” and “second direction”, respectively. The upper side and the lower side in the vertical direction are examples of the “first side in the first direction” and the “second side in the first direction”, respectively. The right side and the left side in the horizontal direction are examples of the “first side in the second direction” and the “second side in the second direction”, respectively. In the blank area determination process of FIG. 6, the upper right direction, which is the middle between the upper side and the right side where the sentence is started, is used for the first enlargement.

(変形例6)上記の実施例では、例えば、図12に示されるように、画像処理サーバ50は、スキャン画像SI内の3行の文字列「A〜M」が結合された結合文字列「A〜M」を含む結合画像CI1を表わす結合画像データを生成し、当該結合画像データを分断して、再配置画像RI1を表わす再配置画像データを生成する。これに代えて、画像処理サーバ50は、結合画像データを生成せずに、再配置画像データを生成してもよい。例えば、画像処理サーバ50は、スキャン画像SI内の1個の文字毎に、当該文字を表わす部分画像データを取得して、当該部分画像データを再配置領域RA1内に再配置して、再配置画像RI1を表わす再配置画像データを生成してもよい。 (Modification 6) In the above embodiment, for example, as shown in FIG. 12, the image processing server 50 uses the combined character string “A” to “M” in three lines in the scanned image SI. Combined image data representing the combined image CI1 including “A to M” is generated, and the combined image data is divided to generate rearranged image data representing the rearranged image RI1. Alternatively, the image processing server 50 may generate rearranged image data without generating combined image data. For example, the image processing server 50 acquires partial image data representing the character for each character in the scanned image SI, rearranges the partial image data in the rearrangement area RA1, and rearranges the partial image data. Rearranged image data representing the image RI1 may be generated.

(変形例7)上記の実施例では、画像処理サーバ50のCPU62がプログラム66(即ちソフトウェア)を実行することによって、図2〜図14の各処理が実現される。これに代えて、図2〜図14の各処理のうちの少なくとも1つの処理は、論理回路等のハードウェアによって実現されてもよい。 (Modification 7) In the above embodiment, the CPU 62 of the image processing server 50 executes the program 66 (that is, software), thereby realizing the processes shown in FIGS. Instead, at least one of the processes in FIGS. 2 to 14 may be realized by hardware such as a logic circuit.

また、本明細書または図面に説明した技術要素は、単独であるいは各種の組合せによって技術的有用性を発揮するものであり、出願時請求項記載の組合せに限定されるものではない。また、本明細書または図面に例示した技術は複数目的を同時に達成するものであり、そのうちの一つの目的を達成すること自体で技術的有用性を持つものである。   The technical elements described in this specification or the drawings exhibit technical usefulness alone or in various combinations, and are not limited to the combinations described in the claims at the time of filing. In addition, the technology illustrated in the present specification or the drawings achieves a plurality of objects at the same time, and has technical utility by achieving one of the objects.

2:通信システム、4:インターネット、10:多機能機、50:画像処理サーバ、52:ネットワークインターフェース、60:制御部、62:CPU、64:メモリ、66:プログラム、SI:スキャン画像、PI:処理済み画像、OB1,OB2:テキストオブジェクト、OB3:写真オブジェクト、OA1,OA2:テキストオブジェクト領域(テキスト領域)、OA3:写真オブジェクト領域、LA11〜LA13,LA21,LA22:帯状領域、BA1,BA2:余白領域、CA:拡大領域、TA1,TA2:目標領域、RA1,RA2:再配置領域、SID:スキャン画像データ、CI1,CI2:結合画像、DI1〜DI7:分断画像、RI1,RI2:再配置画像、PID:処理済み画像データ   2: Communication system, 4: Internet, 10: Multi-function device, 50: Image processing server, 52: Network interface, 60: Control unit, 62: CPU, 64: Memory, 66: Program, SI: Scanned image, PI: Processed image, OB1, OB2: Text object, OB3: Photo object, OA1, OA2: Text object area (text area), OA3: Photo object area, LA11 to LA13, LA21, LA22: Strip area, BA1, BA2: Margin Area, CA: enlarged area, TA1, TA2: target area, RA1, RA2: rearranged area, SID: scanned image data, CI1, CI2: combined image, DI1 to DI7: fragmented image, RI1, RI2: rearranged image, PID: Processed image data

Claims (20)

画像処理装置であって、
特定オブジェクトを含む複数個のオブジェクトを含む原画像を表わす原画像データを取得する取得部と、
前記原画像データに対して画像処理を実行して、前記複数個のオブジェクトを含む処理済み画像を表わす処理済み画像データを生成する画像処理実行部であって、前記処理済み画像では、前記原画像と比べて、前記特定オブジェクトが拡大されて表現されている、前記画像処理実行部と、を備え、
前記画像処理実行部は、
前記原画像内において、前記複数個のオブジェクトのそれぞれについて、当該オブジェクトを含むオブジェクト領域を決定するオブジェクト領域決定部と、
前記原画像内において、前記特定オブジェクトについて決定された特定オブジェクト領域を含むスペース領域を決定するスペース領域決定部であって、前記スペース領域は、前記複数個のオブジェクトのうちの他のオブジェクトについて決定された他のオブジェクト領域に重複しない、前記スペース領域決定部と、
前記原画像内の前記特定オブジェクト領域と前記スペース領域とに基づいて、前記処理済み画像内の目標領域を決定する目標領域決定部であって、前記目標領域は、拡大されて表現される前記特定オブジェクトが配置されるべき領域である、前記目標領域決定部と、を備え、
前記目標領域決定部は、前記特定オブジェクト領域と前記スペース領域との間の第1方向に沿った2個の余白の長さと、前記第1方向に直交する第2方向に沿った2個の余白の長さと、に基づいて、前記処理済み画像内の前記目標領域の位置を決定する、画像処理装置。
An image processing apparatus,
An acquisition unit for acquiring original image data representing an original image including a plurality of objects including a specific object;
An image processing execution unit that performs image processing on the original image data to generate processed image data representing a processed image including the plurality of objects, wherein the processed image includes the original image The image processing execution unit, wherein the specific object is expressed in an enlarged manner,
The image processing execution unit
In the original image, for each of the plurality of objects, an object area determination unit that determines an object area including the object,
A space area determination unit that determines a space area including a specific object area determined for the specific object in the original image, wherein the space area is determined for another object of the plurality of objects. The space area determination unit not overlapping with other object areas;
A target area determination unit that determines a target area in the processed image based on the specific object area and the space area in the original image, wherein the target area is expressed in an enlarged manner The target area determination unit, which is an area in which an object is to be placed,
The target area determination unit includes two margin lengths along a first direction between the specific object area and the space area, and two margins along a second direction orthogonal to the first direction. An image processing apparatus that determines a position of the target area in the processed image based on the length of the image.
前記目標領域決定部は、さらに、前記第1方向に沿った前記2個の余白の長さと、前記第2方向に沿った前記2個の余白の長さと、に基づいて、前記目標領域のアスペクト比を決定する、請求項1に記載の画像処理装置。   The target area determination unit may further determine an aspect of the target area based on the lengths of the two margins along the first direction and the lengths of the two margins along the second direction. The image processing apparatus according to claim 1, wherein the ratio is determined. 前記目標領域決定部は、さらに、前記第1方向に沿った前記2個の余白の長さと、前記第2方向に沿った前記2個の余白の長さと、に基づいて、前記目標領域の前記アスペクト比を有する前記目標領域のサイズを決定する、請求項2に記載の画像処理装置。   The target area determination unit may further include, based on the lengths of the two margins along the first direction and the lengths of the two margins along the second direction, the target area. The image processing apparatus according to claim 2, wherein a size of the target area having an aspect ratio is determined. 前記目標領域の前記アスペクト比は、前記特定オブジェクト領域の前記アスペクト比とは異なる、請求項2又は3に記載の画像処理装置。   The image processing apparatus according to claim 2, wherein the aspect ratio of the target area is different from the aspect ratio of the specific object area. 前記目標領域決定部は、
前記第1方向に沿った前記2個の余白の長さの和が、前記第2方向に沿った前記2個の余白の長さの和よりも大きい場合に、前記第1方向に沿った第1の差分長さが前記第2方向に沿った第2の差分長さよりも大きくなるように、前記目標領域の前記アスペクト比を決定し、
前記第1方向に沿った前記2個の余白の長さの和が、前記第2方向に沿った前記2個の余白の長さの和よりも小さい場合に、前記第1の差分長さが前記第2の差分長さよりも小さくなるように、前記目標領域の前記アスペクト比を決定し、
前記第1の差分長さは、前記目標領域の前記第1方向に沿った長さと、前記特定オブジェクト領域の前記第1方向に沿った長さと、の差分であり、
前記第2の差分長さは、前記目標領域の前記第2方向に沿った長さと、前記特定オブジェクト領域の前記第2方向に沿った長さと、の差分である、請求項2から4のいずれか一項に記載の画像処理装置。
The target area determination unit
When the sum of the lengths of the two margins along the first direction is larger than the sum of the lengths of the two margins along the second direction, the first margin along the first direction Determining the aspect ratio of the target region so that a difference length of 1 is greater than a second difference length along the second direction;
When the sum of the lengths of the two margins along the first direction is smaller than the sum of the lengths of the two margins along the second direction, the first difference length is Determining the aspect ratio of the target area to be smaller than the second difference length;
The first difference length is a difference between a length along the first direction of the target area and a length along the first direction of the specific object area,
5. The method according to claim 2, wherein the second difference length is a difference between a length of the target area along the second direction and a length of the specific object area along the second direction. 6. An image processing apparatus according to claim 1.
前記目標領域決定部は、
前記第1方向に沿った前記2個の余白の長さの和が、前記第2方向に沿った前記2個の余白の長さの和よりも大きい場合に、第1の倍率が第2の倍率よりも大きくなるように、前記目標領域の前記アスペクト比を決定し、
前記第1方向に沿った前記2個の余白の長さの和が、前記第2方向に沿った前記2個の余白の長さの和よりも小さい場合に、前記第1の倍率が前記第2の倍率よりも小さくなるように、前記目標領域の前記アスペクト比を決定し、
前記第1の倍率は、前記特定オブジェクト領域の前記第1方向に沿った長さに対する前記目標領域の前記第1方向に沿った長さの倍率であり、
前記第2の倍率は、前記特定オブジェクト領域の前記第2方向に沿った長さに対する前記目標領域の前記第2方向に沿った長さの倍率である、請求項2から4のいずれか一項に記載の画像処理装置。
The target area determination unit
When the sum of the lengths of the two margins along the first direction is greater than the sum of the lengths of the two margins along the second direction, the first magnification is the second Determining the aspect ratio of the target area to be larger than the magnification,
When the sum of the lengths of the two margins along the first direction is smaller than the sum of the lengths of the two margins along the second direction, the first magnification is Determining the aspect ratio of the target area to be smaller than a magnification of 2;
The first magnification is a magnification of a length along the first direction of the target region with respect to a length along the first direction of the specific object region,
5. The second magnification according to claim 2, wherein the second magnification is a magnification of a length along the second direction of the target region with respect to a length along the second direction of the specific object region. An image processing apparatus according to 1.
前記目標領域決定部は、さらに、前記第1方向に沿った前記2個の余白の長さと、前記第2方向に沿った前記2個の余白の長さと、に基づいて、前記特定オブジェクト領域のアスペクト比に等しいアスペクト比を有する前記目標領域の位置を決定する、請求項1に記載の画像処理装置。   The target area determination unit may further determine the specific object area based on the lengths of the two margins along the first direction and the lengths of the two margins along the second direction. The image processing apparatus according to claim 1, wherein a position of the target area having an aspect ratio equal to an aspect ratio is determined. 前記目標領域決定部は、さらに、
前記特定オブジェクト領域の前記第1方向に沿った長さに1より大きな目標値を乗算することによって得られる第1の候補長さが、前記スペース領域の前記第1方向に沿った長さ以下であり、かつ、前記特定オブジェクト領域の前記第2方向に沿った長さに前記目標値を乗算することによって得られる第2の候補長さが、前記スペース領域の前記第2方向に沿った長さ以下であるという特定の条件が満たされる場合に、前記目標領域の前記第1方向に沿った長さとして前記第1の候補長さを決定すると共に、前記目標領域の前記第2方向に沿った長さとして前記第2の候補長さを決定することによって、前記特定オブジェクト領域のアスペクト比に等しいアスペクト比を有する前記目標領域の位置を決定し、
前記特定の条件が満たされない場合に、前記第1方向に沿った前記2個の余白の長さと、前記第2方向に沿った前記2個の余白の長さと、に基づいて、前記特定オブジェクト領域のアスペクト比とは異なるアスペクト比を有する前記目標領域の位置を決定する、請求項1から7のいずれか一項に記載の画像処理装置。
The target area determination unit further includes:
The first candidate length obtained by multiplying the length of the specific object region along the first direction by a target value greater than 1 is equal to or less than the length of the space region along the first direction. And the second candidate length obtained by multiplying the length of the specific object region along the second direction by the target value is the length of the space region along the second direction. When a specific condition is satisfied, the first candidate length is determined as a length along the first direction of the target area, and along the second direction of the target area Determining the position of the target area having an aspect ratio equal to the aspect ratio of the specific object area by determining the second candidate length as a length;
When the specific condition is not satisfied, the specific object region is based on the lengths of the two margins along the first direction and the lengths of the two margins along the second direction. The image processing apparatus according to claim 1, wherein a position of the target area having an aspect ratio different from the aspect ratio is determined.
画像処理装置であって、
特定オブジェクトを含む複数個のオブジェクトを含む原画像を表わす原画像データを取得する取得部と、
前記原画像データに対して画像処理を実行して、前記複数個のオブジェクトを含む処理済み画像を表わす処理済み画像データを生成する画像処理実行部であって、前記処理済み画像では、前記原画像と比べて、前記特定オブジェクトが拡大されて表現されている、前記画像処理実行部と、を備え、
前記画像処理実行部は、
前記原画像内において、前記複数個のオブジェクトのそれぞれについて、当該オブジェクトを含むオブジェクト領域を決定するオブジェクト領域決定部と、
前記原画像内において、前記特定オブジェクトについて決定された特定オブジェクト領域を含むスペース領域を決定するスペース領域決定部であって、前記スペース領域は、前記複数個のオブジェクトのうちの他のオブジェクトについて決定された他のオブジェクト領域に重複しない、前記スペース領域決定部と、
前記原画像内の前記特定オブジェクト領域と前記スペース領域とに基づいて、前記処理済み画像内の目標領域を決定する目標領域決定部であって、前記目標領域は、拡大されて表現される前記特定オブジェクトが配置されるべき領域である、前記目標領域決定部と、を備え、
前記目標領域決定部は、前記特定オブジェクト領域と前記スペース領域との間の第1方向に沿った2個の余白の長さと、前記第1方向に直交する第2方向に沿った2個の余白の長さと、に基づいて、前記処理済み画像内の前記目標領域のアスペクト比を決定する、画像処理装置。
An image processing apparatus,
An acquisition unit for acquiring original image data representing an original image including a plurality of objects including a specific object;
An image processing execution unit that performs image processing on the original image data to generate processed image data representing a processed image including the plurality of objects, wherein the processed image includes the original image The image processing execution unit, wherein the specific object is expressed in an enlarged manner,
The image processing execution unit
In the original image, for each of the plurality of objects, an object area determination unit that determines an object area including the object,
A space area determination unit that determines a space area including a specific object area determined for the specific object in the original image, wherein the space area is determined for another object of the plurality of objects. The space area determination unit not overlapping with other object areas;
A target area determination unit that determines a target area in the processed image based on the specific object area and the space area in the original image, wherein the target area is expressed in an enlarged manner The target area determination unit, which is an area in which an object is to be placed,
The target area determination unit includes two margin lengths along a first direction between the specific object area and the space area, and two margins along a second direction orthogonal to the first direction. And an aspect ratio of the target area in the processed image based on the length of the image processing apparatus.
前記目標領域決定部は、さらに、前記第1方向に沿った前記2個の余白の長さと、前記第2方向に沿った前記2個の余白の長さと、に基づいて、前記目標領域の前記アスペクト比を有する前記目標領域のサイズを決定する、請求項9に記載の画像処理装置。   The target area determination unit may further include, based on the lengths of the two margins along the first direction and the lengths of the two margins along the second direction, the target area. The image processing apparatus according to claim 9, wherein a size of the target area having an aspect ratio is determined. 前記目標領域の前記アスペクト比は、前記特定オブジェクト領域の前記アスペクト比とは異なる、請求項9又は10に記載の画像処理装置。   The image processing apparatus according to claim 9, wherein the aspect ratio of the target area is different from the aspect ratio of the specific object area. 前記目標領域決定部は、
前記特定オブジェクト領域を目標倍率で拡大することによって得られる第1の拡大領域が所定の条件を満たす場合に、前記第1の拡大領域を前記目標領域として決定し、
前記第1の拡大領域が前記所定の条件を満たさない場合に、前記特定オブジェクト領域を前記目標倍率よりも小さい倍率で拡大することによって得られる第2の拡大領域を前記目標領域として決定する、請求項1から11のいずれか一項に記載の画像処理装置。
The target area determination unit
When the first enlargement area obtained by enlarging the specific object area with the target magnification satisfies a predetermined condition, the first enlargement area is determined as the target area;
When the first enlargement area does not satisfy the predetermined condition, a second enlargement area obtained by enlarging the specific object area at a magnification smaller than the target magnification is determined as the target area. Item 12. The image processing apparatus according to any one of Items 1 to 11.
前記スペース領域決定部は、前記複数個のオブジェクトのうちの2個以上の前記特定オブジェクトについて決定された2個以上の前記特定オブジェクト領域に対応する2個以上の前記スペース領域を決定し、
前記目標領域決定部は、前記2個以上の特定オブジェクト領域と前記2個以上のスペース領域とに基づいて、前記2個以上の特定オブジェクト領域に対応する2個以上の前記目標領域を決定し、
前記目標領域決定部は、前記2個以上の特定オブジェクト領域のそれぞれを目標倍率で拡大することによって得られる2個以上の第1の拡大領域が相互に重なる場合に、前記2個以上の特定オブジェクト領域のそれぞれを前記目標倍率よりも小さい倍率で拡大することによって得られる2個以上の第2の拡大領域を前記2個以上の目標領域として決定する、請求項1から12のいずれか一項に記載の画像処理装置。
The space area determination unit determines two or more space areas corresponding to two or more specific object areas determined for two or more specific objects of the plurality of objects,
The target area determination unit determines two or more target areas corresponding to the two or more specific object areas based on the two or more specific object areas and the two or more space areas;
The target area determination unit includes the two or more specific objects when the two or more first enlarged areas obtained by enlarging each of the two or more specific object areas with a target magnification overlap each other. The two or more second enlarged regions obtained by enlarging each of the regions at a magnification smaller than the target magnification are determined as the two or more target regions. The image processing apparatus described.
前記特定オブジェクトは、複数個の文字によって構成されるM行(前記Mは1以上の整数)の文字列を含むテキストオブジェクトを含む、請求項1から13のいずれか一項に記載の画像処理装置。   The image processing device according to any one of claims 1 to 13, wherein the specific object includes a text object including a character string of M lines (the M is an integer of 1 or more) composed of a plurality of characters. . 前記M行の文字列のそれぞれでは、前記第1方向の第1側から第2側に向かってセンテンスが進み、
前記Mが2以上の整数である場合に、前記M行の文字列では、前記第2方向の第1側から第2側に向かって前記センテンスが進み、
前記スペース領域決定部は、前記特定オブジェクト領域を複数個の向きに順次拡大して、前記スペース領域を決定し、
前記複数個の向きのうち、最初の拡大に利用されるべき向きは、前記第1方向に沿って前記第2側から前記第1側に向かう向きと、前記第2方向に沿って前記第2側から前記第1側に向かう向きと、の間の向きである、請求項14に記載の画像処理装置。
In each of the M rows of character strings, the sentence advances from the first side to the second side in the first direction,
When the M is an integer of 2 or more, in the character string of the M lines, the sentence advances from the first side to the second side in the second direction,
The space area determination unit sequentially expands the specific object area in a plurality of directions to determine the space area,
Of the plurality of directions, the direction to be used for the first enlargement is a direction from the second side toward the first side along the first direction and a second direction along the second direction. The image processing apparatus according to claim 14, wherein the image processing apparatus has a direction between a direction from the side toward the first side.
前記目標領域決定部は、さらに、前記第1方向に沿った前記2個の余白の長さと、前記第2方向に沿った前記2個の余白の長さと、に基づいて、前記特定オブジェクト領域のアスペクト比とは異なる前記目標領域のアスペクト比を決定し、
前記特定オブジェクトは、複数個の文字によって構成されるM行(前記Mは1以上の整数)の文字列を含むテキストオブジェクトを含み、
前記画像処理実行部は、さらに、
前記複数個の文字によって構成されるN行(前記Nは1以上の整数)の文字列を含む再配置画像を表わす再配置画像データを生成する再配置画像データ生成部であって、前記M行の文字列のうちの先頭行の文字列に含まれる文字数と、前記N行の文字列のうちの先頭行の文字列に含まれる文字数と、は異なる、前記再配置画像データ生成部を備え、
前記画像処理実行部は、前記再配置画像データを利用して、前記N行の文字列を含む前記特定オブジェクトを含む前記処理済み画像を表わす前記処理済み画像データを生成する、請求項1から6及び9から11のいずれか一項に記載の画像処理装置。
The target area determination unit may further determine the specific object area based on the lengths of the two margins along the first direction and the lengths of the two margins along the second direction. Determine the aspect ratio of the target area different from the aspect ratio;
The specific object includes a text object including a character string of M lines (M is an integer of 1 or more) composed of a plurality of characters,
The image processing execution unit further includes:
A rearranged image data generation unit that generates rearranged image data representing a rearranged image including a character string of N rows (N is an integer of 1 or more) composed of the plurality of characters, the M rows The number of characters included in the first line of the character string and the number of characters included in the first line of the N character strings, the rearranged image data generation unit,
The image processing execution unit generates the processed image data representing the processed image including the specific object including the character string of the N rows using the rearranged image data. And the image processing apparatus according to any one of 9 to 11.
前記原画像データは、前記原画像が表現されている特定サイズのシートをスキャンすることによって生成されるデータであり、
前記処理済み画像データは、前記処理済み画像を前記特定サイズのシートに印刷するために利用されるデータである、請求項1から16のいずれか一項に記載の画像処理装置。
The original image data is data generated by scanning a sheet of a specific size on which the original image is represented,
The image processing apparatus according to claim 1, wherein the processed image data is data used to print the processed image on the sheet having the specific size.
前記原画像に含まれる前記複数個のオブジェクトは、前記特定オブジェクトと、前記特定オブジェクトとは異なる他のオブジェクトと、を含み。
前記画像処理実行部は、前記原画像と比べて、前記特定オブジェクトが拡大されて表現されていると共に、前記他のオブジェクトが拡大されずに表現されている前記処理済み画像を表わす前記処理済み画像データを生成する、請求項1から17のいずれか一項に記載の画像処理装置。
The plurality of objects included in the original image include the specific object and another object different from the specific object.
The image processing execution unit represents the processed image representing the processed image in which the specific object is expressed in an enlarged manner and the other object is expressed without being enlarged as compared with the original image. The image processing apparatus according to claim 1, which generates data.
画像処理装置のためのコンピュータプログラムであって、
前記画像処理装置に搭載されるコンピュータに、以下の各ステップ、即ち、
特定オブジェクトを含む複数個のオブジェクトを含む原画像を表わす原画像データを取得する取得ステップと、
前記原画像データに対して画像処理を実行して、前記複数個のオブジェクトを含む処理済み画像を表わす処理済み画像データを生成する画像処理実行ステップであって、前記処理済み画像では、前記原画像と比べて、前記特定オブジェクトが拡大されて表現されている、前記画像処理実行ステップと、を実行させ、
前記画像処理実行ステップは、
前記原画像内において、前記複数個のオブジェクトのそれぞれについて、当該オブジェクトを含むオブジェクト領域を決定するオブジェクト領域決定ステップと、
前記原画像内において、前記特定オブジェクトについて決定された特定オブジェクト領域を含むスペース領域を決定するスペース領域決定ステップであって、前記スペース領域は、前記複数個のオブジェクトのうちの他のオブジェクトについて決定された他のオブジェクト領域に重複しない、前記スペース領域決定ステップと、
前記原画像内の前記特定オブジェクト領域と前記スペース領域とに基づいて、前記処理済み画像内の目標領域を決定する目標領域決定ステップであって、前記目標領域は、拡大されて表現される前記特定オブジェクトが配置されるべき領域である、前記目標領域決定ステップと、を含み、
前記目標領域決定ステップでは、前記特定オブジェクト領域と前記スペース領域との間の第1方向に沿った2個の余白の長さと、前記第1方向に直交する第2方向に沿った2個の余白の長さと、に基づいて、前記処理済み画像内の前記目標領域の位置を決定する、コンピュータプログラム。
A computer program for an image processing apparatus,
In the computer mounted on the image processing apparatus, the following steps, that is,
An acquisition step of acquiring original image data representing an original image including a plurality of objects including a specific object;
An image processing execution step of performing image processing on the original image data to generate processed image data representing a processed image including the plurality of objects, wherein the processed image includes the original image The image processing execution step in which the specific object is expressed in an enlarged manner,
The image processing execution step includes
In the original image, for each of the plurality of objects, an object area determination step for determining an object area including the object;
A space region determining step for determining a space region including a specific object region determined for the specific object in the original image, wherein the space region is determined for another object of the plurality of objects; The space area determination step not overlapping with other object areas;
A target area determining step for determining a target area in the processed image based on the specific object area and the space area in the original image, wherein the target area is expressed in an enlarged manner; The target area determining step, which is an area in which an object is to be placed,
In the target area determination step, the lengths of the two margins along the first direction between the specific object area and the space area, and the two margins along the second direction orthogonal to the first direction. A computer program for determining a position of the target area in the processed image based on the length of the image.
画像処理装置のためのコンピュータプログラムであって、
前記画像処理装置に搭載されるコンピュータに、以下の各ステップ、即ち、
特定オブジェクトを含む複数個のオブジェクトを含む原画像を表わす原画像データを取得する取得ステップと、
前記原画像データに対して画像処理を実行して、前記複数個のオブジェクトを含む処理済み画像を表わす処理済み画像データを生成する画像処理実行ステップであって、前記処理済み画像では、前記原画像と比べて、前記特定オブジェクトが拡大されて表現されている、前記画像処理実行ステップと、を実行させ、
前記画像処理実行ステップは、
前記原画像内において、前記複数個のオブジェクトのそれぞれについて、当該オブジェクトを含むオブジェクト領域を決定するオブジェクト領域決定ステップと、
前記原画像内において、前記特定オブジェクトについて決定された特定オブジェクト領域を含むスペース領域を決定するスペース領域決定ステップであって、前記スペース領域は、前記複数個のオブジェクトのうちの他のオブジェクトについて決定された他のオブジェクト領域に重複しない、前記スペース領域決定ステップと、
前記原画像内の前記特定オブジェクト領域と前記スペース領域とに基づいて、前記処理済み画像内の目標領域を決定する目標領域決定ステップであって、前記目標領域は、拡大されて表現される前記特定オブジェクトが配置されるべき領域である、前記目標領域決定ステップと、を含み、
前記目標領域決定ステップでは、前記特定オブジェクト領域と前記スペース領域との間の第1方向に沿った2個の余白の長さと、前記第1方向に直交する第2方向に沿った2個の余白の長さと、に基づいて、前記処理済み画像内の前記目標領域のアスペクト比を決定する、コンピュータプログラム。
A computer program for an image processing apparatus,
In the computer mounted on the image processing apparatus, the following steps, that is,
An acquisition step of acquiring original image data representing an original image including a plurality of objects including a specific object;
An image processing execution step of performing image processing on the original image data to generate processed image data representing a processed image including the plurality of objects, wherein the processed image includes the original image The image processing execution step in which the specific object is expressed in an enlarged manner,
The image processing execution step includes
In the original image, for each of the plurality of objects, an object area determination step for determining an object area including the object;
A space region determining step for determining a space region including a specific object region determined for the specific object in the original image, wherein the space region is determined for another object of the plurality of objects; The space area determination step not overlapping with other object areas;
A target area determining step for determining a target area in the processed image based on the specific object area and the space area in the original image, wherein the target area is expressed in an enlarged manner; The target area determining step, which is an area in which an object is to be placed,
In the target area determination step, the lengths of the two margins along the first direction between the specific object area and the space area, and the two margins along the second direction orthogonal to the first direction. A computer program for determining an aspect ratio of the target area in the processed image based on the length of the image.
JP2014044336A 2014-03-06 2014-03-06 Image processing device Active JP6323075B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014044336A JP6323075B2 (en) 2014-03-06 2014-03-06 Image processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014044336A JP6323075B2 (en) 2014-03-06 2014-03-06 Image processing device

Publications (2)

Publication Number Publication Date
JP2015170128A true JP2015170128A (en) 2015-09-28
JP6323075B2 JP6323075B2 (en) 2018-05-16

Family

ID=54202816

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014044336A Active JP6323075B2 (en) 2014-03-06 2014-03-06 Image processing device

Country Status (1)

Country Link
JP (1) JP6323075B2 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002374400A (en) * 2001-06-15 2002-12-26 Fuji Xerox Co Ltd Image output device
JP2008177823A (en) * 2007-01-18 2008-07-31 Sharp Corp Image processor and image magnifying method
JP2009105541A (en) * 2007-10-22 2009-05-14 Seiko Epson Corp Image processing apparatus, method and program
JP2011151703A (en) * 2010-01-25 2011-08-04 Konica Minolta Business Technologies Inc Image processing apparatus, character magnification processing method and character magnification program
JP2013207584A (en) * 2012-03-28 2013-10-07 Kyocera Document Solutions Inc Image processing apparatus and image formation apparatus

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002374400A (en) * 2001-06-15 2002-12-26 Fuji Xerox Co Ltd Image output device
JP2008177823A (en) * 2007-01-18 2008-07-31 Sharp Corp Image processor and image magnifying method
JP2009105541A (en) * 2007-10-22 2009-05-14 Seiko Epson Corp Image processing apparatus, method and program
JP2011151703A (en) * 2010-01-25 2011-08-04 Konica Minolta Business Technologies Inc Image processing apparatus, character magnification processing method and character magnification program
JP2013207584A (en) * 2012-03-28 2013-10-07 Kyocera Document Solutions Inc Image processing apparatus and image formation apparatus

Also Published As

Publication number Publication date
JP6323075B2 (en) 2018-05-16

Similar Documents

Publication Publication Date Title
JP4483909B2 (en) Translation apparatus and program
JP6311360B2 (en) Image processing device
JP6303622B2 (en) Image processing device
JP4983684B2 (en) Image processing apparatus, image processing method, and computer program for image processing
JP5838984B2 (en) Image processing apparatus and computer program
JP5622787B2 (en) Image processing apparatus and program
JP2010182305A (en) Image processing method, image processing apparatus, and computer-readable medium
JP2010170184A (en) Specifying position of characteristic portion of face image
JP4564986B2 (en) Image processing apparatus, image processing method, and image processing program
JP6323075B2 (en) Image processing device
JP6323076B2 (en) Image processing device
JP2010028429A (en) Image processing apparatus, image processing method, and program
JP6281329B2 (en) Image processing device
JP6264955B2 (en) Image processing device
JP2000069308A (en) Image processor and image processing method therefor
JP4710508B2 (en) Image processing program and image processing apparatus
JP2010224514A (en) Method for adjusting stroke of font
JP2007180930A (en) Image combining device, image combining method and program, and recording medium
US20180101337A1 (en) Image forming apparatus for managing object used for rendering, method thereof, and storage medium
US20170228902A1 (en) Information processing apparatus and information processing method
JP2011096109A (en) Image processing apparatus and image processing program
JP2011077587A (en) Image processor, image processing method, and program
JP6358198B2 (en) Image forming apparatus and program
JP5898438B2 (en) Image processing apparatus, image processing method, and program
JP2012104011A (en) Driver program and printing system

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170216

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20180313

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20180326

R150 Certificate of patent or registration of utility model

Ref document number: 6323075

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150