JP3617145B2 - Plotter - Google Patents

Plotter Download PDF

Info

Publication number
JP3617145B2
JP3617145B2 JP27215295A JP27215295A JP3617145B2 JP 3617145 B2 JP3617145 B2 JP 3617145B2 JP 27215295 A JP27215295 A JP 27215295A JP 27215295 A JP27215295 A JP 27215295A JP 3617145 B2 JP3617145 B2 JP 3617145B2
Authority
JP
Japan
Prior art keywords
color
unit
data
value
rule
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.)
Expired - Lifetime
Application number
JP27215295A
Other languages
Japanese (ja)
Other versions
JPH09114958A (en
Inventor
直樹 林
一夫 澁田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujifilm Business Innovation Corp
Original Assignee
Fuji Xerox Co Ltd
Fujifilm Business Innovation Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuji Xerox Co Ltd, Fujifilm Business Innovation Corp filed Critical Fuji Xerox Co Ltd
Priority to JP27215295A priority Critical patent/JP3617145B2/en
Priority to US08/730,761 priority patent/US5798766A/en
Publication of JPH09114958A publication Critical patent/JPH09114958A/en
Application granted granted Critical
Publication of JP3617145B2 publication Critical patent/JP3617145B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、図形を扱えるワードブロセッサや、ディジタル複写機など、ディジタル画像情報を加工する電子的な作図を行うための作図装置に関するものである。
【0002】
【従来の技術】
近年、ワードプロセツサなどでグラフィカルUI(ユーザインタフェース)を利用して、エンドユーザが電子的に作図をすることが一般的になった。また、カラースキャナやカラープリンタを含むコンピュータシステムの普及により、グラフィックデザイナだけではなく、一般ユーザでもカラーの図が作成できる環境ができつつある。カラーの図は白黒に較べて訴求力が高いので、顧客への提案書やプレゼンテーションのために、美しく分かりやすい図を容易に作成したいというユーザのニーズは高い。
【0003】
美しく分かりやすい図を作る場合、図のどの部分にどのような色を用いるかが重要になる。適切な配色が行われないと、カラーにすることでかえって見づくなるからである。
【0004】
ワードプロセッサやグラフィックソフトウェア、あるいは、カラー編集機能を持つディジタル複写機などにおいて、電子的にカラーの作図をするため用いられてきた従来の手法では、ユーザが図の要素や領域を直接指定し、それに対してどのような色を用いるかを直接指示するという操作を繰り返すことで、配色が行われる。従来の手法に基づくシステムで用意される編集操作系は、個々の図の要素の位置や大きさや色を直接的にユーザが指定するものになっている。
【0005】
しかしながら、グラフィックデザイナではない一般ユーザの場合、従来の手法を用いて図の配色を決めるのは困難である。なぜなら、配色は、ある部分の色と他の部分の色との関係によって決まるものであり、全体のバランスを考えて個々の部分の色を決めなければならないからである。一般ユーザの場合、仕上がりの配色を色づけ作業の前にイメージすることは困難であるため、従来の手法を用いると、個々の部分の色を場当たり的に決めてしまい、最終的に見づらい配色にしてまうことが多い。特に、多様に配置される図の要素の配色を従来の手法で行うことは、一般ユーザにとって著しく困難であった。
【0006】
【発明が解決しようとする課題】
本発明は、上述した事情に鑑みてなされたもので、ユーザが電子的に作図する際に、あるいは、白黒の図からカラーの図を電子的に生成する際に、適切な配色が施された図を簡易に生成できる作図装置を提供することを目的とするものである。
【0007】
【課題を解決する手段】
本発明では、以上の目的を達成するために、図を構成する要素の位置関係に応じて、上記要素に割り当てる色を決定する複数の配色規則に関する情報を記憶する記憶手段と、上記配色規則に応じた配色パターンを表示する手段と、作図対象の図に対して配色規則を指定する手段と、指定された上記配色規則に基づいて上記記憶手段を参照し、上記作図対象の図の要素の色を決定する手段と、上記作図対象の図の要素について決定された色に応じて、色付けの施された上記作成対象の図を表す画像情報を生成する手段とを、作図装置に設けている。
【0008】
この構成によれば、ユーザは配色パターンを実際に見ながら、配色規則を決定することができ、よりユーザの目的に合致した図を生成することができる。この場合、作図目標等と配色パターンとを対応づけて表示すれば、ユーザは、より一層配色の選択を容易に行える。
【0009】
また上記配色パターンを割り当てる上記図の要素は、所定の種類の要素のみとし、他の種類の要素は位置関係に係わらず所定の色を割り当てるようにしてもよい。そして上記記憶する手段が、上記配色規則の情報の他に、上記配色パターンを割り当てない種類の要素の色を規定するデータをも記憶し、作図目標等、図の特徴に応じて、一部の種類の要素の配色パターンと他の種類の要素の色とを決定するようにしてもよい。
【0010】
また上記記憶する手段が、上記配色規則と、上記要素の形状との対応関係を規定するデータをも記憶し、作図目標等、図の特徴に応じて、要素の形状が自動的に決定するようにしてもよい。
【0011】
また、この発明では、上述目的を達成するために、図を構成する要素の位置関係に応じて、上記要素に割り当てる色を決定する複数の配色規則に関する情報を記憶する記憶手段と、作図対象の図に対して配色規則を指定する手段と、上記作図対象の図の原図となる無彩色または単一色の原図画像であって、所定の要素に色マークの付されたものを光学的に読み取り、原図画像情報を生成する手段と、指定された上記配色規則に基づいて上記記憶手段を参照し、上記原図画像情報に基づいて、上記原図画像の上記色マークの付された要素の色を決定する手段と、上記作図対象の図の要素について決定された色および上記原図画像情報に応じて、色付けの施された上記作成対象の図を表す画像情報を生成する手段とを、作図装置に設けている。
【0012】
この構成によれば、たとえば白黒の画像に色マークを付して処理するだけで、適切に配色の施されたカラー画像を簡易に得ることができる。
【0013】
【発明の実施の形態】
以下、この発明の実施例の作図装置について図面を説明する。
[実施例1]
まず実施例1について説明する。この実施例では、入力用紙にラフなスケッチを描き、これを光学的に読み込ませ、合わせて配色を指定し、これにより、配色バランスのとれた見栄えのよい図を生成するものである。ここでは、この作図装置の構成や動作を説明する前に、この作図装置を用いてどのように作図を行うかにその操作の全体の流れを説明しておく。
【0014】
この実施例では、格子が印刷された紙(入力用紙111)に、カラーマーカーペンで図を描く。図を描いてある入力用紙を光学的に読み込む。これと同時に、タッチパネル上の選択肢から図の配色を選択すると、これに基づいて配色が施されたカラー原稿が出力される。
【0015】
この実施例では、図の要素として「囲み」、「矢印」、「テキスト」の3種類がある。「囲み」は、丸や四角など、ユーザが入力用紙の上で閉曲線で描いたものである。「矢印」は、−>の形に描かれるものである。「テキスト」は、図に書き込んだ文字列である。
【0016】
この実施例では、図を描くためのカラーマーカーペンが与えられている。カラーマーカーペンは、「囲み用」、「矢印用」、「テキスト用」といった図の要素の種類ごとに与えられており、用途ごとに色が違う。システムは、この色の違いを利用して、要素の種類を検出する。
【0017】
入力用紙に印刷された格子の色も、カラーマーカーペンの色とは異なる。ユーザには、格子を基準にしてカラーマーカーペンで図を描いてもらう。図の要素と格子の色が違うことを利用して、要素と格子とを個別に認識し、要素の位置関係を格子を基準にして検出する。
【0018】
つぎに、実施例の作図装置の構成を説明する。なお、この作図装置は、専用のワードプロセッサ、デジタル複写機や、汎用のパーソナルコンピュータ、ワークステーション、あるいはホストのソフトウェアとして実現できる。
【0019】
図1はこの作図装置を全体として示すもので、この図において、作図装置は、原稿読み取り部112および配色選択部109を有し、ユーザの各種指示を受け付けるようになっている。原稿読み取り部112は入力用紙111にマーキング操作を行って作成した原稿を読みとるものである。ユーザの指示は、実行部、すなわち、要素データ変更部102、座標データ変更部121、図印刷部123、格子検出部114、囲み検出部115、矢印検出部116、テキスト検出部117、色設定部118、形状設定部119、向き変更部120等で実行される。処理制御部124は全体の制御を統括する。
【0020】
各部の実行に際しては、記憶部すなわち要素データ保持部101、座標データ保持部103、方位距離設定ルール保持部104、色設定ルール保持部105、形状設定ルール保持部106、配色選択肢保持部107、選択肢−設定ルール対応保持部108、処理対象画像保持部113が各種データを記憶する。そして生成中の図はその都度、画面表示部122に表示され、最終的に生成された図が図印刷部123により印刷される。
【0021】
以下、各部の構成を詳細に説明する。
【0022】
[要素データ保持部101]
要素データ保持部101は、図の要素ごとに、その形状、色、配置に関する情報を保持する機能を持つ。この実施例では、図の要素に関する属性データを表形式で保持する。表は、属性と属性値の組を対応づけたものである。要素毎に一つの表が作られ、その表をシステム内で一意に識別するためのIDがふられる。以下、各属性について説明する。
【0023】
属性には、「位置」、「色」、「形状」、「テキスト」および「表示順序」がある。属性「位置」は、その要素の2次元平面上の位置を示す。属性値として、後述する配置可能座標の座標IDをとる。属性「色」は、その要素の色を示す。属性値として、国際照明学会が定めたスケールであるL*a*b*でその要素の色を表現した値をとる。属性「形状」は、その要素の形状を示す。属性値として、ページ記述言語のPostScript(米国アドビ・システムズ社の商標)でその要素の形状を記述した値をとる。属性「テキスト」は、要素種類がテキストの場合に、その内容を示す。属性値として、カラービットマップデータをとる。属性「表示順序」は、その要素が何番目に表示されるかを示す。この実施例では、描画は上書きで行われるので、要素が重なった場合は表示順序が後のものが手前に見える。属性値として、一意の正数値をとる。
【0024】
[要素データ変更部102]
要素データ変更部102は、他の機能部からの命令に応じて、要素データ保持部が保持する情報を変更する機能を持つ。図の要素の生成、すなわち新たな表の生成は、他の機能部から送られる命令によって行われる。この命令を受けると、まず新たな一つの表を要素データ保持部101中に作る。この時点での各属性の値は、次のようになる。
*属性「色」、「形状」、「テキスト」はnil。
*属性「表示順序」は、この時点で要素データ保持部101に存在する表が持つ、この属性値の最大値に1を加えた値。
【0025】
生成命令の結果として、新たに作った表のIDを返す。
【0026】
属性「色」、「形状」、「テキスト」の属性値設定については、直接代入命令が用意されている。この代入命令は、引数として、表のIDと代入する属性と、代入する値とを取る。この命令を受け取ると、この機能部は、要素データ保持部101に保持された表から、引数で渡されたIDを持つものを探し、その表の属性値を渡された値に従って置き換える。
【0027】
属性「色」については、属性値を変更する命令として、明度/彩度/色相の相対的変更命令が用意されている。この変更命令は、引数として、表のIDと現在の値に対する変化量を取る。表のIDは、前述の属性値設定と同様に、代入先を調べるために用いる。変化量は実数値で、色相変更のみ単位がラジアンの値である。明度の変更は、現在のL*値に対して変化量が加算される。彩度および色相の変更は、現在のa*値とb*値から彩度および色相を計算し、これに変化量を加算した後、加算後の値をa*値とb*値に割り振る計算を行う。なお、色相の変化量に関して、a−b座標系(aを機軸、bを縦軸)で時計回りを「プラス変化」の向きとする。
【0028】
属性「形状」については、属性値を変更する命令として、大きさ/向きの変更命令が用意されている。この変更命令は、引数として、表のIDと実数値を取る。表のIDは、前述の属性値設定と同様に、代入先を調べるために用いる。大きさの変更は、与えられた実数値を、単位をパーセントとした長さに対する倍率として扱い、この値に応じた大きさになるように現在の属性値を変更する。向きの変更は、与えられた実数値を、度を単位とした回転量として扱い、この値に応じて向きが変わるように現在の属性値を変更する。なお、向きの変更は相対的な変更であり、原稿の上に対する時計回りを「プラス変化」の向きとする。
【0029】
なお、前記の変更命令の指定方法として、表のIDの代わりに要素種類を指定すると、もう一つの引数の値に基づく変更がその種類の要素すべてに対して行われる。
【0030】
[座標データ保持部103]
座標データ保持部103は、図の要素を配置可能な、2次元平面上の座標に関する情報を保持する機能を持つ。この実施例では、配置可能な座標の数は、入力用紙に印刷された格子の格子点の数に一致する。ある座標のデータは、座標IDと、その座標の2次元上での位置を示す値とからなる。座標IDは、座標を一意に識別するためものである。この実施例では、{1,1}といった、2元の正数値の組で表わす。
【0031】
位置を示す値は、他の座標点を測定対象として、これに対する方位と距離で示される。測定対象となる座標点は一点であり、これを座標IDで示す。方位は、測定対象が自身からみてどの方向にあるかを示すものであり、印刷時に上になる方向を0度として時計回りの角度で示される。距離は、印刷の単位である、ポイントを単位とした非負の整数値で示される。位置を示す値の概念図を図2に示す。例えば、図2の左上の座標点{1,2}は座標点{1,1}を測定対象(基準)として、135度の方位であり、距離は102ポイントである。
【0032】
[方位距離初期化ルール保持部104]
方位距離初期化ルール保持部104は、座標データを初期化するルールを保持する。この実施例では、C言語に似た文法を持つプログラムにより、逐次的手順として記述されている。この初期化ルールは、座標の配置が等間隔となり、全体として格子状の構図をなすものである。初期化のルール(rule_1(dis_val))では、すべての座標で、隣の格子点との距離がdis_valの値に設定される。初期化ルールは以下のように記述される(C言語に類する態様で)。初期化ルールにより実行される動作を図3に示す。図の記述は容易に理解できるためとくに説明は行わない。
【0033】
【表1】

Figure 0003617145
ここで、関数point_data({i,j})はシステム定義であり、座標IDが{i,j}の座標データヘアクセスするためのポインタを返す。これにより、p−>position−>angleのように、座標データの各属性値を参照/代入することができる。また、XPOINTMAX,YPOINTMAXは、配置可能座標の第1元、第2元の最大数を示すマクロである。また、関数reset_reference({i,j})は、方位/距離設定の基準点となる座標を座標ID{i,j}にし、この座標から測定対象の繋がりを木状に展開するシステム定義関数である。測定対象の変更に従って、距離と方位は、座標の配置がこの関数が適用される前と変わらないように、適切に設定される。座標ID{l,m}での「測定対象」の設定は次の通り。
*l<iかつm=jのとき、「測定対象」は座標ID{l+1,m}
*l>iかつm=jのとき、「測定対象」は座標ID{l−1,m}
*m>jのとき、「測定対象」は座標ID{l,m−1}
*m<jのとき、「測定対象」は座標ID{l,m+1}
これらのシステム定義関数とマクロは、後述する座標データ変更部121で定義されている。
【0034】
[色設定ルール保持部105]
色設定ルール保持部105は、要素の配色に関する規則を保持する機能を持つ。この実施例では、要素の属性「色」に設定されるL*a*b*の値と、その色を表わす言葉(赤や青など)とを対応づけた組からなる表によって、ルールを保持している。
【0035】
[形状設定ルール保持部106]
形状設定ルール保持部106は、要素の形状に関する規則を保持する機能を持つ。「形状」については、要素属性「形状」に設定されるPostScriptプログラムと、その形状が示す言葉(円柱や鏃など)とを対応づけた組からなる表を持つ。各PostScriptプログラムで記述されている画像の大ささには、基準が設けられている。ここでは、144ポイント×144ポイント(すなわち2インチ四方)の正方形に収まるものに規定されている。個々の図の要素の実際の大きさは、入力用紙の格子の間隔と選択された規則に応じて、この正方形を拡大または縮小することで決まる。
【0036】
また、各PostScriptプログラムで記述されている、矢印要素として用いられる画像については、上向きに矢が指しているように規定されている。個々の矢印要素の矢印方向は、選択された規則に応じて、この画像を回転させることで決まる。
【0037】
[配色選択肢保持部107]
配色選択肢保持部107は、配色の選択肢を保持する機能を持つ。この実施例では、ある配色は、IDと文字列と画像(ビットマップデータ)の組で表現される。IDは、各配色を各機能部が一意に識別するためのものであり、配色を示す文字列CCに一意な正数値を続けたものである(例えば、CC3)。文字列および画像は、ユーザがその配色を他のものと区別できる言葉および色づけパターンを示している。
【0038】
この実施例では、配色の選択肢を表形式のデータによって保持している。図4に、このデータの例を示す。
【0039】
[選択肢−設定ルール対応保持部108]
選択肢−設定ルール対応保持部108は、配色選択肢保持部107に保持された配色と、色設定ルール保持部105および形状設定ルール保持部106に保持される言葉との対応関係を保持する機能を持つ。
【0040】
この実施例では、配色のIDと言葉とを対応づけた表形式のデータを用いることで、対応関係を保持している。この実施例では、ある配色に対して、要素の種類ごとに異なった色づけや形状を取ることができるように、種類ごとに言葉が対応づけられている。また、「囲み」要素については、要素ごとに異なった色づけができるように、4種類の色が対応づけられている。図5に、図4の例に基づいた、このデータの例を示す。
【0041】
[配色選択部109]
配色選択部109は、ユーザの指示により、配色選択肢保持部107に保持された選択肢のうちから一つを選び、この結果を記憶する機能を持つ。また、他の機能部からの問合せに対して、指示の結果を知らせる機能を持つ。
【0042】
この実施例では、図6に示すような形式で、配色選択肢保持部107に保持された配色を画面表示部122へ表示させることができる。複数の選択肢は、スクロール可能なウインドウの中に表示される。
【0043】
ユーザが画面表示された配色の中から一つを選んだ場合、すなわち、図6において、配色を示す文字列と画像の組を選び(選ばれたものは太線で囲われる)、この後「OK」の領域を選択した場合、この機能部は、選ばれた配色のIDを調べる。
【0044】
[マーキング操作110]
原稿読み取り部112に読み取らせる入力用紙111に、図を描く操作である。この実施例では、複数の、互いに色が異なるカラーマーカーペンを用いる。カラーマーカーペンの色(以下、マーカー色と呼ぶ)は、「囲み用」、「矢印用」、「文字用」というように、図の要素の種類に一意に対応するように割当てられている。なお、この実施例ではマーカー色は白以外のものを用いている。
【0045】
[入力用紙111]
入力用紙111は、原稿読み取り部112に読み取らせる図を描くためのメディアの機能を持つ。入力用紙111上には、図の要素の位置関係を検出する際に用いられる格子が印刷されている。格子は、碁盤の目と同様に、直線が等間隔かつ直交して並んでいるものである。格子の色は、マーカー色とは異なる色である。なお、この実施例では、紙の色は白であり、格子の色は白以外のものを用いている。
【0046】
[原稿読み取り部112]
原稿読み取り部112は、処理対象となる白黒原稿を光学的にスキャンして、光の三原色であるR(赤)、G(緑)、B(青)に分解し、256階調のデジタルカラー画像データを生成して、処理対象画像保持部113にこのデータを保持させる。
【0047】
生成されるデジタルカラー画像データの1画素は、原稿上の0.0625mm四方(lmm2あたり16×16画素;解像度約400dpi)に相当する。一つの画素データは、24ビット(連続した3バイトデータ)で表わされる。24ビットの最初8ビットがRの256階調データ、真ん中の8ビットがGの256階調データ、最後の8ビットがBの256階調データを示す。すべてのビットが立っている時が白色、すべてのビットが立っていないときが黒色を示す(図7参照)。
【0048】
一回のスキャンで得られるデジタルカラー画像データは、A4一枚分に相当するもので、(3360×4752)個の連続した画素データで表わされる。画素データの順序は、画素データの原稿上の位置から一意に決まる。データの順序は、原稿の短辺方向に沿ったスキャンライン(CCDで実現)を長辺方向に動かすという、光学的スキャンに合わせたものである。A4を縦長に置いたときの言葉を使えば、先頭から3360番目までの画素データは、原稿の上端の画素を左から右に順番に並べたものであり、以下3360個のデータをー組にして、原稿の上から下に順番に4752組の画素データが並ぶ。
【0049】
[処理対象画像保持部113]
処理対象画像保持部113は、処理対象となるデジタルカラー画像データ(以下、処理対象画像と呼ぶ)を保持する。処理対象画像のデータサイズは、約46Mbyteである。
【0050】
[格子検出部114]
格子検出部114は、処理対象画像から格子を検出し、これに基づいて座標データ変更部121へ座標データの初期化を命令する機能を持つ。また、他の機能部からの命令により、処理対象画像中の特定の画素データ群に含まれる格子の情報を返す機能を持つ。この機能部は、入力用紙111に印刷された格子の色をあらかじめ測色して、画素データ形式に変換したものを記憶している。また、この色に対して、許容範囲にある値も記憶している。この情報を利用して、格子の検出を行う。
【0051】
一つの格子線は、原稿入力時のスキャンラインに平行か、直行する。したがって、図7に示した処理対象画像のデータ構造において、格子の色(許容値を含む)に一致する画素データ群について、そのアドレスの規則性を調べれば格子を抽出できる。
【0052】
この機能部は、原稿の左右方向の格子点の数、原稿の上下方向の格子点の数、格子点の間隔(単位はポイント)を検出することができる。また、ある画素データ群に対して、その画素データ群に含まれる格子点の数、および、縦または横の格子線の何番目から何番目までがその画素データ群に含まれるかを検出することができる。
【0053】
[囲み検出部115]
囲み検出部115は、処理対象画像から要素種類が「囲み」である要素を検出し、検出した要素に関わる情報を要素データ保持部101に新たに保持させる機能を持つ。要素の検出は処理制御部124からの命令によって行われる。一回の命令で、処理対象画像から、未検出の「囲み」要素をーつ検出する。後述のアルゴリズムで示すように、要素を検出した場合はnil以外の値を返し、未検出のものがない場合はnilを返す。
【0054】
この機能部は、「囲み用」のマーカー色をあらかじめ測色して、画素データ形式に変換したものを記憶している。また、この色に対して、許容範囲にある値も記憶している。この情報を利用して、「囲み」要素の検出を行う。
【0055】
この機能部では、次のアルゴリズムで処理が行われる。
[ステップ1] 処理対象画像の画素データに、色が「囲み用」のマーカー色(許容範囲を含む)に一致するものを、処理対象画像の先頭の画素データ(すなわち、原稿左上隅の画素)から順番に調べる。もし一致するものがあれば、この画素データのアドレスを「輪郭画素データアドレス」として記憶する。もしなければ、nilを返してこの機能部の処理を終了する。
[ステップ2] 要素データ変更部102へ、要素の生成命令を送る。返ってきた値を「新規要素ID」として記憶する。
[ステップ3] ステップ1で見つけた画素データに対して、原稿上でこれとつながって閉曲線をなしている、「囲み用」のマーカー色の画素データすべてを処理対象画像から探しだし、これらのアドレスを「輪郭画素データアドレス」に追加して記憶させる。
[ステップ4] 原稿上で「輪郭画素データアドレス」が示す閉曲線の内側にあたるすべての画素データを処理対象画像から探しだし、これらのアドレスと「輪郭画素データアドレス」のアドレスとを「囲み領域画素データアドレス」として記憶する。
[ステップ5] 格子検出部114に「囲み領域画素データアドレス」を渡して、原稿上でこれらが示す領域に縦の格子線が何番目から何番目まで入っているかを調べさせ、結果を「縦線範囲」として記憶する。
[ステップ6] 格子検出部114に「囲み領域画素データアドレス」を渡して、原稿上でこれらが示す領域に横の格子線が何番目から何番目まで入っているかを調べさせ、結果を「横線範囲」として記憶する。
[ステップ7] 「縦線範囲」と「横線範囲」が原稿上で示す長方形の中心点に最も近い格子点を一つ見つける。この格子点が、左からX番目の縦線と、下からY番目の横線の交差点であるとする。このとき、「新規要素ID」が示す要素の属性「位置」の値を{X,Y}に設定するように、要素データ変更部へ命令を送る。
[ステップ8] 「輪郭画素データアドレス」の画素データの色をすべて白に設定する。
[ステップ9] 結果として、「新規要素ID」と「縦線範囲」と「横線範囲」を一組にして返し、この機能部の処理を終了する。
【0056】
[矢印検出部116]
矢印検出部116は、処理対象画像から要素種類が「矢印」である要素を検出し、検出した要素に関わる情報を要素データ保持部101に新たに保持させる機能を持つ。
【0057】
要素の検出は処理制御部からの命令によって行われる。一回の命令で、処理対象画像から、未検出の「矢印」要素を一つ検出する。後述のアルゴリズムで示すように、要素を検出した場合はnil以外の値を返し、未検出のものがない場合はnilを返す。この機能部は、「矢印用」のマーカー色をあらかじめ測色して、画素データ形式に変換したものを記憶している。また、この色に対して、許容範囲にある値も記憶している。この情報を利用して、「矢印」要素の検出を行う。
【0058】
この機能部では、次のアルゴリズムで処理が行われる。
[ステップ1] 処理対象画像の画素データに、色が「矢印用」のマーカー色(許容範囲を含む)に一致するものを、処理対象画像の先頭の画素データ(すなわち、原稿左上隅の画素)から順番に調べる。もし一致するものがあれば、この画素データのアドレスを「輪郭画素データアドレス」として記憶する。もしなければ、nilを返してこの機能部の処理を終了する。
[ステップ2] 要素データ変更部102へ、図の要素の生成命令を送る。返ってきた値を「新規要素ID」として記憶する。
[ステップ3] ステップ1で見つけた画素データに対して、原稿上でこれとつながって線をなしている、「矢印用」のマーカー色の画素データすべてを処理対象画像から探しだし、これらのアドレスを「輪郭画素データアドレス」に追加して記憶させる。
[ステップ4] 原稿上で「輪郭画素データアドレス」が示す線に対して、これを内包する最小の長方形にあたるすべての画素データを処理対象画像から探しだし、これらを「矢印領域画素データアドレス」として記憶する。
[ステップ5] 格子検出部114に「矢印領域画素データアドレス」を渡して、原稿上でこれらが示す領域に縦の格子線が何番目から何番目まで入っているかを調べさせ、結果を「縦線範囲」として記憶する。
[ステップ6] 格子検出部114に「矢印領域画素データアドレス」を渡して、原稿上でこれらが示す領域に横の格子線が何番目から何番目まで入っているかを調べさせ、結果を「横線範囲」として記憶する。
[ステップ7] 「縦線範囲」と「横線範囲」が原稿上で示す長方形の中心点に最も近い格子点を一つ見つける。この格子点が、左からX番目の縦線と、下からY番目の横線の交差点であるとする。このとき、「新規要素ID」が示す要素の属性「位置」の値を{X,Y}に設定するように、要素データ変更部102へ命令を送る。
[ステップ8] 「輪郭画素データアドレス」から矢がどの方位を向いているかを調べる。これはまず、矢じり部分、すなわち、原稿上で線が3分岐している画素データを探しだす。次に、3分岐している中で最も線が長いものをさがす。その線を構成する画素データ群のアドレスパターンから矢印の方向が分かり、失じり部分がその線のどちらの端点であるかで矢の方位が分かる。この結果を「矢の方位」として記憶する。なお、方位の基準のとりかたは、座標データの方位と同じである。
[ステップ9] 「輪郭画素データアドレス」の画素データの色をすべて白に設定する。
[ステップ10] 結果として、「新規要素ID」と「縦線範囲」と「横線範囲」と「矢の方位」を一組にして返し、この機能部の処理を終了する。
【0059】
[テキスト検出部117]
テキスト検出部117は、処理対象画像から要素種類が「テキスト」である要素を検出し、検出した要素に関わる情報を要素データ保持部101に保持させる機能を持つ。要素の検出は処理制御部124からの命令によって行われる。一回の命令で、処理対象画像から、未検出の「テキスト」要素を一つ検出する。後述のアルゴリズムで示すように、要素を検出した場合はnil以外の値を返し、未検出のものがない場合はnilを返す。
【0060】
この機能部は、「テキスト用」のマーカー色をあらかじめ測色して、画素データ形式に変換したものを記憶している。また、この色に対して、許容範囲にある値も記憶している。この情報を利用して、「テキスト」要素の検出を行う。
【0061】
この機能部では、次のアルゴリズムで処理が行われる。
[ステップ1] 処理対象画像の画素データに、色が「テキスト用」のマーカー色(許容範囲を含む)に一致するものを、処理対象画像の先頭の画素データ(すなわち、原稿左上隅の画素)から順番に調べる。もし一致するものがあれば、この画素データのアドレスを「輪郭画素データアドレス」として記憶する。もしなければ、nilを返してこの機能部の処理を終了する。
[ステップ2] 要素データ変更部102へ、図の要素の生成命令を送る。返ってきた値を「新規要素ID」として記憶する。
[ステップ3] ステップ1で見つけた画素データに対して、原稿上でこれとつながって線をなしているすべての画素データを処理対象画像から探しだし、これらのアドレスを「輪郭画素データアドレス」に追加して記憶させる。
[ステップ4] 「輪郭画素データアドレス」の画素データ群から、原稿上で5mm以内に、「テキスト用」のマーカー色を持つ画素データがないか処理対象画像を調べる。あればステップ5へ、なければステップ6へ制御を渡す。。
[ステップ5] ステップ4で見つけた画素データに対して、原稿上でこれとつながって線をなしているすべての画素データを処理対象画像から探しだし、これらのアドレスを「輪郭画素データアドレス」に追加して記憶させる。この後、ステップ4へ制御を戻す。
[ステップ6] 「輪郭画素データアドレス」に対して、原稿上でこれを内包する最小の長方形にあたるすべての画素データを処理対象画像から探しだし、これらを「テキスト領域画素データアドレス」として記憶する。
[ステップ7] 格子検出部114に「テキスト領域画素データアドレス」を渡して、原稿上でこれらが示す領域に縦の格子線が何番目から何番目まで入っているかを調べさせ、結果を「縦線範囲」として記憶する。
[ステップ8] 格子検出部114に「テキスト領域画素データアドレス」を渡して、原稿上でこれらが示す領域に横の格子線が何番目から何番目まで入っているかを調べさせ、結果を「横線範囲」として記憶する。
[ステップ9] 「縦線範囲」と「横線範囲」が原稿上で示す長万形の中心点に最も近い格子点をーつ見つける。この格子点が、左からX番目の縦線と、下からY番目の横線の交差点であるとする。このとき、「新規要素ID」が示す要素の属性「位置」の値を{X,Y}に設定するように、要素データ変更部102へ命令を送る。
[ステップ10] 「テキスト領域画素データアドレス」が示す部分の画像だけを処理対象画像からコピーしたような画像データを生成する。この画像データで、テキストに相当する部分の画素を黒、それ以外を白にするように画素の色を変更する。変更後の画像データが、「新規要素ID」が示す要素の属性「テキスト」の属性に設定されるように、要素データ変更部102へ命令を送る。
[ステップ11] 「輪郭画素データアドレス」の画素データの色をすべて白に設定する。
[ステップ12] 結果として、「新規要素ID」を返し、この機能部の処理を終了する。
【0062】
[色設定部118]
色設定部118は、他の機能部からの命令により、要素の配置と種類、選択された配色に応じて、要素の色を設定する機能を持つ。設定命令の引数は、要素データ保持部中の表のIDと、要素種類である。
【0063】
この実施例では、要素種類が「囲み」のものに対して、渡されたIDが示す表の属性「位置」に設定された座標から、どの色を割当てるかを決める。この機能部では、次のアルゴリズムで処理が行われる。このアルゴリズムでは、属性「位置」に設定された座標の第2元の値に基づいて、「囲み」要素の色を割当てている。すなわちこのアルゴリズムでは、原稿上で、同じ横の格子線に位置する囲み要素には、同じ色が割当てられている。
[ステップ1] 引数として渡された表のIDと要素種類を、各々、「新規要素ID」と「新規要素種類」として記憶する。
[ステップ2] ユーザが選択した配色のIDを、配色選択部に問合せて調べ、その結果を「配色ID」として記憶する。
[ステップ3] 「新規要素種類」が「囲み」かどうかを調べる。「囲み」であれば、ステップ4へ進む。それ以外は、ステップ6へ進む。
[ステップ4] 「新規要素ID」が示す表の属性「位置」に設定された座標値を調べ、その第2元の値を「Y座標値」として記憶する。
[ステップ5] 「Y座標値」を4で割った余りをMとして、M=0ならばN=4、そうでなければN=Mとする。このとき、選択肢・設定ルール対応保持部中の情報で、「配色ID」に対応づけられた色設定ルールで、「囲み」要素としてN番目に対応づけられている色(図5において、N=1なら「囲み1」の列の色)を「色適用ルール」として記憶する。ステップ7へ進む。
[ステップ6] 選択肢−設定ルール対応保持部108中の情報で、「配色ID」に対応づけられた色設定ルールで、「新規要素種類」要素のものを探し、これを「色適用ルール」として記憶する。
[ステップ7] 色設定ルール保持部105中の情報で「色適用ルール」と対応づけられているL*a*b*値を探し、この値が「新規要素ID」の要素の属性「色」に設定されるように要素データ変更部102へ変更命令を送る。
【0064】
[形状設定部119]
形状設定部119は、他の機能部からの命令により、要素の種類と選択された配色に応じて、要素の形状を設定する機能を持つ。設定命令の引数は、要素データ保持部101中の表のIDと、要素種類と、左右方向の格子点数と、上下方向の格子点数である。左右方向の格子点数とは、値を設定する対象となる要素が、原稿上で、縦の格子線を何本含んでいたかを示すものである。つまり、囲み検出部115または矢印検出部116が検出結果として返す「縦線範囲」から得ることができる値である。上下方向の格子点数も、これと同様である。
【0065】
この機能部では、次のアルゴリズムで処理が行われる。
[ステップ1] 引数として渡された表のIDと要素種類と左右方向の格子点数と上下万向の格子点数を、各々、「新規要素ID」、「新規要素種類」、「X数」、「Y数」として記憶する。
[ステップ2] ユーザが選択した配色のIDを、配色選択部109に問合せて調べ、その結果を「配色ID」として記憶する。
[ステップ3] 選択肢−設定ルール対応保持部108中の情報で、「配色ID」に対応づけられた形状設定ルールで、「新規要素種類」要素のものを探し、これを「形状適用ルール」として記憶する。
[ステップ4] 形状設定ルール保持部106中の情報で「形状適用ルール」と対応づけられているPostScriptプログラムを探し、この値が「新規要素ID」の要素の属性「形状」に設定されるように要素データ変更部102へ変更命令を送る。
[ステップ5] 「X数」が1以外の場合、「X数」に100をかけたものを拡大倍率(単位はパーセント)として、「新規要素ID」の要素が示す画像の左右方向の長さが拡大倍率だけ拡大されるように、要素データ変更部へ変更命令を送る。
[ステップ6] 「Y数」が1以外の場合、「Y数」に100をかけたものを拡大倍率(単位はパーセント)として、「新規要素ID」の要素が示す画像の上下方向の長さが拡大倍率だけ拡大されるように、要素データ変更部102へ変更命令を送る。
【0066】
[向き変更部120]
向き変更部120は他の機能部からの命令により、矢印要素について、矢の原稿上の方位と選択された配色に応じて、矢印の向きを変更する機能を持つ。
【0067】
形状設定部119による設定では、形状設定ルールの規定から、矢印要素は出力画像で上を向いている。この機能部は、形状設定部119による設定後に、矢印の向きを適切なものにする。設定命令の引数は、要素データ保持部中の表のIDと、矢の原稿上の方位である。ここで、矢の原稿上の方位は、矢印検出部116が、検出結果として「矢の方位」で返すものである。これは、原稿上で上向きを0度として、時計方向に何度の角度をなすかを示している。この変更部120は、要素データ変更部102を用いて、引数で渡された表のIDが示す要素を矢の原稿上の方位だけ回転させる。
【0068】
[座標データ初期化部121]
座標データ初期化部121は、格子検出部114から送られた命令により、座標データ保持部103の座標データを初期化する機能を持つ。また、配色選択部109から送られた命令により、方位距離初期化ルール保持部104に保持されたルールを用いて、座標データ保持部103の座標データを変更する機能を持つ。この機能部は、前述のrest_reference()といった、マクロやシステム定義関数を保持しており、ルールを解釈する際にこれらを利用する。
【0069】
初期化の命令は、引数として、原稿の左右方向の格子点の数、原稿の上下方向の格子点の数、格子点の間隔(単位はポイント)を取る。初期化が命令されると、この機能部は、まず、原稿の左右方向の格子点の数をXPOINTMAX、原稿の上下方向の格子点の数をYPOINTMAXとして記憶する。次に、(XPOINTMAX × YPOINTMAX)個の配置可能座標データを座標データ保持部に生成させる。そして、各座標データに対して、座標IDを{1,1}から{XPOINTMAX,YPOINTMAX}まで一意に割当てる。最後に、座標データの方位距離の初期化をするために、refst_reference({1,1})を実行した後、渡された格子点の間隔を引数としてrule_1()を実行する。
【0070】
例えば、原稿の左右方向の格子点の数を5、原稿の上下方向の格子点の数を8、格子点の間隔を144として初期化が命令されると、この機能部は図8のように座標配置を設定する。
【0071】
[画面表示部122]
画面表示部122は、前述の各種指示/選択に運動して、選択肢や値の入力要請などを画面に表示させる機能を持つ。
【0072】
[図印刷部123]
図印刷部123は、ユーザの指示により、要素データ保持部101に保持された要素のデータを解釈してCMYKラスタ画像に変換し、変換後の画像を紙/OHPシートに印刷する機能を持つ。図の要素を描画する際は、属性「表示順序」の値の小さいものから順次上書きで描画する。また、方位0が必ず紙/OHPシートで上を向くように描画する。ある要素が属性「テキスト」に値を持つ場合は、まず属性「色」と「形状」にしたがって描画し、そのあとで属性「テキスト」の値に基づいてテキストを上書きで描画する。
【0073】
[処理制御部124]
処理制御部124は、処理全体の流れを統括する機能を持つ。また、システム全体の起動と終了のユーザ指示を受ける機能を持つ。
【0074】
実施例における処理の流れを図9に示す。この処理の流れは、処理制御部124によって統括され、実行される。図9では、まず、配色の選択および入力が行われると(S1およびS2)、格子検出部114が格子を検出し、座標データを初期化する(S3)。つぎに、囲み検出部115により囲みが検出されるたびに色設定と、形状設定を行う(S4、S5、S6およびS7)。つぎに、矢印検出部116により矢印が検出されるたびに、矢印の色、形状、および向きを設定する(S8、S9、S10、S11、およびS12)。つぎにテキスト検出部117によりテキストが検出されるたびにテキストの色を設定する。最後に図印刷部123で画像を生成して印刷を行う(S16)。
【0075】
この実施例において、例えば、「ビジネス標準」を選択し、図10のようなスケッチを入力すると、図11のような画像を生成する。
【0076】
以上、実施例1について説明した。なお、この実施例1ではつぎに示す変更等種々の変形が可能である。
【0077】
実施例1では、「囲み」要素だけが配置に応じて配色を変えているが、他の種類の要素も「囲み」要素と同様に配置に応じて配色を変えるように変形できる。また、どの種類は配置に応じて配色を変えるかを選択肢に用意し、選択に応じて配色を変えるように変形できる。
【0078】
また、実施例1では、要素データの属性「位置」に設定された座標値の第2元の値だけを利用して配色を変えているが、第1元の値だけ利用する、あるいは、第1元と第2元の値両方を利用するように変形できる。
【0079】
また、実施例1では、何番目の格子線にある要素はこの色、というように色の割当てが固定的に決まったが、要素が配置されていない格子線には色を割当てず、色の割当てを要素が配置されている格子線に対してだけ行う、といったように動的な割当てをするようにも変形できる。
【0080】
また、実施例1では、格子線一本ごとに色の割当てを順次変えているが、何本かまとめて割当てるように変形できる。
【0081】
また、実施例1では、各種ルールの設定は固定であったが、ルールをユーザが差し替え可能のように変形できる。これにより、ユーザの職種や好み、あるいは流行に合わせて、図の構図を用意することが可能となる。
【0082】
[実施例2]
つぎにこの発明の実施例2について説明する。
【0083】
この実施例は、ワードプロセッサ、デジタル複写機、作図ソフトウェアを用いて画面上で対話的に作図を行う環境で利用する。この実施例では、ユーザが対話的に図の要素を生成し、配置する。その後、ユーザが配色を指定すると、図の要素の配置から個々の要素の色を自動的に設定する。
【0084】
図12は実施例2の作図装置の構成を全体として示す。なお図10において図1と対応する箇所には対応する符号を付す。同一の構成の場合にはその旨を期して説明を繰り返さない。
【0085】
図12において、作図装置は、配色選択部209、要素生成指示部225、要素配置指示部226、要素削除指示部227、方位距離変更指示部228および中心座標指示部229を有し、ユーザの各種指示を受け付けるようになっている。ユーザの指示は、実行部、すなわち、要素データ変更部202、座標データ変更部221、図印刷部223、色設定部218、形状設定部219等で実行される。処理制御部224は全体の制御を統括する。
【0086】
各部の実行に際しては、記憶部すなわち要素データ保持部201、座標データ保持部203、方位距離初期化ルール保持部204、色設定ルール保持部205、形状設定ルール保持部206、配色選択肢保持部207、選択肢−設定ルール対応保持部208が各種データを記憶する。そして生成中の図はその都度、画面表示部222に表示され、最終的に生成された図が図印刷部223により印刷される。
【0087】
以下、各部の構成を詳細に説明する。
【0088】
[要素データ保持部201]
要素データ保持部201は実施例1の要素データ保持部101と同じであるので、説明を省略する。
【0089】
[要素データ変更部202]
要素データ変更部202は、他の機能部からの命令に応じて、要素データ保持部201が保持する情報を変更する機能を持つ。また、変更する命令を受けた場合、その変更処理を行った後、画面書き換え命令を画面表示部222へ送る機能を持つ。
【0090】
図の要素の生成、すなわち新たな表の生成は、要素生成指示部225から送られる命令によって行われる。この命令を受けると、まず新たな一つの表を要素データ保持部中に作り、次にその表の各属性値に値を代入する。属性「形状」と「テキスト」は、その命令の引数として渡されるので、その値を属性値として表に代入する。属性「位置」は、デフォルトとして、座標ID{1,1}を属性値として用いる。
【0091】
属性「表示順序」は、この機能部に保持された表のその属性値としてその時点で最も大きな値を調べ、その値に1を加えた正数値を新しい要素の属性「表示順序」の属性値とする。
【0092】
図の要素の配置は、要素配置指示部226から送られる命令によって行われる。まず、配置の変更対象となる要素を特定する。これは、その命令の引数として渡される、移動元の座標IDを属性「位置」の値として持つもののうち、属性「表示順序」の値が最も大きいものである。要素が特定できれば、その要素の属性「位置」の値を、引き数として渡された移動先の座標IDで置き換える。また、引き数としてPostScriptプログラムが渡された場合は、これを属性「テキスト」の値としてその表に代入する。属性「表示順序」は、この機能部に保持された表のその属性値としてその時点で最も大きな値を調べ、その値に1を加えた正数値を新しい要素の属性「表示順序」の属性値とする。
【0093】
図の要素の削除、すなわちある表の削除は、要素削除指示部227から送られる命令によって行われる。削除されるものは、その命令の引数として渡される座標IDを属性「位置」の値として持つもののうち、属性「表示順序」の値が最も大きいものである。
【0094】
[色設定ルール保持部205]
色設定ルール保持部205は、実施例1の色設定ルール保持部105と同じであるので、説明を省略する。
【0095】
[形状設定ルール保持部206]
形状設定ルール保持部206は、実施例1の形状設定ルール保持部106と同じであるので、説明を省略する。
【0096】
[要素生成指示部225]
要素生成指示部225は、ユーザの指示を受け、形状設定ルール保持部206を用いて新たな図の要素を生成し、これを要素データ変更部202を介して要素データ保持部201に記憶させる機能を持つ。また、テキスト入力を受け付ける機能を持つ。
【0097】
ユーザの指示は、要素の属性「形状」に関して、形状設定ルール保持部206が保持する表のうちから、形状を示す言葉をそれぞれ選択することで行われる。このとき、テキストを入力すると、そのテキストを新たに作った図の要素が表わすもの、すなわちその要素の内側に表示されるテキストにできる。
【0098】
選択が行われた後、要素生成指示部225は、要素データ変更部202に新たな表を作成する命令を送る。この命令の引き数として、次のものが要素データ変更部202に渡される。
*ユーザが選択した形状を表わす言葉と対応づけられたPostScriptプログラム。(属性「形状」の値になる)
*入力されたテキストが、できるだけ前記のPostScriptプログラムが表示上占める領域の内側にはいるように、フォント/行数/行間隔が設定された、入力されたテキストを描画するためのPostScriptプログラム(属性「テキスト」の値になる)。
【0099】
[要素配置指示部226]
要素配置指示部226は、ユーザの指示を受け、ある座標に配置されている図の要素を、別の座標に移動する機能を持つ。また、テキスト入力を受け付ける機能を持つ。
【0100】
ユーザの指示は、まず移動元の座標を選択することで行われる。この座標に配置された図の要素のうち、最も手前に表示されているものが移動の対象となる。このときテキストを入力すると、移動対象となる図の要素の属性「テキスト」の値として、入力したテキストを設定することができる。この後、移動先となる座標が選択される。
【0101】
選択が行われた後、要素配置指示部226は、要素データ変更部202に属性値の変更の命令を送る。この命令の引き数として、次のものが要素データ変更部202に渡される。
*はじめに選択した座標のID。(移動元を示す)
*あとで選択した座標のID。(移動先を示す)
*入力されたテキストが、できるだけ前記のPostscriptプログラムが表示上占める領域の内側にはいるように、フォント/行数/行間隔が設定された、入力されたテキストを描画するためのPostScriptプログラム(属性「テキスト」の値になる)。
【0102】
[要素削除指示部227]
要素削除指示部227は、ユーザの指示を受け、任意の座標に配置された図の要素を削除する機能を持つ。ユーザの指示は、座標を選択することで行われる。この座標に配置された図の要素のうち、最も手前に表示されているものが削除の対象となる。ユーザの指示後、選択された座標のIDを引数として、削除命令を要素データ変更部202へ送る。
【0103】
[座標データ保持部203]
座標データ保持部203は、図の要素を配置可能な、2次元平面上の座標に関する情報を保持する機能を持つ。この実施例では、配置可能な座標の数は固定であり、全部で16個である。座標データの定義は実施例1と同じであるので、この機能部に関する説明を省略する。
【0104】
[方位距離初期化ルール保持部204]
方位距離初期化ルール保持部204は、実施例1の方位距離初期化ルール保持部104と同じであるので、説明を省略する。
【0105】
[方位距離変更指示部228]
方位距離変更指示部228は、ユーザが任意の座標データに対して、その方位および距離の変更を指示できる機能を持つ。ユーザの指示は、まず変更する座標を選択することで行われる。次に、画面上で、この座標をどの位置に置くかを選択する。選択が行われた後、この機能部は、座標データ変更部に属性値の変更の命令を送る。この命令の引き数として、次のものが座標データ変更部に渡される。
*選択した座標のID。
*選択した座標の画面上の元の位置と、新たに指定された位置との距離。
*新たに指定された位置からみた、選択した座標の画面上の元の位置の方位。
【0106】
[座標データ変更部221]
座標データ変更部221は、実施例1の座標データ変更部221と同様に、座標データを初期化する機能を持つ。また、方位距離変更指示部228から送られた命令により、座標データ保持部203の座標データを変更する。この機能部は、座標データを変更後、画面表示部222へ画面書き換え命令を送る。
【0107】
方位距離変更の変更が指示された場合、この機能部は、その命令の引数に応じて
その座標の属性値を変更する。同時に、その座標を観測対象とするすべての座標に対して、画面上の位置が変化しないように、これらの属性値を変更する。ある座標の新たな方位と距離は、これを表すベクトルをVnewとし、その座標の現在の距離と方位の属性値から得られるベクトルvと、変更命令の引数である距離と方位から得られるベクトルVdeltaによって次のように計算できる。
【0108】
変更命令の引数で指定された座標について: Vnew=V+Vdelta
観測対象とする座標について:Vnew=V−Vdelta
例えば、図13のように座標配置が初期化された後、方位距離変更命令が、座標IDが{2,3}、距離が72、方位が315を引数としてこの機能部に渡された場合、図14のように座標配置を設定する。
【0109】
[中心座標指定部229]
中心座標指定部229は、配色の中心点となる座標をユーザが指定できる機能をもつ。また、指定された座標を記憶い他の機能部からの問合せに対してこの座標を返す機能を持つ。
【0110】
座標の初期状態として、この機能部は、座標{1,1}を記憶している。ユーザによる指定は画面上の座標を選択することで行われる。
【0111】
[配色選択肢保持部207]
配色選択肢保持部207は、実施例1の配色選択肢保持部207と同じであるので、説明を省略する。
【0112】
[選択肢−設定ルール対応保持部208]
選択肢−設定ルール対応保持部208は、配色選択肢保持部207に保持された配色と、色設定ルール保持部105に保持される言葉との対応関係を保持する機能を持つ。この実施例では、配色のIDと言葉とを対応づけた表形式のデータを用いることで、対応関係を保持している。この実施例では、中心座標からの距離に応じて要素の色を変えるように、ある配色に対して複数の色が対応づけられている。図15に、このデータの例を示す。
【0113】
[配色選択部209]
配色選択部209は、ユーザの指示により、配色選択肢保持部に保持された選択肢のうちから一つを選び、この結果を引数として色設定部へ色設定命令を送る機能を持つ。配色選択部による選択肢の画面表示は、実施例1と同様である。
【0114】
[色設定部218]
色設定部218は、配色選択部209からの命令により、要素の配置と選択された配色に応じて、要素データ保持部201中の要素の色を設定する機能を持つ。この実施例では、要素の属性「位置」に設定された座標値をもとに、各要素の色を設定する。ある要素の色の決定は、その要素の位置が、中心座標指定部が記憶する座標からどれだけ離れているかに応じて決まる。
【0115】
この機能部では、次のアルゴリズムで処理が行われる。
[ステップ1] 引数として渡された配色のIDを、「配色ID」として記憶する。
[ステップ2] 要素データ保持部201中のすべての表に対して、属性「色」の値をnilにする。
[ステップ3] 要素データ保持部201中の表に、属性「色」の値がnilのものがあるかを調べる。もしなければ、この機能部の処理を終了する。
[ステップ4] ステップ3で見つけた表のIDを「処理対象ID」として記憶する。
[ステップ5] 「処理対象ID」が示す表の属性「位置」に設定された座標値を調べ、その値を「処理対象座標」として記憶する。
[ステップ6] 中心座標指定部229に中心座標を問合せ、その結果を「中心座標」として記憶する。
[ステップ7] 「処理対象座標」の第1元、第2元の値を各々x,y、「中心座標」の第1元、第2元の値を各々X,Yとした時、次の値Nを計算する。
N=|X−x|+|Y−y| (ここで、|a|はaの絶対値を示す。)
[ステップ8] ステップ7のNを4で割った余りをMとする。このとき、選択肢−設定ルール対応保持部208中の情報で、「配色ID」の行で、Mの値の列を「色適用ルール」として記憶する。
[ステップ9] 色設定ルール保持部105中の情報で「色適用ルール」と対応づけられているL*a*b*値を探し、この値が「新規要素ID」の要素の属性「色」に設定されるように要素データ変更部202へ変更命令を送る。ステップ3へ進む。
【0116】
[形状設定部219]
形状設定部219は実施例1の形状設定部119と同じであるため説明を繰り返さない。
【0117】
[画面表示部222]
画面表示部222は、画面書き換え命令により、要素データ保持部201に保持された要素のデータを解釈してRGBラスタ画像に変換し、変換後の画像をディスプレイに表示する機能を持つ。また、ポインティングデバイスに運動するカーソルを画面上に表示し、前述の各種指示/選択の際に座標点や図の要素を直接選択する操作を可能にする機能を持つ。
【0118】
図の要素を描画する際は、属性「表示順序」の値の小さいものから順次上書きで描画する。また、方位0が必ず画面で上を向くように描画する。ある要素が属性「テキスト」に値を持つ場合は、まず属性「色」と「形状」にしたがって描画し、そのあとで属性「テキスト」の値に基づいてテキストを上書きで描画する。
【0119】
[図印刷部223]
図印刷部223は、ユーザの指示により、要素データ保持部201に保持された要素のデータを解釈してCMYKラスタ画像に変換し、変換後の画像を紙/OHPシートに印刷する機能を持つ。
【0120】
図の要素を描画する際は、属性「表示順序」の値の小さいものから順次上書きで描画する。また、方位0が必ず紙/OHPシートで上を向くように描画する。ある要素が属性「テキスト」に値を持つ場合は、まず属性「色」と「形状」にしたがって描画し、そのあとで属性「テキスト」の値に基づいてテキストを上書きで描画する。
【0121】
[処理制御部224]
処理制御部224は、処理全体の流れを統括する機能を持つ。また、システム全体の起動と終了のユーザ指示を受ける機能を持つ。
【0122】
ユーザ指示が行える各機能部へ、指示入力受け付けの時間を順次割り当てる。時間が割り当てられた機能部でユーザからの入力があった場合、その要求による処理が終了するまで他の機能部への割り当てを中断する。
【0123】
実施例における処理の流れを図16に示す。この処理の流れは、処理制御部224によって統括され、実行される。図16では、ステップS101で処理の終了を監視し、また、ステップS102、S102、S104、S106、S108、S110、S112およびS115でユーザの指示が何かを判別し、これに基づいて、処理の終了や、各機能部の動作を実行するようになっている(S103、S105、S107、S109、S111、S113およびS114)。各機能部についてはすでに説明した。
【0124】
この実施例では、例えば、図17に示されるように図の要素が配置されている場合に、中心座標を{2,4}として、配色としてメリハリを選択すると、図18のような配色を得ることができる。
【0125】
[実施例3]
つぎに、この発明の実施例3について説明する。この実施例は、白黒原稿に所定の配色で色づけを行うものである。この実施例では、白黒原稿中の色をつけたい閉領域の内側に、カラーマーカーペンでマーキングした後、その原稿を読み込ませ、それに基づいて、マークされている閉領域にその位置に応じた配色が施されたカラー原稿を出力する。
【0126】
図19はこの実施例の作図装置を全体として示す。この作図装置は、専用のワードプロセッサ、デジタル複写機や、汎用のパーソナルコンピュータ、ワークステーション、あるいはホストのソフトウェアとして実現できる。なお図19において図1または図12と対応する箇所には対応する符号を付す。同一の構成の場合にはその旨を期して説明を繰り返さない。
【0127】
この図において、作図装置は、グラデーション選択部336を有し、ユーザの指示を受け付けるようになっている。原稿読み取り部112は白黒原稿にマーキング操作を行って作成した原稿を読みとるものである。ユーザの指示は、実行部、すなわち、図印刷部323、マーク検出部330、閉領域検出部331、閉領域上端検出部333、閉領域左端検出部334、閉領域色決定部337、色変更部338等で実行される。処理制御部124は全体の制御を統括する。
【0128】
各部の実行に際しては、記憶部すなわち処理対象画像保持部313、グラデーションルール保持部334、グラデーション方向選択肢保持部335が各種データを記憶する。生成された図が図印刷部123により印刷される。
【0129】
以下、各部の構成を詳細に説明する。
【0130】
[マーキング操作310]
マーキング操作310は、原稿読み取り部312に読み取らせる白黒原稿上に、マークをつけるための機能をもつ。一色のカラーマーカーペンで実現される。このペンは、色をつけたい閉領域の内側の任意の場所に、マークをするように用いられる。
【0131】
[原稿読み取り部312]
原稿読み取り部312は、実施例1の原稿読み取り部112と同じであるので、説明を省略する。
【0132】
[処理対象画像保持部313]
処理対象画像保持部313は、実施例1の処理対象画像保持部313と同じであるので、説明を省略する。
【0133】
[マーク検出部330]
マーク検出部330は、処理対象画像から、一つのマークに相当する画素データの組を一つ検出し、これを記憶する機能を持つ。この機能部は、マーキング操作310に用いる部のカラーマーカーの色を測色し、画素データの形式でその色を表現したデータを保持している。また、その色に対する許容値も同時に保持している。
【0134】
マークに相当する画素データの組とは、原稿上で連続し、かつ、この機能部が保持するマーカー色(許容値を含む)を持つ画素データ群である。検出された画素データの組は、画素データのアドレスを要素とする集合(以下、マーク画素集合と呼ぶ)として記憶される。これを記憶する機構は、集合の要素が重複しない(すなわち、要素であるアドレスはすべて異なる)ように、要素の追加を制御する。この機能部では、次のアルゴリズムで処理が行われる。なお、このアルゴリズムは再帰的である。
[ステップ1] 記憶されたマーク画素集合に要素があ机ま、これをすべて削除する。
[ステップ2] 処理対象画像中の画素データから、この機能部に保持されたマーカー色に一致するものを一つ選び、画素データのアドレスをカレントアドレスとして記憶する。
[ステップ3] カレントアドレスが指す画素データの示すマーカー色とその許容色を、対象色として記憶する。
[ステップ4] カレントアドレスをマーク画素集合に加える。
[ステップ5] カレントアドレスが指す画素データに対して、原稿で上下左右に位置する画素データを探す。これらの中に、その値が対象色に一致し、かつ、その画素データのアドレスがマーク画素集合にないものがあれば、これらの画素データのアドレスを記憶する。
[ステップ6] ステップ5で記憶された画素データのアドレスに対して、これらを順次カレントアドレスとして、ステップ4から6を実行する。
【0135】
[閉領域検出部331]
閉領域検出部331は、マーク検出部310で検出されたマークに対して、原稿上でそのマークを内包する最も内側の閉領域に相当する画素群を検出し、これのアドレスを記憶する機能を持つ。
【0136】
閉領域の輪郭に相当する画素は、白黒原稿を入力しているので、黒色である。したがって、閉領域の探索は、原稿上で閉じた曲線を成す黒色の画素群を、マーク検出部が保持するアドレスを探索開始点として、原稿上で外側に向かって探索を行えばよい。この探索で見つかった画素群に対して、原稿上内側にある画素群(見つかった画素群は含まない)が求める閉領域である。
【0137】
この機能部で記憶されるデータは、画素データのアドレスの範囲を示すものである。具体的には、アドレスの開始点と終点を示す組を要素とする集合になる。ある組は、同一のラインスキャンライン(原稿短辺方向に並ぶ3360画素)上に並ぶものになっている。
【0138】
[閉領域上端検出部332]
閉領域上端検出部332は、検出された閉領域の上端が、スキャンラインで数えて、上から何番目にあるかを調べて記憶する機能を持つ。この機能部は、閉領域検出部331が検出したデータに対して、そのアドレスから原稿上最も上に存在する画素を探しだす。そして、その画素のアドレスから、その画素が何番目のスキヤンラインにあるかを調べる。この「何番目」という数字を、この機能部は記憶する。
【0139】
[閉領域左端検出部333]
閉領域左端検出部333は、検出された閉領域の左端が、1スキヤンラインを示す画素群の組で数えて、左から何番目にあるかを調べて記憶する機能を持つ。この機能部は、閉領域検出部331が検出したデータに対して、そのアドレスから原稿上最も左に存在する画素を探しだす。そして、その画素のアドレスから、その画素が1スキヤンラインを示す画素群の組で数えて、左から何番目にあるかを調べる。この「何番目」という数字を、この機能部は記憶する。
【0140】
[グラデーションルール保持部334]
グラデーションルール保持部334は、要素の配色として、連続的な色変化をつけるための複数のルールを保持する機能を持つ。この機能部は、各ルールごとに、ルールのIDと色変化の始点の色と色変化の終点の色とを記憶している。これらの色は、画素データと同じ形式で表現されている。なお、この機能部が保持するルールでは、ルールに従って色をつけた時に、マーカー色と同じ色にならないようになっている。これは、閉領域検出部331による検出が正しく行われるようにするためである。
【0141】
[グラデーション方向選択肢保持部335]
グラデーション方向選択肢保持部335は、色変化をつける方向の選択肢を保持する機能を持つ。この実施例では、選択肢は「左から右」、「上から下」の2つである。
【0142】
[グラデーション選択部336]
グラデーションルール保持部334中のルールと、グラデーション方向選択肢保持部335中の選択肢をそれぞれユーザが選択し、その選択結果を記憶する機能を持つ。また、他の機能部の問合せに対して、記憶した選択結果を返す機能を持つ。問合せに対して、ルールのIDと方向の値とを組にした結果を返す。
【0143】
[閉領域色決定部337]
閉領域色決定部337は、グラデーション選択部336による選択結果に基づいて、閉領域検出部331が検出した閉領域の色を決め、色変更部338を用いてその閉領域の色を変更する機能を持つ。この機能部の処理は、次のアルゴリズムに従う。
[ステップ1] グラデーション選択部336に、選択されたグラデーションルールとグラデーション方向とを問合せ、帰ってきた結果をそれぞれ「ルールID」、「指定方向」として記憶する。
[ステップ2] 指定方向が「左から右」であれば閉領域左端検出部333に、「上から下」であれば閉領域上端検出部332に、検出命令を送る。返ってきた結果を「線番号」として記憶する。
[ステップ3] 指定方向が「左から右」であれば「線数」として3360を記憶し、「上から下」であれば「線数」として4752を記憶する。
[ステップ4] 「線番号」を「線数」で割った値(実数値)を「変化率」として記憶する。
[ステップ5] グラデーションルール保持334で「ルールID」と対応づけられている「始点の色」を探す。探しだされた24ピツトデータのRGBごと8ビットデータから、各々を10進数にした値を計算し、これらを「R初期値」、「G初期値」、「B初期値」として記憶する。
[ステップ6] グラデーションルール保持部334で「ルールID」と対応づけられている「終点の色」を探す。探しだされた24ビットデータのRGBごと8ビットデータから、各々を10進数にした値を計算し、これらを「R終端値」、「G終端値」、「B終端値」として記憶する。
[ステップ7] RGB各々の終端値から初期値を引いた値に対して、変化率をかけた値を、各々「R変化値」、「G変化値」、「B変化値」として記憶する。
[ステップ8] RGB各々の初期値に変化値を加算する。加算後の各々の値に対して、小数点以下を四捨五入にして整数化する。整数化した各々の値を2進数8ビットにした値を計算し、これらからRGB24ビットデータをつくる。
[ステップ9] ステップ8で最後に得られた24ビットデータを引数として、色変更部338に色の変更を命令する。色変更部による色の変更が終了した後、この機能部の処理を終える。
【0144】
[色変更部338]
色変更部338は、閉領域色決定部337の命令により、閉領域検出部331が検出して記憶する閉鎖域に対して、引数として渡された色に変更する機能を持つ。この機能部は、閉領域検出部331が記憶するアドレスの画素データに対して、その画素の色が白またはマーカー色であれば、引数として渡された色に一致するように24ビット値を変更する。これにより、領域内の色が塗られていない部分、および、マークされていた部分に色が付くことになる。また、文字など、入力原稿で黒の部分は、色が変わらないことになる。
【0145】
[図印刷部323]
図印刷部323は、実施例1の図印刷部123と同じ機能を有するのに加え、処理制御部からの命令により、複数枚のコピーを出力する機能を持つ。
【0146】
[処理制御部324]
全体の処理を統括し、実行する機能を持つ。また、この機能部は、コピーの開始やコピー枚数をユーザが指示できる機能を持つ。
【0147】
実施例3における処理の流れを図20に示す。図20において、グラデーションルールと方向が選択され、さらにコピーが指示されると(ステップS201〜S203)、原稿が読みとられ、マークの有無が検出される(ステップS204〜S206)。マークが検出されると閉領331域検出部がマークを内包する閉領域を検出し、閉領域色決定部337がその色を決定していく(ステップS208およびS209)。マークが検出されないとき、または閉領域の色がすべて決定されたときに、指定枚数だけコピーを生成する(ステップS207)。
【0148】
以上でこの発明の実施例の説明を終える。
【0149】
【発明の効果】
以上説明したように、この発明によれば、配色規則を指定するだけで配色バランスのとれた図を簡易に生成できる。とくに配色規則に応じた配色パターンを表示させ、またこれに作図目標等をあわせて表示すれば、ユーザは目的に合致し、しかも配色上問題のない図を特別のスキルなしに作成できる。また白黒画像、単一色画像に色マークを付して配色を行いたい要素を指定し、あわせて配色規則を指定すれば、白黒画像から配色バランスのとれたカラーの図を簡易に生成できる。
【図面の簡単な説明】
【図1】この発明の実施例1を全体として示すブロック図である。
【図2】上述実施例1における座標のデータの記述を説明する図である。
【図3】上述実施例の方位距離設定ルール保持部104に記憶されたルール1の動作を説明するフローチャートである。
【図4】上述実施例1の配色選択肢保持部107のデータを説明する図である。
【図5】上述実施例1の選択肢−設定ルール対応保持部108のデータを説明する図である。
【図6】上述実施例1の配色選択部109が提供する配色の選択画面を示す図である。
【図7】上述実施例1の原稿読み取り部112の動作を説明する図である。
【図8】上述実施例1の座標データ初期化部121により初期化された格子の座標を示す図である。
【図9】上述実施例1の動作を説明するフローチャートである。
【図10】上述実施例1で用いる入力用しに描いたラフな原画を示す図である。
【図11】図10の入力用紙を用い、「ビジネス標準」の配色で生成した図面のデザインを示す図である。
【図12】この発明の実施例2を全体として示すブロック図である。
【図13】上述実施例2の座標データ変更部221による座標の状態を説明する図である。
【図14】上述実施例2の座標データ変更部221による座標の他の状態を説明する図である。
【図15】上述実施例2の選択肢−設定ルール対応保持部208のデータを説明する図である。
【図16】上述実施例2の動作を説明するフローチャートである。
【図17】上述実施例2の配色前のデザインを示す図である。
【図18】図17のデザインに配色を施した状態を示す図である。
【図19】この発明の実施例3を全体として示すブロック図である。
【図20】上述実施例3の動作を説明するフローチャートである。
【符号の説明】
101、201、301 要素データ保持部
102、202 要素データ変更部
103、203 座標データ保持部
107、207 配色選択肢保持部
108、208 選択肢−設定ルール対応保持部
109、209 配色選択部
111 入力用紙
112 原稿読み取り部
118 色設定部
331 閉領域検出部
334 グラデーションルール保持部
335 グラデーション方向選択肢保持部
336 グラデーション選択部
337 閉領域色決定部[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a drawing apparatus for performing electronic drawing for processing digital image information, such as a word processor capable of handling graphics and a digital copying machine.
[0002]
[Prior art]
In recent years, it has become common for end users to draw electronically using a graphical UI (user interface) with a word processor or the like. In addition, with the spread of computer systems including color scanners and color printers, not only graphic designers but also general users can create environments for creating color diagrams. Because color diagrams are more appealing than black and white, there is a high need for users to easily create beautiful and easy-to-understand diagrams for proposals and presentations to customers.
[0003]
When creating a beautiful and easy-to-understand diagram, what color is used for which part of the diagram is important. This is because, if the appropriate color scheme is not performed, it will be difficult to see the color.
[0004]
In conventional methods used for electronic color drawing in word processors, graphic software, or digital copiers with color editing functions, the user directly specifies the elements and regions of the figure, The color arrangement is performed by repeating the operation of directly instructing what kind of color to use. An editing operation system prepared in a system based on a conventional method is such that the user directly specifies the position, size, and color of each figure element.
[0005]
However, it is difficult for a general user who is not a graphic designer to determine a color scheme of a figure using a conventional method. This is because the color scheme is determined by the relationship between the color of a certain part and the color of another part, and the color of each part must be determined in consideration of the overall balance. For general users, it is difficult to image the finished color scheme before coloring work, so using the conventional method, the colors of individual parts are determined on a case-by-case basis, and finally it is difficult to see the color scheme. It often happens. In particular, it has been extremely difficult for general users to perform color arrangement of elements in variously arranged diagrams by a conventional method.
[0006]
[Problems to be solved by the invention]
The present invention has been made in view of the above-described circumstances, and when a user electronically draws or when a color diagram is electronically generated from a black and white diagram, an appropriate color scheme is applied. It is an object of the present invention to provide a drawing apparatus that can easily generate a figure.
[0007]
[Means for solving the problems]
In the present invention, in order to achieve the above object, storage means for storing information on a plurality of color arrangement rules for determining colors to be assigned to the elements according to the positional relationship of the elements constituting the diagram, and the color arrangement rules. Means for displaying a corresponding color arrangement pattern, means for specifying a color arrangement rule for the drawing target drawing, and referring to the storage means based on the specified color arrangement rule, the color of the element of the drawing target figure And a means for generating image information representing the drawing to be colored according to the color determined for the element of the drawing to be drawn is provided in the drawing apparatus.
[0008]
According to this configuration, the user can determine the color arrangement rule while actually viewing the color arrangement pattern, and can generate a diagram that more matches the user's purpose. In this case, if the drawing target or the like and the color arrangement pattern are displayed in association with each other, the user can further easily select the color arrangement.
[0009]
Also, the elements in the figure to which the color arrangement pattern is assigned may be only a predetermined type of element, and other types of elements may be assigned a predetermined color regardless of the positional relationship. In addition to the information on the color arrangement rule, the storing means also stores data defining the color of the element of the type to which the color arrangement pattern is not assigned. You may make it determine the color scheme of the element of a kind, and the color of the element of another kind.
[0010]
The storing means also stores data defining a correspondence relationship between the coloration rule and the shape of the element, so that the shape of the element is automatically determined according to the drawing characteristics such as a drawing target. It may be.
[0011]
According to the present invention, in order to achieve the above object, storage means for storing information relating to a plurality of color arrangement rules for determining colors to be assigned to the elements according to the positional relationship of the elements constituting the diagram, A means for designating a color arrangement rule for a figure, and an achromatic or single-color original drawing image that is the original drawing of the drawing target drawing, and optically reading a predetermined element with a color mark, The means for generating the original image information and the storage means are referred to based on the specified color arrangement rule, and the color of the element with the color mark of the original image is determined based on the original image information. And a means for generating image information representing the drawing target drawing that has been colored according to the color determined for the drawing element and the original drawing image information. Yes.
[0012]
According to this configuration, it is possible to easily obtain a color image with an appropriate color arrangement simply by adding a color mark to a monochrome image and processing it.
[0013]
DETAILED DESCRIPTION OF THE INVENTION
DESCRIPTION OF THE PREFERRED EMBODIMENTS A drawing apparatus according to an embodiment of the invention will be described below.
[Example 1]
First, Example 1 will be described. In this embodiment, a rough sketch is drawn on an input sheet, this is optically read, and a color scheme is specified together, thereby generating a good-looking figure with a balanced color scheme. Here, before explaining the configuration and operation of this drawing apparatus, the overall flow of the operation will be described in terms of how to draw using this drawing apparatus.
[0014]
In this embodiment, a figure is drawn with a color marker pen on paper (input paper 111) on which a grid is printed. The input paper on which the figure is drawn is optically read. At the same time, when a color scheme of the figure is selected from the options on the touch panel, a color document with a color scheme based on this is output.
[0015]
In this embodiment, there are three types of elements, “enclosure”, “arrow”, and “text”, in the figure. The “box” is a circle or square drawn by the user with a closed curve on the input sheet. The “arrow” is drawn in the form of −>. “Text” is a character string written in the figure.
[0016]
In this embodiment, a color marker pen for drawing a figure is provided. The color marker pen is given for each kind of element of the figure such as “for enclosure”, “for arrow”, and “for text”, and the color is different for each application. The system uses this color difference to detect the type of element.
[0017]
The color of the grid printed on the input paper is also different from the color of the color marker pen. The user draws a figure with a color marker pen based on the grid. Using the fact that the colors of the elements and the grid in the figure are different, the elements and the grid are recognized individually, and the positional relationship between the elements is detected with reference to the grid.
[0018]
Next, the configuration of the drawing apparatus of the embodiment will be described. This drawing apparatus can be realized as a dedicated word processor, digital copier, general-purpose personal computer, workstation, or host software.
[0019]
FIG. 1 shows the drawing apparatus as a whole. In this figure, the drawing apparatus has a document reading unit 112 and a color arrangement selection unit 109, and accepts various instructions from the user. The document reading unit 112 reads a document created by performing a marking operation on the input paper 111. The user's instruction is an execution unit, that is, an element data changing unit 102, a coordinate data changing unit 121, a figure printing unit 123, a lattice detecting unit 114, an enclosure detecting unit 115, an arrow detecting unit 116, a text detecting unit 117, and a color setting unit. 118, the shape setting unit 119, the orientation changing unit 120, and the like. The processing control unit 124 controls the entire control.
[0020]
When executing each unit, the storage unit, that is, the element data holding unit 101, the coordinate data holding unit 103, the azimuth distance setting rule holding unit 104, the color setting rule holding unit 105, the shape setting rule holding unit 106, the color arrangement option holding unit 107, the option The setting rule correspondence holding unit 108 and the processing target image holding unit 113 store various data. The diagram being generated is displayed on the screen display unit 122 each time, and the diagram finally generated is printed by the diagram printing unit 123.
[0021]
Hereinafter, the configuration of each unit will be described in detail.
[0022]
[Element data holding unit 101]
The element data holding unit 101 has a function of holding information on the shape, color, and arrangement of each element in the drawing. In this embodiment, attribute data relating to the elements of the figure is held in a table format. The table associates pairs of attributes and attribute values. One table is created for each element, and an ID for uniquely identifying the table in the system is assigned. Hereinafter, each attribute will be described.
[0023]
The attributes include “position”, “color”, “shape”, “text”, and “display order”. The attribute “position” indicates the position of the element on the two-dimensional plane. As an attribute value, a coordinate ID of an arrangementable coordinate described later is taken. The attribute “color” indicates the color of the element. As an attribute value, a value representing the color of the element is taken as L * a * b *, which is a scale determined by the International Lighting Association. The attribute “shape” indicates the shape of the element. As the attribute value, a value describing the shape of the element in PostScript (trademark of Adobe Systems Inc., USA) of the page description language is taken. The attribute “text” indicates the content when the element type is text. Color bitmap data is taken as an attribute value. The attribute “display order” indicates what number the element is displayed. In this embodiment, since drawing is performed by overwriting, when elements overlap each other, the display in the later display order can be seen in front. Takes a unique positive value as the attribute value.
[0024]
[Element data changing unit 102]
The element data changing unit 102 has a function of changing information held by the element data holding unit in response to a command from another function unit. Generation of elements in the figure, that is, generation of a new table is performed by an instruction sent from another functional unit. When this command is received, a new table is first created in the element data holding unit 101. The value of each attribute at this point is as follows.
* The attributes “color”, “shape”, and “text” are nil.
* The attribute “display order” is a value obtained by adding 1 to the maximum value of the attribute value of the table existing in the element data holding unit 101 at this time.
[0025]
As a result of the generation instruction, the ID of the newly created table is returned.
[0026]
For attribute value settings of the attributes “color”, “shape”, and “text”, a direct substitution instruction is prepared. This assignment command takes a table ID, an attribute to be assigned, and a value to be assigned as arguments. When this command is received, the functional unit searches the table held in the element data holding unit 101 for the one having the ID passed as an argument, and replaces the attribute value of the table according to the passed value.
[0027]
For the attribute “color”, as a command for changing the attribute value, a relative change command of brightness / saturation / hue is prepared. This change command takes the table ID and the amount of change relative to the current value as arguments. The ID of the table is used to check the assignment destination as in the attribute value setting described above. The amount of change is a real value, and only the hue change is a value in radians. For changing the brightness, the amount of change is added to the current L * value. To change the saturation and hue, calculate the saturation and hue from the current a * value and b * value, add the amount of change to this, and then assign the added value to the a * value and b * value. I do. Regarding the amount of change in hue, the direction of “plus change” is clockwise in the ab coordinate system (a is the machine axis, and b is the vertical axis).
[0028]
For the attribute “shape”, a size / orientation change command is prepared as a command to change the attribute value. This change instruction takes a table ID and a real value as arguments. The ID of the table is used to check the assignment destination as in the attribute value setting described above. To change the size, the given real value is treated as a magnification with respect to the length in units, and the current attribute value is changed to a size corresponding to this value. To change the direction, the given real value is treated as a rotation amount in degrees, and the current attribute value is changed so that the direction changes according to this value. Note that the change in orientation is a relative change, and the clockwise direction with respect to the document is defined as a “plus change” orientation.
[0029]
Note that if the element type is specified instead of the table ID as the method for specifying the change command, the change based on the value of another argument is performed for all elements of that type.
[0030]
[Coordinate data holding unit 103]
The coordinate data holding unit 103 has a function of holding information about coordinates on a two-dimensional plane on which elements of the figure can be arranged. In this embodiment, the number of coordinates that can be arranged matches the number of grid points of the grid printed on the input paper. The data of a certain coordinate includes a coordinate ID and a value indicating the position of the coordinate in two dimensions. The coordinate ID is for uniquely identifying the coordinate. In this embodiment, it is represented by a set of binary positive values such as {1, 1}.
[0031]
The value indicating the position is indicated by the azimuth and distance with respect to another coordinate point as a measurement target. The coordinate point to be measured is one point, which is indicated by a coordinate ID. The azimuth indicates in which direction the measurement object is viewed from itself, and is indicated by a clockwise angle with the upward direction at the time of printing being 0 degrees. The distance is indicated by a non-negative integer value in units of points, which is a printing unit. FIG. 2 shows a conceptual diagram of values indicating positions. For example, the coordinate point {1, 2} at the upper left in FIG. 2 has an orientation of 135 degrees with the coordinate point {1, 1} as the measurement target (reference), and the distance is 102 points.
[0032]
[Azimuth distance initialization rule holding unit 104]
The azimuth distance initialization rule holding unit 104 holds a rule for initializing coordinate data. In this embodiment, it is described as a sequential procedure by a program having a grammar similar to C language. This initialization rule is such that the arrangement of coordinates is equally spaced and the overall structure is a lattice. In the initialization rule (rule_1 (dis_val)), the distance from the adjacent grid point is set to the value of dis_val at all coordinates. The initialization rule is described as follows (in a manner similar to the C language). FIG. 3 shows an operation executed according to the initialization rule. Since the description of the figure can be easily understood, no particular explanation will be given.
[0033]
[Table 1]
Figure 0003617145
Here, the function point_data ({i, j}) is system-defined and returns a pointer for accessing the coordinate data whose coordinate ID is {i, j}. Thereby, each attribute value of coordinate data can be referred to / assigned like p->position-> angle. XPOTINMAX and YPOINTMAX are macros that indicate the maximum number of first and second elements of arrangeable coordinates. The function reset_reference ({i, j}) is a system-defined function that coordinates the coordinate point {i, j} as the reference point for setting the azimuth / distance and expands the connection of the measurement object in a tree shape from this coordinate. is there. According to the change of the object to be measured, the distance and the direction are set appropriately so that the arrangement of the coordinates is not different from that before the function is applied. The setting of “measurement target” with the coordinate ID {l, m} is as follows.
* When l <i and m = j, the “measurement object” is the coordinate ID {l + 1, m}
* When l> i and m = j, the “measurement object” is the coordinate ID {l−1, m}.
* When m> j, the “measurement object” is the coordinate ID {l, m−1}.
* When m <j, the “measurement object” is the coordinate ID {l, m + 1}
These system definition functions and macros are defined in the coordinate data changing unit 121 described later.
[0034]
[Color setting rule holding unit 105]
The color setting rule holding unit 105 has a function of holding rules relating to the color arrangement of elements. In this embodiment, the rule is held by a table composed of a set in which the value of L * a * b * set in the element attribute “color” is associated with a word (red, blue, etc.) representing the color. doing.
[0035]
[Shape setting rule holding unit 106]
The shape setting rule holding unit 106 has a function of holding a rule related to the shape of an element. “Shape” has a table composed of a set in which the PostScript program set in the element attribute “shape” is associated with words (such as a cylinder or a heel) indicated by the shape. A reference is provided for the size of the image described in each PostScript program. Here, it is specified to fit in a square of 144 points × 144 points (that is, 2 inches square). The actual size of each figure element is determined by enlarging or reducing this square, depending on the grid spacing of the input paper and the selected rule.
[0036]
In addition, an image used as an arrow element described in each PostScript program is defined such that an arrow points upward. The arrow direction of each arrow element is determined by rotating this image in accordance with the selected rule.
[0037]
[Color arrangement choice holding unit 107]
The color arrangement option holding unit 107 has a function of holding color arrangement options. In this embodiment, a certain color scheme is expressed by a set of an ID, a character string, and an image (bitmap data). The ID is for each functional unit to uniquely identify each color scheme, and is a character string CC indicating the color scheme followed by a unique positive value (for example, CC3). Character strings and images indicate words and coloring patterns that allow the user to distinguish their color scheme from others.
[0038]
In this embodiment, color arrangement options are held in tabular data. FIG. 4 shows an example of this data.
[0039]
[Option-setting rule correspondence holding unit 108]
The option-setting rule correspondence holding unit 108 has a function of holding a correspondence relationship between the color arrangement held in the color arrangement option holding unit 107 and the words held in the color setting rule holding unit 105 and the shape setting rule holding unit 106. .
[0040]
In this embodiment, the correspondence relationship is maintained by using tabular data in which color IDs and words are associated with each other. In this embodiment, for a certain color scheme, words are associated with each type so that different colors and shapes can be taken for each type of element. The “enclosed” element is associated with four types of colors so that different colors can be used for each element. FIG. 5 shows an example of this data based on the example of FIG.
[0041]
[Color scheme selection unit 109]
The color arrangement selection unit 109 has a function of selecting one of the options held in the color arrangement option holding unit 107 according to a user instruction and storing the result. It also has a function of notifying the result of an instruction in response to an inquiry from another functional unit.
[0042]
In this embodiment, the color scheme held in the color scheme choice holding unit 107 can be displayed on the screen display unit 122 in the format shown in FIG. Multiple choices are displayed in a scrollable window.
[0043]
When the user selects one of the color schemes displayed on the screen, that is, in FIG. 6, a combination of a character string indicating the color scheme and an image is selected (the selected one is surrounded by a thick line). When the area "" is selected, this function unit checks the ID of the selected color scheme.
[0044]
[Marking operation 110]
This is an operation of drawing a figure on the input sheet 111 to be read by the document reading unit 112. In this embodiment, a plurality of color marker pens having different colors are used. The color of the color marker pen (hereinafter referred to as marker color) is assigned so as to uniquely correspond to the element type in the figure, such as “for enclosure”, “for arrow”, and “for character”. In this embodiment, a marker color other than white is used.
[0045]
[Input paper 111]
The input sheet 111 has a medium function for drawing a figure to be read by the document reading unit 112. On the input paper 111, a grid used for detecting the positional relationship between the elements shown in the figure is printed. In the lattice, like straight lines, straight lines are arranged at equal intervals and orthogonally. The grid color is different from the marker color. In this embodiment, the paper color is white and the grid color is other than white.
[0046]
[Original Reading Unit 112]
The document reading unit 112 optically scans a black and white document to be processed and separates it into three primary colors of light, R (red), G (green), and B (blue), and a 256-tone digital color image. Data is generated, and the processing target image holding unit 113 holds this data.
[0047]
One pixel of the generated digital color image data corresponds to 0.0625 mm square (16 × 16 pixels per 1 mm 2; resolution of about 400 dpi) on the original. One pixel data is represented by 24 bits (continuous 3-byte data). The first 8 bits of 24 bits are 256 gradation data of R, the middle 8 bits are 256 gradation data of G, and the last 8 bits are 256 gradation data of B. When all the bits are standing, white is shown, and when all the bits are not standing, black is shown (see FIG. 7).
[0048]
Digital color image data obtained by one scan corresponds to one A4 sheet and is represented by (3360 × 4752) continuous pixel data. The order of the pixel data is uniquely determined from the position of the pixel data on the document. The order of the data is in accordance with an optical scan in which a scan line (implemented with a CCD) along the short side direction of the document is moved in the long side direction. If the words when A4 is placed vertically are used, the pixel data from the top to the 3360th is the pixel at the top of the document arranged in order from left to right. Thus, 4752 sets of pixel data are arranged in order from the top to the bottom of the document.
[0049]
[Processing Target Image Holding Unit 113]
The processing target image holding unit 113 holds digital color image data to be processed (hereinafter referred to as a processing target image). The data size of the processing target image is about 46 Mbytes.
[0050]
[Lattice detection unit 114]
The lattice detection unit 114 has a function of detecting a lattice from the processing target image and instructing the coordinate data changing unit 121 to initialize the coordinate data based on the lattice. Further, it has a function of returning grid information included in a specific pixel data group in the processing target image in accordance with a command from another functional unit. This functional unit stores the color of the grid printed on the input paper 111 in advance and converted into a pixel data format. In addition, a value within an allowable range is also stored for this color. Using this information, the lattice is detected.
[0051]
One grid line is parallel to or perpendicular to the scan line at the time of document input. Therefore, in the data structure of the image to be processed shown in FIG. 7, the lattice can be extracted by examining the regularity of the address of the pixel data group that matches the color of the lattice (including the allowable value).
[0052]
This function unit can detect the number of grid points in the left-right direction of the document, the number of grid points in the vertical direction of the document, and the interval (in units) of the grid points. In addition, for a certain pixel data group, the number of grid points included in the pixel data group and from what number to what number of vertical or horizontal grid lines are detected in the pixel data group Can do.
[0053]
[Box Detection Unit 115]
The box detection unit 115 has a function of detecting an element whose element type is “box” from the processing target image and causing the element data holding unit 101 to newly hold information related to the detected element. The element is detected by a command from the processing control unit 124. One undetected “enclosed” element is detected from the processing target image with a single command. As shown in an algorithm described later, when an element is detected, a value other than nil is returned, and when there is no undetected element, nil is returned.
[0054]
This functional unit stores the color of the “enclosed” marker color previously measured and converted into the pixel data format. In addition, a value within an allowable range is also stored for this color. Using this information, the “enclosing” element is detected.
[0055]
In this function unit, processing is performed by the following algorithm.
[Step 1] The pixel data of the processing target image that matches the marker color (including the allowable range) whose color is “for surrounding” is the first pixel data of the processing target image (that is, the pixel at the upper left corner of the document). Check in order. If there is a match, the address of this pixel data is stored as a “contour pixel data address”. If not, nil is returned and the processing of this functional unit is terminated.
[Step 2] An element generation command is sent to the element data changing unit 102. The returned value is stored as “new element ID”.
[Step 3] With respect to the pixel data found in Step 1, all the pixel data of the marker color “for enclosure” connected to this on the document and forming a closed curve are searched from the processing target image, and these addresses are searched. Is added to the “contour pixel data address” and stored.
[Step 4] All pixel data corresponding to the inside of the closed curve indicated by the “contour pixel data address” on the document is searched from the processing target image, and these addresses and the address of the “contour pixel data address” are set as “enclosed region pixel data”. Store as “Address”.
[Step 5] The “enclosed area pixel data address” is passed to the grid detection unit 114 to check the number of vertical grid lines in the area indicated by these on the manuscript. Store as “Line Range”.
[Step 6] The “enclosed area pixel data address” is passed to the grid detection unit 114, and the number of horizontal grid lines in the area indicated by these on the document is checked. Store as "range".
[Step 7] Find one lattice point that is closest to the center point of the rectangle indicated by the "vertical line range" and "horizontal line range" on the document. It is assumed that this lattice point is an intersection of the Xth vertical line from the left and the Yth horizontal line from the bottom. At this time, an instruction is sent to the element data changing unit so that the value of the attribute “position” of the element indicated by “new element ID” is set to {X, Y}.
[Step 8] The color of the pixel data of “contour pixel data address” is all set to white.
[Step 9] As a result, “new element ID”, “vertical line range”, and “horizontal line range” are returned as a set, and the processing of this functional unit is ended.
[0056]
[Arrow detection unit 116]
The arrow detection unit 116 has a function of detecting an element whose element type is “arrow” from the processing target image and causing the element data holding unit 101 to newly hold information related to the detected element.
[0057]
The element is detected by a command from the processing control unit. One undetected “arrow” element is detected from the processing target image with a single command. As shown in an algorithm described later, when an element is detected, a value other than nil is returned, and when there is no undetected element, nil is returned. This functional unit stores the color measured in advance for the marker color for “arrow” and converted into the pixel data format. In addition, a value within an allowable range is also stored for this color. Using this information, the “arrow” element is detected.
[0058]
In this function unit, processing is performed by the following algorithm.
[Step 1] The pixel data of the processing target image that matches the marker color (including the allowable range) whose color is “for arrow” is the first pixel data of the processing target image (that is, the pixel at the upper left corner of the document). Check in order. If there is a match, the address of this pixel data is stored as a “contour pixel data address”. If not, nil is returned and the processing of this functional unit is terminated.
[Step 2] An element generation command is sent to the element data changing unit 102. The returned value is stored as “new element ID”.
[Step 3] With respect to the pixel data found in Step 1, all the pixel data of the marker color “for arrow” that are connected to the pixel data on the original and form a line are searched from the processing target image, and these addresses are searched. Is added to the “contour pixel data address” and stored.
[Step 4] With respect to the line indicated by the “contour pixel data address” on the document, all pixel data corresponding to the smallest rectangle including the line is searched from the processing target image, and these are set as “arrow area pixel data address”. Remember.
[Step 5] The “arrow area pixel data address” is passed to the grid detection unit 114, and the number of vertical grid lines in the area indicated by these on the document is checked. Store as “Line Range”.
[Step 6] The “arrow region pixel data address” is passed to the lattice detection unit 114 to check from what number to how many horizontal lattice lines are included in the region indicated by these on the document. Store as "range".
[Step 7] Find one lattice point that is closest to the center point of the rectangle indicated by the "vertical line range" and "horizontal line range" on the document. It is assumed that this lattice point is an intersection of the Xth vertical line from the left and the Yth horizontal line from the bottom. At this time, an instruction is sent to the element data changing unit 102 so that the value of the attribute “position” of the element indicated by the “new element ID” is set to {X, Y}.
[Step 8] From which “contour pixel data address” is checked which direction the arrow is pointing. First of all, an arrowhead portion, that is, pixel data in which a line is branched into three on a document is searched. Next, look for the longest line among the three branches. The direction of the arrow can be determined from the address pattern of the pixel data group constituting the line, and the direction of the arrow can be determined depending on which end point of the line the missing part is. The result is stored as “arrow direction”. It should be noted that the orientation reference method is the same as the orientation of the coordinate data.
[Step 9] The color of the pixel data of “contour pixel data address” is all set to white.
[Step 10] As a result, “new element ID”, “vertical line range”, “horizontal line range”, and “arrow direction” are returned as a set, and the processing of this functional unit is terminated.
[0059]
[Text detection unit 117]
The text detection unit 117 has a function of detecting an element whose element type is “text” from the processing target image and causing the element data holding unit 101 to hold information related to the detected element. The element is detected by a command from the processing control unit 124. One undetected “text” element is detected from the processing target image with a single command. As shown in an algorithm described later, when an element is detected, a value other than nil is returned, and when there is no undetected element, nil is returned.
[0060]
This function unit stores the color of the “text” marker color measured in advance and converted into the pixel data format. In addition, a value within an allowable range is also stored for this color. This information is used to detect “text” elements.
[0061]
In this function unit, processing is performed by the following algorithm.
[Step 1] The pixel data of the processing target image that matches the marker color (including the allowable range) whose color is “for text” is the first pixel data of the processing target image (that is, the pixel at the upper left corner of the document). Check in order. If there is a match, the address of this pixel data is stored as a “contour pixel data address”. If not, nil is returned and the processing of this functional unit is terminated.
[Step 2] An element generation command is sent to the element data changing unit 102. The returned value is stored as “new element ID”.
[Step 3] With respect to the pixel data found in Step 1, all pixel data connected to this on the original and forming a line are searched from the processing target image, and these addresses are set as “contour pixel data addresses”. Add and remember.
[Step 4] From the pixel data group of “contour pixel data address”, the image to be processed is examined for pixel data having a marker color of “for text” within 5 mm on the original. If there is, control is passed to step 5; .
[Step 5] With respect to the pixel data found in Step 4, all pixel data connected to this on the original and forming a line are searched from the processing target image, and these addresses are set as “contour pixel data addresses”. Add and remember. Thereafter, control is returned to step 4.
[Step 6] With respect to the “contour pixel data address”, all pixel data corresponding to the smallest rectangle that contains the “contour pixel data address” is searched from the processing target image, and these are stored as the “text area pixel data address”.
[Step 7] The “text area pixel data address” is passed to the grid detection unit 114 to check from what number to how many vertical grid lines are included in the area indicated by these on the document. Store as “Line Range”.
[Step 8] The “text area pixel data address” is passed to the grid detection unit 114, and the number of horizontal grid lines in the area indicated by these on the original is checked. Store as "range".
[Step 9] Find the grid points closest to the center point of the oval shown by the “vertical line range” and “horizontal line range” on the document. It is assumed that this lattice point is an intersection of the Xth vertical line from the left and the Yth horizontal line from the bottom. At this time, an instruction is sent to the element data changing unit 102 so that the value of the attribute “position” of the element indicated by the “new element ID” is set to {X, Y}.
[Step 10] Image data is generated such that only the image of the portion indicated by the “text region pixel data address” is copied from the processing target image. In this image data, the color of the pixel is changed so that the pixel corresponding to the text is black and the other is white. A command is sent to the element data changing unit 102 so that the image data after the change is set to the attribute “text” of the element indicated by “new element ID”.
[Step 11] The color of the pixel data of “contour pixel data address” is all set to white.
[Step 12] As a result, “new element ID” is returned, and the processing of this functional unit is ended.
[0062]
[Color setting unit 118]
The color setting unit 118 has a function of setting the color of an element according to the arrangement and type of the element and the selected color scheme according to a command from another functional unit. The arguments of the setting command are the table ID in the element data holding unit and the element type.
[0063]
In this embodiment, for the element type “enclosed”, which color is assigned is determined from the coordinates set in the attribute “position” in the table indicated by the passed ID. In this function unit, processing is performed by the following algorithm. In this algorithm, the color of the “enclosing” element is assigned based on the second original value of the coordinates set in the attribute “position”. That is, in this algorithm, the same color is assigned to surrounding elements located on the same horizontal grid line on the document.
[Step 1] The table ID and element type passed as arguments are stored as “new element ID” and “new element type”, respectively.
[Step 2] The ID of the color scheme selected by the user is inquired of the color scheme selection unit, and the result is stored as “color scheme ID”.
[Step 3] Check whether “New Element Type” is “Box”. If so, go to step 4. Otherwise, go to step 6.
[Step 4] The coordinate value set in the attribute “position” in the table indicated by “new element ID” is checked, and the second original value is stored as “Y coordinate value”.
[Step 5] The remainder obtained by dividing the “Y coordinate value” by 4 is set as M. If M = 0, N = 4, otherwise N = M. At this time, in the information in the option / setting rule correspondence holding unit, in the color setting rule associated with the “color arrangement ID”, the color associated with the Nth “enclosed” element (in FIG. 5, N = If it is 1, the color of the column of “Box 1”) is stored as “Color application rule”. Proceed to step 7.
[Step 6] In the information in the option-setting rule correspondence holding unit 108, the color setting rule associated with the “color arrangement ID” is searched for the “new element type” element, and this is used as the “color application rule”. Remember.
[Step 7] The L * a * b * value associated with the “color application rule” is searched for in the information in the color setting rule holding unit 105, and the attribute “color” of the element whose value is “new element ID”. The change command is sent to the element data changing unit 102 so as to be set as follows.
[0064]
[Shape setting section 119]
The shape setting unit 119 has a function of setting the shape of an element in accordance with the type of element and the selected color scheme according to a command from another function unit. The arguments of the setting command are the table ID in the element data holding unit 101, the element type, the number of grid points in the horizontal direction, and the number of grid points in the vertical direction. The number of grid points in the left-right direction indicates how many vertical grid lines the element whose value is to be set includes on the document. That is, it is a value that can be obtained from the “vertical line range” returned by the enclosure detection unit 115 or the arrow detection unit 116 as a detection result. The number of grid points in the vertical direction is the same as this.
[0065]
In this function unit, processing is performed by the following algorithm.
[Step 1] The table ID and element type, the number of grid points in the left and right direction, and the number of grid points in the vertical direction passed as arguments are respectively set to “new element ID”, “new element type”, “number of X”, “ Stored as “Y number”.
[Step 2] The color arrangement ID selected by the user is checked by inquiring the color arrangement selection unit 109, and the result is stored as “color arrangement ID”.
[Step 3] In the information in the option-setting rule correspondence holding unit 108, the shape setting rule associated with the “color arrangement ID” is searched for the “new element type” element, and this is used as the “shape application rule”. Remember.
[Step 4] The PostScript program associated with the “shape application rule” is searched for in the information in the shape setting rule holding unit 106, and this value is set to the attribute “shape” of the element of “new element ID”. A change command is sent to the element data change unit 102.
[Step 5] When the “number of X” is other than 1, the length of the image indicated by the element of “new element ID” in the horizontal direction is obtained by multiplying the “number of X” by 100 as an enlargement magnification (unit: percent). Is sent to the element data changing unit so that is enlarged by the enlargement magnification.
[Step 6] When “Y number” is other than 1, the number of “Y number” multiplied by 100 is used as an enlargement magnification (unit: percent), and the vertical length of the image indicated by the element of “new element ID” Is sent to the element data changing unit 102 so that is enlarged by the enlargement magnification.
[0066]
[Orientation changing unit 120]
The direction changing unit 120 has a function of changing the direction of an arrow with respect to an arrow element according to the direction of the arrow on the document and the selected color scheme in accordance with a command from another function unit.
[0067]
In the setting by the shape setting unit 119, the arrow element faces upward in the output image because of the definition of the shape setting rule. This function unit makes the direction of the arrow appropriate after setting by the shape setting unit 119. The arguments of the setting command are the ID of the table in the element data holding unit and the orientation of the arrow on the document. Here, the direction of the arrow on the document is returned by the arrow detection unit 116 as the “arrow direction” as a detection result. This indicates how many angles are formed in the clockwise direction, with the upward direction being 0 degrees on the document. This changing unit 120 uses the element data changing unit 102 to rotate the element indicated by the ID of the table passed as an argument by the direction of the arrow on the document.
[0068]
[Coordinate data initialization unit 121]
The coordinate data initialization unit 121 has a function of initializing the coordinate data of the coordinate data holding unit 103 in accordance with a command sent from the lattice detection unit 114. Further, it has a function of changing the coordinate data of the coordinate data holding unit 103 by using a rule held in the azimuth distance initialization rule holding unit 104 in accordance with a command sent from the color arrangement selection unit 109. This functional unit holds macros and system definition functions such as rest_reference () described above, and uses these when interpreting rules.
[0069]
The initialization command takes, as arguments, the number of grid points in the horizontal direction of the document, the number of grid points in the vertical direction of the document, and the interval (in points) of the grid points. When the initialization is instructed, this function unit first stores the number of grid points in the left and right direction of the document as XPOTINMAX and the number of grid points in the vertical direction of the document as YPOINTMAX. Next, (XPOINTMAX.times.YPOINTMAX) pieces of arrangeable coordinate data are generated in the coordinate data holding unit. For each coordinate data, a coordinate ID is uniquely assigned from {1, 1} to {XPOINTMAX, YPOINTMAX}. Finally, in order to initialize the azimuth distance of the coordinate data, after executing refst_reference ({1, 1}), execute rule_1 () with the interval of the passed grid points as an argument.
[0070]
For example, when initialization is commanded with the number of grid points in the left and right direction of the document set to 5, the number of grid points in the vertical direction of the document set to 8 and the interval between the grid points set to 144, this function unit is as shown in FIG. Set the coordinate arrangement.
[0071]
[Screen Display 122]
The screen display unit 122 has a function of exercising the above-described various instructions / selections to display options and value input requests on the screen.
[0072]
[Figure Printing Unit 123]
The figure printing unit 123 has a function of interpreting element data held in the element data holding unit 101 and converting it into a CMYK raster image according to a user instruction, and printing the converted image on a paper / OHP sheet. When drawing the elements in the figure, the elements with the smaller attribute “display order” values are drawn in order by overwriting. In addition, the drawing is performed so that the azimuth 0 is always upward on the paper / OHP sheet. When a certain element has a value in the attribute “text”, the drawing is first performed according to the attribute “color” and “shape”, and then the text is overwritten based on the value of the attribute “text”.
[0073]
[Processing control unit 124]
The process control unit 124 has a function of supervising the entire process flow. It also has a function of receiving user instructions for starting and stopping the entire system.
[0074]
FIG. 9 shows the flow of processing in the embodiment. This processing flow is controlled and executed by the processing control unit 124. In FIG. 9, first, when a color scheme is selected and input (S1 and S2), the lattice detection unit 114 detects a lattice and initializes coordinate data (S3). Next, every time an enclosure is detected by the enclosure detector 115, color setting and shape setting are performed (S4, S5, S6 and S7). Next, every time an arrow is detected by the arrow detector 116, the color, shape, and direction of the arrow are set (S8, S9, S10, S11, and S12). Next, whenever the text is detected by the text detection unit 117, the color of the text is set. Finally, an image is generated and printed by the figure printing unit 123 (S16).
[0075]
In this embodiment, for example, when “business standard” is selected and a sketch as shown in FIG. 10 is input, an image as shown in FIG. 11 is generated.
[0076]
In the above, Example 1 was demonstrated. In the first embodiment, various modifications such as the following changes are possible.
[0077]
In the first embodiment, only the “enclosed” element changes the color scheme according to the arrangement, but other types of elements can be modified to change the color arrangement according to the arrangement in the same manner as the “enclosed” element. In addition, it is possible to prepare a choice as to which kind of color scheme is to be changed according to the arrangement, and to change the color scheme according to the selection.
[0078]
In the first embodiment, the color scheme is changed using only the second original value of the coordinate value set in the attribute “position” of the element data. However, only the first original value is used, or It can be modified to use both one- and second-element values.
[0079]
In the first embodiment, the color assignment is fixedly determined such that the element in which grid line is this color, but the color is not assigned to the grid line in which no element is arranged. It can be modified to perform dynamic assignment such that assignment is made only to the grid line on which the element is arranged.
[0080]
In the first embodiment, the color assignment is sequentially changed for each grid line, but it can be modified so that several lines are assigned together.
[0081]
In the first embodiment, the setting of various rules is fixed, but the rules can be modified so that the user can replace them. Thereby, it becomes possible to prepare the composition of a figure according to a user's occupation, preference, or fashion.
[0082]
[Example 2]
Next, a second embodiment of the present invention will be described.
[0083]
This embodiment is used in an environment in which drawing is performed interactively on a screen using a word processor, a digital copying machine, and drawing software. In this embodiment, the user interactively creates and places elements of the diagram. Thereafter, when the user designates a color scheme, the color of each element is automatically set from the arrangement of the elements in the figure.
[0084]
FIG. 12 shows the overall configuration of the drawing apparatus of the second embodiment. 10, parts corresponding to those in FIG. 1 are denoted by corresponding reference numerals. In the case of the same configuration, the description will not be repeated for that purpose.
[0085]
In FIG. 12, the drawing apparatus includes a color arrangement selection unit 209, an element generation instruction unit 225, an element arrangement instruction unit 226, an element deletion instruction unit 227, an azimuth distance change instruction unit 228, and a center coordinate instruction unit 229. It is designed to accept instructions. The user instruction is executed by the execution unit, that is, the element data changing unit 202, the coordinate data changing unit 221, the figure printing unit 223, the color setting unit 218, the shape setting unit 219, and the like. The processing control unit 224 controls the entire control.
[0086]
In executing each unit, a storage unit, that is, an element data holding unit 201, a coordinate data holding unit 203, an azimuth distance initialization rule holding unit 204, a color setting rule holding unit 205, a shape setting rule holding unit 206, a color arrangement option holding unit 207, The option-setting rule correspondence holding unit 208 stores various data. The diagram being generated is displayed on the screen display unit 222 each time, and the diagram finally generated is printed by the diagram printing unit 223.
[0087]
Hereinafter, the configuration of each unit will be described in detail.
[0088]
[Element data holding unit 201]
Since the element data holding unit 201 is the same as the element data holding unit 101 of the first embodiment, description thereof is omitted.
[0089]
[Element data changing unit 202]
The element data changing unit 202 has a function of changing information held by the element data holding unit 201 in response to a command from another function unit. In addition, when a command to change is received, the screen rewriting command is sent to the screen display unit 222 after performing the changing process.
[0090]
The generation of the elements in the figure, that is, the generation of a new table is performed by a command sent from the element generation instruction unit 225. When this command is received, a new table is first created in the element data holding unit, and then a value is assigned to each attribute value in the table. Since the attributes “shape” and “text” are passed as arguments of the command, the values are substituted into the table as attribute values. The attribute “position” uses the coordinate ID {1, 1} as an attribute value as a default.
[0091]
The attribute “display order” is the attribute value of the new element attribute “display order” obtained by checking the largest value at that time as the attribute value of the table held in this functional unit and adding 1 to the value. And
[0092]
Arrangement of elements in the figure is performed by a command sent from the element arrangement instruction unit 226. First, an element whose arrangement is to be changed is specified. This is the attribute having the largest value of the attribute “display order” among those having the coordinate ID of the movement source passed as an argument of the command as the value of the attribute “position”. If the element can be specified, the value of the attribute “position” of the element is replaced with the coordinate ID of the movement destination passed as an argument. If the PostScript program is passed as an argument, it is substituted into the table as the value of the attribute “text”. The attribute “display order” is the attribute value of the new element attribute “display order” obtained by checking the largest value at that time as the attribute value of the table held in this functional unit and adding 1 to the value. And
[0093]
Deletion of elements in the figure, that is, deletion of a certain table is performed by a command sent from the element deletion instruction unit 227. What is deleted is the one having the largest attribute “display order” value among those having the coordinate “ID” passed as an argument of the command as the value of the attribute “position”.
[0094]
[Color setting rule holding unit 205]
Since the color setting rule holding unit 205 is the same as the color setting rule holding unit 105 of the first embodiment, description thereof is omitted.
[0095]
[Shape setting rule holding unit 206]
Since the shape setting rule holding unit 206 is the same as the shape setting rule holding unit 106 of the first embodiment, description thereof is omitted.
[0096]
[Element generation instruction unit 225]
The element generation instruction unit 225 receives a user instruction, generates a new figure element using the shape setting rule holding unit 206, and stores this in the element data holding unit 201 via the element data change unit 202 have. It also has a function to accept text input.
[0097]
The user's instruction is given by selecting a word indicating a shape from the table held by the shape setting rule holding unit 206 regarding the attribute “shape” of the element. At this time, if text is input, the text can be represented by a newly created diagram element, that is, the text displayed inside the element.
[0098]
After the selection is made, the element generation instructing unit 225 sends a command for creating a new table to the element data changing unit 202. As arguments of this command, the following are passed to the element data changing unit 202.
A PostScript program associated with a word representing the shape selected by the user. (It becomes the value of attribute "shape")
* PostScript program (attributes) for drawing the input text with the font / number of lines / line spacing set so that the input text is located inside the display area occupied by the PostScript program as much as possible. "Text" value).
[0099]
[Element arrangement instruction unit 226]
The element arrangement instruction unit 226 has a function of receiving an instruction from the user and moving an element of a figure arranged at a certain coordinate to another coordinate. It also has a function to accept text input.
[0100]
The user's instruction is performed by first selecting the movement source coordinates. Among the elements of the figure arranged at this coordinate, the element displayed at the forefront is the object of movement. When text is input at this time, the input text can be set as the value of the attribute “text” of the element of the diagram to be moved. Thereafter, a coordinate as a movement destination is selected.
[0101]
After the selection is made, the element arrangement instruction unit 226 sends an attribute value change command to the element data change unit 202. As arguments of this command, the following are passed to the element data changing unit 202.
* ID of the first selected coordinate. (Indicates the source)
* ID of the coordinate selected later. (Show destination)
* PostScript program (attributes) for drawing the input text with the font / number of lines / line spacing set so that the input text is located inside the area occupied by the Postscript program on the display as much as possible. "Text" value).
[0102]
[Element deletion instruction unit 227]
The element deletion instructing unit 227 has a function of receiving an instruction from the user and deleting an element of the figure arranged at an arbitrary coordinate. The user's instruction is performed by selecting coordinates. Among the elements of the figure arranged at this coordinate, the element displayed at the forefront is the object to be deleted. After the user's instruction, a deletion command is sent to the element data changing unit 202 using the ID of the selected coordinate as an argument.
[0103]
[Coordinate data holding unit 203]
The coordinate data holding unit 203 has a function of holding information about coordinates on a two-dimensional plane on which elements of the figure can be arranged. In this embodiment, the number of coordinates that can be arranged is fixed, and is 16 in total. Since the definition of the coordinate data is the same as that in the first embodiment, the description regarding this functional unit is omitted.
[0104]
[Azimuth distance initialization rule holding unit 204]
Since the azimuth distance initialization rule holding unit 204 is the same as the azimuth distance initialization rule holding unit 104 of the first embodiment, description thereof is omitted.
[0105]
[Azimuth distance change instruction unit 228]
The azimuth distance change instruction unit 228 has a function that allows the user to instruct change of the azimuth and distance for arbitrary coordinate data. The user's instruction is given by first selecting the coordinates to be changed. Next, the position on which the coordinates are placed is selected on the screen. After the selection is made, this functional unit sends an attribute value change command to the coordinate data changing unit. As arguments of this command, the following are passed to the coordinate data changing unit.
* ID of the selected coordinate.
* Distance between the original position of the selected coordinates on the screen and the newly specified position.
* The orientation of the original position on the screen of the selected coordinates as seen from the newly specified position.
[0106]
[Coordinate data changing unit 221]
The coordinate data changing unit 221 has a function of initializing coordinate data, like the coordinate data changing unit 221 of the first embodiment. Further, the coordinate data of the coordinate data holding unit 203 is changed by a command sent from the azimuth distance change instruction unit 228. After changing the coordinate data, this function unit sends a screen rewrite command to the screen display unit 222.
[0107]
When a change in azimuth distance is instructed, this function unit responds to the argument of the command.
Change the attribute value of the coordinate. At the same time, these attribute values are changed so that the position on the screen does not change with respect to all coordinates whose observation targets are the coordinates. A new azimuth and distance of a certain coordinate is expressed as Vnew, a vector v obtained from the attribute value of the current distance and azimuth of the coordinate, and a vector Vdelta obtained from the distance and azimuth as arguments of the change command. Can be calculated as follows.
[0108]
For the coordinates specified by the argument of the change command: Vnew = V + Vdelta
Coordinates to be observed: Vnew = V−Vdelta
For example, after the coordinate arrangement is initialized as shown in FIG. 13, when the azimuth distance change command is passed to this function unit with the coordinate ID {2, 3}, the distance 72, and the azimuth 315 as arguments, The coordinate arrangement is set as shown in FIG.
[0109]
[Center coordinate designation unit 229]
The center coordinate designating unit 229 has a function that allows the user to designate coordinates as the center point of the color scheme. It also has a function of storing designated coordinates and returning the coordinates in response to an inquiry from another functional unit.
[0110]
As an initial state of coordinates, this functional unit stores coordinates {1, 1}. The designation by the user is performed by selecting coordinates on the screen.
[0111]
[Color scheme selection holding unit 207]
Since the color arrangement option holding unit 207 is the same as the color arrangement option holding unit 207 of the first embodiment, the description thereof is omitted.
[0112]
[Option-setting rule correspondence holding unit 208]
The option-setting rule correspondence holding unit 208 has a function of holding the correspondence relationship between the color arrangement held in the color arrangement option holding unit 207 and the words held in the color setting rule holding unit 105. In this embodiment, the correspondence relationship is maintained by using tabular data in which color IDs and words are associated with each other. In this embodiment, a plurality of colors are associated with a certain color scheme so that the color of the element is changed according to the distance from the center coordinate. FIG. 15 shows an example of this data.
[0113]
[Color scheme selection unit 209]
The color arrangement selection unit 209 has a function of selecting one of the options held in the color arrangement option holding unit according to a user instruction and sending a color setting command to the color setting unit using the result as an argument. The screen display of options by the color arrangement selection unit is the same as in the first embodiment.
[0114]
[Color setting unit 218]
The color setting unit 218 has a function of setting the color of an element in the element data holding unit 201 according to the arrangement of the element and the selected color arrangement according to a command from the color arrangement selection unit 209. In this embodiment, the color of each element is set based on the coordinate value set in the attribute “position” of the element. The determination of the color of an element depends on how far the position of the element is from the coordinates stored in the center coordinate designating unit.
[0115]
In this function unit, processing is performed by the following algorithm.
[Step 1] The color scheme ID passed as an argument is stored as a “color scheme ID”.
[Step 2] The value of the attribute “color” is set to nil for all the tables in the element data holding unit 201.
[Step 3] The table in the element data holding unit 201 checks whether the attribute “color” has a value of nil. If not, the processing of this functional unit is terminated.
[Step 4] The ID of the table found in step 3 is stored as a “processing target ID”.
[Step 5] The coordinate value set in the attribute “position” in the table indicated by “processing object ID” is checked, and the value is stored as “processing object coordinates”.
[Step 6] The center coordinate designation unit 229 is queried for the center coordinates, and the result is stored as “center coordinates”.
[Step 7] When the first and second element values of the “coordinates to be processed” are x and y, respectively, and the first and second element values of the “center coordinates” are X and Y, respectively, The value N is calculated.
N = | X−x | + | Y−y | (where | a | indicates the absolute value of a)
[Step 8] Let M be the remainder of dividing N in Step 7 by 4. At this time, in the information in the option-setting rule correspondence holding unit 208, the column of M values is stored as the “color application rule” in the “color arrangement ID” row.
[Step 9] The L * a * b * value associated with the “color application rule” is searched for in the information in the color setting rule holding unit 105, and the attribute “color” of the element whose value is “new element ID”. The change command is sent to the element data changing unit 202 so that Go to step 3.
[0116]
[Shape setting section 219]
Since the shape setting unit 219 is the same as the shape setting unit 119 of the first embodiment, description thereof will not be repeated.
[0117]
[Screen Display Unit 222]
The screen display unit 222 has a function of interpreting element data held in the element data holding unit 201 by a screen rewriting command, converting the data into an RGB raster image, and displaying the converted image on the display. In addition, a cursor that moves on the pointing device is displayed on the screen, and has a function that enables an operation of directly selecting a coordinate point or an element of a figure at the time of various instructions / selections described above.
[0118]
When drawing the elements in the figure, the elements with the smaller attribute “display order” values are drawn in order by overwriting. In addition, drawing is performed so that the azimuth 0 always faces upward on the screen. When a certain element has a value in the attribute “text”, the drawing is first performed according to the attribute “color” and “shape”, and then the text is overwritten based on the value of the attribute “text”.
[0119]
[Figure Print Unit 223]
The figure printing unit 223 has a function of interpreting element data held in the element data holding unit 201 and converting it into a CMYK raster image according to a user instruction, and printing the converted image on a paper / OHP sheet.
[0120]
When drawing the elements in the figure, the elements with the smaller attribute “display order” values are drawn in order by overwriting. In addition, the drawing is performed so that the azimuth 0 is always upward on the paper / OHP sheet. When a certain element has a value in the attribute “text”, the drawing is first performed according to the attribute “color” and “shape”, and then the text is overwritten based on the value of the attribute “text”.
[0121]
[Processing control unit 224]
The process control unit 224 has a function of supervising the entire process flow. It also has a function of receiving user instructions for starting and stopping the entire system.
[0122]
The instruction input acceptance time is sequentially assigned to each functional unit that can issue a user instruction. When there is an input from the user in the functional unit to which time is allocated, allocation to other functional units is suspended until the processing according to the request is completed.
[0123]
The flow of processing in the embodiment is shown in FIG. This process flow is controlled and executed by the process control unit 224. In FIG. 16, the end of the process is monitored in step S101, and the user's instruction is determined in steps S102, S102, S104, S106, S108, S110, S112, and S115. The operation is terminated or the operation of each functional unit is executed (S103, S105, S107, S109, S111, S113, and S114). Each functional unit has already been described.
[0124]
In this embodiment, for example, when the elements shown in FIG. 17 are arranged, if the center coordinates are {2, 4} and the sharp color is selected as the color arrangement, the color arrangement as shown in FIG. 18 is obtained. be able to.
[0125]
[Example 3]
Next, a third embodiment of the present invention will be described. In this embodiment, a monochrome document is colored with a predetermined color scheme. In this embodiment, after marking with a color marker pen inside a closed area to be colored in a black and white original, the original is read, and based on this, the color arrangement corresponding to the position is applied to the marked closed area. A color manuscript with a mark is output.
[0126]
FIG. 19 shows the drawing apparatus of this embodiment as a whole. This drawing apparatus can be realized as a dedicated word processor, digital copier, general-purpose personal computer, workstation, or host software. In FIG. 19, portions corresponding to those in FIG. 1 or FIG. In the case of the same configuration, the description will not be repeated for that purpose.
[0127]
In this figure, the plotting apparatus has a gradation selection unit 336 and accepts user instructions. The document reading unit 112 reads a document created by performing a marking operation on a black and white document. The user instructions are the execution unit, that is, the figure printing unit 323, the mark detection unit 330, the closed region detection unit 331, the closed region upper end detection unit 333, the closed region left end detection unit 334, the closed region color determination unit 337, and the color change unit. 338 etc. The processing control unit 124 controls the entire control.
[0128]
When each unit is executed, the storage unit, that is, the processing target image holding unit 313, the gradation rule holding unit 334, and the gradation direction option holding unit 335 store various data. The generated diagram is printed by the diagram printing unit 123.
[0129]
Hereinafter, the configuration of each unit will be described in detail.
[0130]
[Marking operation 310]
The marking operation 310 has a function for placing a mark on a monochrome document to be read by the document reading unit 312. Realized with a single color marker pen. This pen is used to mark an arbitrary place inside the closed area to be colored.
[0131]
[Original Reading Unit 312]
Since the document reading unit 312 is the same as the document reading unit 112 of the first embodiment, description thereof is omitted.
[0132]
[Processing Image Holding Unit 313]
Since the processing target image holding unit 313 is the same as the processing target image holding unit 313 of the first embodiment, description thereof is omitted.
[0133]
[Mark detection unit 330]
The mark detection unit 330 has a function of detecting one set of pixel data corresponding to one mark from the processing target image and storing it. This functional unit measures the color of the color marker used in the marking operation 310 and holds data representing the color in the form of pixel data. In addition, an allowable value for the color is also held at the same time.
[0134]
A set of pixel data corresponding to a mark is a group of pixel data that is continuous on a document and has a marker color (including an allowable value) held by this functional unit. The detected set of pixel data is stored as a set (hereinafter referred to as a mark pixel set) whose elements are the addresses of the pixel data. The mechanism for storing this controls the addition of elements so that the elements of the set do not overlap (ie, the addresses that are elements are all different). In this function unit, processing is performed by the following algorithm. Note that this algorithm is recursive.
[Step 1] If there are elements in the stored mark pixel set, all of them are deleted.
[Step 2] One pixel data that matches the marker color held in this functional unit is selected from the pixel data in the processing target image, and the address of the pixel data is stored as the current address.
[Step 3] The marker color indicated by the pixel data indicated by the current address and its allowable color are stored as the target color.
[Step 4] The current address is added to the mark pixel set.
[Step 5] With respect to the pixel data indicated by the current address, the document is searched for pixel data located on the top, bottom, left, and right. If any of these values matches the target color and the address of the pixel data is not in the mark pixel set, the address of these pixel data is stored.
[Step 6] Steps 4 to 6 are executed for the address of the pixel data stored in Step 5 by using these as the current address sequentially.
[0135]
[Closed region detection unit 331]
The closed region detection unit 331 has a function of detecting a pixel group corresponding to the innermost closed region that includes the mark on the original and detecting the mark detected by the mark detection unit 310 and storing the address of the pixel group. Have.
[0136]
The pixel corresponding to the outline of the closed region is black because a black-and-white document is input. Therefore, the search for the closed region may be performed by searching the black pixel group forming a closed curve on the document with the address held by the mark detection unit as the search start point toward the outside on the document. This is a closed region obtained by a pixel group (not including the found pixel group) located on the inner side of the document with respect to the pixel group found by this search.
[0137]
The data stored in this functional unit indicates the address range of the pixel data. Specifically, it is a set having a pair indicating an address start point and end point as elements. A certain group is arranged on the same line scan line (3360 pixels arranged in the document short side direction).
[0138]
[Closed region upper end detection unit 332]
The closed region upper end detection unit 332 has a function of checking and storing the number of the upper end of the detected closed region counted from the scan line from the top. This function unit searches for the pixel present on the top of the document from the address of the data detected by the closed region detection unit 331. Then, from the address of the pixel, the number of the scan line in the pixel is checked. This functional unit stores this “number”.
[0139]
[Closed region left end detection unit 333]
The closed region left end detection unit 333 has a function of counting and storing the left end of the detected closed region in a pixel group indicating one scan line, and determining the number from the left. This function unit searches the leftmost pixel on the document from the address of the data detected by the closed region detection unit 331. Then, from the address of the pixel, the pixel is counted in a set of pixel groups indicating one scan line, and the number from the left is checked. This functional unit stores this “number”.
[0140]
[Gradation rule holding unit 334]
The gradation rule holding unit 334 has a function of holding a plurality of rules for applying a continuous color change as an element color scheme. For each rule, this functional unit stores the rule ID, the color of the start point of the color change, and the color of the end point of the color change. These colors are expressed in the same format as the pixel data. It should be noted that the rule held by this functional unit is such that when a color is applied according to the rule, it does not become the same color as the marker color. This is because the detection by the closed region detection unit 331 is performed correctly.
[0141]
[Gradation direction option holding unit 335]
The gradation direction option holding unit 335 has a function of holding options in the direction in which the color change is applied. In this embodiment, there are two options, “left to right” and “top to bottom”.
[0142]
[Gradation selection unit 336]
The user has a function of selecting the rule in the gradation rule holding unit 334 and the option in the gradation direction option holding unit 335, respectively, and storing the selection result. In addition, it has a function of returning a stored selection result in response to an inquiry from another functional unit. In response to the query, the result of combining the rule ID and the direction value is returned.
[0143]
[Closed region color determination unit 337]
The closed region color determination unit 337 determines the color of the closed region detected by the closed region detection unit 331 based on the selection result by the gradation selection unit 336, and changes the color of the closed region using the color change unit 338. have. The processing of this functional unit follows the following algorithm.
[Step 1] The gradation selection unit 336 is inquired about the selected gradation rule and gradation direction, and the returned results are stored as “rule ID” and “designated direction”, respectively.
[Step 2] If the designated direction is “left to right”, a detection command is sent to the closed region left end detection unit 333, and if “from top to bottom”, a detection command is sent to the closed region upper end detection unit 332. The returned result is stored as “line number”.
[Step 3] If the specified direction is “left to right”, 3360 is stored as the “number of lines”, and 4752 is stored as the “number of lines” if it is “from top to bottom”.
[Step 4] A value (real value) obtained by dividing "line number" by "number of lines" is stored as "change rate".
[Step 5] The gradation rule holding 334 searches for the “starting color” associated with the “rule ID”. From the searched 8-bit data for each RGB of 24-bit data, values obtained by converting each of them into decimal numbers are calculated and stored as “R initial value”, “G initial value”, and “B initial value”.
[Step 6] The gradation rule holding unit 334 searches for the “end point color” associated with the “rule ID”. From the searched 24-bit data for each RGB, 8-bit data is calculated, each of which is converted to a decimal number, and these values are stored as “R terminal value”, “G terminal value”, and “B terminal value”.
[Step 7] Values obtained by subtracting the initial value from the end values of each of RGB are multiplied by the rate of change, and stored as “R change value”, “G change value”, and “B change value”, respectively.
[Step 8] The change value is added to the initial values of RGB. Each value after addition is rounded off to the nearest whole number. A value obtained by converting each integer value into binary 8 bits is calculated, and RGB 24-bit data is generated from these values.
[Step 9] The 24-bit data finally obtained in Step 8 is used as an argument to instruct the color changing unit 338 to change the color. After the color change by the color changing unit is finished, the processing of this functional unit is finished.
[0144]
[Color changing unit 338]
The color changing unit 338 has a function of changing the closed area detected and stored by the closed area detecting unit 331 to a color passed as an argument according to a command from the closed area color determining unit 337. This function unit changes the 24-bit value to match the color passed as an argument if the pixel color is white or marker color for the pixel data at the address stored in the closed region detection unit 331 To do. As a result, a color is applied to a portion in the area where the color is not painted and a marked portion. In addition, the color of the black portion of the input document such as characters does not change.
[0145]
[Figure Print Unit 323]
The diagram printing unit 323 has the same function as the diagram printing unit 123 of the first embodiment, and also has a function of outputting a plurality of copies in response to a command from the processing control unit.
[0146]
[Processing control unit 324]
It has functions to control and execute the entire process. The function unit has a function that allows the user to instruct the start of copying and the number of copies.
[0147]
FIG. 20 shows the flow of processing in the third embodiment. In FIG. 20, when the gradation rule and direction are selected and further copying is instructed (steps S201 to S203), the document is read and the presence or absence of a mark is detected (steps S204 to S206). When the mark is detected, the closed region 331 area detection unit detects the closed region including the mark, and the closed region color determination unit 337 determines the color (steps S208 and S209). When the mark is not detected or when all the colors of the closed area are determined, the designated number of copies are generated (step S207).
[0148]
This is the end of the description of the embodiment of the present invention.
[0149]
【The invention's effect】
As described above, according to the present invention, it is possible to easily generate a figure with a balanced color arrangement simply by specifying a color arrangement rule. In particular, if a color arrangement pattern according to the color arrangement rule is displayed and a drawing target or the like is displayed together with this, the user can create a figure that matches the purpose and has no problem in color arrangement without any special skill. In addition, if a black and white image or a single color image is attached with a color mark to specify an element to be colored, and a coloring rule is also specified, a color diagram with a balanced coloring can be easily generated from the monochrome image.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a first embodiment of the present invention as a whole.
FIG. 2 is a diagram illustrating a description of coordinate data in the first embodiment.
FIG. 3 is a flowchart for explaining the operation of rule 1 stored in an azimuth distance setting rule holding unit 104 according to the embodiment.
FIG. 4 is a diagram illustrating data in a color arrangement option holding unit 107 according to the first embodiment.
FIG. 5 is a diagram illustrating data in an option-setting rule correspondence holding unit according to the first embodiment.
6 is a diagram showing a color scheme selection screen provided by a color scheme selection unit 109 according to the first embodiment. FIG.
FIG. 7 is a diagram illustrating the operation of the document reading unit 112 according to the first embodiment.
FIG. 8 is a diagram illustrating lattice coordinates initialized by the coordinate data initialization unit 121 according to the first embodiment.
FIG. 9 is a flowchart illustrating the operation of the first embodiment.
FIG. 10 is a diagram showing a rough original picture drawn for input used in the first embodiment.
11 is a diagram showing a design of a drawing generated using the “business standard” color scheme using the input sheet of FIG.
FIG. 12 is a block diagram showing Embodiment 2 of the present invention as a whole.
FIG. 13 is a diagram for explaining a state of coordinates by the coordinate data changing unit 221 according to the second embodiment.
FIG. 14 is a diagram illustrating another state of coordinates by the coordinate data changing unit 221 according to the second embodiment.
FIG. 15 is a diagram illustrating data in an option-setting rule correspondence holding unit 208 according to the second embodiment.
FIG. 16 is a flowchart for explaining the operation of the second embodiment;
FIG. 17 is a diagram showing a design before color arrangement in Example 2 described above.
18 is a diagram showing a state in which a color scheme is applied to the design of FIG.
FIG. 19 is a block diagram showing Embodiment 3 of the present invention as a whole.
FIG. 20 is a flowchart for explaining the operation of the third embodiment.
[Explanation of symbols]
101, 201, 301 Element data holding unit
102, 202 Element data change part
103, 203 Coordinate data holding unit
107, 207 Coloration option holding unit
108, 208 Option-setting rule correspondence holding unit
109, 209 Color scheme selection section
111 input paper
112 Document reading unit
118 color setting section
331 Closed area detection unit
334 Gradation rule holding part
335 Gradation direction option holding part
336 Gradation selection part
337 Closed area color determination unit

