JP5880418B2 - Image processing apparatus and program - Google Patents
Image processing apparatus and program Download PDFInfo
- Publication number
- JP5880418B2 JP5880418B2 JP2012273085A JP2012273085A JP5880418B2 JP 5880418 B2 JP5880418 B2 JP 5880418B2 JP 2012273085 A JP2012273085 A JP 2012273085A JP 2012273085 A JP2012273085 A JP 2012273085A JP 5880418 B2 JP5880418 B2 JP 5880418B2
- Authority
- JP
- Japan
- Prior art keywords
- instruction
- image processing
- setting means
- executed
- condition
- 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 - Fee Related
Links
Images
Description
本発明は、画像処理装置及びプログラムに関する。 The present invention relates to an image processing apparatus and a program.
画像に対して、例えば、フォーマット変換、色変換、拡大、縮小、などといった画像処理を実行する画像処理装置が存在する。特許文献1には、スクリプトが表す実行順序を解釈して、解釈された実行順序で画像処理を実行する技術が記載されている。特許文献2には、取得した画像を、指示書によって指定された複数種類の画像に変換する技術が記載されている。
There are image processing apparatuses that perform image processing such as format conversion, color conversion, enlargement, reduction, etc. on an image. Japanese Patent Application Laid-Open No. 2004-228561 describes a technique for interpreting an execution order represented by a script and executing image processing in the interpreted execution order.
本発明の目的の1つは、利用者が、画像処理命令に用いられる属性の型を意識せずに、複数の画像処理の実行指示が記述された画像処理指示情報を作成できるようにすることにある。 One of the objects of the present invention is to allow a user to create image processing instruction information in which a plurality of image processing execution instructions are described without being conscious of the type of attribute used in the image processing instruction. It is in.
請求項1に記載の発明は、画像処理装置であって、複数の画像処理の識別情報、並びに、条件分岐が記述された画像処理指示情報を取得する取得手段と、前記条件分岐での条件のそれぞれについて、条件を満足する場合に実行されることが前記画像処理指示情報に記述されている前記識別情報に対応付けられる命令を、実行対象の命令として設定する第1設定手段と、前記条件分岐での条件のそれぞれについて、前記第1設定手段で設定された命令が実行された後に実行される命令として、当該条件を満足する場合に前記第1設定手段で設定された命令の実行結果を戻り値として返し、当該条件を満足しない場合に値がないことを示す戻り値を返す命令を設定する第2設定手段と、前記条件分岐での条件のすべてについて前記第1設定手段及び前記第2設定手段で実行することが設定された命令が実行された後に実行される命令として、前記条件分岐での条件のそれぞれについての前記第2設定手段で設定された命令の戻り値のうち、値がないことを示す戻り値とは異なる戻り値を、前記画像処理指示情報に応じた命令での最終的な戻り値として返す命令を設定する第3設定手段と、前記第1設定手段、前記第2設定手段、及び、前記第3設定手段で設定された命令を実行する実行手段と、を含むこととしたものである。
The invention according to
請求項2に記載の発明は、請求項1に記載の画像処理装置であって、前記条件分岐での条件のそれぞれについて、前記第1設定手段で設定された命令が実行される前に実行される命令として、当該条件を満足する場合に当該命令の前に実行される命令の実行結果を戻り値として返し、当該条件を満足しない場合に値がないことを示す戻り値を返す命令を設定する第4設定手段、をさらに含み、前記実行手段は、前記第1設定手段、前記第2設定手段、前記第3設定手段、及び、前記第4設定手段で設定された命令を実行することとしたものである。 A second aspect of the present invention is the image processing apparatus according to the first aspect, wherein each of the conditions in the conditional branch is executed before the instruction set by the first setting means is executed. If the condition is satisfied, the execution result of the instruction executed before the instruction is returned as a return value. If the condition is not satisfied, an instruction that returns a return value indicating no value is set. And a fourth setting unit, wherein the execution unit executes the command set by the first setting unit, the second setting unit, the third setting unit, and the fourth setting unit. Is.
請求項3に記載の発明は、請求項1又は2に記載の画像処理装置であって、前記画像処理指示情報には、条件分岐前に実行される画像処理の識別情報が記述されており、前記第1設定手段は、条件分岐前に実行されることが前記画像処理指示情報に記述されている識別情報に対応付けられる命令を、条件を満足する場合に実行されることが前記画像処理指示情報に記述されている前記識別情報に対応付けられる命令よりも前に実行される命令として設定し、前記第3設定手段は、満足する場合に実行される画像処理が前記画像処理指示情報に記述されていない前記条件分岐での条件が存在する際には、前記条件分岐での条件のすべてについて前記第1設定手段及び前記第2設定手段で実行することが設定された命令が実行された後に実行される命令として、前記条件分岐での条件のそれぞれについての前記第2設定手段で設定された命令の戻り値がすべて、値がないことを示す戻り値である場合は、条件分岐前に実行されることが前記画像処理指示情報に記述されている識別情報に対応付けられる命令の戻り値を、前記画像処理指示情報に応じた命令での最終的な戻り値として返す命令を設定することとしたものである。
The invention according to claim 3 is the image processing apparatus according to
請求項4に記載の発明は、請求項1から3のいずれか一項に記載の画像処理装置であって、前記条件分岐での条件のそれぞれについて、当該条件を満足しない場合に、前記実行手段により命令が実行される際に発生するエラーが出力されることを抑制する抑制手段、をさらに含むこととしたものである。 A fourth aspect of the present invention is the image processing apparatus according to any one of the first to third aspects, wherein the execution means is provided when each of the conditions in the conditional branch does not satisfy the condition. Further, it includes suppression means for suppressing output of an error that occurs when an instruction is executed.
請求項5に記載の発明は、プログラムであって、複数の画像処理の識別情報、並びに、条件分岐が記述された画像処理指示情報を取得する取得手段、前記条件分岐での条件のそれぞれについて、条件を満足する場合に実行されることが前記画像処理指示情報に記述されている前記識別情報に対応付けられる命令を、実行対象の命令として設定する第1設定手段、前記条件分岐での条件のそれぞれについて、前記第1設定手段で設定された命令が実行された後に実行される命令として、当該条件を満足する場合に前記第1設定手段で設定された命令の実行結果を戻り値として返し、当該条件を満足しない場合に値がないことを示す戻り値を返す命令を設定する第2設定手段、前記条件分岐での条件のすべてについて前記第1設定手段及び前記第2設定手段で実行することが設定された命令が実行された後に実行される命令として、前記条件分岐での条件のそれぞれについての前記第2設定手段で設定された命令の戻り値のうち、値がないことを示す戻り値とは異なる戻り値を、前記画像処理指示情報に応じた命令での最終的な戻り値として返す命令を設定する第3設定手段、前記第1設定手段、前記第2設定手段、及び、前記第3設定手段で設定された命令を実行する実行手段、としてコンピュータを機能させることとしたものである。 The invention according to claim 5 is a program, wherein each of the plurality of image processing identification information, the acquisition means for acquiring the image processing instruction information describing the conditional branch, and each of the conditions in the conditional branch, A first setting means for setting an instruction associated with the identification information described in the image processing instruction information to be executed when a condition is satisfied, as an instruction to be executed; For each of the instructions executed after the instruction set by the first setting means is executed, the execution result of the instruction set by the first setting means is returned as a return value when the condition is satisfied. Second setting means for setting an instruction to return a return value indicating that there is no value when the condition is not satisfied, the first setting means for all the conditions in the conditional branch, and the first As an instruction to be executed after an instruction set to be executed by the setting means is executed, a value among the return values of the instructions set by the second setting means for each of the conditions in the conditional branch is A third setting means, a first setting means, and a second setting for setting an instruction to return a return value different from a return value indicating that there is no return value as a final return value in an instruction corresponding to the image processing instruction information The computer is caused to function as a means and an execution means for executing the instruction set by the third setting means.
請求項1,5に記載の発明によれば、利用者が、画像処理命令に用いられる属性の型を意識せずに、複数の画像処理の実行指示が記述された画像処理指示情報を作成できることとなる。 According to the first and fifth aspects of the present invention, the user can create image processing instruction information in which a plurality of image processing execution instructions are described without being aware of the attribute type used in the image processing instruction. It becomes.
請求項2に記載の発明によれば、本構成を有しない場合と比較して、処理の負荷が低減される。 According to the second aspect of the present invention, the processing load is reduced as compared with the case where the present configuration is not provided.
請求項3に記載の発明によれば、満足する場合に実行される画像処理が画像処理指示情報に記述されていない条件分岐での条件が存在する場合についても、利用者が、画像処理命令に用いられる属性の型を意識せずに、複数の画像処理の実行指示が記述された画像処理指示情報を作成できることとなる。 According to the third aspect of the present invention, even when there is a conditional branch condition in which the image processing to be executed when satisfied is not described in the image processing instruction information, the user can Image processing instruction information describing a plurality of image processing execution instructions can be created without being conscious of the type of attribute used.
請求項4に記載の発明によれば、満足しない条件に対応付けて設定された命令について発生するエラーが出力されることが防止できる。 According to the fourth aspect of the present invention, it is possible to prevent an error occurring for an instruction set in association with a condition that is not satisfied from being output.
以下、本発明の一実施形態について図面に基づき詳細に説明する。 Hereinafter, an embodiment of the present invention will be described in detail with reference to the drawings.
図1は、本実施形態における画像処理装置10により実現される機能の一例を示す機能ブロック図である。図1に示すように、本実施形態における画像処理装置10は、機能的には、例えば、取得部12、解釈部14、実行部16、を含んでいる。
FIG. 1 is a functional block diagram illustrating an example of functions realized by the
本実施形態に係る画像処理装置10は、例えば、パーソナルコンピュータなどであり、画像処理装置10にインストールされるプログラムに従って動作するCPU等のプログラム制御デバイスである制御部、ROMやRAM等の記憶素子やハードディスクドライブなどである記憶部、ディスプレイ、キーボード、マウス、等を含んでいる。そして、図1に示す各部の機能は、コンピュータである画像処理装置10にインストールされた、図1に示す各部の機能に対応する命令を含むプログラムを、画像処理装置10の制御部で実行することにより実現されている。このプログラムは、例えば、光ディスク、磁気ディスク、磁気テープ、光磁気ディスク、フラッシュメモリ等のコンピュータ可読な情報記憶媒体を介して、あるいは、インターネットなどの通信手段を介して画像処理装置10に供給される。
The
取得部12は、複数の画像処理の実行指示が記述された画像処理指示情報を取得する。本実施形態では、取得部12は、例えば、画像処理指示情報の一例として、画像処理装置10の記憶部に予め記憶されている、図2に例示する画像処理指示書20を取得する。
The acquisition unit 12 acquires image processing instruction information describing a plurality of image processing execution instructions. In the present embodiment, for example, the acquisition unit 12 acquires the image
図2に例示する画像処理指示書20は、XML形式の文書である。本実施形態に係る画像処理指示書20には、複数の画像処理の識別情報、並びに、条件分岐が記述されている。図3は、図2に例示する画像処理指示書20に記述された内容の一例を模式的に示した図である。図2に例示する画像処理指示書20には、以下の処理が記述されている。なお、図2には、以下に示す処理のそれぞれについて、画像処理指示書20内における、処理に対応する文字列が記載されている位置に、以下の記載において当該処理に割り振られている番号と同一の番号が配置されている。
(1−1)画像処理装置10は、ファイルパス“/tmp/input.tiff”を、バイトストリームの出力元となるファイル入力ストレージの所在を示す情報として設定する。
(1−2)画像処理装置10は、(1−1)で設定されたファイル入力ストレージから、バイトストリームをTIFFフォーマットと解釈して、情報を読み出す。
(1−3)画像処理装置10は、(1−2)で読み出されたバイトストリームから画像の情報を取得する。
(1−4)画像処理装置10は、(1−3)で取得された画像の情報のうち、チャンネル当たりのビット数を取得する。
(1−5)画像処理装置10は、(1−4)で取得したビット数が1である場合は、画像を8ビット化する。
(1−6)画像処理装置10は、(1−4)で取得したビット数が1でない場合は、画像をグレー化する。
(1−7)画像処理装置10は、ファイルパス“/tmp/output.jpg”を、バイトストリームの出力先となるファイル出力ストレージの所在を示す情報として設定する。
(1−8)画像処理装置10は、(1−7)で設定されたファイル出力ストレージに、8ビット化又はグレー化された画像のバイトストリームをJPEGフォーマットで書き出す。
(1−9)画像処理装置10は、以上のようにして設定された命令を実行する。
The image
(1-1) The
(1-2) The
(1-3) The
(1-4) The
(1-5) When the number of bits acquired in (1-4) is 1, the
(1-6) The
(1-7) The
(1-8) The
(1-9) The
本実施形態では、処理の単位となる1又は複数の命令が、画像処理ライブラリ等のモジュールとして管理されている。そして、モジュールに対応するプログラムが、予め、画像処理装置10の記憶部に記憶されている。そして、解釈部14は、画像処理指示書20を解釈して、複数のモジュールから構成されたパイプラインを構築する。また、本実施形態に係るパイプラインが、複数のサブパイプラインから構成されていてもよい。
In this embodiment, one or a plurality of instructions serving as a processing unit is managed as a module such as an image processing library. A program corresponding to the module is stored in the storage unit of the
本実施形態では、解釈部14は、例えば、条件分岐までの処理である上述の(1−1)〜(1−4)の処理については、上述の(1−1)〜(1−4)の順序が実行順序として定義された、それぞれの処理に対応付けられるモジュールから構成されるサブパイプラインを構築する。そして、解釈部14は、当該サブパイプラインに後続するサブパイプラインとして、条件分岐での条件のそれぞれについての、条件を満足する場合に実行される処理である上述の(1−5)、(1−6)に対応付けられるサブパイプライン(ここでは、例えば、2つのサブパイプライン)を接続する。上述の(1−5)、(1−6)の処理は、図3では、破線で囲まれた領域内の部分に相当する。そして、解釈部14は、上述のようにして構成されたサブパイプライン群に後続するサブパイプラインとして、上述の(1−7)、(1−8)の順序が実行順序として定義された、それぞれの処理に対応付けられるモジュールから構成されるサブパイプラインを接続する。このようにして、複数のサブパイプラインから構成されるパイプラインが構築される。 In the present embodiment, the interpretation unit 14, for example, processes (1-1) to (1-4) described above (1-1) to (1-4) that are processes up to conditional branching. A sub-pipeline composed of modules associated with the respective processes is constructed in which the order is defined as the execution order. Then, the interpretation unit 14 performs processing executed when the condition is satisfied for each of the conditions in the conditional branch as the sub-pipeline subsequent to the sub-pipeline (1-5), ( 1-6) are connected to sub pipelines (here, for example, two sub pipelines). The processes (1-5) and (1-6) described above correspond to the portion in the area surrounded by the broken line in FIG. Then, the interpretation unit 14 defines the above-described order (1-7) and (1-8) as the execution order as a sub-pipeline subsequent to the sub-pipeline group configured as described above. A sub-pipeline composed of modules associated with each process is connected. In this way, a pipeline composed of a plurality of sub-pipelines is constructed.
そして、実行部16は、解釈部14が構築したパイプラインに相当する命令を実行する。本実施形態では、例えば、パイプラインを構成する最初のモジュールから順に、モジュールの出力が、当該モジュールに後続するモジュールへの入力として用いられることで、パイプラインを構成するモジュール群の全体に相当する命令が実行されることとなる。 Then, the execution unit 16 executes an instruction corresponding to the pipeline constructed by the interpretation unit 14. In the present embodiment, for example, in order from the first module that configures the pipeline, the output of the module is used as an input to a module that follows the module, and thus corresponds to the entire module group that configures the pipeline. The instruction will be executed.
ここで、解釈部14による、条件分岐での条件のそれぞれについての、条件を満足する場合に実行される処理に対応付けられるサブパイプラインの構築処理の流れの一例を、図4に例示するフロー図を参照しながら説明する。 Here, an example of the flow of the construction process of the sub-pipeline associated with the process executed when the condition is satisfied for each condition in the conditional branch by the interpretation unit 14 is illustrated in FIG. This will be described with reference to the drawings.
まず、解釈部14は、条件分岐での条件の数(ここでは、例えば、n)だけ、構築されるサブパイプラインへの入力となる画像を複製分岐させる命令に対応するモジュールを、最初のモジュールとして設定する(S101)。これによって、本実施形態では、例えば、入力画像が、要素の数がnである配列aryの各要素から参照可能となる。当該配列aryの各要素を、ary[0]〜ary[n−1]と呼ぶこととする。 First, the interpretation unit 14 determines a module corresponding to an instruction for copying and branching an image to be input to the constructed sub-pipeline as many as the number of conditions in the conditional branch (here, n, for example) as the first module. (S101). Thereby, in this embodiment, for example, the input image can be referred to from each element of the array ary having n elements. Each element of the array ary will be referred to as ary [0] to ary [n−1].
そして、解釈部14は、条件数カウンタiの値に、0を設定する(S102)。そして、解釈部14は、カウンタiの値がn未満であるか否かを確認する(S103)。そして、カウンタiの値がn未満である場合は(S103:Y)、(i+1)番目の分岐、すなわち、(i+1)番目の配列要素であるary[i]に後続するモジュールとして、第1条件判定モジュールを接続する(S104)。ここで、第1条件判定モジュールとは、条件分岐における(i+1)番目の条件を満足する場合は、直前の処理の実行結果を戻り値として返し、条件分岐における(i+1)番目の条件を満足しない場合は、値がないことを示す戻り値を返す、すなわち、Nullを戻り値として返す命令に対応するモジュールである。
Then, the interpretation unit 14
そして、解釈部14は、第1条件判定モジュールに後続するモジュールとして、条件分岐における(i+1)番目の条件を満足する場合に実行されることが記述されている画像処理に相当する1又は複数のモジュール(サブパイプライン)を接続する(S105)。S105に示す処理は、例えば、条件分岐における(i+1)番目の条件を満足する場合に実行されることが記述されている画像処理に相当する1又は複数のモジュール(サブパイプライン)への入力モジュール名を、第1条件判定モジュールの名称に変更した上で、当該サブパイプラインを構築することによって実装される。 Then, the interpretation unit 14 is one or a plurality of image processing units corresponding to image processing described to be executed when the (i + 1) th condition in the conditional branch is satisfied as a module subsequent to the first condition determination module. Modules (sub-pipelines) are connected (S105). The process shown in S105 is, for example, an input module to one or a plurality of modules (sub-pipelines) corresponding to image processing described to be executed when the (i + 1) th condition in the conditional branch is satisfied The name is changed to the name of the first condition determination module, and then the sub pipeline is constructed.
そして、解釈部14は、S105に示す処理で接続された1又は複数のモジュール(サブパイプライン)に後続するモジュールとして、第2条件判定モジュールを接続する(S106)。ここで、第2条件判定モジュールとは、条件分岐における(i+1)番目の条件を満足する場合は、直前の処理の実行結果を戻り値として返し、条件分岐における(i+1)番目の条件を満足しない場合は、値がないことを示す戻り値を返す、すなわち、Nullを戻り値として返す命令に対応するモジュールである。 Then, the interpretation unit 14 connects the second condition determination module as a module subsequent to the one or more modules (sub-pipelines) connected in the process shown in S105 (S106). Here, when the (i + 1) th condition in the conditional branch is satisfied, the second condition determination module returns the execution result of the immediately preceding process as a return value, and does not satisfy the (i + 1) th condition in the conditional branch. Is a module corresponding to an instruction that returns a return value indicating no value, that is, returns Null as a return value.
そして、解釈部14は、(i+1)番目の配列要素であるary[i]を、第2条件判定モジュールの出力に置換する(S107)。 Then, the interpretation unit 14 replaces ary [i], which is the (i + 1) th array element, with the output of the second condition determination module (S107).
そして、解釈部14は、カウンタiの値を1増加させて(S108)、S103に示す処理に戻る。 Then, the interpretation unit 14 increments the value of the counter i by 1 (S108), and returns to the process shown in S103.
S103に示す処理で、カウンタiの値がn未満ではないことが確認された場合は(S103:N)、解釈部14は、(i+1)番目の配列要素であるary[i](ここでは、第2条件判定モジュールの出力(戻り値)である。)のうち、Nullではないものの中で値iが最小であるものを出力するモジュールを、上述のS101〜S108に示す処理で構築されたパイプラインを構成するモジュールの実行後に実行されるモジュールとして設定して(S109)、本処理例に示す処理を終了する。このようにして構築されるサブパイプラインでは、(i+1)番目の配列要素であるary[i]のうち、Nullではないものの中で値iが最小であるものが出力され、当該要素が、上述のようにして構築されたサブパイプラインに後続するサブパイプラインへの入力となる。 When it is confirmed in the process shown in S103 that the value of the counter i is not less than n (S103: N), the interpretation unit 14 sets ary [i] (here, the (i + 1) th array element) Among the outputs (return values) of the second condition determination module), a module that outputs a non-Null one with the smallest value i is a pipe constructed by the processing shown in S101 to S108 described above. It is set as a module to be executed after execution of the modules constituting the line (S109), and the processing shown in this processing example is ended. In the sub-pipeline constructed in this way, among the (i + 1) -th array elements, ary [i], the non-null ones with the smallest value i are output, and these elements are It becomes an input to the sub pipeline following the sub pipeline constructed as described above.
このように、本実施形態では、解釈部14は、S105に示す処理で、条件分岐での条件のそれぞれについて、条件を満足する場合に実行されることが画像処理指示書20に記述されている識別情報に対応付けられる命令を、実行対象の命令として設定する。
As described above, in the present embodiment, it is described in the image
また、本実施形態では、S104に示す処理で、解釈部14は、条件分岐での条件のそれぞれについて、S105に示す処理で接続されるサブパイプラインに相当する命令として設定された命令が実行される前に実行される命令として、当該条件を満足する場合に当該命令の前に実行される命令の実行結果を戻り値として返し、当該条件を満足しない場合に値がないことを示す戻り値(ここでは、Null)を返す命令を設定する。 In the present embodiment, in the process shown in S104, the interpretation unit 14 executes an instruction set as an instruction corresponding to the sub-pipeline connected in the process shown in S105 for each condition in the conditional branch. As an instruction to be executed before the execution, the execution result of the instruction executed before the instruction is returned as a return value when the condition is satisfied, and a return value indicating that there is no value when the condition is not satisfied ( Here, an instruction to return (Null) is set.
また、本実施形態では、S106に示す処理で、解釈部14は、条件分岐での条件のそれぞれについて、S105に示す処理で接続されるサブパイプラインに相当する命令が実行された後に実行される命令として、当該条件を満足する場合に実行対象の命令として設定された命令の実行結果を戻り値として返し、当該条件を満足しない場合に値がないことを示す戻り値(ここでは、Null)を返す命令を設定する。 In the present embodiment, in the process shown in S106, the interpretation unit 14 is executed after the instruction corresponding to the sub-pipeline connected in the process shown in S105 is executed for each condition in the conditional branch. As an instruction, an execution result of an instruction set as an instruction to be executed is returned as a return value when the condition is satisfied, and a return value (in this case, Null) indicating that there is no value when the condition is not satisfied Set the instruction to return.
また、本実施形態では、解釈部14は、S109に示す処理で、条件分岐での条件のすべてについて、S101〜S108に示す処理で実行することが設定された命令が実行された後に実行される命令として、条件分岐での条件のそれぞれについての戻り値のうちの、Nullでない戻り値を、以上のようにして構築されるサブパイプラインにおける最終的な戻り値として返す命令を設定する。 In the present embodiment, the interpretation unit 14 is executed after the instruction set to be executed in the process shown in S101 to S108 is executed for all the conditions in the conditional branch in the process shown in S109. As an instruction, an instruction that returns a non-null return value among return values for each condition in a conditional branch as a final return value in the sub-pipeline constructed as described above is set.
図5は、上述の処理によって、図2に例示する画像処理指示書における上述の(1−5)、(1−6)に示す処理に相当するサブパイプラインの一例を模式的に示す図である。図5には、上下に分かれて2つのサブパイプラインが示されている。 FIG. 5 is a diagram schematically illustrating an example of a sub-pipeline corresponding to the processes (1-5) and (1-6) described above in the image processing instruction sheet illustrated in FIG. 2 by the process described above. is there. FIG. 5 shows two sub-pipelines that are divided into upper and lower parts.
図5に示されている上側のサブパイプラインの左側には、ary[0]のビット数が1である場合は、ary[0]が戻り値として返され、8ビット化のモジュールへの入力となることが示されている。また、ary[0]のビット数が1でない場合は、Nullが戻り値として返され、8ビット化のモジュールへの入力となることが示されている。この場合は、8ビット化には、Nullが入力されるため、8ビット化は実行されない。 On the left side of the upper sub-pipeline shown in FIG. 5, if the number of bits of ary [0] is 1, ary [0] is returned as the return value and input to the 8-bit module. It has been shown that Further, when the number of bits of ary [0] is not 1, Null is returned as a return value, indicating that it is an input to the 8-bit module. In this case, since Null is input to the 8-bit conversion, the 8-bit conversion is not executed.
また、図5に示されている上側のサブパイプラインの右側には、ary[0]のビット数が1である場合は、ary[0]に対する8ビット化の戻り値であるbitconv0が、ary[0]に設定され、ary[0]のビット数が1でない場合は、Nullがary[0]に設定されることが示されている。 Also, on the right side of the upper sub-pipeline shown in FIG. 5, when the number of bits of ary [0] is 1, bitconv0, which is the return value of 8-bit conversion for ary [0], is When set to [0] and the number of bits of ary [0] is not 1, it is indicated that Null is set to ary [0].
また、図5に示されている下側のサブパイプラインの左側には、ary[1]のビット数が1でない場合は、ary[1]が戻り値として返され、グレー化のモジュールへの入力となることが示されている。また、ary[1]のビット数が1である場合は、Nullが戻り値として返され、グレー化のモジュールへの入力となることが示されている。この場合は、グレー化には、Nullが入力されるため、グレー化は実行されない。 Also, on the left side of the lower sub-pipeline shown in FIG. 5, if the number of bits of ary [1] is not 1, ary [1] is returned as a return value, and It is shown to be input. Also, when the number of bits of ary [1] is 1, Null is returned as a return value, indicating that it is an input to the graying module. In this case, since Null is input to the graying, the graying is not executed.
また、図5に示されている下側のサブパイプラインの右側には、ary[1]のビット数が1でない場合は、ary[1]に対するグレー化の戻り値であるgray0が、ary[1]に設定され、ary[1]のビット数が1である場合は、Nullがary[1]に設定されることが示されている。 In addition, on the right side of the lower sub-pipeline illustrated in FIG. 5, when the number of bits of ary [1] is not 1, gray0 which is the graying return value for ary [1] is set to ary [1]. 1] and the number of bits of ary [1] is 1, it is indicated that Null is set to ary [1].
そして、図5の右端には、ary[0]又はary[1]のうち、Nullでない最初の要素が、図5に示されているサブパイプラインに後続するサブパイプラインへの入力となることが示されている。 At the right end of FIG. 5, the first non-Null element of ary [0] or ary [1] becomes an input to the sub-pipeline that follows the sub-pipeline shown in FIG. 5. It is shown.
次に、解釈部14による、条件分岐での条件のそれぞれについての、条件を満足する場合に実行される処理に対応付けられるパイプラインの構築処理の流れの別の一例を、図6に例示するフロー図を参照しながら説明する。 Next, another example of the flow of the pipeline construction process associated with the process executed when the condition is satisfied for each condition in the conditional branch by the interpretation unit 14 is illustrated in FIG. This will be described with reference to a flow diagram.
まず、解釈部14は、条件分岐での条件の数(ここでは、例えば、n)だけ、構築されるサブパイプラインへの入力となる画像を複製分岐させる命令に対応するモジュールを、最初のモジュールとして設定する(S201)。これによって、本実施形態では、例えば、入力画像が、要素の数がnである配列aryの各要素から参照可能となる。当該配列aryの各要素を、ary[0]〜ary[n−1]と呼ぶこととする。 First, the interpretation unit 14 determines a module corresponding to an instruction for copying and branching an image to be input to the constructed sub-pipeline as many as the number of conditions in the conditional branch (here, n, for example) as the first module. (S201). Thereby, in this embodiment, for example, the input image can be referred to from each element of the array ary having n elements. Each element of the array ary will be referred to as ary [0] to ary [n−1].
そして、解釈部14は、条件数カウンタiの値に、0を設定する(S202)。そして、解釈部14は、カウンタiの値がn未満であるか否かを確認する(S203)。そして、カウンタiの値がn未満である場合は(S203:Y)、(i+1)番目の分岐、すなわち、(i+1)番目の配列要素であるary[i]に、条件分岐における(i+1)番目の条件を満足する場合に実行されることが記述されている画像処理に相当する1又は複数のモジュール(サブパイプライン)を接続する(S204)。S204に示す処理は、例えば、サブパイプラインへの入力モジュール名を、(i+1)番目の配列要素ary[i]に変更した上で、当該サブパイプラインを構築することによって実装される。
Then, the interpretation unit 14
そして、解釈部14は、S204に示す処理で接続された1又は複数のモジュール(サブパイプライン)に後続するモジュールとして、本処理例における条件判定モジュールを接続する(S205)。ここで、S205に示す処理で接続される条件判定モジュールとは、条件分岐における(i+1)番目の条件を満足する場合は、直前の処理の実行結果を戻り値として返し、条件分岐における(i+1)番目の条件を満足しない場合は、値がないことを示す戻り値を返す、すなわち、Nullを戻り値として返す命令に対応するモジュールである。 Then, the interpretation unit 14 connects the condition determination module in this processing example as a module subsequent to one or more modules (sub-pipelines) connected in the process shown in S204 (S205). Here, with the condition determination module connected in the process shown in S205, when the (i + 1) th condition in the conditional branch is satisfied, the execution result of the immediately preceding process is returned as a return value, and (i + 1) in the conditional branch. When the second condition is not satisfied, the module returns a return value indicating that there is no value, that is, a module corresponding to an instruction that returns Null as a return value.
そして、解釈部14は、(i+1)番目の配列要素であるary[i]を、条件判定モジュールの出力に置換する(S206)。 Then, the interpretation unit 14 replaces ary [i], which is the (i + 1) th array element, with the output of the condition determination module (S206).
そして、解釈部14は、カウンタiの値を1増加させて(S207)、S203に示す処理に戻る。 Then, the interpretation unit 14 increments the value of the counter i by 1 (S207), and returns to the process shown in S203.
S203に示す処理で、カウンタiの値がn未満ではないことが確認された場合は(S203:N)、解釈部14は、(i+1)番目の配列要素であるary[i](ここでは、条件判定モジュールの出力(戻り値)である。)のうち、Nullではないものの中で値iが最小であるものを出力するモジュールを、上述のS201〜S207に示す処理で構築されたパイプラインを構成するモジュールの実行後に実行されるモジュールとして設定して(S208)、本処理例に示す処理を終了する。このようにして構築されるサブパイプラインでは、(i+1)番目の配列要素であるary[i]のうち、Nullではないものの中で値iが最小であるものが出力され、当該要素が、上述のようにして構築されたサブパイプラインに後続するサブパイプラインへの入力となる。 In the process shown in S203, when it is confirmed that the value of the counter i is not less than n (S203: N), the interpretation unit 14 sets ary [i] (here, the (i + 1) th array element) Among the outputs (return values) of the condition determination module), a module that outputs a non-Null one with the smallest value i is a pipeline constructed by the processing shown in S201 to S207 described above. The module is set as a module to be executed after execution of the module to be configured (S208), and the processing shown in this processing example is ended. In the sub-pipeline constructed in this way, among the (i + 1) -th array elements, ary [i], the non-null ones with the smallest value i are output, and these elements are It becomes an input to the sub pipeline following the sub pipeline constructed as described above.
図7は、上述のS201〜S208に示す処理の対象となる画像処理指示書20に記述された内容の一例を模式的に示した図である。図7に示すように、上述のS201〜S208に示す処理の対象となる画像処理指示書20には、以下の処理が記述されている。
(2−1)画像処理装置10は、ファイルパス“/tmp/input.tiff”を、バイトストリームの出力元となるファイル入力ストレージの所在を示す情報として設定する。
(2−2)画像処理装置10は、(2−1)で設定されたファイル入力ストレージから、バイトストリームをTIFFフォーマットと解釈して、情報を読み出す。
(2−3)画像処理装置10は、(2−2)で読み出されたバイトストリームから画像の情報を取得する。
(2−4)画像処理装置10は、(2−3)で取得された画像の情報のうち、チャンネル当たりのビット数を取得する。
(2−5)画像処理装置10は、(2−4)で取得したビット数が1である場合は、ファイルパス“/tmp/input.jpeg”を、新たなバイトストリームの出力元となるファイル入力ストレージの所在を示す情報として設定する。
(2−6)画像処理装置10は、(2−5)で設定されたファイル入力ストレージから、バイトストリームをJPEGフォーマットと解釈して、情報を読み出す。
(2−7)画像処理装置10は、(2−4)で取得したビット数が1でない場合は、画像をグレー化する。
(2−8)画像処理装置10は、ファイルパス“/tmp/output.jpg”を、バイトストリームの出力先となるファイル出力ストレージの所在を示す情報として設定する。
(2−9)画像処理装置10は、(2−8)で設定されたファイル出力ストレージに、(2−5)で設定されたファイル入力ストレージから読み出されたバイトストリーム、又は、(2−7)によりグレー化された画像のバイトストリームをJPEGフォーマットで書き出す。
(2−10)画像処理装置10は、以上のようにして設定された命令を実行する。
FIG. 7 is a diagram schematically illustrating an example of contents described in the image
(2-1) The
(2-2) The
(2-3) The
(2-4) The
(2-5) When the number of bits acquired in (2-4) is 1, the
(2-6) The
(2-7) The
(2-8) The
(2-9) The
(2-10) The
上述の例では、解釈部14は、例えば、条件分岐までの処理である上述の(2−1)〜(2−4)の処理については、上述の(2−1)〜(2−4)の順序が実行順序として定義された、それぞれの処理に対応付けられるモジュールから構成されるサブパイプラインを構築する。そして、解釈部14は、当該サブパイプラインに後続するサブパイプラインとして、条件分岐での条件のそれぞれについての、条件を満足する場合に実行される処理である上述の(2−5)〜(2−7)に対応付けられるサブパイプライン(ここでは、例えば、2つのサブパイプライン)を接続する。上述の(2−5)〜(2−7)の処理は、図7では、破線で囲まれた領域内の部分に相当する。そして、解釈部14は、上述のようにして構成されたサブパイプライン群に後続するサブパイプラインとして、上述の(2−8)、(2−9)の順序が実行順序として定義された、それぞれの処理に対応付けられるモジュールから構成されるサブパイプラインを接続する。このようにして、複数のサブパイプラインから構成されるパイプラインが構築される。 In the above-described example, for example, the interpretation unit 14 processes (2-1) to (2-4) described above (2-1) to (2-4) as processes up to conditional branching. A sub-pipeline composed of modules associated with the respective processes is constructed in which the order is defined as the execution order. Then, the interpretation unit 14 is a process executed when the condition is satisfied for each of the conditions in the conditional branch as a sub-pipeline subsequent to the sub-pipeline. 2-7) are connected to sub pipelines (here, for example, two sub pipelines). The processes (2-5) to (2-7) described above correspond to the portion in the area surrounded by the broken line in FIG. Then, the interpretation unit 14 defines the execution order of the above (2-8) and (2-9) as the sub-pipeline subsequent to the sub-pipeline group configured as described above. A sub-pipeline composed of modules associated with each process is connected. In this way, a pipeline composed of a plurality of sub-pipelines is constructed.
そして、実行部16は、解釈部14が構築したパイプラインに相当する命令を実行する。本実施形態では、例えば、パイプラインを構成する最初のモジュールから順に、モジュールの出力が、当該モジュールに後続するモジュールへの入力として用いられることで、パイプラインを構成するモジュール群の全体に相当する命令が実行されることとなる。 Then, the execution unit 16 executes an instruction corresponding to the pipeline constructed by the interpretation unit 14. In the present embodiment, for example, in order from the first module that configures the pipeline, the output of the module is used as an input to a module that follows the module, and thus corresponds to the entire module group that configures the pipeline. The instruction will be executed.
図8は、上述の(2−5)〜(2−7)に示す処理に相当するサブパイプラインの一例を模式的に示す図である。図8には、上下に分かれて2つのサブパイプラインが示されている。 FIG. 8 is a diagram schematically illustrating an example of a sub-pipeline corresponding to the processes (2-5) to (2-7) described above. FIG. 8 shows two sub-pipelines that are divided into upper and lower parts.
図8に示されている上側のサブパイプラインには、ary[0]のビット数が1である場合は、JPEG読み出しの戻り値であるread1が、ary[0]に設定され、ary[0]のビット数が1でない場合は、Nullがary[0]に設定されることが示されている。 In the upper sub-pipeline illustrated in FIG. 8, when the number of bits of ary [0] is 1, read1 that is a return value of JPEG reading is set to ary [0], and ary [0] ] Is not set to 1, it is indicated that Null is set to ary [0].
図8に示されている下側のサブパイプラインには、ary[1]のビット数が1でない場合は、ary[1]に対するグレー化の戻り値であるgray0がary[1]に設定され、当該パイプラインに入力されるTIFF画像のビット数が1である場合は、Nullがary[1]に設定されることが示されている。 In the lower sub-pipeline shown in FIG. 8, when the number of bits of ary [1] is not 1, gray0 which is the graying return value for ary [1] is set to ary [1]. When the number of bits of the TIFF image input to the pipeline is 1, it is indicated that Null is set to ary [1].
そして、図8の右端には、ary[0]又はary[1]のうち、Nullでない最初の要素が、図5に示されているサブパイプラインに後続するサブパイプラインへの入力となることが示されている。 At the right end of FIG. 8, the first non-Null element of ary [0] or ary [1] becomes an input to the sub-pipeline that follows the sub-pipeline shown in FIG. It is shown.
なお、上述のS201に示す処理において、条件分岐での条件の数(ここでは、例えば、n)だけ入力画像を複製分岐させる命令に対応するモジュールの代わりに、条件分岐での条件の数に1加えた数(ここでは、例えば、n+1)だけ入力画像を複製分岐させる命令に対応するモジュールを、最初のモジュールとして設定してもよい。 In the processing shown in S201 described above, the number of conditions in the conditional branch is 1 instead of the module corresponding to the instruction that replicates and branches the input image by the number of conditions in the conditional branch (here, n, for example). A module corresponding to an instruction for copying and branching the input image by the added number (here, for example, n + 1) may be set as the first module.
図9は、条件分岐での条件の数に1加えた数(ここでは、例えば、n+1)だけ入力画像を複製分岐させる命令に対応するモジュールが、最初のモジュールとして設定される場合における処理の対象となる画像処理指示書20に記述された内容の一例を模式的に示した図である。図9に示すように、条件分岐での条件の数に1加えた数(ここでは、例えば、n+1)だけ入力画像を複製分岐させる命令に対応するモジュールが、最初のモジュールとして設定される場合における処理の対象となる画像処理指示書20には、以下の処理が記述されている。
(3−1)画像処理装置10は、ファイルパス“/tmp/input.tiff”を、バイトストリームの出力元となるファイル入力ストレージの所在を示す情報として設定する。
(3−2)画像処理装置10は、(3−1)で設定されたファイル入力ストレージから、バイトストリームをTIFFフォーマットと解釈して、情報を読み出す。
(3−3)画像処理装置10は、(3−2)で読み出されたバイトストリームから画像の情報を取得する。
(3−4)画像処理装置10は、(3−3)で取得された画像の情報のうち、チャンネル当たりのビット数とチャンネル数を取得する。
(3−5)画像処理装置10は、(3−4)で取得したビット数とチャンネル数の積が1である場合は、画像を8ビット化する。
(3−6)画像処理装置10は、(3−4)で取得したビット数とチャンネル数の積が32である場合は、画像をYCbCr化する。
(3−7)画像処理装置10は、ファイルパス“/tmp/output.jpg”を、バイトストリームの出力先となるファイル出力ストレージの所在を示す情報として設定する。
(3−8)画像処理装置10は、(3−7)で設定されたファイル出力ストレージに、(3−5)により8ビット化された画像、(3−6)によりYCbCr化された画像、又は、上記(3−5)若しくは(3−6)の処理が実行されなかった画像のバイトストリームをJPEGフォーマットで書き出す。
(3−9)画像処理装置10は、以上のようにして設定された命令を実行する。
FIG. 9 shows the processing target when the module corresponding to the instruction that duplicates and branches the input image by the number of conditions in the conditional branch plus 1 (here, for example, n + 1) is set as the first module. It is the figure which showed typically an example of the content described in the image
(3-1) The
(3-2) The
(3-3) The
(3-4) The
(3-5) When the product of the number of bits acquired in (3-4) and the number of channels is 1, the
(3-6) If the product of the number of bits and the number of channels acquired in (3-4) is 32, the
(3-7) The
(3-8) The
(3-9) The
なお、以上の記述において、チャンネル数とは、画像の色空間の成分数を指す。例えば、CMYK色空間の画素値で表現された画像のチャンネル数は4であり。RGB色空間、YCbCr色空間で表現された画像のチャンネル数は3であり、グレースケールで表現された画像のチャンネル数は1である。 In the above description, the number of channels refers to the number of components in the image color space. For example, the number of image channels represented by pixel values in the CMYK color space is four. The number of channels of the image expressed in the RGB color space and the YCbCr color space is 3, and the number of channels of the image expressed in the gray scale is 1.
また、以上の記述における(3−8)において、(3−4)で取得したビット数とチャンネル数の積が1でも32でもない場合に、上記(3−5)若しくは(3−6)の処理が実行されなかった画像のバイトストリームがJPEGフォーマットで書き出される。 Further, in (3-8) in the above description, when the product of the number of bits acquired in (3-4) and the number of channels is neither 1 nor 32, the above (3-5) or (3-6) A byte stream of an image that has not been processed is written out in JPEG format.
上述の例では、解釈部14は、例えば、条件分岐までの処理である上述の(3−1)〜(3−4)の処理については、上述の(3−1)〜(3−4)の順序が実行順序として定義された、それぞれの処理に対応付けられるモジュールから構成されるサブパイプラインを構築する。そして、解釈部14は、当該サブパイプラインに後続するサブパイプラインとして、条件分岐での条件のそれぞれについての、条件を満足する場合に実行される処理である上述の(3−5)、(3−6)に対応付けられるサブパイプライン(ここでは、例えば、3つのサブパイプライン)を接続する。上述の(3−5)、(3−6)の処理は、図9では、破線で囲まれた領域内の部分に相当する。そして、解釈部14は、上述のようにして構成されたサブパイプライン群に後続するサブパイプラインとして、上述の(3−7)、(3−8)の順序が実行順序として定義された、それぞれの処理に対応付けられるモジュールから構成されるサブパイプラインを接続する。このようにして、複数のサブパイプラインから構成されるパイプラインが構築される。 In the above-described example, for example, the interpretation unit 14 processes (3-1) to (3-4) described above (3-1) to (3-4) for the processes up to conditional branching. A sub-pipeline composed of modules associated with the respective processes is constructed in which the order is defined as the execution order. Then, the interpretation unit 14 performs processing executed when the condition is satisfied for each of the conditions in the conditional branch as a sub-pipeline subsequent to the sub-pipeline (3-5), ( 3-6) are connected to sub pipelines (here, for example, three sub pipelines). The processes (3-5) and (3-6) described above correspond to the portion in the area surrounded by the broken line in FIG. Then, the interpretation unit 14 defines the order of the above (3-7) and (3-8) as the execution order as a sub-pipeline subsequent to the sub-pipeline group configured as described above. A sub-pipeline composed of modules associated with each process is connected. In this way, a pipeline composed of a plurality of sub-pipelines is constructed.
そして、実行部16は、解釈部14が構築したパイプラインに相当する命令を実行する。本実施形態では、例えば、パイプラインを構成する最初のモジュールから順に、モジュールの出力が、当該モジュールに後続するモジュールへの入力として用いられることで、パイプラインを構成するモジュール群の全体に相当する命令が実行されることとなる。 Then, the execution unit 16 executes an instruction corresponding to the pipeline constructed by the interpretation unit 14. In the present embodiment, for example, in order from the first module that configures the pipeline, the output of the module is used as an input to a module that follows the module, and thus corresponds to the entire module group that configures the pipeline. The instruction will be executed.
図10は、上述の(3−5)、(3−6)に示す処理に相当するパイプラインの一例を模式的に示す図である。図10には、上中下に分かれて3つのサブパイプラインが示されている。 FIG. 10 is a diagram schematically illustrating an example of a pipeline corresponding to the processes (3-5) and (3-6) described above. FIG. 10 shows three sub-pipelines divided into upper, middle, and lower sides.
図10に示されている上側のサブパイプラインには、ary[0]のビット数とチャンネル数との積が1である場合は、ary[0]に対する8ビット化の戻り値であるbitconv0が、ary[0]に設定され、ary[0]のビット数とチャンネル数との積が1でない場合は、Nullがary[0]に設定されることが示されている。 In the upper sub-pipeline illustrated in FIG. 10, when the product of the number of bits of ary [0] and the number of channels is 1, bitconv0 that is a return value of 8-bit conversion for ary [0] is set. , [0] and Null is set to ary [0] when the product of the number of bits of ary [0] and the number of channels is not 1.
図10に示されている中央のサブパイプラインには、ary[1]のビット数とチャンネル数との積が32である場合は、ary[1]に対するYCbCr化の戻り値であるcolorconv0が、ary[1]に設定され、ary[1]のビット数とチャンネル数との積が32でない場合は、Nullがary[1]に設定されることが示されている。 In the central sub-pipeline shown in FIG. 10, when the product of the number of bits of ary [1] and the number of channels is 32, colorconv0 that is a return value of YCbCr conversion for ary [1] is When ary [1] is set and the product of the number of bits of ary [1] and the number of channels is not 32, it is indicated that Null is set to ary [1].
図10に示されている下側のサブパイプラインには、ary[2]がそのまま、図10の右端に示されているモジュールへの入力となることが示されている。 In the lower sub-pipeline shown in FIG. 10, it is shown that ary [2] is directly input to the module shown at the right end of FIG.
そして、図10の右端には、ary[0]、ary[1]、又は、ary[2]のうち、Nullでない最初の要素を戻り値として返し、後続の処理への入力となることが示されている。 The right end of FIG. 10 indicates that the first element that is not Null among ary [0], ary [1], or ary [2] is returned as a return value, and is input to subsequent processing. Has been.
このように、解釈部14が、満足する場合に実行される画像処理が画像処理指示書20に記述されていない条件分岐での条件が存在する際には、条件分岐での条件のすべてについて実行することが設定された命令が実行された後に実行される命令として、条件分岐での条件のそれぞれに対応するサブパイプラインに相当する戻り値がすべて、値がないことを示す戻り値(ここでは、Null)である場合は、条件分岐前に実行されることが画像処理指示書20に記述されている識別情報に対応付けられる命令の戻り値を、上述のようにして構築されるサブパイプラインに相当する命令における最終的な戻り値として返す命令を設定してもよい。
As described above, when there are conditions in the conditional branch in which the image processing to be executed when satisfied is not described in the image
また、上述のS101に示す処理において、条件分岐での条件の数(ここでは、例えば、n)だけ入力画像を複製分岐させる命令に対応するモジュールの代わりに、条件分岐での条件の数に1加えた数(ここでは、例えば、n+1)だけ入力画像を複製分岐させる命令に対応するモジュールを、最初のモジュールとして設定してもよい。 Further, in the processing shown in S101 described above, the number of conditions in the conditional branch is 1 instead of the module corresponding to the instruction that duplicates and branches the input image by the number of conditions in the conditional branch (here, n, for example). A module corresponding to an instruction for copying and branching the input image by the added number (here, for example, n + 1) may be set as the first module.
本実施形態では、属性の型は、画像処理ライブラリ等のモジュール側でのみ扱われ、画像処理指示書20や、パイプラインを構築する解釈部14といった、インタプリタ側では、属性の型を意識する必要がない。本実施形態によれば、画像処理装置10の利用者が、画像処理命令に用いられる属性の型を意識せずに、複数の画像処理の実行指示が記述された画像処理指示情報を作成できることとなる。
In this embodiment, the attribute type is handled only on the module side such as the image processing library, and it is necessary to be aware of the attribute type on the interpreter side such as the image
また、本実施形態では、画像処理装置10の利用者が、用いられるモジュールにおける属性の型を指定することなく、画像処理指示情報を作成できることとなる。
In this embodiment, the user of the
なお、本発明は上述の実施形態に限定されるものではない。 In addition, this invention is not limited to the above-mentioned embodiment.
例えば、上述の図7および上述の(2−1)〜(2−10)に模式的に示されている画像処理指示書20の内容を実行するにあたって、条件に合致するサブパイプラインでの処理で発生したエラーだけが外部に出力されるようにしてもよい。具体的には、例えば、上述の図7に模式的に示されている画像処理指示書20の内容を実行するにあたって、条件に合致するサブパイプラインでの処理で発生したエラーだけが、ディスプレイの画面を介して利用者に通知されるようにしてもよい。
For example, when executing the contents of the image
図11は、この場合における、上述の(2−5)〜(2−7)に示す処理に相当するパイプラインの一例を模式的に示す図である。図11には、上下に分かれて2つのサブパイプラインが示されている。 FIG. 11 is a diagram schematically illustrating an example of a pipeline corresponding to the processes (2-5) to (2-7) described above in this case. FIG. 11 shows two sub-pipelines that are divided into upper and lower parts.
当該パイプラインについては、実行部16は、命令の実行を開始する際に、「未選択」、「選択中」、又は、「選択済」のいずれかの値をとるデータである分岐選択状態データstを生成して、画像処理装置10の記憶部に記憶させる。
For the pipeline, the execution unit 16 selects branch selection state data that takes one of the values “unselected”, “selected”, or “selected” when starting execution of the instruction. st is generated and stored in the storage unit of the
図11に示されている上側のサブパイプラインの左側には、分岐選択状態データstの値が「未選択」であり、ary[0]のビット数が1である場合は、分岐選択状態データstの値が「選択中」に変更されるとともに、ary[0]が戻り値として返され、JPEG読み込みモジュールへの入力となり、そうでない場合は、Nullが戻り値として返され、JPEG読み込みモジュールへの入力となることが示されている。 On the left side of the upper sub-pipeline shown in FIG. 11, when the value of the branch selection state data st is “unselected” and the number of bits of ary [0] is 1, the branch selection state data The value of st is changed to “selected”, and ary [0] is returned as a return value, which is an input to the JPEG reading module. Otherwise, Null is returned as a return value and sent to the JPEG reading module. It is shown that it becomes the input of.
その右には、ary[0]のビット数が1である場合は、JPEG読み出しの戻り値であるread1がary[0]に設定され、ary[0]のビット数が1でない場合は、Nullがary[0]に設定されることが示されている。 On the right side, when the number of bits of ary [0] is 1, read1 which is a return value of JPEG reading is set to ary [0], and when the number of bits of ary [0] is not 1, Null Is set to ary [0].
さらにその右には、分岐選択状態データstの値が「選択中」でない場合に、ary[0]についてのサブパイプラインでの処理で発生したエラーのクリアが実行され、そうでない場合に、分岐選択状態データstの値が「選択済」に変更されることが示されている。 Further to the right, when the value of the branch selection state data st is not “selected”, the error generated in the processing in the sub-pipeline for ary [0] is cleared, and if not, the branch is executed. It is shown that the value of the selection state data st is changed to “selected”.
図11に示されている下側のサブパイプラインの左側には、分岐選択状態データstの値が「未選択」であり、ary[1]のビット数が1でない場合は、分岐選択状態データstの値が「選択中」に変更されるとともに、ary[1]が戻り値として返され、グレー化モジュールへの入力となり、そうでない場合は、Nullが戻り値として返され、グレー化モジュールへの入力となることが示されている。 On the left side of the lower sub-pipeline shown in FIG. 11, when the value of the branch selection state data st is “unselected” and the number of bits of ary [1] is not 1, the branch selection state data While the value of st is changed to “selected”, ary [1] is returned as a return value and is input to the graying module; otherwise, Null is returned as the return value and passed to the graying module. It is shown that it becomes the input of.
その右には、ary[1]のビット数が1でない場合は、ary[1]に対するグレー化の戻り値であるgray0が、ary[1]に設定され、ary[1]のビット数が1である場合は、Nullがary[1]に設定されることが示されている。 To the right, when the number of bits of ary [1] is not 1, gray0, which is the graying return value for ary [1], is set to ary [1], and the number of bits of ary [1] is 1. In the case of Null, it is indicated that Null is set to ary [1].
さらにその右には、分岐選択状態データstの値が「選択中」でない場合に、ary[1]についてのサブパイプラインでの処理で発生したエラーのクリアが実行され、そうでない場合に、分岐選択状態データstの値が「選択済」に変更されることが示されている。 Furthermore, on the right side, when the value of the branch selection state data st is not “selected”, the error generated in the processing in the sub-pipeline for ary [1] is executed. It is shown that the value of the selection state data st is changed to “selected”.
そして、図11の右端には、ary[0]又はary[1]のうち、Nullでない最初の要素を戻り値として返し、後続の処理への入力となることが示されている。 The right end of FIG. 11 indicates that the first element that is not Null among ary [0] or ary [1] is returned as a return value and becomes an input to the subsequent processing.
以上の処理を実現するにあたって、例えば、解釈部14が、以下説明する点以外については、上述のS101〜S109に示す処理を実行するようにしてもよい。 In realizing the above processing, for example, the interpretation unit 14 may execute the processing shown in S101 to S109 described above except for the points described below.
ここで、解釈部14は、上述のS104に示す処理の代わりに、(i+1)番目の分岐、すなわち、(i+1)番目の配列要素であるary[i]に後続するモジュールとして、分岐選択状態データstの値が「未選択」であり、条件分岐における(i+1)番目の条件を満足する場合に、分岐選択状態データstの値を「選択中」に変更するとともに、ary[i]を戻り値として返し、そうでない場合は、値がないことを示す戻り値を返すモジュールである第3条件判定モジュールを接続する処理を実行してもよい。 Here, instead of the process shown in S104 described above, the interpretation unit 14 uses the branch selection state data as a module following the (i + 1) th branch, that is, the ary [i] which is the (i + 1) th array element. When the value of st is “unselected” and the (i + 1) th condition in the conditional branch is satisfied, the value of the branch selection state data st is changed to “selected” and ary [i] is returned. If not, processing for connecting the third condition determination module, which is a module that returns a return value indicating that there is no value, may be executed.
そして、解釈部14は、上述のS108に示す処理の代わりに、分岐選択状態データstの値が「選択中」でない場合に、ary[i]についてのサブパイプラインでの処理で発生したエラーのクリアを実行し、そうでない場合に、分岐選択状態データstの値が「選択済」に変更する処理を実行してから、カウンタiの値を1増加させた上で、S103に示す処理に戻ってもよい。 Then, instead of the process shown in S108 described above, the interpretation unit 14 determines the error that occurred in the process in the sub-pipeline for ary [i] when the value of the branch selection state data st is not “selected”. If clear is executed, otherwise, the process of changing the value of the branch selection state data st to “selected” is executed, then the value of the counter i is incremented by 1, and the process returns to the process shown in S103. May be.
実行部16は、上述のようにして構築されたパイプラインに相当する命令を実行するにあたって、条件分岐での条件のそれぞれについて、当該条件を満足しない場合に、当該条件に対応するサブパイプラインに相当する命令が実行される際に発生するエラーが出力されることを抑制する。 When executing the instruction corresponding to the pipeline constructed as described above, the execution unit 16 sets the sub-pipeline corresponding to the condition when each of the conditions in the conditional branch does not satisfy the condition. The output of an error that occurs when the corresponding instruction is executed is suppressed.
なお、本実施形態における画像処理装置10が複数の筐体から構成されていてもよい。また、明細書中の具体的な文字列や数値、並びに、図面中の具体的な文字列や数値は例示であり、これらの文字列や数値には限定されない。
Note that the
10 画像処理装置、12 取得部、14 解釈部、16 実行部、20 画像処理指示書。
DESCRIPTION OF
Claims (5)
前記条件分岐での条件のそれぞれについて、条件を満足する場合に実行されることが前記画像処理指示情報に記述されている前記識別情報に対応付けられる命令を、実行対象の命令として設定する第1設定手段と、
前記条件分岐での条件のそれぞれについて、前記第1設定手段で設定された命令が実行された後に実行される命令として、当該条件を満足する場合に前記第1設定手段で設定された命令の実行結果を戻り値として返し、当該条件を満足しない場合に値がないことを示す戻り値を返す命令を設定する第2設定手段と、
前記条件分岐での条件のすべてについて前記第1設定手段及び前記第2設定手段で実行することが設定された命令が実行された後に実行される命令として、前記条件分岐での条件のそれぞれについての前記第2設定手段で設定された命令の戻り値のうち、値がないことを示す戻り値とは異なる戻り値を、前記画像処理指示情報に応じた命令での最終的な戻り値として返す命令を設定する第3設定手段と、
前記第1設定手段、前記第2設定手段、及び、前記第3設定手段で設定された命令を実行する実行手段と、
を含むことを特徴とする画像処理装置。 A plurality of image processing identification information, and acquisition means for acquiring image processing instruction information in which conditional branches are described;
For each of the conditions in the conditional branch, a command that is associated with the identification information described in the image processing instruction information to be executed when a condition is satisfied is set as a command to be executed. Setting means;
For each of the conditions in the conditional branch, as an instruction to be executed after the instruction set by the first setting means is executed, execution of the instruction set by the first setting means when the condition is satisfied A second setting means for setting an instruction to return a result as a return value and to return a return value indicating that there is no value when the condition is not satisfied;
For each of the conditions in the conditional branch, the instruction executed after the instruction set to be executed by the first setting means and the second setting means is executed for all the conditions in the conditional branch. A command that returns a return value different from a return value indicating that there is no value among the return values of the command set by the second setting means as a final return value in a command corresponding to the image processing instruction information Third setting means for setting
Execution means for executing instructions set by the first setting means, the second setting means, and the third setting means;
An image processing apparatus comprising:
前記実行手段は、前記第1設定手段、前記第2設定手段、前記第3設定手段、及び、前記第4設定手段で設定された命令を実行する、
ことを特徴とする請求項1に記載の画像処理装置。 For each of the conditions in the conditional branch, as an instruction to be executed before the instruction set by the first setting means is executed, execution of the instruction executed before the instruction when the condition is satisfied A fourth setting means for setting a command for returning a result as a return value and returning a return value indicating that there is no value when the condition is not satisfied;
The execution means executes instructions set by the first setting means, the second setting means, the third setting means, and the fourth setting means;
The image processing apparatus according to claim 1.
前記第1設定手段は、条件分岐前に実行されることが前記画像処理指示情報に記述されている識別情報に対応付けられる命令を、条件を満足する場合に実行されることが前記画像処理指示情報に記述されている前記識別情報に対応付けられる命令よりも前に実行される命令として設定し、
前記第3設定手段は、満足する場合に実行される画像処理が前記画像処理指示情報に記述されていない前記条件分岐での条件が存在する際には、前記条件分岐での条件のすべてについて前記第1設定手段及び前記第2設定手段で実行することが設定された命令が実行された後に実行される命令として、前記条件分岐での条件のそれぞれについての前記第2設定手段で設定された命令の戻り値がすべて、値がないことを示す戻り値である場合は、条件分岐前に実行されることが前記画像処理指示情報に記述されている識別情報に対応付けられる命令の戻り値を、前記画像処理指示情報に応じた命令での最終的な戻り値として返す命令を設定する、
ことを特徴とする請求項1又は2に記載の画像処理装置。 In the image processing instruction information, identification information of image processing executed before conditional branching is described,
The first setting means may execute an instruction associated with the identification information described in the image processing instruction information to be executed before conditional branching when the condition is satisfied. Set as an instruction to be executed before the instruction associated with the identification information described in the information,
When there is a condition in the conditional branch that is not described in the image processing instruction information, the third setting unit performs the processing for all of the conditions in the conditional branch. Instructions set by the second setting means for each condition in the conditional branch as instructions executed after execution of instructions set to be executed by the first setting means and the second setting means Are all return values indicating that there is no value, the return value of the instruction associated with the identification information described in the image processing instruction information to be executed before the conditional branching, Setting an instruction to be returned as a final return value in an instruction according to the image processing instruction information;
The image processing apparatus according to claim 1, wherein the image processing apparatus is an image processing apparatus.
ことを特徴とする請求項1から3のいずれか一項に記載の画像処理装置。 For each of the conditions in the conditional branch, further includes a suppression unit that suppresses output of an error that occurs when an instruction is executed by the execution unit when the condition is not satisfied.
The image processing apparatus according to claim 1, wherein the image processing apparatus is an image processing apparatus.
前記条件分岐での条件のそれぞれについて、条件を満足する場合に実行されることが前記画像処理指示情報に記述されている前記識別情報に対応付けられる命令を、実行対象の命令として設定する第1設定手段、
前記条件分岐での条件のそれぞれについて、前記第1設定手段で設定された命令が実行された後に実行される命令として、当該条件を満足する場合に前記第1設定手段で設定された命令の実行結果を戻り値として返し、当該条件を満足しない場合に値がないことを示す戻り値を返す命令を設定する第2設定手段、
前記条件分岐での条件のすべてについて前記第1設定手段及び前記第2設定手段で実行することが設定された命令が実行された後に実行される命令として、前記条件分岐での条件のそれぞれについての前記第2設定手段で設定された命令の戻り値のうち、値がないことを示す戻り値とは異なる戻り値を、前記画像処理指示情報に応じた命令での最終的な戻り値として返す命令を設定する第3設定手段、
前記第1設定手段、前記第2設定手段、及び、前記第3設定手段で設定された命令を実行する実行手段、
としてコンピュータを機能させることを特徴とするプログラム。
Acquisition means for acquiring identification information of a plurality of image processes, and image processing instruction information in which conditional branches are described;
For each of the conditions in the conditional branch, a command that is associated with the identification information described in the image processing instruction information to be executed when a condition is satisfied is set as a command to be executed. Setting means,
For each of the conditions in the conditional branch, as an instruction to be executed after the instruction set by the first setting means is executed, execution of the instruction set by the first setting means when the condition is satisfied Second setting means for setting a command for returning a result as a return value and returning a return value indicating that there is no value when the condition is not satisfied;
For each of the conditions in the conditional branch, the instruction executed after the instruction set to be executed by the first setting means and the second setting means is executed for all the conditions in the conditional branch. A command that returns a return value different from a return value indicating that there is no value among the return values of the command set by the second setting means as a final return value in a command corresponding to the image processing instruction information Third setting means for setting
Execution means for executing instructions set by the first setting means, the second setting means, and the third setting means;
A program characterized by causing a computer to function.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012273085A JP5880418B2 (en) | 2012-12-14 | 2012-12-14 | Image processing apparatus and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012273085A JP5880418B2 (en) | 2012-12-14 | 2012-12-14 | Image processing apparatus and program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2014119848A JP2014119848A (en) | 2014-06-30 |
JP5880418B2 true JP5880418B2 (en) | 2016-03-09 |
Family
ID=51174656
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2012273085A Expired - Fee Related JP5880418B2 (en) | 2012-12-14 | 2012-12-14 | Image processing apparatus and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5880418B2 (en) |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2001243460A (en) * | 2000-02-29 | 2001-09-07 | Fuji Photo Film Co Ltd | Image processor and image processing program storage medium |
JP2004112514A (en) * | 2002-09-19 | 2004-04-08 | Fuji Xerox Co Ltd | Image processing method and apparatus |
JP2006338507A (en) * | 2005-06-03 | 2006-12-14 | Fujifilm Holdings Corp | Processing device and processing method |
JP5419631B2 (en) * | 2009-10-16 | 2014-02-19 | キヤノン株式会社 | Image processing apparatus and script correction method in image processing apparatus |
-
2012
- 2012-12-14 JP JP2012273085A patent/JP5880418B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2014119848A (en) | 2014-06-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5028372B2 (en) | Image processing apparatus, image processing method, and image processing program | |
US8243322B2 (en) | Image data processor and image data processing program storage medium for variable printing | |
TW200620997A (en) | Method and apparatus for efficient processing of color conversion | |
JP5267255B2 (en) | Image processing apparatus, image processing method, and program | |
JP6210319B2 (en) | Printing method and printing system | |
US9229914B2 (en) | Optimizing the layout of electronic documents by reducing presentation size of content within document sections so that when combined a plurality of document sections fit within a page | |
JP5880418B2 (en) | Image processing apparatus and program | |
JP2005278171A (en) | Color image processor and color image processing method | |
JP2010124459A (en) | Document generation method and document generation apparatus | |
KR100966783B1 (en) | Information processing apparatus, control method of information processing apparatus and storage medium | |
JP2015139062A (en) | Printing system, information processing apparatus, control method thereof and program | |
WO2017043284A1 (en) | Information processing system, information processing method, information processing program, and storage medium | |
JP2011025539A (en) | Printing device, image output system, rendering method and program | |
JP2008108266A (en) | Method and apparatus for compiling two-level morphology rules | |
JP5139779B2 (en) | Image forming apparatus and image forming method | |
JP5007291B2 (en) | Image processing apparatus, image processing method, and image processing program | |
JP2010244098A (en) | Image processing apparatus, printing system, image processing method, and program | |
JP5033746B2 (en) | Image processing apparatus, image processing method, and image processing program | |
JP6404865B2 (en) | A method to support color conversion in multiplied data | |
JP5033747B2 (en) | Image processing apparatus, image processing method, and image processing program | |
JP5577763B2 (en) | Image processing apparatus, image processing system, and image processing program | |
JP5028373B2 (en) | Image processing apparatus, image processing method, and image processing program | |
JP5326858B2 (en) | Image processing apparatus and image processing program | |
JP2011096109A (en) | Image processing apparatus and image processing program | |
JP2010214905A (en) | Image forming apparatus, image forming method, and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20150306 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20151130 |
|
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: 20160105 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20160118 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5880418 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
LAPS | Cancellation because of no payment of annual fees |