JP2010219686A - Image processing method, image processing device, program, and memory medium - Google Patents

Image processing method, image processing device, program, and memory medium Download PDF

Info

Publication number
JP2010219686A
JP2010219686A JP2009061863A JP2009061863A JP2010219686A JP 2010219686 A JP2010219686 A JP 2010219686A JP 2009061863 A JP2009061863 A JP 2009061863A JP 2009061863 A JP2009061863 A JP 2009061863A JP 2010219686 A JP2010219686 A JP 2010219686A
Authority
JP
Japan
Prior art keywords
block
content
page
height
area
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
JP2009061863A
Other languages
Japanese (ja)
Other versions
JP5287384B2 (en
Inventor
Yuka Kihara
酉華 木原
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.)
Ricoh Co Ltd
Original Assignee
Ricoh Co 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 Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP2009061863A priority Critical patent/JP5287384B2/en
Publication of JP2010219686A publication Critical patent/JP2010219686A/en
Application granted granted Critical
Publication of JP5287384B2 publication Critical patent/JP5287384B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Record Information Processing For Printing (AREA)
  • Processing Or Creating Images (AREA)
  • Editing Of Facsimile Originals (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To automatically create a suitable layout over each page of a content covering a plurality of pages. <P>SOLUTION: When arranging the content in an arranging area, the device creates the closest layout, for example, using FFDH (First-Fit Decreasing Height). In the created closest layout, if it occurs that a content is arranged over pages, the device solves a problem that the content is divided over pages by shifting blocks whose height is defined by a height of the content in a left end including the content, and have a width of the arranging area, to the next or succeeding pages. The layout of respective pages of a plurality of pages of content can be easily and automatically created by performing the processing in a block unit. Moreover, a number of pages does not increase even if the contents are shifted in a block, and it is possible to create the page layout with higher degree of freedom. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、コンテンツのページレイアウトを自動的に生成する画像処理方法、画像処理装置、プログラムおよび記憶媒体に関する。   The present invention relates to an image processing method, an image processing apparatus, a program, and a storage medium that automatically generate a page layout of content.

従来より、レイアウトに関する技術が研究、開発されており、集積回路のレイアウトやクロックレイアウトなど多方面で応用されている。こういったレイアウト技術は、テキストやイメージで構成された複数のコンテンツを紙面上に配置する場合にも適用することができる。   Conventionally, layout-related technologies have been researched and developed, and applied in various fields such as integrated circuit layout and clock layout. Such a layout technique can also be applied to a case where a plurality of contents composed of text and images are arranged on a sheet.

特許文献1には、各コンテンツデータをそれぞれ1つの矩形領域と対応させ、ドキュメントページ内において各矩形領域のサイズに応じて自動的にレイアウトを決定する方法が開示されている。特許文献1によれば、コンテンツデータに対応する矩形をグリッド状のレイアウト領域に配置し、その後、最適化アルゴリズムなどを用いてコンテンツ同士の重複を除去する。特許文献1では、さらに、レイアウト領域上の各グリッドに定義された重みに基づきレイアウトを最適化することで、コンテンツの中央寄せなども可能としている。   Patent Document 1 discloses a method in which each content data is associated with one rectangular area, and a layout is automatically determined in accordance with the size of each rectangular area in a document page. According to Patent Document 1, a rectangle corresponding to content data is arranged in a grid-like layout area, and thereafter, an overlap between contents is removed using an optimization algorithm or the like. In Japanese Patent Laid-Open No. 2004-260, further, the centering of contents can be performed by optimizing the layout based on the weight defined for each grid on the layout area.

ところで、例えば半導体回路などのレイアウトを決定する場面では、如何に効率的な配置を行うかが非常に重要であり、そのための様々な手法が研究されている。同様の手法は、紙面レイアウトにも適用可能である。すなわち、半導体回路のレイアウト決定手法を紙面レイアウトに適用することで、ロール紙の先端から複数の例えば画像コンテンツを並べる際、配置する領域に対応するロールの長さがなるべく小さくなるようにレイアウトを決定する事ができる。   By the way, in the scene of determining the layout of, for example, a semiconductor circuit, it is very important how to perform the efficient arrangement, and various methods for that purpose have been studied. A similar method can also be applied to the paper layout. In other words, by applying the semiconductor circuit layout determination method to the paper layout, the layout is determined so that the roll length corresponding to the area to be arranged becomes as small as possible when arranging a plurality of image contents from the leading edge of the roll paper. I can do it.

レイアウトの効率性を重視したレイアウト手法として、特許文献2では、コンテンツを紙面に対して効率良く割り付けて印刷する技術が開示されている。特許文献2によれば、印刷対象コンテンツを異なる配置で印刷可能領域に割り付けて複数の割付候補を生成した上で、印刷対象コンテンツの印刷可能領域に対する占有率に基づいて最終的な割付を決定することで、余白の少ない効率的なレイアウト生成を可能としている。   As a layout technique that places importance on layout efficiency, Patent Document 2 discloses a technique for efficiently allocating and printing content on a paper surface. According to Patent Document 2, after assigning print target content to printable areas in different arrangements and generating a plurality of assignment candidates, final assignment is determined based on the occupation ratio of the print target content to the printable area. This enables efficient layout generation with little margin.

一方、一般的に、レイアウト対象として紙を利用する場合は、ページ単位でレイアウトが扱われる事が多い。そのため、レイアウト生成時に、単純に領域の長さだけを考慮すると、コンテンツがページを跨いで配置されてしまう、ページ内にコンテンツの配置される領域が少量であったとしても新たなページが作成されてしまう、などといった不都合が生じるおそれがある。   On the other hand, in general, when paper is used as a layout target, the layout is often handled in units of pages. Therefore, when the layout is generated, if only the length of the area is taken into consideration, the content is arranged across the pages. Even if the area where the content is arranged in the page is small, a new page is created. May cause inconveniences such as

この不都合に対する解決方法は、様々に提案されている。例えば特許文献3では、構造化言語で記述された文書に対して、コンテンツの途中で改ページが発生した場合に、分断される要素の相関性に応じてコンテンツ全体を次ページにずらしたり、最低限必要な行数だけページ内に収めるなどのレイアウト変更を行う方法について開示されている。   Various solutions to this inconvenience have been proposed. For example, in Patent Document 3, when a page break occurs in the middle of content for a document described in a structured language, the entire content is shifted to the next page according to the correlation of the elements to be divided, or at least A method for changing the layout such as fitting the limited number of lines into a page is disclosed.

また、特許文献4では、集約印刷時の転写紙枚数が集約率に応じて最大となるように文書のレイアウトやページ区切り位置を調整する方法が開示されている。特許文献4によれば、例えば図表などのコンテンツが複数のページに亘る場合、図表の配置を変更したりサイズを縮小するなどの処理が行われる。   Further, Patent Document 4 discloses a method for adjusting the document layout and page break position so that the number of transfer sheets at the time of aggregate printing is maximized according to the aggregation rate. According to Patent Document 4, for example, when content such as a chart covers a plurality of pages, processing such as changing the layout of the chart or reducing the size is performed.

さらに、特許文献5には、ページ内に含まれるコンテンツが少量である場合に、そのページの大部分が余白となり見栄えが劣るという課題を解決するために、コンテンツ間の距離を調整してレイアウトを変更するようにした技術が開示されている。   Furthermore, in Patent Document 5, when a small amount of content is included in a page, in order to solve the problem that most of the page is blank and poor in appearance, the layout is adjusted by adjusting the distance between the contents. A technique to be changed is disclosed.

しかしながら、上述した特許文献1によれば、従来ではユーザー側に委ねられていたレイアウト作業が自動化されるため、作業負荷の軽減に繋がる一方で、各コンテンツデータを効率的に配置する、という観点は考慮されていないという問題点があった。   However, according to Patent Document 1 described above, the layout work that has been entrusted to the user in the past is automated, leading to a reduction in work load, while the viewpoint of efficiently arranging each content data is There was a problem that it was not considered.

また、上述した特許文献2では、そもそも、生成された複数の割付候補の中に精度の高いレイアウトが存在している保証がないという問題点があった。また、特許文献2によれば、占有率は、印刷対象コンテンツの印刷媒体上の印刷領域に占める割合として定義される。そのため、見た目に目立つ広範囲の余白と、コンテンツ間のマージンとが同様に扱われるおそれがある。さらに、特許文献2では、上述したようなページという概念を踏まえたレイアウトのあり方ついては触れられていない。   Further, in the above-mentioned Patent Document 2, there is a problem that there is no guarantee that a highly accurate layout exists among the plurality of generated allocation candidates. According to Patent Document 2, the occupation rate is defined as the proportion of the print target content in the print area on the print medium. For this reason, a wide range of margins that are noticeable and a margin between contents may be handled in the same manner. Furthermore, Patent Document 2 does not touch on the layout based on the concept of a page as described above.

さらにまた、上述した特許文献3〜特許文献5の技術は、コンテンツのレイアウトそのものを生成する手法ではない。すなわち、特許文献3〜特許文献5の技術は、ページの区切りに応じてレイアウトを調整する手法に関するものであり、コンテンツを複数ページに亘る紙面上に配置する自動レイアウトを提供するものではない。   Furthermore, the techniques of Patent Documents 3 to 5 described above are not methods for generating the content layout itself. In other words, the techniques of Patent Documents 3 to 5 relate to a method of adjusting the layout according to page breaks, and do not provide an automatic layout in which content is arranged on a paper surface extending over a plurality of pages.

本発明は、上記に鑑みてなされたものであって、複数ページに亘るコンテンツの各ページに対する適切なレイアウトを自動生成可能な画像処理方法、画像処理装置、プログラムおよび記憶媒体を提供することを目的とする。   The present invention has been made in view of the above, and an object thereof is to provide an image processing method, an image processing apparatus, a program, and a storage medium capable of automatically generating an appropriate layout for each page of content over a plurality of pages. And

上述した課題を解決し、目的を達成するために、本発明は、幅と、所定の高さ毎に順序付けて区切られた領域からなるページ領域とが定義される配置領域に対して複数のコンテンツを配置して出力する画像処理方法であって、配置領域の高さ方向に対して、コンテンツを、幅方向に一列に配置されるコンテンツのうち高さが最大のコンテンツの上端および下端からなる範囲内に配置すると共に、配置領域の幅を持ち、高さが最大のコンテンツの上端および下端で高さが定義されるブロックを、配置領域の高さ方向の一方の端を先頭として、隣接するブロックと接するように順次配置し、配置領域の幅方向に対して、コンテンツを、隣接するコンテンツと接すると共に配置領域の幅を超えず、且つ、全コンテンツが配置された際のブロックによる全体の高さが近似的に最小となるように配置する最密充填レイアウト生成ステップと、最密充填レイアウト生成ステップにより、ブロックがページ領域を跨いで配置されている場合に、ページ領域を跨いだブロックを、ブロックが跨ぐページ領域のうち順序が後以降のページ領域に移動させてブロックの再配置を行う最終レイアウト生成ステップとを有するを特徴とする。   In order to solve the above-described problems and achieve the object, the present invention provides a plurality of contents with respect to an arrangement area in which a width and a page area consisting of areas divided in order at predetermined heights are defined. Is an image processing method for arranging and outputting content in a range formed by the top and bottom edges of content having the maximum height among the content arranged in a row in the width direction with respect to the height direction of the placement region A block whose height is defined by the top and bottom edges of the content with the maximum width and the width of the placement area, and an adjacent block starting at one end in the height direction of the placement area Are arranged in contact with each other in the width direction of the arrangement area, and the content is in contact with the adjacent contents, does not exceed the width of the arrangement area, and all the contents are arranged. The close-packed layout generation step that arranges the overall height to be approximately the minimum and the close-packed layout generation step straddle the page area when the block is placed across the page area. And a final layout generation step of rearranging the blocks by moving the blocks to the page areas in the subsequent order in the page areas spanned by the blocks.

また、本発明は、幅と、所定の高さ毎に順序付けて区切られた領域からなるページ領域とが定義される配置領域に対して複数のコンテンツを配置して出力する画像処理装置であって、配置領域の高さ方向に対して、コンテンツを、幅方向に一列に配置されるコンテンツのうち高さが最大のコンテンツの上端および下端からなる範囲内に配置すると共に、配置領域の幅を持ち、高さが最大のコンテンツの上端および下端で高さが定義されるブロックを、配置領域の高さ方向の一方の端を先頭として、隣接するブロックと接するように順次配置し、配置領域の幅方向に対して、コンテンツを、隣接するコンテンツと接すると共に配置領域の幅を超えず、且つ、全コンテンツが配置された際のブロックによる全体の高さが近似的に最小となるように配置する最密充填レイアウト生成手段と、最密充填レイアウト生成手段により、ブロックがページ領域を跨いで配置されている場合に、ページ領域を跨いだブロックを、ブロックが跨ぐページ領域のうち順序が後以降のページ領域に移動させてブロックの再配置を行う最終レイアウト生成手段とを有することを特徴とする。   The present invention is also an image processing apparatus that arranges and outputs a plurality of contents with respect to an arrangement area in which a width and a page area consisting of areas divided in order at predetermined heights are defined. The content is arranged within the range consisting of the top and bottom edges of the content with the maximum height among the content arranged in a row in the width direction with respect to the height direction of the placement area, and has the width of the placement area. The blocks whose height is defined at the top and bottom of the content with the maximum height are sequentially placed so that one of the placement area in the height direction starts at the top and touches the adjacent block, and the width of the placement area The content touches the adjacent content and does not exceed the width of the placement area with respect to the direction, and the overall height of the block when all the content is placed is approximately minimized. When the block is arranged across the page area by the close-packed layout generation unit and the close-packed layout generation unit, the block that straddles the page area is changed to the block in the page area that the block straddles. And final layout generation means for rearranging blocks by moving to subsequent page areas.

本発明によれば、配置領域の高さ方向に対して、コンテンツを、幅方向に一列に配置されるコンテンツのうち高さが最大のコンテンツの上端および下端からなる範囲内に配置すると共に、配置領域の幅を持ち、高さが最大のコンテンツの上端および下端で高さが定義されるブロックを、配置領域の高さ方向の一方の端を先頭として、隣接するブロックと接するように順次配置し、配置領域の幅方向に対して、コンテンツを、隣接するコンテンツと接すると共に配置領域の幅を超えず、且つ、全コンテンツが配置された際のブロックによる全体の高さが近似的に最小となるように配置し、ブロックがページ領域を跨いで配置されている場合に、ページ領域を跨いだブロックを、ブロックが跨ぐページ領域のうち順序が後以降のページ領域に移動させてブロックの再配置を行うようにしている。そのため、コンテンツの配置をブロック単位で調整することができ、複数ページに亘るコンテンツの各ページに対する適切なレイアウトを自動的に生成可能であるという効果を奏する。   According to the present invention, with respect to the height direction of the placement area, the content is placed within a range composed of the upper end and the lower end of the content having the maximum height among the content placed in a row in the width direction. Blocks that have the width of the area and whose height is defined by the top and bottom edges of content with the maximum height are sequentially placed so that one edge in the height direction of the placement area starts at the top and touches the adjacent block. In the width direction of the placement area, the content touches the adjacent content, does not exceed the width of the placement area, and the overall height of the block when all the contents are placed is approximately minimized. If the block is placed across the page area, the block across the page area is moved to the page area after the order of the page area across the block. Allowed to have to perform the re-arrangement of blocks. Therefore, it is possible to adjust the arrangement of contents in units of blocks, and there is an effect that an appropriate layout for each page of contents over a plurality of pages can be automatically generated.

図1は、本発明に適用可能な画像処理装置の一例の構成を示すブロック図である。FIG. 1 is a block diagram showing the configuration of an example of an image processing apparatus applicable to the present invention. 図2は、本発明で想定するコンテンツのレイアウトについて説明するための略線図である。FIG. 2 is a schematic diagram for explaining a content layout assumed in the present invention. 図3は、本発明の第1の実施形態による画像処理を概念的に示す一例のフローチャートである。FIG. 3 is an exemplary flowchart conceptually showing the image processing according to the first embodiment of the present invention. 図4は、FFDHによるコンテンツの一例の配置方法を概略的に示すフローチャートである。FIG. 4 is a flowchart schematically showing an example of a content arrangement method using FFDH. 図5は、FFDHにより生成した最密充填レイアウトの一例を示す略線図である。FIG. 5 is a schematic diagram illustrating an example of the close-packed layout generated by FFDH. 図6は、ブロックおよび行の定義を説明するための略線図である。FIG. 6 is a schematic diagram for explaining definitions of blocks and rows. 図7−1は、ブロックがページを跨いで配置される例を説明するための略線図である。FIG. 7A is a schematic diagram for explaining an example in which blocks are arranged across pages. 図7−2は、ブロックがページを跨がないで配置される例を説明するための略線図である。FIG. 7B is a schematic diagram for explaining an example in which blocks are arranged without straddling pages. 図8は、本発明の第1の実施形態によるページレイアウトの生成方法の一例の処理を示すフローチャートである。FIG. 8 is a flowchart showing an example of a process for generating a page layout according to the first embodiment of the present invention. 図9−1は、効率的な配置であっても適当なページ区切りが見つからない例を説明するための略線図である。FIG. 9A is a schematic diagram for explaining an example where an appropriate page break is not found even in an efficient arrangement. 図9−2は、本発明の第1の実施形態によるコンテンツの配置方法の効果を説明するための略線図である。FIG. 9-2 is a schematic diagram for explaining the effect of the content arrangement method according to the first embodiment of the present invention. 図10は、本発明の第2の実施形態によるページレイアウトの生成方法の一例の処理を示すフローチャートである。FIG. 10 is a flowchart showing an example of a page layout generation method according to the second embodiment of the present invention. 図11は、ブロック自体の位置を調整する処理を示す一例のフローチャートである。FIG. 11 is a flowchart illustrating an example of a process for adjusting the position of the block itself. 図12は、ブロック内でコンテンツの位置を調整する処理を示す一例のフローチャートである。FIG. 12 is a flowchart illustrating an example of a process for adjusting the position of content within a block. 図13は、本発明の第4の実施形態によるページレイアウトの生成方法の一例の処理を示すフローチャートである。FIG. 13 is a flowchart showing an example of a page layout generation method according to the fourth embodiment of the present invention. 図14は、発明の本第5の実施形態によるページレイアウトの生成方法の一例の処理を示すフローチャートである。FIG. 14 is a flowchart showing an example of a page layout generation method according to the fifth embodiment of the present invention.

以下に添付図面を参照して、この発明に係る画像処理方法の最良な実施の形態を詳細に説明する。図1は、本発明に適用可能な画像処理装置100の一例の構成を示す。図1に例示されるように、本発明に適用可能な画像処理装置100は、一般的なコンピュータによって構成することができる。   Exemplary embodiments of an image processing method according to the present invention will be explained below in detail with reference to the accompanying drawings. FIG. 1 shows an example of the configuration of an image processing apparatus 100 applicable to the present invention. As illustrated in FIG. 1, the image processing apparatus 100 applicable to the present invention can be configured by a general computer.

画像処理装置100において、内部バス110に対してCPU(Central Processing Unit)101、I/O(Input/Output)部102、ROM(Read Only Memory)103、RAM(Random Access Memory)104およびハードディスクドライブ(HDD)105が接続される。内部バス110に接続される各部は、内部バス110を介して互いにデータのやりとりを行うことができるようになっている。   In the image processing apparatus 100, a CPU (Central Processing Unit) 101, an I / O (Input / Output) unit 102, a ROM (Read Only Memory) 103, a RAM (Random Access Memory) 104, and a hard disk drive (with respect to the internal bus 110) HDD) 105 is connected. Each unit connected to the internal bus 110 can exchange data with each other via the internal bus 110.

