JP5620829B2 - Data processing apparatus, image processing apparatus, and methods thereof - Google Patents

Data processing apparatus, image processing apparatus, and methods thereof Download PDF

Info

Publication number
JP5620829B2
JP5620829B2 JP2011003398A JP2011003398A JP5620829B2 JP 5620829 B2 JP5620829 B2 JP 5620829B2 JP 2011003398 A JP2011003398 A JP 2011003398A JP 2011003398 A JP2011003398 A JP 2011003398A JP 5620829 B2 JP5620829 B2 JP 5620829B2
Authority
JP
Japan
Prior art keywords
filter
data
divided
image
processing
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
JP2011003398A
Other languages
Japanese (ja)
Other versions
JP2012146096A (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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2011003398A priority Critical patent/JP5620829B2/en
Publication of JP2012146096A publication Critical patent/JP2012146096A/en
Application granted granted Critical
Publication of JP5620829B2 publication Critical patent/JP5620829B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration by the use of local operators

Landscapes

  • Image Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)

Description

本発明は、ディジタルデータのフィルタ処理に関する。   The present invention relates to digital data filtering.

フィルタサイズが大きいフィルタ処理の高速化手法として、例えば、フィルタ処理を行う周波数域を制限する方法が知られている(例えば、特許文献1)。特許文献1は、二焦点レンズのピント暈けを補正する技術を開示する。つまり、暈けを表す関数の逆関数と撮影画像を畳込演算する際に、ピント暈けが低域成分に存在することを考慮して、帯域分割により撮影画像の低域成分を取り出して畳込演算の演算量を削減する。   As a method for speeding up filter processing with a large filter size, for example, a method of limiting a frequency region for performing filter processing is known (for example, Patent Document 1). Patent Document 1 discloses a technique for correcting the defocusing of a bifocal lens. In other words, when convolution is performed between the inverse function of the function representing blur and the captured image, the low frequency component of the captured image is extracted by band division and convolved, considering that the focus blur exists in the low frequency component. Reduce the amount of computation.

また、フィルタによる畳込演算を、フィルタ処理する注目画素と、その周辺画素の相互作用と考えると、空間上に存在する多数の粒子の間において、何らかの力の相互作用が生じる場を解く多体問題(N-body problem)と見做すことができる。多体問題の高速化手法として、高速多重極法(fast multipole method)が知られている(例えば、非特許文献1)。高速多重極法は、重力またはクーロン力が相互作用する場において、遠く離れた物体間の作用力は小さいことに着目し、式展開とツリー構造による領域分割により、離れた粒子からの寄与分をまとめて効率よく計算する手法である。   Also, considering the convolution operation by the filter as the interaction between the target pixel to be filtered and its surrounding pixels, it is a multi-body that solves a field where some force interaction occurs between many particles existing in space. It can be regarded as a problem (N-body problem). A fast multipole method is known as a method for speeding up many-body problems (for example, Non-Patent Document 1). The fast multipole method pays attention to the fact that the acting force between distant objects is small in the field where gravity or Coulomb force interacts. This is a method for calculating efficiently together.

しかし、特許文献1が開示する技術は、ある特定の帯域のみをフィルタ処理することはできるが、全周波数域をフィルタ処理する場合に適用することができない。   However, the technique disclosed in Patent Document 1 can filter only a specific band, but cannot be applied to the case of filtering the entire frequency band.

また、非特許文献1が開示する技術は、重力やクーロン力のような二点間の距離の二乗に反比例するような力に対して式変形を施して計算量を削減するが、相互作用力がより一般的な任意の関数で表される場合には適用することができない。   In addition, the technology disclosed in Non-Patent Document 1 reduces the amount of calculation by transforming a force that is inversely proportional to the square of the distance between two points, such as gravity and Coulomb force, but the interaction force Is not applicable if is represented by any more general function.

特開2007-72558公報JP 2007-72558

L. Greengard and V. Rohklin「A Fast Algorithm for Particle Simulations」JOURNAL OF COMPUTATIONAL PHYSICS 73, 315-348(1987)L. Greengard and V. Rohklin `` A Fast Algorithm for Particle Simulations '' JOURNAL OF COMPUTATIONAL PHYSICS 73, 315-348 (1987)

本発明は、ディジタルデータのフィルタ処理における計算量を低減して、フィルタ処理を高速化することを目的とする。   An object of the present invention is to reduce the amount of calculation in the filtering process of digital data and to speed up the filtering process.

本発明は、前記の目的を達成する一手段として、以下の構成を備える。   The present invention has the following configuration as one means for achieving the above object.

本発明にかかるデータ処理は、入力データを所定データサイズの複数の分割データに分割し、前記所定データサイズに基づき、フィルタを複数の分割フィルタに分割し、前記複数の分割フィルタごとにフィルタ係数の近似多項式を作成し、複数の分割データ、前記複数の分割フィルタおよび前記近似多項式を用いて、前記入力データに前記フィルタによるフィルタ処理を施すことを特徴とする。   The data processing according to the present invention divides input data into a plurality of divided data of a predetermined data size, divides a filter into a plurality of divided filters based on the predetermined data size, and sets a filter coefficient for each of the plurality of divided filters. An approximate polynomial is created, and a filter process using the filter is performed on the input data using a plurality of divided data, the plurality of divided filters, and the approximate polynomial.

本発明によれば、ディジタルデータのフィルタ処理における計算量を低減して、フィルタ処理を高速化することができる。   According to the present invention, it is possible to reduce the amount of calculation in the filtering process of digital data and to speed up the filtering process.

実施例の画像処理装置の構成例を説明するブロック図。1 is a block diagram illustrating a configuration example of an image processing apparatus according to an embodiment. 画像処理装置が実行するフィルタ処理を説明するフローチャート。6 is a flowchart for describing filter processing executed by the image processing apparatus. フィルタ処理の詳細を説明するフローチャート。The flowchart explaining the detail of a filter process. フィルタサイズの分割を説明する図。The figure explaining division | segmentation of filter size. 畳込演算における画像データAとフィルタB'の関係を説明する図。The figure explaining the relationship between the image data A and filter B 'in a convolution calculation. 分割領域Rdi、Rdj周辺の拡大図を示す図。The figure which shows the enlarged view around division area Rdi and Rdj. フィルタ範囲の拡大を説明する図。The figure explaining expansion of a filter range. 処理結果の確認に使用した画像Aの一例を示す図。The figure which shows an example of the image A used for confirmation of a processing result. 処理結果の確認に使用した画像Aの一例を示す図。The figure which shows an example of the image A used for confirmation of a processing result. 画像Aに対し、フィルタBによる処理を行って取得した画像Cと、フィルタB'による処理を行って取得した画像Dを示す図。The figure which shows the image C acquired by performing the process by filter B ', and the image C acquired by performing the process by the filter B with respect to the image A. フィルタBを用いる処理とフィルタB'を用いる処理の比較結果を説明する図。The figure explaining the comparison result of the process which uses filter B, and the process which uses filter B '. 分割領域のサイズを20×20画素として、フィルタ処理した後の画像および空間周波数分布を示す図。The figure which shows the image and spatial frequency distribution after filter processing by making the size of a division area into 20x20 pixels. 一次元フィルタ処理を説明するフローチャート。The flowchart explaining a one-dimensional filter process. フィルタ処理の詳細を説明するフローチャート。The flowchart explaining the detail of a filter process.

以下、本発明にかかる実施例のデータ処理および画像処理を図面を参照して詳細に説明する。   Hereinafter, data processing and image processing according to an embodiment of the present invention will be described in detail with reference to the drawings.

[装置の構成]
図1のブロック図により実施例の画像処理装置の構成例を説明する。
[Device configuration]
A configuration example of the image processing apparatus according to the embodiment will be described with reference to the block diagram of FIG.

CPU101は、RAM103をワークメモリとして、ROM102やハードディスクドライブ(HDD)108に格納されたプログラムを実行し、システムバス104を介して後述する各構成を制御する。これにより、後述する様々な処理が実行される。   The CPU 101 uses the RAM 103 as a work memory, executes a program stored in the ROM 102 or the hard disk drive (HDD) 108, and controls each component to be described later via the system bus 104. Thereby, various processes described later are executed.

汎用インタフェイス(I/F)105は、キーボードやマウス、ディジタルカメラ、スキャナ、メモリカードリーダ、ハードディスクドライブなど、様々なデバイス106を接続する、例えばUSBやIEEE1394などのシリアルバスインタフェイスである。CPU101は、汎用I/F105を介して、デバイス106から各種データを読み込み、各種データをデバイス106に書き込むことが可能である。   A general-purpose interface (I / F) 105 is a serial bus interface such as USB or IEEE1394 that connects various devices 106 such as a keyboard, mouse, digital camera, scanner, memory card reader, and hard disk drive. The CPU 101 can read various data from the device 106 via the general-purpose I / F 105 and write various data to the device 106.

HDDインタフェイス(I/F)107は、HDD108や光ディスクドライブなどの二次記憶装置を接続する、例えばシリアルATA(SATA)などのインタフェイスである。CPU101は、HDD I/F107を介して、HDD108からデータを読み出し、HDD108にデータを書き込むことが可能である。さらに、CPU101は、HDD108に格納されたデータをRAM103に展開し、同様に、RAM103に展開されたデータをHDD108に保存することが可能である。そしてCPU101は、RAM103に展開したデータをプログラムと見做して実行することができる。   The HDD interface (I / F) 107 is an interface such as a serial ATA (SATA) for connecting a secondary storage device such as the HDD 108 or an optical disk drive. The CPU 101 can read data from the HDD 108 and write data to the HDD 108 via the HDD I / F 107. Further, the CPU 101 can expand the data stored in the HDD 108 to the RAM 103, and can similarly store the data expanded in the RAM 103 to the HDD 108. The CPU 101 can execute the data expanded in the RAM 103 as a program.

ビデオカード(VC)109は、モニタ110用のインタフェイスである。CPU101は、VC109を介して、後述するユーザインタフェイス(UI)、フィルタ処理すべき画像、フィルタ処理後の画像を含む各種画像をモニタ110に表示する。   A video card (VC) 109 is an interface for the monitor 110. The CPU 101 displays various images including a user interface (UI), which will be described later, an image to be filtered, and an image after filtering, on the monitor 110 via the VC 109.

ユーザは、デバイス106として汎用I/F105に接続されたキーボードやマウスにより、モニタ110に表示されたUIを操作して、例えば後述するフィルタ処理などの実行をCPU101に指示する。フィルタ処理の実行を指示されたCPU101は、ROM102またはHDD108に格納されたフィルタ処理のプログラムを実行する。そして、CPU101は、UIを介してユーザが指定する画像データをHDD108やデバイス106から読み込み、読み込んだ画像データにフィルタ処理を施す。さらに、フィルタ処理後の画像データを、UIを介してユーザが指定する、HDD108やデバイス106の領域に格納したり、フィルタ処理後の画像データが表す画像をモニタ110に表示したりする。   The user operates the UI displayed on the monitor 110 with a keyboard or mouse connected to the general-purpose I / F 105 as the device 106, and instructs the CPU 101 to execute, for example, a filter process described later. The CPU 101 instructed to execute the filter process executes a filter process program stored in the ROM 102 or the HDD 108. Then, the CPU 101 reads image data specified by the user via the UI from the HDD 108 or the device 106, and performs a filtering process on the read image data. Further, the image data after the filtering process is stored in the area of the HDD 108 or the device 106 designated by the user via the UI, or the image represented by the image data after the filtering process is displayed on the monitor 110.

