JP4933462B2 - Image processing method - Google Patents

Image processing method Download PDF

Info

Publication number
JP4933462B2
JP4933462B2 JP2008025938A JP2008025938A JP4933462B2 JP 4933462 B2 JP4933462 B2 JP 4933462B2 JP 2008025938 A JP2008025938 A JP 2008025938A JP 2008025938 A JP2008025938 A JP 2008025938A JP 4933462 B2 JP4933462 B2 JP 4933462B2
Authority
JP
Japan
Prior art keywords
instruction
processing
command
image
pixels
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2008025938A
Other languages
Japanese (ja)
Other versions
JP2009187240A (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.)
Ricoh Co Ltd
Original Assignee
Ricoh Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP2008025938A priority Critical patent/JP4933462B2/en
Publication of JP2009187240A publication Critical patent/JP2009187240A/en
Application granted granted Critical
Publication of JP4933462B2 publication Critical patent/JP4933462B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Processing (AREA)

Description

本発明は画像の歪み補正などの画像処理方法に関する。   The present invention relates to an image processing method such as image distortion correction.

入力画像に対して回転や歪み補正などの処理を行う画像処理方法としては、例えば特許文献1や2に記載の方法が提案されている。   For example, methods disclosed in Patent Documents 1 and 2 have been proposed as image processing methods for performing processing such as rotation and distortion correction on an input image.

特許文献1に記載の画像処理方法は、ライン単位で読み込んだmラインの画像データを主走査方向にn画素毎のブロックに分割して各ブロックを符号化する手段と、(m画素)×(n画素)の画像データを90°単位で回転される手段とで、画像データを回転することを特徴としている。   The image processing method described in Patent Literature 1 includes a unit that encodes each block by dividing m-line image data read in line units into blocks for every n pixels in the main scanning direction, and (m pixels) × ( The image data is rotated by means for rotating the image data of n pixels) in units of 90 °.

特許文献2に記載の画像処理方法は、複雑な演算を行わずラインデータ保持メモリの活用と補間処理とだけで画像データの回転処理を行うことを目的とし、ラインスキャンされた画像データを取り込み画像の回転を行う画像処理において、回転前のサンプリング点を副走査方向に接続する線と回転後の主走査方向のラインとが交差する位置を回転前の副走査方向の画像データより第1の補間処理で求めて、副走査補間画像データを配置し、回転後の主走査ラインと回転後のサンプリング点を副走査方向に接続する線とが交差する位置を回転後の主走査方向の副走査補間画像データより第2の補間演算で求めて、回転後の画像データを配置することを特徴としている。
特開平10−93805号公報 特開2006−295379号公報
The image processing method described in Patent Document 2 aims to perform rotation processing of image data only by utilizing the line data holding memory and interpolation processing without performing complicated calculations, and by taking in line scanned image data and performing image processing. In the image processing in which rotation is performed, the position where the line connecting the sampling points before rotation in the sub-scanning direction and the line in the main scanning direction after rotation intersect is first interpolated from the image data in the sub-scanning direction before rotation. Sub-interpolation in the main scanning direction after rotation is determined at the position where the sub-scan interpolation image data obtained by processing is arranged, and the position where the rotated main scanning line intersects the line connecting the rotated sampling points in the sub-scanning direction The image data is obtained from the image data by the second interpolation calculation, and the rotated image data is arranged.
JP-A-10-93805 JP 2006-295379 A

しかしながら、特許文献1や2に記載の画像処理方法では、小容量メモリを用いて処理を行いシステムコストの低減化は可能であるが、アクセスされる特別の回路が必要となるので、アフィン変換等の複雑な演算が必要となる。更に、並列処理を行うプロセッサで複数画素を同時に処理をする場合、1つのラインデータを並列処理するのに必要な画像データを全て画像処理するメモリに保持しなければ処理が行えないので、画像データによっては、処理速度向上につながらないという問題があった。   However, the image processing methods described in Patent Documents 1 and 2 can perform processing using a small-capacity memory and reduce the system cost. However, since a special circuit to be accessed is required, affine transformation, etc. The complicated calculation is required. Furthermore, when a plurality of pixels are simultaneously processed by a processor that performs parallel processing, processing cannot be performed unless all the image data necessary for parallel processing of one line data is held in a memory for image processing. Depending on the case, there is a problem that the processing speed cannot be improved.

例えば、図12に示すような歪みを持った画像を補正する場合では、画素の移動距離が近い場合(図12の場合画像の中央)と遠い場合(図12の場合画像の左右端)とで処理の内容を変えなければならないという問題があった。 For example, in the case of correcting an image having distortion as shown in FIG. 12 , when the moving distance of the pixel is short (the center of the image in the case of FIG. 12 ) and when it is far (in the case of FIG. 12 , the left and right edges of the image). There was a problem that the contents of processing had to be changed.

本発明はかかる問題を解決することを目的としている。   The present invention aims to solve such problems.

