JP2006050480A - Image processing apparatus, image processing method and program thereof - Google Patents
Image processing apparatus, image processing method and program thereof Download PDFInfo
- Publication number
- JP2006050480A JP2006050480A JP2004232135A JP2004232135A JP2006050480A JP 2006050480 A JP2006050480 A JP 2006050480A JP 2004232135 A JP2004232135 A JP 2004232135A JP 2004232135 A JP2004232135 A JP 2004232135A JP 2006050480 A JP2006050480 A JP 2006050480A
- Authority
- JP
- Japan
- Prior art keywords
- image
- pixel
- feature amount
- region
- edge
- 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 85
- 238000003672 processing method Methods 0.000 title claims description 10
- 230000002950 deficient Effects 0.000 abstract 1
- 238000000034 method Methods 0.000 description 52
- 238000010586 diagram Methods 0.000 description 14
- 230000002093 peripheral effect Effects 0.000 description 8
- 238000006243 chemical reaction Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 230000007547 defect Effects 0.000 description 2
- 230000006866 deterioration Effects 0.000 description 2
- 238000009499 grossing Methods 0.000 description 2
- 238000013507 mapping Methods 0.000 description 2
- 230000015556 catabolic process Effects 0.000 description 1
- 238000006731 degradation reaction Methods 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
- 238000010187 selection method Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/40—Scaling of whole images or parts thereof, e.g. expanding or contracting
- G06T3/403—Edge-driven scaling; Edge-based scaling
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Editing Of Facsimile Originals (AREA)
- Record Information Processing For Printing (AREA)
- Image Processing (AREA)
Abstract
Description
本発明は、画像を拡大する画像処理装置に関する。 The present invention relates to an image processing apparatus that enlarges an image.
例えば、特許文献1は、注目画素の周辺の画素値の分布状態を評価し、その評価結果に応じて代表値を決定し、決定された代表値を注目画素に対応する(N×M)画素のブロック内に配置することにより、画像を拡大する画像処理装置を開示する。
また、特許文献2は、原画像を2値化して、この2値化画像と2次元パターンとを照合することにより斜め成分の方向を判定し、判定された斜め成分の方向をもとに補間処理を行う画素数変換装置を開示する。
また、特許文献3は、補正対象のパターン毎、かつ、倍率毎に拡大画素のドット配置情報を有し、パターンマッチング結果及び倍率から1つのドット配置情報を抽出する画像処理装置を開示する。
また、特許文献4は、原画素が属するエッジ領域の傾斜方向を原画素及び補間画素にマッピングし、マッピングされた傾斜方向に対応するフィルタ処理を原画素及び補間画素に対して実行する画像処理装置を開示する。
Further,
本発明は、上述した背景からなされたものであり、画像を高画質に拡大する画像処理装置を提供することを目的とする。 The present invention has been made from the above-described background, and an object thereof is to provide an image processing apparatus that enlarges an image with high image quality.
[画像処理装置]
上記目的を達成するために、本発明にかかる画像処理装置は、入力画像の拡大処理を行う画像処理装置であって、入力画像における既定の大きさの画像領域について、階調変化に関する特徴量を算出する領域特徴量算出手段と、前記領域特徴量算出手段によりそれぞれの画像領域について算出された特徴量に基づいて、パラメータを生成するパラメータ生成手段と、処理対象画素が含まれる画像領域内の画素値と、前記パラメータ生成手段によりこの画像領域について生成されたパラメータとを用いて、この処理対象画素に対応する拡大画像データを生成する拡大画像生成手段とを有する。
[Image processing device]
In order to achieve the above object, an image processing apparatus according to the present invention is an image processing apparatus that performs an enlargement process of an input image, and has a feature amount related to a gradation change for an image area of a predetermined size in the input image. Area feature amount calculating means for calculating, parameter generation means for generating parameters based on the feature amounts calculated for the respective image regions by the area feature amount calculating means, and pixels in the image area including the processing target pixel Enlarged image generating means for generating enlarged image data corresponding to the processing target pixel using the value and the parameter generated for the image region by the parameter generating means.
好適には、前記領域特徴量算出手段は、前記画像領域における階調変化量を前記特徴量として算出する。 Preferably, the area feature amount calculating means calculates a gradation change amount in the image area as the feature amount.
好適には、前記領域特徴量算出手段は、前記画像領域における階調変化の方向を前記特徴量として算出し、前記パラメータ生成手段は、前記領域特徴量算出手段により算出された階調変化の方向に応じて画像領域内から参照画素を選択し、少なくとも、選択された参照画素の画素値を前記パラメータとする。 Preferably, the region feature amount calculating unit calculates a direction of gradation change in the image region as the feature amount, and the parameter generation unit calculates the direction of gradation change calculated by the region feature amount calculating unit. A reference pixel is selected from the image area in accordance with the above, and at least the pixel value of the selected reference pixel is set as the parameter.
好適には、前記領域特徴量算出手段は、予め用意された複数のエッジパターンのうち、それぞれの画像領域における階調変化に対応するエッジパターンを前記特徴量として選択し、前記パラメータ生成手段は、前記領域特徴量算出手段により選択されたエッジパターンに対応する演算式を用いて、前記パラメータを算出する。 Preferably, the region feature amount calculating unit selects an edge pattern corresponding to a gradation change in each image region from among a plurality of edge patterns prepared in advance as the feature amount, and the parameter generation unit includes: The parameter is calculated using an arithmetic expression corresponding to the edge pattern selected by the region feature amount calculating means.
好適には、前記領域特徴量算出手段は、色空間におけるそれぞれの色成分毎に前記特徴量を算出し、算出された1つ以上の特徴量に基づいていずれか1つの色成分を選択し、選択された色成分の特徴量を前記画像領域の特徴量とする。 Preferably, the area feature value calculating means calculates the feature value for each color component in a color space, selects any one color component based on the calculated one or more feature values, The feature amount of the selected color component is set as the feature amount of the image area.
好適には、前記領域特徴量算出手段は、それぞれの色成分について、前記画像領域における階調変化量を算出し、算出された階調変化量が最大である色成分を選択する。 Preferably, the area feature amount calculating unit calculates a gradation change amount in the image area for each color component, and selects a color component having the maximum calculated gradation change amount.
好適には、前記パラメータ生成手段は、前記領域特徴量算出手段により算出された特徴量に対応する既定の演算式を用いてパラメータを生成する。 Preferably, the parameter generation unit generates a parameter using a predetermined arithmetic expression corresponding to the feature amount calculated by the region feature amount calculation unit.
好適には、前記パラメータ生成手段は、拡大率に応じてカーネル要素及びカーネル要素間距離が異なるエッジ強調カーネルを用いて、入力画像の画素値を補正し、補正された画素値を用いてパラメータを生成する。 Preferably, the parameter generation means corrects the pixel value of the input image using an edge enhancement kernel having a kernel element and a distance between kernel elements different depending on the enlargement ratio, and uses the corrected pixel value to set the parameter. Generate.
好適には、前記拡大画像生成手段は、処理対象画素を含む複数の画像領域の画素値と、前記パラメータ生成手段によりこれらの画像領域について生成されたパラメータとを用いて、この処理対象画素に対応する拡大画像データをそれぞれ生成する。 Preferably, the enlarged image generating unit uses the pixel values of a plurality of image regions including the processing target pixel and the parameters generated for the image region by the parameter generating unit to correspond to the processing target pixel. Each of the enlarged image data to be generated is generated.
好適には、前記拡大画像生成手段は、前記パラメータ生成手段により生成されたパラメータと、処理対象画素が含まれる画像領域中の画素値とを重み付け加算して拡大画像データを生成する。 Preferably, the enlarged image generation unit generates enlarged image data by weighted addition of the parameter generated by the parameter generation unit and the pixel value in the image area including the processing target pixel.
[画像処理方法]
また、本発明にかかる画像処理方法は、入力画像の拡大処理を行う画像処理方法であって、入力画像における既定の大きさの画像領域について、階調変化に関する特徴量を算出し、それぞれの画像領域について算出された特徴量に基づいて、パラメータを生成し、処理対象画素が含まれる画像領域内の画素値と、この画像領域について生成されたパラメータとを用いて、この処理対象画素に対応する拡大画像データを生成する。
[Image processing method]
An image processing method according to the present invention is an image processing method for performing an enlargement process of an input image, and calculates a feature amount related to a gradation change for an image area of a predetermined size in the input image, and each image A parameter is generated based on the feature amount calculated for the region, and the pixel value in the image region including the processing target pixel and the parameter generated for the image region are used to correspond to the processing target pixel. Enlarged image data is generated.
[プログラム]
また、本発明にかかるプログラムは、入力画像の拡大処理を行う画像処理装置において、入力画像における既定の大きさの画像領域について、階調変化に関する特徴量を算出するステップと、それぞれの画像領域について算出された特徴量に基づいて、パラメータを生成するステップと、処理対象画素が含まれる画像領域内の画素値と、この画像領域について生成されたパラメータとを用いて、この処理対象画素に対応する拡大画像データを生成するステップとを前記画像処理装置に実行させる。
[program]
The program according to the present invention includes a step of calculating a feature amount related to a gradation change for an image area of a predetermined size in an input image in an image processing apparatus that performs an enlargement process of the input image, and for each image area Based on the calculated feature amount, a parameter is generated, a pixel value in an image area including the processing target pixel, and a parameter generated for the image area are used to correspond to the processing target pixel. Causing the image processing apparatus to execute a step of generating enlarged image data.
本発明の画像処理装置によれば、比較的軽い処理負荷で、高画質な拡大画像を得ることができる。 According to the image processing apparatus of the present invention, a high-quality enlarged image can be obtained with a relatively light processing load.
まず、本発明の理解を助けるために、その背景及び概略を説明する。
画像の拡大処理は、画像の編集、ファイリング、表示、又は印刷などを行うシステムにおいて基本的な処理の一つである。また近年、インターネット上のホームページに表示される画像やデジタルビデオなどのように、ディスプレイ解像度での表示を主目的とした画像データが普及しており、これらの低解像度画像を高解像度のプリンタなどで印刷することも頻繁に行われている。このプリンタによる印刷の際に、高画質の出力結果を得るためには高画質の拡大処理が必要とされる。
First, in order to help understanding of the present invention, its background and outline will be described.
The image enlargement process is one of basic processes in a system that performs image editing, filing, display, printing, or the like. In recent years, image data mainly intended for display at display resolution, such as images displayed on homepages on the Internet and digital video, has become widespread. These low-resolution images can be used with high-resolution printers, etc. Printing is also frequently done. In order to obtain a high-quality output result during printing by this printer, high-quality enlargement processing is required.
多階調で表現されたカラー画像(以下、多値画像)を拡大処理する手法としては、例えば、最近傍法、線形補間法、キュービック・コンボリューション法などがある。
最近傍法は、拡大後の各画素値として、その画素を原画像上に逆写像した際に最も距離が近い画素の画素値を適用するという方法である。この方法は、演算量が少ないため高速に拡大処理することができる。しかし、原画像の1画素がそのまま矩形形状に拡大されるため、隣り合う画素の画素値の差が小さい場合は画質劣化の程度は小さくほとんど影響はないが、画素値の差が大きい場合などは、斜線部やエッジ部のジャギーが目立ったり、拡大倍率が大きい場合には画像がモザイク状になるなど、画質劣化の程度は大きい。
Examples of a technique for enlarging a color image (hereinafter referred to as a multi-valued image) expressed in multiple gradations include a nearest neighbor method, a linear interpolation method, and a cubic convolution method.
The nearest neighbor method is a method of applying the pixel value of the pixel having the closest distance when the pixel is inversely mapped onto the original image as each pixel value after enlargement. Since this method requires a small amount of computation, it can be enlarged at high speed. However, since one pixel of the original image is directly expanded into a rectangular shape, if the difference in pixel values between adjacent pixels is small, the degree of image quality degradation is small and has little effect, but if the difference in pixel values is large, etc. The degree of image quality deterioration is large, for example, jaggy in the shaded area or the edge part is conspicuous, or when the enlargement magnification is large, the image becomes mosaic.
また、線形補間法は、画素間の画素値が直線的に変化していると仮定し、拡大後の画素を逆写像した点の近傍4画素の画素値を線形に補間して画素値を求めるという方法である。この方法では、最近傍法よりも処理は重いものの演算量は比較的少なく、ジャギーなども発生しにくい。その一方で、直線的に変化しているという仮定に当てはまらないエッジ部分を中心に、画像全体がボケ気味になるという欠点がある。 Further, the linear interpolation method assumes that the pixel value between pixels changes linearly, and linearly interpolates the pixel values of four pixels in the vicinity of the point obtained by inversely mapping the enlarged pixel to obtain the pixel value. It is a method. Although this method is heavier than the nearest neighbor method, the amount of calculation is relatively small, and jaggies are less likely to occur. On the other hand, there is a drawback that the entire image becomes blurred, centering on the edge portion that does not apply to the assumption that it changes linearly.
キュービック・コンボリューション法は、標本化定理に基づいてsinc関数(sin(x)/x)を近似した補間関数を定義し、この近似補間関数と拡大後の画素を逆写像した点の近傍16画素(X、Y方向それぞれ4画素)との畳み込み演算により、拡大後の画素値を求める方法である。この方法は、上記2つの手法に比べて画質は比較的良いが、参照範囲が大きく演算量が多いという欠点がある。また、高域が強調気味となる特性を持つため、エッジ部分で軽いジャギーが発生したりノイズ成分が強調されてしまうなどの欠点もある。 The cubic convolution method defines an interpolation function that approximates a sinc function (sin (x) / x) based on the sampling theorem, and 16 pixels in the vicinity of a point obtained by inversely mapping the approximated interpolation function and the enlarged pixel. This is a method for obtaining a pixel value after enlargement by convolution with (4 pixels in each of the X and Y directions). This method has relatively good image quality compared to the above two methods, but has a drawback that the reference range is large and the amount of calculation is large. In addition, since the high frequency band is emphasized, there are disadvantages such as light jaggies occurring at the edge and noise components being emphasized.
これらの問題を解決する試みとして、例えば、特許文献1、特許文献2、特許文献3及び特許文献4などの手法が提案されている。
特許文献1に記載されている手法では、注目画素の周囲N×M領域(例えば3×3)の画素から最大値及び最小値を検出し、さらにコントラスト及び中間値を算出し、このコントラストにより最大値又は最小値のいずれかとそれ以外の値の平均値とを代表値として導出する。次に注目画素をN×M画素に線形補間処理し、先に算出した中間値を閾値として2値化し、上記2つの代表値を2値化の結果に応じて配置する。コントラストが小さい場合は線形補間処理の画素値をそのまま用いることにより最終的に拡大画像を得るものである。これによりジャギーが発生せず、自然画像でも補間ボケが生じない良好な変換が可能であるが、コントラストのみでエッジ部を判断しており、エッジの方向再現が難しいという問題がある。またN×M領域を2つの値のみで構成するため、エッジ部にブロック状の歪みが生じるという問題がある。
As an attempt to solve these problems, for example, methods such as
In the method described in
また、特許文献2に記載されている手法では、まず原画像を2値化し、その2値画像から原画像に含まれる斜め成分の方向を予め用意した2次元パターン(行列データ)と一致判定することにより求め、求められた斜め方向に沿って補間処理をする。またそれ以外の部分は線形補間処理を行っている。しかし、原画像を予め定められた閾値により2値化してから斜め成分の方向判定を行っているので、濃度差の大きいエッジに対しては有効であるが、濃度差の小さいエッジの再現には問題がある。
In the method described in
また、特許文献3に記載されている手法では、パターンファイルに1対1に対応した整数倍率毎のドット配置ファイル(拡大パターンファイル)と画素ブロックのどの位置の画素値でドット配置ファイルの画素値を決定するかという画素参照情報とにより拡大画像ブロックを生成する。さらに一致パターンがないときは単純に原画像ブロックの注目画素で拡大画像ブロックを生成する。しかし、特許文献3では、パターンマッチングのみで一意に拡大ブロックを生成しているため、パターンファイル及びドット配置ファイルの数により拡大画像の画質が決まる。つまり、画質向上には予め多くのパターンファイルが必要である。しかしながら、多くのパターンファイルを予め用意しておくのは現実的ではない。
Further, in the method described in
また、特許文献4に記載されている手法では、原画像を線形補間処理で拡大し、それと並行して、原画像において注目画素を含む周囲N×M領域毎に2値化し、予め設定された斜線検出パターンと一致判定を行い、注目画素がエッジ領域に属する(斜線検出パターンと一致する)場合には、その方向情報を注目画素にマッピングする。さらに、この方向情報を先に線形補間処理で拡大した拡大画像にマッピングし、マッピングされた方向情報の方向に沿った平滑化フィルタを施すことにより、ジャギーの発生を抑えた拡大処理を行っている。しかし、特許文献4では、原画像の拡大、パターンマッチング、方向情報の拡大、拡大処理画像に対する方向依存平滑化フィルタ処理という流れであり、画像サイズが大きくなると処理負荷が非常に大きくなるという問題がある。
Further, in the method described in
そこで、本実施形態における画像処理装置2は、注目画素を含む既定の大きさの画像領域の特徴量を算出し、算出された特徴量に基づいて、注目画素を含む画像領域の拡大パラメータを算出し、算出された拡大パラメータと入力画像データの画素値とを用いて拡大画素値を生成する。これにより、入力画像中の特徴的な部分の特徴量を保存する画像拡大処理を実現でき、特徴的部分のボケ及びジャギーの画質欠陥を抑制した高画質な拡大画像を高速に得ることができる。
Therefore, the
[ハードウェア構成]
次に、画像処理装置2のハードウェア構成を説明する。
図1は、本発明にかかる画像処理方法が適応される画像処理装置2のハードウェア構成を、制御装置20を中心に例示する図である。
図1に例示するように、画像処理装置2は、CPU202及びメモリ204などを含む制御装置20、通信装置22、HDD・CD装置などの記録装置24、並びに、LCD表示装置あるいはCRT表示装置及びキーボード・タッチパネルなどを含むユーザインターフェース装置(UI装置)26から構成される。
画像処理装置2は、例えば、画像拡大プログラム5(後述)がインストールされた汎用コンピュータであり、通信装置22又は記録装置24などを介して画像データを取得し、取得された画像データを出力解像度に応じて拡大する。例えば、画像処理装置2は、プリンタ装置10に対して画像データを出力する場合には、600dpi又は2400dpiなどの解像度に変換し、UI装置26に対して画像データを出力する場合には、75dpiなどの解像度に変換する。
[Hardware configuration]
Next, the hardware configuration of the
FIG. 1 is a diagram illustrating a hardware configuration of an
As illustrated in FIG. 1, the
The
[画像拡大プログラム]
図2は、制御装置20(図1)により実行され、本発明にかかる画像処理方法を実現する画像拡大プログラム5の機能構成を例示する図である。
図2に例示するように、画像拡大プログラム5は、記憶部500、画像ブロック設定部510、画像ブロック特徴量算出部520、拡大パラメータ算出部530及び拡大画素生成部540を有する。
なお、画像拡大プログラム5の全部又は一部をASICなどのハードウェアで実現してもよい。
[Image enlargement program]
FIG. 2 is a diagram illustrating a functional configuration of the
As illustrated in FIG. 2, the
Note that all or part of the
画像拡大プログラム5において、記憶部500は、画像データが他の機能構成により拡大処理されるまで一時的に記憶する機能、及び、解像度変換又は拡大処理された拡大画像データが出力されるまで一時的に記憶する機能などを備える。記憶部500に記憶される画像データは、画像処理装置2で処理可能な画像フォーマット(例えば、BMP、TIFF、PNGなど)で記述されたデータであり、パーソナルコンピュータ(不図示)等において編集等された画像データ等である。拡大された後の画像データ(拡大画像データ)も、同様の画像フォーマットのデータである。すなわち、記憶部500は、メモリ204(図1)及び記録装置24(図1)を制御して、入力された画像データを記憶し、画像ブロック設定部510、画像ブロック特徴量算出部520、拡大パラメータ算出部530及び拡大画素生成部540に対してワークエリアを提供する。
In the
画像ブロック設定部510は、画像ブロック特徴量算出部520及び拡大パラメータ算出部530における処理で必要とされる既定の画像ブロックサイズをそれぞれ設定し、記憶部500により記憶されている入力画像データから、設定されたブロックサイズの画像ブロックを順次(例えばラスタスキャン順に)切り出し、このブロックサイズの画像ブロックそれぞれを画像ブロック特徴量算出部520及び拡大パラメータ算出部530にそれぞれ出力する。
The image
画像ブロック特徴量算出部520は、画像ブロック設定部510から順次入力される画像ブロックの少なくとも一部(例えば中心部近傍の矩形部分)を注目領域とし、注目領域における画像特徴量を、注目領域又はこの注目領域の周辺部を含む画像ブロック内の各画素値に基づいて算出する。画像特徴量とは、例えば、注目領域のエッジ強度(階調変化量)又はエッジ角度(階調変化の方向)などである。しかしこれに限られるものではなく、画像ブロック特徴量算出部520は、例えば注目領域の各画素値の平均値を算出し、この平均値に対する注目領域の各画素値のばらつきを表す値(例えば標準偏差又は分散)を画像特徴量として算出してもよい。
The image block feature
拡大パラメータ算出部530は、画像ブロック特徴量算出部520から入力された各画像ブロックの画像特徴量に基づいて、拡大画素生成部540における拡大画素値算出処理に用いる複数の拡大パラメータを算出する。ここで、複数の拡大パラメータとは、画像ブロック設定部510から入力された画像ブロック内の複数の画素値及びこれらの画素値から画像ブロック特徴量算出部520で算出された画像特徴量に基づいて算出される値などである。
The enlargement
拡大画素生成部540は、入力画像データ中の拡大対象画素(注目画素)を含む画像ブロック中の画素値と、拡大パラメータ算出部530で算出された拡大パラメータ(注目画素を含む画像ブロックについて設定されたもの)とを用いて、注目画素に対応する拡大画素値(拡大画像データ)を算出する。拡大画像はこの拡大画素値により構成される。
The enlargement
[画像ブロック特徴量算出部の詳細説明]
次に、画像ブロック特徴量算出部520をより詳細に説明する。なお、注目領域が2×2画素サイズブロックであり、注目領域を含む周辺領域が4×4画素サイズブロックである場合を具体例として説明する。
本例の画像ブロック特徴量算出部520は、図2に示すように、エッジ強度算出部522、エッジ方向推定部524及びエッジパターン選択部526を含む。
[Detailed Description of Image Block Feature Quantity Calculation Unit]
Next, the image block feature
As shown in FIG. 2, the image block feature
エッジ強度算出部522は、画像ブロック設定部510で切り出された画像ブロック中の注目領域のエッジ強度Gを次の式(1)で算出する。
gx=(a+c−b−d)/2
gy=(a+b−c−d)/2
G=gx×gx+gy×gy・・・式(1)
上記式におけるa、b、c及びdは、図3に例示するように、注目領域にある各画素の画素値である。また、このように算出される「gx」は、主走査方向(図3の左右方向)の画素値の変化量を示し、「gy」は、副走査方向(図3の上下方向)の画素値の変化量を示す。
なお、エッジ強度は上記式(1)で算出されるものに限定されるわけでなく、以下の式(2)などで算出しても良い。
G=|gx|+|gy|・・・式(2)
すなわち、エッジ強度Gは、(gx)の絶対値と(gy)の絶対値との和として算出されてもよい。
The edge
gx = (a + c−b−d) / 2
gy = (a + b−c−d) / 2
G = gx × gx + gy × gy (1)
In the above formula, a, b, c, and d are pixel values of each pixel in the region of interest, as illustrated in FIG. Further, “gx” calculated in this way indicates the amount of change in the pixel value in the main scanning direction (left and right direction in FIG. 3), and “gy” indicates the pixel value in the sub scanning direction (up and down direction in FIG. 3). The amount of change is shown.
The edge strength is not limited to that calculated by the above formula (1), but may be calculated by the following formula (2).
G = | gx | + | gy | ... Formula (2)
That is, the edge strength G may be calculated as the sum of the absolute value of (gx) and the absolute value of (gy).
次に、エッジ方向推定部524について説明する。
図3(A)は、注目領域及び周辺領域を例示し、図3(B)は、この注目領域について推定されるエッジ方向を例示する図である。
図3(A)に例示するように、注目領域は2×2の矩形領域(主走査方向及び副走査方向にそれぞれ2つ)を有し、周辺領域は4×4の矩形領域(主走査方向及び副走査方向にそれぞれ4つ)を有する。各矩形はそれぞれ画素に相当し、矩形内の各数字はそれぞれの画素値を示している。すなわち、注目領域は、中心部近傍の画素{a,b,c,d}={15,104,86,203}である。以下、この図3(A)で例示する注目領域を具体例として、エッジ方向推定部524によるエッジ方向推定処理を説明する。
Next, the edge
FIG. 3A illustrates the attention area and the peripheral area, and FIG. 3B illustrates the edge direction estimated for the attention area.
As illustrated in FIG. 3A, the region of interest has a 2 × 2 rectangular region (two each in the main scanning direction and the sub-scanning direction), and the peripheral region is a 4 × 4 rectangular region (main scanning direction). And 4 each in the sub-scanning direction. Each rectangle corresponds to a pixel, and each number in the rectangle indicates a pixel value. That is, the attention area is the pixel {a, b, c, d} = {15, 104, 86, 203} near the center. Hereinafter, the edge direction estimation processing by the edge
図4は、エッジ方向推定部524によるエッジ方向推定処理(S10)のフローチャートである。
図5は、S110において選択される参照領域を例示する図である。なお、図5におけるハッチングされた部分は、図3に示した注目領域に相当する。
FIG. 4 is a flowchart of the edge direction estimation process (S10) by the edge
FIG. 5 is a diagram illustrating a reference region selected in S110. The hatched portion in FIG. 5 corresponds to the attention area shown in FIG.
図4に示すように、ステップ100(S100)において、エッジ方向推定部524は、図3(A)に例示した注目領域のエッジ角度Θを、次の式(3)で計算する。
Θ=arctan(gy/gx)・・・式(3)
図3(A)では、注目領域の画素値は、{a,b,c,d}={15,104,86,203}であり、式(1)より、
gx=−103
gy=−85
となり、これらを式(3)に代入することにより、
Θ=−140.5°
となる。
このエッジ角度Θの方向は、図3(B)に示された破線方向に相当する。
As shown in FIG. 4, in step 100 (S100), the edge
Θ = arctan (gy / gx) (3)
In FIG. 3 (A), the pixel value of the attention area is {a, b, c, d} = {15, 104, 86, 203}.
gx = −103
gy = −85
By substituting these into equation (3),
Θ = -140.5 °
It becomes.
The direction of the edge angle Θ corresponds to the broken line direction shown in FIG.
さらに、エッジ方向推定部524は、算出されたエッジ角度Θが22.5°ごとに区分された方向(8方向)の角度範囲のいずれに含まれるかを判定する。本例では、エッジ角度Θが0°又は±180°を中心とした角度範囲を「方向0」とし、22.5°又は−157.5°を中心とした角度範囲を「方向1」とし、45°又は−135°を中心とした角度範囲を「方向2」とし、67.5°又は−112.5°を中心とした角度範囲を「方向3」とし、90°又は−90°を中心とした角度範囲を「方向4」とし、112.5°又は−67.5°を中心とした角度範囲を「方向5」とし、135°又は−45°を中心とした角度範囲を「方向6」とし、157.5°又は−22.5°を中心とした角度範囲を「方向7」する。これらの角度範囲は、それぞれの中心から±11.25°の範囲である。上述の具体例におけるエッジ角度Θ(=−140.5°)は、−135°±11.25°の範囲内に含まれるので、エッジ角度は「方向2」となる。
Further, the edge
ステップ110(S110)において、エッジ方向推定部524は、算出された注目領域のエッジ角度Θに応じて、図3(A)に示した周辺領域(太線枠外の領域)の中からエッジ方向の推定に用いる参照領域を選択する。より具体的には、エッジ方向推定部524は、算出されたエッジ角度Θの方向で注目領域と隣接する可能性のある画素を含むように、参照領域を選択する。
例えば、エッジ方向推定部524は、注目領域について算出されたエッジ角度が「方向0」に含まれる場合に、図5(A)に例示する参照領域(太線で囲まれた2つの領域)を選択し、算出されたエッジ角度が「方向4」に含まれる場合に、図5(B)に例示する参照領域(太線で囲まれた2つの領域)を選択し、算出されたエッジ角度が上記以外の方向(方向1〜3、方向5〜7)に含まれる場合に、図5(C)に例示する参照領域(太線で囲まれた4つの領域)を選択する。図3に示した具体例では、エッジ角度の方向は「方向2」であるので、図5(C)に示した4つの参照領域が選択の候補となる。
なお、参照領域は、図5に例示したものに限定されるわけではなく、例えば図5(C)の場合などは、参照領域数を8としたり、それぞれの方向に応じた参照領域を設定してもよい。
In step 110 (S110), the edge
For example, when the edge angle calculated for the attention area is included in “
The reference areas are not limited to those illustrated in FIG. 5. For example, in the case of FIG. 5C, the number of reference areas is set to 8, or the reference areas corresponding to the respective directions are set. May be.
ステップ120(S120)において、エッジ方向推定部524は、選択された参照領域それぞれに対して、S100と同様に、式(1)及び式(3)に従ってエッジ角度Θを計算する。
ステップ130(S130)において、エッジ方向推定部524は、それぞれの参照領域について算出されたエッジ角度と、注目領域について算出されたエッジ角度とを比較して、これらの差分が予め設定されている閾値Θthより小さいか否かを判断する。エッジ方向推定部524は、エッジ角度の差分が閾値Θthより小さい場合には、この参照領域のエッジ角度を適正なエッジ角度として判定してS140の処理に移行し、エッジ角度の差分が閾値Θth以上である場合には、この参照領域のエッジ角度を適正なエッジ角度ではないと判定してS150の処理に移行する。
In step 120 (S120), the edge
In step 130 (S130), the edge
ステップ140(S140)において、エッジ方向推定部524は、角度参照数をインクリメントする。すなわち、エッジ方向推定部524は、参照領域について算出されたエッジ角度が適正なエッジ角度であると判断された場合にのみ、角度参照数をインクリメントする。
なお、角度参照数は、エッジ角度の参照数をカウントするための変数であり、注目領域ごとに「角度参照数1」に初期化される。
In step 140 (S140), the edge
The angle reference number is a variable for counting the reference number of the edge angle, and is initialized to “
ステップ150(S150)において、エッジ方向推定部524は、選択した全ての参照領域についてエッジ角度を算出したか否かを判断し、全ての参照領域についてエッジ角度が算出された場合には、S160の処理に移行し、これ以外の場合には、S120の処理に戻って次の参照領域についてエッジ角度を算出する。
ステップ160(S160)において、エッジ方向推定部524は、注目領域のエッジ角度と、適正なエッジ角度として判定された参照領域のエッジ角度との総和を計算し、算出されたエッジ角度の総和を角度参照数で割った平均エッジ角度を注目領域の推定エッジ方向とする。
In step 150 (S150), the edge
In step 160 (S160), the edge
なお、図3に示した具体例では、上部の参照領域{86,203,171,211}からエッジ角度ΘU=−149.4°、左部の参照領域{10,15,20,86}からエッジ角度ΘL=−131.2°、下部の参照領域{1,102,15,104}からエッジ角度ΘD=−175.2°、右部の参照領域{104,215,203,219}からエッジ角度ΘR=−141.0°となる。注目領域のエッジ角度Θ=−140.5°とそれぞれの参照領域のエッジ角度が比較され、その差分が閾値Θthより小さい参照領域の数が角度参照数としてカウントされる。 In the specific example shown in FIG. 3, the edge angle ΘU = -149.4 ° from the upper reference area {86, 203, 171, 211}, and from the left reference area {10, 15, 20, 86}. Edge angle ΘL = −131.2 °, lower reference region {1, 102, 15, 104} to edge angle ΘD = −175.2 °, right reference region {104, 215, 203, 219} to edge The angle ΘR = −141.0 °. The edge angle Θ = −140.5 ° of the attention area is compared with the edge angle of each reference area, and the number of reference areas whose difference is smaller than the threshold Θth is counted as the angle reference number.
図6は、図3に示した注目領域における推定エッジ方向の一例の説明図である。例えば上述の具体例において、すべての参照領域について注目領域のエッジ角度との差分が閾値Θthより小さいとすれば、注目領域及び4つの参照領域から求められたエッジ角度の総和は−737.3°となり、角度参照数5で割ることによって平均エッジ角度は−147.5°と求めることができる。この場合も、エッジ方向推定部524は、上述の注目領域のエッジ方向と同様に、例えば8方向のいずれかに含まれるかを判定する。本例では、平均エッジ角度が−147.5°であるため「方向1」に含まれ、これが推定エッジ方向となる。
FIG. 6 is an explanatory diagram illustrating an example of the estimated edge direction in the attention area illustrated in FIG. 3. For example, in the above-described specific example, if the difference between the edge angle of the attention area for all the reference areas is smaller than the threshold Θth, the sum of the edge angles obtained from the attention area and the four reference areas is −737.3 °. By dividing by the
なお、本実施形態では、1画素につき1色要素であるグレースケール画像を具体例として説明しているが、これに限定されるわけではない。例えば、1画素につき3色要素のRGB色空間のカラー画像が入力される場合には、各々の色成分のデータにおけるエッジ強度Gr、Gg、Gbの強さにより選択された色空間データで上記のエッジ方向推定処理(S10)を行えばよい。より具体的には、画像ブロック特徴量算出部520は、それぞれの色成分についてエッジ強度を算出し、算出されたエッジ強度Gr、Gg、Gbが最大となる色成分を選択して、選択された色成分についてのみ特徴量を算出する。このようにすることで、カラー画像における拡大画像データのエッジ部の色ずれなど、画質低下を抑えることが可能となる。
また、本例では、注目領域及び参照領域について式(1)により算出されたエッジ角度は、8方向のいずれかに分類されたが、これに限定されるものではなく、より精度の高いエッジ方向が必要であれば12方向(15.0°ごと)、16方向(12.25°ごと)など、さらに多数の角度領域に分類してもよい。
In the present embodiment, a grayscale image that is one color element per pixel is described as a specific example, but the present invention is not limited to this. For example, when a color image in the RGB color space having three color elements per pixel is input, the color space data selected by the strengths of the edge strengths Gr, Gg, and Gb in each color component data is used as described above. The edge direction estimation process (S10) may be performed. More specifically, the image block feature
Further, in this example, the edge angle calculated by the expression (1) for the attention area and the reference area is classified into any one of the eight directions, but the present invention is not limited to this, and the edge direction with higher accuracy is used. May be classified into a larger number of angle regions such as 12 directions (every 15.0 °) and 16 directions (every 12.25 °).
次に、エッジパターン選択部526について説明する。
図7は、エッジパターン選択部526で用いるエッジパターンテーブルを例示する図である。
図7に例示するように、エッジパターン選択部526は、推定エッジ方向とエッジパターンとを互いに対応付けたエッジパターンテーブルを有する。エッジパターンテーブルには、注目領域のパターンサイズに対応するエッジパターンがそれぞれの推定エッジ方向(ここでは8方向)ごとに1つ以上のエッジパターンが登録されている。
エッジパターン選択部526は、このエッジパターンテーブルを参照して、エッジ方向推定部524によりそれぞれの注目領域について推定された推定エッジ方向に対応するエッジパターンを選択する。
本例では、図6に例示するように、注目領域に対する推定エッジ方向がエッジ方向推定部524によって「方向1」であると推定されているため、エッジパターン選択部526は、この推定エッジ方向(方向1)に従い、図7に示すエッジパターンテーブルの中から、方向1に対応する「パターン0」から「パターン3」までの4つのエッジパターンを選択し、これらをこの注目領域(図3)に対するエッジパターンの候補とする。
Next, the edge
FIG. 7 is a diagram illustrating an edge pattern table used in the edge
As illustrated in FIG. 7, the edge
The edge
In this example, as illustrated in FIG. 6, since the estimated edge direction with respect to the region of interest is estimated to be “
次に、エッジパターン選択部526は、注目領域の画素値に基づいて、エッジパターンの候補となった1つ以上のエッジパターンの中から、1つのエッジパターンを選択する。エッジパターンの具体的な選択方法について、図8を参照しながら説明する。
図8は、図3に示した注目領域に対応するエッジパターンの選択方法を説明する図である。
本例では、推定エッジ方向が「方向1」であったため、図8(A)に例示するように、エッジパターンの候補として、「パターン0」から「パターン3」までの4つのエッジパターンが選択されている。これらのエッジパターンは、図8(B)に例示するように、ビットパターンとして表現される。具体的には、白部分を0、それ以外を1としてビットパターン化し、「ビットパターン0」から「ビットパターン3」までのビットパターンが生成される。なお、これらのビットパターンは、図7に示すエッジパターンテーブルにビットテーブルとして予め登録されていてもよい。
Next, the edge
FIG. 8 is a diagram for explaining a method of selecting an edge pattern corresponding to the attention area shown in FIG.
In this example, since the estimated edge direction is “
エッジパターン選択部526は、注目領域に相当するビットパターンを判定する。具体的には、エッジパターン選択部526は、以下に示す式(4)に従い、注目領域中の平均画素値を計算し、注目領域内の各々の画素値から平均値を引き、その符号を以て注目領域の画素値パターンとする。
Mean=(a+b+c+d)/4
a_sign=a−Mean
b_sign=b−Mean
c_sign=c−Mean
d_sign=d−Mean・・・式(4)
なお、本例では、図8(C)に示すように、Mean=(15+104+86+203)/4=102であり、a_sign=−87、b_sign=2、c_sign=−16、d_sign=101となる。よって、エッジパターン選択部526は、これらの正負符号を判定して、図8(C)に示すように、注目領域のビットパターン(1010)を生成する。
そして、エッジパターン選択部526は、図8(B)に例示するエッジパターン候補に対応するビットパターンと、図8(C)に例示する注目領域のビットパターンとのパターンマッチングを行い、最も類似するエッジパターンを選択パターンとして決定する。選択されたエッジパターンは、後述する拡大パラメータ算出部530による注目領域における拡大パラメータの算出処理に適用される。
The edge
Mean = (a + b + c + d) / 4
a_sign = a-Mean
b_sign = b-Mean
c_sign = c-Mean
d_sign = d−Mean (4)
In this example, as shown in FIG. 8C, Mean = (15 + 104 + 86 + 203) / 4 = 102, a_sign = −87, b_sign = 2, c_sign = −16, and d_sign = 101. Therefore, the edge
The edge
なお、エッジパターンは、図7に示したものに限定されるわけではなく、例えば、エッジパターン選択部526は、入力画像データの種類に応じて、エッジパターンテーブルを切り替えて、異なるエッジパターンを適用してもよい。また、エッジパターン選択部526は、各角度におけるエッジパターン候補数を増減させてもよい。
Note that the edge patterns are not limited to those shown in FIG. 7. For example, the edge
[拡大パラメータ算出部の詳細説明]
次に、拡大パラメータ算出部530をより詳細に説明する。
拡大パラメータ算出部530は、まず、拡大処理の拡大倍率に応じたサイズ及び係数の強調カーネルを用いて、画像ブロック設定部510により切り出された画像ブロック中の注目領域及びその周辺領域の画像データのコントラストを強調する。
図9は、拡大パラメータ算出部530により用いられる強調カーネル(エッジ強調カーネル)を例示する図である。
図9に例示するように、第1の強調カーネル532は、重み付け係数「1.60」及び「−0.15」を用いてコントラストを強調し、第2の強調カーネル534は、重み付け係数「1.20」及び「−0.05」を用いてコントラストを強調する。これらの強調カーネルは、対象画像に対して既になされた拡大処理の拡大倍率に対応付けられており、互いに異なる重み付け係数を用いて、互いに異なる位置の画素値を参照する。
第1の強調カーネル532は、図9(A)に例示するように、注目画素Pの直下画素a、直右画素b、直上画素c及び直左画素dを参照して、これらの画素の画素値にそれぞれ重み付け係数(−0.15)を掛け合わせ、重み付け係数(1.60)が掛けられた注目画素Pの画素値と合算し、合算された値を注目画素Pの画素値とする。
第2の強調カーネル534は、第1の強調カーネル532よりも拡大倍率の大きな画像に対して適用され、図9(B)に例示するように、注目画素Pから1画素分離間した下画素a、右画素b、上画素c及び左画素dを参照して、これらの画素の画素値にそれぞれ重み付け係数(−0.05)を掛け合わせ、重み付け係数(1.20)が掛けられた注目画素Pの画素値と合算し、合算された値を注目画素Pの画素値とする。
例えば、第1の強調カーネル532を適用する場合に、以下の式(5)に従って、コントラスト強調後の画素値P’が算出される。
(画素値P’)=1.60×P‐0.15×(a+b+c+d)・・・式(5)
[Detailed description of the enlarged parameter calculation unit]
Next, the expansion
The enlargement
FIG. 9 is a diagram illustrating an enhancement kernel (edge enhancement kernel) used by the enlargement
As illustrated in FIG. 9, the first enhancement kernel 532 uses the weighting factors “1.60” and “−0.15” to enhance contrast, and the second enhancement kernel 534 includes the weighting factor “1”. .20 ”and“ −0.05 ”to enhance contrast. These enhancement kernels are associated with the enlargement magnification of the enlargement process already performed on the target image, and refer to pixel values at different positions using different weighting coefficients.
As illustrated in FIG. 9A, the first enhancement kernel 532 refers to the pixel a, the right pixel b, the pixel c, and the pixel d of the pixel of interest P with reference to the pixels of these pixels. Each value is multiplied by a weighting coefficient (−0.15) and added to the pixel value of the target pixel P multiplied by the weighting coefficient (1.60), and the sum is set as the pixel value of the target pixel P.
The second enhancement kernel 534 is applied to an image having a larger magnification than the first enhancement kernel 532, and as illustrated in FIG. 9B, a lower pixel a that is separated by one pixel from the target pixel P. , The right pixel b, the upper pixel c, and the left pixel d, the pixel value of these pixels is multiplied by a weighting coefficient (−0.05), and the pixel of interest multiplied by the weighting coefficient (1.20) The pixel value of P is added together, and the added value is set as the pixel value of the target pixel P.
For example, when the first enhancement kernel 532 is applied, the pixel value P ′ after contrast enhancement is calculated according to the following equation (5).
(Pixel value P ′) = 1.60 × P−0.15 × (a + b + c + d) Expression (5)
このように、既になされた拡大処理の拡大倍率に応じて強調カーネルが異なるのは、4倍、8倍と順に画像を拡大していくと、原画像の特徴を有している画素は、2画素、4画像離れた位置の画素となる。そのため、拡大パラメータ算出部530は、図9に例示するように、拡大倍率が高いほど離れた画素を参照して強調処理を行う。なお、8倍、16倍以降の倍率においても同様である。
また、参照する画素の位置は、図9に示すような上下左右に限られたものではない。例えば、拡大パラメータ算出部530は、斜め方向の画素を参照してコントラスト強調を行ったり、さらに離れた画素を参照してコントラスト強調を行ったり、処理対象画像データの種類及びサイズなどにより適用する強調カーネルを切り替えたりしてもよい。
As described above, the enhancement kernels differ according to the enlargement magnification of the already performed enlargement process. When the image is enlarged in order of 4 times and 8 times, the pixels having the characteristics of the original image are 2 The pixel is a pixel at a position distant from four images. Therefore, as illustrated in FIG. 9, the enlargement
Further, the position of the pixel to be referred to is not limited to the vertical and horizontal directions as shown in FIG. For example, the enlargement
次に、拡大パラメータ算出部530は、エッジ方向推定部524により推定された推定エッジ方向と、エッジパターン選択部526により選択されたエッジパターンと、コントラスト強調がなされた画素値とを用いて、注目領域の画像特徴量に基づく拡大パラメータを算出する。
図10は、拡大パラメータ算出部530により算出される拡大パラメータを例示する図である。
図10に例示するように、「uh」、「lh」、「lv」、「rv」及び「mid」の5つの拡大パラメータは、注目領域(図10中のハッチングを施した領域)の各画素の画素値(a、b、c、d)を用いて、既定の計算式によりそれぞれ算出される。この注目領域の画素値は、図9で例示した強調カーネルによりコントラスト強調がなされたものである。また、この計算式(演算式)は、エッジ方向推定部524で得られた推定エッジ方向と、エッジパターン選択部526で得られたエッジパターンとで決定される。
また、図10に例示したref[0,5]は、注目領域の推定エッジ方向に応じて一意に設定される。具体的には、注目領域の推定エッジ方向が方向1(22.5°)から方向3(67.5°)のいずれかである場合には、図10(A)に示すように、注目領域周辺のコントラスト強調された画素のうち、左上から下へ3画素(ref4、ref2及びref0)と、右下から上へ3画素(ref1、ref3及びref5)とがref[0,5]として設定される(以後、このref設定をtypeAと呼ぶ)。また、注目領域の推定エッジ方向が方向5(112.5°)から方向7(157.5°)のいずれかである場合には、図10(B)に示すように、左下から上へ3画素(ref0、ref2及びref4)と、右上から下へ3画素(ref5、ref3及びref1)とがref[0,5]として設定される(以後、このref設定をtypeBと呼ぶ)。さらに、注目領域の推定エッジ方向が方向0又は方向4(すなわち垂直方向又は水平方向の場合)である場合は、図10(C)に示すように、ref[0,5]が設定される(以後、このref設定をtypeCと呼ぶ)。
なお、ref設定は、図10に例示した3パターンに限定されるものではなく、推定エッジ方向に従い、より多くのref設定パターンが用意されてもよい。
Next, the enlargement
FIG. 10 is a diagram illustrating the enlargement parameter calculated by the enlargement
As illustrated in FIG. 10, the five expansion parameters “uh”, “lh”, “lv”, “rv”, and “mid” are set for each pixel of the attention area (the hatched area in FIG. 10). The pixel values (a, b, c, d) are respectively calculated by predetermined calculation formulas. The pixel value of this attention area has been subjected to contrast enhancement by the enhancement kernel exemplified in FIG. Also, this calculation formula (calculation formula) is determined by the estimated edge direction obtained by the edge
Further, ref [0,5] illustrated in FIG. 10 is uniquely set according to the estimated edge direction of the attention area. Specifically, when the estimated edge direction of the attention area is any one of the direction 1 (22.5 °) to the direction 3 (67.5 degrees), as shown in FIG. Among the peripheral-emphasized pixels, three pixels (ref4, ref2, and ref0) from the upper left to the lower and three pixels (ref1, ref3, and ref5) from the lower right to the upper are set as ref [0,5]. (Hereafter, this ref setting is referred to as type A). When the estimated edge direction of the attention area is any one of the direction 5 (112.5 °) to the direction 7 (157.5 °), as shown in FIG. Pixels (ref0, ref2, and ref4) and three pixels (ref5, ref3, and ref1) from the upper right to the lower are set as ref [0,5] (hereinafter, this ref setting is referred to as type B). Furthermore, when the estimated edge direction of the attention area is
Note that the ref setting is not limited to the three patterns illustrated in FIG. 10, and more ref setting patterns may be prepared according to the estimated edge direction.
次に、エッジ方向推定部524で得られた推定エッジ方向、及び、エッジパターン選択部526で得られたエッジパターンに基づいて決定される拡大パラメータの計算式を説明する。
図11は、推定エッジ方向及びエッジパターンに応じて決定される拡大パラメータの計算式を例示する図である。
図11(A)に例示するように、拡大パラメータ算出部530は、エッジ方向推定部524によりエッジ方向1と推定され、かつ、エッジパターン選択部526によりエッジパターン2が選択された場合(すなわち、図3(A)に例示した注目領域が処理対象である場合)、この注目領域(図3(A)に相当)に対して以下の計算式を設定する。
uh=(a+c)/2
lh=(b+d)/2
lv=(a+c)/2
rv=(b+d)/2
mid=(b+c)/2
ref[0,5]=typeA
なお、上記a,b,c及びdは、注目領域にある各画素の画素値である。
Next, calculation formulas for the enlargement parameter determined based on the estimated edge direction obtained by the edge
FIG. 11 is a diagram illustrating an enlargement parameter calculation formula determined according to the estimated edge direction and the edge pattern.
As illustrated in FIG. 11A, the enlargement
uh = (a + c) / 2
lh = (b + d) / 2
lv = (a + c) / 2
rv = (b + d) / 2
mid = (b + c) / 2
ref [0,5] = typeA
Note that a, b, c, and d are the pixel values of each pixel in the region of interest.
また、拡大パラメータ算出部530は、推定エッジ方向1であり、かつ、エッジパターン0である場合には、図11(B)に例示するように、以下の計算式を設定する。
lh=(c+d)/2
lv=(a+c)/2
rv=(b+d)/2
mid=(b+c)/2
uh=2*mid−lh
ref[0,5]=typeA
The enlargement
lh = (c + d) / 2
lv = (a + c) / 2
rv = (b + d) / 2
mid = (b + c) / 2
uh = 2 * mid-lh
ref [0,5] = typeA
また、拡大パラメータ算出部530は、推定エッジ方向3であり、かつ、エッジパターン0である場合には、図11(C)に例示するように、以下の計算式を設定する。
uh=(a+b)/2
lh=(c+d)/2
rv=(b+d)/2
mid=(b+c)/2
lv=2*mid−rv
ref[0,5]=typeA
The enlargement
uh = (a + b) / 2
lh = (c + d) / 2
rv = (b + d) / 2
mid = (b + c) / 2
lv = 2 * mid-rv
ref [0,5] = typeA
また、拡大パラメータ算出部530は、推定エッジ方向7であり、かつ、エッジパターン1である場合には、図11(D)に例示するように、以下の計算式を設定する。
uh=(b+d)/2
lh=(a+c)/2
rv=(a+c)/2
mid=(b+d)/2
lv=(a+d)/2
ref[0,5]=typeB
Further, when the estimated
uh = (b + d) / 2
lh = (a + c) / 2
rv = (a + c) / 2
mid = (b + d) / 2
lv = (a + d) / 2
ref [0,5] = typeB
拡大パラメータ算出部530は、以上のように設定された計算式に基づいて、拡大パラメータ(uh、lhなど)を算出する。
なお、他の推定エッジ方向及びエッジパターンの組合せについても、同様にそれぞれ一意に対応した計算式が設定され、この計算式に従って拡大パラメータが算出され設定される。
The expansion
For other combinations of estimated edge directions and edge patterns, calculation formulas that uniquely correspond to each other are similarly set, and an enlargement parameter is calculated and set according to the calculation formula.
[拡大画素生成部の詳細説明]
次に、拡大画素生成部540をより詳細に説明する。
拡大画素生成部540は、拡大パラメータ算出部530により算出された複数の拡大パラメータと、入力画像データ中の拡大対象画素(注目画素)が含まれる画像ブロック中の画素値とを用いて、この注目画素に対応する拡大画素値(拡大倍率に応じた拡大処理後の画素の画素値)を算出する。
図12は、注目画素が含まれた複数の画像ブロック(近傍ブロック)を例示する図である。
図12に例示するように、拡大画素生成部540は、拡大画素生成処理において、拡大対象画素である注目画素が含まれる複数の近傍ブロックの画素値を参照して、注目画素に対応する拡大画素値を生成する。具体的には、拡大画素生成部540は、拡大対象画素である注目画素Eを拡大する場合に、図12に示すように、近傍ブロック0(ABDE)、近傍ブロック1(BCEF)、近傍ブロック2(DEGH)及び近傍ブロック3(EFHI)の4つの近傍ブロックに関して、それぞれの近傍ブロックについて拡大パラメータ算出部530により算出された拡大パラメータの一部を用いて、注目画素に対応する拡大画素の画素値を算出する。
[Detailed description of enlarged pixel generator]
Next, the enlarged
The enlargement
FIG. 12 is a diagram illustrating a plurality of image blocks (neighboring blocks) including the target pixel.
As illustrated in FIG. 12, the enlarged
図13は、注目画素Eを主走査方向及び副走査方向にそれぞれ2倍する場合の拡大画素を例示する図である。
図13に例示するように、拡大画素生成部540は、拡大対象画素である注目画素Eを拡大倍率2倍で拡大する場合に、拡大画素S0、S1、S2、S3を生成する。より具体的には、拡大画素生成部540は、注目画素Eが含まれた4つの近傍ブロック(図12)の画素値と、拡大パラメータ算出部530により算出された拡大パラメータとを用いて、以下に示す算出式により拡大画素S0、S1、S2、S3の画素値を算出する。なお、注目画素Eを含む近傍ブロック内の画素値は、拡大パラメータ算出部530により予めコントラスト強調がなされている。
FIG. 13 is a diagram illustrating an enlarged pixel when the target pixel E is doubled in the main scanning direction and the sub-scanning direction, respectively.
As illustrated in FIG. 13, the enlarged
S0=0.05×(A+B)+0.36×E
+0.12×uh(DEGH)+0.06×lh(ABDE)
+0.12×lv(BCEF)+0.06×rv(ABDE)
+0.09×mid(ABDE)
+0.04×ref0(EFHI)
+0.03×ref2(BCEF)
+0.02×ref4(BCEF)
S0 = 0.05 × (A + B) + 0.36 × E
+ 0.12 × uh (DEGH) + 0.06 × lh (ABDE)
+ 0.12 × lv (BCEF) + 0.06 × rv (ABDE)
+0.09 x mid (ABDE)
+ 0.04 × ref0 (EFHI)
+0.03 x ref2 (BCEF)
+ 0.02 × ref4 (BCEF)
S1=0.05×(B+C)+0.36×E
+0.12×uh(EFHI)+0.06×lh(BCEF)
+0.12×rv(ABDE)+0.06×lv(BCEF)
+0.09×mid(BCEF)
+0.04×ref1(DEGH)
+0.03×ref3(ABDE)
+0.02×ref5(ABDE)
S1 = 0.05 × (B + C) + 0.36 × E
+ 0.12 × uh (EFHI) + 0.06 × lh (BCEF)
+ 0.12 × rv (ABDE) + 0.06 × lv (BCEF)
+0.09 x mid (BCEF)
+ 0.04 × ref1 (DEGH)
+0.03 x ref3 (ABDE)
+ 0.02 × ref5 (ABDE)
S2=0.05×(G+H)+0.36×E
+0.12×lh(ABDE)+0.06×uh(DEGH)
+0.12×lv(EFHI)+0.06×rv(DEGH)
+0.09×mid(DEGH)
+0.04×ref4(BCEF)
+0.03×ref2(EFHI)
+0.02×ref0(EFHI)
S2 = 0.05 × (G + H) + 0.36 × E
+ 0.12 × lh (ABDE) + 0.06 × uh (DEGH)
+ 0.12 × lv (EFHI) + 0.06 × rv (DEGH)
+0.09 x mid (DEGH)
+ 0.04 × ref4 (BCEF)
+0.03 x ref2 (EFHI)
+ 0.02 × ref0 (EFHI)
S3=0.05×(H+I)+0.36×E
+0.12×lh(BCEF)+0.06×uh(EFHI)
+0.12×rv(DEGH)+0.06×lv(EFHI)
+0.09×mid(EFHI)
+0.04×ref5(ABDE)
+0.03×ref3(DEGH)
+0.02×ref1(DEGH)
S3 = 0.05 × (H + I) + 0.36 × E
+ 0.12 × lh (BCEF) + 0.06 × uh (EFHI)
+ 0.12 × rv (DEGH) + 0.06 × lv (EFHI)
+0.09 x mid (EFHI)
+ 0.04 × ref5 (ABDE)
+0.03 x ref3 (DEGH)
+ 0.02 × ref1 (DEGH)
なお、上式に示した記号(AからE)は、それぞれ図13で説明した注目画素及び近傍画素の画素値を表す。また、uh、lh、lv、rv、ref[0、5]は、それぞれ拡大パラメータ算出部530により算出された、カッコ内のアルファベット列(ABDE、BCEF、DEGH、EFHI)で表される近傍ブロック0から近傍ブロック3における拡大パラメータである。
Note that the symbols (A to E) shown in the above expression represent the pixel values of the pixel of interest and the neighboring pixels described in FIG. Further, uh, lh, lv, rv, ref [0, 5] are
[全体動作]
次に、画像拡大プログラム5の全体動作を説明する。
図14は、画像拡大プログラム5による画像拡大処理(S20)のフローチャートである。
図14に示すように、ステップ200(S200)において、画像ブロック設定部510は、画像ブロック特徴量算出部520、拡大パラメータ算出部530及び拡大画素生成部540における処理で必要とされる既定の画像ブロックのサイズをそれぞれ設定し、記憶部500に記憶されている処理対象画像データから、設定されたブロックサイズの画像ブロックを順次(例えばラスタスキャン順に)切り出し、切り出された各画像ブロックを画像ブロック特徴量算出部520、拡大パラメータ算出部530及び拡大画素生成部540にそれぞれ出力する。
[Overall operation]
Next, the overall operation of the
FIG. 14 is a flowchart of image enlargement processing (S20) by the
As shown in FIG. 14, in step 200 (S200), the image
S10において、画像ブロック特徴量算出部520は、入力された画像ブロック中の注目領域のエッジ強度Gを式(1)で算出する。なお、{a,b,c,d}は図3に例示するように注目領域内の各画素値である。入力画像データがグレースケール画像でなく、例えばRGB色空間のカラー画像である場合には、画像ブロック特徴量算出部520は、注目領域に関してR,G,Bの各色空間の色成分毎の画像ブロックそれぞれについて、式(1)を用いてエッジ強度Gr、Gg、Gbを計算し、Gr、Gg、Gbの中で最大のエッジ強度である色成分の画像ブロックを選択し、そのエッジ強度を注目領域の(すべての色成分に共通の)エッジ強度とする。
さらに、画像ブロック特徴量算出部520は、注目領域及びその注目領域を含む1ないし複数の周辺領域中の参照領域のエッジ角度Θを、式(3)で計算する。
なお、gx、gyは式(1)において各々算出される値である。そして、得られた複数のエッジ角度Θから注目領域のエッジ方向θを推定する。例えば、画像ブロック特徴量算出部520は、得られた複数のエッジ角度Θの平均値を算出し、算出された平均値を推定エッジ方向θとする。
In S10, the image block feature
Further, the image block feature
Note that gx and gy are values calculated in equation (1). Then, the edge direction θ of the region of interest is estimated from the obtained plurality of edge angles Θ. For example, the image block feature
ステップ210(S210)において、画像ブロック特徴量算出部520は、推定されたエッジ方向θ及び注目領域の画素分布パターンを用いてエッジパターンを選択する。ここで、エッジパターンについては、エッジ方向及び画素分布パターンに応じて予め用意されたパターンテーブルの中から選択される。
In step 210 (S210), the image block feature
ステップ220(S220)において、拡大パラメータ算出部530は、拡大率に応じてサイズ及び重み付け係数が設定された強調カーネルを用いて、画像ブロック設定部510により切り出された画像ブロック中の注目領域及びその周辺領域の画像データに対してコントラスト強調処理を施す。さらに、拡大パラメータ算出部530は、コントラスト強調処理が施された画像データと、エッジ方向推定部524により推定された推定エッジ方向と、エッジパターン選択部526により選択されたエッジパターンとを用いて、これら注目領域の画像特徴量に基づく拡大パラメータ(uh、lh、lv、rv、mid、ref)を算出する。
In step 220 (S220), the enlargement
ステップ230(S230)において、拡大画素生成部540は、入力画像データの拡大対象画素(注目画素)が含まれる画像ブロックの画素値(コントラスト強調された画素値)と、注目画素周辺(注目画素を含む)の画像ブロックについて拡大パラメータ算出部530により算出された複数の拡大パラメータ(uh、lh、lv、rv、mid、ref)とを用いて、この注目画素について拡大倍率に応じた拡大画素の画素値を生成し、生成された拡大画素の画素値を記憶部500に出力し格納させる。
In step 230 (S230), the enlarged
ステップ240(S240)において、画像拡大プログラム5は、すべての入力画像データについて拡大処理が完了したか否かを判定し、拡大処理が完了していないと判定された場合に、S200の処理に戻って次の画素ブロックに対する拡大処理を行い、拡大処理が完了していると判定された場合に、拡大処理(S20)を終了する。
In step 240 (S240), the
このように、本実施形態における画像処理装置2は、処理対象となった入力画像データを例えば所定サイズの画像ブロックに分けて、各画像ブロックについてエッジ強度やエッジ方向等の特徴量を算出する。そして、画像処理装置2は、この特徴量に基づいて画像ブロック毎の拡大パラメータを算出し、入力画像データにおける注目画素から拡大画素を生成する際に、これら拡大パラメータを用いることにより、拡大処理全体の処理負荷を抑えた、高画質な拡大画像を得ることができるようになる。
すなわち、本画像処理装置2は、注目画素を含む所定の大きさの画像ブロックの特徴量に従って拡大画素を生成することにより、入力画像中の特徴的な部分の特徴量を保存する拡大処理を実現でき、特徴的部分におけるボケやジャギーなどの画質欠陥を抑制した高画質な拡大処理を小さな処理負荷により高速に行うことができる。
As described above, the
That is, the
2・・・画像処理装置
5・・・画像拡大プログラム
500・・・記憶部
510・・・画像ブロック設定部
520・・・画像ブロック特徴量算出部
522・・・エッジ強度算出部
524・・・エッジ方向推定部
526・・・エッジパターン選択部
530・・・拡大パラメータ算出部
532,534・・・強調カーネル
540・・・拡大画素生成部
DESCRIPTION OF
Claims (12)
入力画像における既定の大きさの画像領域について、階調変化に関する特徴量を算出する領域特徴量算出手段と、
前記領域特徴量算出手段によりそれぞれの画像領域について算出された特徴量に基づいて、パラメータを生成するパラメータ生成手段と、
処理対象画素が含まれる画像領域内の画素値と、前記パラメータ生成手段によりこの画像領域について生成されたパラメータとを用いて、この処理対象画素に対応する拡大画像データを生成する拡大画像生成手段と
を有する画像処理装置。 An image processing apparatus for enlarging an input image,
A region feature amount calculating means for calculating a feature amount related to a gradation change for an image region of a predetermined size in the input image;
Parameter generating means for generating a parameter based on the feature amount calculated for each image region by the region feature amount calculating means;
Enlarged image generating means for generating enlarged image data corresponding to the processing target pixel using the pixel value in the image area including the processing target pixel and the parameter generated for the image area by the parameter generating means; An image processing apparatus.
請求項1に記載の画像処理装置。 The image processing apparatus according to claim 1, wherein the region feature amount calculating unit calculates a gradation change amount in the image region as the feature amount.
前記パラメータ生成手段は、前記領域特徴量算出手段により算出された階調変化の方向に応じて画像領域内から参照画素を選択し、少なくとも、選択された参照画素の画素値を前記パラメータとする
請求項1に記載の画像処理装置。 The area feature quantity calculating means calculates a direction of gradation change in the image area as the feature quantity,
The parameter generation unit selects a reference pixel from the image region in accordance with the direction of gradation change calculated by the region feature amount calculation unit, and at least the pixel value of the selected reference pixel is used as the parameter. Item 8. The image processing apparatus according to Item 1.
前記パラメータ生成手段は、前記領域特徴量算出手段により選択されたエッジパターンに対応する演算式を用いて、前記パラメータを算出する
請求項1に記載の画像処理装置。 The region feature amount calculation means selects, as the feature amount, an edge pattern corresponding to a gradation change in each image region from among a plurality of edge patterns prepared in advance.
The image processing apparatus according to claim 1, wherein the parameter generation unit calculates the parameter using an arithmetic expression corresponding to the edge pattern selected by the region feature amount calculation unit.
請求項1に記載の画像処理装置。 The area feature value calculating means calculates the feature value for each color component in a color space, selects any one color component based on the calculated one or more feature values, and selects the selected color The image processing apparatus according to claim 1, wherein a feature amount of a component is a feature amount of the image area.
請求項5に記載の画像処理装置。 6. The image processing according to claim 5, wherein the region feature amount calculating unit calculates a gradation change amount in the image region for each color component, and selects a color component having the maximum calculated gradation change amount. apparatus.
請求項1に記載の画像処理装置。 The image processing apparatus according to claim 1, wherein the parameter generation unit generates a parameter using a predetermined arithmetic expression corresponding to the feature amount calculated by the region feature amount calculation unit.
請求項1に記載の画像処理装置。 The parameter generation means corrects a pixel value of an input image using an edge enhancement kernel having a kernel element and a distance between kernel elements different depending on an enlargement ratio, and generates a parameter using the corrected pixel value. The image processing apparatus according to 1.
請求項1に記載の画像処理装置。 The enlarged image generation means uses the pixel values of a plurality of image areas including the processing target pixel and the parameters generated for the image areas by the parameter generation means, and uses the enlarged image data corresponding to the processing target pixel. The image processing device according to claim 1, wherein each of the image processing devices is generated.
請求項1に記載の画像処理装置。 2. The image processing according to claim 1, wherein the enlarged image generation unit generates enlarged image data by weighted addition of the parameter generated by the parameter generation unit and a pixel value in an image region including the processing target pixel. apparatus.
入力画像における既定の大きさの画像領域について、階調変化に関する特徴量を算出し、
それぞれの画像領域について算出された特徴量に基づいて、パラメータを生成し、
処理対象画素が含まれる画像領域内の画素値と、この画像領域について生成されたパラメータとを用いて、この処理対象画素に対応する拡大画像データを生成する
画像処理方法。 An image processing method for enlarging an input image,
For the image area of a predetermined size in the input image, calculate the feature value related to the gradation change,
Based on the feature amount calculated for each image area, generate parameters,
An image processing method for generating enlarged image data corresponding to a processing target pixel by using a pixel value in an image region including the processing target pixel and a parameter generated for the image region.
入力画像における既定の大きさの画像領域について、階調変化に関する特徴量を算出するステップと、
それぞれの画像領域について算出された特徴量に基づいて、パラメータを生成するステップと、
処理対象画素が含まれる画像領域内の画素値と、この画像領域について生成されたパラメータとを用いて、この処理対象画素に対応する拡大画像データを生成するステップと
を前記画像処理装置に実行させるプログラム。 In an image processing apparatus that performs enlargement processing of an input image,
A step of calculating a feature amount related to a gradation change for an image area of a predetermined size in the input image;
Generating a parameter based on the feature amount calculated for each image region;
Generating the enlarged image data corresponding to the pixel to be processed using the pixel value in the image region including the pixel to be processed and the parameter generated for the image region; program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004232135A JP2006050480A (en) | 2004-08-09 | 2004-08-09 | Image processing apparatus, image processing method and program thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004232135A JP2006050480A (en) | 2004-08-09 | 2004-08-09 | Image processing apparatus, image processing method and program thereof |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2006050480A true JP2006050480A (en) | 2006-02-16 |
Family
ID=36028478
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2004232135A Pending JP2006050480A (en) | 2004-08-09 | 2004-08-09 | Image processing apparatus, image processing method and program thereof |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2006050480A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008017291A (en) * | 2006-07-07 | 2008-01-24 | Canon Inc | Image processor, image processing method, image processing program, and storage medium |
JP2012079195A (en) * | 2010-10-05 | 2012-04-19 | Jvc Kenwood Corp | Image processing method and image processing device |
WO2022055273A1 (en) * | 2020-09-09 | 2022-03-17 | Samsung Electronics Co., Ltd. | Method and electronic device for applying adaptive zoom on an image |
-
2004
- 2004-08-09 JP JP2004232135A patent/JP2006050480A/en active Pending
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008017291A (en) * | 2006-07-07 | 2008-01-24 | Canon Inc | Image processor, image processing method, image processing program, and storage medium |
JP4677376B2 (en) * | 2006-07-07 | 2011-04-27 | キヤノン株式会社 | Image processing apparatus, image processing method, image processing program, and storage medium |
JP2012079195A (en) * | 2010-10-05 | 2012-04-19 | Jvc Kenwood Corp | Image processing method and image processing device |
WO2022055273A1 (en) * | 2020-09-09 | 2022-03-17 | Samsung Electronics Co., Ltd. | Method and electronic device for applying adaptive zoom on an image |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP3915563B2 (en) | Image processing apparatus and image processing program | |
JP4568460B2 (en) | Image processing apparatus and recording medium | |
EP1758093B1 (en) | Image processing device and method, recording medium, and program | |
EP0874330A2 (en) | Area based interpolation for image enhancement | |
JP3167120B2 (en) | Image processing apparatus and method | |
US7885486B2 (en) | Image processing system, method for processing image and computer readable medium | |
JP4507279B2 (en) | Image processing apparatus, image processing method, and program thereof | |
JP4716255B2 (en) | Image processing apparatus, image processing method, and program thereof | |
JP4126541B2 (en) | Image processing apparatus, image processing method, image processing program, and storage medium | |
JP4857975B2 (en) | Image processing system and image processing program | |
JP2006050481A (en) | Image processing apparatus, image processing method and program thereof | |
JP2006050480A (en) | Image processing apparatus, image processing method and program thereof | |
JP4730525B2 (en) | Image processing apparatus and program thereof | |
JP3092769B2 (en) | Image processing device | |
KR100587979B1 (en) | Interpolation method for image enlargement based on edge and corner | |
JP4265363B2 (en) | Image processing device | |
JP4827137B2 (en) | Resolution conversion processing method, image processing apparatus, image display apparatus, and program | |
JP4517288B2 (en) | Image processing apparatus, image processing method, and program thereof | |
JP2006252108A (en) | Image processing device, image processing method, and its program | |
JP5013243B2 (en) | Image processing apparatus, image processing method, image processing program, and recording medium recording the same | |
JP4736121B2 (en) | Image analysis apparatus, image processing apparatus, image analysis method, image analysis program, and recording medium recording the same | |
JP4517287B2 (en) | Image processing apparatus, image processing method, and program thereof | |
JP3972625B2 (en) | Image processing apparatus and image processing method | |
JPH0993424A (en) | Image processor | |
JP2006252107A (en) | Image processing device, image processing method, and its program |