JP2009044258A - Image processing apparatus, image data generation method, and computer program - Google Patents
Image processing apparatus, image data generation method, and computer program Download PDFInfo
- Publication number
- JP2009044258A JP2009044258A JP2007204637A JP2007204637A JP2009044258A JP 2009044258 A JP2009044258 A JP 2009044258A JP 2007204637 A JP2007204637 A JP 2007204637A JP 2007204637 A JP2007204637 A JP 2007204637A JP 2009044258 A JP2009044258 A JP 2009044258A
- Authority
- JP
- Japan
- Prior art keywords
- image
- image data
- function
- cubic interpolation
- interpolation
- 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
- 238000000034 method Methods 0.000 title claims abstract description 41
- 238000004590 computer program Methods 0.000 title claims description 12
- 238000009795 derivation Methods 0.000 claims abstract description 4
- 230000008569 process Effects 0.000 claims description 16
- 230000008859 change Effects 0.000 claims description 5
- 238000004904 shortening Methods 0.000 abstract description 2
- 230000006870 function Effects 0.000 description 56
- 238000010586 diagram Methods 0.000 description 10
- 238000004364 calculation method Methods 0.000 description 5
- 238000006243 chemical reaction Methods 0.000 description 5
- 230000002093 peripheral effect Effects 0.000 description 3
- 230000009467 reduction Effects 0.000 description 2
- 101100377706 Escherichia phage T5 A2.2 gene Proteins 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000009499 grossing Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Images
Landscapes
- Image Processing (AREA)
- Editing Of Facsimile Originals (AREA)
- Facsimile Image Signal Circuits (AREA)
Abstract
【課題】本発明は、画像の大きさ、解像度、コントラスト、明度等を変更する場合の処理時間を短縮する技術を提供することを目的とする。
【解決手段】コンピュータ100は、画像を示す第1の画像データを取得する画像データ取得部162と、3次補間処理を行うための3次補間関数を導出する補間関数導出部166と、画像を拡大するために、第1の画像データに対して、導出された3次補間関数を用いて、3次補間処理を行なう3次補間処理部164と、補間画素を含む出力用画像データを生成して出力する画像データ出力部168とを備え、3次補間関数の係数は、画像のコントラストを調整する際の入出力特性を示す調整関数の係数の関数として表される。
【選択図】図1An object of the present invention is to provide a technique for shortening the processing time when changing the size, resolution, contrast, brightness, etc. of an image.
A computer 100 includes an image data acquisition unit 162 that acquires first image data representing an image, an interpolation function derivation unit 166 that derives a cubic interpolation function for performing cubic interpolation processing, and an image. In order to enlarge, a third-order interpolation processing unit 164 that performs third-order interpolation processing on the first image data using the derived third-order interpolation function, and output image data including interpolation pixels are generated. The coefficient of the cubic interpolation function is expressed as a function of the coefficient of the adjustment function indicating the input / output characteristics when adjusting the contrast of the image.
[Selection] Figure 1
Description
本発明は、画像データに、3次補間処理を施すことが可能な画像処理装置に関する。 The present invention relates to an image processing apparatus capable of performing cubic interpolation processing on image data.
従来は、例えば、コンピュータにおいて、画像を拡大し、明度、コントラスト、先鋭度を調整する場合には、画像を示す画像データに対して、拡大の処理を行った後に、明度の調整、コントラストの調整、先鋭度の調整を、順次、行なっていた。そうすると、1種類の処理(例えば、拡大の処理)につき、画素数×3(R,G,B各画素について)回、メモリからの読み込み、メモリへの書き込みが必要である。そのため、拡大等の処理を行う際の処理時間が長く、ディスプレイに表示したり、プリンタで印刷するのに、時間がかかるという問題があった。画像を縮小したり、画像の解像度を変更する場合にも、同様の問題があった。 Conventionally, for example, when an image is enlarged and brightness, contrast, and sharpness are adjusted on a computer, the image data indicating the image is subjected to enlargement processing, and then the brightness adjustment and contrast adjustment are performed. The sharpness was adjusted sequentially. Then, the number of pixels × 3 (for each pixel of R, G, and B) needs to be read from the memory and written to the memory for one type of processing (for example, enlargement processing). For this reason, there has been a problem that the processing time when performing processing such as enlargement is long, and it takes time to display on a display or to print with a printer. The same problem occurs when the image is reduced or the resolution of the image is changed.
そこで、処理時間を短くするために、画像を拡大、縮小する際に、Bスプライン補間と、キュービックスプライン補間とを組み合わせた補間演算方法を利用して、画像の拡大、縮小を行なうと共に画像の先鋭度を調整する方法が提案されている(例えば、特許文献1参照。)。 Therefore, in order to shorten the processing time, when enlarging or reducing the image, an interpolation operation method combining B-spline interpolation and cubic spline interpolation is used to enlarge and reduce the image and sharpen the image. A method of adjusting the degree has been proposed (see, for example, Patent Document 1).
上記した補間演算方法によれば、画像の拡大等の処理を行う際に、先鋭度の調整をするため、従来よりも、処理は高速化される。しかしながら、明度の調整、コントラストの調整も行なう場合は、拡大等の処理を行った後に、順次、明度の調整、コントラストの調整を行なうため、処理時間が長くかかり、表示等されるのに時間がかかった。 According to the above-described interpolation calculation method, the sharpness is adjusted when performing processing such as image enlargement, so that the processing is faster than the conventional method. However, in the case of adjusting brightness and adjusting contrast, after processing such as enlargement, the brightness and contrast are sequentially adjusted. It took.
なお、このような問題は、プリンタ、パーソナルコンピュータ、デジタルカメラ等の、画像の大きさ、解像度、先鋭度、コントラスト、明度等を変更することが可能な画像処理装置に共通する問題であった。 Such a problem is a problem common to image processing apparatuses such as printers, personal computers, and digital cameras that can change the size, resolution, sharpness, contrast, brightness, and the like of an image.
そこで、本発明は、画像の大きさ、解像度、コントラスト、明度等を変更する場合の処理時間を短縮する技術を提供することを目的とする。 Therefore, an object of the present invention is to provide a technique for shortening the processing time when changing the size, resolution, contrast, brightness, and the like of an image.
本発明は、上述の課題の少なくとも一部を解決するためになされたものであり、以下の形態又は適用例として実現することが可能である。 SUMMARY An advantage of some aspects of the invention is to solve at least a part of the problems described above, and the invention can be implemented as the following forms or application examples.
[適用例1] 画像処理装置であって、
画像を示す第1の画像データを取得する画像データ取得部と、
前記第1の画像データに対して3次補間処理を行うときに用いる3次補間関数を導出する3次補間関数導出部と、
前記画像の大きさおよび解像度のうち、少なくとも一方を変更するために、前記第1の画像データに対して、導出された前記3次補間関数を用いて、前記3次補間処理を行なって第2の画像データを生成して出力する画像データ生成部と、
を備え、
前記3次補間関数の係数は、前記画像のコントラストを調整する際の入出力特性を示す調整関数が有する係数の関数として表されることを特徴とする画像処理装置。
Application Example 1 An image processing apparatus,
An image data acquisition unit for acquiring first image data indicating an image;
A cubic interpolation function derivation unit for deriving a cubic interpolation function to be used when performing cubic interpolation processing on the first image data;
In order to change at least one of the size and resolution of the image, a second interpolation process is performed on the first image data using the derived third-order interpolation function to perform a second interpolation process. An image data generation unit for generating and outputting the image data;
With
The image processing apparatus, wherein the coefficient of the cubic interpolation function is expressed as a function of a coefficient included in an adjustment function indicating input / output characteristics when adjusting the contrast of the image.
適用例1の画像処理装置によれば、3次補間関数の係数は、画像のコントラストを調整する場合の入出力特性を示す調整関数が有する係数の関数であるため、画像のコントラストが異なると、3次補間関数も異なる。すなわち、第1の画像データに対して、導出された3次補間関数を用いて3次補間処理を行うことにより、画像の大きさの変更(すなわち、画像の拡大または縮小)や、画像の解像度の変更を行うと共に、コントラストの調整もできるようになる。 According to the image processing apparatus of Application Example 1, the coefficient of the cubic interpolation function is a function of a coefficient included in the adjustment function indicating the input / output characteristics when adjusting the contrast of the image. The cubic interpolation function is also different. That is, by performing a cubic interpolation process on the first image data using the derived cubic interpolation function, the image size is changed (that is, the image is enlarged or reduced), and the image resolution is increased. In addition, the contrast can be adjusted.
したがって、画像の大きさや解像度を変更する処理と、コントラストの調整とを行なう場合の、処理時間を短縮することができる。例えば、画像の拡大およびコントラストの調整後のプレビュー画像を表示させるまでの時間を短縮することができる。 Therefore, it is possible to shorten the processing time when performing processing for changing the size and resolution of an image and adjustment of contrast. For example, it is possible to shorten the time until the preview image after image enlargement and contrast adjustment is displayed.
[適用例2] 適用例1に記載の画像処理装置において、
前記3次補間処理は、
前記第1の画像データに対して前記3次補間関数を乗じて得られる結果に、前記画像の明るさを調整する際の入出力特性を示す調整関数の定数を加算する処理であることを特徴とする画像処理装置。
Application Example 2 In the image processing apparatus according to Application Example 1,
The cubic interpolation process is:
It is a process of adding a constant of an adjustment function indicating an input / output characteristic when adjusting the brightness of the image to a result obtained by multiplying the first image data by the cubic interpolation function. An image processing apparatus.
適用例2の画像処理装置によれば、画像の拡大等を行うと共に、コントラストおよび明るさの調整もできるようになる。したがって、さらに、処理時間を短縮させることができる。 According to the image processing apparatus of the application example 2, the image can be enlarged and the contrast and brightness can be adjusted. Therefore, the processing time can be further shortened.
[適用例3] 適用例1または2に記載の画像処理装置において、
前記3次補間関数導出部は、
前記第2の画像データが所定の先鋭度を示すように、前記3次補間関数を導出することを特徴とする画像処理装置。
Application Example 3 In the image processing apparatus according to Application Example 1 or 2,
The cubic interpolation function deriving unit
An image processing apparatus, wherein the cubic interpolation function is derived so that the second image data shows a predetermined sharpness.
適用例2の画像処理装置によれば、画像の拡大等の処理を行う際に、同時に先鋭度も調整することができるようになるため、さらに、処理時間を短縮することができるようになる。 According to the image processing apparatus of the application example 2, when performing processing such as image enlargement, the sharpness can be adjusted at the same time, so that the processing time can be further shortened.
なお、本発明は、上記した画像処理装置の態様に限ることなく、画像処理装置を構築するためのコンピュータプログラムとしての態様や、そのコンピュータプログラムを記憶した記憶媒体としての態様、画像データ生成方法としての態様など、種々の態様で実現することも可能である。 The present invention is not limited to the above-described aspect of the image processing apparatus, but as an aspect as a computer program for constructing the image processing apparatus, an aspect as a storage medium storing the computer program, and an image data generation method It is also possible to implement in various modes such as the above mode.
A1.実施例の構成:
図1は、本発明の一実施例としてのコンピュータ100を示すブロック図である。 コンピュータ100は、コンピュータプログラムに従って種々の処理や制御を行うためのCPU110と、ROMやRAMなどの内部メモリ120と、スキャナ200や、デジタルカメラや、HDD、CD等のドライブ等と通信するための周辺機器インタフェース130、リムーバブルメモリ300に格納されたデータを読み出すための外部メモリインタフェース140、画像等を表示するためのLCD等で構成されるディスプレイ150、これらの構成要素をつなぐバス170を備えている。
A1. Example configuration:
FIG. 1 is a block diagram showing a
内部メモリ120には、画像処理部160として機能するコンピュータプログラムが格納されている。なお、画像処理部160の機能は、CPU110がコンピュータプログラムを実行することによって実現される。このコンピュータプログラムは、ROMのチップ(図示せず)に記録された形態で提供される。また、このようなROMを用いる代わりに、コンピュータプログラムをCD−ROMドライブ装置(図示せず)によって読み取って、不揮発性のRAMに書き込むようにしてもよい。なお、後述する先鋭度LUT(Look Up Table)122、コントラストLUT124、明度LUT126も、画像処理用のコンピュータプログラムと共に、ROMに格納されている。
The
画像処理部160は、画像データ取得部162、3次補間処理部164、補間関数導出部166、画像データ出力部168と、を備えている。画像データ取得部162は、周辺機器インタフェース130や外部メモリインタフェース140を介して、画像データを取得して、内部メモリ120に格納する。3次補間処理部164は、後述する補間関数導出部166によって求められた3次補間関数を利用して、内部メモリ120に格納された画像データに対して、3次補間処理を施して、取得した画像の拡大、縮小、解像度変換等の処理と、先鋭度、コントラスト、明度の調整とを同時に行って、補間画素の濃度を求める。補間関数導出部166は、ユーザが指定した先鋭度、コントラストに基づいて、3次補間関数を導出する(後に詳述する)。画像データ出力部168は、3次補間処理部164によって求められた補間画素を含む出力用画像データを生成して、ディスプレイ150に表示させる。
The
なお、本実施例において、出力用画像データをディスプレイ150に表示させる場合を例示しているが、例えば、プリンタに出力したり、ハードディスクに書き込む等、種々の出力装置に出力することができる。例えば、プリンタに送出する場合は、画像データ出力部168は、出力用画像データに基づいて、プリンタによる印刷に適した印刷用画像データを生成して、プリンタに送出するようにしてもよい。
In the present embodiment, the case where the image data for output is displayed on the
本実施例における補間関数導出部166が、請求項における3次補間関数導出部に、3次補間処理部164および画像データ出力部168が、請求項における画像データ生成部に、それぞれ、相当する。
The interpolation
A2.3次補間関数:
A2.1.バイキュービック法:
一般に、画像の大きさや解像度を変更する場合に、対応する画素がない場合には、補間を行なう。補間の方法としては、近い点で代表させるニアレストネイバー法 (最近傍法ともいう)、近くの点との距離に応じて重み平均をとるバイリニア法(双線形補間ともいう)、周囲の16点から計算するバイキュービック法(双3次補間ともいう)等がある。
A2.3 cubic interpolation function:
A2.1. Bicubic method:
In general, when changing the size or resolution of an image, if there is no corresponding pixel, interpolation is performed. As interpolation methods, the nearest neighbor method (also referred to as nearest neighbor method), which is represented by nearby points, the bilinear method (also referred to as bilinear interpolation) that takes a weighted average according to the distance to nearby points, and 16 surrounding points There is a bicubic method (also called bicubic interpolation) calculated from
バイキュービック法は、ニアトレスネイバー法やバイリニア法と比べ元画像情報の損失が最も少なく、補間法適用後でも自然な画像を得ることができる一方、計算量が多く、処理速度が遅い。ここで、バイキュービック法にて画素を補間する方法について、図4に基づいて、簡単に説明する。図4は、バイキュービック法により画素を補間する場合の計算方法を説明するための説明図である。 The bicubic method has the least loss of original image information as compared with the near-less neighbor method and the bilinear method, and a natural image can be obtained even after the interpolation method is applied, but the calculation amount is large and the processing speed is slow. Here, a method of interpolating pixels by the bicubic method will be briefly described with reference to FIG. FIG. 4 is an explanatory diagram for explaining a calculation method in the case of interpolating pixels by the bicubic method.
説明を簡単にするために、一次元の場合(例えば、横のみに拡大する場合)を例に挙げて説明する。一次元の場合、補間画素に近い元画像の画素4点を参照して、補間画素の濃度(輝度、階調値)を求める。具体的には、〔元画像の画素(以下、参照画素ともいう)の濃度〕×〔参照画素と補間画素との距離による重み関数k(x)〕を、4点の参照画素それぞれについて計算し、その和を求めることによって、補間画素の濃度をもとめることができる。この重み関数k(x)を、3次補間関数という。xは、隣り合う参照画素間の距離を1とした場合の、求める補間画素と参照画素との距離である。 In order to simplify the description, the case of one-dimensional (for example, the case of enlarging only horizontally) will be described as an example. In the one-dimensional case, the density (luminance, gradation value) of the interpolation pixel is obtained with reference to four pixels of the original image close to the interpolation pixel. Specifically, [Density of original image pixel (hereinafter also referred to as reference pixel)] × [Weight function k (x) according to distance between reference pixel and interpolation pixel] is calculated for each of four reference pixels. By obtaining the sum, the density of the interpolated pixel can be obtained. This weight function k (x) is called a cubic interpolation function. x is the distance between the interpolated pixel and the reference pixel to be calculated when the distance between adjacent reference pixels is 1.
バイキュービック法を用いて補間する場合の3次補間関数をk(x)として、例えば、パラメータB、Cを用いる式(1)が知られている。式(1)は、BCスプラインの式といわれる式である。 For example, Equation (1) using parameters B and C is known, where k (x) is a cubic interpolation function when interpolation is performed using the bicubic method. Expression (1) is an expression called BC spline expression.
例えば、元画像を3倍に拡大する場合、バイキュービック法によって補間画素の濃度を求める場合について、図4に基づいて説明する。元画像の位置uにある画素Puの濃度をf(u)とすると、隣の画素Pu-1、Pu+1の濃度はそれぞれf(u−1)、f(u+1)となる。図4(a)は、元画像を3倍に拡大するイメージを説明する説明図である。図示するように、画像を3倍に拡大する場合、同一解像度では、画素Puと画素Pu+1の間に2点の画素Pu+1/3と画素Pu+2/3を補間しなければならない。図4(b)は、補間画素Pu+1/3の濃度f(u+1/3)を求める場合に参照する参照画素と補間画素との距離xを示す説明図である。
For example, in the case where the original image is enlarged three times, a case where the density of the interpolation pixel is obtained by the bicubic method will be described with reference to FIG. When the density of the pixel P u in the position u of the original image and f (u),
上記したように、参照画素の濃度に3次補間関数k(x)を乗じて得た値を加えることによって、画素Pu+1/3の濃度を求めることができる。補間画素Pu+1/3の濃度f(u+1/3)を求める場合の計算式を、式(2)に示す。 As described above, the density of the pixel P u + 1/3 can be obtained by adding the value obtained by multiplying the density of the reference pixel by the cubic interpolation function k (x). Formula (2) shows a calculation formula for obtaining the density f (u + 1/3) of the interpolation pixel P u + 1/3 .
f(u+1/3)=f(u−1)×k(3/4)+f(u)×k(1/3)+f(u+1)×k(2/3)+f(u+2)×k(5/3) ・・・(2) f (u + 1/3) = f (u−1) × k (3/4) + f (u) × k (1/3) + f (u + 1) × k (2/3) + f (u + 2) × k (5 / 3) (2)
なお、2次元の場合(縦横に拡大)には、上記の通り、横に拡大した後に、同様に縦に拡大することによって、補間画素の濃度を求めることができる。すなわち、縦4画素×横4画素の16画素を参照することになる。 In the two-dimensional case (enlarged vertically and horizontally), as described above, after horizontally enlarging, the pixels can be obtained by similarly enlarging vertically. That is, 16 pixels of 4 vertical pixels × 4 horizontal pixels are referred to.
A2.2.先鋭度の調整:
画像の大きさ、解像度を変更する場合に、同時に先鋭度を変更することができる。例えば、3次補間関数k(x)として、式(1)を用いる場合に、式(1)のB、Cの値を変更することによって、画像の先鋭度を調整することができる。例えば、C=0として、Bを大きくしていくと、先鋭度の低いぼやけた画像になる。図5は、パラメータB=0.5、C=0の場合の周波数特性を示す説明図、図6は、パラメータB=1.0、C=0の場合の周波数特性を示す説明図である。図示するように、Bを大きくすることにより、高周波成分をカットすることができる。すなわち、Bの値を小さくすれば、画像をシャープにすることができ、Bの値を大きくすれば、画像を平滑化することができる。
A2.2. Sharpness adjustment:
When changing the size and resolution of the image, the sharpness can be changed at the same time. For example, when Expression (1) is used as the cubic interpolation function k (x), the sharpness of the image can be adjusted by changing the values of B and C in Expression (1). For example, when C = 0 and B is increased, a blurred image with low sharpness is obtained. FIG. 5 is an explanatory diagram showing frequency characteristics when parameters B = 0.5 and C = 0, and FIG. 6 is an explanatory diagram showing frequency characteristics when parameters B = 1.0 and C = 0. As shown in the figure, high frequency components can be cut by increasing B. That is, if the value of B is reduced, the image can be sharpened, and if the value of B is increased, the image can be smoothed.
A2.3.コントラストの調整:
図7は、コントラストを調整する際に用いられる、入出力特性を示す説明図である。例えば、A2.1において説明したように補間画素の濃度を求める場合に、求める補間画素と参照画素との距離をx、参照画素の濃度をl、参照画素の濃度に3次補間関数k(x)を乗じた結果を、h(x)とし、3次補間関数k(x)=a|x|3+b|x|2+c|x|+dとすると、h(x)は、以下のようになる。
A2.3. Contrast adjustment:
FIG. 7 is an explanatory diagram showing the input / output characteristics used when adjusting the contrast. For example, as described in A2.1, when obtaining the density of the interpolation pixel, the distance between the obtained interpolation pixel and the reference pixel is x, the density of the reference pixel is l, and the density of the reference pixel is the cubic interpolation function k (x ) Is h (x), and the cubic interpolation function k (x) = a | x | 3 + b | x | 2 + c | x | + d, h (x) is as follows: Become.
h(x)=(a|x|3+b|x|2+c|x|+d)l ・・・(3) h (x) = (a | x | 3 + b | x | 2 + c | x | + d) l (3)
h(x)について、図7に示す入出力特性を示すように、コントラスト変換を行なう。コントラスト変換をした結果をt(x)とすると、以下のようになる。 Contrast conversion is performed for h (x) so as to show the input / output characteristics shown in FIG. Assuming that the result of contrast conversion is t (x), the result is as follows.
ここで、
とし、式(4)に、式(3)を代入すると、
t(x)=(a|x|3+b|x|2+c|x|+d)αl+β=(aα|x|3+bα|x|2+cα|x|+dα)l+β
となる。
aα=a1、bα=b1、cα=c1、dα=d1とすると、3次補間関数k1(x)は、以下のようになる。
here,
And substituting equation (3) into equation (4),
t (x) = (a | x | 3 + b | x | 2 + c | x | + d) αl + β = (aα | x | 3 + bα | x | 2 + cα | x | + dα) l + β
It becomes.
When aα = a1, bα = b1, cα = c1, and dα = d1, the cubic interpolation function k1 (x) is as follows.
k1(x)=a1|x|3+b1|x|2+c1|x|+d1 ・・・(5) k1 (x) = a1 | x | 3 + b1 | x | 2 + c1 | x | + d1 (5)
このように、3次補間関数の係数を、a1、b1、c1、d1にする。そして、各参照画素の濃度に3次補間関数を乗じた結果を加算して、さらにβを加えることによって補間画素を求めれば、画像を拡大すると同時にコントラストを変更することができる。なお、縦横に拡大縮小する場合、縦横両方に上記した係数を用いると二重にコントラスト変換するので、縦横どちらか一方の参照画素に用い、他方は通常通り式(3)の係数を用いる。 As described above, the coefficients of the cubic interpolation function are set to a1, b1, c1, and d1. If the interpolation pixel is obtained by adding the result obtained by multiplying the density of each reference pixel by the cubic interpolation function and further adding β, the contrast can be changed at the same time as the image is enlarged. In the case of enlarging / reducing in the vertical and horizontal directions, if the above-described coefficients are used in both the vertical and horizontal directions, the contrast conversion is doubled.
A2.4.明るさの調整:
図8は、明るさを調整する際に用いられる、入出力特性を示す説明図である。図8では、画像全体を一律に、vだけ明るくする場合の入出力特性を示している。
A2.4. Brightness adjustment:
FIG. 8 is an explanatory diagram showing input / output characteristics used when adjusting the brightness. FIG. 8 shows input / output characteristics when the entire image is uniformly brightened by v.
入力をin、出力をoutとすると、
out=in+v ・・・(6)
If the input is in and the output is out,
out = in + v (6)
コントラストの調整処理を施した補間画素の濃度を入力値として、式(6)に代入すると、明るさを調整することができる。なお、1画素の濃度が0〜255で表現される画像では、通常、補間画素の濃度が255以上は255、0以下は0に制限する。しかし、明るさをv上げる場合は、v>0の時、v〜255、v<0の時、0〜255+vに濃度を制限する。 The brightness can be adjusted by substituting the density of the interpolated pixel subjected to the contrast adjustment processing as an input value into Expression (6). Note that in an image in which the density of one pixel is expressed by 0 to 255, the density of the interpolation pixel is usually limited to 255 when the density is 255 or higher, and 0 when the density is 0 or lower. However, when the brightness is increased by v, the density is limited to 0 to 255 + v when v> 0, v to 255, and v <0.
式(6)に、コントラストの調整処理を施した結果t(x)を代入すると、
out=t(x)+v=(a1|x|3+b1|x|2+c1|x|+d1)l+β+v=k1(x)l+v1,v1=β+v ・・・(7)
Substituting the result t (x) obtained by performing the contrast adjustment process into equation (6),
out = t (x) + v = (a1 | x | 3 + b1 | x | 2 + c1 | x | + d1) l + β + v = k1 (x) l + v1, v1 = β + v ··· (7)
このように、3次補間関数k1(x)の係数を、a1、b1、c1、d1として、各参照画素に3次補間関数を乗じた結果を加算して、v1を加えることによって補間画素を求めれば、画像を拡大すると共に、コントラストおよび明るさを変更することができる。 In this way, the coefficients of the cubic interpolation function k1 (x) are set as a1, b1, c1, and d1, and the result obtained by multiplying each reference pixel by the cubic interpolation function is added, and v1 is added to obtain the interpolation pixel. If required, the image can be enlarged and the contrast and brightness can be changed.
A2.5.補間画素の濃度の求め方:
式(7)におけるa1、b1、c1、d1、v1を、以下のように求めることによって、3次補間関数の係数に、先鋭度、コントラストの調整に関する係数を含めることができる。そして、バイキュービック法を利用して補間画素の濃度を求める場合に、元画像の各参照画素に上記した3次補間関数を乗じた結果を加算して、v1を加えれば、画像を拡大すると共に、先鋭度、コントラストおよび明るさを変更することができる。
A2.5. How to determine the density of interpolated pixels:
By obtaining a1, b1, c1, d1, and v1 in Expression (7) as follows, coefficients relating to sharpness and contrast adjustment can be included in the coefficients of the cubic interpolation function. When obtaining the density of the interpolation pixel using the bicubic method, the result obtained by multiplying each reference pixel of the original image by the above-described cubic interpolation function is added, and if v1 is added, the image is enlarged. The sharpness, contrast and brightness can be changed.
a1〜d1は、xの範囲によって異なる以下の式によって求められる。
(i)|x|<1の場合
a1=aα=(12−9B−6C)α×1/6 ・・・(11)
b1=bα=(−18+12B+6C)α×1/6 ・・・(12)
c1=cα=0×α×1/6=0 ・・・(13)
d1=dα=(6−2B)α×1/6 ・・・(14)
(ii)1≦|x|<2の場合
a1=aα=(−B−6C)α×1/6 ・・・(21)
b1=bα=(6B+30C)α×1/6 ・・・(22)
c1=cα=(−12B−48C)α×1/6 ・・・(23)
d1=dα=(8B+24C)α×1/6 ・・・(24)
(iii)|x|≧2の場合
a1=b1=c1=d1=0 ・・・(31)
a1 to d1 are obtained by the following formulas that vary depending on the range of x.
(I) When | x | <1 a1 = aα = (12−9B−6C) α × 1/6 (11)
b1 = bα = (− 18 + 12B + 6C) α × 1/6 (12)
c1 = cα = 0 × α × 1/6 = 0 (13)
d1 = dα = (6-2B) α × 1/6 (14)
(Ii) When 1 ≦ | x | <2 a1 = aα = (− B−6C) α × 1/6 (21)
b1 = bα = (6B + 30C) α × 1/6 (22)
c1 = cα = (− 12B−48C) α × 1/6 (23)
d1 = dα = (8B + 24C) α × 1/6 (24)
(Iii) When | x | ≧ 2 a1 = b1 = c1 = d1 = 0 (31)
v1は、xの範囲に関わらず、以下のように求められる。
v1=β+v ・・・(41)
v1 is obtained as follows regardless of the range of x.
v1 = β + v (41)
上記の式(11)〜(24)から分かるように、3次補間関数の各係数には、先鋭度の調整に関する定数B、Cと、コントラストの調整に関する係数αが含まれる。すなわち、3次補間関数の係数は、B、C、αの関数として表される。また、v1には、コントラストの調整に関する定数βと明るさの調整に関する定数vが含まれる。従って、上記の通り、3次補間関数の係数を求めて、その3次補間関数と、v1を利用して、補間画素の濃度を求めることにより、画像を拡大すると共に、先鋭度、コントラストおよび明るさを変更することができる。 As can be seen from the above equations (11) to (24), each coefficient of the cubic interpolation function includes constants B and C relating to the sharpness adjustment and a coefficient α relating to the contrast adjustment. That is, the coefficient of the cubic interpolation function is expressed as a function of B, C, and α. Further, v1 includes a constant β related to contrast adjustment and a constant v related to brightness adjustment. Therefore, as described above, the coefficient of the cubic interpolation function is obtained, and the density of the interpolation pixel is obtained by using the cubic interpolation function and v1, thereby enlarging the image, and sharpness, contrast, and brightness. Can be changed.
なお、上記したように、α、βは、コントラスト変換の入出力特性におけるn、mから求めることができる。本実施例においては、コントラストLUT124に、後述するコントラストの強さ(%)に対するα、βの値が記載されている。また、先鋭度LUT122には、後述するシャープネスの値に対するB、Cの値が記載されている。明度LUT126には、明るさ(%)に対するvの値が記載されている。したがって、B、C、α、β、vは、ユーザが入力した先鋭度、コントラスト、明度に基づいて、各LUTを参照して求めることができる。
As described above, α and β can be obtained from n and m in the input / output characteristics of contrast conversion. In this embodiment, the
A3.実施例の動作:
図2は、本実施例のコンピュータ100における画像処理の流れを示すフローチャートである。
A3. Example operation:
FIG. 2 is a flowchart showing the flow of image processing in the
コンピュータ100が起動している場合に、ユーザがリムーバブルメモリ300を、コンピュータ100のカードスロット(図示しない)に挿入することによって、リムーバブルメモリ300が外部メモリインタフェース140と接続されると、CPU110は、リムーバブルメモリ300を認識する。すると、CPU110は、内部メモリ120に記憶されたアプリケーションプログラムを読み出して実行することにより、アプリケーションとして機能する。アプリケーションが立ち上がると、リムーバブルメモリ300に格納された画像が表示される。ユーザが、メニューから「画像処理」(図示しない)を選択すると、CPU110は、画像処理用のコンピュータプログラムを読み出して実行することにより、画像処理部として機能する。すると、図3に示すように、実行可能な各種の画像処理が表示される。
When the
図3は、画像処理画面Wを示す説明図である。画像処理画面Wは、拡大率入力欄cl1、シャープネス入力欄cl2、コントラスト入力欄cl3、明るさ入力欄cl4が設けられている。これらの入力欄は、ユーザがアップダウンボタンを選択して、入力するように構成されている。また、ユーザが設定した種々の内容を確定するための「OK」ボタンB1等、種々のボタンが設けられている。 FIG. 3 is an explanatory diagram showing the image processing screen W. The image processing screen W is provided with an enlargement ratio input field cl1, a sharpness input field cl2, a contrast input field cl3, and a brightness input field cl4. These input fields are configured such that the user selects and inputs an up / down button. Further, various buttons such as an “OK” button B1 for confirming various contents set by the user are provided.
本実施例において、拡大率として、100%(拡大しない)、200%、400%、600%、800%を選択できる。シャープネスは、−20%、−10%、0%(標準)、+10%、+20%を選択できる。0%を標準として、マイナスにすると画像を平滑化、プラスにすると画像をシャープにすることを意味する。コントラスト、明るさについても、同様に、−20%、−10%、0%(標準)、+10%、+20%を選択できる。なお、シャープネス等の表示は、%表示に限られず、例えば、シャープネスの場合に、NO(標準)、Low(少しシャープに)、High(シャープに)というような表示にしてもよい。 In the present embodiment, 100% (not enlarged), 200%, 400%, 600%, and 800% can be selected as the enlargement ratio. Sharpness can be selected from -20%, -10%, 0% (standard), + 10%, and + 20%. With 0% as the standard, a negative value means smoothing the image, and a positive value means sharpening the image. Similarly, the contrast and brightness can be selected from -20%, -10%, 0% (standard), + 10%, and + 20%. The display of sharpness or the like is not limited to% display. For example, in the case of sharpness, a display such as NO (standard), Low (slightly sharp), or High (sharp) may be used.
ユーザが、画像処理画面Wにおいて、拡大、シャープネス、コントラスト、明るさの各値を入力して、ボタンB1を選択すると、アプリケーションは、入力された情報を取得して、拡大率情報、シャープネス情報、コントラスト情報、明るさ情報として、内部メモリ120に記憶して、画像処理画面Wを閉じる。
When the user inputs each value of enlargement, sharpness, contrast, and brightness on the image processing screen W and selects the button B1, the application acquires the input information, and enlargement rate information, sharpness information, The contrast information and the brightness information are stored in the
補間関数導出部166は、先鋭度LUT122を参照して、内部メモリ120に記憶されたシャープネス情報に基づいて、上記したB、Cの値を求める(図2:ステップS102)。続いて、補間関数導出部166は、コントラストLUT124を参照して、コントラスト情報に基づいて、α、βを求める(ステップS104)。そして、補間関数導出部166は、明度LUT126を参照して、明度情報に基づいて、vを求める(ステップS106)。補間関数導出部166は、B、C、α、β、vそれぞれの値を用いて、上記したa1、b1、c1、d1、v1を求める(ステップS108)。
The interpolation
画像データ取得部162は、外部メモリインタフェース140を介してリムーバブルメモリ300に記憶されている画像データを取得して、内部メモリ120に格納する(ステップS110)。3次補間処理部164は、内部メモリ120に格納された画像データの各画素を参照して、内部メモリ120に記憶されている拡大率情報に基づいて、導出された3次補間補間関数、およびv1を用いて、各補間画素の濃度を求める(ステップS111)。画像データ出力部168は、補間画素を含む出力用画像データを生成して、ディスプレイ150に表示させる(ステップS112)。
The image
本実施例におけるステップS102〜108が、請求項における工程(b)、ステップS110が、請求項における工程(a)、ステップS111、112が、請求項における工程(c)に、それぞれ相当する。 Steps S102 to S108 in this embodiment correspond to step (b) in the claims, step S110 corresponds to step (a) in the claims, and steps S111 and 112 correspond to step (c) in the claims.
A4.実施例の効果:
上記したように、本実施例のコンピュータ100によれば、画像を拡大する際に、シャープネス、コントラスト、明るさも同時に調整することができる。したがって、これらの調整を行なって画像データを生成する際の、メモリへのアクセス量を減らして、処理を高速化することができる。例えば、拡大・縮小等のプレビュー画像を表示させる場合に、表示させるまでの時間を短縮することができるようになる。
A4. Effects of the embodiment:
As described above, according to the
B.変形例
なお、本発明は上記した実施例に限られるものではなく、その要旨を逸脱しない範囲において種々の態様にて実施することが可能である。
B. Modifications The present invention is not limited to the above-described embodiments, and can be implemented in various modes without departing from the scope of the invention.
(1)上記した実施例において、補間関数導出部166が、ユーザが入力した先鋭度等に基づいて、各LUTを参照して、B,C,α,β,vを求めて、その値に基づいて、3次補間関数を導出するものを示したが、例えば、予め、ユーザが入力する先鋭度等の組み合わせに対応する、3次補間関数の係数が記載されたLUTを用意して、そのLUTを参照して求めるようにしてもよい。このようにすることによって、さらに、処理を高速化することができるようになる。
(1) In the above-described embodiment, the interpolation
(2)上記した実施例においては、画像処理装置として、コンピュータ100を示しているが、プリンタ、デジタルカメラ、フォトストレージ等、画像の大きさ、解像度、先鋭度、コントラスト、明度等を変更することが可能な画像処理装置であればよい。
(2) In the above-described embodiments, the
(3)上記した実施例においては、画像を拡大する場合を例示したが、画像を縮小する場合、解像度を変更する場合等に、同時に、先鋭度、コントラスト、明度を調整するようにしてもよい。また、全てを同時に調整するのではなく、画像の大きさまたは解像度を変更する際に、コントラストおよび明度のいずれか一方を調整できるようにしてもよい。このようにしても、各処理を別々に行う場合に比べて、処理速度を早くすることができる。 (3) In the above-described embodiments, the case of enlarging the image has been illustrated. However, when the image is reduced, the resolution is changed, etc., the sharpness, contrast, and brightness may be adjusted at the same time. . Further, instead of adjusting all of them at the same time, either the contrast or the brightness may be adjusted when changing the size or resolution of the image. Even if it does in this way, processing speed can be made faster compared with the case where each processing is performed separately.
100…コンピュータ
110…CPU
120…内部メモリ
130…周辺機器インタフェース
140…外部メモリインタフェース
150…ディスプレイ
160…画像処理部
162…画像データ取得部
166…補間関数導出部
168…画像データ出力部
170…バス
200…スキャナ
300…リムーバブルメモリ
122…先鋭度LUT
124…コントラストLUT
126…明度LUT
W…画像処理画面
B1…ボタン
cl1…拡大率入力欄
cl2…シャープネス入力欄
cl3…コントラスト入力欄
cl4…明るさ入力欄
100 ... Computer 110 ... CPU
DESCRIPTION OF
124 ... Contrast LUT
126 ... Lightness LUT
W ... Image processing screen B1 ... Button cl1 ... Enlargement rate input field cl2 ... Sharpness input field cl3 ... Contrast input field cl4 ... Brightness input field
Claims (5)
画像を示す第1の画像データを取得する画像データ取得部と、
前記第1の画像データに対して3次補間処理を行うときに用いる3次補間関数を導出する3次補間関数導出部と、
前記画像の大きさおよび解像度のうち、少なくとも一方を変更するために、前記第1の画像データに対して、導出された前記3次補間関数を用いて、前記3次補間処理を行なって第2の画像データを生成して出力する画像データ生成部と、
を備え、
前記3次補間関数の係数は、前記画像のコントラストを調整する際の入出力特性を示す調整関数が有する係数の関数として表されることを特徴とする画像処理装置。 An image processing apparatus,
An image data acquisition unit for acquiring first image data indicating an image;
A cubic interpolation function derivation unit for deriving a cubic interpolation function to be used when performing cubic interpolation processing on the first image data;
In order to change at least one of the size and resolution of the image, a second interpolation process is performed on the first image data using the derived third-order interpolation function to perform a second interpolation process. An image data generation unit for generating and outputting the image data;
With
The image processing apparatus, wherein the coefficient of the cubic interpolation function is expressed as a function of a coefficient included in an adjustment function indicating input / output characteristics when adjusting the contrast of the image.
前記3次補間処理は、
前記第1の画像データに対して前記3次補間関数を乗じて得られる結果に、前記画像の明るさを調整する際の入出力特性を示す調整関数の定数を加算する処理であることを特徴とする画像処理装置。 The image processing apparatus according to claim 1,
The cubic interpolation process is:
It is a process of adding a constant of an adjustment function indicating an input / output characteristic when adjusting the brightness of the image to a result obtained by multiplying the first image data by the cubic interpolation function. An image processing apparatus.
前記3次補間関数導出部は、
前記第2の画像データが所定の先鋭度を示すように、前記3次補間関数を導出することを特徴とする画像処理装置。 The image processing apparatus according to claim 1, wherein:
The cubic interpolation function deriving unit
An image processing apparatus, wherein the cubic interpolation function is derived so that the second image data shows a predetermined sharpness.
(a)前記第1の画像データを取得する工程と、
(b)前記3次補間処理を行うための3次補間関数を導出する工程と、
(c)前記工程(b)において導出された前記3次補間関数を用いて、前記工程(a)において取得された前記第1の画像データに対して、前記3次補間処理を行なって前記第2の画像データを生成して出力する工程と、
を備え、
前記3次補間関数の係数は、前記画像のコントラストを調整する際の入出力特性を示す調整関数が有する係数の関数として表されることを特徴とする画像データ生成方法。 An image data generation method for generating second image data by performing cubic interpolation processing on first image data representing an image in order to change at least one of the size and resolution of the image. And
(A) obtaining the first image data;
(B) deriving a cubic interpolation function for performing the cubic interpolation process;
(C) Using the cubic interpolation function derived in the step (b), the cubic interpolation processing is performed on the first image data acquired in the step (a) to perform the first interpolation. Generating and outputting the image data of 2; and
With
The method of generating image data, wherein the coefficient of the cubic interpolation function is expressed as a function of a coefficient included in an adjustment function indicating input / output characteristics when adjusting the contrast of the image.
前記第1の画像データを取得する機能と、
前記3次補間処理を行うための3次補間関数の係数が、前記画像のコントラストを調整する際の入出力特性を示す調整関数が有する係数の関数として表される、前記3次補間関数を導出する機能と、
導出された前記3次補間関数を用いて、取得された前記第1の画像データに対して、3次補間処理を行なって、前記第2の画像データを生成して出力する機能と、
を、コンピュータに実現させることを特徴とするコンピュータプログラム。 A computer program for generating a second image data by performing a cubic interpolation process on the first image data representing an image in order to change at least one of the size and resolution of the image. And
A function of acquiring the first image data;
Deriving the cubic interpolation function, wherein the coefficient of the cubic interpolation function for performing the cubic interpolation process is expressed as a function of a coefficient of an adjustment function indicating input / output characteristics when adjusting the contrast of the image. Function to
A function of performing a third-order interpolation process on the acquired first image data using the derived third-order interpolation function to generate and output the second image data;
A computer program for causing a computer to realize the above.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007204637A JP2009044258A (en) | 2007-08-06 | 2007-08-06 | Image processing apparatus, image data generation method, and computer program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007204637A JP2009044258A (en) | 2007-08-06 | 2007-08-06 | Image processing apparatus, image data generation method, and computer program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2009044258A true JP2009044258A (en) | 2009-02-26 |
Family
ID=40444554
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2007204637A Pending JP2009044258A (en) | 2007-08-06 | 2007-08-06 | Image processing apparatus, image data generation method, and computer program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2009044258A (en) |
-
2007
- 2007-08-06 JP JP2007204637A patent/JP2009044258A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN100397420C (en) | Image processing device and image processing method and its program | |
JP2008033692A (en) | Image processing device and its control method, and, computer program and computer readable storage medium | |
Trentacoste et al. | Blur‐aware image downsampling | |
JP2007200170A (en) | Image processing apparatus and image processing program | |
TWI297485B (en) | Image processing device, and computer-readable recording medium | |
JP5388559B2 (en) | Image processing apparatus, image processing method, program for executing image processing method, and storage medium | |
JP6241192B2 (en) | Image processing apparatus, image processing system, image processing method, program, and recording medium | |
JP2004012633A (en) | List display of multiple images | |
US7809199B2 (en) | Image processing apparatus | |
US20090161174A1 (en) | Image processing device, image processing method, and computer program product | |
JP2009044258A (en) | Image processing apparatus, image data generation method, and computer program | |
JP4400760B2 (en) | Image data interpolation apparatus, image data printing apparatus, image data interpolation method, and medium on which image data interpolation program is recorded | |
JP2829931B2 (en) | Image processing device | |
JP2011175309A (en) | Image processing apparatus and program | |
JP3478498B2 (en) | Object pixel determination device, object pixel determination method, medium recording object pixel determination program, and object pixel determination program | |
JP4171902B2 (en) | Object pixel extraction device, object pixel extraction method, medium on which object pixel extraction program is recorded, and object pixel extraction program | |
JP2015085563A (en) | Information processing device, information processing method, and program | |
US8537413B2 (en) | Image processing apparatus, image processing method, and computer-readable storage medium | |
JP6260144B2 (en) | Image processing apparatus and computer program | |
JP5277651B2 (en) | Image processing apparatus, image processing method, and computer program | |
US11334298B2 (en) | Image layout size calculation apparatus, image layout size calculation method, image layout size calculation program, and recording medium storing the program | |
Savagave et al. | Study of image interpolation | |
JP5142949B2 (en) | Image processing apparatus and image processing method | |
JP4862747B2 (en) | Data interpolation method and image scaling method Image processing apparatus | |
JP2011130087A (en) | Image processing apparatus and image processing method |