請求項1に記載された発明は、入力された画像データに対して、その画像データの単一画素ごとに処理を行うGP命令と、一度に複数の画素の処理を行うPE命令と、を選択して実行する画像処理方法において、前記画像データに対して所定の処理を行う際に、原点から移動点に移るパラメータである変換位置情報に基づいて、前記GP命令と前記PE命令とのうちのいずれかの処理時間が短い命令に切り替えて実行することを特徴とする画像処理方法である。   According to the first aspect of the present invention, a GP command for performing processing for each single pixel of the input image data and a PE command for performing processing for a plurality of pixels at the same time are selected. In the image processing method to be executed, when predetermined processing is performed on the image data, the GP command and the PE command are selected based on conversion position information that is a parameter that moves from the origin to the moving point. An image processing method is characterized in that any one of the processing times is switched to an instruction having a short processing time.

請求項2に記載された発明は、請求項1に記載された発明において、前記GP命令と前記PE命令が、それぞれ同一の処理結果となる異なるアルゴリズムにより前記画像データの処理を行うことを特徴とするものである。   The invention described in claim 2 is characterized in that, in the invention described in claim 1, the GP instruction and the PE instruction process the image data by different algorithms each having the same processing result. To do.

請求項に記載された発明は、請求項1または2に記載された発明において、前記画像データの前記PE命令で一度に処理を行える複数画素ごとに、前記GP命令と前記PE命令とを切り替えることを特徴とするものである。 The invention described in claim 3 is the invention described in claim 1 or 2, wherein the GP command and the PE command are switched for each of a plurality of pixels that can be processed at once by the PE command of the image data. It is characterized by this.

請求項に記載された発明は、請求項1乃至のうちいずれか一項に記載された発明において、前記変換位置情報を、前記PE命令で一度に処理を行える複数画素ごとに算出することを特徴とするものである。 The invention described in claim 4 is the invention described in any one of claims 1 to 3 , wherein the conversion position information is calculated for each of a plurality of pixels that can be processed at once by the PE instruction. It is characterized by.

請求項に記載された発明は、請求項に記載された発明において、前記変換位置情報を、予め算出して保持することを特徴とするものである。 The invention described in claim 5 is characterized in that, in the invention described in claim 4 , the conversion position information is calculated and held in advance.

請求項1に記載の発明によれば、入力画素データの変換位置情報により、GP命令とPE命令のうち、どちらか処理時間が短く行う処理に適した命令に切り替えて処理を行うことで、画像処理の速度、特に歪み補正や画像の回転の処理速度を向上することができる。   According to the first aspect of the present invention, processing is performed by switching to a command suitable for processing with a shorter processing time out of either the GP command or the PE command based on the conversion position information of the input pixel data. The processing speed, particularly the processing speed for distortion correction and image rotation can be improved.

請求項2に記載の発明によれば、2種類の異なるアルゴリズムを使用する場合でも、結果として同じ処理結果を得る事が可能であるために適切な処理を選択することができる。   According to the second aspect of the present invention, even when two different algorithms are used, the same processing result can be obtained as a result, so that an appropriate processing can be selected.

請求項に記載の発明によれば、PE命令で一度に処理を行える複数画素ごとにGP命令とPE命令とを切り替えているので、PE命令とGP命令の判定処理の頻度が削減され処理速度を向上することができる。また、PE命令で一度に処理を行える複数画素ごとにその処理に合った適切な命令を選択することができる。 According to the third aspect of the invention, since the GP instruction and the PE instruction are switched for each of a plurality of pixels that can be processed at once by the PE instruction, the frequency of determination processing of the PE instruction and the GP instruction is reduced, and the processing speed is reduced. Can be improved. Further, it is possible to select an appropriate instruction suitable for the processing for each of a plurality of pixels that can be processed at once by the PE instruction.

請求項に記載の発明によれば、PE命令で一度に処理を行える複数画素ごとに変換位置情報を算出しているので、PE命令で一度に処理を行える複数画素ごとに効率の良い方の命令を選択実行する事で画像の処理速度を向上することができる。 According to the invention described in claim 4 , since the conversion position information is calculated for each of the plurality of pixels that can be processed at once by the PE command, the more efficient one for each of the plurality of pixels that can be processed by the PE command at once. The image processing speed can be improved by selecting and executing the command.

請求項に記載の発明によれば、変換位置情報を予め算出して保持しているので、画素単位やPE命令で一度に処理を行える複数画素単位の処理時の処理時間やステップ数を削減することができるので画像の処理速度を向上することができる。 According to the fifth aspect of the present invention, since the conversion position information is calculated and held in advance, the processing time and the number of steps at the time of processing of a plurality of pixels that can be processed at a time by a pixel unit or a PE command are reduced Image processing speed can be improved.

[第1実施形態]
以下、本発明の第1の実施形態を、図1ないし図8を参照して説明する。図1は、本実施形態において画像処理として歪み補正処理がなされる画像の構成を示す説明図である。図2は、SIMD単位を示す説明図である。図3は、図1に示された画像とSIMD単位との関係を示す説明図である。図4は、本発明の第1の実施形態にかかる画像処理装置としてのSIMD型マイクロプロセッサのブロック図である。図5は、図1に示した画像の一部分の拡大図である。図6は、SIMD単位で処理を実行する場合の説明図である。図7は、変換位置情報をSIMD単位で予め算出してメモリ等に保存した場合のGP命令とPE命令との選択動作を示すフローチャートである。図8は、変換位置情報をPE命令とGP命令の切り替え判断時にSIMD単位ごとに算出した場合のGP命令とPE命令との選択動作を示すフローチャートである。
[First Embodiment]
Hereinafter, a first embodiment of the present invention will be described with reference to FIGS. FIG. 1 is an explanatory diagram illustrating a configuration of an image on which distortion correction processing is performed as image processing in the present embodiment. FIG. 2 is an explanatory diagram showing SIMD units. FIG. 3 is an explanatory diagram showing the relationship between the image shown in FIG. 1 and SIMD units. FIG. 4 is a block diagram of a SIMD type microprocessor as an image processing apparatus according to the first embodiment of the present invention. FIG. 5 is an enlarged view of a part of the image shown in FIG. FIG. 6 is an explanatory diagram when processing is executed in SIMD units. FIG. 7 is a flowchart showing a selection operation between the GP instruction and the PE instruction when the conversion position information is calculated in advance in SIMD units and stored in a memory or the like. FIG. 8 is a flowchart showing a selection operation between the GP instruction and the PE instruction when the conversion position information is calculated for each SIMD unit when determining the switching between the PE instruction and the GP instruction.