HDD105は、各種のプログラムやデータが格納される。例えばOS(Operating System)や、この発明に係る画像処理方法を実行するための画像処理プログラムなどがHDD105に格納される。また、画像入力部11から入力された画像データがHDD105に格納される。CPU101は、ROM103に予め記憶されたプログラムや、HDD105に格納されたプログラムに従い、RAM104をワークメモリとして用いて、この画像処理装置100の全体の動作を制御する。I/O部102は、画像入力部11および画像出力部12などを含む、この画像処理装置100に接続される外部機器との間でのデータの入出力を管理する。   The HDD 105 stores various programs and data. For example, an OS (Operating System) and an image processing program for executing the image processing method according to the present invention are stored in the HDD 105. The image data input from the image input unit 11 is stored in the HDD 105. The CPU 101 controls the overall operation of the image processing apparatus 100 using the RAM 104 as a work memory in accordance with a program stored in advance in the ROM 103 or a program stored in the HDD 105. The I / O unit 102 manages data input / output with external devices connected to the image processing apparatus 100, including the image input unit 11 and the image output unit 12.

この画像処理装置100で処理されるコンテンツデータとしての画像データは、画像入力部11から画像入力装置100に対して入力され、I/O部102を介してHDD105に格納されたり、CPU101に供給される。画像入力部11は、例えばスキャナ、複写機、スキャン機能や印刷機能を複合的に備える複合機といった、画像を取り込んで出力する機能を備える。画像入力部11がADF(Auto Document Feeder)を備え、複数の画像を連続して自動的に取り込み出力できるようにしてもよい。これに限らず、画像入力部11がインターネットやLAN(Local Area Network)といったネットワークを介して通信を行う通信機能を備え、ネットワークに接続された記憶媒体から画像データを取り込むようにしてもよい。   Image data as content data processed by the image processing apparatus 100 is input from the image input unit 11 to the image input apparatus 100 and stored in the HDD 105 via the I / O unit 102 or supplied to the CPU 101. The The image input unit 11 has a function of capturing and outputting an image, such as a scanner, a copier, or a multifunction device having a combination of a scanning function and a printing function. The image input unit 11 may include an ADF (Auto Document Feeder) so that a plurality of images can be automatically captured and output continuously. However, the present invention is not limited to this, and the image input unit 11 may have a communication function for performing communication via a network such as the Internet or a LAN (Local Area Network), and may take in image data from a storage medium connected to the network.

なお、画像処理装置100は、コンテンツデータとしてテキストデータを処理することもできる。テキストデータは、例えば、画像処理装置100に接続されたキーボード(図示しない)や、外部機器からI/O部102を介して画像処理装置100に入力される。   The image processing apparatus 100 can also process text data as content data. The text data is input to the image processing apparatus 100 via, for example, a keyboard (not shown) connected to the image processing apparatus 100 or an external device via the I / O unit 102.

この画像処理装置100で処理されたコンテンツデータは、I/O部102を介して画像出力部12に対して出力される。画像出力部12は、例えばプリンタやディスプレイといった、コンテンツデータから画像を形成して出力する機能を備える。画像処理装置100は、画像入力部11から入力されたコンテンツデータの1または複数をページ単位に配置したレイアウトデータを生成し、画像出力部12に対して出力する。画像出力部12は、画像処理装置100から供給されたレイアウトデータに従い、コンテンツデータのページ単位での印刷や表示出力を行う。   The content data processed by the image processing apparatus 100 is output to the image output unit 12 via the I / O unit 102. The image output unit 12 has a function of forming and outputting an image from content data, such as a printer or a display. The image processing apparatus 100 generates layout data in which one or more pieces of content data input from the image input unit 11 are arranged in units of pages, and outputs the layout data to the image output unit 12. The image output unit 12 performs printing and display output of content data in units of pages according to the layout data supplied from the image processing apparatus 100.

<第1の実施形態>
本発明では、図2に例示されるように、様々な大きさ(幅×高さ)を有する複数の矩形コンテンツを、幅W、高さHの配置領域200上に配置する際のレイアウトを生成する。ここで、幅Wは有限の値を持ち、高さHは、無限大の値を持つものとする。また、レイアウトとは、配置領域200上におけるコンテンツの配置を示し、レイアウトデータは、レイアウトにおけるコンテンツの配置を示す情報(例えば座標情報)からなるものとする。また、ページとは、一度に表示を行うための領域をいい、以下では、幅Wを持つ配置領域を、一度に表示を行う所定の高さh毎に区切った各領域をページと呼ぶ。
<First Embodiment>
In the present invention, as illustrated in FIG. 2, a layout is generated when a plurality of rectangular contents having various sizes (width × height) are arranged on the arrangement area 200 having the width W and the height H. To do. Here, the width W has a finite value, and the height H has an infinite value. The layout indicates the content arrangement on the arrangement area 200, and the layout data includes information (for example, coordinate information) indicating the content arrangement in the layout. A page refers to an area for displaying at one time. In the following, each area obtained by dividing an arrangement area having a width W at a predetermined height h for displaying at one time is called a page.

図3は、本発明の第1の実施形態による画像処理を概念的に示す一例のフローチャートである。この図3のフローチャートにおける各処理は、CPU101により、本第1の実施形態による画像処理プログラムに従い実行される。   FIG. 3 is an exemplary flowchart conceptually showing the image processing according to the first embodiment of the present invention. Each process in the flowchart of FIG. 3 is executed by the CPU 101 in accordance with the image processing program according to the first embodiment.

ステップS1で複数のコンテンツデータが画像処理装置100に取得される。次のステップS2で、画像処理装置100は、ステップS1で取得された複数のコンテンツデータに基づき、最密充填レイアウトを生成する。そして、次のステップS3で、ステップS2で生成された最密充填レイアウトに基づきページ毎の最終レイアウトを決定する。このステップS3で決定された最終レイアウトを示すレイアウトデータが、画像出力部12に対して出力される。   In step S1, a plurality of pieces of content data are acquired by the image processing apparatus 100. In the next step S2, the image processing apparatus 100 generates a close-packed layout based on the plurality of content data acquired in step S1. In the next step S3, the final layout for each page is determined based on the closest packed layout generated in step S2. Layout data indicating the final layout determined in step S3 is output to the image output unit 12.

<最密充填レイアウトの生成>
図3のステップS2における最密充填レイアウトの生成処理について、より詳細に説明する。なお、実際に入力されるコンテンツデータは、様々な形状が想定されるが、以下では、説明のため、コンテンツデータによる画像が矩形であるものとする。ここで、コンテンツデータによる画像を含む最小の矩形を想定してもよいし、コンテンツデータによる画像に対してマージンなどを考慮した矩形を想定してもよい。以下では、煩雑さを避けるため、「コンテンツデータによる画像」を単に「コンテンツ」と呼ぶ。
<Generate close-packed layout>
The close-packed layout generation process in step S2 of FIG. 3 will be described in more detail. In addition, although the content data actually input can assume various shapes, in the following, it is assumed that an image based on the content data is a rectangle for explanation. Here, a minimum rectangle including an image based on content data may be assumed, or a rectangle considering a margin or the like may be assumed for an image based on content data. Hereinafter, in order to avoid complications, “images based on content data” are simply referred to as “contents”.

ステップS2の最密充填レイアウトでは、予め決められた幅を持ち、高さが無限の領域に対して、下記の条件を満たし、且つ、高さを最小にするように複数のコンテンツを配置する問題として考えて、各コンテンツのレイアウトを決める。
(1)コンテンツの形状が矩形であって、幅および高さが有理数値である。
(2)回転を許容しない。
(3)各コンテンツが互いに重ならない。
In the close-packed layout in step S2, there is a problem that a plurality of contents are arranged so that the following conditions are satisfied and the height is minimized for an area having a predetermined width and an infinite height. And decide the layout of each content.
(1) The content has a rectangular shape, and the width and height are rational values.
(2) Do not allow rotation.
(3) Each content does not overlap each other.

ここで、(3)の各コンテンツが互いに重ならないという条件は、2つのコンテンツCおよびCについて、下記の式(1)〜式(4)のうち少なくとも1つが成立することと等価である。なお、式(1)〜式(4)において、値wおよび値hは、それぞれコンテンツの幅および高さ、値xおよび値yは、それぞれコンテンツの一端(例えば左下隅)のx座標およびy座標である。
+w≦x …(1)
+w≦x …(2)
+h≦y …(3)
+h≦y …(4)
Here, the condition that the contents in (3) do not overlap each other is equivalent to that at least one of the following expressions (1) to (4) holds for the two contents C i and C j. . In Expressions (1) to (4), value w and value h are the width and height of the content, respectively, value x and value y are the x coordinate and y coordinate of one end of the content (for example, the lower left corner), respectively. It is.
x i + w i ≦ x j (1)
x j + w j ≦ x i ... (2)
y i + h i ≦ y j (3)
y j + h j ≦ y i (4)