[フィルタ処理]
図2Aのフローチャートにより画像処理装置が実行するフィルタ処理を説明する。
[Filter processing]
The filtering process executed by the image processing apparatus will be described with reference to the flowchart of FIG. 2A.

CPU101は、ユーザが指定する画像データAを入力し(S101)、入力した画像データAが表す画像を横Nx画素×縦Ny画素(所定サイズ)の複数の領域に分割する(S102)。なお、画像を横方向(X方向)に分割する場合、画像の例えば右端において幅がNx画素に満たない領域が発生する可能性があるが、そのような領域も分割領域として扱う。同様に、画像を縦方向(Y方向)に分割する場合、画像の例えば下端において高さがNy画素に満たない領域が発生する可能性があるが、そのような領域も分割領域として扱う。また、以下の説明では、分割領域の数をMとする。   The CPU 101 inputs image data A designated by the user (S101), and divides the image represented by the input image data A into a plurality of regions of horizontal Nx pixels × vertical Ny pixels (predetermined size) (S102). Note that, when an image is divided in the horizontal direction (X direction), an area having a width less than Nx pixels may occur at the right end of the image, for example. Such an area is also treated as a divided area. Similarly, when an image is divided in the vertical direction (Y direction), an area having a height less than Ny pixels may occur at the lower end of the image, for example. Such an area is also treated as a divided area. In the following description, the number of divided areas is M.

次に、CPU101は、フィルタ処理用のフィルタBを表すデータを例えばHDD108から入力する(S103)。フィルタBのフィルタサイズを横Nfx画素×縦Nfy画素とする。フィルタBは、注目画素からの距離の関数として表現されてもよいし、フィルタの各成分(フィルタ係数)を表すデータでもよい。ただし、後述するように、フィルタBのフィルタサイズを分割領域のサイズの自然数倍に拡大するため、フィルタ処理の裾に相当する部分の成分(フィルタ係数)がほぼ零であることが好ましい。   Next, the CPU 101 inputs data representing the filter B for filter processing from, for example, the HDD 108 (S103). The filter size of filter B is horizontal Nfx pixels × vertical Nfy pixels. The filter B may be expressed as a function of the distance from the target pixel, or may be data representing each component (filter coefficient) of the filter. However, as will be described later, in order to increase the filter size of the filter B to a natural number times the size of the divided region, it is preferable that the component (filter coefficient) of the portion corresponding to the tail of the filter processing is substantially zero.

次に、CPU101は、分割領域のサイズNx×Nyに対応させて、フィルタBを分割する(S104)。その際、CPU101は、分割後のフィルタが縦横ともに奇数個の分割フィルタ(サイズNx×Ny)から構成されるように、フィルタサイズを拡大する。図3によりフィルタサイズの分割を説明する。つまり、分割フィルタの数を縦Lx×横Lyとすると、Lx、Lyが下式を満たすようにフィルタサイズを拡大する。なお、以下では、分割フィルタの数をLx×Ly=LLと表す。
Nx×Lx ≧ Nfx
Ny×Ly ≧ Nfy …(1)
ここで、Lx、Lyはそれぞれ奇数。
Next, the CPU 101 divides the filter B so as to correspond to the size of the divided area Nx × Ny (S104). At this time, the CPU 101 enlarges the filter size so that the divided filter is composed of an odd number of divided filters (size Nx × Ny) both vertically and horizontally. The filter size division will be described with reference to FIG. That is, assuming that the number of divided filters is vertical Lx × horizontal Ly, the filter size is expanded so that Lx and Ly satisfy the following expression. Hereinafter, the number of division filters is expressed as Lx × Ly = LL.
Nx × Lx ≧ Nfx
Ny × Ly ≧ Nfy… (1)
Here, Lx and Ly are odd numbers.

なお、拡大後のフィルタのサイズは下式で表される。
Nfx'×Nfy' = (Nx×Lx)×(Ny×Ly) …(2)
The size of the enlarged filter is expressed by the following formula.
Nfx '× Nfy' = (Nx × Lx) × (Ny × Ly)… (2)

次に、CPU101は、分割フィルタごとに、フィルタ係数をフィルタ中心からの距離の多項式関数で近似して、多項式の各項の係数を求める(S105)。なお、元のフィルタBを近似多項式で表したフィルタをフィルタB'とする。そして、CPU101は、詳細は後述するが、複数の分割領域、複数の分割フィルタおよび近似多項式を用いて、画像データAにフィルタB'によるフィルタ処理を施す(S106)。   Next, for each divided filter, the CPU 101 approximates the filter coefficient with a polynomial function of the distance from the filter center to obtain a coefficient of each term of the polynomial (S105). Note that a filter in which the original filter B is represented by an approximate polynomial is a filter B ′. Then, as will be described in detail later, the CPU 101 performs filter processing using the filter B ′ on the image data A using a plurality of divided regions, a plurality of divided filters, and an approximate polynomial (S106).

●近似多項式
ここで、近似多項式の作成について説明する。
● Approximation polynomial Here, the creation of the approximation polynomial is explained.

フィルタが二階微分が可能な関数で表される場合、各分割フィルタの中心周りでテイラ展開を行って近似多項式を作成すればよい。より一般的には、誤差の二乗和を最小にするように近似多項式の係数を決める最小二乗法を利用する。最小二乗法は、フィルタの関数が不連続または微分不可能な点を含む場合や、フィルタ係数が中心からの距離の関数ではなく予め画素に対応するセルごとに与えられている場合にも適用可能である。   When the filter is expressed by a function capable of second order differentiation, an approximate polynomial may be created by performing Taylor expansion around the center of each divided filter. More generally, a least square method is used in which the coefficients of the approximate polynomial are determined so as to minimize the sum of squared errors. The least squares method can be applied when the filter function includes discontinuous or non-differentiable points, or when the filter coefficient is given in advance for each cell corresponding to a pixel instead of a function of the distance from the center. It is.

ここで、テイラ展開を用いて近似多項式を求める例を説明する。例えば、フィルタBのフィルタ係数が、フィルタ中心からの距離(x, y)の関数f(x, y)として表されるとする。関数f(x, y)を二階微分が可能な関数とし、位置(a, b)周りで二次の項までテイラ展開すると、下式が得られる。
f(x, y) ≒ f(a, b) + fx(a, b)(x-a) + fy(a, b)(y-b)
+ fxx(a, b)(x-a)2/2 + fyy(a, b)(y-b)2/2
+ fxy(a, b)(x-a)(y-b) …(3)
ここで、fx = ∂f/∂x、fy = ∂f/∂y、
fxx = ∂2f/∂x2、fyy = ∂2f/∂y2
fxy = ∂2f/∂x/∂y
Here, an example of obtaining an approximate polynomial using Taylor expansion will be described. For example, it is assumed that the filter coefficient of the filter B is expressed as a function f (x, y) of the distance (x, y) from the filter center. When the function f (x, y) is a function capable of second order differentiation and Taylor expansion is performed up to a quadratic term around the position (a, b), the following equation is obtained.
f (x, y) ≒ f (a, b) + f x (a, b) (xa) + f y (a, b) (yb)
+ F xx (a, b) (xa) 2/2 + f yy (a, b) (yb) 2/2
+ f xy (a, b) (xa) (yb)… (3)
Where f x = ∂f / ∂x, f y = ∂f / ∂y,
f xx = ∂ 2 f / ∂x 2 , f yy = ∂ 2 f / ∂y 2 ,
f xy = ∂ 2 f / ∂x / ∂y

さらに、下記を定義して式(3)を変形すると式(4)が得られる。
axx = fxx(a, b)/2、ayy = fyy(a, b)/2、axy = fxy(a, b)、
ax = fx(a, b) - 2afxx(a, b) - bfxy(a, b)、ay = fy(a, b) - 2bfyy(a, b) - afxy(a,b)、
a0 = f(a, b) - afx(a, b)- bfy(a, b) + a2fxx(a, b)/2 + abfxy(a, b) + b2fyy(a, b)/2、
f(x, y) ≒ axxx2 + axyxy + ayyy2 + axx + ayy + a0 …(4)
Furthermore, when the equation (3) is modified by defining the following, the equation (4) is obtained.
a xx = f xx (a, b) / 2, a yy = f yy (a, b) / 2, a xy = f xy (a, b),
a x = f x (a, b)-2af xx (a, b)-bf xy (a, b), a y = f y (a, b)-2bf yy (a, b)-af xy (a , b),
a 0 = f (a, b ) - af x (a, b) - bf y (a, b) + a 2 f xx (a, b) / 2 + abf xy (a, b) + b 2 f yy (a, b) / 2,
f (x, y) ≒ a xx x 2 + a xy xy + a yy y 2 + a x x + a y y + a 0 … (4)

なお、上記には二次多項式の例を示したが、これに限定されるものではなく、一次、あるいは、三次または四次以上の次数をもつ多項式でもよい。例えば一次の項までの近似多項式であれば、式(4)に代わり式(5)を用いることになる。式(5)を用いれば、項の数は半分になるが、近似精度(元の関数f(x, y)と(3)や(4)式で示す多項式との誤差)が低下する。
f(x, y) ≒ axx + ayy + a0 …(5)
In addition, although the example of the 2nd order polynomial was shown above, it is not limited to this, The polynomial which has the order of 1st order or 3rd order or 4th order or more may be used. For example, in the case of an approximate polynomial up to a first order term, equation (5) is used instead of equation (4). If Expression (5) is used, the number of terms is halved, but the approximation accuracy (the error between the original function f (x, y) and the polynomial shown in Expressions (3) and (4)) decreases.
f (x, y) ≒ a x x + a y y + a 0 … (5)

他方、三次や四次以上の次数をもつ近似多項式を用いれば、近似精度は向上するが、例えば、項の数は三次で10、四次で15と増える分、計算量が増大する。一般にf(x, y)をn次多項式で近似すると式(6)のように表される。
f(x, y) ≒ ΣpΣqapqxpqj …(6)
ここで、Σpの範囲はp=0からn、
Σqの範囲はq=0からn、
nは多項式の次数。
On the other hand, if an approximation polynomial having a degree of 3rd order or 4th order or more is used, the approximation accuracy is improved. However, for example, the number of terms increases to 10 for the third order and 15 for the fourth order, so that the calculation amount increases. In general, when f (x, y) is approximated by an nth order polynomial, it is expressed as equation (6).
f (x, y) ≒ Σ p Σ q a pq x p q j … (6)
Where Σ p ranges from p = 0 to n,
Σ q ranges from q = 0 to n,
n is the degree of the polynomial.

フィルタBをLL個の分割フィルタに分割した場合、式(6)の近似多項式もLL個生成され、係数{apq}の組もLL組得られる。なお、LL個の近似多項式のすべてが同じ次数をもつ必要はなく、例えば、フィルタ中心に近い分割フィルタは二次の近似多項式とし、フィルタ中心から遠い分割フィルタは一次の近似多項式としてもよい。 When filter B is divided into LL divided filters, LL approximation polynomials of Equation (6) are also generated, and LL sets of coefficients {a pq } are also obtained. Note that it is not necessary for all the LL approximation polynomials to have the same order. For example, a division filter close to the filter center may be a second-order approximation polynomial, and a division filter far from the filter center may be a first-order approximation polynomial.