図1は主走査方向に2112画素、副走査方向にNラインの画像を示している。主走査方向の2112画素は352画素×6を意味し、これはSIMD単位6つ分を示している。   FIG. 1 shows an image of 2112 pixels in the main scanning direction and N lines in the sub-scanning direction. 2112 pixels in the main scanning direction means 352 pixels × 6, which indicates six SIMD units.

SIMD単位とは後述するSIMD型マイクロプロセッサにおいてPE命令実行時に一度に処理可能な画素数(データ数)を意味し、本実施形態に用いるSIMD型マイクロプロセッサでは図2に示すように352画素を一度に処理可能である。   The SIMD unit means the number of pixels (the number of data) that can be processed at a time when a PE instruction is executed in a SIMD type microprocessor, which will be described later. In the SIMD type microprocessor used in this embodiment, 352 pixels are set once as shown in FIG. Can be processed.

従って、図3に示すように1ラインをSIMD単位で処理を行うことで、1画素単位で処理を行うよりも処理回数を削減することができ、一定時間内ではより多くの画素の処理を行うことができる。   Therefore, as shown in FIG. 3, by processing one line in SIMD units, the number of processes can be reduced as compared with processing in one pixel unit, and more pixels are processed in a certain time. be able to.

図4に本実施形態の歪み補正処理に用いるSIMD型マイクロプロセッサを示す。SIMD型マイクロプロセッサ2は、グローバルプロセッサ3と、プロセッサエレメントブロック4と、を備えている。   FIG. 4 shows a SIMD type microprocessor used for the distortion correction processing of this embodiment. The SIMD type microprocessor 2 includes a global processor 3 and a processor element block 4.

グローバルプロセッサ3は、図4に示すようにグローバルプロセッサ3にて実行するプログラム格納用のプログラムRAM(Program-RAM)と演算データ格納用のデータRAM(Data-RAM)が内蔵されている。さらに、プログラムのアドレスを保持するプログラムカウンタ(PC)、演算処理のデータ格納のための汎用レジスタであるG0〜G15レジスタ、レジスタ退避および復帰時に退避先データRAMのアドレスを保持しているスタックポインタ(SP)、サブルーチンコール時にコール元のアドレスを保持するリンクレジスタ(LS)、同じくIRQ(割り込み)時とNMI(マスク不可割り込み)時の分岐元アドレスを保持するLI、LNレジスタ、プロセッサの状態を保持しているプロセッサステータスレジスタ(P)が内蔵されている。これらのレジスタと図示していない命令デコーダ、ALU、メモリ制御回路、割り込み制御回路、外部I/O制御回路、GP演算制御回路を使用してグローバルプロセッサ命令(GP命令)の実行が行われる。プロセッサエレメント命令(PE命令)実行時は命令デコーダ、図示していないレジスタファイル制御回路、PE演算制御回路を使用して、後述するレジスタファイルアレイ7の制御と演算アレイ8の制御を行う。即ち、GP命令とはグローバルプロセッサ3内の演算回路等を用いて実行される命令、PE命令とはプロセッサエレメントブロック4を用いて実行される命令である。   As shown in FIG. 4, the global processor 3 includes a program RAM (Program-RAM) for storing programs executed by the global processor 3 and a data RAM (Data-RAM) for storing operation data. Furthermore, a program counter (PC) that holds the address of the program, G0 to G15 registers that are general-purpose registers for storing data for arithmetic processing, and a stack pointer that holds the address of the save destination data RAM when the registers are saved and restored SP), a link register (LS) that holds the address of the caller at the time of a subroutine call, and LI and LN registers that hold the branch source address at the time of IRQ (interrupt) and NMI (non-maskable interrupt), and the processor status A processor status register (P) is built in. A global processor instruction (GP instruction) is executed using these registers and an instruction decoder, ALU, memory control circuit, interrupt control circuit, external I / O control circuit, and GP operation control circuit (not shown). When a processor element instruction (PE instruction) is executed, an instruction decoder, a register file control circuit (not shown), and a PE operation control circuit are used to control a register file array 7 and an operation array 8 described later. That is, the GP instruction is an instruction executed using an arithmetic circuit or the like in the global processor 3, and the PE instruction is an instruction executed using the processor element block 4.

プロセッサエレメントブロック4は、レジスタファイルアレイ7と、演算アレイ8と、を備えている。   The processor element block 4 includes a register file array 7 and an operation array 8.

