JP2014230014A - Image processing device, image processing program and electronic camera - Google Patents
Image processing device, image processing program and electronic camera Download PDFInfo
- Publication number
- JP2014230014A JP2014230014A JP2013106784A JP2013106784A JP2014230014A JP 2014230014 A JP2014230014 A JP 2014230014A JP 2013106784 A JP2013106784 A JP 2013106784A JP 2013106784 A JP2013106784 A JP 2013106784A JP 2014230014 A JP2014230014 A JP 2014230014A
- Authority
- JP
- Japan
- Prior art keywords
- interpolation
- pixel
- image
- image processing
- target position
- 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.)
- Pending
Links
- 238000012545 processing Methods 0.000 title claims abstract description 131
- 238000011156 evaluation Methods 0.000 claims abstract description 24
- 238000000605 extraction Methods 0.000 claims abstract description 7
- 238000009792 diffusion process Methods 0.000 claims abstract 2
- 239000000284 extract Substances 0.000 claims description 5
- 238000003384 imaging method Methods 0.000 claims description 4
- 230000001131 transforming effect Effects 0.000 claims description 4
- 238000003860 storage Methods 0.000 claims description 2
- 238000000034 method Methods 0.000 description 36
- 230000008569 process Effects 0.000 description 27
- 230000009467 reduction Effects 0.000 description 14
- 238000012937 correction Methods 0.000 description 12
- 230000004304 visual acuity Effects 0.000 description 11
- 238000010586 diagram Methods 0.000 description 9
- 238000013519 translation Methods 0.000 description 9
- 230000014509 gene expression Effects 0.000 description 8
- 230000003287 optical effect Effects 0.000 description 6
- 238000006243 chemical reaction Methods 0.000 description 5
- 238000004364 calculation method Methods 0.000 description 3
- 239000003086 colorant Substances 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 230000009466 transformation Effects 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 230000006835 compression Effects 0.000 description 2
- 238000007906 compression Methods 0.000 description 2
- 238000011946 reduction process Methods 0.000 description 2
- 238000012935 Averaging Methods 0.000 description 1
- 230000004075 alteration Effects 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 230000006866 deterioration Effects 0.000 description 1
- 230000012447 hatching Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Images
Landscapes
- Facsimile Image Signal Circuits (AREA)
- Studio Devices (AREA)
- Image Processing (AREA)
- Editing Of Facsimile Originals (AREA)
Abstract
Description
本発明は、補間処理を行う画像処理技術に関する。 The present invention relates to an image processing technique for performing interpolation processing.
一般に、電子カメラなどで撮影されたデジタル画像に対して、拡大、縮小、回転、並進、歪曲収差補正などの変形処理を行う場合、変形前の画素値から変形後に新たに生成される画素値を補間する処理が行われている。例えば、1.2倍の拡大を行う処理では、拡大後の画像の座標(x,y)の画素値として、拡大前の座標(x/1.2,y/1.2)の画素値を割り当てればよい。但し、拡大前の画素は整数座標で配置されているので、座標(x/1.2,y/1.2)が整数にならない場合は、例えば近傍の整数座標の画素値を用いて、座標(x/1.2,y/1.2)の画素値を補間している(例えば、特許文献1参照)。 In general, when performing deformation processing such as enlargement, reduction, rotation, translation, and distortion correction on a digital image taken with an electronic camera or the like, a pixel value that is newly generated from the pixel value before deformation is changed. Interpolation processing is performed. For example, in the process of enlarging 1.2 times, the pixel value of the coordinates (x / 1.2, y / 1.2) before enlargement is used as the pixel value of the coordinates (x, y) of the image after enlargement. Assign it. However, since the pixels before enlargement are arranged in integer coordinates, if the coordinates (x / 1.2, y / 1.2) do not become integers, the pixel values of the neighboring integer coordinates are used, for example. A pixel value of (x / 1.2, y / 1.2) is interpolated (see, for example, Patent Document 1).
しかしながら、従来は、既存画素間に新たな画素を補間生成する場合、既存画素や補間対象位置によって解像力(ボケの程度など)に差が生じてしまうという問題があった。例えば、補間対象位置の座標が特定の既存画素の整数座標に近い場合、その整数座標の画素値を主に参照して生成する補間値を算出するので、補間対象位置の解像力の低下が少ない。一方、補間対象位置の座標が複数の整数座標の画素位置の中間にある場合、それらの整数座標の画素値を均等に参照して補間対象位置の補間値を算出するので、複数の参照画素の画素値が平滑化され、補間対象位置の解像力が低下してしまうという問題が生じる。 However, conventionally, when a new pixel is interpolated between existing pixels, there is a problem that a difference in resolution (such as the degree of blur) occurs depending on the existing pixel and the interpolation target position. For example, when the coordinates of the interpolation target position are close to the integer coordinates of a specific existing pixel, the interpolation value generated by referring mainly to the pixel value of the integer coordinate is calculated, so that the resolution of the interpolation target position is hardly lowered. On the other hand, when the coordinates of the interpolation target position are in the middle of the pixel positions of a plurality of integer coordinates, the interpolation values of the interpolation target positions are calculated by uniformly referring to the pixel values of the integer coordinates. There arises a problem that the pixel value is smoothed and the resolving power at the interpolation target position is reduced.
尚、補間後に輪郭強調処理を行えば、低下した解像力を高めることができるが、解像力の低下が少ない画素に対しては過剰な強調処理を行うことになり、ジャギーの発生など画質が劣化する原因となる。 If the contour enhancement processing is performed after interpolation, the reduced resolution can be increased, but excessive enhancement processing is performed for pixels with a small decrease in the resolution, and the image quality deteriorates due to the occurrence of jaggies, etc. It becomes.
上記課題を鑑み、本発明の目的は、画素間に新たな画素を補間生成する場合に、補間生成された画素間で解像力の差が生じないように補間することができる画像処理装置および画像処理プログラム並びに電子カメラを提供することである。 In view of the above problems, an object of the present invention is to provide an image processing apparatus and an image processing capable of performing interpolation so as not to cause a difference in resolving power between pixels generated by interpolation when a new pixel is generated by interpolation. To provide a program and an electronic camera.
本発明に係る画像処理装置は、二次元状に配置された複数の画素で構成される画像を入力する画像入力部と、入力画像を変形した出力画像の画素に対応する前記入力画像上の補間対象位置を設定する補間対象位置設定部と、前記入力画像を構成する複数の画素のうち前記補間対象位置の近傍のN個(Nは3以上の整数)を参照画素とし、当該参照画素の画素値を抽出する参照画素値抽出部と、前記N個の参照画素の位置に応じて、前記参照画素毎に補間加重係数を設定する補間加重係数設定部と、前記参照画素の画素値に当該参照画素の前記補間加重係数を掛けた乗算値を算出し、前記N個の参照画素に対する前記乗算値の総和を前記補間対象位置の補間値とする補間部とを備え、前記補間加重係数設定部は、前記N個の参照画素の位置の拡散度を表す評価値が、補間対象位置に依存せずに一定になるように前記補間加重係数を設定することを特徴とする。 An image processing apparatus according to the present invention includes an image input unit that inputs an image composed of a plurality of pixels arranged two-dimensionally, and interpolation on the input image corresponding to the pixels of the output image obtained by transforming the input image An interpolation target position setting unit that sets a target position, and N pixels (N is an integer of 3 or more) in the vicinity of the interpolation target position among a plurality of pixels constituting the input image, are used as reference pixels. A reference pixel value extracting unit for extracting a value, an interpolation weighting factor setting unit for setting an interpolation weighting factor for each reference pixel according to the position of the N reference pixels, and a reference to the pixel value of the reference pixel An interpolation unit that calculates a multiplication value obtained by multiplying the interpolation weighting coefficient of a pixel and uses the sum of the multiplication values for the N reference pixels as an interpolation value of the interpolation target position, and the interpolation weighting coefficient setting unit includes: , Expanding the position of the N reference pixels. Evaluation value representing the degree is, and sets the interpolation weighting factors to be constant regardless of the position to be interpolated.
本発明に係る画像処理プログラムは、前記画像処理装置の各部の処理をコンピュータで実行することを特徴とする。 An image processing program according to the present invention is characterized in that the processing of each unit of the image processing apparatus is executed by a computer.
本発明に係る電子カメラは、前記画像処理装置を搭載する電子カメラであって、被写体を撮像して得られた画像を前記画像入力部に出力する撮像部と、前記画像処理装置が補間生成した画像を記録する記憶部とを有することを特徴とする。 An electronic camera according to the present invention is an electronic camera equipped with the image processing device, wherein an imaging unit that outputs an image obtained by imaging a subject to the image input unit, and the image processing device interpolated and generated. And a storage unit for recording an image.
本発明に係る画像処理装置および画像処理プログラム並びに電子カメラは、画素間に新たな画素を補間生成する場合に、補間生成された画素間で解像力の差が生じないように補間することができる。 The image processing apparatus, the image processing program, and the electronic camera according to the present invention can interpolate so that a difference in resolving power does not occur between the interpolated pixels when a new pixel is interpolated between the pixels.
以下、本発明に係る画像処理装置および画像処理プログラム並びに電子カメラの実施形態について、図面を用いて詳しく説明する。尚、本実施形態では、本発明に係る画像処理装置が搭載された電子カメラの例を挙げて説明するが、撮影済みの画像を入力して画像処理を行うパソコンのプログラムや単体の画像処理装置であっても構わない。 Embodiments of an image processing apparatus, an image processing program, and an electronic camera according to the present invention will be described below in detail with reference to the drawings. In this embodiment, an example of an electronic camera equipped with the image processing apparatus according to the present invention will be described. However, a personal computer program or a single image processing apparatus that inputs a photographed image and performs image processing. It does not matter.
[電子カメラ101の構成例]
図1は、電子カメラ101の構成を示すブロック図である。図1において、電子カメラ101は、光学系102と、メカニカルシャッタ103と、撮像素子104と、A/D変換部105と、画像バッファ106と、画像処理部107と、制御部108と、メモリ109と、表示部110と、操作部111と、メモリカードIF(インターフェース)112とで構成される。ここで、画像処理部107は、本発明に係る画像処理プログラムが搭載された画像処理装置に相当するブロックである。
[Configuration Example of Electronic Camera 101]
FIG. 1 is a block diagram illustrating a configuration of the
図1において、光学系102に入射される被写体光は、メカニカルシャッタ103を介して撮像素子104の受光面に入射される。ここで、光学系102は、ズームレンズやフォーカスレンズなどの複数枚のレンズおよびレンズ駆動部や絞りなどで構成され、制御部108からの指令に応じて、ズームレンズやフォーカスレンズ或いは絞りなどが撮影条件に応じて制御される。
In FIG. 1, the subject light incident on the
撮像素子104は、CMOSセンサなどで構成される。尚、本実施形態では、撮像素子104が出力する信号はモノクロ画像であってもよいし、カラー画像であってもよい。また、撮像素子104が各画素にRGB3色のいずれか1色のカラー情報を有するベイヤー配列などのRAWデータである場合は、色補間処理によって各画素にRGB3色の情報を有するRGBデータやYCbCrデータなどの輝度/色差データに変換された後の画像データを扱うものとする。
The
A/D変換部105は、撮像素子104が出力する画像信号を各画素毎にデジタル値に変換し、1枚の撮影画像分の画像データを画像バッファ106に一時的に記憶する。例えば、撮像素子104の解像度が4000画素×3000画素である場合、1200万画素分の画像データが画像バッファ106に取り込まれる。尚、画像バッファ106に取り込まれた画像データは、RAWデータである場合、先に説明したように、各画素にRGB3色の情報を生成する色補間処理が画像処理部107によって行われる。撮像素子104がモノクロの撮像素子やRGB3色に対応する3板の撮像素子である場合は、色補間処理は不要である。
The A /
画像バッファ106は、揮発性の高速メモリで構成され、A/D変換部105が出力する撮影画像を一時的に記憶するだけでなく、画像処理部107が画像処理を行う際のバッファメモリとしても使用される。或いは、撮影画像やメモリカードIF112に接続されたメモリカード112aに保存されている撮影済の画像を表示部110に表示する際の表示用バッファとしても使用される。
The
画像処理部107は、画像バッファ106に取り込まれた画像データに対して、ノイズ除去処理,彩度強調処理,輪郭強調処理などの一般的な画像処理を行う。さらに電子カメラ101の設定に応じて、JPEG規格などに準拠した画像圧縮方法で撮影画像の圧縮処理を行いJPEGデータを出力する。特に本実施形態に係る電子カメラ101では、画像処理部107は、拡大、縮小、回転、並進、歪曲収差補正などの変形処理を行う。この時、画像処理部107は、変形前の画素値から変形後に新たに生成される画素値を補間する処理を実行する。尚、補間処理については後で詳しく説明する。
The
制御部108は、内部に予め記憶されたプログラムに従って動作するCPUで構成され、電子カメラ101全体の動作を制御する。例えば、制御部108は、操作部111を構成する撮影モード選択ダイヤルやレリーズボタンの操作に応じて、電子カメラ101の撮影モードを設定したり、レリーズボタン押下時には光学系102のレンズ制御や絞り制御を行ってメカニカルシャッタ103を開閉して、撮像素子104で被写体画像を撮像する。そして、制御部108は、撮像素子104からアナログの画像信号を読み出しながらA/D変換部105でデジタル値に変換し、1画面分の画像データを画像バッファ106に取り込む。さらに、制御部108は、画像バッファ106に取り込まれた画像データに対してノイズ除去処理や輪郭強調処理などの画像処理を施すよう画像処理部107に指令し、画像処理後の画像(例えばJPEG画像)に所定のファイル名やヘッダ情報を付加してメモリカードI/F112を介してメモリカード112aに保存する。特に本実施形態では、制御部108は、画像処理部107に対して撮像素子104で撮影された画像データに対して、拡大、縮小、回転、並進、歪曲収差補正などの変形処理を施すように指令する。
The
メモリ109は、フラッシュメモリなどの不揮発性の半導体メモリで構成され、電子カメラ101の撮影モードや露出情報,フォーカス情報などのパラメータが記憶される。そして、制御部108はこれらのパラメータを参照して電子カメラ101の動作を制御する。特に、本実施形態に係る電子カメラ101では、拡大、縮小、回転、並進、歪曲収差補正などの変形処理を行うために必要なパラメータや係数テーブルなどが製造時にメモリ109に記憶されており、制御部108はこれらのパラメータや係数テーブルを参照して画像処理部107に変形処理や補間処理を指令する。尚、これらのパラメータや係数テーブルは、操作部111を介して行われる設定メニューによってユーザーが適宜変更することができる。
The
表示部110は、液晶モニタなどで構成され、制御部108によって撮影画像や電子カメラ101の操作に必要な設定メニュー画面などが表示される。
The
操作部111は、電源ボタン、レリーズボタン、撮影モード選択ダイヤル、カーソルボタンなどで構成される。ユーザーは、これらの操作ボタンを操作して電子カメラ101を使用する。尚、これらの操作ボタンの操作情報は制御部108に出力され、制御部108は操作部111から入力する操作情報に応じて電子カメラ101全体の動作を制御する。
The
メモリカードIF112は、電子カメラ101にメモリカード112aを接続するためのインターフェースで、制御部108はメモリカードIF112を介してメモリカード112aとの間で画像データを読み書きする。
The memory card IF 112 is an interface for connecting the
以上が本実施形態に係る電子カメラ101の構成および基本動作である。尚、電子カメラ101ではなく、本発明に係る単体の画像処理装置を構成する場合は、図1において、光学系102,メカニカルシャッタ103,撮像素子104およびA/D変換部105で構成される撮像部を取り除いた装置とし、制御部108(画像処理装置の制御部に相当)が撮影済みの画像データをメモリカード112aから画像バッファ106に読み出して、画像処理部107で変形処理や補間処理を行う。
[変形処理の例]
本実施形態に係る電子カメラ101では、撮像素子104で撮影された画像やメモリカード112aに記憶された撮影済の画像に対して、拡大、縮小、回転、並進、歪曲収差補正などの変形処理を行うことができる。変形処理は、例えば撮影画像や撮影済の画像を表示部110に表示して、操作部111のカーソルボタンを操作し、拡大、縮小、回転、並進、歪曲収差補正などの変形処理を選択して実行する。例えば拡大や縮小の処理であれば倍率、回転処理であれば回転の中心と角度、などを指定して変形処理を実行する。尚、本実施形態では、入力画像を変形処理した出力画像を構成する画素の画素値を補間する技術に関するので、変形処理自体の操作については省略する。また、タッチパネルが操作部111のマンマシンインターフェースとして表示部110に配置されている場合は、制御部108は、タッチパネル上で行われる拡大、縮小、回転などの変形処理の操作に応じて、拡大縮小倍率や回転角度などの情報を含む指令を画像処理部107に与える。
The above is the configuration and basic operation of the
[Example of deformation processing]
In the
次に、変形処理の一例として拡大処理の場合について説明する。図2は、4000画素×3000画素で構成される熊の画像121をk倍(kは0を除く実数)に拡大処理を行い、同じ画素サイズ及び画素数の画像122を作成する場合の一例を示している。また、図2の点線枠123は、画像121と画像122の熊の目と鼻の部分を抽出した時の画素と画像の位置関係を示し、熊の左目の位置を基準にして横方向7画素、縦方向5画素の領域を示した図である。尚、画像121と画像122の画素数と画素サイズ(画素間隔)は同じである。
Next, a case of enlargement processing will be described as an example of deformation processing. FIG. 2 shows an example in which an
ここで、拡大前の画像121をxy座標の画素で示し、k倍に拡大後の画像122をij座標の画素で示す。尚、説明がわかり易いように、熊の目や鼻の大きさに対して画素サイズを粗く描いてあるが、実際には、目や鼻の形を表現できる程度に画素サイズは小さいものとする。
Here, the
点線枠123は、拡大前と拡大後の熊の左目を同じ画素位置に比較し易いように配置した図で、拡大前の画像121における熊の左目121aはxy座標の画素(2,2)に位置し、拡大後の画像122における熊の左目122aもij座標の画素(2,2)に位置する。一方、熊の右目は、拡大前の画像121のxy座標では画素(4,2)に位置(右目121b)するが、拡大後の画像122のij座標では右目122bは画素(5,2)に位置しているので、この場合の拡大倍率はk=1.5倍である。
The
ここで、一般的な拡大処理では、拡大後の画素(5,2)の画素値は、拡大前の画素(4,2)の画素値がそのまま用いられるが、拡大後の画素が拡大前の整数座標の画素に合致しない場合、拡大後の画素値を求めるために補間処理が用いられる。図3は、水平方向のみ(x軸またはi軸のみ)の拡大前のx座標の画素P(x)と、k=4/3倍の拡大後のi座標の画素p(i)とを描いた図である。尚、図2で説明したように、同じ画素サイズ(画素間隔)であるものとする。また、図3では、拡大前の画像の画素P(0)を拡大後の画像の画素p(0)に合わせて、右方向に4/3倍に拡大している。 Here, in a general enlargement process, the pixel value of the pixel (5, 2) after enlargement uses the pixel value of the pixel (4, 2) before enlargement as it is. If the pixel does not match the integer coordinate pixel, an interpolation process is used to obtain the enlarged pixel value. FIG. 3 depicts an x-coordinate pixel P (x) before enlargement only in the horizontal direction (only the x-axis or i-axis) and an i-coordinate pixel p (i) after enlargement of k = 4/3 times. It is a figure. As described with reference to FIG. 2, it is assumed that the pixel size is the same (pixel interval). In FIG. 3, the pixel P (0) of the image before enlargement is enlarged 4/3 times to the right in accordance with the pixel p (0) of the image after enlargement.
図3において、拡大後の画素p(0)の画素値は、拡大前の画素P(0)の画素値をそのまま用いることができるが、拡大後の画素p(1)の画素値は、x座標が0.75で、拡大前の画素P(0)と画素P(1)の間にあるため、例えば画素P(0)の画素値と画素P(1)の画素値とを0.25:0.75の比率で加算して求める必要がある。同様に、次の拡大後の画素p(2)の画素値は、x座標が整数座標ではなく実数座標の位置にあるため、例えば画素P(1)の画素値と画素P(1)の画素値とを平均する必要がある。また、画素p(3)の画素値は、画素P(2)の画素値と画素P(3)の画素値を0.25:0.75の比率で加算して求める必要がある。次の画素p(4)の画素値は、対応する拡大前のx軸上の整数座標の画素P(3)があるので、画素P(3)の画素値で置き換えることができる。 In FIG. 3, the pixel value of the pixel p (0) before enlargement can be used as it is, but the pixel value of the pixel p (1) after enlargement is x Since the coordinate is 0.75 and is between the pixel P (0) and the pixel P (1) before enlargement, for example, the pixel value of the pixel P (0) and the pixel value of the pixel P (1) are set to 0.25. : It is necessary to obtain by adding at a ratio of 0.75. Similarly, since the pixel value of the next enlarged pixel p (2) is in the position of the real coordinate instead of the integer coordinate, for example, the pixel value of the pixel P (1) and the pixel P (1) The values need to be averaged. The pixel value of the pixel p (3) needs to be obtained by adding the pixel value of the pixel P (2) and the pixel value of the pixel P (3) at a ratio of 0.25: 0.75. The pixel value of the next pixel p (4) can be replaced with the pixel value of the pixel P (3) because there is a corresponding pixel P (3) of integer coordinates on the x-axis before enlargement.
ところが、上記のような補間処理を行った場合、拡大後の画素p(0)および画素p(4)は、拡大前の画素P(0)およびP(3)のそれぞれの画素値のみで置き換えられるだけなので、解像力(ボケの程度)は拡大前と同じであるが、拡大後の画素p(1)、画素p(2)および画素p(3)は、拡大前の複数の画素P(x)の画素値が含まれるので、解像力(ボケの程度)は拡大前より劣化する。これは、平均化処理によって精鋭度が落ちた画像(ボケた画像)を生成するのと同じことを意味する。この結果、拡大後の画素p(1)、画素p(2)および画素p(3)は、画素p(0)および画素p(4)に比べて解像力が低くなり、参照する拡大前の画素の位置によって解像力が異なってしまう。このようにして、拡大後の画像の解像力が一定にならず、ジャギーなどが現れて画質が劣化するという問題が生じる。尚、図3の例では、説明がわかり易いように、4/3倍の拡大処理の例を挙げたが、縮小処理や回転処理、或いは歪曲収差補正などの変形処理を行う場合でも、整数座標の画素の画素値だけでなく、実数座標の位置の画素値を補間して求める必要があるので、様々な解像力の画素値が混在する出力画像が生成されることになる。 However, when the interpolation processing as described above is performed, the pixel p (0) and the pixel p (4) after enlargement are replaced with only the pixel values of the pixels P (0) and P (3) before the enlargement. Therefore, the resolving power (the degree of blur) is the same as that before the enlargement, but the pixel p (1), the pixel p (2), and the pixel p (3) after the enlargement have a plurality of pixels P (x ) Is included, the resolving power (the degree of blur) is deteriorated more than before enlargement. This means the same thing as generating an image (blurred image) with reduced sharpness by the averaging process. As a result, the pixel p (1), the pixel p (2), and the pixel p (3) after enlargement have lower resolution than the pixel p (0) and the pixel p (4), and the pixel before enlargement to be referred to The resolving power varies depending on the position of. In this way, the resolution of the enlarged image is not constant, and there is a problem that the image quality deteriorates due to the appearance of jaggy and the like. In the example of FIG. 3, an example of 4/3 times enlargement processing is given for easy understanding. However, even when deformation processing such as reduction processing, rotation processing, or distortion correction is performed, integer coordinates Since it is necessary to interpolate not only the pixel value of the pixel but also the pixel value at the position of the real number coordinate, an output image in which pixel values of various resolutions are mixed is generated.
そこで、本実施形態に係る電子カメラ101では、解像力が一定になるように補間処理を行い、出力画像にジャギーなどが現れないようにすることができるようになっている。
Therefore, in the
次に、二次元状に配置された画素で拡大処理を行う場合について説明する。図4(a)は、拡大前の画素配置例を示す図で、例えば図2で説明した画像121に対応する。図4(a)の例では、x軸方向の整数位置に3画素、y軸方向の整数位置に3画素、合計9画素が配置されている。ここで、各画素の座標を画素P(x,y)で表記し、図4(a)の例では、画素P(0,0)から画素P(2,2)までの9つの画素が描かれている。
Next, a case where enlargement processing is performed with pixels arranged in a two-dimensional manner will be described. FIG. 4A is a diagram illustrating a pixel arrangement example before enlargement, and corresponds to, for example, the
図4(b)は、図4(a)を1.25倍に拡大後の画素配置例を示す図で、例えば図2で説明した画像121に対応する。図4(b)の例では、i軸方向の整数位置に3画素、j軸方向の整数位置に3画素、合計9画素が配置されている。ここで、拡大前後の画素サイズ(画素間隔)は変わらないものとする。また、拡大後の各画素の座標を画素p(i,j)で表記し、図4(b)の例では、画素p(0,0)から画素p(2,2)までの9つの画素が描かれている。
FIG. 4B is a diagram illustrating a pixel arrangement example after 1.25 times enlargement of FIG. 4A, and corresponds to the
図4(a)のxy座標の画像121を1.25倍に拡大して図4(b)のij座標の画像122を作成する場合、画素P(0,0)と画素p(0,0)とを基準として拡大後のij座標の画素p(1,1)の画素値は、拡大前のxy座標上の位置(0.8,0.8)の画素値と同じにしなければならない。尚、拡大後のij座標の画素p(1,1)に対応する拡大前のxy座標上の位置(0.8,0.8)を補間対象位置と称する。
When the
ここで、倍率をk、拡大後のij座標の画素p(i,j)、画素p(i,j)に対応するxy座標上の補間対象位置の座標(x0,y0)とした場合、次の関係がある。
x0=i/k …(式1)
y0=j/k …(式2)
上記の例では、k=1.25倍、拡大後のij座標の画素p(1,1)なので、拡大前のxy座標上の補間対象位置(x0,y0)の座標は、次のように求まる。
x0=1/1.25=0.8
y0=1/1.25=0.8
この補間対象位置(0.8,0.8)を図4(a)のxy座標上に描くと、黒丸印の座標(0.8,0.8)に対応し、この座標の補間値を求めれば、それが図4(b)の拡大後のij座標の画素p(1,1)の画素値となる。
Here, when the magnification is k, the pixel p (i, j) of the ij coordinate after enlargement, and the coordinate (x0, y0) of the interpolation target position on the xy coordinate corresponding to the pixel p (i, j), There is a relationship.
x0 = i / k (Formula 1)
y0 = j / k (Formula 2)
In the above example, since the pixel p (1, 1) of the ij coordinate after expansion is k = 1.25, the coordinates of the interpolation target position (x0, y0) on the xy coordinate before expansion are as follows: I want.
x0 = 1 / 1.25 = 0.8
y0 = 1 / 1.25 = 0.8
When this interpolation target position (0.8, 0.8) is drawn on the xy coordinates in FIG. 4A, it corresponds to the coordinates (0.8, 0.8) of the black circles, and the interpolation value of this coordinate is If obtained, it becomes the pixel value of the pixel p (1, 1) of the ij coordinate after enlargement in FIG.
次に、補間対象位置の補間値を求める方法について説明する。尚、補間対象位置の補間値は、画像処理部107によって行われる処理である。図5(a)は、図4(a)および図4(b)で説明した拡大処理に対応し、黒丸印で示した補間対称位置(0.8,0.8)の補間値を求める必要がある。
Next, a method for obtaining the interpolation value of the interpolation target position will be described. The interpolation value at the interpolation target position is a process performed by the
先ず、本実施形態では、拡大前の整数座標の画素のうち、補間対象位置(0.8,0.8)に最も近いを画素を選択する。図5(a)の例では、画素(1,1)が中心画素として選択される。そして、画素(1,1)を中心とする周囲の8つの画素を含む9つの画素(参照画素と称する)の画素値から補間対象位置(0.8,0.8)の補間値を求める。ここで、実数座標の補間対象位置(x0,y0)に最も近い整数座標の画素は、例えば補間対象位置の実数座標を四捨五入した整数座標の画素として選択することができる。図5(a)の例では、補間対象位置(0.8,0.8)に最も近い拡大前の整数座標の画素は、実数座標0.8を四捨五入した整数座標1の画素P(1,1)となる。そして、画素P(1,1)を中心とする画素P(1,1)を含む画素P(0,0)から画素(2,2)までの9つの参照画素の画素値から図4の拡大後の画素p(1,1)の画素値に対応する補間対象位置(0.8,0.8)の補間値を求める。尚、補間対象位置(0.8,0.8)に最も近い画素P(1,1)とのずれ(座標差分)は、x軸方向にΔx、y軸方向にΔyとなる。ここで、ΔxおよびΔyを端数座標(Δx,Δy)と称する。 First, in the present embodiment, a pixel closest to the interpolation target position (0.8, 0.8) is selected from the pixels of integer coordinates before enlargement. In the example of FIG. 5A, the pixel (1, 1) is selected as the central pixel. Then, the interpolation value at the interpolation target position (0.8, 0.8) is obtained from the pixel values of nine pixels (referred to as reference pixels) including the surrounding eight pixels centered on the pixel (1, 1). Here, the pixel of the integer coordinate closest to the interpolation target position (x0, y0) of the real number coordinate can be selected as the pixel of the integer coordinate obtained by rounding off the real number coordinate of the interpolation target position, for example. In the example of FIG. 5A, the integer coordinate pixel nearest to the interpolation target position (0.8, 0.8) before the enlargement is the integer coordinate 1 pixel P (1, 1). 4 is expanded from the pixel values of nine reference pixels from pixel P (0,0) to pixel (2,2) including pixel P (1,1) centered on pixel P (1,1). An interpolation value at the interpolation target position (0.8, 0.8) corresponding to the pixel value of the subsequent pixel p (1, 1) is obtained. The deviation (coordinate difference) from the pixel P (1, 1) closest to the interpolation target position (0.8, 0.8) is Δx in the x-axis direction and Δy in the y-axis direction. Here, Δx and Δy are referred to as fractional coordinates (Δx, Δy).
端数座標(Δx,Δy)は、図5(a)の例では、補間対象位置(0.8,0.8)と、画素P(0.8,0.8)に最も近い画素P(1,1)とのそれぞれのxy座標から、以下のように計算できる。
Δx=0.8−1より、Δx=−0.2
Δy=0.8−1より、Δy=−0.2
となる。
In the example of FIG. 5A, the fractional coordinates (Δx, Δy) are the interpolation target position (0.8, 0.8) and the pixel P (1) closest to the pixel P (0.8, 0.8). , 1) and the respective xy coordinates can be calculated as follows.
From Δx = 0.8-1, Δx = −0.2
From Δy = 0.8-1, Δy = −0.2
It becomes.
尚、図5(a)では、k=1.25倍の拡大処理を行う場合について説明したが、k=0.8倍の縮小処理の場合は、図4の縮小後の画素p(1,1)に対応する縮小前のxy座標における補間対象位置は(1.25,1.25)となり、図5(b)に示すように、補間対象位置(1.25,1.25)に最も近い整数座標の画素は、画素P(1,1)となる。この場合の端数座標(Δx,Δy)は、次のように計算できる。
Δx=1.25−1より、Δx=0.25
Δy=1.25−1より、Δy=0.25
となる。
In FIG. 5A, the case of performing the enlargement process of k = 1.25 times has been described. However, in the case of the reduction process of k = 0.8 times, the pixel p (1, 1) after the reduction in FIG. The position to be interpolated in the xy coordinates before reduction corresponding to 1) is (1.25, 1.25), and is the largest position to be interpolated (1.25, 1.25) as shown in FIG. A pixel having a close integer coordinate is a pixel P (1, 1). The fractional coordinates (Δx, Δy) in this case can be calculated as follows.
From Δx = 1.25-1, Δx = 0.25
From Δy = 1.25-1, Δy = 0.25
It becomes.
ここで、補間対象位置P(x0,y0)に最も近い整数座標の画素をP(x,y)とすると、端数座標(Δx,Δy)は(式3)で表すことができる。
(Δx,Δy)=(x0−x,y0−y) …(式3)
尚、拡大や縮小だけでなく、回転、歪曲収差補正などの変形処理の場合についても、同様に、変形処理前の補間対象位置(x0,y0)から参照画素を抽出することができる。
[補間対象位置(x0,y0)の補間値の算出方法]
次に、補間対象位置(x0,y0)の補間値を求める方法について説明する。図6(a)は、図5(b)の例を一般化して描いた図である。図6(a)において、補間対象位置(x0,y0)に最も近い整数座標の画素P(x,y)を中心とし、画素P(x,y)を含む周辺の画素P(x−1,y−1)から画素P(x+1,y+1)までの9つの参照画素の画素値から補間対象位置(x0,y0)の補間値を算出する。ここで、整数座標の画素P(x,y)に対する補間対象位置(x0,y0)のずれは、端数座標(Δx,Δy)である。また、端数座標(Δx,Δy)の範囲は、例えば図7に示したように、画素P(x,y)を中心とする斜線で示した領域131に対応し、本実施形態では下記の条件を満たすものとする。
−0.5 ≦ Δx < 0.5 …(式4)
−0.5 ≦ Δy < 0.5 …(式5)
以下、順番に補間処理について説明する。先ず、図6(b)に示すように、補間対象位置(x0,y0)の端数座標Δxを各行に投影させた位置の補間値を求める。図6(b)の例では、y−1の行における補間対象位置(x0,y−1)の補間値を同じ行の整数座標の画素P(x−1,y−1)、画素P(x,y−1)、画素P(x+1,y−1)の3つの画素値から算出する。同様に、yの行における補間対象位置(x0,y)の補間値を同じ行の整数座標の画素P(x−1,y)、画素P(x,y)、画素P(x+1,y)の3つの画素値から算出し、y+1の行における補間対象位置(x0,y+1)の補間値を同じ行の整数座標の画素P(x−1,y+1)、画素P(x,y+1)、画素P(x+1,y+1)の3つの画素値から算出する。ここで、参照する3つの画素を参照画素と称する。
Here, when the pixel of the integer coordinate closest to the interpolation target position P (x0, y0) is P (x, y), the fractional coordinate (Δx, Δy) can be expressed by (Expression 3).
(Δx, Δy) = (x0−x, y0−y) (Expression 3)
In the case of deformation processing such as rotation and distortion correction as well as enlargement and reduction, reference pixels can be similarly extracted from the interpolation target position (x0, y0) before the deformation processing.
[Calculation method of interpolation value of interpolation target position (x0, y0)]
Next, a method for obtaining the interpolation value of the interpolation target position (x0, y0) will be described. FIG. 6A is a diagram illustrating a generalized example of FIG. 5B. In FIG. 6A, the peripheral pixel P (x-1, y) including the pixel P (x, y) with the pixel P (x, y) of the integer coordinates closest to the interpolation target position (x0, y0) as the center. The interpolation value at the interpolation target position (x0, y0) is calculated from the pixel values of nine reference pixels from y-1) to the pixel P (x + 1, y + 1). Here, the deviation of the interpolation target position (x0, y0) from the integer coordinate pixel P (x, y) is a fractional coordinate (Δx, Δy). Further, the range of the fractional coordinates (Δx, Δy) corresponds to a
−0.5 ≦ Δx <0.5 (Formula 4)
−0.5 ≦ Δy <0.5 (Formula 5)
Hereinafter, the interpolation processing will be described in order. First, as shown in FIG. 6B, the interpolation value at the position where the fractional coordinates Δx of the interpolation target position (x0, y0) are projected on each row is obtained. In the example of FIG. 6B, the interpolation value at the interpolation target position (x0, y-1) in the y-1 row is set to the pixel P (x-1, y-1) and the pixel P ( It is calculated from three pixel values of x, y-1) and pixel P (x + 1, y-1). Similarly, the interpolation value of the interpolation target position (x0, y) in the y row is set to the pixel P (x−1, y), the pixel P (x, y), and the pixel P (x + 1, y) of integer coordinates in the same row. The pixel P (x-1, y + 1), the pixel P (x, y + 1), the pixel P (x-1, y + 1) of the integer coordinates in the same row are calculated from the three pixel values of y, and the interpolation value at the interpolation target position (x0, y + 1) in the y + 1 row is calculated. It is calculated from three pixel values of P (x + 1, y + 1). Here, the three pixels to be referred to are referred to as reference pixels.
次に、各行における補間対象位置の補間値の求め方について説明する。図8(a)は、yの行における補間対象位置(x0,y)の補間値を同じ行の3つの参照画素(P(x−1,y)、P(x,y)、P(x+1,y))から求める例を示している。ここで、補間対象位置(x0,y)の範囲(Δxの範囲)は、画素P(x,y)を中心として、−0.5≦Δx<0.5の範囲とする。そして、Δxの範囲を例えば16分割した場合、Δx=0を含む17個の位置のいずれかが求めるべき補間対象位置(x0,y)となる。ここで、Δxを17個の補間対象位置に分けるための算術的手法として、例えばΔxを16倍した値を四捨五入して求めることができる。これにより、Δxを−8,−7,−6,−5,−4,−3,−2,−1,0,1,2,3,4,5,6,7,8の17段階の分割位置に分けることができる。例えばΔx=−0.5の時は分割位置=−8となり、Δx=0.4999・・・の時は分割位置=8となる。図8(b)の例では、補間対象位置(x0,y)のΔxは+0.3なので、16×0.3=4.8となり、四捨五入すると分割位置は5となる。 Next, how to obtain the interpolation value of the interpolation target position in each row will be described. In FIG. 8A, the interpolation value of the interpolation target position (x0, y) in the y row is set to three reference pixels (P (x-1, y), P (x, y), P (x + 1) in the same row. , Y)). Here, the range of the interpolation target position (x0, y) (the range of Δx) is a range of −0.5 ≦ Δx <0.5 with the pixel P (x, y) as the center. When the range of Δx is divided into 16, for example, any one of 17 positions including Δx = 0 is an interpolation target position (x0, y) to be obtained. Here, as an arithmetic method for dividing Δx into 17 interpolation target positions, for example, a value obtained by multiplying Δx by 16 can be obtained by rounding off. As a result, Δx is set to 17 levels of -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8. It can be divided into division positions. For example, when Δx = −0.5, the division position = −8, and when Δx = 0.4999..., The division position = 8. In the example of FIG. 8B, since Δx of the interpolation target position (x0, y) is +0.3, 16 × 0.3 = 4.8, and the division position is 5 when rounded off.
図9は、補間対象位置(x0,y)と同じ行の3つの参照画素(P(x−1,y)、P(x,y)、P(x+1,y))の画素値に乗算する3つの係数(A(Δ)、B(Δ)、C(Δ))の数値例を示した係数テーブル141である。ここで、係数テーブル141は、x軸方向およびy軸方向に共通なので、ΔxおよびΔyをまとめてΔと表記している。 FIG. 9 multiplies the pixel values of three reference pixels (P (x-1, y), P (x, y), P (x + 1, y)) in the same row as the interpolation target position (x0, y). It is a coefficient table 141 showing numerical examples of three coefficients (A (Δ), B (Δ), C (Δ)). Here, since the coefficient table 141 is common to the x-axis direction and the y-axis direction, Δx and Δy are collectively expressed as Δ.
そして、係数テーブル141を用いて、補間対象位置(x0,y)の補間値は、(式6)のように求めることができる。
補間対象位置(x0,y)の補間値=A(Δx)・P(x−1,y)+B(Δx)・P(x,y)+C(Δx)・P(x+1,y)…(式6)
例えば図8(b)の場合、Δx=0.3なので、図9の係数テーブル141の分割位置は16×0.3≒+5となり、この時の係数A(Δ)=0.018、B(Δ)=0.652、C(Δ)=0.330が求められる。これを、(式6)に適用すると、補間対象位置(x0,y)の補間値は、変倍処理前の参照画素(P(x−1,y)、P(x,y)、P(x+1,y))の画素値から以下の式で求めることができる。
補間対象位置(x0,y)の補間値=0.018・P(x−1,y)+0.652・P(x,y)+0.330・P(x+1,y)
このようにして、補間対象位置(x0,y)の補間値を求めることができる。同様に、図6(b)のy−1行目の補間対象位置(x0,y−1)の補間値も同じ行の参照画素(P(x−1,y−1)、P(x,y−1)、P(x+1,y−1))の画素値から求めることができる。また、y+1行目の補間対象位置(x0,y+1)の補間値も同じ行の参照画素(P(x−1,y+1)、P(x,y+1)、P(x+1,y+1))の画素値から求めることができる。
Then, using the coefficient table 141, the interpolation value of the interpolation target position (x0, y) can be obtained as shown in (Expression 6).
Interpolation value of interpolation target position (x0, y) = A (Δx) · P (x−1, y) + B (Δx) · P (x, y) + C (Δx) · P (x + 1, y) (formula 6)
For example, in the case of FIG. 8B, since Δx = 0.3, the division position of the coefficient table 141 in FIG. 9 is 16 × 0.3≈ + 5, and the coefficient A (Δ) = 0.018, B ( Δ) = 0.552 and C (Δ) = 0.330 are obtained. When this is applied to (Equation 6), the interpolation value at the interpolation target position (x0, y) is the reference pixel (P (x-1, y), P (x, y), P ( x + 1, y)) can be obtained by the following equation.
Interpolation value of interpolation target position (x0, y) = 0.018 · P (x−1, y) + 0.652 · P (x, y) + 0.330 · P (x + 1, y)
In this way, the interpolation value of the interpolation target position (x0, y) can be obtained. Similarly, the interpolation value of the interpolation target position (x0, y-1) in the y-1 row in FIG. 6B is also the reference pixel (P (x-1, y-1), P (x, y-1) and P (x + 1, y-1)). The interpolation value at the interpolation target position (x0, y + 1) in the y + 1th row is also the pixel value of the reference pixel (P (x-1, y + 1), P (x, y + 1), P (x + 1, y + 1)) in the same row. Can be obtained from
このようにして、図6(b)の各行のx座標=x0(x0の列)における3つの補間対象位置((x0,y−1)、(x0,y)、(x0,y+1))の補間値が求められる。 In this way, the three interpolation target positions ((x0, y−1), (x0, y), (x0, y + 1)) at the x coordinate = x0 (x0 column) of each row in FIG. An interpolated value is determined.
次に、図6(c)に示すように、各行のx0列の3つの補間対象位置((x0,y−1)、(x0,y)、(x0,y+1))の補間値から最終的な補間対象位置(x0,y0)の補間値を求める。図6(c)において、補間対象位置(x0,y0)の補間値は、x0列のy軸上のΔyに応じて、参照する3つの補間対象位置((x0,y−1)、(x0,y)、(x0,y+1))の補間値に乗算する各係数(A(Δy)、B(Δy)、C(Δy))を係数テーブル141から求める。ここで、補間対象位置(x0,y0)の範囲(Δyの範囲)は、図8(a)のΔxの場合と同様に、図10(a)に示すように、画素P(x0,y)を中心として、−0.5≦Δy<0.5の範囲とする。そして、Δyの範囲を例えば16分割したΔy=0を含む17段階に分割する。分割位置は、Δxの場合と同様に、例えばΔyを16倍した値を四捨五入して求めることができる。図10(b)の例では、補間対象位置(x0,y0)のΔyは+0.3なので、16×0.3=4.8となり、四捨五入すると分割位置=5となる。 Next, as shown in FIG. 6C, from the interpolation values at the three interpolation target positions ((x0, y−1), (x0, y), (x0, y + 1)) in the x0 column of each row, the final values are obtained. The interpolation value at the correct interpolation target position (x0, y0) is obtained. In FIG. 6 (c), the interpolation value at the interpolation target position (x0, y0) is represented by three reference interpolation target positions ((x0, y-1), (x0) according to Δy on the y-axis of the x0 column. , Y), (x0, y + 1)), the coefficients (A (Δy), B (Δy), C (Δy)) to be multiplied are obtained from the coefficient table 141. Here, the range of the interpolation target position (x0, y0) (the range of Δy) is the pixel P (x0, y) as shown in FIG. 10A, as in the case of Δx in FIG. Is set to a range of −0.5 ≦ Δy <0.5. Then, the range of Δy is divided into 17 stages including, for example, Δy = 0 divided into 16. As in the case of Δx, the division position can be obtained by rounding a value obtained by multiplying Δy by 16, for example. In the example of FIG. 10B, since Δy of the interpolation target position (x0, y0) is +0.3, 16 × 0.3 = 4.8, and when rounded off, the division position = 5.
そして、係数テーブル141を用いて、補間対象位置(x0,y0)の補間値は、(式7)のように求めることができる。
補間対象位置(x0,y0)の補間値=A(Δy)・P(x0,y−1)+B(Δy)・P(x0,y)+C(Δy)・P(x0,y+1)…(式7)
例えば図10(b)の場合、Δy=0.3なので、図9の係数テーブル141の分割位置は16×0.3≒+5となり、この時の係数A(Δ)=0.018、B(Δ)=0.652、C(Δ)=0.330が求められる。これを、(式7)に適用すると、補間対象位置(x0,y0)の補間値は、図6(b)で求めた各行の3つの補間対象位置((x0,y−1)、(x0,y)、(x0,y+1))の各補間値をP(x0,y−1)、P(x0,y)、P(x0,y+1)とすると、以下の式で求めることができる。
補間対象位置(x0,y0)の補間値=0.018・P(x0,y−1)+0.652・P(x0,y)+0.330・P(x0,y+1)
このようにして、図6(c)に示した最終的な補間対象位置(x0,y0)の補間値を求めることができる。そして、上記の一連の処理を変形処理後の出力画像を構成する整数座標の全画素p(i,j)について同じように実行する。
Then, using the coefficient table 141, the interpolation value of the interpolation target position (x0, y0) can be obtained as in (Equation 7).
Interpolation value of interpolation target position (x0, y0) = A (Δy) · P (x0, y−1) + B (Δy) · P (x0, y) + C (Δy) · P (x0, y + 1) (formula 7)
For example, in the case of FIG. 10B, since Δy = 0.3, the division position of the coefficient table 141 in FIG. 9 is 16 × 0.3≈ + 5, and the coefficient A (Δ) = 0.018, B ( Δ) = 0.552 and C (Δ) = 0.330 are obtained. When this is applied to (Expression 7), the interpolation value of the interpolation target position (x0, y0) is the three interpolation target positions ((x0, y−1), (x0) of each row obtained in FIG. 6B. , Y) and (x0, y + 1)) are P (x0, y-1), P (x0, y), and P (x0, y + 1), respectively, and can be obtained by the following equations.
Interpolated value of interpolation target position (x0, y0) = 0.018 · P (x0, y−1) + 0.652 · P (x0, y) + 0.330 · P (x0, y + 1)
In this way, the final interpolation value of the interpolation target position (x0, y0) shown in FIG. 6C can be obtained. Then, the above-described series of processing is executed in the same manner for all the pixels p (i, j) of integer coordinates that constitute the output image after the deformation processing.
ここで、上記の一連の処理は、図1の制御部108の指令によって画像処理部107で実行される処理である。
[画像処理部107の構成例]
次に、画像処理部107の構成および動作について説明する。図11は、画像処理部107の構成例を示す図で、各ブロック間の処理の流れを示している。図11において、画像処理部107は、画像入力部201と、補間対象位置設定部202と、参照画素値抽出部203と、補間加重係数設定部204と、補間部205と、画像出力部206とを備え、拡大、縮小、回転、並進、歪曲収差補正などの変形処理に伴う補間処理を行う。ここで、図4(a)および図4(b)で説明したように、変形処理前の入力画像の座標を(x,y)で表し、整数座標の画素をP(x,y)とする。また、変形処理後に補間処理を行って生成される出力画像の整数座標の画素をp(i,j)とする。
Here, the above-described series of processing is processing executed by the
[Configuration Example of Image Processing Unit 107]
Next, the configuration and operation of the
画像入力部201は、撮像素子104で撮影された画像またはメモリカード112aに保存されている撮影済の画像を画像バッファ106に取り込む処理を行う。そして、画像入力部201は、画像バッファ106に取り込まれた画像に対して変倍処理などの変形処理を施す。
The
補間対象位置設定部202は、出力画像の画素p(i,j)に相当する入力画像上の補間対象位置(x,y)を設定する。この処理は、例えば先に説明した図4において、変倍後の出力画像における画素p(i,j)=p(1,1)に相当する変倍前の補間対象位置(0.8,0.8)を設定する処理である。変倍前の補間対象位置(x0,y0)は、先に説明した(式1)および(式2)により求めることができる。尚、変倍処理に限らず、並進処理や回転処理、或いは歪曲補正処理など、任意の変形処理における補間対象位置を公知の方法で算出してもよい。 The interpolation target position setting unit 202 sets an interpolation target position (x, y) on the input image corresponding to the pixel p (i, j) of the output image. This processing is performed by, for example, the interpolation target position (0.8,0) before scaling corresponding to the pixel p (i, j) = p (1,1) in the output image after scaling in FIG. .8) is set. The interpolation target position (x0, y0) before zooming can be obtained by (Expression 1) and (Expression 2) described above. The position to be interpolated in an arbitrary deformation process such as a translation process, a rotation process, or a distortion correction process is not limited to the scaling process, and may be calculated by a known method.
そして、補間対象位置設定部202は、補間対象位置(x0,y0)の実数座標x0およびy0を小数以下を四捨五入して、補間対象位置(x0,y0)に最も近い入力画像上の整数座標(x,y)を算出すると共に、補間対象位置(x0,y0)の端数座標(Δx,Δy)を先に説明した(式3)により算出する。 Then, the interpolation target position setting unit 202 rounds the real number coordinates x0 and y0 of the interpolation target position (x0, y0) to the nearest decimal point to the integer coordinates on the input image (x0, y0) (x0, y0). x, y) is calculated, and the fractional coordinates (Δx, Δy) of the interpolation target position (x0, y0) are calculated according to (Equation 3) described above.
参照画素値抽出部203は、入力画像のx座標((x−1)から(x+1)まで)、且つ、y座標((y−1)から(y+1)まで)において、補間対象位置(x0,y0)に最も近い入力画像上の整数座標(x,y)を中心とする9つの画素(P(x−1,y−1),P(x,y−1),P(x+1,y−1),P(x−1,y),P(x,y),P(x+1,y),P(x−1,y+1),P(x,y+1),P(x+1,y+1))の画素値を抽出する。
The reference pixel
補間加重係数設定部204は、先に説明した図9の係数テーブル141に基づいて、Δxに対応する補間加重係数(A(Δx),B(Δx),C(Δx))を設定する。そして、Δxを16倍して四捨五入した値を係数テーブル141の左端の欄の中から探し、当該行の係数(A(Δx),B(Δx),C(Δx))を設定する。例えば(16×Δx)を四捨五入した値が−8の場合は、A(Δx)=0.5,B(Δx)=0.5,C(Δx)=0となり、当該値が−7の場合は、A(Δx)=0.439,B(Δx)=0.559,C(Δx)=0.002となる。同様に、Δyに対応する補間加重係数(A(Δy),B(Δy),C(Δy))も設定する。
The interpolation weighting
補間部205は、次の演算により補間対象位置(x0,y0)の補間値を算出する。ここで、補間対象位置(x0,y0)=(x+Δx,y+Δy)である。
The
先ず、(y−1)行目の補間対象位置(x0,y−1)の補間値P(x+Δx,y−1)を先に説明した(式6)により、次のように算出する。
P(x+Δx,y−1)=A(Δx)×P(x−1,y−1)+B(Δx)×P(x,y−1)+C(Δx)×P(x+1,y−1)
同様に、(y)行目の補間対象位置(x0,y)の補間値P(x+Δx,y)を次のように算出する。
P(x+Δx,y)=A(Δx)×P(x−1,y)+B(Δx)×P(x,y)+C(Δx)×P(x+1,y)
同様に、(y+1)行目の補間対象位置(x0,y+1)の補間値P(x+Δx,y+1)を次のように算出する。
P(x+Δx,y+1)=A(Δx)×P(x−1,y+1)+B(Δx)×P(x,y+1)+C(Δx)×P(x+1,y+1)
そして、(y−1)行目、(y)行目、(y+1)行目の各補間対象位置の補間値を用いて、最終的な補間対象位置(x0,y0)の補間値P(x+Δx,y+Δy)を先に説明した(式7)により、次のように算出する。
P(x+Δx,y+Δy)=A(Δy)×P(x+Δx,y−1)+B(Δy)×P(x+Δx,y)+C(Δy)×P(x+Δx,y+1)
画像出力部206は、出力画像の画素p(i,j)の画素値として、補間部205が求めた補間対象位置(x0,y0)の補間値P(x+Δx,y+Δy)を出力する。尚、画像処理部107は、上記の一連の処理を変形処理後の出力画像を構成する整数座標の全画素p(i,j)について同じように実行する。また、出力する変形処理後の画像は、画像バッファ106に一時的に保持され、必要に応じて他の画像処理や更なる変形処理が施された後、JPEGなどの画像圧縮処理が施され、ファイル名が付加されてメモリカード112aに記憶される。
First, the interpolation value P (x + Δx, y−1) of the interpolation target position (x0, y−1) in the (y−1) th row is calculated as follows using (Equation 6) described above.
P (x + Δx, y−1) = A (Δx) × P (x−1, y−1) + B (Δx) × P (x, y−1) + C (Δx) × P (x + 1, y−1)
Similarly, the interpolation value P (x + Δx, y) at the interpolation target position (x0, y) in the (y) th row is calculated as follows.
P (x + Δx, y) = A (Δx) × P (x−1, y) + B (Δx) × P (x, y) + C (Δx) × P (x + 1, y)
Similarly, the interpolation value P (x + Δx, y + 1) of the interpolation target position (x0, y + 1) in the (y + 1) th row is calculated as follows.
P (x + Δx, y + 1) = A (Δx) × P (x−1, y + 1) + B (Δx) × P (x, y + 1) + C (Δx) × P (x + 1, y + 1)
The interpolation value P (x + Δx) of the final interpolation target position (x0, y0) is used by using the interpolation values of the respective interpolation target positions in the (y-1) th line, the (y) th line, and the (y + 1) th line. , Y + Δy) is calculated as follows using (Equation 7) described above.
P (x + Δx, y + Δy) = A (Δy) × P (x + Δx, y−1) + B (Δy) × P (x + Δx, y) + C (Δy) × P (x + Δx, y + 1)
The
このようにして、本実施形態に係る電子カメラ101は、図2で説明したような拡大処理や縮小処理、或いは並進処理、回転処理、歪曲補正処理などの変形処理を行うことができる。
In this way, the
尚、本実施形態では、各画素の画素値が輝度値だけの白黒画像なのか、色差やRGBデータを含むカラー画像なのかを明記していないが、カラー画像である場合は、例えばRGB各色の値について(或いは、Y,Cr,Cbの各値について)それぞれ同様の処理によって出力画像を生成する。
[本実施形態の効果]
本実施形態に係る電子カメラ101は、図3で説明したように、補間対象位置に依らず、出力画像における各画素の解像力を一定に維持できるという効果がある。以下、この理由について詳しく説明する。
In the present embodiment, it is not specified whether the pixel value of each pixel is a monochrome image with only a luminance value or a color image including color difference and RGB data. However, in the case of a color image, for example, for each color of RGB An output image is generated by the same processing for each value (or each value of Y, Cr, and Cb).
[Effect of this embodiment]
As described with reference to FIG. 3, the
先ず、図9に例示した補間加重係数(A(Δ),B(Δ),C(Δ))の条件を示す。
(1)条件A:「補間加重係数の合計は1(一定)である。」
条件Aを数式で表すと、A(Δ)+B(Δ)+C(Δ)=1となる。この条件Aを満たすことにより、補間後の平均的な明るさが補間前と同じになる。つまり、平均的な明るさが変わらないことを意味する。尚、本実施形態では、A(Δ)+B(Δ)+C(Δ)=1としたが、A(Δ)+B(Δ)+C(Δ)=一定であってもよい。この場合は、補間後の平均的な明るさを同時に変えることができる。例えば、A(Δ)+B(Δ)+C(Δ)=0.8とすれば、出力画像の明るさを暗くすることができる。また、カラー画像である場合は、各色毎に条件Aの値を変えて色補正などを同時に行うようにしてもよい。
(2)条件B:「参照画素位置の加重平均は、補間対象位置である。」
条件Bをx軸の場合について数式で表すと、
{(x−1)×A(Δx)+x×B(Δx)+(x+1)×C(Δx)}/(A(Δx)+B(Δx)+C(Δx))=(x+Δx)
であり、条件Aを使ってまとめると、−A(Δx)+C(Δx)=Δxとなる。y軸の場合についても同様に、
{(y−1)×A(Δy)+y×B(Δy)+(y+1)×C(Δy)}/(A(Δy)+B(Δy)+C(Δy))=(y+Δy)
となる。
First, the conditions of the interpolation weighting coefficients (A (Δ), B (Δ), C (Δ)) illustrated in FIG. 9 are shown.
(1) Condition A: “The total of interpolation weighting coefficients is 1 (constant)”
When the condition A is expressed by a mathematical expression, A (Δ) + B (Δ) + C (Δ) = 1. By satisfying this condition A, the average brightness after interpolation becomes the same as before interpolation. That is, the average brightness does not change. In this embodiment, A (Δ) + B (Δ) + C (Δ) = 1, but A (Δ) + B (Δ) + C (Δ) may be constant. In this case, the average brightness after interpolation can be changed simultaneously. For example, if A (Δ) + B (Δ) + C (Δ) = 0.8, the brightness of the output image can be reduced. In the case of a color image, color correction or the like may be performed simultaneously by changing the value of condition A for each color.
(2) Condition B: “The weighted average of reference pixel positions is an interpolation target position.”
If the condition B is expressed by a mathematical formula for the x-axis case,
{(X-1) × A (Δx) + x × B (Δx) + (x + 1) × C (Δx)} / (A (Δx) + B (Δx) + C (Δx)) = (x + Δx)
In summary, using condition A, −A (Δx) + C (Δx) = Δx. Similarly for the y-axis case,
{(Y−1) × A (Δy) + y × B (Δy) + (y + 1) × C (Δy)} / (A (Δy) + B (Δy) + C (Δy)) = (y + Δy)
It becomes.
これは、条件Bを満たすことにより、補間加重係数(A(Δ),B(Δ),C(Δ))によって求められる補間値は、補間対象位置(x+Δx,y+Δy)の画素値に相当する値になることを示している。例えば、先に説明した図8(b)の場合、A(Δx)=0.018、C(Δx)=0.330なので、
−A(Δx)+C(Δx)=−0.018+0.330=0.312となり、小数点第二位で四捨五入すると、+0.3となる。これは、図8(b)のΔx=+0.3と同じである。つまり、図9の係数テーブル141は、参照画素位置の画素値から補間対象位置の補間値を精度良く求めるための係数値に設定されていることを意味する。
(3)条件C:「参照画素位置の広がり具合を表す評価値が、補間対象位置に依存せずに一定である。」
ここで、「参照画素位置の広がり具合を表す評価値」とは、複数の位置の参照画素の画素値がどのくらい補間対象位置の補間値に反映されているかを評価するための値で、補間対象位置の補間値に対する参照画素の画素値の拡散度を示している。例えば、「参照画素位置の広がり具合を表す評価値」として、参照画素の座標の加重分散を用いている。これは、次式に示すように、(補間対象位置の座標−参照画素の座標)2に補間加重係数を乗算した総和である。
This is because, by satisfying the condition B, the interpolation value obtained by the interpolation weighting coefficients (A (Δ), B (Δ), C (Δ)) corresponds to the pixel value of the interpolation target position (x + Δx, y + Δy). It shows that it becomes a value. For example, in the case of FIG. 8B described above, since A (Δx) = 0.018 and C (Δx) = 0.330,
−A (Δx) + C (Δx) = − 0.018 + 0.330 = 0.312, and rounding off to the second decimal place results in +0.3. This is the same as Δx = + 0.3 in FIG. That is, the coefficient table 141 in FIG. 9 means that the coefficient value for accurately obtaining the interpolation value at the interpolation target position from the pixel value at the reference pixel position is set.
(3) Condition C: “The evaluation value indicating the extent of the reference pixel position is constant without depending on the interpolation target position.”
Here, the “evaluation value indicating the extent of the reference pixel position” is a value for evaluating how much the pixel values of the reference pixels at a plurality of positions are reflected in the interpolation value at the interpolation target position. The diffusivity of the pixel value of the reference pixel with respect to the position interpolation value is shown. For example, the weighted variance of the coordinates of the reference pixel is used as the “evaluation value representing the extent of the reference pixel position”. This is a sum obtained by multiplying (interpolation target position coordinates-reference pixel coordinates) 2 by an interpolation weighting coefficient, as shown in the following equation.
図8(b)の例では、参照画素位置(1)=−1、参照画素位置(2)=0、参照画素位置(3)=+1で、補間対象位置=+0.3なので、図9の係数テーブル141より、Δ=+0.3の時の補間加重係数(1)=0.018、補間加重係数(2)=0.652、補間加重係数(3)=0.330である。これらの値を(式8)に代入すると、評価値は0.2508(約0.25)となる。 In the example of FIG. 8B, since the reference pixel position (1) = − 1, the reference pixel position (2) = 0, the reference pixel position (3) = + 1, and the interpolation target position = + 0.3, From the coefficient table 141, when Δ = + 0.3, the interpolation weighting coefficient (1) = 0.018, the interpolation weighting coefficient (2) = 0.552, and the interpolation weighting coefficient (3) = 0.330. When these values are substituted into (Equation 8), the evaluation value is 0.2508 (about 0.25).
同様に、補間対象位置が−0.5の場合の評価値は、補間対象位置=−0.5、参照画素位置(1)=−1、参照画素位置(2)=0、参照画素位置(3)=+1で、係数テーブル141より、Δ=−0.5の時の補間加重係数(1)=0.500、補間加重係数(2)=0.500、補間加重係数(3)=0.000である。これらの値を(式8)に代入すると、評価値は0.25となる。 Similarly, when the interpolation target position is −0.5, the evaluation values are: interpolation target position = −0.5, reference pixel position (1) = − 1, reference pixel position (2) = 0, reference pixel position ( 3) = + 1, and from the coefficient table 141, the interpolation weighting coefficient (1) = 0.500 when Δ = −0.5, the interpolation weighting coefficient (2) = 0.500, and the interpolation weighting coefficient (3) = 0. .000. If these values are substituted into (Equation 8), the evaluation value is 0.25.
その他の例として、補間対象位置が−0.2の場合の評価値は、補間対象位置=−0.2、参照画素位置(1)=−1、参照画素位置(2)=0、参照画素位置(3)=+1で、係数テーブル141より、Δ=−0.2の時の補間加重係数(1)=0.049、補間加重係数(2)=0.715、補間加重係数(3)=0.236である。これらの値を(式8)に代入すると、評価値は0.2502(約0.25)となる。 As another example, when the interpolation target position is −0.2, the evaluation values are: interpolation target position = −0.2, reference pixel position (1) = − 1, reference pixel position (2) = 0, reference pixel At position (3) = + 1, from the coefficient table 141, interpolation weight coefficient (1) = 0.049 when Δ = −0.2, interpolation weight coefficient (2) = 0.715, interpolation weight coefficient (3) = 0.236. When these values are substituted into (Equation 8), the evaluation value is 0.2502 (about 0.25).
上記以外の−0.5≦Δ<0.5に対応する図9の係数テーブル141の補間加重係数の評価値も0.25になるように設定されている。 Other than the above, the evaluation value of the interpolation weighting coefficient in the coefficient table 141 in FIG. 9 corresponding to −0.5 ≦ Δ <0.5 is also set to be 0.25.
このように、補間対象位置の補間値P(x+Δ)について、Δに応じた補間加重係数A(Δ),B(Δ),C(Δ)を用いて、
P(x+Δ)=A(Δ)×P(x−1)+B(Δ)×P(x)+C(Δ)×P(x+1)
の式により補間する処理の評価値Eは、以下の式で求めることができる。
E=((x+Δ)−(x−1))2×A(Δ)+((x+Δ)−x)2×B(Δ)+((x+Δ)−(x+1))2×C(Δ)
=(Δ+1)2×A(Δ)+Δ2×B(Δ)+(Δ−1)2×C(Δ)
この評価値Eによって、補間対象位置の座標に対して参照画素の座標がどの程度広がっているかを適切に表現することができる。従って、評価値Eを一定に保つように補間加重係数を設定することにより、補間値の解像力の低下を一定に維持することができる。
In this way, with respect to the interpolation value P (x + Δ) at the interpolation target position, using the interpolation weighting coefficients A (Δ), B (Δ), and C (Δ) corresponding to Δ,
P (x + Δ) = A (Δ) × P (x−1) + B (Δ) × P (x) + C (Δ) × P (x + 1)
The evaluation value E of the process to be interpolated by the following formula can be obtained by the following formula.
E = ((x + Δ) − (x−1)) 2 × A (Δ) + ((x + Δ) −x) 2 × B (Δ) + ((x + Δ) − (x + 1)) 2 × C (Δ)
= (Δ + 1) 2 × A (Δ) + Δ 2 × B (Δ) + (Δ−1) 2 × C (Δ)
By this evaluation value E, it is possible to appropriately express how much the coordinates of the reference pixel are spread with respect to the coordinates of the interpolation target position. Therefore, by setting the interpolation weighting coefficient so as to keep the evaluation value E constant, it is possible to keep the decrease in the resolution of the interpolation value constant.
以上、説明したように、本実施形態において、補間加重係数(A(Δ),B(Δ),C(Δ))が満たすべき条件式は以下の3つである。
条件A:A(Δ)+B(Δ)+C(Δ)=1
条件B:−A(Δ)+C(Δ)=Δ
条件C:(Δ+1)2×A(Δ)+Δ2×B(Δ)+(Δ−1)2×C(Δ)=E
そして、補間対象位置の端数座標Δと評価値Eを与えれば、補間加重係数A(Δ),B(Δ),C(Δ)についての3式の連立方程式となるので、この連立方程式を解けば、補間加重係数A(Δ),B(Δ),C(Δ)が一義的に定まる。図9の係数テーブル141は、評価値E=0.25に設定した場合の上記の連立方程式の解(補間加重係数A(Δ),B(Δ),C(Δ))を示している。また、この解は、Δを−0.5(−8/16)から+0.5(+8/16)までを1/16ステップずつ変えた時の補間加重係数A(Δ),B(Δ),C(Δ)である。
As described above, in the present embodiment, the following three conditional expressions must be satisfied by the interpolation weighting coefficients (A (Δ), B (Δ), C (Δ)).
Condition A: A (Δ) + B (Δ) + C (Δ) = 1
Condition B: -A (Δ) + C (Δ) = Δ
Condition C: (Δ + 1) 2 × A (Δ) + Δ 2 × B (Δ) + (Δ−1) 2 × C (Δ) = E
If the fractional coordinates Δ of the interpolation target position and the evaluation value E are given, three simultaneous equations for the interpolation weighting coefficients A (Δ), B (Δ), and C (Δ) are obtained. For example, the interpolation weighting coefficients A (Δ), B (Δ), and C (Δ) are uniquely determined. The coefficient table 141 in FIG. 9 shows the solutions of the above simultaneous equations (interpolation weighting coefficients A (Δ), B (Δ), C (Δ)) when the evaluation value E is set to 0.25. Further, this solution is obtained by interpolating weighting coefficients A (Δ) and B (Δ) when Δ is changed from −0.5 (−8/16) to +0.5 (+8/16) by 1/16 steps. , C (Δ).
このようにして、係数テーブル141の補間加重係数を用いて補間対象位置の補間値を求めることにより、図3で説明した従来例のように、補間値の解像力が補間対象位置に依存することなく、補間値の解像力を一定に保つことができる。この結果、出力画像の全ての画素について解像力が一定に保たれているので、出力画像に対して公知の輪郭強調処理を強く施した場合でもジャギーの発生を少なくすることができる。
(その他の例)
上記の説明では、「参照画素位置の広がり具合を表す評価値」として、参照画素の座標と補間対象位置との差を二乗して補間加重係数を乗じる加重分散を用いたが、(式9)に示すような参照画素の座標と補間対象位置との差の絶対値に補間加重係数を乗じる一次ノルムを適用してもよい。
In this way, by obtaining the interpolation value of the interpolation target position using the interpolation weight coefficient of the coefficient table 141, the resolution of the interpolation value does not depend on the interpolation target position as in the conventional example described in FIG. The resolving power of the interpolation value can be kept constant. As a result, since the resolving power is kept constant for all the pixels of the output image, it is possible to reduce the occurrence of jaggies even when a known contour enhancement process is strongly applied to the output image.
(Other examples)
In the above description, the weighted variance in which the difference between the coordinates of the reference pixel and the interpolation target position is squared and multiplied by the interpolation weighting coefficient is used as the “evaluation value representing the extent of the reference pixel position”. A primary norm that multiplies the absolute value of the difference between the reference pixel coordinates and the interpolation target position by an interpolation weighting coefficient as shown in FIG.
E=|Δ+1|×A(Δ)+|Δ|×B(Δ)+|Δ−1|×C(Δ)
尚、上記以外の方法で、参照画素位置の広がり具合を表す任意の評価値を求めるようにしてもよい。
E = | Δ + 1 | × A (Δ) + | Δ | × B (Δ) + | Δ−1 | × C (Δ)
Note that an arbitrary evaluation value representing the extent of the reference pixel position may be obtained by a method other than the above.
このようにして求めた評価値Eを条件Cとして、先に説明した条件Aおよび条件Bと組み合わせた連立方程式を解くことにより、補間加重係数(A(Δ),B(Δ),C(Δ))を求めることができる。そして、補間加重係数(A(Δ),B(Δ),C(Δ))を用いて、入力画像を変形処理した出力画像の画素値を生成する処理は、先の実施形態と同様なので説明を省略する。 By using the evaluation value E thus obtained as the condition C and solving the simultaneous equations combined with the conditions A and B described above, interpolation weighting coefficients (A (Δ), B (Δ), C (Δ )). The process for generating the pixel value of the output image obtained by transforming the input image using the interpolation weighting coefficients (A (Δ), B (Δ), C (Δ)) is the same as in the previous embodiment, and will be described. Is omitted.
以上、説明してきたように、本実施形態に係る電子カメラ101は、条件A,BおよびCを満足する補間加重係数を算出し、この補間加重係数を用いて出力画像の画素値を生成する。これにより、出力画像を構成する画素毎の解像力の差をなくすことができ、出力画像に輪郭強調処理を施した場合でもジャギーなどによる画質の劣化を防止できる。
As described above, the
尚、本実施形態では、本発明に係る画像処理装置が搭載された電子カメラの例を挙げて説明したが、図11で説明した画像処理部107の処理を実行する画像処理プログラムをパソコン、携帯電話、スマートフォンなどにインストールして、ネットワークからダウンロードした画像やメモリカード112aなどに記憶されている画像に対して変形処理を行う場合でも同様の効果が得られる。
In this embodiment, the example of the electronic camera equipped with the image processing apparatus according to the present invention has been described. However, an image processing program for executing the processing of the
また、本発明に係る画像処理装置および画像処理プログラム並びに電子カメラについて、各実施形態で例を挙げて説明してきたが、その精神またはその主要な特徴から逸脱することなく他の多様な形で実施することができる。そのため、上述した実施形態はあらゆる点で単なる例示に過ぎず、限定的に解釈してはならない。本発明は、特許請求の範囲によって示されるものであって、本発明は明細書本文にはなんら拘束されない。さらに、特許請求の範囲の均等範囲に属する変形や変更は、全て本発明の範囲内である。 Further, the image processing apparatus, the image processing program, and the electronic camera according to the present invention have been described by way of examples in the respective embodiments. can do. Therefore, the above-described embodiment is merely an example in all respects and should not be interpreted in a limited manner. The present invention is defined by the claims, and the present invention is not limited to the text of the specification. Further, all modifications and changes belonging to the equivalent scope of the claims are within the scope of the present invention.
101・・・電子カメラ;102・・・光学系;103・・・メカニカルシャッタ;104・・・撮像素子;105・・・A/D変換部;106・・・画像バッファ;107・・・画像処理部;108・・・制御部;109・・・メモリ;110・・・表示部;111・・・操作部;112・・・メモリカードIF;112a・・・メモリカード;141・・・係数テーブル;201・・・画像入力部;202・・・補間対象位置設定部;203・・・参照画素値抽出部;204・・・補間加重係数設定部;205・・・補間部;206・・・画像出力部
DESCRIPTION OF
Claims (10)
入力画像を変形した出力画像の画素に対応する前記入力画像上の補間対象位置を設定する補間対象位置設定部と、
前記入力画像を構成する複数の画素のうち前記補間対象位置の近傍のN個(Nは3以上の整数)を参照画素とし、当該参照画素の画素値を抽出する参照画素値抽出部と、
前記N個の参照画素の位置に応じて、前記参照画素毎に補間加重係数を設定する補間加重係数設定部と、
前記参照画素の画素値に当該参照画素の前記補間加重係数を掛けた乗算値を算出し、前記N個の参照画素に対する前記乗算値の総和を前記補間対象位置の補間値とする補間部と
を備え、
前記補間加重係数設定部は、
前記N個の参照画素の位置の拡散度を表す評価値が、補間対象位置に依存せずに一定になるように前記補間加重係数を設定する
ことを特徴とする画像処理装置。 An image input unit for inputting an image composed of a plurality of pixels arranged two-dimensionally;
An interpolation target position setting unit that sets an interpolation target position on the input image corresponding to a pixel of the output image obtained by transforming the input image;
A reference pixel value extraction unit that extracts N values (N is an integer of 3 or more) in the vicinity of the interpolation target position among a plurality of pixels constituting the input image as reference pixels, and extracts a pixel value of the reference pixels;
An interpolation weight coefficient setting unit that sets an interpolation weight coefficient for each reference pixel according to the position of the N reference pixels;
An interpolation unit that calculates a multiplication value obtained by multiplying the pixel value of the reference pixel by the interpolation weighting coefficient of the reference pixel, and uses a sum of the multiplication values for the N reference pixels as an interpolation value of the interpolation target position; Prepared,
The interpolation weighting coefficient setting unit
The image processing apparatus, wherein the interpolation weighting coefficient is set so that an evaluation value representing a diffusion degree at the position of the N reference pixels is constant without depending on an interpolation target position.
前記補間加重係数設定部は、
条件Aとして、前記N個の補間加重係数の合計が一定であること、
条件Bとして、前記N個の参照画素位置の加重平均が前記補間対象位置であること、
条件Cとして、前記評価値が前記補間対象位置に依存せずに一定であること、
の少なくとも3つの条件を満足する前記補間加重係数を設定する
ことを特徴とする画像処理装置。 The image processing apparatus according to claim 1.
The interpolation weighting coefficient setting unit
As condition A, the sum of the N interpolation weighting coefficients is constant,
Condition B is that the weighted average of the N reference pixel positions is the interpolation target position;
As the condition C, the evaluation value is constant without depending on the interpolation target position,
The image processing apparatus is characterized in that the interpolation weighting coefficient satisfying at least three conditions is set.
前記評価値は、次式(nは1からNまでの整数)により算出される
The evaluation value is calculated by the following formula (n is an integer from 1 to N):
前記評価値は、次式(nは1からNまでの整数)により算出される
The evaluation value is calculated by the following formula (n is an integer from 1 to N):
xを整数座標、Δを−0.5から+0.5までの範囲の端数座標、補間対象位置を(x+Δ)、参照画素の数Nを3とした場合、
前記参照画素値抽出部は、前記3つの参照画素の座標(x−1),x,(x+1)の画素値P(x−1),P(x),P(x+1)を抽出し、
前記補間加重係数設定部は、
前記条件Aとして、A(Δ)+B(Δ)+C(Δ)=1であること、
前記条件Bとして、−A(Δ)+C(Δ)=Δであること、
前記条件Cとして、(Δ+1)2×A(Δ)+Δ2×B(Δ)+(Δ−1)2×C(Δ)=一定であること、
の3つの条件から成る連立方程式の解を前記3つの参照画素のそれぞれに対する前記補間加重係数A(Δ),B(Δ),C(Δ)とする
ことを特徴とする画像処理装置。 The image processing apparatus according to claim 3.
When x is an integer coordinate, Δ is a fractional coordinate in a range from −0.5 to +0.5, an interpolation target position is (x + Δ), and the number N of reference pixels is 3,
The reference pixel value extraction unit extracts pixel values P (x−1), P (x), and P (x + 1) of coordinates (x−1), x, and (x + 1) of the three reference pixels,
The interpolation weighting coefficient setting unit
As the condition A, A (Δ) + B (Δ) + C (Δ) = 1,
As the condition B, −A (Δ) + C (Δ) = Δ,
As the condition C, (Δ + 1) 2 × A (Δ) + Δ 2 × B (Δ) + (Δ−1) 2 × C (Δ) = constant,
An image processing apparatus characterized in that a solution of simultaneous equations comprising the three conditions is the interpolation weighting coefficients A (Δ), B (Δ), and C (Δ) for each of the three reference pixels.
xを整数座標、Δを−0.5から+0.5までの範囲の端数座標、補間対象位置を(x+Δ)、参照画素の数Nを3とした場合、
前記参照画素値抽出部は、前記3つの参照画素の座標(x−1),x,(x+1)の画素値P(x−1), P(x), P(x+1)を抽出し、
前記補間加重係数設定部は、
前記条件Aとして、A(Δ)+B(Δ)+C(Δ)=1であること、
前記条件Bとして、−A(Δ)+C(Δ)=Δであること、
前記条件Cとして、|Δ+1|×A(Δ)+|Δ|×B(Δ)+|Δ−1|×C(Δ)=一定であること、
の3つの条件から成る連立方程式の解を前記3つの参照画素のそれぞれに対する前記補間加重係数A(Δ),B(Δ),C(Δ)とする
ことを特徴とする画像処理装置。 The image processing apparatus according to claim 4.
When x is an integer coordinate, Δ is a fractional coordinate in a range from −0.5 to +0.5, an interpolation target position is (x + Δ), and the number N of reference pixels is 3,
The reference pixel value extraction unit extracts pixel values P (x−1), P (x), and P (x + 1) of coordinates (x−1), x, and (x + 1) of the three reference pixels,
The interpolation weighting coefficient setting unit
As the condition A, A (Δ) + B (Δ) + C (Δ) = 1,
As the condition B, −A (Δ) + C (Δ) = Δ,
As the condition C, | Δ + 1 | × A (Δ) + | Δ | × B (Δ) + | Δ−1 | × C (Δ) = constant,
An image processing apparatus characterized in that a solution of simultaneous equations comprising the three conditions is the interpolation weighting coefficients A (Δ), B (Δ), and C (Δ) for each of the three reference pixels.
−0.5から+0.5までの範囲の前記端数座標Δに対応する前記補間加重係数A(Δ),B(Δ),C(Δ)を予め算出した係数テーブルを設け、
前記補間部は、前記係数テーブルを参照して前記端数座標Δに応じた前記補間加重係数を求め、前記参照画素値に当該参照画素の前記補間加重係数を掛けた乗算値を算出し、前記N個の参照画素の前記乗算値の総和を前記補間対象位置の補間値とする
ことを特徴とする画像処理装置。 The image processing apparatus according to claim 5 or 6,
A coefficient table in which the interpolation weighting coefficients A (Δ), B (Δ), and C (Δ) corresponding to the fractional coordinates Δ in the range of −0.5 to +0.5 are provided in advance;
The interpolation unit refers to the coefficient table to obtain the interpolation weighting coefficient corresponding to the fractional coordinate Δ, calculates a multiplication value obtained by multiplying the reference pixel value by the interpolation weighting coefficient of the reference pixel, and the N An image processing apparatus, wherein a sum total of the multiplication values of the reference pixels is used as an interpolation value at the interpolation target position.
−0.5から+0.5までの範囲の前記端数座標Δの分解能を1/8から1/32に設定する
ことを特徴とする画像処理装置。 In the image processing device according to any one of claims 5 to 7,
An image processing apparatus, wherein the resolution of the fractional coordinate Δ in the range from −0.5 to +0.5 is set from 1/8 to 1/32.
被写体を撮像して得られた画像を前記画像入力部に出力する撮像部と、
前記画像処理装置が補間した画像を記録する記憶部と
を有することを特徴とする電子カメラ。 An electronic camera equipped with the image processing apparatus according to claim 1,
An imaging unit that outputs an image obtained by imaging a subject to the image input unit;
An electronic camera comprising: a storage unit that records an image interpolated by the image processing apparatus.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013106784A JP2014230014A (en) | 2013-05-21 | 2013-05-21 | Image processing device, image processing program and electronic camera |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013106784A JP2014230014A (en) | 2013-05-21 | 2013-05-21 | Image processing device, image processing program and electronic camera |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2014230014A true JP2014230014A (en) | 2014-12-08 |
Family
ID=52129509
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2013106784A Pending JP2014230014A (en) | 2013-05-21 | 2013-05-21 | Image processing device, image processing program and electronic camera |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2014230014A (en) |
-
2013
- 2013-05-21 JP JP2013106784A patent/JP2014230014A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR101204727B1 (en) | Image processing apparatus, image processing method, and storage medium | |
JP6308748B2 (en) | Image processing apparatus, imaging apparatus, and image processing method | |
JP6711396B2 (en) | Image processing device, imaging device, image processing method, and program | |
JP5984493B2 (en) | Image processing apparatus, image processing method, imaging apparatus, and program | |
JP2006033656A (en) | User interface provider | |
CN108886581A (en) | Image processing device, imaging device, control method and program thereof | |
EP2847998B1 (en) | Systems, methods, and computer program products for compound image demosaicing and warping | |
JP6087612B2 (en) | Image processing apparatus and image processing method | |
JP5968088B2 (en) | Image processing apparatus, image processing method, and program | |
JP5455728B2 (en) | Imaging apparatus, image processing apparatus, and image processing method | |
CN118247173A (en) | Content-based image processing | |
EP3474532B1 (en) | Image processing apparatus, image processing method, and program | |
JP7262940B2 (en) | IMAGE PROCESSING DEVICE, IMAGING DEVICE, CONTROL METHOD AND PROGRAM FOR IMAGE PROCESSING DEVICE | |
JP5458906B2 (en) | Image processing device | |
CN107979715B (en) | Image pickup apparatus | |
JP2017045273A (en) | Image processing apparatus, image processing method, and program | |
JP7183015B2 (en) | Image processing device, image processing method, and program | |
JP2015095890A (en) | Image processing apparatus and control method for the same | |
JP2018182550A (en) | Image processing apparatus | |
JP2014230014A (en) | Image processing device, image processing program and electronic camera | |
JP2020057242A (en) | Image processing system, image processing method, and program | |
JP2012133492A (en) | Image processing device and program | |
JP2006139697A (en) | Image processor and image processing method | |
CN119744405A (en) | Gaze point downsampling of image data | |
JP2017182668A (en) | Data processor, imaging device, and data processing method |