●フィルタ処理
図2Bのフローチャートによりフィルタ処理(S106)の詳細を説明する。
Filter Process Details of the filter process (S106) will be described with reference to the flowchart of FIG. 2B.

近似多項式の作成(S105)の後、CPU101は、領域分割した画像データAに対し、フィルタB'の近似多項式を使って各画素とフィルタの畳込演算を行う。CPU101は、カウンタiを1に初期化し(S111)、画像データAのi番目の分割領域Rdi(第一の分割領域)を選択する(S112)。   After creation of the approximate polynomial (S105), the CPU 101 performs a convolution operation of each pixel and the filter on the image data A obtained by dividing the region using the approximate polynomial of the filter B ′. The CPU 101 initializes the counter i to 1 (S111), and selects the i-th divided area Rdi (first divided area) of the image data A (S112).

図4により畳込演算における画像データAとフィルタB'の関係を説明する。図4に示すように、CPU101は、分割領域Rdiとフィルタ中心が一致するように画像データAにフィルタB'を重ね、分割領域RdiとフィルタB'による畳込演算の対象領域Rfを決定する(S113)。そして、カウンタjを1に初期化し(S114)、対象領域Rfに含まれるj番目の分割領域Rdj(第二の分割領域)を選択する(S115)。   The relationship between the image data A and the filter B ′ in the convolution operation will be described with reference to FIG. As shown in FIG. 4, the CPU 101 superimposes the filter B ′ on the image data A so that the filter center matches the divided region Rdi, and determines the target region Rf of the convolution operation by the divided region Rdi and the filter B ′ ( S113). Then, the counter j is initialized to 1 (S114), and the jth divided region Rdj (second divided region) included in the target region Rf is selected (S115).

図4はカウンタiに対応する分割領域Rdiを中心とする対象領域Rfにおいて、カウンタjに対応する分割領域Rdjが選択された様子を示す。CPU101は、分割領域Rdiの位置に対する分割領域Rdjの位置に基づきフィルタB'の近似多項式の係数の組を選択する(S116)。   FIG. 4 shows a state in which the divided region Rdj corresponding to the counter j is selected in the target region Rf centered on the divided region Rdi corresponding to the counter i. The CPU 101 selects a set of coefficients of the approximate polynomial of the filter B ′ based on the position of the divided area Rdj with respect to the position of the divided area Rdi (S116).

分割領域Rdi内の画素(x1, y1)を注目画素とすると、注目画素とフィルタB'の畳込演算は次のように表される。
h'(x1, y1) = h(x1, y1)*f(x1, y1)
= Σx'Σy'h(x', y')f(x'-x1, y'-y1) …(7)
ここで、h(x1, y1)は注目画素の画素値、
h'(x1, y1)はフィルタ処理後の画素値、
f(x1, y1)はフィルタ係数、
*は畳込演算を表す。
When the pixel (x1, y1) in the divided region Rdi is the target pixel, the convolution operation of the target pixel and the filter B ′ is expressed as follows.
h '(x1, y1) = h (x1, y1) * f (x1, y1)
= Σ x ' Σ y' h (x ', y') f (x'-x1, y'-y1)… (7)
Where h (x1, y1) is the pixel value of the target pixel,
h ′ (x1, y1) is the pixel value after filtering,
f (x1, y1) is the filter coefficient,
* Represents a convolution operation.

式(7)において、分割領域Rdjに含まれる画素からの寄与分は、フィルタB'が二次多項式(4)で近似されているものとし、分割領域Rdjに含まれる画素の位置を(x2, y2)として、下式で表される。
h'(x1, y1)|Rdj = ΣΣh(x2, y2)f(x2-x1, y2-y1)
≒ ΣΣh(x2, y2){axx(x2-x1)2 + axy(x2-x1)(y2-y1)
+ ayy(y2-y1)2 + ax(x2-x1) + ay(y2-y1) + a0}
= ΣΣh(x2, y2){axxx12 + axyx1y1 + ayyy12
+ (-2axxx2 - axyy2 - ax)x1 + (-2ayyy2 - axyx2 - ay)y1
+ axxx22 + axyx2y2 + ayyy22 + axx2 + ayy2 + a0} …(8)
ここで、Σの範囲は分割領域Rdjに含まれる画素(x2, y2)の範囲。
In Equation (7), the contribution from the pixels included in the divided region Rdj is assumed that the filter B ′ is approximated by a quadratic polynomial (4), and the position of the pixel included in the divided region Rdj is (x2, y2) is expressed by the following equation.
h '(x1, y1) | Rdj = ΣΣh (x2, y2) f (x2-x1, y2-y1)
≒ ΣΣh (x2, y2) {a xx (x2-x1) 2 + a xy (x2-x1) (y2-y1)
+ a yy (y2-y1) 2 + a x (x2-x1) + a y (y2-y1) + a 0 }
= ΣΣh (x2, y2) {a xx x1 2 + a xy x1y1 + a yy y1 2
+ (-2a xx x2-a xy y2-a x ) x1 + (-2a yy y2-a xy x2-a y ) y1
+ a xx x2 2 + a xy x2y2 + a yy y2 2 + a x x2 + a y y2 + a 0 }… (8)
Here, the range of Σ is the range of pixels (x2, y2) included in the divided region Rdj.

さらに、下記を定義して式(8)を変形すると式(9)が得られる。
Gxx = ΣΣh(x2, y2)x22、Gxy = ΣΣh(x2, y2)x2y2、Gyy = ΣΣh(x2, y2)y22
Gx = ΣΣh(x2, y2)x2、Gy = ΣΣh(x2, y2)y2、G0 = ΣΣh(x2, y2)。
h'(x1, y1)|Rdj ≒ axxG0x12 + axyG0x1y1 + ayyG0y12
+ (-2axxGx - axyGy -axG0)x1 + (-2ayyGy - axyGx -ayG0)y1
+ (axxGxx + axyGxy + ayyGyy + axGx + ayGy + a0G0)
= φxxx12 + φxyx1y1 + φyyy12 + φxx1 + φyy1 + φ0 …(9)
ここで、φxx = axxG0、φxy = axyG0、φyy = ayyG0
φx = -2axxGx - axyGy - axG0、φy = -2ayyGy - axyGx - ayG0
φ0 = axxGxx + axyGxy + ayyGyy + axGx + ayGy + a0G0
Further, when the equation (8) is modified by defining the following, the equation (9) is obtained.
G xx = ΣΣh (x2, y2) x2 2 , G xy = ΣΣh (x2, y2) x2y2, G yy = ΣΣh (x2, y2) y2 2 ,
G x = ΣΣh (x2, y2 ) x2, G y = ΣΣh (x2, y2) y2, G 0 = ΣΣh (x2, y2).
h '(x1, y1) | Rdj ≒ a xx G 0 x1 2 + a xy G 0 x1y1 + a yy G 0 y1 2
+ (-2a xx G x -a xy G y -a x G 0 ) x1 + (-2a yy G y -a xy G x -a y G 0 ) y1
+ (a xx G xx + a xy G xy + a yy G yy + a x G x + a y G y + a 0 G 0 )
= φ xx x1 2 + φ xy x1y1 + φ yy y1 2 + φ x x1 + φ y y1 + φ 0 … (9)
Where φ xx = a xx G 0 , φ xy = a xy G 0 , φ yy = a yy G 0 ,
φ x = -2a xx G x -a xy G y -a x G 0 , φ y = -2a yy G y -a xy G x -a y G 0 ,
φ 0 = a xx G xx + a xy G xy + a yy G yy + a x G x + a y G y + a 0 G 0

式(9)はフィルタB'を、前述した二次多項式(4)で近似した式である。フィルタB'を、前述したより一般的なn次多項式(6)で近似した式は次のようになる。
h'(x1, y1)|Rdj = Σx2Σy2h(x2, y2)f(x2-x1, y2-y1)
≒ Σx2Σy2h(x2, y2){ΣpΣqapq(x2-x1)p(y2-y1)q} …(10)
Expression (9) is an expression obtained by approximating the filter B ′ with the above-described second-order polynomial (4). An expression that approximates the filter B ′ with the above-described more general n-order polynomial (6) is as follows.
h '(x1, y1) | Rdj = Σ x2 Σ y2 h (x2, y2) f (x2-x1, y2-y1)
≒ Σ x2 Σ y2 h (x2, y2) {Σ p Σ q a pq (x2-x1) p (y2-y1) q }… (10)

式(10)を、式(9)と同様にx1、y1について整理すると次式が得られる。
h'(x1, y1)|Rdj ≒ ΣpΣqφpqx1py1q …(11)
When Expression (10) is rearranged for x1 and y1 as in Expression (9), the following expression is obtained.
h '(x1, y1) | Rdj ≒ Σ p Σ q φ pq x1 p y1 q … (11)

式(11)の{φpq}(0≦p≦n、0≦q≦n)は、x1py1q項の係数であり、近似多項式(6)の係数{apq}と、分割領域Rdj内の画素の位置のみから得られる。図5により分割領域Rdi、Rdj周辺の拡大図を示す。図5示すように分割領域Rdi内の画素(x1, y1)とは異なる画素(x3, y3)を注目画素として、注目画素(x3, y3)とフィルタB'の畳込演算における分割領域Rdjからの寄与分を考えると、式(11)と同様に、次式が得られる。
h'(x3, y3)|Rdj ≒ ΣpΣqφpqx3py3q …(12)
pq } (0 ≦ p ≦ n, 0 ≦ q ≦ n) in Equation (11) is a coefficient of the x1 p y1 q term, the coefficient {a pq } of the approximate polynomial (6), and the divided region Rdj It is obtained only from the position of the pixel in FIG. 5 shows an enlarged view around the divided areas Rdi and Rdj. As shown in FIG. 5, the pixel (x3, y3) different from the pixel (x1, y1) in the divided region Rdi is set as the target pixel, and from the divided region Rdj in the convolution operation of the target pixel (x3, y3) and the filter B ′ Is considered, the following equation is obtained in the same manner as equation (11).
h '(x3, y3) | Rdj ≒ Σ p Σ q φ pq x3 p y3 q … (12)

式(12)の{φpq}(0≦p≦n、0≦q≦n)の値は、前述したように、分割領域Rdiの画素(x1, y1)または画素(x3, y3)の値とは無関係であり、式(11)の{φpq}と同一の値を有する。つまり、分割領域Rdi内に含まれる各画素について、フィルタB'との畳込演算のうち、分割領域Rdjからの寄与分の計算は、以下の手順で行えばよい。
・分割領域Rdiと分割領域Rdjの位置関係からフィルタB'の近似多項式の係数の組を選択し(S116)、
・分割領域Rdjの係数{φpq}を計算し、得られた値を保存し(S117)、
・分割領域Rdiの各画素について、係数{φpq}および式(11)を用いて分割領域Rdjからの寄与分を計算する(S118)。
The value of {φ pq } (0 ≦ p ≦ n, 0 ≦ q ≦ n) in Equation (12) is the value of the pixel (x1, y1) or pixel (x3, y3) of the divided region Rdi as described above. And has the same value as {φ pq } in equation (11). That is, for each pixel included in the divided region Rdi, the calculation of the contribution from the divided region Rdj in the convolution operation with the filter B ′ may be performed according to the following procedure.
Select a set of coefficients of the approximate polynomial of the filter B ′ from the positional relationship between the divided region Rdi and the divided region Rdj (S116),
-Calculate the coefficient {φ pq } of the divided region Rdj, save the obtained value (S117),
For each pixel in the divided region Rdi, the contribution from the divided region Rdj is calculated using the coefficient {φ pq } and Expression (11) (S118).