レジスタファイルアレイ7は、プロセッサエレメント数分のレジスタファイル71から構成されている。レジスタファイル71は、16ビットのレジスタが32本内蔵されており、レジスタはPEごとにR0〜R31と呼ぶこととする。それぞれのレジスタは演算アレイ8に対してポートを備えており、16ビットのリード/ライト兼用のバス(以下レジスタバス)で演算アレイ8からアクセスできる。図示しているレジスタは、紙面の関係で各PEで6本としている。   The register file array 7 includes register files 71 corresponding to the number of processor elements. The register file 71 includes 32 16-bit registers, and the registers are called R0 to R31 for each PE. Each register has a port for the arithmetic array 8 and can be accessed from the arithmetic array 8 by a 16-bit read / write bus (hereinafter referred to as a register bus). The number of registers shown in the figure is six for each PE due to space limitations.

演算アレイ8は、プロセッサエレメント数分の演算部81から構成されている。演算部81は、レジスタファイル71との接続に16ビット幅の7to1のマルチプレクサ(7to1MUX)81aを備えており、PE方向で左に1、2および3つ離れたPEのレジスタバス、右に1、2および3つ離れたPEのレジスタバス、自PEのレジスタバスに接続し、演算対象として7つのレジスタバスから選択することが可能である。選択の制御はグローバルプロセッサ3により行われる。   The arithmetic array 8 is composed of arithmetic units 81 corresponding to the number of processor elements. The calculation unit 81 includes a 16-bit 7-to-1 multiplexer (7-to-1 MUX) 81a for connection with the register file 71, and the PE register buses are 1, 2, and 3 apart to the left in the PE direction, and 1 to the right. It is possible to connect to the register buses of the PEs 2 and 3 apart from each other and the register bus of the own PE, and select from seven register buses as the operation target. Selection control is performed by the global processor 3.

7to1のマルチプレクサ81aの後段にはシフタ(Shift Expand)81bを設けており、レジスタファイル71から読み出されたデータのビットシフトとビット拡張を行う。シフトの制御はグローバルプロセッサ3により行われる。   A shifter 81b is provided after the 7to1 multiplexer 81a to perform bit shift and bit expansion of data read from the register file 71. Shift control is performed by the global processor 3.

シフタ81bの後段には、上位用16ビットALU81f、上位用16ビットAレジスタ81g、上位用Fレジスタ81h、下位用16ビットALU81c、上位用16ビットAレジスタ81d、上位用Fレジスタ81eを設けている。PE命令による演算は基本的にレジスタファイル71から読み出されたデータを、例えば上位であれば上位用16ビットALU81fの片側の入力として、もう片側には上位用16ビットAレジスタ81gの内容を入力として、結果を上位用Aレジスタ81gに格納する。したがって、上位用Aレジスタ81gとR0〜R31レジスタとの演算が行われることとなる。下位用16ビットALU81cも同様である。   At the subsequent stage of the shifter 81b, an upper 16-bit ALU 81f, an upper 16-bit A register 81g, an upper F register 81h, a lower 16-bit ALU 81c, an upper 16-bit A register 81d, and an upper F register 81e are provided. . In the operation by the PE instruction, basically, the data read from the register file 71 is input as one side of the high-order 16-bit ALU 81f if it is high-order, for example, and the content of the high-order 16-bit A register 81g is input to the other side. The result is stored in the upper A register 81g. Therefore, an operation is performed between the upper A register 81g and the R0 to R31 registers. The same applies to the lower 16-bit ALU 81c.

上位用16ビットALU81fと下位用16ビットALU81cは、それぞれ独立して16ビットの演算が可能であり、また上位用16ビットALU81fと下位用16ビットALU81cは連動して動作し、合わせて32ビットの演算も可能である。それぞれの動作はグローバルプロセッサ3からの制御による。上位用16ビットALU81fと下位用16ビットALU81cが連動する場合のため、両ALU間にキャリーなどの情報伝達経路を備えている。   The high-order 16-bit ALU 81f and the low-order 16-bit ALU 81c can independently perform 16-bit operations, and the high-order 16-bit ALU 81f and the low-order 16-bit ALU 81c operate in conjunction with each other, so that a total of 32 bits Arithmetic is also possible. Each operation is controlled by the global processor 3. Since the upper 16-bit ALU 81f and the lower 16-bit ALU 81c are linked, an information transmission path such as a carry is provided between both ALUs.

つまり、上述したレジスタファイル71と、演算部81と、でプロセッサエレメント(以降PE)を構成している。即ち、本実施形態のSIMD型マイクロプロセッサ2は、レジスタファイル71と演算部81の組を352組備えている。   That is, the register file 71 and the calculation unit 81 described above constitute a processor element (hereinafter referred to as PE). That is, the SIMD type microprocessor 2 of this embodiment includes 352 sets of register files 71 and arithmetic units 81.

次に、上述した構成のSIMD型マイクロプロセッサ2を用いて画像処理として歪み補正処理を行う場合におけるGP命令とPE命令の使い分け(切り替え)の方法を説明する。   Next, a method for selectively using (switching) the GP instruction and the PE instruction when performing distortion correction processing as image processing using the SIMD type microprocessor 2 having the above-described configuration will be described.