各コンテンツに対して、式(1)〜式(4)のうち何れを採用するかを決める場合、単純に見積もって4(n(n-1)/2)通りの可能性があるといえる。この問題は、一般的に箱詰め問題と称され、NP困難に属しており、実用的な演算時間で解決することが極めて困難であると考えられる。そこで、本実施形態では、最適解に近似する最適近似解をできるだけ簡単な手順で求める手法を用いて、最密充填レイアウトの生成を行う。 When deciding which one of the formulas (1) to (4) is to be adopted for each content, it can be said that there are 4 (n (n-1) / 2) possibilities in simple estimation. This problem is generally referred to as a boxing problem, belongs to NP difficulty, and is considered extremely difficult to solve in a practical calculation time. Therefore, in the present embodiment, a close-packed layout is generated using a technique for obtaining an optimal approximate solution that approximates the optimal solution with the simplest possible procedure.

このような問題を解決するために、上述の各条件を満たし、且つ、評価値すなわち最適解からの外れ度が定まっている基本的なアルゴリズムとして、FFDH(First-Fit Decreasing-Height)やNFDH(Next-Fit Decreasing-Height)などが知られている。本発明の第1の実施形態では、FFDHを用いて最密充填レイアウトの生成を行う。FFDHについては、「E.G.Coffman, JR., M.R.Garey, D.S.Johonson, R.E.Tarjan(Bell Lab.&Stanford Univ.) "Performance bounds for level-oriented two-dimensional packing algorithms", SIAM J. Comput, vol.9., pp808-826, No.4, 1980.」(非特許文献1)に記載がある。   In order to solve such a problem, FFDH (First-Fit Decreasing-Height) or NFDH (NFDH) is used as a basic algorithm that satisfies the above-described conditions and has an evaluation value, that is, a degree of deviation from the optimal solution. Next-Fit Decreasing-Height) is known. In the first embodiment of the present invention, the closest packed layout is generated using FFDH. For FFDH, see “EGCoffman, JR., MRGarey, DSJohonson, RETarjan (Bell Lab. & Stanford Univ.)“ Performance bounds for level-oriented two-dimensional packing algorithms ”, SIAM J. Comput, vol.9. , pp808-826, No. 4, 1980 ”(Non-Patent Document 1).

図4は、FFDHによるコンテンツの一例の配置方法を概略的に示すフローチャートである。この図4のフローチャートにおける各処理は、CPU101により、本第1の実施形態による画像処理プログラムに従い実行される。FFDHによれば、先ず、コンテンツを高さの大きい順にソートして、ソート順で1番目のコンテンツ(すなわち最も高さの高いコンテンツ)を、配置領域の配置開始位置に配置して、処理を開始する。以下では、説明のため、配置開始位置を配置領域の左上隅とする。   FIG. 4 is a flowchart schematically showing an example of a content arrangement method using FFDH. Each process in the flowchart of FIG. 4 is executed by the CPU 101 in accordance with the image processing program according to the first embodiment. According to FFDH, first, the contents are sorted in descending order, and the first content (that is, the highest content) in the sort order is arranged at the arrangement start position of the arrangement area, and the processing is started. To do. In the following, for the sake of explanation, the arrangement start position is defined as the upper left corner of the arrangement area.

図4のフローチャートによる処理の開始に先立って、何らかのコンテンツ(例えばソート順で1番目のコンテンツ)が配置領域に配置されているものとする。これを最後に配置されたコンテンツとして、図4のフローチャートによる処理が開始される。ステップS10で、全てのコンテンツについて配置が完了したか否かが判定され、完了していないと判定されたら、処理がステップS11に移行される。一方、完了していると判断されたら、図4のフローチャートによる一連の処理が終了する。   Prior to the start of the processing according to the flowchart of FIG. 4, it is assumed that some content (for example, the first content in the sort order) is arranged in the arrangement area. With this as the last placed content, the processing according to the flowchart of FIG. 4 is started. In step S10, it is determined whether or not the arrangement has been completed for all the contents. If it is determined that the arrangement has not been completed, the process proceeds to step S11. On the other hand, if it is determined that the processing has been completed, a series of processes according to the flowchart of FIG. 4 ends.

ステップS11で、直前に選択したコンテンツに対してソート順で次のコンテンツを選択する。次のステップS12で、ステップS11で選択されたコンテンツがソート順で最後のコンテンツか否かが判定される。若し、最後のコンテンツではないと判定されたら、処理はステップS13に移行される。   In step S11, the next content is selected in the sort order with respect to the content selected immediately before. In the next step S12, it is determined whether or not the content selected in step S11 is the last content in the sort order. If it is determined that it is not the last content, the process proceeds to step S13.

ステップS13では、ステップS11で選択されたコンテンツが、最後に配置したコンテンツの右隣に配置可能な否かが判定される。すなわち、最後に配置したコンテンツの右端から配置領域の右端までの幅が、ステップS11で選択されたコンテンツの幅以上であれば、当該選択されたコンテンツが配置可能であると判定される。若し、配置不可であると判定されたら、処理はステップS10に戻され、全てのコンテンツについて配置が完了していなければソート順でさらに次のコンテンツが選択され(ステップS11)、処理が繰り返される。   In step S13, it is determined whether or not the content selected in step S11 can be arranged on the right side of the content arranged last. That is, if the width from the right end of the content arranged last to the right end of the arrangement area is equal to or larger than the width of the content selected in step S11, it is determined that the selected content can be arranged. If it is determined that the content cannot be arranged, the process returns to step S10. If the arrangement has not been completed for all contents, the next content is selected in the sort order (step S11), and the process is repeated. .

一方、ステップS13で配置可能であると判定されたら、処理はステップS14に移行され、最後に配置したコンテンツの右隣にステップS11で選択されたコンテンツが配置される。コンテンツの配置位置を示す情報は、例えばRAM104に記憶される。そして、処理がステップS10に戻される。   On the other hand, if it is determined in step S13 that the content can be arranged, the process proceeds to step S14, and the content selected in step S11 is arranged to the right of the content arranged last. Information indicating the arrangement position of the content is stored in the RAM 104, for example. Then, the process returns to step S10.

上述のステップS12で、ステップS11で選択されたコンテンツがソート順で最後のコンテンツであると判定されたら、処理はステップS15に移行される。ステップS15では、未配置のコンテンツのうち、ソート順が最も早い(すなわち高さが最も高い)コンテンツを、最後に配置したコンテンツに対して幅方向の左端に配置されるコンテンツの下に、配置領域に対して左詰めで配置する。コンテンツの配置位置を示す情報は、例えばRAM104に記憶される。そして、処理はステップS11に戻される。   If it is determined in step S12 described above that the content selected in step S11 is the last content in the sort order, the process proceeds to step S15. In step S15, among the unarranged contents, the contents having the earliest sort order (that is, the highest height) are arranged below the contents arranged at the left end in the width direction with respect to the contents arranged last. Are arranged left justified. Information indicating the arrangement position of the content is stored in the RAM 104, for example. Then, the process returns to step S11.

図5は、上述のようにしてFFDHにより生成した最密充填レイアウトの一例を示す。この例では、幅が「10」の配置領域に、8個のコンテンツが配置されている。この、図3のステップS2において生成された最密充填レイアウトを、初期ページレイアウトと呼ぶ。   FIG. 5 shows an example of the close-packed layout generated by FFDH as described above. In this example, eight contents are arranged in an arrangement area having a width of “10”. The close-packed layout generated in step S2 of FIG. 3 is referred to as an initial page layout.

図5および図4のフローチャートによる処理で分かるように、FFDHによる最密充填レイアウトでは、コンテンツの右隣には、当該コンテンツと高さが同じかまたは低いコンテンツが配置される。また、左端のコンテンツについては、コンテンツの下には当該コンテンツと高さが同じかまたは低いコンテンツが配置される。以下、配置領域の幅を持ち、左端のコンテンツの上下端で高さおよび配置領域における高さ方向の位置が規定される領域を、「ブロック」と呼び、ブロックとブロックとの区切りを、「行」と呼ぶ(図6参照)。   As can be seen from the processing according to the flowcharts of FIGS. 5 and 4, in the close-packed layout by FFDH, content having the same or lower height as the content is arranged on the right side of the content. As for the content at the left end, content having the same height as or lower than the content is arranged below the content. Hereinafter, the area that has the width of the placement area, the height and the position in the height direction in the placement area are defined at the upper and lower ends of the content at the left end, is referred to as “block”, and the block delimiter is defined as “row”. (Refer to FIG. 6).

ここで、図5の例では、各コンテンツは、上端を揃えて一列に配置されている。これに限らず、左端のブロックに対して右方向に一列に配置される一連のブロックは、上下端が左端のブロックの上端および下端からなる範囲を越えなければ、他の配置でもよい。   Here, in the example of FIG. 5, the contents are arranged in a line with the upper ends aligned. Not limited to this, a series of blocks arranged in a line in the right direction with respect to the leftmost block may be arranged in other ways as long as the upper and lower ends do not exceed the range of the upper and lower ends of the leftmost block.

なお、FFDHでは、最適解に対する評価値が下記の式(5)のようになることが知られている。式(5)は、コンテンツの高さと幅とをそれぞれ「1」に正規化した場合の例である。また、式(5)において、値HalgはFFDHにより求められる高さ、値Hoptは最適解を表す。
alg≦1.7×Hopt+1 …(5)
In FFDH, it is known that the evaluation value for the optimal solution is as shown in the following equation (5). Expression (5) is an example when the height and width of the content are normalized to “1”, respectively. In the equation (5), the value H alg represents the height obtained by FFDH, and the value H opt represents an optimal solution.
H alg ≦ 1.7 × H opt +1 (5)

<第1の実施形態によるページレイアウトの生成>
次に、上述した図3のステップS3における、ページ毎の最終レイアウトの生成について説明する。図3のステップS2において、図4を用いて説明した手順に従い最密充填レイアウトによる初期ページレイアウトを生成した後に、配置領域を、幅が配置領域の幅と一致し、所定の高さを持つページ単位に分割する。このとき、図7−1に例示されるように、あるブロックがページに跨って配置されてしまうことがある。図7−1の例では、配置領域300に配置されたブロック301〜304のうち、ブロック303がページを跨いで配置されてしまっている。このままでは、コンテンツが途中で分断されてしまう結果となり、好ましくない。そこで、本発明の第1の実施形態では、各ブロックがページを跨がないようにレイアウトを調整して、ページ毎の最終レイアウトを生成する。
<Generation of Page Layout According to First Embodiment>
Next, generation of a final layout for each page in step S3 of FIG. 3 described above will be described. In step S2 of FIG. 3, after generating the initial page layout by the close-packed layout according to the procedure described with reference to FIG. 4, the layout area is a page whose width matches the width of the layout area and has a predetermined height. Divide into units. At this time, as illustrated in FIG. 7A, a certain block may be arranged across the page. In the example of FIG. 7A, among the blocks 301 to 304 arranged in the arrangement area 300, the block 303 is arranged across the pages. This is not preferable because the content is divided on the way. Therefore, in the first embodiment of the present invention, the layout is adjusted so that each block does not cross the page, and a final layout for each page is generated.

本第1の実施形態では、ページを跨いで配置されたブロックを、次のページの先頭に移動させる。ここで、次のページとは、ページを跨いで配置されたブロックの上端が属するページから見た次のページをいう。すなわち、図7−1の例では、ページを跨いで配置されているブロック303を次ページの先頭に移動させ、当該ブロック303より下に配置された各ブロックも、当該ブロック303の移動に伴い下方に位置をずらす。以降、この処理をページ毎に順次、繰り返して行うことで、最終的には全てのコンテンツがページを跨がないように配置されたレイアウトを生成することができる。   In the first embodiment, a block arranged across pages is moved to the top of the next page. Here, the next page refers to the next page viewed from the page to which the upper end of a block arranged across the pages belongs. That is, in the example of FIG. 7A, the block 303 arranged across the page is moved to the top of the next page, and each block arranged below the block 303 is also moved downward as the block 303 moves. Shift the position to. Thereafter, by repeating this process sequentially for each page, it is possible to finally generate a layout in which all the contents are arranged not to cross the page.

図8は、本第1の実施形態によるページレイアウトの生成方法の一例の処理を示すフローチャートである。この図8のフローチャートにおける各処理は、CPU101により、本第1の実施形態による画像処理プログラムに従い実行される。先ず、ステップS20で、対象ページのページレイアウトを取得する。なお、ステップS20で取得されるページレイアウトは、処理の対象となる対象ページに係るブロックからなるレイアウトである。対象ページが第1ページ目の場合は、初期ページレイアウトから対象ページのページレイアウトを取得することになる。   FIG. 8 is a flowchart illustrating an example of processing of a page layout generation method according to the first embodiment. Each process in the flowchart of FIG. 8 is executed by the CPU 101 in accordance with the image processing program according to the first embodiment. First, in step S20, the page layout of the target page is acquired. Note that the page layout acquired in step S20 is a layout including blocks related to the target page to be processed. When the target page is the first page, the page layout of the target page is acquired from the initial page layout.

次のステップS21で、対象ページのページレイアウトにページを跨るブロックがあるか否かを判定する。若し、ページを跨るブロックが無いと判定されたら、処理はステップS23に移行される。   In the next step S <b> 21, it is determined whether or not there is a block straddling the page in the page layout of the target page. If it is determined that there is no block straddling the page, the process proceeds to step S23.

一方、ステップS21で、対象ページのレイアウトにページを跨るブロックがあると判定されたら、処理はステップS22に移行される。ステップS22では、対象ページのレイアウト中においてページを跨って配置されたブロックが、対象ページの次のページの先頭に配置されるように、当該ブロックおよび当該ブロックの下に配置される各ブロックを下方へずらして再配置する。ブロックの再配置が終了すると、処理はステップS23に移行される。   On the other hand, if it is determined in step S21 that the layout of the target page includes a block straddling the page, the process proceeds to step S22. In step S22, the block and each block arranged below the block are moved downward so that the block arranged across the page in the layout of the target page is arranged at the head of the next page of the target page. Shift and rearrange. When the block rearrangement is completed, the process proceeds to step S23.