次に、CPU101は、カウンタjをインクリメントし(S119)、カウンタjのカウント値と分割フィルタの数LLを比較して(S120)、j≦LLならば処理をステップS115に戻す。また、j>LLならばカウンタiをインクリメントし(S121)、カウンタjのカウント値と分割領域Rdの数Mを比較して(S122)、i≦Mならば処理をステップS112に戻す。   Next, the CPU 101 increments the counter j (S119), compares the count value of the counter j with the number LL of divided filters (S120), and if j ≦ LL, returns the process to step S115. If j> LL, the counter i is incremented (S121), the count value of the counter j is compared with the number M of the divided areas Rd (S122), and if i ≦ M, the process returns to step S112.

そして、j>Mになると、CPU101は、式(11)によって演算した畳込演算の結果を画素ごとに加算して、画像データAとフィルタB'の畳込演算結果(フィルタ処理結果)の画像データA'として出力する(S123)。   When j> M, the CPU 101 adds the result of the convolution operation calculated by Expression (11) for each pixel, and the image of the convolution operation result (filter processing result) of the image data A and the filter B ′ Output as data A '(S123).

[計算量]
フィルタを分割しない場合、注目画素一画素に対するフィルタ処理の計算回数はNfx×Nfy回であるから、一つの分割領域Rdが含む全画素の計算回数NRは次式によって表される。
NR = Nfx・Nfy・Nx・Ny …(13)
[Calculation amount]
When the filter is not divided, the number of calculation times of the filter process for one pixel of interest is Nfx × Nfy times. Therefore, the number of calculation times NR of all the pixels included in one divided region Rd is expressed by the following equation.
NR = Nfx / Nfy / Nx / Ny (13)

一回の計算には、分割領域Rdが含む画素の値とフィルタ係数との乗算、乗算結果を新しい画素値として積算する処理が含まれる。また、本実施例のフィルタ処理における計算量は次のように見積られる。   One calculation includes a process of multiplying a pixel value included in the divided region Rd by a filter coefficient and integrating the multiplication result as a new pixel value. Further, the amount of calculation in the filter processing of this embodiment is estimated as follows.

●分割領域Rdjの係数{φpq}の計算(S117)
計算量は、分割領域の画素数とフィルタB'の分割フィルタの数の積に比例する。
α1・(Nx×Ny)(Nfx'/Nx)(Nfy'/Ny) = α1・Nfx'・Nfy' …(14)
ここで、α1は一回当りの計算量を示す定数。
Calculation of coefficient {φ pq } of divided region Rdj (S117)
The amount of calculation is proportional to the product of the number of pixels in the divided area and the number of divided filters in the filter B ′.
α1 ・ (Nx × Ny) (Nfx '/ Nx) (Nfy' / Ny) = α1 ・ Nfx '・ Nfy'… (14)
Here, α1 is a constant indicating the amount of calculation per time.

●分割領域Rdjからの寄与分の計算(S118)
つまり、係数{φpq}を用いた式(11)の計算であり、式(11)の計算を、一画素に付きフィルタB'に含まれる分割フィルタの数分繰り返し、さらに、分割領域の画素数分繰り返す。
α2・(Nfx'/Nx)(Nfy'/Ny)・Nx・Ny = α2・Nfx'・Nfy' …(15)
ここで、α2は式(11)の一回当りの計算量を示す定数。
● Calculation of contribution from divided area Rdj (S118)
That is, the calculation of the equation (11) using the coefficient {φ pq }, the calculation of the equation (11) is repeated by the number of divided filters included in the filter B ′ per pixel, and the pixels of the divided region are further calculated. Repeat for a few minutes.
α2 ・ (Nfx '/ Nx) (Nfy' / Ny) ・ Nx ・ Ny = α2 ・ Nfx '・ Nfy'… (15)
Here, α2 is a constant indicating the amount of calculation per expression (11).

従って、式(14)と(15)を加算した結果が、本実施例のフィルタ処理における、分割領域とフィルタB'の畳込演算に要する計算量LFである。
LF = α・Nfx'・Nfy' …(16)
ここで、α=α1・α2
Therefore, the result of adding Expressions (14) and (15) is the calculation amount LF required for the convolution operation of the divided region and the filter B ′ in the filter processing of the present embodiment.
LF = α ・ Nfx '・ Nfy'… (16)
Where α = α1 ・ α2