図5は、図1に示した画像の一部分の拡大図である。ここで、補正をかける注目データ(画素)として、S00(x,y)、S10(x+1,y)、S20(x+2,y)、S30(x+3,y)、S40(x+4,y)の5点を例に説明する。この5点について補正する際に、各データの変換位置情報としてのオフセット値を、それぞれS00は(0,0)、S10は(0,1)、S20は(0,3)、S30は(0,4)、S40は(0,5)とする。このオフセット値は各画素ごとに予めレンズの収差値から求めておく。   FIG. 5 is an enlarged view of a part of the image shown in FIG. Here, five points of S00 (x, y), S10 (x + 1, y), S20 (x + 2, y), S30 (x + 3, y), and S40 (x + 4, y) are the target data (pixels) to be corrected. Will be described as an example. When correcting these five points, the offset values as conversion position information of each data are respectively (0, 0) for S00, (0, 1) for S10, (0, 3) for S20, and (0) for S30. , 4) and S40 are (0, 5). This offset value is obtained in advance from the aberration value of the lens for each pixel.

図5の場合、このオフセット値が補正処理を行うために参照する画素の距離となり、S00は副走査方向に距離が0画素分、S10は副走査方向に距離が1画素分、S20は副走査方向に距離が2画素分、S30は副走査方向に距離が3画素分、S40は副走査方向に距離が5画素分あることになる。   In the case of FIG. 5, this offset value is the distance of the pixel to be referred to for correction processing, S00 is 0 pixel in the sub-scanning direction, S10 is 1 pixel in the sub-scanning direction, and S20 is sub-scanning. The distance is 2 pixels in the direction, S30 is the distance of 3 pixels in the sub-scanning direction, and S40 is the distance of 5 pixels in the sub-scanning direction.

図4に示したSIMD型マイクロプロセッサ2の場合は、7to1のマルチプレクサ81aが、上述したように、自身の前後3PE分のデータしか一度にアクセスできないので、一度にアクセスできる距離であるS30まではPE命令で実行し、S40はGP命令で実行することで効率良く歪み補正処理を行うことができる。つまり、S30まではPE命令で実行しS40はGP命令で実行することで歪み補正処理にかかるステップ数や演算数を減らすことができ処理時間を短くすることができる。   In the case of the SIMD type microprocessor 2 shown in FIG. 4, since the 7to1 multiplexer 81a can access only the data for 3PE before and after itself as described above, the PE can be accessed up to S30, which is the distance that can be accessed at one time. The distortion correction processing can be performed efficiently by executing the command and executing S40 with the GP command. In other words, by executing up to S30 with the PE instruction and S40 with the GP instruction, it is possible to reduce the number of steps and the number of operations required for the distortion correction processing, thereby shortening the processing time.

実施形態ではSIMD単位ごとに変換位置情報を算出しPE命令とGP命令とを切り替える。即ち、PE命令で一度に処理を行える複数画素ごとに、GP命令とPE命令とを切り替えている。 In this embodiment, the conversion position information is calculated for each SIMD unit, and the PE command and the GP command are switched . Immediately Chi, for each of a plurality of pixels capable of performing processing at a time in PE instruction, and switches between GP instructions and PE instruction.

は、変換位置情報をSIMD単位で予め算出してメモリ等に保存した場合のGP命令とPE命令との選択動作を示すフローチャートである。なお、図のフローチャートはSIMD型マイクロプロセッサ2のグローパルプロセッサ3において実行される。 FIG. 7 is a flowchart showing a selection operation between the GP instruction and the PE instruction when the conversion position information is calculated in advance in SIMD units and stored in a memory or the like. 7 is executed by the global processor 3 of the SIMD type microprocessor 2.

まず、ステップS41において、処理前に変換位置情報(PE命令とGP命令との切り替え条件)をSIMD単位ごとに算出してメモリに保存し、ステップS42において、1SIMD単位の画素を入力し、ステップS43において、メモリに保存したSIMD単位ごとの変換位置情報を参照してPE命令とGP命令の切り替えの判断を行い、PE命令に切り替えられた場合はステップS44において、PE命令にて処理を行い、ステップS43においてGP命令に切り替えられた場合はステップS45において、GP命令にて処理を行い、ステップS46において全画素の処理が完了した場合は終了し、そうでない場合はステップS43に戻る。   First, in step S41, conversion position information (a switching condition between the PE instruction and the GP instruction) is calculated for each SIMD unit and stored in the memory before processing, and in step S42, a pixel in one SIMD unit is input. In step S44, it is determined whether to switch between the PE instruction and the GP instruction by referring to the conversion position information for each SIMD unit stored in the memory. If it is switched to the GP command in S43, the process is performed using the GP command in Step S45. If all the pixels have been processed in Step S46, the process ends. If not, the process returns to Step S43.

は、変換位置情報をPE命令とGP命令の切り替え判断時にSIMD単位ごとに算出した場合のGP命令とPE命令との選択動作を示すフローチャートである。なお、図のフローチャートはSIMD型マイクロプロセッサ2のグローパルプロセッサ3において実行される。 FIG. 8 is a flowchart showing a selection operation between the GP instruction and the PE instruction when the conversion position information is calculated for each SIMD unit when determining the switching between the PE instruction and the GP instruction. Note that the flowchart of FIG. 8 is executed by the global processor 3 of the SIMD type microprocessor 2.