ステップS23では、現在のブロックの配置状態に従い、対象ページにおけるページレイアウトを生成し、当該対象ページのページレイアウトを決定する。そして、処理はステップS24に移行され、全てのページについてページレイアウトが決定されたか否かが判定される。若し、ページレイアウトが決定されていないページが存在すると判定されたら、処理はステップS20に戻され、ステップS23でページレイアウトが決定された次のページを対象ページとして、処理が繰り返される。   In step S23, a page layout in the target page is generated according to the current block arrangement state, and the page layout of the target page is determined. Then, the process proceeds to step S24, and it is determined whether or not the page layout has been determined for all pages. If it is determined that there is a page for which the page layout is not determined, the process returns to step S20, and the process is repeated with the next page for which the page layout is determined in step S23 as the target page.

一方、ステップS24で、全てのページについてページレイアウトが決定されたと判定されたら、一連の処理が終了される。この場合、未配置のブロックが存在しない場合に、全てのページについてページレイアウトが決定されたと判定する。   On the other hand, if it is determined in step S24 that the page layout has been determined for all the pages, a series of processing ends. In this case, when there is no unarranged block, it is determined that the page layout has been determined for all pages.

このように、本発明の第1の実施形態によれば、様々なサイズのコンテンツを複数ページに亘る配置領域に配置する場合に、出力ページ数がなるべく小さくなり、且つ、コンテンツがページで分断されないようなレイアウトを自動的に生成できる。   As described above, according to the first embodiment of the present invention, when contents of various sizes are arranged in an arrangement area extending over a plurality of pages, the number of output pages becomes as small as possible and the contents are not divided by pages. Such a layout can be automatically generated.

また、配置領域に対して様々なサイズのコンテンツを配置する場合、全てのコンテンツがページを跨がないようにページ区切りを設けることができる保証が無く、ページを跨いで配置されるコンテンツが発生する可能性が高い。すなわち、コンテンツが配置された状態でコンテンツを区切らないように幅方向の線(ページ区切り)を引くためには、幅方向に見たときに、コンテンツの上辺または下辺が揃っているなどの条件が必要となる。図9−1は、効率的な配置であっても、適当なページ区切りが見つからない例を示す。   In addition, when content of various sizes is placed in the placement area, there is no guarantee that page breaks can be provided so that all content does not cross pages, and content that is placed across pages occurs. Probability is high. In other words, in order to draw a line (page break) in the width direction so as not to divide the content in a state where the content is arranged, there is a condition that the upper side or the lower side of the content is aligned when viewed in the width direction. Necessary. FIG. 9A illustrates an example in which an appropriate page break is not found even in an efficient arrangement.

本発明の第1の実施形態によれば、コンテンツを配置する際に、配置領域の幅方向については、図9−2に例示されるように、左端に配置されたコンテンツ201の高さからはみ出ない範囲202に収まるコンテンツを探索していくため、ブロック単位での配置の入れ替えが可能となる。したがって、ページ間でコンテンツが分断されないような各ページのレイアウトを、最密充填レイアウトによる初期ページレイアウトの配置から容易に決定することが可能となる。   According to the first embodiment of the present invention, when content is arranged, the width direction of the arrangement region protrudes from the height of the content 201 arranged at the left end as illustrated in FIG. Since the content that falls within the nonexistent range 202 is searched, the arrangement can be changed in units of blocks. Therefore, it is possible to easily determine the layout of each page from which content is not divided between pages from the arrangement of the initial page layout by the close-packed layout.

<第2の実施形態>
次に、本発明の第2の実施形態について説明する。本第2の実施形態では、上述した第1の実施形態の処理に対し、さらに、ページに跨るブロックが存在する場合に、当該ブロック以降のブロックから対象ページ内に収まるブロックを探索する。そして、探索されたブロックとページに跨るブロックとを入れ替えて再配置を行う。これにより、効率的なページレイアウトを簡易に生成することができる。
<Second Embodiment>
Next, a second embodiment of the present invention will be described. In the second embodiment, in addition to the processing of the first embodiment described above, when there is a block straddling a page, a block that fits in the target page is searched from a block subsequent to the block. Then, rearrangement is performed by exchanging the searched block and the block over the page. Thereby, an efficient page layout can be easily generated.

図4を用いて説明した最密充填レイアウトの生成方法によれば、新しいブロックの形成時には、その時点で未配置のコンテンツの中で高さが最大のコンテンツが当該ブロックの左端に配置されることになる。そのため、ブロックは、下方に配置されるに従い高さが単調に減少(または非増加)する。したがって、あるブロックがページを跨いで配置された場合、当該ブロックの下に、当該ブロックと配置を交換することでブロックがページを跨ぐ事態を解消可能な高さのブロックが存在している可能性がある。   According to the method for generating the close-packed layout described with reference to FIG. 4, when a new block is formed, content having the maximum height among the unallocated content at that time is arranged at the left end of the block. become. Therefore, the height of the block monotonously decreases (or does not increase) as the block is disposed below. Therefore, when a block is placed across a page, there is a possibility that there is a block under the block that is high enough to eliminate the situation where the block crosses the page by exchanging the placement with the block. There is.

そこで、本第2の実施形態では、あるブロックがページを跨いで配置された場合、当該ブロックの下に位置するブロックから順次、対象ブロックと配置を交換した際にページ内に収まるか否かを判定する。そして、ページ内に収まる高さのブロックが存在したら、そのブロックの配置と、ページを跨るブロックの配置とを入れ替える。ブロックがページを跨いで配置される毎に同様の処理を繰り返すことで、最終的には、全てのコンテンツがページを跨がないようなページレイアウトを生成することができる。   Therefore, in the second embodiment, when a certain block is arranged across the page, it is determined whether or not the block fits in the page when the arrangement is exchanged with the target block sequentially from the block located below the block. judge. If there is a block having a height that fits within the page, the arrangement of the block and the arrangement of the block across the page are switched. By repeating the same process every time a block is placed across pages, a page layout can be generated so that all content does not cross pages.

図7を用いて、より具体的に説明する。図7−1に示される例では、配置領域300に対してブロック301〜304が配置され、それらのうち、ブロック303がページを跨いで配置されブロック303に含まれるコンテンツがページ区切りで分断されてしまっている。このようなコンテンツの分断は、特にコンテンツの内容が図や表などの場合、好ましくない。   This will be described more specifically with reference to FIG. In the example shown in FIG. 7A, blocks 301 to 304 are arranged in the arrangement area 300, and among them, the block 303 is arranged across the pages, and the content included in the block 303 is divided by page breaks. I'm stuck. Such division of content is not preferable particularly when the content is a figure or a table.

ここで、上述した処理により、ページを跨いで配置されたブロック303の直下に配置されるブロックから順次、ブロック303との配置交換を試みる。図7−1の例では、1ページの高さ「11」に対して上から高さがそれぞれ「6」、「3」および「3」のブロック301〜303が配置され、ブロック303が高さ「1」だけページからはみ出している。ブロック303を取り去ると、ブロック303の直上のブロック302とページ下端との間に高さ「2」の余裕が生じる。一方、ブロック303の1つ下に配置されるブロック304は、高さが「2」であるため、ブロック303とブロック304とを入れ替えて再配置を行うことで、ブロックがページを跨ぐ事態が解消されることが分かる。   Here, by the above-described processing, the arrangement exchange with the block 303 is tried sequentially from the block arranged immediately below the block 303 arranged across the pages. In the example of FIG. 7A, blocks 301 to 303 whose heights are “6”, “3”, and “3” from the top with respect to the height “11” of one page are arranged, and the block 303 has a height. Only "1" protrudes from the page. When the block 303 is removed, a margin of height “2” is generated between the block 302 immediately above the block 303 and the lower end of the page. On the other hand, since the block 304 arranged immediately below the block 303 has a height of “2”, the situation where the block straddles the page is resolved by replacing the block 303 and the block 304 and performing the rearrangement. You can see that

図7−2は、図7−1の状態から、ブロック303とブロック304とを入れ替えて再配置した場合の例を示す。対象ページに対して、ブロック304がページを跨がずに配置されていることが分かる。このような再配置を行うことで、効率性を保持しつつ、ブロックがページを跨いでしまう事態を解消することができる。   FIG. 7-2 illustrates an example in which the blocks 303 and 304 are replaced and rearranged from the state illustrated in FIG. It can be seen that the block 304 is arranged without straddling the target page. By performing such rearrangement, it is possible to eliminate a situation in which blocks straddle pages while maintaining efficiency.

図10は、本第2の実施形態によるページレイアウトの生成方法の一例の処理を示すフローチャートである。この図10のフローチャートにおける各処理は、CPU101により、本第2の実施形態による画像処理プログラムに従い実行される。先ず、ステップS30で、上述したステップS20と同様にして、対象ページのページレイアウトを取得する。そして、次のステップS31で、対象ページのページレイアウトにページを跨るブロックがあるか否かを判定する。若し、ページを跨るブロックが無いと判定されたら、処理はステップS37に移行される。   FIG. 10 is a flowchart showing an example of processing of a page layout generation method according to the second embodiment. Each process in the flowchart of FIG. 10 is executed by the CPU 101 in accordance with the image processing program according to the second embodiment. First, in step S30, the page layout of the target page is acquired in the same manner as in step S20 described above. Then, in the next step S31, it is determined whether or not there is a block across the page in the page layout of the target page. If it is determined that there is no block straddling the page, the process proceeds to step S37.

一方、ステップS31で、対象ページのレイアウトにページを跨るブロックがあると判定されたら、処理はステップS32に移行される。ステップS32では、ページを跨ると判定されたブロックの直上に配置されるブロックの下端から、対象ページの下端までの高さyが求められる。   On the other hand, if it is determined in step S31 that there is a block that crosses the page in the layout of the target page, the process proceeds to step S32. In step S32, the height y from the lower end of the block arranged immediately above the block determined to straddle the page to the lower end of the target page is obtained.

次のステップS33で、対象ブロックの下にさらにブロックが配置されているか否かが判定される。ステップS33による判定が、ステップS31でページを跨るブロックがあると判定された直後の判定であれば、当該ページを跨るブロックが対象ブロックとされる。若し、対象ブロックの直下にさらにブロックが配置されていると判定されたら、処理はステップS34に移行される。   In the next step S33, it is determined whether or not a block is further arranged below the target block. If the determination in step S33 is a determination immediately after it is determined in step S31 that there is a block straddling the page, the block straddling the page is set as the target block. If it is determined that more blocks are arranged immediately below the target block, the process proceeds to step S34.

ステップS34では、対象ブロックの直下に配置されたブロックをページを跨るブロックと入れ替えて配置した場合に、ブロックが対象ページ内に収まるか否かが判定される。例えば、ステップS32で求められた高さyと、対象ブロックの直下に配置されたブロックの高さhbとを比較し、高さyが高さhb以上であれば、当該ブロックが対象ページ内に収まると判定される。 In step S34, when the block arranged immediately below the target block is replaced with a block straddling the page, it is determined whether or not the block fits in the target page. For example, the height y obtained in step S32, is compared with the height h b of the blocks arranged directly below the target block, if the height y is the height h b above, the block is subject pages It is determined that it falls within.

若し、ステップS34で、高さhbが高さyよりも高く、対象ブロックとページを跨ぐブロックとを入れ替えて配置した際に、対象ブロックがページ内に収まらないと判定されたら、処理はステップS33に戻される。そして、直前にページを跨ぐブロックとの入れ替えを試みられたブロックを新たな対象ブロックとして、当該対象ブロックの直下に配置されているブロックについて、同様にして判定が行われる。 Wakashi, in step S34, higher than the height h b is the height y, when placed interchanging the block across the target block and page, if the target block is determined not to fit in the page, the process It returns to step S33. Then, the block that has been attempted to be replaced with the block that straddles the page immediately before is set as a new target block, and the determination is performed in the same manner for a block arranged immediately below the target block.

一方、ステップS34で、高さhbが高さy以内であって、対象ブロックとページを跨ぐブロックとを入れ替えて配置した際に、対象ブロックがページ内に収まると判定されたら、処理はステップS35に移行される。ステップS35では、当該対象ブロックとページを跨ぐブロックとが入れ替えられて、ブロックの再配置がなされる。この場合、当該対象ブロックがページを跨ぐブロックの直上のブロックの直下に配置されると共に、ページを跨ぐブロックが対象ページの次ページの先頭に配置される。そして、このブロックの直下から、当該対象ブロックの直下から配置されていた各ブロックが、順序を変えずに配置される。ステップS35でブロックの再配置が行われると、処理はステップS37に移行される。 On the other hand, in step S34, the height h b is not more than the height y, when placed interchanging the block across the target block and page, if the target block is determined to fit on the page, the process steps The process proceeds to S35. In step S35, the target block and the block straddling the page are switched, and the blocks are rearranged. In this case, the target block is arranged immediately below the block immediately above the block straddling the page, and the block straddling the page is arranged at the head of the next page of the target page. Then, from the position immediately below this block, the blocks arranged from directly below the target block are arranged without changing the order. When block rearrangement is performed in step S35, the process proceeds to step S37.

上述のステップS33で、対象ブロックの下にブロックが配置されていないと判定されたら、処理はステップS36に移行される。この場合には、対象ページ内に収まるようにページを跨ぐブロックと入れ替え可能なブロックが存在しないことを意味する。そこで、ステップS36では、当該ページを跨ぐブロックを対象ページの次ページの先頭に配置されるように、当該ブロックおよび当該ブロックの下に配置される各ブロックを下方にずらして再配置する。ブロックの再配置が終了すると、処理はステップS37に移行される。   If it is determined in step S33 described above that no block is placed below the target block, the process proceeds to step S36. In this case, this means that there is no block that can be replaced with a block that straddles the page so as to fit within the target page. Therefore, in step S36, the block and each block arranged below the block are shifted and rearranged so that the block straddling the page is arranged at the head of the next page of the target page. When the block rearrangement is completed, the process proceeds to step S37.