また、フィルタを分割しない場合の計算数(式(13))と式(16)から次式が得られる。
α・Nfx'・Nfy'/(Nfx・Nfy・Nx・Ny) = α'/(Nx・Ny) …(17)
ここで、α' = α・(Nfx'/Nfx)・(Nfy'/Nfy)
Further, the following expression is obtained from the number of calculations (expression (13)) and expression (16) when the filter is not divided.
α ・ Nfx '・ Nfy' / (Nfx ・ Nfy ・ Nx ・ Ny) = α '/ (Nx ・ Ny)… (17)
Where α '= α ・ (Nfx' / Nfx) ・ (Nfy '/ Nfy)

フィルタB'を奇数個の分割フィルタによって構成するためにフィルタB'のサイズはフィルタBのサイズよりも大きくなる。フィルタサイズの拡大が計算量に影響する分としてα'を加味する。例えば、α'が9.0程度、Nx=Ny=8とすると、本実施例のフィルタ処理は、計算量を9/(8×8)≒1/7に削減することができる。   Since the filter B ′ is composed of an odd number of divided filters, the size of the filter B ′ is larger than the size of the filter B. Α ′ is taken into account that the increase in the filter size affects the calculation amount. For example, if α ′ is about 9.0 and Nx = Ny = 8, the filter processing of this embodiment can reduce the calculation amount to 9 / (8 × 8) ≈1 / 7.

●計算量が削減される理由
式(17)に示すように計算量を削減できる理由は、畳込演算の式(7)または式(8)を、式(11)に示す近似式で置き換えたことにある。
The reason why the amount of calculation is reduced The reason why the amount of calculation can be reduced as shown in equation (17) is to replace equation (7) or equation (8) of convolution operation with the approximate equation shown in equation (11). There is.

ここで、フィルタ係数がフィルタ中心からの距離で決まるようなフィルタに対して、フィルタを分割せずに畳込演算を行う場合を考える。フィルタ処理する注目画素(x1, y1)が変わると、フィルタ範囲に含まれる周辺画素(x2, y2)のフィルタ中心からの距離が変わり、周辺画素(x2, y2)の寄与分も変化する。従って、周辺画素(x2, y2)からの寄与分Cは下式で表される。
C = h(x2, y2)×f(x2-x1, y2-y1) …(18)
ここで、h(x2,y2)は周辺画素(x2,y2)の画素値、
f(x, y)はフィルタ関数、
(x1, y1)は注目画素の位置。
Here, consider a case where a convolution operation is performed on a filter whose filter coefficient is determined by the distance from the filter center without dividing the filter. When the target pixel (x1, y1) to be filtered changes, the distance from the filter center of the peripheral pixels (x2, y2) included in the filter range changes, and the contribution of the peripheral pixels (x2, y2) also changes. Therefore, the contribution C from the peripheral pixel (x2, y2) is expressed by the following equation.
C = h (x2, y2) × f (x2-x1, y2-y1)… (18)
Where h (x2, y2) is the pixel value of the surrounding pixel (x2, y2),
f (x, y) is the filter function,
(x1, y1) is the position of the target pixel.

注目画素が(x3, y3)に移動すると、周辺画素(x2, y2)からの寄与分Cは下式で表される。
C = h(x2, y2)×f(x2-x3, y2-y3) …(19)
When the target pixel moves to (x3, y3), the contribution C from the peripheral pixel (x2, y2) is expressed by the following equation.
C = h (x2, y2) × f (x2-x3, y2-y3)… (19)

つまり、同じ周辺画素(x2, y2)からの寄与分Cを計算するとしても、注目画素の移動に伴いフィルタ関数f(x, y)の値が変化するため、注目画素ごとに寄与分Cを計算する必要が生じる。   That is, even if the contribution C from the same surrounding pixel (x2, y2) is calculated, the value of the filter function f (x, y) changes as the pixel of interest moves, so the contribution C is calculated for each pixel of interest. There is a need to calculate.

一方、式(11)においては、{φpq}が分割領域Rdj内の画素位置と画素値のみで決まり、フィルタ処理する分割領域Rdi内の注目画素の位置(x1, y1)と分離されている。従って、注目画素が移動した場合も、分割領域Rdj内の画素からの寄与分を表す{φpq}は同一(式(11)(12)参照)であり、{φpq}の再計算は不要で、{φpq}は定数と見做すことができる。また、式(11)に示す表現方法は、元のフィルタを二次多項式(4)で近似する場合の式の変形例(式(8)(9))において示したように、多項式関数で置き換えることで、容易に実現することができる。 On the other hand, in Expression (11), {φ pq } is determined only by the pixel position and pixel value in the divided region Rdj, and is separated from the position (x1, y1) of the target pixel in the divided region Rdi to be filtered. . Therefore, even when the target pixel moves, {φ pq } representing the contribution from the pixel in the divided region Rdj is the same (see equations (11) and (12)), and recalculation of {φ pq } is unnecessary. Thus, {φ pq } can be regarded as a constant. Also, the expression method shown in equation (11) is replaced with a polynomial function as shown in the modified example of equations (equations (8) and (9)) when the original filter is approximated by a quadratic polynomial (4) This can be easily realized.

一般に、任意の連続関数は多項式で近似することが可能であるが、元の関数と近似関数の誤差を小さくすれば、多項式の次数を大きくする必要があり計算量が増大する。そこで、元のフィルタの範囲を領域分割し、一つの分割フィルタの範囲における近似多項式を求めるようにすれば、多項式の次数を大きくしなくても、分割フィルタの範囲内において充分に誤差が小さい近似多項式を得ることができる。さらに、予め近似多項式の形を決めておき、近似多項式の係数を最小二乗法を用いて求める手法を用いれば、元のフィルタは必ずしも連続関数である必要はない。   In general, an arbitrary continuous function can be approximated by a polynomial. However, if the error between the original function and the approximate function is reduced, the degree of the polynomial needs to be increased and the amount of calculation increases. Therefore, if the original filter range is divided into regions, and an approximate polynomial in one divided filter range is obtained, an approximation with sufficiently small error within the range of the divided filter can be obtained without increasing the order of the polynomial. A polynomial can be obtained. Furthermore, if the method of determining the shape of the approximate polynomial in advance and obtaining the coefficient of the approximate polynomial using the least square method is used, the original filter does not necessarily have to be a continuous function.

なお、式(13)から式(17)に示した計算量について、一回の計算量は、フィルタを分割しない場合は前述したように「一回の乗算」と「一回の加算」の和である。一方、本実施例における一回の計算量は、例えば二次の近似多項式を用いる式(9)においては、加算と乗算がそれぞれ五回ずつ含まれる。また、フィルタのサイズが分割フィルタ単位になるように、Nfx×NfyからNfx'×Nfy'に拡大する影響もある。そのため、式(17)の定数αは1よりも大きくなり、例えば二次の近似多項式を用いると9.0程度になる。   As for the computational complexity shown in equations (13) to (17), the computational complexity is the sum of “one multiplication” and “one addition” as described above when the filter is not divided. It is. On the other hand, the amount of calculation in this embodiment includes, for example, five additions and multiplications in the equation (9) using a quadratic approximate polynomial, for example. In addition, there is an effect that the size of the filter is expanded from Nfx × Nfy to Nfx ′ × Nfy ′ so that the size of the filter becomes a division filter unit. Therefore, the constant α in the equation (17) is larger than 1, and becomes about 9.0 when a quadratic approximate polynomial is used, for example.

[フィルタ範囲の拡大]
本実施例におけるフィルタ処理は、奇数個の分割フィルタ単位に行うため、フィルタB'の範囲は、フィルタBの範囲に比べて拡大される。図6によりフィルタ範囲の拡大を説明する。
[Expand filter range]
Since the filter processing in the present embodiment is performed in units of an odd number of divided filters, the range of the filter B ′ is expanded as compared with the range of the filter B. The expansion of the filter range will be described with reference to FIG.

図6は、実線で示す72×80画素の画像を8×8画素に分割した画像Aに、破線で示すサイズが49×49画素のフィルタBを8×8画素のフィルタに分割した7×7の分割フィルタを有するフィルタB'を重ねた状態を示す。この場合、フィルタB'のサイズは56×56画素になる。   FIG. 6 shows an image A obtained by dividing a 72 × 80 pixel image indicated by a solid line into 8 × 8 pixels, and a filter B having a size indicated by a broken line of 49 × 49 pixels divided into 8 × 8 pixel filters. A state in which filters B ′ having the divided filters are overlapped is shown. In this case, the size of the filter B ′ is 56 × 56 pixels.

図6に示す分割領域の左上画素(32, 40)が注目画素501の場合、フィルタB(49×49画素)の範囲は、点線で示す左上(8, 16)、右下(56, 64)の範囲である。また、右下画素(39, 47)が注目画素502の場合、フィルタBの範囲は、点線で示す左上(15, 23)、右下(63, 71)の範囲である。一方、本実施例においては、同じ分割領域内の注目画素501、502に対してフィルタB'の範囲は変化せず、破線で示す左上(8, 16)、右下(63, 71)の範囲である。なお、本実施例において、注目画素501についてx=57より右、y=65より下の画素が参照範囲に追加され、注目画素502についてx=14より左、y=22より上の画素が参照画素に追加される。   When the upper left pixel (32, 40) in the divided area shown in FIG. 6 is the target pixel 501, the range of the filter B (49 × 49 pixels) is the upper left (8, 16) and lower right (56, 64) indicated by dotted lines Range. When the lower right pixel (39, 47) is the target pixel 502, the range of the filter B is the upper left (15, 23) and lower right (63, 71) indicated by the dotted line. On the other hand, in the present embodiment, the range of the filter B ′ does not change with respect to the target pixels 501 and 502 in the same divided region, and the upper left (8, 16) and lower right (63, 71) ranges indicated by broken lines It is. In this embodiment, for the pixel of interest 501, a pixel to the right of x = 57 and a pixel below y = 65 is added to the reference range, and for the pixel of interest 502, a pixel to the left of x = 14 and a pixel above y = 22 is referenced. Added to the pixel.

このようなフィルタ範囲の違いは、畳込演算を分割フィルタ単位に実施するために生じる誤差であり、フィルタ範囲を拡大した部分のフィルタ係数がほぼ0であれば、誤差の影響は僅かである。従って、フィルタ中心から遠いフィルタ範囲の端部の係数がほぼ零になるフィルタに、本実施例を適用することが最も好ましい。   Such a difference in the filter range is an error that occurs due to the execution of the convolution operation for each divided filter. If the filter coefficient of the portion where the filter range is expanded is almost 0, the influence of the error is slight. Therefore, it is most preferable to apply the present embodiment to a filter in which the coefficient at the end of the filter range far from the filter center is almost zero.

[処理結果]
●ガウシアンフィルタ
図7により処理結果の確認に使用した画像Aの一例を示す。図7に示す画像Aは、2048×2048画素の8ビットモノクロ画像であり、ランダムな位置に、ランダムな大きさの正方形や円が重畳し、さらにランダムなノイズが加わっている。また、フィルタBは、下式に示すガウシアンフィルタである。
f(x, y) = C1×exp{-(x2+y2)/2/σ2} …(20)
ここで、C1は定数。
[Processing result]
● Gaussian filter Figure 7 shows an example of image A used to check the processing results. An image A shown in FIG. 7 is an 8-bit monochrome image of 2048 × 2048 pixels, and a random square and a circle are superimposed at random positions, and further random noise is added. The filter B is a Gaussian filter expressed by the following equation.
f (x, y) = C1 × exp {-(x 2 + y 2 ) / 2 / σ 2 }… (20)
Where C1 is a constant.

フィルタB(式(20))のσは12画素とし、フィルタサイズは73×73画素である。フィルタBの係数f(x, y)の合計が1.0になるように定数C1=0.00249とする。また、分割領域の大きさは8×8画素である。フィルタB'の各分割フィルタを式(4)で示す二次多項式で近似し、フィルタBのサイズは11×11の分割フィルタである。つまり、フィルタBを73×73画素から88×88画素に拡大してフィルタB'にする。   In the filter B (Expression (20)), σ is 12 pixels, and the filter size is 73 × 73 pixels. The constant C1 is set to 0.00249 so that the sum of the coefficients f (x, y) of the filter B becomes 1.0. The size of the divided area is 8 × 8 pixels. Each divided filter of the filter B ′ is approximated by a second order polynomial expressed by the equation (4), and the size of the filter B is an 11 × 11 divided filter. That is, the filter B is enlarged from 73 × 73 pixels to 88 × 88 pixels to be a filter B ′.

画像Aに対し、フィルタBによる処理を行って画像Cを取得し、フィルタB'による処理を行って画像Dを取得した。そして、画像Cと画像Dの各画素ごとに画素値の差分を取り、全画像領域における差分値の最大、最小値を求めた。また、各画素の差分値の二乗平均平方根(RMS)を下式によって計算した。
RMS = √[ΣxΣy{hC'(x, y) - hD'(x, y)}2}/NA] …(21)
ここで、hC(x, y)は画像Cの画素値、
hD(x, y)は画像Dの画素値、
NAは画素数。
For image A, processing by filter B was performed to obtain image C, and processing by filter B ′ was performed to obtain image D. Then, the difference between the pixel values for each pixel of the image C and the image D was taken, and the maximum and minimum values of the difference values in the entire image area were obtained. Further, the root mean square (RMS) of the difference value of each pixel was calculated by the following equation.
RMS = √ [Σ x Σ y {h C '(x, y)-h D ' (x, y)} 2 } / N A ]… (21)
Where h C (x, y) is the pixel value of image C,
h D (x, y) is the pixel value of image D,
N A is the number of pixels.

その結果、全画像領域における差分値の最大は1、最小は-1であり、画素値の差は±1の範囲に収まり、RMS値は0.196であった。さらに、画像Dおよび差分値の分布に対して高速フーリエ変換(FFT)を施して空間周波数成分の分布を調べたところ、分割領域の大きさに関連するような空間周波数特性は見出されなかった。従って、画像Cと画像Dは殆ど同一の画像であり、フィルタ処理の違いによる差は殆ど生じないことを確認した。   As a result, the maximum difference value in all image regions was 1, the minimum was -1, the pixel value difference was within ± 1, and the RMS value was 0.196. Furthermore, when the distribution of the spatial frequency component was examined by applying Fast Fourier Transform (FFT) to the distribution of the image D and the difference value, no spatial frequency characteristic related to the size of the divided region was found. . Therefore, it was confirmed that the image C and the image D are almost the same image, and the difference due to the difference in filter processing hardly occurs.

また、フィルタB'による処理時間は、フィルタBによる処理時間の1/7.5であった。   Further, the processing time by the filter B ′ was 1 / 7.5 of the processing time by the filter B.

●LoGフィルタ
図8により処理結果の確認に使用した画像Aの一例を示す。図8に示す画像Aは、1024×1024画素の8ビットモノクロ画像であり、ランダムな位置に、ランダムな大きさの正方形や円が重畳し、さらにランダムなノイズが加わっている。また、フィルタBは、下式に示すLoG (Laplacian of Gaussian)フィルタである。
f(x, y) = (x2 + y2 - 2σ2)/(2πσ6)×exp{-(x2+y2)/2/σ2} …(22)
● LoG filter Fig. 8 shows an example of image A used to check the processing results. An image A shown in FIG. 8 is an 8-bit monochrome image of 1024 × 1024 pixels, and squares and circles of a random size are superimposed at random positions, and further random noise is added. The filter B is a LoG (Laplacian of Gaussian) filter represented by the following equation.
f (x, y) = ( x 2 + y 2 - 2σ 2) / (2πσ 6) × exp {- (x 2 + y 2) / 2 / σ 2} ... (22)

フィルタB(式(22))のσは24画素とし、フィルタサイズは145×145画素である。また、分割領域の大きさは8×8画素である。フィルタB'の各分割フィルタを式(4)で示す二次多項式で近似し、フィルタBのサイズは19×19の分割フィルタである。つまり、フィルタBを145×145画素から152×152画素に拡大してフィルタB'にする。   In the filter B (Equation (22)), σ is 24 pixels, and the filter size is 145 × 145 pixels. The size of the divided area is 8 × 8 pixels. Each division filter of the filter B ′ is approximated by a second order polynomial expressed by the equation (4), and the size of the filter B is a 19 × 19 division filter. That is, the filter B is enlarged from 145 × 145 pixels to 152 × 152 pixels to be a filter B ′.

図9により画像Aに対し、フィルタBによる処理を行って取得した画像C(図9(a))と、フィルタB'による処理を行って取得した画像D(図9(b))を示す。図8において、フィルタ処理によって得られた正の値の画素を黒色、負の値の画素を白色で表す。式(22)におけるσ値が大きいため、図9における正値の画素が構成する線の幅が太くなっているが、細線化すれば図8に示す図形のエッジに相当することは明らかである。また、図9(a)、図9(b)とも、同様に、エッジが抽出されている。   FIG. 9 shows an image C (FIG. 9 (a)) acquired by performing processing using the filter B on the image A, and an image D (FIG. 9 (b)) acquired by performing processing using the filter B ′. In FIG. 8, positive value pixels obtained by the filter processing are represented in black, and negative value pixels are represented in white. Since the σ value in equation (22) is large, the width of the line formed by the positive pixels in FIG. 9 is thick, but it is clear that if it is made thin, it corresponds to the edge of the figure shown in FIG. . Similarly, edges are extracted in both FIGS. 9A and 9B.

また、フィルタB'による処理時間は、フィルタBによる処理時間の1/6.2であった。   Further, the processing time by the filter B ′ was 1 / 6.2 of the processing time by the filter B.

●分割領域のサイズの変更
以上では、分割領域のサイズが8×8画素の例を説明したが、以下では、分割領域のサイズを変化させた場合に、処理時間、および、フィルタを分割しない場合との誤差がどのように変化するかについて説明する。
Changing the size of the divided area In the above, the example where the size of the divided area is 8 x 8 pixels has been explained. However, in the following, when the size of the divided area is changed, the processing time and the filter are not divided A description will be given of how the error changes.

画像Aは、図7に示す2048×2048画素の8ビットモノクロ画像である。また、フィルタBは式(20)に示すガウシアンフィルタ(73×73画素)である。そして、分割領域のサイズを6×6、8×8、10×10、12×12、14×14、16×16、18×18、20×20画素の八種類とする。分割領域のサイズを変更しながら、フィルタBを用いる処理とフィルタB'を用いる処理について、精度と処理時間の比較を行った。   Image A is an 2048 × 2048 pixel 8-bit monochrome image shown in FIG. The filter B is a Gaussian filter (73 × 73 pixels) shown in Expression (20). Then, the size of the divided area is 8 types of 6 × 6, 8 × 8, 10 × 10, 12 × 12, 14 × 14, 16 × 16, 18 × 18, and 20 × 20 pixels. While changing the size of the divided areas, the accuracy and processing time of the process using the filter B and the process using the filter B ′ were compared.

図10によりフィルタBを用いる処理とフィルタB'を用いる処理の比較結果を説明する。図10において、横軸は「分割領域の辺の大きさ/フィルタのσ値」、左の縦軸は処理時間比(=フィルタB'を用いる処理/フィルタBを用いる処理)、右の縦軸は式(21)に示すRMS値をそれぞれ表す。   A comparison result between the process using the filter B and the process using the filter B ′ will be described with reference to FIG. In FIG. 10, the horizontal axis is “division area side size / filter σ value”, the left vertical axis is the processing time ratio (= processing using filter B ′ / processing using filter B), and right vertical axis. Represents the RMS value shown in Formula (21), respectively.

図10によれば、フィルタB'を用いる処理は、分割領域のサイズを大きくする程、処理時間が短くなり、分割領域のサイズを小さくする程、誤差が小さくなることがわかる。   As can be seen from FIG. 10, in the process using the filter B ′, the processing time is shortened as the size of the divided region is increased, and the error is reduced as the size of the divided region is decreased.

図11により分割領域のサイズを20×20画素として、フィルタ処理した後の画像(図11(a))および空間周波数分布(図11(b))を示す。なお、図11(a)に示す画像は分割領域の20画素間隔の縞模様が見えるように部分的に拡大したものである。   FIG. 11 shows an image (FIG. 11 (a)) and a spatial frequency distribution (FIG. 11 (b)) after the filter processing with the size of the divided region being 20 × 20 pixels. Note that the image shown in FIG. 11 (a) is a partially enlarged view so that a striped pattern with 20 pixel intervals in the divided region can be seen.

図11(a)を参照すると、XY軸に対してそれぞれ±20画素、および、±20画素/整数に相当するピッチの模様が生じている。これは分割領域が元のフィルタのサイズに比べて大きいため、近似多項式の精度が低下し、誤差が生じているためと考えられる。   Referring to FIG. 11 (a), patterns with pitches corresponding to ± 20 pixels and ± 20 pixels / integer are generated with respect to the XY axes, respectively. This is presumably because the divided area is larger than the size of the original filter, so that the accuracy of the approximate polynomial is lowered and an error occurs.

このように、フィルタを分割する本実施例のフィルタ処理は、分割領域のサイズを大きくする程、処理時間の短縮が期待できるが、その一方、誤差が大きくなり精度は低下する。従って、分割領域のサイズを適切に決めることにより、精度を低下させずに、フィルタ処理の処理時間を短縮することが可能になる。   As described above, the filter processing of this embodiment for dividing the filter can be expected to shorten the processing time as the size of the divided region is increased. On the other hand, the error is increased and the accuracy is lowered. Therefore, by appropriately determining the size of the divided region, it is possible to shorten the processing time of the filter processing without reducing the accuracy.

以下、本発明にかかる実施例2の画像処理を説明する。なお、実施例2において、実施例1と略同様の構成については、同一符号を付して、その詳細説明を省略する。   The image processing according to the second embodiment of the present invention will be described below. Note that the same reference numerals in the second embodiment denote the same parts as in the first embodiment, and a detailed description thereof will be omitted.

実施例1においては二次元フィルタ処理を説明したが、実施例2においては、図12Aのフローチャートにより一次元フィルタ処理を説明する。   In the first embodiment, the two-dimensional filter processing has been described. In the second embodiment, the one-dimensional filter processing will be described with reference to the flowchart of FIG. 12A.

CPU101は、一次元のデータA(例えばサウンドデータ)を入力し(S201)、入力データAをNxデータ(所定データサイズ)ごとに分割した分割データを生成する(S202)。なお、データAが画像データのような二次元データの場合、例えば画像の右端において、Nx画素に満たない分割データが発生する可能性があるが、そのような場合も分割データとして扱う。また、以下の説明では、分割データの数をMとする。   The CPU 101 inputs one-dimensional data A (for example, sound data) (S201), and generates divided data obtained by dividing the input data A into Nx data (predetermined data size) (S202). When the data A is two-dimensional data such as image data, for example, there is a possibility that divided data less than Nx pixels may be generated at the right end of the image. Such a case is also treated as divided data. In the following description, the number of divided data is M.

次に、CPU101は、一次元フィルタ処理用のフィルタBを表すデータを例えばHDD108から入力する(S203)。フィルタBのフィルタサイズをNfxデータとする。フィルタBは、注目データからの距離の関数として表現されてもよいし、フィルタの各成分(フィルタ係数)を表すデータでもよい。ただし、フィルタBのフィルタサイズを分割データの数の自然数倍に拡大するため、フィルタ処理の裾に相当する部分の成分(フィルタ係数)がほぼ零であることが好ましい。   Next, the CPU 101 inputs data representing the filter B for one-dimensional filter processing from, for example, the HDD 108 (S203). Let the filter size of filter B be Nfx data. The filter B may be expressed as a function of the distance from the data of interest, or data representing each component (filter coefficient) of the filter. However, in order to increase the filter size of the filter B to a natural number multiple of the number of pieces of divided data, it is preferable that the component (filter coefficient) of the portion corresponding to the tail of the filter process is substantially zero.

次に、CPU101は、分割データの数Nxに対応させて、フィルタBを分割する(S204)。その際、CPU101は、分割後のフィルタが奇数個の分割フィルタ(サイズNx)から構成されるように、フィルタサイズを拡大する。つまり、分割フィルタの数をLxとすると、Lxが下式を満たすようにフィルタサイズを拡大する。
Nx×Lx ≧ Nfx …(23)
ここで、Lxは奇数。
Next, the CPU 101 divides the filter B in correspondence with the number of divided data Nx (S204). At that time, the CPU 101 enlarges the filter size so that the divided filter is composed of an odd number of divided filters (size Nx). That is, if the number of division filters is Lx, the filter size is expanded so that Lx satisfies the following expression.
Nx × Lx ≧ Nfx (23)
Where Lx is an odd number.

なお、拡大後のフィルタのサイズは下式で表される。
Nfx' = Nx×Lx …(24)
The size of the enlarged filter is expressed by the following formula.
Nfx '= Nx × Lx (24)

次に、CPU101は、分割フィルタごとに、フィルタ係数をフィルタ中心からの距離の多項式関数で近似して、多項式の各項の係数を求める(S205)。なお、元のフィルタBを近似多項式で表したフィルタをフィルタB'とする。そして、CPU101は、詳細は後述するが、前記複数の分割データ、複数の分割フィルタおよび近似多項式を用いて、データAにフィルタBによるフィルタ処理を施す(S206)。   Next, for each divided filter, the CPU 101 approximates the filter coefficient with a polynomial function of the distance from the filter center to obtain the coefficient of each term of the polynomial (S205). Note that a filter in which the original filter B is represented by an approximate polynomial is a filter B ′. Then, as will be described in detail later, the CPU 101 performs a filter process using the filter B on the data A using the plurality of divided data, the plurality of divided filters, and the approximate polynomial (S206).

●近似多項式
フィルタBが二階微分が可能な関数として表記されている場合、例えば、各分割フィルタの中心に対してテイラ展開を行って近似多項式を求める。例えば、フィルタBのフィルタ係数が、フィルタ中心からの距離xの関数f(x)として表されるとする。関数f(x)を二階微分が可能な関数とし、位置aに対して二次の項までテイラ展開すると、下式が得られる。
f(x) ≒ f(a) + fx(a)(x-a) + fxx(a)(x-a)2/2 …(25)
ここで、fx = df/dx、
fxx = d2f/dx2
Approximation polynomial When filter B is expressed as a function capable of second order differentiation, for example, Taylor expansion is performed on the center of each divided filter to obtain an approximation polynomial. For example, it is assumed that the filter coefficient of the filter B is expressed as a function f (x) of the distance x from the filter center. When the function f (x) is a function capable of second order differentiation and Taylor expansion is performed up to a second-order term with respect to the position a, the following expression is obtained.
f (x) ≒ f (a) + f x (a) (xa) + f xx (a) (xa) 2 /2… (25)
Where f x = df / dx,
f xx = d 2 f / dx 2

さらに、下記を定義して式(25)を変形すると式(26)が得られる。
axx = fxx(a)/2、
ax = fx(a) - 2afxx(a)、
a0 = f(a) - afx(a)- a2fxx(a)/2、
f(x, y) ≒ axxx2 + axx + a0 …(26)
Further, the following equation is defined by defining the following and obtaining the equation (26).
a xx = f xx (a) / 2,
a x = f x (a)-2af xx (a),
a 0 = f (a)-af x (a)-a 2 f xx (a) / 2,
f (x, y) ≒ a xx x 2 + a x x + a 0 … (26)

なお、上記には二次多項式の例を示したが、これに限定されるものではなく、一次、あるいは、三次または四次以上の次数をもつ多項式でもよい。一般にf(x)をn次多項式で近似すると式(27)のように表される。
f(x) ≒ Σpapxp …(27)
ここで、Σpの範囲はp=0からn、
nは多項式の次数。
In addition, although the example of the 2nd order polynomial was shown above, it is not limited to this, The polynomial which has the order of 1st order or 3rd order or 4th order or more may be used. In general, when f (x) is approximated by an nth order polynomial, it is expressed as shown in Expression (27).
f (x) ≒ Σ p a p x p (27)
Where Σ p ranges from p = 0 to n,
n is the degree of the polynomial.

フィルタBをLx個の分割フィルタに分割した場合、式(27)の近似多項式もLx個生成され、係数{ap}の組もLx組得られる。なお、Lx個の近似多項式のすべてが同じ次数をもつ必要はなく、例えば、フィルタ中心に近い分割フィルタは二次の近似多項式とし、フィルタ中心から遠い分割フィルタは一次の近似多項式としてもよい。 When filter B is divided into Lx divided filters, Lx approximate polynomials of Expression (27) are also generated, and Lx sets of coefficients {a p } are also obtained. Note that it is not necessary for all the Lx approximate polynomials to have the same order. For example, a division filter close to the filter center may be a second-order approximation polynomial, and a division filter far from the filter center may be a first-order approximation polynomial.

●フィルタ処理
図12Bのフローチャートによりフィルタ処理(S206)の詳細を説明する。
Filter Process Details of the filter process (S206) will be described with reference to the flowchart of FIG. 12B.

近似多項式の作成後、CPU101は、分割したデータAに対し、フィルタB'の近似多項式を使って各データとフィルタの畳込演算を行う。CPU101は、カウンタiを1に初期化し(S211)、データAのi番目の分割データDdi(第一の分割データ)を選択する(S212)。   After creating the approximate polynomial, the CPU 101 performs a convolution operation of each data and filter on the divided data A using the approximate polynomial of the filter B ′. The CPU 101 initializes the counter i to 1 (S211), and selects the i-th divided data Ddi (first divided data) of the data A (S212).

CPU101は、分割データDdiとフィルタ中心が一致するようにデータAにフィルタB'を重ね、分割データDdiとフィルタB'による畳込演算の対象データ集合Sfを決定する(S213)。そして、カウンタjを1に初期化し(S214)、対象データ集合Sfに含まれるj番目の分割データDdj(第二の分割データ)を選択する(S215)。   The CPU 101 superimposes the filter B ′ on the data A so that the divided data Ddi and the filter center coincide with each other, and determines the target data set Sf of the convolution operation using the divided data Ddi and the filter B ′ (S213). Then, the counter j is initialized to 1 (S214), and the j-th divided data Ddj (second divided data) included in the target data set Sf is selected (S215).

CPU101は、分割データDdiの位置に対する分割データDdjの位置に基づきフィルタB'の近似多項式の係数の組を選択する(S216)。分割データDdi内のデータx1を注目データとすると、注目データとフィルタB'の畳込演算は次のように表される。
h'(x1) = h(x1)*f(x1)
= Σx'h(x')f(x'-x1) …(28)
ここで、h(x1)は注目データの値、
h'(x1)はフィルタ処理後の値、
f(x1)はフィルタ係数、
*は畳込演算を表す。
The CPU 101 selects a set of coefficients of the approximate polynomial of the filter B ′ based on the position of the divided data Ddj with respect to the position of the divided data Ddi (S216). Assuming that the data x1 in the divided data Ddi is the attention data, the convolution operation of the attention data and the filter B ′ is expressed as follows.
h '(x1) = h (x1) * f (x1)
= Σ x ' h (x') f (x'-x1)… (28)
Where h (x1) is the value of the data of interest,
h '(x1) is the value after filtering,
f (x1) is the filter coefficient,
* Represents a convolution operation.

式(28)において、分割データDdjに含まれるデータからの寄与分は、フィルタB'が二次多項式(26)で近似されているものとし、分割データDdjに含まれるデータの位置をx2として、下式で表される。
h'(x1)|Ddj = Σh(x2)f(x2-x1)
= Σh(x2){axx(x2-x1)2 + ax(x2-x1) + a0}
= Σh(x2){axxx12 + (-2axxx2 - ax)x1 + axxx22 + axx2 + a0} …(29)
ここで、Σの範囲は分割データDdjに含まれるデータx2の範囲。
In Equation (28), the contribution from the data included in the divided data Ddj is assumed that the filter B ′ is approximated by a second order polynomial (26), and the position of the data included in the divided data Ddj is x2. It is expressed by the following formula.
h '(x1) | Ddj = Σh (x2) f (x2-x1)
= Σh (x2) {a xx (x2-x1) 2 + a x (x2-x1) + a 0 }
= Σh (x2) {a xx x1 2 + (-2a xx x2-a x ) x1 + a xx x2 2 + a x x2 + a 0 }… (29)
Here, the range of Σ is the range of data x2 included in the divided data Ddj.

さらに、下記を定義して式(29)を変形すると式(30)が得られる。
Gxx = Σh(x2, y2)x22、Gx = Σh(x2, y2)x2、G0 = Σh(x2, y2)
h'(x1)|Ddj ≒ axxG0x12 + (-2axxGx - axG0)x1 + (axxGxx + axGx + a0G0)
≒ φxxx12 + φxx1 + φ0 …(30)
ここで、φxx = axxG0、φx = -2axxGx - axG0、φ0 = axxGxx + axGx + a0G0
Furthermore, the equation (30) is obtained by modifying the equation (29) by defining the following.
G xx = Σh (x2, y2) x2 2 , G x = Σh (x2, y2) x2, G 0 = Σh (x2, y2)
h '(x1) | Ddj ≒ a xx G 0 x1 2 + (-2a xx G x -a x G 0 ) x1 + (a xx G xx + a x G x + a 0 G 0 )
≒ φ xx x1 2 + φ x x1 + φ 0 … (30)
Where φ xx = a xx G 0 , φ x = -2a xx G x -a x G 0 , φ 0 = a xx G xx + a x G x + a 0 G 0

式(30)はフィルタB'を、前述した二次多項式(26)で近似した式である。フィルタB'を、前述したより一般的なn次多項式(27)で近似した式は次のようになる。
h'(x1)|Ddj = Σx2h(x2)f(x2-x1)
≒ Σx2h(x2){Σpap(x2-x1)p} …(31)
Expression (30) is an expression obtained by approximating the filter B ′ with the above-described second-order polynomial (26). An expression that approximates the filter B ′ with the above-described more general n-order polynomial (27) is as follows.
h '(x1) | Ddj = Σ x2 h (x2) f (x2-x1)
≒ Σ x2 h (x2) {Σ p a p (x2-x1) p }… (31)

式(31)を、式(30)と同様にx1について整理すると次式が得られる。
h'(x1)|Ddj ≒ Σpφpx1p …(32)
When Expression (31) is rearranged with respect to x1 similarly to Expression (30), the following expression is obtained.
h '(x1) | Ddj ≒ Σ p φ p x1 p … (32)

式(32)の{φp}(0≦p≦n)は、x1p項の係数であり、近似多項式(26)の係数{ap}と、分割データDdj内のデータの位置のみから得られる。つまり、分割データDdi内のデータx1とは異なるデータx3を注目データとして、注目データx3とフィルタB'の畳込演算における分割データDdjからの寄与分を考えると、式(32)と同様に、次式が得られる。
h'(x3)|Ddj ≒ Σpφpx3p …(33)
p } (0 ≦ p ≦ n) in equation (32) is the coefficient of the x1 p term, and is obtained only from the coefficient {a p } of the approximate polynomial (26) and the position of the data in the divided data Ddj. It is done. That is, considering the data x3 different from the data x1 in the divided data Ddi as the data of interest, and considering the contribution from the divided data Ddj in the convolution operation of the data of interest x3 and the filter B ′, as in equation (32), The following equation is obtained.
h '(x3) | Ddj ≒ Σ p φ p x3 p … (33)

式(33)の{φp}(0≦p≦n)の値は、前述したように、分割データDdiのデータx1またはデータx3の値とは無関係であり、式(31)の{φp}と同一の値を有する。つまり、分割データDdi内に含まれる各画素について、フィルタB'との畳込演算のうち、分割データDdjからの寄与分の計算は、以下の手順で行えばよい。
・分割データDdiと分割データDdjの位置関係からフィルタB'の近似多項式の係数の組を選択し(S216)、
・分割データDdjの係数{φp}を計算し、得られた値を保存し(S217)、
・分割データDdiの各データについて、係数{φp}および式(32)を用いて分割データDdjからの寄与分を計算する(S218)。
As described above, the value of {φ p } (0 ≦ p ≦ n) in Equation (33) is independent of the value of data x1 or data x3 of divided data Ddi, and {φ p in Equation (31) } Has the same value. That is, for each pixel included in the divided data Ddi, the calculation of the contribution from the divided data Ddj in the convolution operation with the filter B ′ may be performed according to the following procedure.
Select a set of coefficients of the approximate polynomial of filter B ′ from the positional relationship between the divided data Ddi and the divided data Ddj (S216),
Calculate the coefficient {φ p } of the divided data Ddj and store the obtained value (S217)
For each data of the divided data Ddi, the contribution from the divided data Ddj is calculated using the coefficient {φ p } and the equation (32) (S218).

次に、CPU101は、カウンタjをインクリメントし(S219)、カウンタjのカウント値と分割フィルタの数Lxを比較して(S220)、j≦Lxならば処理をステップS215に戻す。また、j>Lxならばカウンタiをインクリメントし(S221)、カウンタjのカウント値と分割データRdの数Mを比較して(S222)、i≦Mならば処理をステップS212に戻す。   Next, the CPU 101 increments the counter j (S219), compares the count value of the counter j with the number Lx of divided filters (S220), and if j ≦ Lx, returns the process to step S215. If j> Lx, the counter i is incremented (S221), the count value of the counter j is compared with the number M of the divided data Rd (S222), and if i ≦ M, the process returns to step S212.

そして、j>Mになると、CPU101は、式(32)によって演算した畳込演算の結果をデータごとに加算して、データAとフィルタB'の畳込演算結果(フィルタ処理結果)のデータA'として出力する(S223)。   When j> M, the CPU 101 adds the result of the convolution operation calculated by the equation (32) for each data, and the data A of the convolution operation result (filter processing result) of the data A and the filter B ′ Output as' (S223).

[計算量]
フィルタを分割しない場合、注目データに対するフィルタ処理の計算回数はNfx回であるから、一つの分割データDdが含む全データの計算回数NRは次式によって表される。
NR = Nfx・Nx …(34)
[Calculation amount]
When the filter is not divided, the number of times of calculation of the filtering process for the data of interest is Nfx, and the number of calculations NR of all data included in one piece of divided data Dd is expressed by the following equation.
NR = Nfx · Nx (34)

一回の計算には、分割データDdが含むデータとフィルタ係数との乗算、乗算結果を新しいデータとして積算する処理が含まれる。また、本実施例のフィルタ処理における計算量LFは、実施例1で説明したように、次のように見積られる。
LF = α・Nfx' …(35)
One calculation includes the multiplication of the data included in the divided data Dd and the filter coefficient, and the process of integrating the multiplication results as new data. Further, as described in the first embodiment, the calculation amount LF in the filter processing of the present embodiment is estimated as follows.
LF = α ・ Nfx '… (35)

また、フィルタを分割しない場合の計算数(式(34))と式(35)から次式が得られる。
α・Nfx'/(Nfx・Nx) = α'/Nx …(36)
ここで、α' = α・(Nfx'/Nfx)
Further, the following expression is obtained from the number of calculations (expression (34)) and expression (35) when the filter is not divided.
α ・ Nfx '/ (Nfx ・ Nx) = α' / Nx… (36)
Where α '= α ・ (Nfx' / Nfx)

フィルタB'を奇数個の分割フィルタによって構成するためにフィルタB'のサイズはフィルタBのサイズよりも大きくなる。フィルタサイズの拡大が計算量に影響する分としてα'を加味する。例えば、α'が4程度、Nx=8とすると、本実施例のフィルタ処理は、計算量を4/8=1/2に削減することができる。   Since the filter B ′ is composed of an odd number of divided filters, the size of the filter B ′ is larger than the size of the filter B. Α ′ is taken into account that the increase in the filter size affects the calculation amount. For example, if α ′ is about 4 and Nx = 8, the filter processing of this embodiment can reduce the calculation amount to 4/8 = 1/2.

[その他の実施例]
また、本発明は、以下の処理を実行することによっても実現される。即ち、上述した実施形態の機能を実現するソフトウェア(プログラム)を、ネットワーク又は各種記憶媒体を介してシステム或いは装置に供給し、そのシステムあるいは装置のコンピュータ(又はCPUやMPU等)がプログラムを読み出して実行する処理である。
[Other Examples]
The present invention can also be realized by executing the following processing. That is, software (program) that realizes the functions of the above-described embodiments is supplied to a system or apparatus via a network or various storage media, and a computer (or CPU, MPU, etc.) of the system or apparatus reads the program. It is a process to be executed.

Claims (9)

入力データを所定データサイズの複数の分割データに分割するデータの分割手段と、
前記所定データサイズに基づき、フィルタを複数の分割フィルタに分割するフィルタの分割手段と、
前記複数の分割フィルタごとにフィルタ係数の近似多項式を作成する作成手段と、
前記複数の分割データ、前記複数の分割フィルタおよび前記近似多項式を用いて、前記入力データに前記フィルタによるフィルタ処理を施す処理手段とを有することを特徴とするデータ処理装置。
Data dividing means for dividing the input data into a plurality of divided data of a predetermined data size;
Filter dividing means for dividing the filter into a plurality of divided filters based on the predetermined data size;
Creating means for creating an approximate polynomial of filter coefficients for each of the plurality of divided filters;
A data processing apparatus comprising: processing means for performing filter processing on the input data using the plurality of divided data, the plurality of divided filters, and the approximate polynomial.
前記処理手段は、第一の分割データを選択する手段と、
前記第一の分割データを中心とする分割データの参照範囲を決定する手段と、
前記第一の分割データを前記フィルタ処理する際に参照すべき第二の分割データを前記参照範囲から選択する手段と、
前記第一の分割データに含まれる注目データの前記フィルタ処理において、前記第一の分割データと前記第二の分割データの位置関係に基づき前記近似多項式の係数を計算する手段と、
前記係数および前記近似多項式を用いて前記第二の分割データから前記注目データへ寄与するデータを計算する手段とを有することを特徴とする請求項1に記載されたデータ処理装置。
The processing means includes means for selecting first divided data;
Means for determining a reference range of divided data centered on the first divided data;
Means for selecting, from the reference range, second divided data to be referred to when filtering the first divided data;
Means for calculating a coefficient of the approximate polynomial based on a positional relationship between the first divided data and the second divided data in the filtering process of the data of interest included in the first divided data;
2. The data processing apparatus according to claim 1, further comprising means for calculating data contributing to the data of interest from the second divided data using the coefficient and the approximate polynomial.
前記フィルタの分割手段は、前記フィルタのフィルタサイズを拡大して、前記フィルタを奇数個の前記所定データサイズの分割フィルタに分割することを特徴とする請求項1または請求項2に記載されたデータ処理装置。   3. The data according to claim 1, wherein the filter dividing unit divides the filter into an odd number of divided filters having the predetermined data size by enlarging a filter size of the filter. Processing equipment. 画像データが表す画像を所定サイズの複数の分割領域に分割する画像の分割手段と、
前記所定サイズに基づき、二次元フィルタを複数の分割フィルタに分割するフィルタの分割手段と、
前記複数の分割フィルタごとにフィルタ係数の近似多項式を作成する作成手段と、
前記複数の分割領域、前記複数の分割フィルタおよび前記近似多項式を用いて、前記画像データに前記二次元フィルタによるフィルタ処理を施す処理手段とを有することを特徴とする画像処理装置。
Image dividing means for dividing the image represented by the image data into a plurality of divided regions of a predetermined size;
Filter dividing means for dividing the two-dimensional filter into a plurality of divided filters based on the predetermined size;
Creating means for creating an approximate polynomial of filter coefficients for each of the plurality of divided filters;
An image processing apparatus comprising: processing means for performing filter processing on the image data using the two-dimensional filter using the plurality of divided regions, the plurality of divided filters, and the approximate polynomial.
前記処理手段は、第一の分割領域を選択する手段と、
前記第一の分割領域を中心とする分割領域の参照範囲を決定する手段と、
前記第一の分割領域を前記フィルタ処理する際に参照すべき第二の分割領域を前記参照範囲から選択する手段と、
前記第一の分割領域に含まれる注目画素の前記フィルタ処理において、前記第一の分割領域と前記第二の分割領域の位置関係に基づき前記近似多項式の係数を計算する手段と、
前記係数および前記近似多項式を用いて前記第二の分割領域から前記注目画素へ寄与するデータを計算する手段とを有することを特徴とする請求項4に記載された画像処理装置。
Means for selecting a first divided region;
Means for determining a reference range of a divided area centered on the first divided area;
Means for selecting, from the reference range, a second divided area to be referred to when filtering the first divided area;
Means for calculating a coefficient of the approximate polynomial based on a positional relationship between the first divided area and the second divided area in the filtering process of the target pixel included in the first divided area;
5. The image processing apparatus according to claim 4, further comprising means for calculating data contributing to the target pixel from the second divided region using the coefficient and the approximate polynomial.
データの分割手段、フィルタの分割手段、作成手段、処理手段を有するデータ処理装置のデータ処理方法であって、
前記データの分割手段が、入力データを所定データサイズの複数の分割データに分割し、
前記フィルタの分割手段が、前記所定データサイズに基づき、フィルタを複数の分割フィルタに分割し、
前記作成手段が、前記複数の分割フィルタごとにフィルタ係数の近似多項式を作成し、
前記処理手段が、前記複数の分割データ、前記複数の分割フィルタおよび前記近似多項式を用いて、前記入力データに前記フィルタによるフィルタ処理を施すことを特徴とするデータ処理方法。
A data processing method for a data processing apparatus having data dividing means, filter dividing means, creating means, and processing means,
The data dividing means divides input data into a plurality of divided data of a predetermined data size,
The filter dividing means divides the filter into a plurality of divided filters based on the predetermined data size,
The creating means creates an approximate polynomial of filter coefficients for each of the plurality of divided filters,
The data processing method characterized in that the processing means performs filter processing by the filter on the input data using the plurality of divided data, the plurality of divided filters, and the approximate polynomial.
データの分割手段、フィルタの分割手段、作成手段、処理手段を有する画像処理装置の画像処理方法であって、
前記データの分割手段が、画像データが表す画像を所定サイズの複数の分割領域に分割し、
前記フィルタの分割手段が、前記所定データサイズに基づき、二次元フィルタを複数の分割フィルタに分割し、
前記作成手段が、前記複数の分割フィルタごとにフィルタ係数の近似多項式を作成し、
前記処理手段が、前記複数の分割領域、前記複数の分割フィルタおよび前記近似多項式を用いて、前記画像データに前記二次元フィルタによるフィルタ処理を施すことを特徴とする画像処理方法。
An image processing method of an image processing apparatus having a data dividing means, a filter dividing means, a creating means, and a processing means,
The data dividing means divides the image represented by the image data into a plurality of divided areas of a predetermined size;
The filter dividing means divides the two-dimensional filter into a plurality of divided filters based on the predetermined data size,
The creating means creates an approximate polynomial of filter coefficients for each of the plurality of divided filters,
The image processing method characterized in that the processing means performs filter processing by the two-dimensional filter on the image data using the plurality of divided regions, the plurality of divided filters, and the approximate polynomial.
コンピュータを請求項1から請求項3の何れか一項に記載されたデータ処理装置の各手段として機能させることを特徴とするプログラム。   A program that causes a computer to function as each unit of the data processing device according to any one of claims 1 to 3. コンピュータを請求項4または請求項5に記載された画像処理装置の各手段として機能させることを特徴とするプログラム。   6. A program for causing a computer to function as each unit of the image processing apparatus according to claim 4 or 5.
JP2011003398A 2011-01-11 2011-01-11 Data processing apparatus, image processing apparatus, and methods thereof Expired - Fee Related JP5620829B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011003398A JP5620829B2 (en) 2011-01-11 2011-01-11 Data processing apparatus, image processing apparatus, and methods thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011003398A JP5620829B2 (en) 2011-01-11 2011-01-11 Data processing apparatus, image processing apparatus, and methods thereof

Publications (2)

Publication Number Publication Date
JP2012146096A JP2012146096A (en) 2012-08-02
JP5620829B2 true JP5620829B2 (en) 2014-11-05

Family

ID=46789603

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011003398A Expired - Fee Related JP5620829B2 (en) 2011-01-11 2011-01-11 Data processing apparatus, image processing apparatus, and methods thereof

Country Status (1)

Country Link
JP (1) JP5620829B2 (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0756673B2 (en) * 1986-03-07 1995-06-14 株式会社日立製作所 Image processing method by divided space filter
US6725247B2 (en) * 2001-04-30 2004-04-20 Intel Corporation Two-dimensional pyramid filter architecture
JP2004145615A (en) * 2002-10-24 2004-05-20 Mega Chips Corp Image processor and image processing method
US7366746B2 (en) * 2004-02-12 2008-04-29 Xerox Corporation Finite impulse response filter method and apparatus
JP2006211010A (en) * 2005-01-25 2006-08-10 Nippon Hoso Kyokai <Nhk> Filter and picture interpolator, and method for specifying filter coefficient
US7835586B2 (en) * 2007-08-01 2010-11-16 Mitsubishi Electric Research Laboratories, Inc. Method for filtering images with bilateral filters

Also Published As

Publication number Publication date
JP2012146096A (en) 2012-08-02

Similar Documents

Publication Publication Date Title
Abid Hasan et al. Depth edge detection by image-based smoothing and morphological operations
Hyun Kim et al. Dynamic scene deblurring
US10424112B2 (en) Mesh boundary smoothing
US9202258B2 (en) Video retargeting using content-dependent scaling vectors
Pogrebnyak et al. Wiener discrete cosine transform-based image filtering
US10891786B2 (en) Generating data for a three-dimensional (3D) printable object, including a truss structure
Sahin et al. Salt and pepper noise filtering with fuzzy-cellular automata
EP3806030B1 (en) Bilateral filter with data model
US10614178B2 (en) Scalable and precise fitting of NURBS surfaces to large-size mesh representations
TW201616449A (en) System and method for simplifying grids of point clouds
JP2007000205A (en) Image processing apparatus, image processing method, and image processing program
Rajagopalan et al. Space-variant approaches to recovery of depth from defocused images
CN106960470B (en) Three-dimensional point cloud curved surface reconstruction method and device
Prasad et al. High‐resolution imaging using integrated optical systems
JP4981798B2 (en) Image composition by rank-1 lattice
JP5620829B2 (en) Data processing apparatus, image processing apparatus, and methods thereof
CN111062878A (en) Image denoising method and device and computer readable storage medium
KR102104238B1 (en) Structure illumination microscope system based on light modulator and method for generating image performed by the same
Moroto et al. Fast Polygonal Splatting using Directional Kernel Difference.
CN112150532A (en) Image processing method and device, electronic equipment and computer readable medium
Zhan The nonlocal-laplacian evolution for image interpolation
US8854378B2 (en) System and method for simulating hair and cloth using polyhedral-based constraints
Zon et al. Fast and easy blind deblurring using an inverse filter and PROBE
Yamaguchi et al. The quick and high quality image interpolation for single image using multi-filtering and weighted mean
Rana et al. Image deblurring methodology using wiener filter & genetic algorithm

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20140108

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140808

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140919

LAPS Cancellation because of no payment of annual fees