まず、ステップS51において、1SIMD単位の画素を入力し、ステップS52において、入力したSIMD単位において変換位置情報(PE命令とGP命令との切り替え条件)を算出し、ステップS53において、算出した変換位置情報によりPE命令とGP命令の切り替えの判断を行い、PE命令に切り替えられた場合はステップS54において、PE命令にて処理を行い、ステップS53においてGP命令に切り替えられた場合はステップS55において、GP命令にて処理を行い、ステップS56において全画素の処理が完了した場合は終了し、そうでない場合はステップS51に戻る。   First, in step S51, a pixel in one SIMD unit is input. In step S52, conversion position information (a switching condition between a PE command and a GP command) is calculated in the input SIMD unit. In step S53, the calculated conversion position information is calculated. To determine whether to switch between the PE instruction and the GP instruction. When the instruction is switched to the PE instruction, the processing is performed with the PE instruction in step S54. When the switching to the GP instruction is performed in step S53, the GP instruction is performed in step S55. In step S56, the process ends if all pixels have been processed. Otherwise, the process returns to step S51.

本実施形態によれば、SIMD単位ごとに変換位置情報を算出しPE命令とGP命令とを切り替えているので、PE命令とGP命令の判定処理の頻度が削減され処理速度を向上することができる。また、PE命令で一度に処理を行える複数画素ごとにその処理に合った適切な命令を選択することができる。   According to the present embodiment, the conversion position information is calculated for each SIMD unit and the PE instruction and the GP instruction are switched, so that the frequency of the PE instruction and GP instruction determination processing is reduced and the processing speed can be improved. . Further, it is possible to select an appropriate instruction suitable for the processing for each of a plurality of pixels that can be processed at once by the PE instruction.

また、オフセット値を予めSIMD単位ごとに算出してメモリに保存し、PE命令とGP命令の切り替え判断時にそのオフセット値を参照しているので、SIMD単位ごとに効率の良い方の命令を選択実行する事で処理速度を向上することができる。   In addition, the offset value is calculated in advance for each SIMD unit, stored in the memory, and the offset value is referred to when switching between the PE instruction and the GP instruction. Therefore, the instruction that is more efficient for each SIMD unit is selected and executed. By doing so, the processing speed can be improved.

また、オフセット値をPE命令とGP命令の切り替え判断時にその都度算出しているので、メモリの使用量を抑えながら、画素ごとに効率の良い方の命令を選択実行する事で処理速度を向上することができる。   In addition, since the offset value is calculated each time when switching between the PE instruction and the GP instruction is determined, the processing speed is improved by selectively executing the more efficient instruction for each pixel while suppressing the memory usage. be able to.

[第実施形態]
次に、本発明の第の実施形態を図ないし図11を参照して説明する。なお、前述した第1、第2の実施形態と同一部分には、同一符号を付して説明を省略する。図は、GP命令を用いて歪み補正処理を行った場合の例を示す説明図である。図10は、PE命令を用いて歪み補正処理を行った場合の例を示す説明図である。図11は、GP命令とPE命令の組み合わせパターンを示したフローチャートである。
[ Second Embodiment]
Next, a second embodiment of the present invention with reference to FIGS. The same parts as those in the first and second embodiments described above are denoted by the same reference numerals and description thereof is omitted. FIG. 9 is an explanatory diagram showing an example when distortion correction processing is performed using a GP instruction. FIG. 10 is an explanatory diagram showing an example when distortion correction processing is performed using a PE instruction. FIG. 11 is a flowchart showing a combination pattern of GP instructions and PE instructions.

のGP命令を用いた場合、注目画素(x+M,y+N)では、予め各画素ごとに算出したオフセット値が(3,3)であった場合は、処理後の画素位置(x+M+3,y+N+3)の画素値を参照して処理後の注目画素(x+M,y+N)の画素値を決定していく。 When the GP command of FIG. 9 is used, in the target pixel (x + M, y + N), if the offset value calculated in advance for each pixel is (3, 3), the pixel position after processing (x + M + 3, y + N + 3) The pixel value of the target pixel (x + M, y + N) after processing is determined with reference to the pixel value.

次に、図10のPE命令を用いた場合、注目画素(x+M,y+N)を中心とするm×nのマトリクス内で探索することで処理後の画素位置を参照して処理後の注目画素(x+M,y+N)の画素値を決定していく。つまり、図4に示したSIMD型マイクロプロセッサを用いる場合は最大7×7の範囲について探索することができる。 Next, when the PE instruction in FIG. 10 is used, the pixel of interest after processing is referred to by referring to the pixel position after processing by searching in an m × n matrix centered on the pixel of interest (x + M, y + N). The pixel value of x + M, y + N) is determined. That is, when using the SIMD type microprocessor shown in FIG. 4, it is possible to search for a range of a maximum of 7 × 7.

この図10のアルゴリズムの場合、例えば1画素を移動するために10命令かかり、PE命令では図4に示したSIMD型マイクロプロセッサ2が352PEであったとすると、7×7範囲の場合、49×10命令=490回で1SIMD単位分(352画素)の処理を完了することが出来るのに対して、GP命令では1画素単位処理のために、1SIMD単位分352画素を処理するためには、490×352=172480回必要になる。 In the case of the algorithm shown in FIG. 10 , for example, 10 instructions are required to move one pixel. In the PE instruction, if the SIMD type microprocessor 2 shown in FIG. The processing for 1 SIMD unit (352 pixels) can be completed by 490 times of the command = 490 times, whereas in order to process 352 pixels for 1 SIMD unit in the GP command, 490 × 352 = 172480 times are required.