ステップS37では、現在のブロックの配置状態に従い、対象ページにおけるページレイアウトを生成し、当該対象ページのページレイアウトを決定する。そして、処理はステップS38に移行され、全てのページについてページレイアウトが決定されたか否かが判定される。若し、ページレイアウトが決定されていないページが存在すると判定されたら、処理はステップS30に戻され、ステップS37でページレイアウトが決定された次のページを対象ページとして、処理が繰り返される。   In step S37, a page layout in the target page is generated according to the current block arrangement state, and the page layout of the target page is determined. Then, the process proceeds to step S38, and it is determined whether or not the page layout has been determined for all pages. If it is determined that there is a page for which the page layout is not determined, the process returns to step S30, and the process is repeated with the next page for which the page layout is determined in step S37 as the target page.

一方、ステップS38で、全てのページについてページレイアウトが決定されたと判定されたら、一連の処理が終了される。この場合、未配置のブロックが存在しない場合に、全てのページについてページレイアウトが決定されたと判定する。   On the other hand, if it is determined in step S38 that the page layout has been determined for all the pages, the series of processes is terminated. In this case, when there is no unarranged block, it is determined that the page layout has been determined for all pages.

このように、本発明の第2の実施形態によれば、様々なサイズのコンテンツを複数ページに亘る配置領域に配置する場合に、出力ページ数がなるべく小さくなり、且つ、コンテンツがページで分断されないようなレイアウトを自動的に生成できる。   As described above, according to the second embodiment of the present invention, when contents of various sizes are arranged in an arrangement area extending over a plurality of pages, the number of output pages becomes as small as possible, and the contents are not divided by pages. Such a layout can be automatically generated.

また、本第2の実施形態によれば、最密充填レイアウト生成により、新しいブロックの形成時には、その時点で未配置のコンテンツの中で高さが最大のコンテンツが当該ブロックの左端に配置されることになる。そのため、ブロックは、下方に配置されるに従い高さが単調に減少(または非増加)する。したがって、ブロックがページを跨いで配置されてしまった場合、直下のブロックから順次、ブロックの高さを調べていき、ページ内に収まる高さのブロックがあれば、そのブロックとページを跨ぐブロックとを入れ替えて再配置を行うことで、簡易に効率的なページレイアウトを生成することができる。   Further, according to the second embodiment, when a new block is formed by generating the close-packed layout, content having the maximum height among the unallocated contents at that time is arranged at the left end of the block. It will be. Therefore, the height of the block monotonously decreases (or does not increase) as the block is disposed below. Therefore, if a block is placed across a page, the block height is checked sequentially from the block immediately below, and if there is a block that fits within the page, that block and the block that crosses the page By replacing and rearranging, it is possible to easily generate an efficient page layout.

<第3の実施形態>
次に、本発明の第3の実施形態について説明する。本第3の実施形態では、上述した第1または第2の実施形態で生成された最終的なページレイアウトに対して、さらに調整を加えることで、より好ましいページレイアウトを生成する。この場合、ブロック自体の位置を調整する方法と、ブロック内でコンテンツの位置を調整する方法とが考えられる。
<Third Embodiment>
Next, a third embodiment of the present invention will be described. In the third embodiment, a more preferable page layout is generated by further adjusting the final page layout generated in the first or second embodiment described above. In this case, a method of adjusting the position of the block itself and a method of adjusting the position of the content within the block are conceivable.

先ず、第1の方法として、ブロック自体の位置をページ内で調整する方法について説明する。すなわち、上述した第1および第2の実施形態により生成されるページレイアウトでは、最終ページに対して1つのブロックのみが配置され、そのページの残り全ての領域が空白という事態が起こり得る。そこで、上述した第1または第2の実施形態で説明した方法でページレイアウトを生成し、全ページ数が決定された後に、ブロック自体の位置をページ内およびページ間で調整する。   First, as a first method, a method for adjusting the position of the block itself within the page will be described. That is, in the page layout generated by the first and second embodiments described above, only one block may be arranged for the last page, and all the remaining areas of the page may be blank. Therefore, a page layout is generated by the method described in the first or second embodiment, and after the total number of pages is determined, the position of the block itself is adjusted within the page and between pages.

図11は、ブロック自体の位置を調整する処理を示す一例のフローチャートである。この図11のフローチャートにおける各処理は、CPU101により、本第3の実施形態による画像処理プログラムに従い実行される。先ず、ステップS40で、図4を用いて説明したようにして最密充填レイアウトを取得し、次のステップS41で、最密充填レイアウトから初期ページレイアウトを生成する。この初期ページレイアウトでは、既に説明したように、ページを跨いで配置されるブロックが存在する可能性がある。次のステップS42で、初期ページレイアウトに基づきブロック単位で再配置を行い、ページを跨ぐブロックが全ページに亘って存在しないようにする。ステップS42での処理は、図8または図9を用いて説明した手順に従い、ページを跨ぐブロックを次のページの先頭に移動させたり、他のブロックとの入れ替えを行うことで、ブロックがページを跨いで配置される事態を解消する。   FIG. 11 is a flowchart illustrating an example of a process for adjusting the position of the block itself. Each process in the flowchart of FIG. 11 is executed by the CPU 101 according to the image processing program according to the third embodiment. First, in step S40, the closest packed layout is acquired as described with reference to FIG. 4, and in the next step S41, an initial page layout is generated from the closest packed layout. In this initial page layout, as already explained, there is a possibility that there are blocks arranged across the pages. In the next step S42, rearrangement is performed in units of blocks based on the initial page layout so that there are no blocks across the pages across all pages. The process in step S42 follows the procedure described with reference to FIG. 8 or FIG. 9 and moves the block across the page to the beginning of the next page or replaces it with another block, so that the block changes the page. Eliminate the situation of straddling.

ステップS42までの処理により全ページのレイアウトが決定し、レイアウトに必要な全ページ数が確定すると、処理はステップS43に移行される。ステップS43では、ブロックの位置調整を行う。   When the layout of all pages is determined by the processing up to step S42 and the total number of pages necessary for the layout is determined, the processing proceeds to step S43. In step S43, the position of the block is adjusted.

ステップS43での処理として、例えばページ下部の空白部分のページ間でのバラツキが小さくなるように、ブロックを再配置することが考えられる。一例として、ステップS42の処理が終了した時点で、全ブロックの高さの合計をページ数で除して、1ページに配置されるブロックの合計高さの平均値havgを算出する。そして、最終ページに配置されるブロックの合計高さが平均値havgに近くなるように、各ページから1つずつ、ブロックを最終ページに移動させる。 As the processing in step S43, for example, it is conceivable to rearrange the blocks so that the variation between the blank portions at the bottom of the page is reduced. As an example, when the processing of step S42 is completed, the total height h avg of the total height of blocks arranged on one page is calculated by dividing the total height of all blocks by the number of pages. The total height of the blocks arranged in the last page to be close to the average value h avg, one from each page, move the block to the last page.

また、ページ内でブロックの再配置を行ってページ毎のレイアウトを調整することもできる。例えば、ページ内の下部に生じた空白を、ブロック間のマージンとして割り当てることが考えられる。一例として、下記の式(6)に例示されるように、各ページにおいて、下部の空白領域の高さMをブロック数n−1で除して、ブロック間に対して等分にブロック間マージンBMを割り当てる。
BM=M/(n−1) …(6)
In addition, the layout of each page can be adjusted by rearranging blocks within the page. For example, it is conceivable to assign a blank generated at the bottom of the page as a margin between blocks. As an example, as illustrated in the following formula (6), in each page, the height M of the lower blank area is divided by the number of blocks n−1 and the inter-block margin is equally divided between the blocks. Allocate BM.
BM = M / (n-1) (6)

勿論、このページ内でのブロック再配置と、上述したページ間でのブロックの移動とを組み合わせて実行してもよい。すなわち、ページ下部の空白部分のページ間でのバラツキが小さくなるようにブロックを再配置した後に、ページ内でのブロックの再配置を行い空白部分を均一化する。   Of course, the block rearrangement within this page may be combined with the above-described block movement between pages. That is, after the blocks are rearranged so that the variation between the blank portions at the bottom of the page is reduced, the blocks are rearranged in the page to make the blank portions uniform.

次に、第2の方法として、ブロック内でコンテンツの位置を調整する方法について説明する。ブロック内でコンテンツを移動させても、ブロック自体を移動させない限りはページ数が増加することはない。そこで、ブロック内で例えば水平方向にコンテンツを移動させて、左右のバランスを調整する方法が考えられる。このとき、ブロック内に配置されるコンテンツのサイズや形状(アスペクト比)などを考慮してコンテンツの移動を行うと好ましい。   Next, as a second method, a method for adjusting the position of content in a block will be described. Even if the content is moved within the block, the number of pages does not increase unless the block itself is moved. Therefore, a method of adjusting the left / right balance by moving the content in the block in the horizontal direction, for example, can be considered. At this time, it is preferable to move the content in consideration of the size and shape (aspect ratio) of the content arranged in the block.

図12は、ブロック内でコンテンツの位置を調整する処理を示す一例のフローチャートである。この図12のフローチャートにおける各処理は、CPU101により、本第3の実施形態による画像処理プログラムに従い実行される。先ず、ステップS50で、図4を用いて説明したようにして最密充填レイアウトを取得し、次のステップS51で、最密充填レイアウトから初期ページレイアウトを生成する。この初期ページレイアウトでは、既に説明したように、ページを跨いで配置されるブロックが存在する可能性がある。次のステップS52で、初期ページレイアウトに基づきブロック単位で再配置を行い、ページを跨ぐブロックが全ページに亘って存在しないようにする。ステップS52での処理は、図8または図9を用いて説明した手順に従い、ページを跨ぐブロックを次のページの先頭に移動させたり、他のブロックとの入れ替えを行うことで、ブロックがページを跨いで配置される事態を解消する。   FIG. 12 is a flowchart illustrating an example of a process for adjusting the position of content within a block. Each process in the flowchart of FIG. 12 is executed by the CPU 101 according to the image processing program according to the third embodiment. First, in step S50, the closest packed layout is acquired as described with reference to FIG. 4, and in the next step S51, an initial page layout is generated from the closest packed layout. In this initial page layout, as already explained, there is a possibility that there are blocks arranged across the pages. In the next step S52, rearrangement is performed in units of blocks based on the initial page layout so that there are no blocks across the pages across all pages. The processing in step S52 follows the procedure described with reference to FIG. 8 or FIG. 9 and moves the block across the page to the top of the next page or replaces it with another block, so that the block changes the page. Eliminate the situation of straddling.

ステップS52までの処理により全ページのレイアウトが決定すると、処理がステップS53に移行される。ステップS53では、ブロック内でのコンテンツの位置調整を行う。   When the layout of all pages is determined by the process up to step S52, the process proceeds to step S53. In step S53, the position of the content within the block is adjusted.

ステップS53において、ブロックの視覚的な中心や、コンテンツの視覚的な中心は、例えば「Steven J.Harrington, J.Femando Naveda, Rhys Price Jones, Paul Roetling, Nishant Thakker, "Aesthetic Measures for Automated Document Layout"」(非特許文献2)に示される方法で算出可能である。例えば、ブロック内コンテンツ全体の水平方向の位置は下記の式(7)〜式(9)で、ブロック内コンテンツの左右のバランス度は下記の式(10)でそれぞれ算出することができる。

Figure 2010219686
Figure 2010219686
Figure 2010219686
Figure 2010219686
In step S53, the visual center of the block and the visual center of the content are, for example, “Steven J. Harrington, J. Femando Naveda, Rhys Price Jones, Paul Roetling, Nishant Thakker,“ Aesthetic Measures for Automated Document Layout ”. (Non-Patent Document 2). For example, the horizontal position of the entire in-block content can be calculated by the following formulas (7) to (9), and the left / right balance degree of the in-block content can be calculated by the following formula (10).
Figure 2010219686
Figure 2010219686
Figure 2010219686
Figure 2010219686

なお、上述の式(7)〜式(10)で用いられる各変数の意味は、次の通りである。
(xi,yi):コンテンツiのxy座標
(xc,yc):ブロックの視覚的な中心
i:コンテンツの視覚的中心
(dx,dy):ブロックの視覚的中心からの最大距離
h:ブロックの高さ
In addition, the meaning of each variable used by above-mentioned Formula (7)-Formula (10) is as follows.
(x i , y i ): xy coordinates of content i
(x c , y c ): Visual center of block M i : Visual center of content
(d x , d y ): Maximum distance from the visual center of the block d h : Block height

また、ブロック内ではコンテンツを自由に移動させることができるため、例えば、ステップS53において、ブロック内のコンテンツの中心位置がブロックの中央に近付くように、コンテンツの位置調整を行うこともできる。ブロック内コンテンツの中心位置は例えば下記の式(11)および式(12)により、バランス度は式(13)により、それぞれ算出することができる。

Figure 2010219686
Figure 2010219686
Figure 2010219686
Further, since the content can be freely moved within the block, for example, in step S53, the position of the content can be adjusted so that the center position of the content in the block approaches the center of the block. The center position of the in-block content can be calculated by, for example, the following equations (11) and (12), and the balance can be calculated by the equation (13).
Figure 2010219686
Figure 2010219686
Figure 2010219686

ブロックおよびコンテンツのレイアウト調整方法は、上述の例に限定されるものではない。例えば、上述した非特許文献2に記載されている幾つかの指標を用いてブロック間のコンテンツの配置を調整することもできる。   The block and content layout adjustment method is not limited to the above-described example. For example, the arrangement of content between blocks can be adjusted using some indices described in Non-Patent Document 2 described above.

本発明に適用可能な最密充填レイアウトでは、コンテンツは基本的に左詰め(または右詰め)で配置される。一方、レイアウトとしては、幅方向のバランスがとれた方が一般的に見やすいとされている。本第3の実施形態によれば、ブロック内部でコンテンツの左右のバランスを調整する事で、レイアウトの効率性は保持しつつ、より美しいレイアウトを実現することができる。   In the close-packed layout applicable to the present invention, the content is basically arranged left-justified (or right-justified). On the other hand, as a layout, it is generally easy to see when the width direction is balanced. According to the third embodiment, by adjusting the left / right balance of content within a block, a more beautiful layout can be realized while maintaining the efficiency of the layout.

また、本発明に適用可能な最密充填レイアウトでは、ブロック単位で見ると、基本的にコンテンツが左上詰め(または右上詰め)で配置される。一方、レイアウトとしては、コンテンツの重心がブロックの中央付近に位置していた方がバランスが良く、一般的に見やすいとされている。本第3の実施形態によれば、ブロック内部でコンテンツの重心位置を調整することで、レイアウトの効率性を保持しつつ、より美しいレイアウトを実現することができる。   Further, in the close-packed layout applicable to the present invention, when viewed in units of blocks, the content is basically arranged in the upper left (or upper right). On the other hand, as the layout, it is said that the center of content is located near the center of the block, the balance is better, and it is generally easier to see. According to the third embodiment, by adjusting the position of the center of gravity of the content inside the block, it is possible to realize a more beautiful layout while maintaining the efficiency of the layout.

<第4の実施形態>
次に、本発明の第4の実施形態について説明する。本第4の実施形態では、コンテンツに対する倍率の可変量や、アスペクトの可変量を取得し、これら取得された可変量に基づきコンテンツのサイズを変更することで、ブロックをページを跨がずに配置する。
<Fourth Embodiment>
Next, a fourth embodiment of the present invention will be described. In the fourth embodiment, the variable amount of the magnification and the variable amount of the aspect are acquired, and the size of the content is changed based on the acquired variable amount, thereby arranging the blocks without straddling the page. To do.

図13は、本第4の実施形態によるページレイアウトの生成方法の一例の処理を示すフローチャートである。この図13のフローチャートにおける各処理は、CPU101により、本第4の実施形態による画像処理プログラムに従い実行される。   FIG. 13 is a flowchart illustrating an example of processing of a page layout generation method according to the fourth embodiment. Each process in the flowchart of FIG. 13 is executed by the CPU 101 in accordance with the image processing program according to the fourth embodiment.

この図13のフローチャートは、例えば述した図8のフローチャートにおけるステップS21や、図9のフローチャートにおけるステップS31の判定において、ページに跨るブロックがあると判定された場合の処理に対応する。ページに跨るブロックがあると判定されると、ステップS60において、当該ブロックに含まれるコンテンツに対する倍率およびアスペクト比の少なくとも一方の可変量を取得する。   The flowchart of FIG. 13 corresponds to the processing in the case where it is determined that there is a block straddling a page in the determination of step S21 in the flowchart of FIG. 8 described above or the determination of step S31 in the flowchart of FIG. If it is determined that there is a block straddling the page, in step S60, a variable amount of at least one of a magnification and an aspect ratio for the content included in the block is acquired.

可変量は、例えば画像処理装置100に対するユーザ操作により、コンテンツ毎に指定することができる。これに限らず、可変量を予め画像処理プログラムにより指定するようにしてもよい。また、可変量は、ブロックに対する可変量であってもよい。さらに、コンテンツがテキストの場合は可変量を小さく、画像の場合は可変量を大きくといったように、可変量をコンテンツの種類に応じて指定するようにしてもよい。   The variable amount can be specified for each content by a user operation on the image processing apparatus 100, for example. However, the present invention is not limited to this, and a variable amount may be designated in advance by an image processing program. Further, the variable amount may be a variable amount for the block. Furthermore, the variable amount may be specified according to the type of content, such as a small variable amount when the content is text and a large variable amount when the content is an image.

なお、コンテンツがテキストであるか画像であるかは、例えばテキストが画像として入力される場合には、後述する第5の実施形態で説明する解析処理によって、判定することが考えられる。テキストがテキストデータで入力される場合には、データの種類に基づいて判定可能であることはいうまでもない。   Note that whether the content is a text or an image can be determined by, for example, an analysis process described in a fifth embodiment to be described later when the text is input as an image. Needless to say, when text is input as text data, it can be determined based on the type of data.

可変量が取得されると、処理はステップS61に移行され、可変量の範囲内でコンテンツまたはブロックを変形させた場合に、当該ブロックがページ内に収まるか否かが判定される。例えば、指定された可変量の範囲内でコンテンツを変形させ、それに伴いブロックを変形させて高さを調整することで当該ブロックがページ内に収まるか否かが判定される。若し、変形により当該ブロックがページ内に収まると判定されたら、処理はステップS62に移行され、ページ内に収まるように当該ブロックの高さを調整する。   When the variable amount is acquired, the process proceeds to step S61, and it is determined whether or not the block fits in the page when the content or the block is deformed within the range of the variable amount. For example, it is determined whether or not the block fits in the page by deforming the content within a specified variable range and adjusting the height by deforming the block accordingly. If it is determined that the block fits in the page due to the deformation, the process proceeds to step S62, and the height of the block is adjusted to fit in the page.

一方、ステップS61で、可変量の範囲内で変形を行っても当該ブロックがページ内に収まらない、すなわち、当該ブロックがページを跨いでしまうと判定されたら、処理はステップS63に移行される。そして、当該ブロックが次のページの先頭に配置され、それに伴い当該ブロックの下に配置されるブロックの位置も下方にずらされる。   On the other hand, if it is determined in step S61 that the block does not fit within the page even if the deformation is performed within the range of the variable amount, that is, the block crosses the page, the process proceeds to step S63. Then, the block is arranged at the head of the next page, and accordingly, the position of the block arranged below the block is also shifted downward.

<第5の実施形態>
次に、本発明の第5の実施形態について説明する。本第5の実施形態では、画像処理装置100に対してコンテンツの内容を解析するコンテンツ解析機能を持たせる。そして、配置領域に配置するコンテンツの内容をコンテンツ解析機能によって解析し、解析結果に基づきブロックの入れ替えなどを行う。
<Fifth Embodiment>
Next, a fifth embodiment of the present invention will be described. In the fifth embodiment, the image processing apparatus 100 is provided with a content analysis function for analyzing the content. And the content of the content arrange | positioned to an arrangement | positioning area | region is analyzed by a content analysis function, and a block is replaced based on the analysis result.

コンテンツ解析機能は、例えばCPU101上で動作するプログラムとして実現される。コンテンツの解析方法としては、既存の技術を適用することができる。コンテンツの解析結果として得られる情報としては、例えば下記のような情報が考えられる。
分類:テキスト/イメージ
視覚情報:色/密度など
構造情報:見出し/タイトル/本文など
意味情報:コンテンツ間やブロック間の相関/重要度
The content analysis function is realized as a program that runs on the CPU 101, for example. As a content analysis method, an existing technique can be applied. As information obtained as a result of content analysis, for example, the following information can be considered.
Classification: Text / image Visual information: Structure information such as color / density: Semantic information such as headline / title / text: Correlation / importance between contents and blocks

先ず、入力されたコンテンツがテキストおよびイメージの何れであるかを解析する。例えば、入力された画像データに対して文字検出を行い、検出結果に基づきコンテンツがテキストおよびイメージの何れであるかを判定する。   First, it is analyzed whether the input content is text or image. For example, character detection is performed on the input image data, and it is determined whether the content is text or image based on the detection result.

なお、テキストは、テキストデータとして入力することもできる。この場合、表示範囲などテキストのレイアウトに関する情報が共に入力されるものとする。これに限らず、画像処理装置100側において、入力されたテキストデータに対して表示範囲を設定するようにしてもよい。   The text can also be input as text data. In this case, it is assumed that information related to text layout such as a display range is input together. However, the display range may be set for the input text data on the image processing apparatus 100 side.

コンテンツがイメージであれば、例えば画素毎の色情報に基づきRGB値のヒストグラムを作成して色に関する解析を行うことが考えられる。また例えば、画像データの空間周波数を解析することで、画像の密度に関する情報を取得することが考えられる。   If the content is an image, for example, it may be possible to create a histogram of RGB values based on the color information for each pixel and perform an analysis on the color. Further, for example, it is conceivable to acquire information related to the density of the image by analyzing the spatial frequency of the image data.

コンテンツデータがテキストであれば、テキストの構造を解析し、見出し、タイトルおよび本文などをそれぞれ抽出することが考えられる。例えば、検出された文字(文字群)の位置や大きさ、装飾などに基づき、テキストの構造を解析することが考えられる。また、テキストデータがHTML(Hyper Text Markup Language)やXML(Extensible Markup Language)といったマークアップ言語で記述されたテキストデータとして入力されている場合は、タグに基づき構造解析を行うことができる。これに限らず、テキストデータに用いられている単語を抽出してテキストの意味解析を行うことも考えられる。   If the content data is text, it may be possible to analyze the structure of the text and extract a headline, a title, a body, and the like. For example, it is conceivable to analyze the structure of text based on the position and size of a detected character (character group), decoration, and the like. When text data is input as text data described in a markup language such as HTML (Hyper Text Markup Language) or XML (Extensible Markup Language), structural analysis can be performed based on the tag. However, the present invention is not limited to this, and it is conceivable to extract a word used in text data and perform a semantic analysis of the text.

上述した視覚情報や構造情報の解析結果に基づき、コンテンツ間の相関やコンテンツの重要度を解析することができる。また、コンテンツ毎の解析結果を用いて、それぞれコンテンツが1または複数配置されたブロック間での相関やブロックの重要度を解析することも可能である。   Based on the analysis results of the visual information and the structure information described above, it is possible to analyze the correlation between the contents and the importance of the contents. It is also possible to analyze the correlation between blocks in which one or a plurality of contents are arranged and the importance of the blocks using the analysis result for each content.

図14は、本第5の実施形態によるページレイアウトの生成方法の一例の処理を示すフローチャートである。この図14のフローチャートにおける各処理は、CPU101により、本第5の実施形態による画像処理プログラムに従い実行される。この図14のフローチャートにおいては、ページを跨ぐブロックがあった場合に、上述した解析結果を行って当該ブロックの直上に配置されるブロックと、当該ブロックより下方に配置されるブロックとの相関を順次、求める。そして、相関を示す相関値が予め定めた閾値thより高いと判定されたブロックとの配置の入れ替えを行う。   FIG. 14 is a flowchart showing an example of a page layout generation method according to the fifth embodiment. Each process in the flowchart of FIG. 14 is executed by the CPU 101 in accordance with the image processing program according to the fifth embodiment. In the flowchart of FIG. 14, when there is a block straddling a page, the analysis result described above is performed, and the correlation between the block arranged immediately above the block and the block arranged below the block is sequentially ,Ask. Then, the arrangement of the block determined to have a correlation value indicating correlation higher than a predetermined threshold th is replaced.

先ず、ステップS70で、上述したステップS20と同様にして、対象ページのページレイアウトを取得する。そして、次のステップS71で、対象ページのページレイアウトにページを跨るブロックがあるか否かを判定する。若し、ページを跨るブロックが無いと判定されたら、処理はステップS79に移行される。   First, in step S70, the page layout of the target page is acquired in the same manner as in step S20 described above. Then, in the next step S71, it is determined whether or not there is a block straddling the page in the page layout of the target page. If it is determined that there is no block straddling the page, the process proceeds to step S79.

一方、ステップS71で、対象ページのレイアウトにページを跨るブロックがあると判定されたら、処理はステップS72に移行される。ステップS72では、ページを跨ると判定されたブロックの直上に配置されるブロックの下端から、対象ページの下端までの高さyが求められる。   On the other hand, if it is determined in step S71 that there is a block across the page in the layout of the target page, the process proceeds to step S72. In step S72, the height y from the lower end of the block arranged immediately above the block determined to straddle the page to the lower end of the target page is obtained.

次のステップS73で、対象ブロックの下にさらにブロックが配置されているか否かが判定される。ステップS73による判定が、ステップS71でページを跨るブロックがあると判定された直後の判定であれば、当該ページを跨るブロックが対象ブロックとされる。若し、対象ブロックの直下にさらにブロックが配置されていると判定されたら、処理はステップS74に移行される。   In a next step S73, it is determined whether or not a block is further arranged below the target block. If the determination in step S73 is a determination immediately after it is determined in step S71 that there is a block straddling the page, the block straddling the page is the target block. If it is determined that more blocks are arranged immediately below the target block, the process proceeds to step S74.

ステップS74では、対象ブロックの直下に配置されたブロックをページを跨るブロックと入れ替えて配置した場合に、ブロックが対象ページ内に収まるか否かが判定される。例えば、ステップS72で求められた高さyと、対象ブロックの直下に配置されたブロックの高さhbとを比較し、高さyが高さhb以上であれば、当該ブロックが対象ページ内に収まると判定される。 In step S74, it is determined whether or not the block fits in the target page when the block arranged immediately below the target block is replaced with a block straddling the page. For example, the height y obtained in step S72, the comparison between the height h b of the blocks arranged directly below the target block, if the height y is the height h b above, the block is subject pages It is determined that it falls within.

若し、ステップS74で、高さhbが高さyよりも高く、対象ブロックとページを跨ぐブロックとを入れ替えて配置した際に、対象ブロックがページ内に収まらないと判定されたら、処理はステップS73に戻される。そして、直前にページを跨ぐブロックとの入れ替えを試みられたブロックを新たな対象ブロックとして、当該対象ブロックの直下に配置されているブロックについて、同様にして判定が行われる。 If it is determined in step S74 that the height h b is higher than the height y and the target block and the block straddling the page are replaced and arranged and the target block does not fit in the page, the process is as follows. It returns to step S73. Then, the block that has been attempted to be replaced with the block that straddles the page immediately before is set as a new target block, and the determination is performed in the same manner for a block arranged immediately below the target block.

一方、ステップS74で、高さhbが高さy以内であって、対象ブロックとページを跨ぐブロックとを入れ替えて配置した際に、対象ブロックがページ内に収まると判定されたら、処理はステップS75に移行される。ステップS75では、当該対象ブロックと、ページを跨ぐブロックの直上に配置されるブロックとの相関が算出される。そして、次のステップS76で、この相関が予め決められた閾値thよりも高いか否かが判定される。 On the other hand, in step S74, the height h b is not more than the height y, when placed interchanging the block across the target block and page, if the target block is determined to fit on the page, the process steps The process proceeds to S75. In step S75, a correlation between the target block and a block arranged immediately above the block across the page is calculated. Then, in the next step S76, it is determined whether this correlation is higher than a predetermined threshold th.

若し、算出された相関が閾値thよりも高いと判定されたら、処理はステップS77に移行され、当該対象ブロックとページを跨ぐブロックとが入れ替えられて、ブロックの再配置がなされる。この場合、当該対象ブロックがページを跨ぐブロックの直上のブロックの直下に配置されると共に、ページを跨ぐブロックが対象ページの次ページの先頭に配置される。そして、このブロックの直下から、当該対象ブロックの直下から配置されていたブロックが、順序を変えずに配置される。ステップS77でブロックの再配置が行われると、処理はステップS79に移行される。   If it is determined that the calculated correlation is higher than the threshold th, the process proceeds to step S77, the target block and the block straddling the page are switched, and the blocks are rearranged. In this case, the target block is arranged immediately below the block immediately above the block straddling the page, and the block straddling the page is arranged at the head of the next page of the target page. Then, the blocks arranged from directly under this block are arranged without changing the order. When block rearrangement is performed in step S77, the process proceeds to step S79.

一方、ステップS76で、相関が閾値th以下であると判定されたら、処理はステップS73に戻され、次のブロックについて処理が繰り返される。   On the other hand, if it is determined in step S76 that the correlation is equal to or less than the threshold th, the process returns to step S73, and the process is repeated for the next block.

上述のステップS73で、対象ブロックの下にブロックが配置されていないと判定されたら、処理はステップS78に移行される。ステップS78では、当該ページを跨ぐブロックを対象ページの次ページの先頭に配置されるように、当該ブロックおよび当該ブロックの下に配置される各ブロックを下方にずらして再配置する。ブロックの再配置が終了すると、処理はステップS79に移行される。   If it is determined in step S73 described above that no block is arranged below the target block, the process proceeds to step S78. In step S78, the block and the blocks arranged below the block are shifted downward and rearranged so that the block straddling the page is arranged at the head of the next page of the target page. When the block rearrangement is completed, the process proceeds to step S79.

ステップS79では、現在のブロックの配置状態に従い、対象ページにおけるページレイアウトを生成する。そして、処理はステップS80に移行され、全てのページについてページレイアウトが決定されたか否かが判定される。若し、ページレイアウトが決定されていないページが存在すると判定されたら、処理はステップS70に戻され、ステップS79でページレイアウトが決定された次のページを対象ページとして、処理が繰り返される。   In step S79, a page layout in the target page is generated according to the current block arrangement state. Then, the process proceeds to step S80, and it is determined whether or not the page layout has been determined for all pages. If it is determined that there is a page for which the page layout is not determined, the process returns to step S70, and the process is repeated with the next page for which the page layout is determined in step S79 as the target page.

一方、ステップS80で、全てのページについてページレイアウトが決定されたと判定されたら、一連の処理が終了される。この場合、未配置のブロックが存在しない場合に、全てのページについてページレイアウトが決定されたと判定する。   On the other hand, if it is determined in step S80 that the page layout has been determined for all the pages, the series of processes is terminated. In this case, when there is no unarranged block, it is determined that the page layout has been determined for all pages.

なお、上述では、ステップS76において相関が閾値thよりも高いと判定されたブロックを直接的に入れ替えに用いているが、これはこの例に限定されない。例えば、ページを跨ぐブロックの下に配置され、且つ、ページ内に収まると判定された対象ブロックが複数存在する場合も考えられる。このような場合に、当該対象ブロック全てについて、ページを跨ぐブロックの直上のブロックとの相関を求め、最も相関の高いブロックを選択して入れ替えに用いてもよい。   In the above description, the block whose correlation is determined to be higher than the threshold th in step S76 is used directly for replacement, but this is not limited to this example. For example, there may be a case where there are a plurality of target blocks that are arranged under blocks that cross the page and are determined to fit within the page. In such a case, for all the target blocks, the correlation with the block immediately above the block across the pages may be obtained, and the block with the highest correlation may be selected and used for replacement.

このように、本第5の実施形態では、ステップS74でブロックの高さhに基づきブロックの入れ替えが可能だと判断されても、入れ替えられたブロックと当該ブロックの直上に配置されるブロックとの相関が低いと判定されると、その入れ替えを行わない。これにより、ブロックの入れ替えによって内容的に無関係のブロックが配置されることが抑制される。   As described above, in the fifth embodiment, even if it is determined in step S74 that the block can be replaced based on the height h of the block, the replaced block and the block arranged immediately above the block are If it is determined that the correlation is low, the replacement is not performed. As a result, it is possible to suppress disposition of blocks that are irrelevant in content due to block replacement.

なお、上述した各実施形態による画像処理装置100で実行される画像処理プログラムは、インストール可能な形式又は実行可能な形式のファイルでCD−ROM、フレキシブルディスク(FD)、CD(Compact Disk)、DVD(Digital Versatile Disk)等のコンピュータで読み取り可能な記録媒体に記録されて提供される。   The image processing program executed by the image processing apparatus 100 according to each of the above-described embodiments is a file in an installable format or executable format, and is a CD-ROM, flexible disk (FD), CD (Compact Disk), DVD. (Digital Versatile Disk) provided by being recorded on a computer-readable recording medium.

また、上述した各実施形態による画像処理装置100で実行される画像処理プログラムを、インターネットなどのネットワークに接続されたコンピュータ上に格納し、ネットワーク経由でダウンロードさせることにより提供するように構成しても良い。また、上述した各実施形態による画像処理装置100で実行される画像処理プログラムをインターネットなどのネットワーク経由で提供または配布するように構成しても良い。   Further, the image processing program executed by the image processing apparatus 100 according to each embodiment described above may be provided by being stored on a computer connected to a network such as the Internet and downloaded via the network. good. The image processing program executed by the image processing apparatus 100 according to each embodiment described above may be provided or distributed via a network such as the Internet.

また、上述した各実施形態による画像処理装置100で実行される画像処理プログラムを、ROM等に予め組み込んで提供するように構成してもよい。   In addition, the image processing program executed by the image processing apparatus 100 according to each of the above-described embodiments may be provided by being incorporated in advance in a ROM or the like.

上述した各実施形態による画像処理装置100で実行される画像処理プログラムは、上述した最密充填レイアウトを生成するモジュールと、最密充填レイアウトに基づき各ページのレイアウトを生成するモジュールとを含むモジュール構成となっており、実際のハードウェアとしてはCPU101(プロセッサ)が例えばHDD105から画像処理プログラムを読み出して実行することにより、上述の各モジュールが主記憶装置(RAM104)上にロードされ、最密充填レイアウト生成モジュールと、ページレイアウト生成モジュールとが主記憶装置上に生成されるようになっている。   The image processing program executed by the image processing apparatus 100 according to each of the above-described embodiments includes a module that generates the above-described closest packing layout and a module that generates a layout of each page based on the closest packing layout. As actual hardware, the CPU 101 (processor) reads out and executes an image processing program from, for example, the HDD 105, whereby the above-described modules are loaded onto the main storage device (RAM 104), and the closest packing layout is obtained. A generation module and a page layout generation module are generated on the main storage device.

なお、上述では、本発明に適用可能な画像処理装置100が一般的なコンピュータとして構成されるように説明したが、これはこの例に限定されない。例えば、本発明による画像処理装置100は、コピー機能、プリンタ機能、スキャナ機能およびファクシミリ機能のうち少なくとも2つの機能を有する複合機に適用することができる。また、本発明による画像処理装置100は、複写機、プリンタ、スキャナ装置、ファクシミリ装置などの画像形成装置であれば何れにも適用することができる。   In the above description, the image processing apparatus 100 applicable to the present invention is described as being configured as a general computer, but this is not limited to this example. For example, the image processing apparatus 100 according to the present invention can be applied to a multifunction machine having at least two functions among a copy function, a printer function, a scanner function, and a facsimile function. Further, the image processing apparatus 100 according to the present invention can be applied to any image forming apparatus such as a copying machine, a printer, a scanner apparatus, and a facsimile apparatus.

11 画像入力部
12 画像出力部
100 画像処理装置
101 CPU
102 I/O部
105 HDD
200 配置領域
DESCRIPTION OF SYMBOLS 11 Image input part 12 Image output part 100 Image processing apparatus 101 CPU
102 I / O unit 105 HDD
200 placement area

特許第4047326号公報Japanese Patent No. 4047326 特開2005−275682公報JP 2005-275682 A 特開2006−259819公報JP 2006-259819 A 特開2007−150698公報JP 2007-150698 A 特開2007−11577公報JP 2007-11577 A

Claims (15)

幅と、所定の高さ毎に順序付けて区切られた領域からなるページ領域とが定義される配置領域に対して複数のコンテンツを配置して出力する画像処理方法であって、
前記配置領域の高さ方向に対して、コンテンツを、幅方向に一列に配置されるコンテンツのうち高さが最大のコンテンツの上端および下端からなる範囲内に配置すると共に、前記配置領域の幅を持ち、該高さが最大のコンテンツの上端および下端で高さが定義されるブロックを、前記配置領域の高さ方向の一方の端を先頭として、隣接する該ブロックと接するように順次配置し、
前記配置領域の幅方向に対して、コンテンツを、隣接するコンテンツと接すると共に該配置領域の幅を超えず、且つ、全コンテンツが配置された際の前記ブロックによる全体の高さが近似的に最小となるように配置する最密充填レイアウト生成ステップと、
前記最密充填レイアウト生成ステップにより、前記ブロックが前記ページ領域を跨いで配置されている場合に、該ページ領域を跨いだ該ブロックを、該ブロックが跨ぐページ領域のうち順序が後以降のページ領域に移動させてブロックの再配置を行う最終レイアウト生成ステップと
を有する
ことを特徴とする画像処理方法。
An image processing method for arranging and outputting a plurality of contents with respect to an arrangement area in which a width and a page area composed of areas divided in order for each predetermined height are defined,
With respect to the height direction of the arrangement area, the content is arranged within a range consisting of the upper end and the lower end of the maximum content among the contents arranged in a row in the width direction, and the width of the arrangement area is set. The blocks whose height is defined at the upper and lower ends of the content having the maximum height are sequentially arranged so as to be in contact with the adjacent blocks, starting from one end in the height direction of the arrangement area,
With respect to the width direction of the placement area, the content touches the adjacent content and does not exceed the width of the placement area, and the overall height by the block when all the contents are placed is approximately minimum. A close-packed layout generation step to arrange so that
When the block is arranged across the page area by the close-packed layout generation step, the block that straddles the page area is changed to a page area after the order in the page area that the block straddles. And a final layout generation step of rearranging the blocks after moving to the image processing method.
前記最密充填レイアウト生成ステップは、
前記コンテンツを高さの高い順に順序付ける順序付けステップと、
配置対象の全コンテンツのうち前記順序付けステップにより最も高さが高いと順序付けられたコンテンツを、前記配置領域の幅方向の一方の端と、高さ方向の一方の端とに接するように配置する第1の配置ステップと、
前記順序付けステップにより未配置のコンテンツのうち最も高さが高いと順序付けられたコンテンツを、直前に配置されたコンテンツが属する前記ブロック内に他のコンテンツと重ならずに配置可能か否かを判定する判定ステップと、
前記判定ステップにより配置可能であると判定された場合に、前記未配置のコンテンツのうち最も高さが高いと順序付けされたコンテンツを前記直前に配置されたコンテンツが属するブロック内に該直前に配置されたコンテンツに接するように配置し、
前記判定ステップにより配置可能ではないと判定された場合に、前記未配置のコンテンツのうち最も高さが高いと順序付けされたコンテンツを、前記直前に配置されたコンテンツが属するブロックに接し、且つ、前記幅方向の一方の端に接するように配置する第2の配置ステップと
を有する
ことを特徴とする請求項1記載の画像処理方法。
The close-packed layout generation step includes
An ordering step for ordering the content in descending order;
The content that is ordered as having the highest height in the ordering step among all the content to be arranged is arranged so as to be in contact with one end in the width direction of the arrangement region and one end in the height direction. 1 placement step;
It is determined whether or not the content ordered as having the highest height among the unallocated content in the ordering step can be arranged without overlapping other content in the block to which the content arranged immediately before belongs. A determination step;
If it is determined in the determination step that the content can be placed, the content ordered as having the highest height among the unplaced content is placed immediately before the content placed immediately before in the block to which the content is placed. Placed in contact with the content
When it is determined by the determination step that the content is not arrangeable, the content ordered as having the highest height among the unplaced content is in contact with the block to which the content placed immediately before belongs, and the The image processing method according to claim 1, further comprising: a second arrangement step of arranging so as to be in contact with one end in the width direction.
前記最終レイアウト生成ステップは、
前記ページ領域を跨いだブロックを、該ブロックが跨ぐページ領域のうち順序が後のページ領域の先頭に移動させると共に、該移動に伴い該ブロックより後ろに配置されるブロックの位置をずらしてブロックの再配置を行う
ことを特徴とする請求項1または請求項2に記載の画像処理方法。
The final layout generation step includes
The block straddling the page area is moved to the beginning of the page area in the order of the page area straddling the block, and the position of the block arranged behind the block is shifted with the movement. The image processing method according to claim 1, wherein rearrangement is performed.
前記最終レイアウト生成ステップは、
前記ページ領域を跨いだブロックの後ろに配置されたブロックから、高さが該ページ領域を跨いだブロックの直上に配置されたブロックの下端と、該ページ領域の下端との間による高さ以下のブロックを検索し、検索された該ブロックと、該ページ領域を跨いだブロックとを入れ替えてブロックの再配置を行う
ことを特徴とする請求項1または請求項2に記載の画像処理方法。
The final layout generation step includes
From the block arranged behind the block across the page area, the height is equal to or less than the height between the lower end of the block arranged immediately above the block across the page area and the lower end of the page area 3. The image processing method according to claim 1, wherein the block is searched, and the block that has been searched and the block that crosses the page area are replaced to perform block rearrangement.
コンテンツの内容を解析してコンテンツ間の相関を求める解析ステップをさらに有し、
前記最終レイアウト生成ステップは、
前記解析ステップで求められた、前記検索されたブロックと前記ページ領域を跨いだブロックとの前記相関に基づき前記入れ替えを行うブロックを選択する
ことを特徴とする請求項4に記載の画像処理方法。
An analysis step for analyzing the contents of the content to obtain a correlation between the contents;
The final layout generation step includes
5. The image processing method according to claim 4, wherein the block to be replaced is selected based on the correlation between the searched block and the block across the page area, which is obtained in the analysis step.
前記最終レイアウト生成ステップは、
前記検索によって複数のブロックが得られた場合に、検索された該複数のブロックのうち、前記解析ステップで求められた、前記ページ領域を跨いだブロックとの相関が最も高いブロックを、前記入れ替えを行うブロックに決定する
ことを特徴とする請求項5に記載の画像処理方法。
The final layout generation step includes
When a plurality of blocks are obtained by the search, the block having the highest correlation with the block straddling the page area obtained in the analysis step among the plurality of searched blocks is replaced. 6. The image processing method according to claim 5, wherein a block to be performed is determined.
前記最終レイアウト生成ステップは、
コンテンツを該コンテンツに指定された範囲内で変形させる変形ステップを有し、
前記ページ領域を跨いだブロック内のコンテンツを前記変形ステップにより前記範囲内で変形させ、該コンテンツの変形に伴い該ブロックを変形させて該ブロックの高さの調整を行ったときに、該高さの調整後の該ページ領域を跨いだブロックが前記ページ領域に収まらない場合に、該ページ領域を跨いだブロックの前記移動を行う
ことを特徴とする請求項1乃至請求項6の何れか1項に記載の画像処理方法。
The final layout generation step includes
A transformation step for transforming the content within the range specified for the content;
When the content in the block across the page area is deformed within the range by the deformation step, and the height of the block is adjusted by deforming the block as the content is deformed. 7. The movement of a block straddling the page area is performed when a block straddling the page area after adjustment does not fit in the page area. 8. An image processing method described in 1.
前記変形ステップが行う前記変形は、前記コンテンツに対する縮小処理である
ことを特徴とする請求項7に記載の画像処理方法。
The image processing method according to claim 7, wherein the deformation performed by the deformation step is a reduction process for the content.
前記変形ステップが行う前記変形は、前記コンテンツのアスペクト比の変更処理である
ことを特徴とする請求項7に記載の画像処理方法。
The image processing method according to claim 7, wherein the deformation performed by the deformation step is a process of changing an aspect ratio of the content.
前記最終レイアウト生成ステップは、
前記ブロック内でコンテンツの幅方向の配置を調整するステップを有する
ことを特徴とする請求項1乃至請求項9の何れか1項に記載の画像処理方法。
The final layout generation step includes
The image processing method according to claim 1, further comprising a step of adjusting an arrangement of contents in a width direction in the block.
前記最終レイアウト生成ステップは、
前記ページ領域内にブロックが配置されない空白領域を前記ページ領域のそれぞれで均一化するように、前記ブロックを該ページ領域間で移動させるステップをさらに有する
ことを特徴とする請求項1乃至請求項10の何れか1項に記載の画像処理装置。
The final layout generation step includes
11. The method according to claim 1, further comprising a step of moving the blocks between the page areas so that a blank area in which no blocks are arranged in the page area is uniformized in each of the page areas. The image processing apparatus according to any one of the above.
前記最終レイアウト生成ステップは、
前記ページ領域の再下段に配置されるブロックの下辺と該ページ領域の下辺との間の空白部を分割して、該ページ領域内に配置される各ブロック間にそれぞれ配置するステップをさらに有する
ことを特徴とする請求項1乃至請求項10の何れか1項に記載の画像処理方法。
The final layout generation step includes
The method further comprises a step of dividing a blank portion between a lower side of the block arranged in the lower stage of the page area and a lower side of the page area, and arranging the divided portion between the blocks arranged in the page area. The image processing method according to claim 1, wherein:
幅と、所定の高さ毎に順序付けて区切られた領域からなるページ領域とが定義される配置領域に対して複数のコンテンツを配置して出力する画像処理装置であって、
前記配置領域の高さ方向に対して、コンテンツを、幅方向に一列に配置されるコンテンツのうち高さが最大のコンテンツの上端および下端からなる範囲内に配置すると共に、前記配置領域の幅を持ち、該高さが最大のコンテンツの上端および下端で高さが定義されるブロックを、前記配置領域の高さ方向の一方の端を先頭として、隣接する該ブロックと接するように順次配置し、
前記配置領域の幅方向に対して、コンテンツを、隣接するコンテンツと接すると共に該配置領域の幅を超えず、且つ、全コンテンツが配置された際の前記ブロックによる全体の高さが近似的に最小となるように配置する最密充填レイアウト生成手段と、
前記最密充填レイアウト生成手段により、前記ブロックが前記ページ領域を跨いで配置されている場合に、該ページ領域を跨いだ該ブロックを、該ブロックが跨ぐページ領域のうち順序が後以降のページ領域に移動させてブロックの再配置を行う最終レイアウト生成手段と
を有する
ことを特徴とする画像処理装置。
An image processing apparatus that arranges and outputs a plurality of contents with respect to an arrangement area in which a width and a page area composed of areas divided in order for each predetermined height are defined,
With respect to the height direction of the arrangement area, the content is arranged within a range consisting of the upper end and the lower end of the maximum content among the contents arranged in a row in the width direction, and the width of the arrangement area is set. The blocks whose height is defined at the upper and lower ends of the content having the maximum height are sequentially arranged so as to be in contact with the adjacent blocks, starting from one end in the height direction of the arrangement area,
With respect to the width direction of the placement area, the content touches the adjacent content and does not exceed the width of the placement area, and the overall height by the block when all the contents are placed is approximately minimum. A close-packed layout generating means arranged so that
When the block is arranged across the page area by the close-packed layout generation unit, the block that straddles the page area is changed to a page area that is later in order among the page areas that the block straddles. An image processing apparatus comprising: final layout generation means for rearranging blocks after being moved to
幅と、所定の高さ毎に順序付けて区切られた領域からなるページ領域とが定義される配置領域の高さ方向に対して、コンテンツを、幅方向に一列に配置されるコンテンツのうち高さが最大のコンテンツの上端および下端からなる範囲内に配置すると共に、前記配置領域の幅を持ち、該高さが最大のコンテンツの上端および下端で高さが定義されるブロックを、前記配置領域の高さ方向の一方の端を先頭として、隣接する該ブロックと接するように順次配置し、
前記配置領域の幅方向に対して、コンテンツを、隣接するコンテンツと接すると共に該配置領域の幅を超えず、且つ、全コンテンツが配置された際の前記ブロックによる全体の高さが近似的に最小となるように配置する最密充填レイアウト生成ステップと、
前記最密充填レイアウト生成ステップにより、前記ブロックが前記ページ領域を跨いで配置されている場合に、該ページ領域を跨いだ該ブロックを、該ブロックが跨ぐページ領域のうち順序が後以降のページ領域に移動させてブロックの再配置を行う最終レイアウト生成ステップと
をコンピュータに実行させるプログラム。
The content is the height of the content arranged in a row in the width direction with respect to the height direction of the placement region in which the width and the page region consisting of regions divided in order for each predetermined height are defined. Is placed within the range consisting of the top and bottom edges of the largest content, and the block having the width of the placement area and having the height defined by the top and bottom edges of the largest content is placed in the placement area. Place one end in the height direction as the head, and sequentially arrange so as to contact the adjacent block,
With respect to the width direction of the placement area, the content touches the adjacent content and does not exceed the width of the placement area, and the overall height by the block when all the contents are placed is approximately minimum. A close-packed layout generation step to arrange so that
When the block is arranged across the page area by the close-packed layout generation step, the block that straddles the page area is changed to a page area after the order in the page area that the block straddles. A program for causing a computer to execute a final layout generation step of rearranging blocks by moving to a position.
請求項14に記載のプログラムを記憶したコンピュータ読み取り可能な記憶媒体。   A computer-readable storage medium storing the program according to claim 14.
JP2009061863A 2009-03-13 2009-03-13 Image processing method, image processing apparatus, program, and storage medium Expired - Fee Related JP5287384B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009061863A JP5287384B2 (en) 2009-03-13 2009-03-13 Image processing method, image processing apparatus, program, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009061863A JP5287384B2 (en) 2009-03-13 2009-03-13 Image processing method, image processing apparatus, program, and storage medium

Publications (2)

Publication Number Publication Date
JP2010219686A true JP2010219686A (en) 2010-09-30
JP5287384B2 JP5287384B2 (en) 2013-09-11

Family

ID=42978079

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009061863A Expired - Fee Related JP5287384B2 (en) 2009-03-13 2009-03-13 Image processing method, image processing apparatus, program, and storage medium

Country Status (1)

Country Link
JP (1) JP5287384B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015518590A (en) * 2012-03-06 2015-07-02 アップル インコーポレイテッド Application for generating journals
JP2017143326A (en) * 2016-02-08 2017-08-17 ブラザー工業株式会社 Image reader, image processing system and image processing program
US10062004B2 (en) 2015-08-20 2018-08-28 Kabushiki Kaisha Toshiba Arrangement detection apparatus and pickup apparatus
JP2021020316A (en) * 2019-07-24 2021-02-18 富士ゼロックス株式会社 Image processing device and information processing program

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0439078A (en) * 1990-06-04 1992-02-10 Fujitsu Ltd Information printing method
JPH1074265A (en) * 1996-08-30 1998-03-17 Canon Inc Printing control device, its method and storage medium storing printing control program
JPH11127343A (en) * 1997-06-09 1999-05-11 Eastman Kodak Co Digital image of variable dimension and method for optimizing filling to editing medium with specification of dimension ratio
JP2004175095A (en) * 2002-10-04 2004-06-24 Fuji Xerox Co Ltd Device and method for forming image
JP2004282732A (en) * 2003-03-03 2004-10-07 Hewlett-Packard Development Co Lp Image layout on page
JP2005275682A (en) * 2004-03-24 2005-10-06 Seiko Epson Corp Printing controller, printing control method and printing control program
JP4047326B2 (en) * 2004-11-25 2008-02-13 キヤノン株式会社 Layout device, layout method, and program
JP2009021712A (en) * 2007-07-10 2009-01-29 Canon Inc Image processing unit and control method thereof

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0439078A (en) * 1990-06-04 1992-02-10 Fujitsu Ltd Information printing method
JPH1074265A (en) * 1996-08-30 1998-03-17 Canon Inc Printing control device, its method and storage medium storing printing control program
JPH11127343A (en) * 1997-06-09 1999-05-11 Eastman Kodak Co Digital image of variable dimension and method for optimizing filling to editing medium with specification of dimension ratio
JP2004175095A (en) * 2002-10-04 2004-06-24 Fuji Xerox Co Ltd Device and method for forming image
JP2004282732A (en) * 2003-03-03 2004-10-07 Hewlett-Packard Development Co Lp Image layout on page
JP2005275682A (en) * 2004-03-24 2005-10-06 Seiko Epson Corp Printing controller, printing control method and printing control program
JP4047326B2 (en) * 2004-11-25 2008-02-13 キヤノン株式会社 Layout device, layout method, and program
JP2009021712A (en) * 2007-07-10 2009-01-29 Canon Inc Image processing unit and control method thereof

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
CSNG200501086005; 今堀 慎治: '切出し・詰込み問題とその応用' 経営の科学 オペレーションズ・リサーチ 第50巻 第5号 Communications of the Operations Research 第50巻, 社団法人日本オペレーションズ・リサーチ学会 *
JPN6013001303; 今堀 慎治: '切出し・詰込み問題とその応用' 経営の科学 オペレーションズ・リサーチ 第50巻 第5号 Communications of the Operations Research 第50巻, 社団法人日本オペレーションズ・リサーチ学会 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015518590A (en) * 2012-03-06 2015-07-02 アップル インコーポレイテッド Application for generating journals
US10062004B2 (en) 2015-08-20 2018-08-28 Kabushiki Kaisha Toshiba Arrangement detection apparatus and pickup apparatus
JP2017143326A (en) * 2016-02-08 2017-08-17 ブラザー工業株式会社 Image reader, image processing system and image processing program
JP2021020316A (en) * 2019-07-24 2021-02-18 富士ゼロックス株式会社 Image processing device and information processing program
JP7318387B2 (en) 2019-07-24 2023-08-01 富士フイルムビジネスイノベーション株式会社 Image processing device, information processing program

Also Published As

Publication number Publication date
JP5287384B2 (en) 2013-09-11

Similar Documents

Publication Publication Date Title
JP6119689B2 (en) Electronic document generation system, electronic document generation apparatus and program
JP4483909B2 (en) Translation apparatus and program
US20120166934A1 (en) Information processing apparatus, layout generating method, and computer program product
JP5915628B2 (en) Image forming apparatus, text data embedding method, and embedding program
JP5287384B2 (en) Image processing method, image processing apparatus, program, and storage medium
JP2007317034A (en) Image processing apparatus, image processing method, program, and recording medium
US8780404B2 (en) Information processing apparatus, method for controlling same, and storage medium on which computer program has been recorded
JP5629509B2 (en) Information processing apparatus, information browsing apparatus, information processing method, and program
JP2015170982A (en) Image processor
JP5622787B2 (en) Image processing apparatus and program
US8749834B2 (en) Information processing apparatus that perform margin reduction depending on the column group structure, method for controlling same, and storage medium on which computer program has been recorded
JP5003606B2 (en) Image processing device
JP5881937B2 (en) Information processing apparatus, information processing method, and program
JP5028980B2 (en) Document editing apparatus and program
JP5098614B2 (en) Method for controlling sentence processing apparatus and sentence processing apparatus
JP2016045896A (en) Display control device, display device, program, and recording medium
JP5298997B2 (en) Document image editing apparatus, document image editing method, document image editing program, and computer-readable recording medium storing a program for causing a computer to execute the method
JP5338586B2 (en) Image processing apparatus, image processing system, and image processing program
JP2012014488A (en) Information processing apparatus, information processing method, and program
JP2008197451A (en) Extraction method, extraction device, and program
JP6281329B2 (en) Image processing device
JP2006262445A (en) Image processing apparatus and method
JP4288972B2 (en) Layout system, layout support system, layout support program, and layout support method
JP2011141613A (en) Image processing apparatus, image processing system, image processing program, and storage medium
JP2011065295A (en) Apparatus, system and program for processing image

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120130

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120620

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20121228

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130122

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130325

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130520

LAPS Cancellation because of no payment of annual fees