Claims (3)

図を構成する要素の位置関係に応じて、上記要素に割り当てる色を決定する複数の配色規則に関する情報を記憶する記憶手段と、
上記配色規則に応じた配色パターンを表示する手段と、
作図対象の図に対して配色規則を指定する手段と、
指定された上記配色規則に基づいて上記記憶手段を参照し、上記作図対象の図の要素の色を決定する手段と、
上記作図対象の図の要素について決定された色に応じて、色付けの施された上記作成対象の図を表す画像情報を生成する手段とを有し、
上記配色規則により位置関係に応じて色を割り当てられる上記図の要素は、所定の種類の要素とし、
上記記憶手段は、上記所定の種類の要素について、上記配色規則に関する情報を記憶し、さらに上記配色規則により位置関係によらず一意の色を割り当てられる種類の要素について、その種類毎に割り当てる色に関する情報を記憶することを特徴とする作図装置。
Storage means for storing information relating to a plurality of coloration rules for determining colors to be assigned to the elements according to the positional relationship of the elements constituting the diagram;
Means for displaying a color pattern according to the color rule;
Means for specifying a color scheme for a drawing to be drawn;
Means for referring to the storage means based on the specified color arrangement rule and determining the color of an element of the drawing target drawing;
Means for generating image information representing the colored drawing of the drawing target according to the color determined for the drawing drawing element.
The elements in the above figure to which colors are assigned according to the positional relationship according to the color arrangement rules are elements of a predetermined type,
The storage means stores information relating to the color arrangement rule for the predetermined type of element, and further relates to a color assigned for each type of an element of a type to which a unique color can be assigned regardless of the positional relationship by the color arrangement rule. A drawing device characterized by storing information.
上記配色規則に応じた配色パターンを表示する手段は、上記配色規則に対応する図の特徴を表示する請求項1記載の作図装置。The drawing apparatus according to claim 1, wherein the means for displaying a color arrangement pattern according to the color arrangement rule displays a feature of the figure corresponding to the color arrangement rule. 上記記憶手段は、上記配色規則と、上記要素の形状との対応関係を規定するデータを記憶する請求項1または2記載の作図装置。The drawing apparatus according to claim 1, wherein the storage unit stores data defining a correspondence relationship between the color arrangement rule and the shape of the element.
JP27215295A 1995-10-20 1995-10-20 Plotter Expired - Lifetime JP3617145B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP27215295A JP3617145B2 (en) 1995-10-20 1995-10-20 Plotter
US08/730,761 US5798766A (en) 1995-10-20 1996-10-15 Drawing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP27215295A JP3617145B2 (en) 1995-10-20 1995-10-20 Plotter

Publications (2)

Publication Number Publication Date
JPH09114958A JPH09114958A (en) 1997-05-02
JP3617145B2 true JP3617145B2 (en) 2005-02-02

Family

ID=17509820

Family Applications (1)

Application Number Title Priority Date Filing Date
JP27215295A Expired - Lifetime JP3617145B2 (en) 1995-10-20 1995-10-20 Plotter

Country Status (1)

Country Link
JP (1) JP3617145B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005124690A1 (en) * 2004-06-22 2005-12-29 Seiko Epson Corporation Coloration assisting system, coloration assisting program, storage medium, and coloration assisting method

Also Published As

Publication number Publication date
JPH09114958A (en) 1997-05-02

Similar Documents

Publication Publication Date Title
US5798766A (en) Drawing system
JP3166555B2 (en) Document processing device
US20080141123A1 (en) Editing apparatus and editing method
JPH11136528A (en) Processor and method for information processing and program storage medium
JP3589254B2 (en) Plotting device
JP2800672B2 (en) Document processing device
AU2013383628B2 (en) Image processing apparatus, program, computer readable medium and image processing method
JP4821485B2 (en) Image processing apparatus and program
US6067555A (en) Device for coloration of black and white documents
JP3617145B2 (en) Plotter
US5442736A (en) Correlation of cursor position to shapes displayed on a video display screen
US4625288A (en) Method and apparatus for creating a structured image data set based on acquired image data
JP2014171219A (en) Mechanism for top coat processing
US6496198B1 (en) Color editing system
JP3192066B2 (en) Drawing method and drawing device
JP3589253B2 (en) Plotting device
JP4271998B2 (en) Image search output device
JP2813815B2 (en) Layouter for flyers and catalogs
JP2014006445A (en) Image processing system
KR20000052433A (en) Method of creating two demensional shapes drawing system
JP3601175B2 (en) Plotting device
JPH1021377A (en) Image processor
JP7401344B2 (en) Image processing system for digitizing documents, its control method and program
JP2008204342A (en) Image processor and image processing program
JP2562498B2 (en) Coordinate detection method for specified figure

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040409

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040607

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040713

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040910

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20041101

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20071119

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20081119

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091119

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101119

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111119

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111119

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121119

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121119

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20131119

Year of fee payment: 9

EXPY Cancellation because of completion of term