また、図のGP命令を用いた場合のアルゴリズムと、図10のPE命令を用いた場合のアルゴリズムは、それぞれ異なるが、同じ入力画像であれば同じ結果を得ることができる。従って、図11に示すように複数の処理を連続して行う際に、PE命令とGP命令とを組み合わせることができる。つまり、図11の処理パターン1では、GP命令で補間処理を行った後にGP命令で補正処理を行っている。処理パターン2では、GP命令で補間処理を行った後にPE命令で補正処理を行っている。処理パターン3では、PE命令で補間処理を行った後にPE命令で補正処理を行っている。処理パターン4では、PE命令で補間処理を行った後にGP命令で補正処理を行っている。このような組み合わせを入力画像の画素やSIMD単位ごとに組み合わせて行うことで、演算時間の短縮が図れる。 Further, the algorithm using the GP instruction of FIG. 9 and the algorithm using the PE instruction of FIG. 10 are different, but the same result can be obtained if they are the same input image. Therefore, as shown in FIG. 11, when a plurality of processes are continuously performed, the PE instruction and the GP instruction can be combined. That is, in the processing pattern 1 of FIG. 11 , the interpolation processing is performed with the GP command and then the correction processing is performed with the GP command. In the processing pattern 2, the interpolation processing is performed using the GP command, and then the correction processing is performed using the PE command. In processing pattern 3, after performing interpolation processing with a PE command, correction processing is performed with a PE command. In the processing pattern 4, the interpolation processing is performed using the PE command, and then the correction processing is performed using the GP command. Calculation time can be reduced by combining such combinations for each pixel or SIMD unit of the input image.

本実施形態によれば、GP命令とPE命令とで、同じ結果が得られるがそれぞれ異なるアルゴリズムを用いて処理を行っているので、入力画像の特徴、つまり変換位置情報によって適切な処理を選択することができる。   According to the present embodiment, the same result is obtained with the GP instruction and the PE instruction, but processing is performed using different algorithms, so that an appropriate process is selected according to the characteristics of the input image, that is, the converted position information. be able to.

なお、上述した実施形態は、図4に示したSIMD型マイクロプロセッサ2を用いた場合であって、他のSIMD型マイクロプロセッサなどPE命令とGP命令を実行可能なマイクロプロセッサであれば用いることができる。勿論その際は、PE命令とGP命令との切り替え条件(4画素以上の距離や7×7の範囲等)もそのマイクロプロセッサに応じて変更すればよい。   The embodiment described above is a case where the SIMD type microprocessor 2 shown in FIG. 4 is used, and any microprocessor such as another SIMD type microprocessor capable of executing PE instructions and GP instructions may be used. it can. Of course, in that case, the switching condition (distance of 4 pixels or more, range of 7 × 7, etc.) between the PE instruction and the GP instruction may be changed according to the microprocessor.

また、本発明を適用する画像処理も歪み補正処理に限らず、画像の回転処理などの処理に用いてもよい。   The image processing to which the present invention is applied is not limited to distortion correction processing, and may be used for processing such as image rotation processing.

また、本発明は上記実施形態に限定されるものではない。即ち、本発明の骨子を逸脱しない範囲で種々変形して実施することができる。   The present invention is not limited to the above embodiment. That is, various modifications can be made without departing from the scope of the present invention.

本実施形態において画像処理として歪み補正処理がなされる画像の構成を示す説明図である。It is explanatory drawing which shows the structure of the image in which distortion correction processing is made as image processing in this embodiment. SIMD単位を示す説明図である。It is explanatory drawing which shows a SIMD unit. 図1に示された画像とSIMD単位との関係を示す説明図である。It is explanatory drawing which shows the relationship between the image shown by FIG. 1, and a SIMD unit. 本発明の第1の実施形態にかかる画像処理装置としてのSIMD型マイクロプロセッサのブロック図である。1 is a block diagram of a SIMD type microprocessor as an image processing apparatus according to a first embodiment of the present invention. 図1に示した画像の一部分の拡大図である。FIG. 2 is an enlarged view of a part of the image shown in FIG. 1. SIMD単位で処理を実行する場合の説明図である。It is explanatory drawing in the case of performing a process per SIMD unit. 変換位置情報をSIMD単位で予め算出してメモリ等に保存した場合のGP命令とPE命令との選択動作を示すフローチャートである。It is a flowchart which shows selection operation | movement of GP command and PE command at the time of calculating beforehand conversion position information per SIMD unit, and preserve | saving in memory etc. FIG. 変換位置情報をPE命令とGP命令の切り替え判断時にSIMD単位ごとに算出した場合のGP命令とPE命令との選択動作を示すフローチャートである。It is a flowchart which shows the selection operation | movement of GP command and PE command at the time of calculating conversion position information for every SIMD unit at the time of switching judgment of PE command and GP command. GP命令を用いて歪み補正処理を行った場合の例を示す説明図である。It is explanatory drawing which shows the example at the time of performing a distortion correction process using GP command. PE命令を用いて歪み補正処理を行った場合の例を示す説明図である。It is explanatory drawing which shows the example at the time of performing a distortion correction process using PE command. GP命令とPE命令の組み合わせパターンを示したフローチャートである。It is the flowchart which showed the combination pattern of GP command and PE command. レンズ歪みを持った画像とその補正例を示す説明図である。It is explanatory drawing which shows the image with lens distortion, and its correction example.

2 SIMD型マイクロプロセッサ
3 グローバルプロセッサ
43 GP命令とPE命令との切り替え判断
44 PE命令による処理
45 GP命令による処理
2 SIMD type microprocessor 3 Global processor S 43 Judgment of switching between GP instruction and PE instruction S 44 Processing by PE instruction S 45 Processing by GP instruction

Claims (5)

入力された画像データに対して、その画像データの単一画素ごとに処理を行うGP命令と、一度に複数の画素の処理を行うPE命令と、を選択して実行する画像処理方法において、
前記画像データに対して所定の処理を行う際に、原点から移動点に移るパラメータである変換位置情報に基づいて、前記GP命令と前記PE命令とのうちのいずれかの処理時間が短い命令に切り替えて実行することを特徴とする画像処理方法。
In an image processing method for selecting and executing a GP instruction for processing each input image data for each single pixel of the image data and a PE instruction for processing a plurality of pixels at a time,
When performing predetermined processing on the image data, based on the conversion position information that is a parameter that moves from the origin to the moving point, the command that has a shorter processing time of either the GP command or the PE command An image processing method characterized by switching and executing.
前記GP命令と前記PE命令が、それぞれ同一の処理結果となる異なるアルゴリズムにより前記画像データの処理を行うことを特徴とする請求項1に記載の画像処理方法。   2. The image processing method according to claim 1, wherein the GP instruction and the PE instruction process the image data according to different algorithms each having the same processing result. 前記画像データの前記PE命令で一度に処理を行える複数画素ごとに、前記GP命令と前記PE命令とを切り替えることを特徴とする請求項1または2に記載の画像処理方法。   3. The image processing method according to claim 1, wherein the GP command and the PE command are switched for each of a plurality of pixels that can be processed at once by the PE command of the image data. 前記変換位置情報を、前記PE命令で一度に処理を行える複数画素ごとに算出することを特徴とする請求項1乃至のうちいずれか一項に記載の画像処理方法。 The conversion position information, the image processing method according to any one of claims 1 to 3, characterized in that calculating for each of the plurality of pixels capable of performing processing at a time in the PE instruction. 前記変換位置情報を、予め算出して保持することを特徴とする請求項に記載の画像処理方法。 The image processing method according to claim 4 , wherein the conversion position information is calculated and held in advance.
JP2008025938A 2008-02-06 2008-02-06 Image processing method Expired - Fee Related JP4933462B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008025938A JP4933462B2 (en) 2008-02-06 2008-02-06 Image processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008025938A JP4933462B2 (en) 2008-02-06 2008-02-06 Image processing method

Publications (2)

Publication Number Publication Date
JP2009187240A JP2009187240A (en) 2009-08-20
JP4933462B2 true JP4933462B2 (en) 2012-05-16

Family

ID=41070417

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008025938A Expired - Fee Related JP4933462B2 (en) 2008-02-06 2008-02-06 Image processing method

Country Status (1)

Country Link
JP (1) JP4933462B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012059186A (en) * 2010-09-13 2012-03-22 Ricoh Co Ltd Image processing apparatus and method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001076132A (en) * 1999-07-05 2001-03-23 Sony Corp Device and method for image processing
JP2001092946A (en) * 1999-09-20 2001-04-06 Ricoh Co Ltd Image processor

Also Published As

Publication number Publication date
JP2009187240A (en) 2009-08-20

Similar Documents

Publication Publication Date Title
US8219783B2 (en) SIMD type microprocessor having processing elements that have plural determining units
JP5840994B2 (en) Matrix operation unit
JP4478050B2 (en) SIMD type microprocessor and data processing method
JP2009223758A (en) Image processing apparatus
JP3985797B2 (en) Processor
JP2009015555A (en) Simd microprocessor and data transfer method for simd microprocessor
JP4933462B2 (en) Image processing method
US7515159B2 (en) Reconfigurable address generation circuit for image processing, and reconfigurable LSI comprising the same
JP2012059186A (en) Image processing apparatus and method
JP2013061738A (en) Image processing device and method
US7483595B2 (en) Image processing method and device
JP4482356B2 (en) Image processing method and image processing apparatus using SIMD processor
JP4708387B2 (en) Address data generation apparatus and memory addressing method
JP5369669B2 (en) SIMD type microprocessor
JP4408113B2 (en) Signal processing method
JP2007108913A (en) Simd microprocessor for detecting peak value
JP5463799B2 (en) SIMD type microprocessor
US20100031002A1 (en) Simd microprocessor and operation method
JP5499203B2 (en) Block matching circuit and data update method
US20090060048A1 (en) Motion detection circuit and method
JP2013161325A (en) Simd (single instruction-stream multiple data-stream) type microprocessor, processor system and data processing method for simd type microprocessor
JP5055393B2 (en) SIMD type microprocessor
JP4516495B2 (en) Data processing method in SIMD type microprocessor
JP3970049B2 (en) Address data generation apparatus and memory addressing method
JPH06309349A (en) Program-controlled processor

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20101006

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20111013

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20111101

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20111228

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120216

R150 Certificate of patent or registration of utility model

Ref document number: 4933462

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20150224

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees