JP2017005660A - Image processing apparatus and image processing method - Google Patents
Image processing apparatus and image processing method Download PDFInfo
- Publication number
- JP2017005660A JP2017005660A JP2015121084A JP2015121084A JP2017005660A JP 2017005660 A JP2017005660 A JP 2017005660A JP 2015121084 A JP2015121084 A JP 2015121084A JP 2015121084 A JP2015121084 A JP 2015121084A JP 2017005660 A JP2017005660 A JP 2017005660A
- Authority
- JP
- Japan
- Prior art keywords
- pixel
- edge
- image
- image processing
- pixels
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Landscapes
- Image Processing (AREA)
- Facsimile Image Signal Circuits (AREA)
Abstract
【課題】エッジ強調処理に代表されるフィルタ畳み込み演算を行う事に伴う演算量が多く、処理時間が膨大になってしまう。
【解決手段】画像処理装置は、入力画像に含まれる画素のうち、一定周期の画素のエッジ成分を抽出する。そして、抽出されていない注目画素のエッジ成分を、注目画素に隣接する画素の抽出されたエッジ成分を用いた補間演算により算出する。
【選択図】図2A large amount of calculation is involved in performing a filter convolution operation represented by edge enhancement processing, and the processing time becomes enormous.
An image processing apparatus extracts an edge component of a pixel having a fixed period from pixels included in an input image. Then, the edge component of the target pixel that has not been extracted is calculated by interpolation using the extracted edge component of the pixel adjacent to the target pixel.
[Selection] Figure 2
Description
本発明は、画像に含まれるエッジ成分を求める技術に関する。 The present invention relates to a technique for obtaining an edge component included in an image.
従来、画像に対してエッジ成分を求め、求めたエッジ成分を付加することでエッジ強調処理が行なわれている。エッジ強調処理を行うことで文字画像であれば可読性が増し、写真であればその写真が鮮鋭になり画質の向上を図る事が可能になる。エッジ成分を求める処理としてはフィルタによる畳みこみ演算を用いるのが一般的である。エッジ強調処理によりエッジ付近のコントラストが強調された画像に変換される。具体的には明るい領域と暗い領域の接する位置では明るい所はより明るく、暗いところはより暗く変換されることで境界部が誇張され、見た目には鮮鋭になったように見える。 Conventionally, edge enhancement processing is performed by obtaining an edge component from an image and adding the obtained edge component. By performing the edge enhancement processing, the readability of a character image is increased, and if it is a photograph, the photograph becomes sharp and the image quality can be improved. As processing for obtaining the edge component, it is common to use a convolution operation by a filter. The image is converted into an image in which the contrast near the edge is enhanced by the edge enhancement process. Specifically, the bright part is brighter at the position where the bright area and the dark area are in contact with each other, and the dark part is converted to darker so that the boundary portion is exaggerated, and it looks sharp.
カラー画像に対してエッジ強調を行う技術に関しては多くの技術がこれまでも公開されている。 Many techniques have been published so far for edge enhancement techniques for color images.
スキャンされた原稿画像に対して、黒い文字を判定しその黒い文字と判定された箇所に対してエッジ強調を行い、またその黒い文字をプリントする時に墨版で生成することで可読性の向上を図る技術がある。例えば色画像データを輝度を示すデータと彩度を示すデータとに分離し、輝度から算出されるエッジ量と彩度とから黒エッジ度合いを求め、そのエッジに対して強調処理を行っている。 Improve readability by scanning the original image with a black character, performing edge emphasis on the black character, and generating the black character when printing the black character. There is technology. For example, color image data is separated into data indicating luminance and data indicating saturation, a black edge degree is obtained from the edge amount and saturation calculated from the luminance, and enhancement processing is performed on the edge.
また注目画素の周囲の明度と閾値との大小関係から文字やロゴなどのエッジが明瞭なベタ部境界をより鮮鋭に、そうでない絵柄の部分では鮮鋭を抑えるよう選択的に鮮鋭度強調量を制御する処理も開示されている(特許文献1参照)。 In addition, the amount of sharpness enhancement is selectively controlled to sharpen solid borders with clear edges, such as letters and logos, and to suppress sharpness in areas where the pattern is not clear, based on the relationship between the brightness around the pixel of interest and the threshold. The process to perform is also disclosed (see Patent Document 1).
しかしながら、エッジ強調処理をソフトウェアを用いて行うと、畳み込み演算にかかる処理時間が、入力される画像のサイズや処理するCPUリソースに応じて膨大になる場合がある。畳み込み演算には、通常、その畳み込み演算に用いる処理ウィンドウ内の画素それぞれに対してフィルタ内の対応する位置の係数の乗算を行い、その結果を累積加算する処理を行う。つまりそのウィンドウの大きさが5×5の場合、1画素処理するために25回の乗算と加算とがそれぞれ必要になり、エッジ強調処理に占めるウェイトが最も大きくなる。また上述のように単純な畳み込み演算によるエッジ強調だけでなく、それに付随したエッジ強調量の補正処理も含めると1画素にかかる演算量は膨大なものになってしまう。 However, when the edge enhancement process is performed using software, the processing time for the convolution calculation may become enormous depending on the size of the input image and the CPU resource to be processed. In the convolution operation, usually, a process of multiplying each pixel in the processing window used for the convolution operation by a coefficient at a corresponding position in the filter and accumulating the result is performed. In other words, when the size of the window is 5 × 5, 25 multiplications and additions are required to process one pixel, and the weight occupying the edge enhancement processing is the largest. In addition to the edge enhancement by simple convolution calculation as described above, the calculation amount per pixel becomes enormous if the accompanying edge enhancement amount correction process is included.
本発明に係る画像処理装置は、入力画像に含まれる画素のうち、一定周期の画素のエッジ成分を抽出する抽出手段と、前記抽出手段で抽出されていない注目画素のエッジ成分を、前記注目画素に隣接する画素の前記抽出手段で抽出されたエッジ成分を用いた補間演算により算出する算出手段とを有することを特徴とする。 An image processing apparatus according to the present invention includes an extraction unit that extracts an edge component of a pixel having a fixed period among pixels included in an input image, and an edge component of a pixel of interest that has not been extracted by the extraction unit. And calculating means for calculating by interpolation using the edge component extracted by the extracting means for the pixels adjacent to the pixel.
本発明によれば、画像に対して畳み込み演算処理を行う際の処理時間を短縮することが可能になる。 According to the present invention, it is possible to reduce processing time when performing convolution operation processing on an image.
以下、本発明を実施するための形態について図面を用いて説明する。なお以下の実施形態において示す構成は一例にすぎず、本発明は図示された構成に限定されるものではない。 Hereinafter, embodiments for carrying out the present invention will be described with reference to the drawings. The configurations shown in the following embodiments are merely examples, and the present invention is not limited to the illustrated configurations.
[実施形態1]
[画像形成装置の構成]
図1は本実施形態の、エッジ強調を行う機能を有する画像処理装置の構成を示すブロック図である。図1に示すように、画像処理装置は、画像読取部101、画像処理部102、記憶部103、CPU104、画像出力部105、ユーザインタフェース(UI)部106、および送受信部107を備える。なお、画像処理装置は、画像データを管理するサーバ、プリントの実行を指示するパーソナルコンピュータ(PC)などにネットワークなどを介して接続可能である。
[Embodiment 1]
[Configuration of Image Forming Apparatus]
FIG. 1 is a block diagram illustrating a configuration of an image processing apparatus having a function of performing edge enhancement according to the present exemplary embodiment. As illustrated in FIG. 1, the image processing apparatus includes an image reading unit 101, an image processing unit 102, a storage unit 103, a CPU 104, an image output unit 105, a user interface (UI) unit 106, and a transmission / reception unit 107. The image processing apparatus can be connected to a server that manages image data, a personal computer (PC) that instructs execution of printing, and the like via a network.
画像読取部101は、原稿の画像を読み取り、画像データを出力する。画像処理部102は、画像読取部101や送受信部107等より外部から入力される画像データを含む印刷情報を中間情報(以下「オブジェクト」と呼ぶ)に変換し、記憶部103のオブジェクトバッファに格納する。さらに、画像処理部102は、バッファしたオブジェクトに基づきビットマップデータを生成し、記憶部103のバッファに格納する。画像処理部102はビットマップデータを生成する処理において、色変換処理や、エッジ強調処理等を行う。詳細に関しては後述する。 The image reading unit 101 reads an image of a document and outputs image data. The image processing unit 102 converts print information including image data input from the outside from the image reading unit 101 and the transmission / reception unit 107 into intermediate information (hereinafter referred to as “object”) and stores it in an object buffer of the storage unit 103. To do. Further, the image processing unit 102 generates bitmap data based on the buffered object and stores it in the buffer of the storage unit 103. The image processing unit 102 performs color conversion processing, edge enhancement processing, and the like in the processing for generating bitmap data. Details will be described later.
記憶部103は、例えばROM、RAM、及びハードディスク(HD)などから構成される。ROMは、CPU104が実行する各種の制御プログラムや画像処理プログラムを格納する。RAMは、CPU104がデータや各種情報を格納する参照領域や作業領域として用いられる。また、RAMとHDは、上記のオブジェクトバッファの記憶などに用いられる。また、画像処理に必要な処理パラメータも併せて記憶しておく。このRAMとHD上で画像データを蓄積し、ページのソートや、ソートされた複数ページにわたる原稿を蓄積し、複数部プリント出力を行う。 The storage unit 103 includes, for example, a ROM, a RAM, and a hard disk (HD). The ROM stores various control programs and image processing programs executed by the CPU 104. The RAM is used as a reference area or work area in which the CPU 104 stores data and various types of information. The RAM and HD are used for storing the object buffer. Further, processing parameters necessary for image processing are also stored. Image data is stored on the RAM and HD, the pages are sorted, the originals over the sorted pages are stored, and a plurality of copies are printed out.
画像出力部105は、記録紙などの記録媒体にカラー画像を形成して出力する。UI部106は、画像処理部での画像処理の種類やレベル調整等を装置へ指示するための操作を行う。例えば前述の画像処理の調整量等の設定を行う。送受信部107は、外部からプリント用の画像データを受け取り記憶部103への保存や画像出力部105への出力を行う。また記憶部103内に蓄積されている画像データを機器の外へ送信出力する。 The image output unit 105 forms and outputs a color image on a recording medium such as recording paper. The UI unit 106 performs an operation for instructing the apparatus to perform image processing type and level adjustment in the image processing unit. For example, the adjustment amount of the image processing described above is set. The transmission / reception unit 107 receives image data for printing from the outside, saves it in the storage unit 103, and outputs it to the image output unit 105. In addition, the image data stored in the storage unit 103 is transmitted and output outside the device.
なお、本実施形態においては、画像処理装置は、例えば図1に示すような構成を有する装置、例えばMFP(Multifunction Peripheral)を例に挙げて説明するが、画像処理装置はこれに限られるものではない。すなわち、画像データを扱う装置であればどのような装置であってもよく、例えばPCなどの情報処理装置や撮像装置などでもよい。 In the present embodiment, the image processing apparatus will be described by taking an example of an apparatus having a configuration as shown in FIG. 1, for example, an MFP (Multifunction Peripheral), but the image processing apparatus is not limited to this. Absent. That is, any device that handles image data may be used, and for example, an information processing device such as a PC or an imaging device may be used.
次に、本実施形態の画像処理部102において行なわれる画像のエッジ強調処理に関して図2を用いて詳細に説明する。以降のフローに示される処理はCPU104からの命令を元に画像処理部102により実行される。なお、画像処理部102に入力される画像データは各画素RGBの3色から構成されており、横方向(行方向)と縦方向(列方向)の画素配列として構成されているものとする。 Next, image edge enhancement processing performed in the image processing unit 102 of the present embodiment will be described in detail with reference to FIG. The processing shown in the subsequent flow is executed by the image processing unit 102 based on a command from the CPU 104. The image data input to the image processing unit 102 is composed of three colors of each pixel RGB, and is configured as a pixel array in the horizontal direction (row direction) and the vertical direction (column direction).
まずステップS201において画像処理部102は、入力されたRGB画像データに対して色変換処理を行う。例えば、画像処理部102は、RGBの色空間から輝度と色差系の色空間に画素値を変換する処理を行なう。ここではRGB成分からYCbCrへの色変換を行う。色変換式を以下に示す。
Y = 0.2990 * R + 0.5870 * G + 0.1140 * B
Cb = -0.1687 * R - 0.3313 * G + 0.5000 * B
Cr = 0.5000 * R - 0.4187 * G - 0.0813 * B … 式(1)
First, in step S201, the image processing unit 102 performs color conversion processing on the input RGB image data. For example, the image processing unit 102 performs a process of converting a pixel value from an RGB color space to a luminance and color difference color space. Here, color conversion from RGB components to YCbCr is performed. The color conversion formula is shown below.
Y = 0.2990 * R + 0.5870 * G + 0.1140 * B
Cb = -0.1687 * R-0.3313 * G + 0.5000 * B
Cr = 0.5000 * R-0.4187 * G-0.0813 * B ... Equation (1)
式(1)においては、入力のRGB画像のRedの信号値(例えば8bitの信号であれば0〜255の値)をR、同GreenをG、同BlueをBと表している。式(1)は、入力のRGB成分をY(0〜255の値)Cb(−128〜127の値)Cr(−128〜127の値)に変換する処理を示している。この変換により入力のRGB画像は輝度Yと色差Cb、Crとへ分離される。ステップS201において画像処理部102は、入力されたRGB画像データの全ての画素について色変換処理を行なう。すなわち、各画素がRGB値を有するデータから、各画素がYCbCr値を有するデータに変換が行なわれる。 In Expression (1), the Red signal value (for example, a value of 0 to 255 for an 8-bit signal) of the input RGB image is represented by R, the Green is represented by G, and the Blue is represented by B. Expression (1) shows a process of converting the input RGB component into Y (value of 0 to 255) Cb (value of −128 to 127) Cr (value of −128 to 127). By this conversion, the input RGB image is separated into luminance Y and color differences Cb and Cr. In step S201, the image processing unit 102 performs color conversion processing on all the pixels of the input RGB image data. That is, conversion is performed from data in which each pixel has RGB values to data in which each pixel has YCbCr values.
次にステップS202において画像処理部102は、処理中の画素である注目画素の位置が画素配列中の偶数行か奇数行かを判定する。すなわち、注目画素が偶数行に位置するか奇数行に位置するかを判定する。0行目、2行目、4行目・・といった偶数行であると判定した場合には続くステップS203に処理を進め、そうでない奇数行の場合にはステップS205に処理を飛ばす。 Next, in step S <b> 202, the image processing unit 102 determines whether the position of the pixel of interest that is the pixel being processed is an even row or an odd row in the pixel array. That is, it is determined whether the pixel of interest is located in an even row or an odd row. If it is determined that the line is an even line such as the 0th line, the 2nd line, the 4th line,..., The process proceeds to the next step S203, and if not, the process skips to step S205.
次にステップS203において画像処理部102は、ステップS201における色変換処理後の画素をフィルタウィンドウ分切り出す。色変換後の画素には、前述のように輝度情報Yおよび色差情報CbCrの信号が含まれている。画像処理部102は、色変換後の画像からある決まったサイズのウィンドウに対応する画素を切り出す。具体的には、本実施形態では行方向に5画素、列方向に5画素の5x5のウィンドウとする。本実施形態においては、注目画素を中心とした5x5のウィンドウサイズに対応する画素(計25画素)を切り出す。この場合、注目画素が画像データにおける偶数行に位置することになる。なお、ここでは5x5のウィンドウを例に挙げて説明したがウィンドウサイズはこれに限られるものではない。 Next, in step S203, the image processing unit 102 cuts out the pixels after the color conversion processing in step S201 by the filter window. The pixels after the color conversion include the luminance information Y and color difference information CbCr signals as described above. The image processing unit 102 cuts out pixels corresponding to a window having a certain size from the color-converted image. Specifically, in this embodiment, a 5 × 5 window having 5 pixels in the row direction and 5 pixels in the column direction is used. In the present embodiment, pixels (a total of 25 pixels) corresponding to a 5 × 5 window size centered on the target pixel are cut out. In this case, the target pixel is located in an even number line in the image data. Although a 5 × 5 window has been described as an example here, the window size is not limited to this.
次にステップS204において画像処理部102は、ステップS203で切り出したウィンドウ内の各画素の輝度Yの信号に対してフィルタマトリクスを畳みこむことでエッジ成分の算出を行う。一般的なエッジ強調の手法としてはラプラシアンフィルタを用いて2次微分にあたるエッジ成分を計算し、その値を原画像の信号値に加算するといった手法が用いられる。ステップS204では、まずエッジ成分の算出までの処理を各画素について行なう。この2次微分成分の計算を、例えば以下に示すフィルタマトリクスを用いて行う。 In step S204, the image processing unit 102 calculates an edge component by convolving a filter matrix with the luminance Y signal of each pixel in the window cut out in step S203. As a general edge enhancement technique, a technique is used in which an edge component corresponding to the second derivative is calculated using a Laplacian filter and the value is added to the signal value of the original image. In step S204, first, processing up to the calculation of the edge component is performed for each pixel. The calculation of the secondary differential component is performed using, for example, the following filter matrix.
このフィルタマトリクスは、5x5のサイズのマトリクスであり、各要素にはフィルタ係数が含まれている。ステップS203で切り出されたウィンドウ内の各画素の輝度値をこのフィルタマトリクスを用いて畳み込みを行なう。すなわち、ステップS303で切り出されたウィンドウ内の左上に位置する画素の輝度値とフィルタマトリクス内の左上に位置する係数(−0.09)とを乗算する。また、ウィンドウ内の左上から一つ右にずらした位置の画素の輝度値と、フィルタマトリクス内の左上から一つ右にずらした係数とを乗算する。このような乗算を25画素分全てに行い、25画素分の得られた値を全て加算する。このように求められた加算後の値が注目画素(ここでは5x5のウィンドウ内の中央の画素)のエッジ成分として抽出される。 This filter matrix is a matrix having a size of 5 × 5, and each element includes a filter coefficient. The brightness value of each pixel in the window cut out in step S203 is convolved using this filter matrix. That is, the luminance value of the pixel located at the upper left in the window cut out in step S303 is multiplied by the coefficient (−0.09) located at the upper left in the filter matrix. Further, the luminance value of the pixel shifted to the right from the upper left in the window is multiplied by the coefficient shifted to the right from the upper left in the filter matrix. Such multiplication is performed for all 25 pixels, and all the obtained values for 25 pixels are added. The added value obtained in this way is extracted as the edge component of the target pixel (here, the center pixel in the 5 × 5 window).
このように、5x5のフィルタマトリクスの中心(この例だと1.08を乗じる位置)がこのウィンドウの注目画素になり、この位置の出力結果となる。このフィルタマトリクスのサイズはステップS203において切り出されるウィンドウのサイズ以下にする必要がある。フィルタマトリクスの方がサイズが大きいと畳み込みで演算されない画素が出てくるので正しくエッジ成分を求められないからである。このステップS204の畳み込み処理は輝度Yに対してのみ行い色差CbCrに対しては行わない。こうすることで明るさのみ強調され、エッジ部の色変化をある程度抑える事が可能になる。このようにして得られた輝度のエッジ成分をdYとして以降扱う。求められた輝度のエッジ成分は、例えば記憶部103内に画像データの画素数と同じサイズの画素数のデータ配列を設けて、注目画素の対応する位置にそれぞれ格納される。 In this way, the center of the 5 × 5 filter matrix (in this example, the position multiplied by 1.08) is the target pixel of this window, and the output result at this position. The size of the filter matrix needs to be equal to or smaller than the size of the window cut out in step S203. This is because if the size of the filter matrix is larger, pixels that are not calculated by convolution appear, so that the edge component cannot be obtained correctly. The convolution process in step S204 is performed only for the luminance Y and not for the color difference CbCr. In this way, only the brightness is enhanced, and the color change at the edge portion can be suppressed to some extent. The luminance edge component thus obtained is treated as dY hereinafter. The obtained luminance edge components are stored in corresponding positions of the target pixel, for example, by providing a data array having the same number of pixels as the number of pixels of the image data in the storage unit 103.
ステップS204において画像処理部102は、画像データに含まれるすべての画素に対して処理を行ったかを判定する。未処理の画素がある場合、ステップS202に戻り、注目画素を別の画素に変えて処理を繰り返す。 In step S204, the image processing unit 102 determines whether all pixels included in the image data have been processed. When there is an unprocessed pixel, the process returns to step S202, and the process is repeated by changing the target pixel to another pixel.
図3は、畳み込み処理の結果の得られる各画素の輝度のエッジ成分と、このエッジ成分を原画像の輝度値に加算した場合の各画素の輝度変化とを2次元のグラフで表した図である。図3では、各画素の座標は横軸の一次元で表している。破線301で示したグラフが入力輝度Yの信号値のグラフである。実線302は各画素における入力輝度値に応じて算出されて出力されたエッジ成分dYのグラフになる。実線303は、破線301で示す入力の輝度値に実線302で示すエッジ成分を各画素について加算した場合の結果の輝度値を示している。実線303で示すように、輝度の変化が起っている場所で、暗いところはより暗く、明るい側はより明るくコントラストが現れる。言い変えるとこのエッジ成分dYはエッジ強調処理を行った前後の差分信号と取る事もできる。なお、図3では入力輝度にエッジ成分を加算している例を説明しているが、ステップS205の処理の時点ではまだエッジ成分は加算していない。その後の処理においてエッジ成分の加算が行なわれる。その様子を、続くステップS206から説明する。 FIG. 3 is a two-dimensional graph showing the edge component of the luminance of each pixel obtained as a result of the convolution process and the luminance change of each pixel when this edge component is added to the luminance value of the original image. is there. In FIG. 3, the coordinates of each pixel are represented in one dimension on the horizontal axis. A graph indicated by a broken line 301 is a graph of the signal value of the input luminance Y. A solid line 302 is a graph of the edge component dY calculated and output according to the input luminance value in each pixel. A solid line 303 indicates a luminance value as a result when the edge component indicated by the solid line 302 is added to the input luminance value indicated by the broken line 301 for each pixel. As indicated by a solid line 303, in a place where the luminance change occurs, the dark part is darker and the bright side is brighter and the contrast appears. In other words, the edge component dY can be taken as a difference signal before and after the edge enhancement processing. Note that FIG. 3 illustrates an example in which the edge component is added to the input luminance, but the edge component has not yet been added at the time of the processing in step S205. In the subsequent processing, edge components are added. This will be described from the following step S206.
ステップS206において画像処理部102は、処理中の注目画素の位置が画素配列中の偶数行か奇数行かを判定し、偶数行である場合と奇数行である場合で処理を切り替える。偶数行である場合には以下に続くステップS207の処理を行なう。奇数行である場合にはステップS208及びステップS209の処理を行う。 In step S <b> 206, the image processing unit 102 determines whether the position of the target pixel being processed is an even row or an odd row in the pixel array, and switches processing between the even row and the odd row. If it is an even line, the following step S207 is performed. If it is an odd row, the processing of step S208 and step S209 is performed.
注目画素の位置が偶数行である場合、ステップS207において画像処理部102は、ステップS201の処理で求めた注目画素の輝度信号Yに対し、ステップS204で求めたその注目画素のエッジ成分dYを加算し、エッジ強調後の輝度信号Y’を生成する。 When the position of the target pixel is an even row, in step S207, the image processing unit 102 adds the edge component dY of the target pixel obtained in step S204 to the luminance signal Y of the target pixel obtained in the process of step S201. Then, the luminance signal Y ′ after edge enhancement is generated.
一方、注目画素の位置が奇数行である場合においても、本来、画像処理部102は、ステップS201の処理で求めた注目画素の輝度信号Yに対して、ステップS207の処理と同様に注目画素のエッジ成分dYを加算したい。しかしながら画像処理部102は、その注目画素の位置でのエッジ成分dYをステップS204で求めていない。そのため、ステップS208において画像処理部102は、注目画素が含まれている行の上下行の画素から注目画素の位置でのエッジ成分dYを補間生成する。例えば処理中の注目画素の横方向の座標をx、縦方向の座標をy(yは奇数)とした時のdYの値をdY(x,y)と表現すると、その未知のdY(x,y)を以下の式(2)で求める。
dY(x,y) = (dY(x,y-1) + dY(x,y+1)) / 2 … 式(2)
On the other hand, even when the position of the target pixel is an odd row, the image processing unit 102 originally uses the target pixel luminance signal Y obtained in step S201 in the same manner as in step S207. I want to add the edge component dY. However, the image processing unit 102 has not obtained the edge component dY at the position of the target pixel in step S204. For this reason, in step S208, the image processing unit 102 generates an edge component dY at the position of the target pixel from the pixels in the upper and lower rows of the row including the target pixel by interpolation. For example, when the horizontal coordinate of the target pixel being processed is x, and the vertical coordinate is y (y is an odd number), the dY value is expressed as dY (x, y). y) is obtained by the following equation (2).
dY (x, y) = (dY (x, y-1) + dY (x, y + 1)) / 2 ... Equation (2)
これは結果として、1画素分上下の画素に対してステップS204のステップでフィルタマトリクスを畳み込んで得られたそれぞれの値を、式(2)で示すようにさらに足して2で割った値となる。図4を用いてその様子を説明する。処理中の注目画素の位置401を中心とした5x7のウィンドウ402を考える。ここで、注目画素の前の行(図4では一つ上の画素位置)で処理した画素の位置403の畳み込みの結果は、次のように考えられる。すなわち、画素の位置403を中心として破線で示した5x5のウィンドウ404内の画素に対して、下2行0を加えた下記のフィルタBを畳み込んだ結果と等価である。 As a result, the respective values obtained by convolving the filter matrix in the step S204 with respect to the upper and lower pixels by one pixel are further added and divided by 2 as shown in the equation (2). Become. This will be described with reference to FIG. Consider a 5 × 7 window 402 centered on the position 401 of the pixel of interest being processed. Here, the result of the convolution of the pixel position 403 processed in the row before the target pixel (the pixel position one level up in FIG. 4) can be considered as follows. That is, it is equivalent to the result of convolution of the following filter B with the bottom two rows 0 added to the pixels in the 5 × 5 window 404 indicated by a broken line with the pixel position 403 as the center.
下2行に0を加えた部分についてはエッジ成分としての計算に使われないので、ステップS304で説明した5x5のマトリクスフィルタを用いた結果と同じになる。 The portion obtained by adding 0 to the lower two rows is not used for the calculation as an edge component, and thus is the same as the result using the 5 × 5 matrix filter described in step S304.
同様に、注目画素の位置401の後ろの行(図では一つ下の画素位置)で処理した画素の位置405の畳み込みの結果は、次のように考えられる。すなわち、画素の位置405を中心として破線で示した5x5のウィンドウ406内の画素に対して、上2行0を加えた下記のフィルタCを畳み込んだ結果と等価となる。 Similarly, the result of convolution of the pixel position 405 processed in the row after the pixel position 401 of interest (the pixel position one lower in the figure) is considered as follows. That is, this is equivalent to the result of convolution of the following filter C with the upper two rows 0 added to the pixels in the 5 × 5 window 406 indicated by the broken line with the pixel position 405 as the center.
そして、前述のように注目画素の位置401の補間結果は、上記の2つのフィルタを用いて畳み込みを行なった結果を足して、2で割ったものとなる。これは、実数演算をしている限り、上記の2つのフィルタマトリクスを足して2で割った5x7の下記のフィルタDを5x7のウィンドウ内の画素に畳み込んだ結果と等価になる。 As described above, the interpolation result at the position 401 of the target pixel is obtained by adding the results of the convolution using the two filters and dividing the result by 2. This is equivalent to the result of convolution of the following 5 × 7 filter D, which is obtained by adding the above two filter matrices and dividing by 2 as long as a real number operation is performed, into pixels in the 5 × 7 window.
このフィルタDの周波数応答は、横方向については、元のステップS204で用いたフィルタAの畳み込み結果とほぼ等価な応答になる。また、このときの演算量は2画素分のエッジ成分を加算して2で割るだけで済むので、5x5の25画素の乗加算を行なう場合と比べて無視出来るレベルに減る。 The frequency response of the filter D is substantially equivalent to the convolution result of the filter A used in the original step S204 in the horizontal direction. Also, the amount of calculation at this time is only required to add edge components for two pixels and divide by two, so that the amount of computation is reduced to a level that can be ignored compared to the case of multiplying and adding 25 pixels of 5 × 5.
このようにステップS208のエッジ成分補間処理では、式(2)に従ってエッジ成分dYを求める。そして、ステップS209において画像処理部102は、ステップS207と同様に、ステップS201の処理で求めた輝度信号YにステップS208で求めたエッジ成分dYを加算し、エッジ処理強調後の輝度信号Y’を生成する。 As described above, in the edge component interpolation processing in step S208, the edge component dY is obtained according to the equation (2). In step S209, as in step S207, the image processing unit 102 adds the edge component dY obtained in step S208 to the luminance signal Y obtained in step S201 to obtain the luminance signal Y ′ after edge processing enhancement. Generate.
次に、ステップS210において画像処理部102は、輝度、色差の色空間からRGBの色空間へ色変換する。この計算はステップS201で行った色変換の逆行列演算にあたり式としては以下の様な式になる。
R = Y' + 1.4020 * Cr
G = Y' - 0.3441 * Cb - 0.7141 * Cr
B = Y' + 1.7720 * Cb … 式(3)
Next, in step S210, the image processing unit 102 performs color conversion from the luminance / color difference color space to the RGB color space. This calculation is based on the following equation for the inverse matrix calculation of the color conversion performed in step S201.
R = Y '+ 1.4020 * Cr
G = Y '-0.3441 * Cb-0.7141 * Cr
B = Y '+ 1.7720 * Cb… (3)
式(3)では、輝度信号としてエッジ強調後の輝度信号Y’が用いられている。ステップS211では全ての画素について処理を行なったかを判定し、未処理の画素があれば注目画素を変更してステップS206に処理を戻す。 In Expression (3), the luminance signal Y ′ after edge enhancement is used as the luminance signal. In step S211, it is determined whether all pixels have been processed. If there is an unprocessed pixel, the target pixel is changed, and the process returns to step S206.
このように、偶数行の画素に対してフィルタ畳み込み演算によりエッジ強調を行う。一方で、奇数行の画素については偶数行で得られたエッジ成分を補間することによりエッジ強調を行なう。このような処理によれば、画像データを構成する全画素に対して畳み込み演算を行うのに対して演算量を半分程度に抑制することが可能になる。 In this way, edge enhancement is performed on even-numbered pixels by filter convolution. On the other hand, for the pixels in the odd rows, edge enhancement is performed by interpolating the edge components obtained in the even rows. According to such processing, the amount of calculation can be reduced to about half compared to the convolution calculation performed on all the pixels constituting the image data.
なお本実施形態ではエッジ強調を行う色空間として輝度色差色空間YCbCrを用いたが、輝度色差系の色空間であればL*a*b*等他の色空間でも同様の事が実現できる。また色変換を行わずRGB画像のままRGB信号値それぞれに対して処理を行っても効果は得られる。またRGBを入力としたが、Gray画像や、CMYK画像でもその効果が損なわれる訳ではない。また、画像データの画素配列のうち、一定周期の画素に対して畳み込み演算を行ない、一定周期に該当しない画素について補間演算を行なう例を説明した。すなわち、偶数行に対して畳み込み演算を行い奇数行で補間を行う例を説明したが、偶数奇数を入れ替えても当然同等の効果が得られる。同様に行単位では無く列単位で畳み込み演算と補間を切り替える事も可能である。また行列共に間引いて畳み込み演算することも可能である。 In this embodiment, the luminance color difference color space YCbCr is used as the color space for edge enhancement, but the same can be realized in other color spaces such as L * a * b * as long as the color space is a luminance color difference system. Further, the effect can be obtained by performing processing on each of the RGB signal values as they are without performing color conversion. Although RGB is used as an input, the effect is not impaired even with a Gray image or a CMYK image. Further, an example has been described in which a convolution operation is performed on pixels having a fixed period in the pixel array of image data, and an interpolation operation is performed on pixels that do not correspond to the fixed period. That is, the example in which the convolution calculation is performed on the even-numbered rows and the interpolation is performed on the odd-numbered rows has been described. Similarly, it is possible to switch between convolution calculation and interpolation not in units of rows but in units of columns. It is also possible to perform a convolution operation by thinning out both matrices.
また本実施形態ではエッジ成分を算出した後にその結果を元の信号に加算することでエッジ強調画像を求める例を説明したが、それに限らずエッジ強調前後の信号値差を算出する事ができれば(dYが算出出来れば)別の処理に応用してもよい。例えばエッジ強調に限らず、スムージングの処理等にも適用は可能である。 In the present embodiment, the edge component is calculated, and the result is added to the original signal to obtain the edge enhanced image. However, the present invention is not limited to this, and if the signal value difference before and after edge enhancement can be calculated ( It may be applied to another process (if dY can be calculated). For example, the present invention can be applied not only to edge enhancement but also to smoothing processing.
また本実施形態ではフィルタ畳み込み演算を用いたオーソドックスなエッジ強調処理に関して説明したが、先に述べたように処理前後の信号値差を算出することができればそれに限らない。例えば黒い文字を判定しエッジ強調のパラメータを切り替えるような処理に対して本実施形態を適用することも可能である。 In this embodiment, the orthodox edge enhancement processing using the filter convolution operation has been described. However, the present invention is not limited to this as long as the signal value difference before and after the processing can be calculated as described above. For example, the present embodiment can be applied to a process of determining a black character and switching an edge enhancement parameter.
なお、本実施形態で説明した処理により得られる奇数行の補間結果は必ずしも偶数行でのフィルタ畳み込み結果と等価にはならない。前述したように横方向の周波数応答はほぼ同じを示しているが、縦方向の応答は大きく異なる。この結果、画像によっては不自然な周期の縞が出てしまう場合も起こりうる。しかしながら解像度が高い画像の入力であればそれが気になる事は少ない。 Note that the odd-numbered row interpolation result obtained by the processing described in this embodiment is not necessarily equivalent to the even-numbered filter convolution result. As described above, the frequency response in the horizontal direction is almost the same, but the response in the vertical direction is greatly different. As a result, depending on the image, stripes with an unnatural period may occur. However, if an image with high resolution is input, there is little concern.
外部装置とネットワークなどを介して接続された場合、そこから送受信部107経由で受信される画像データは、送信元のオリジナルのデータによってさまざまな解像度の画像データであることが考えられる。それらを画像処理部102はプリント出力される解像度に拡大もしくは縮小処理する事になる。 When connected to an external device via a network or the like, the image data received from the transmission / reception unit 107 may be image data with various resolutions depending on the original data of the transmission source. The image processing unit 102 enlarges or reduces the resolution to a print output resolution.
そこでそれらの入力画像の解像度が処理後に縞が気になるほど低いと判定された場合には偶数行でも奇数行でも一様にフィルタ畳み込み演算を行うよう入力の解像度に応じて処理を切り替える構成でもよい。つまり、画像処理部102は、入力画像の解像度が所定の閾値より大きいか否かを判定し、所定の閾値より大きい場合に、図2に示すフローに従ったエッジ強調処理を行う。一方、入力画像の解像度が所定の閾値以下である場合、偶数行か奇数行かによって処理を切り替えるのではなく、いずれについても一様にフィルタ畳み込み演算を行う。入力画像の解像度が所定の閾値以下であるということは画素数が減るということになるので、処理に必要な演算量も少なくなる。つまり、トータルの処理時間は変わらないので、フィルタ畳み込み演算が膨大となってしまう事態はそもそも生じないので前述したような課題は生じなくなる。 Therefore, when it is determined that the resolution of those input images is low enough to cause stripes after processing, the processing may be switched in accordance with the input resolution so that the filter convolution operation is uniformly performed in even rows and odd rows. . That is, the image processing unit 102 determines whether or not the resolution of the input image is greater than a predetermined threshold value, and performs edge enhancement processing according to the flow illustrated in FIG. On the other hand, when the resolution of the input image is equal to or less than a predetermined threshold value, the filter convolution operation is uniformly performed for both, instead of switching the processing depending on whether the row is an even row or an odd row. If the resolution of the input image is less than or equal to the predetermined threshold, the number of pixels is reduced, and the amount of calculation required for processing is also reduced. That is, since the total processing time does not change, the situation where the filter convolution calculation becomes enormous does not occur in the first place, and thus the above-described problem does not occur.
[実施形態2]
実施形態1においては画像の偶数行と奇数行とでフィルタ畳み込み演算する画素と補間で生成する画素との切り替えを行っていた。しかしながら前述したように結果として得られる出力画像は全画素に対してフィルタ畳み込み演算を行った結果とは異なり、画像によっては偶数行と奇数行との切り替えにより縞の様なテクスチャが出てしまう事が起こりうる。これは前述のようにステップS208における補間処理で実質的に用いられていることに相当するフィルタDの周波数応答が縦方向と横方向とで異なる応答をすることに起因している。
[Embodiment 2]
In the first embodiment, switching between a pixel that is subjected to filter convolution calculation and a pixel that is generated by interpolation is performed between even and odd lines of an image. However, as described above, the output image obtained as a result is different from the result obtained by performing the filter convolution operation on all the pixels, and depending on the image, a texture such as a stripe may appear by switching between the even and odd lines. Can happen. This is due to the fact that the frequency response of the filter D, which is substantially used in the interpolation processing in step S208 as described above, has different responses in the vertical direction and the horizontal direction.
そこで本実施形態2では補間処理で実質的に用いられていることに相当するフィルタの縦と横との周波数応答差を軽減しながらエッジ強調におけるフィルタ畳み込み演算に必要な演算量を削減する構成に関して説明する。なお、実施形態1と同様である画像処理装置の構成に関しての記載および重複するフローの説明は割愛し、本実施形態でポイントとなる点に主眼をおいて説明する。 Therefore, in the second embodiment, a configuration that reduces the amount of calculation necessary for filter convolution calculation in edge enhancement while reducing the frequency response difference between the vertical and horizontal of the filter that is substantially used in the interpolation processing. explain. Note that the description regarding the configuration of the image processing apparatus, which is the same as that of the first embodiment, and the description of the overlapping flows are omitted, and the description will focus on the points that are important in this embodiment.
本実施形態の画像処理部102における画像へのエッジ強調処理に関して図5を用いて詳細に説明する。以降のフローに示される処理はCPU104からの命令を元に画像処理部102により処理される。 The edge enhancement processing for an image in the image processing unit 102 according to the present embodiment will be described in detail with reference to FIG. The processing shown in the subsequent flow is processed by the image processing unit 102 based on a command from the CPU 104.
また実施形態1と同様に入力の画像データは各画素RGBの3色から構成されており、横方向(行方向)と縦方向(列方向)の配列として構成されているものとする。 Similarly to the first embodiment, the input image data is composed of three colors of each pixel RGB, and is configured as an array in the horizontal direction (row direction) and the vertical direction (column direction).
まずステップS501において画像処理部102は、入力のRGB画像データに対して色変換処理を行い輝度と色差系の色空間、ここではRGB成分からYCbCrへの色変換を行う。詳細説明はステップS201と同様のため割愛する。 First, in step S501, the image processing unit 102 performs color conversion processing on input RGB image data, and performs color conversion from a luminance and color-difference color space, here, RGB components to YCbCr. Detailed description is omitted because it is the same as step S201.
ステップS502において画像処理部102は、処理中の注目画素の位置が画像配列中の偶数行かつ偶数列か、または、奇数行かつ奇数列か、もしくはそれ以外か、を判定する。これは具体的には横方向の座標をx、縦方向の座標をyとした時に、x,y共に偶数またはx,y共に奇数の時と、それ以外の場合、すなわちxが偶数かつyが奇数またはxが奇数かつyが偶数の場合とで処理を切り替えるための判定になる。x,y共に偶数または共に奇数の場合には続くステップS503の処理に進み、そうでない場合にはステップS505に処理を飛ばす。つまり千鳥格子状に処理を飛ばしていくことになる。 In step S <b> 502, the image processing unit 102 determines whether the position of the target pixel being processed is an even-numbered row and an even-numbered column, an odd-numbered row and an odd-numbered column, or any other number in the image array. Specifically, when the horizontal coordinate is x and the vertical coordinate is y, both x and y are even or both x and y are odd, and in other cases, that is, x is even and y is The determination for switching the process is performed when the odd number or x is an odd number and y is an even number. If both x and y are even or odd, the process proceeds to the subsequent step S503. Otherwise, the process skips to step S505. In other words, processing is skipped in a staggered pattern.
次にステップS503およびステップS504のステップで画像処理部102が行う処理は、それぞれステップS203およびステップS204で説明した内容と同じであるため、説明は割愛する。 Next, the processing performed by the image processing unit 102 in step S503 and step S504 is the same as that described in step S203 and step S204, respectively.
このステップS504までの処理をすべての画像データに含まれる全ての画素に対して行う。これらの処理により、画像上において千鳥格子状にステップS503およびステップS504の処理を行って千鳥格子状の画素にてエッジ成分を算出していく事になる。その後にエッジ成分の加算処理を行っていく様子を続くステップS506から説明する。 The processing up to step S504 is performed for all the pixels included in all the image data. With these processes, the processing in steps S503 and S504 is performed in a staggered pattern on the image, and the edge components are calculated in the staggered pixels. After that, the process of adding edge components will be described from the subsequent step S506.
ステップS506のステップにおいて画像処理部102は、ステップS502と同様に処理中の注目画素の位置が画素配列中の偶数行かつ偶数列か、または、奇数行かつ奇数列か、もしくはそれ以外か、を判定し処理を切り替える。偶数行かつ偶数列、または、奇数行かつ奇数列の場合には以下に続くステップS507を行い、それ以外である場合にはステップS508およびS509の処理を行う。 In step S506, the image processing unit 102 determines whether the position of the pixel of interest being processed is an even-numbered row and an even-numbered column, an odd-numbered row and an odd-numbered column, or other than that in step S502. Judge and switch processing. If it is an even-numbered row and an even-numbered column, or an odd-numbered row and an odd-numbered column, the following step S507 is performed. Otherwise, the processing of steps S508 and S509 is performed.
ステップS507のステップにおいて画像処理部102は、ステップS501の処理で求めた注目画素の輝度信号Yに対し、注目画素のエッジ成分dYを加算し、エッジ強調後の輝度信号Y’を生成する。 In step S507, the image processing unit 102 adds the edge component dY of the target pixel to the luminance signal Y of the target pixel obtained in the process of step S501, and generates a luminance signal Y ′ after edge enhancement.
一方、ステップS508のステップにおいても画像処理部102は、ステップS501の処理で求めた注目画素の輝度信号Yに対し、ステップS506の処理と同様に注目画素のエッジ成分dYを加算したい。しかしながら画像処理部102は、その注目画素の位置でのエッジ成分dYをステップS504では求めていない。そのため、ステップS508において画像処理部102は、注目画素の上下および左右の画素から注目画素の位置でのエッジ成分dYを補間生成する。本実施形態においては、千鳥格子状にエッジ成分を求めているので、実施形態1のステップS208で説明した上下の画素からの補間だけでなく、左右の画素も用いた補間が可能になる。処理中の注目画素の横方向の座標をx,縦方向の座標をyとした時のエッジ成分dYの値をdY(x,y)と表現する。すなわちdY(x,y)は未知であり、それに隣接する画素のエッジ成分dY(x−1,y),dY(x+1,y),dY(x,y−1),dY(x,y+1)はそれぞれステップS504で処理済みで既知となっている。この注目画素の上下左右の画素の既知のエッジ成分を用いて注目画素の未知のエッジ成分dY(x,y)を補間推定する。 On the other hand, also in the step S508, the image processing unit 102 wants to add the edge component dY of the target pixel to the luminance signal Y of the target pixel obtained in the process of step S501 as in the process of step S506. However, the image processing unit 102 has not obtained the edge component dY at the position of the target pixel in step S504. For this reason, in step S508, the image processing unit 102 interpolates and generates an edge component dY at the position of the target pixel from the upper and lower and left and right pixels of the target pixel. In the present embodiment, since edge components are obtained in a staggered pattern, not only interpolation from the upper and lower pixels described in step S208 of the first embodiment but also interpolation using left and right pixels is possible. The value of the edge component dY when the horizontal coordinate of the target pixel being processed is x and the vertical coordinate is y is expressed as dY (x, y). That is, dY (x, y) is unknown, and edge components dY (x-1, y), dY (x + 1, y), dY (x, y-1), dY (x, y + 1) of pixels adjacent to it are unknown. Are already processed in step S504 and are already known. An unknown edge component dY (x, y) of the target pixel is interpolated and estimated using known edge components of the upper, lower, left, and right pixels of the target pixel.
その補間の式は、例えば、
dY(x,y) = (dY(x,y-1) + dY(x,y+1) + dY(x-1,y) + dY(x+1,y))×α / 2 … 式(4)
で求める。ここでαの値は正の実数でフィルタゲインを調整するパラメータであり、1より大きければよりエッジ強調の強度を強くする事になるパラメータになる。この値は元のステップS204で示したフィルタと結果を近づけるためのパラメータとなる。当然乗算を伴うため処理時間に影響する。なお、式(4)では4点の既知のエッジ成分から補間演算を行う際に、4ではなく2で除算を行っている。この理由は、エッジというものは類似の値が連続している方向と、値が連続していない境界となる方向とから構成されるからである。たとえば、縦線のエッジを考えると、上下方向の画素については類似の値が連続している。一方で、左右方向の画素については値が異なるものになる。4で除算を行うということは、エッジ強調に寄与する画素とエッジ強調に寄与しない画素との両方を考慮した価を求めることになる。しかしながら、本質的にはエッジ強調に寄与する画素のみから補間をすることが望ましい。そこで本実施形態ではエッジ強調に寄与する画素から補間を行なうことを目的として、2で除算を行っている。つまり、本実施形態の処理によれば、結果としてこのエッジ強調に寄与しない画素の関連性を弱めることができる。なお、もちろん蓋然性の問題であり、2で除算を行うことでエッジ強調に寄与する画素とエッジ強調に寄与しない画素との関連性をすべて解決できるわけではない。そこで、本実施形態では、パラメータとしてαを乗算することでフィルタゲインを調整している。
The interpolation formula is, for example,
dY (x, y) = (dY (x, y-1) + dY (x, y + 1) + dY (x-1, y) + dY (x + 1, y)) x α / 2 ... (Four)
Ask for. Here, the value of α is a parameter that adjusts the filter gain as a positive real number. This value is a parameter for bringing the result closer to the filter shown in the original step S204. Naturally, multiplication is involved, which affects the processing time. In equation (4), when interpolation is performed from four known edge components, division is performed by 2 instead of 4. This is because an edge is composed of a direction in which similar values are continuous and a direction that is a boundary in which values are not continuous. For example, considering vertical line edges, similar values are continuous for pixels in the vertical direction. On the other hand, the values of the pixels in the left-right direction are different. Dividing by 4 is to obtain a value considering both pixels that contribute to edge enhancement and pixels that do not contribute to edge enhancement. However, it is essentially desirable to interpolate only from pixels that contribute to edge enhancement. Therefore, in this embodiment, division by 2 is performed for the purpose of performing interpolation from pixels that contribute to edge enhancement. That is, according to the process of the present embodiment, the relevance of pixels that do not contribute to edge enhancement can be weakened as a result. Of course, this is a probability problem, and division by 2 does not solve all the relevance between pixels that contribute to edge enhancement and pixels that do not contribute to edge enhancement. Therefore, in this embodiment, the filter gain is adjusted by multiplying α as a parameter.
本実施形態ではαを1として以下説明を行う。αを1とした場合、結果として、ステップS204で示したフィルタマトリクスを注目画素の1画素分上下左右にずらしたマトリクスで注目画素の上下左右の5x5の画素をそれぞれ畳み込む。そして、それぞれ畳み込んだ値を式(4)に従い足して2で割ったものになる。この様子を図6を用いて説明する。注目画素の位置601前の行で処理した画素の位置603の畳み込みの結果は、次のように考えられる。すなわち、画素の位置603を中心として破線で示した5x5のウィンドウ604内の画素に対して、下2行0と、左右列に0とを埋めた下記のフィルタEを畳み込んだ結果と等価である、 In the present embodiment, the following description will be made assuming that α is 1. When α is 1, as a result, 5 × 5 pixels on the top, bottom, left and right of the target pixel are convolved with a matrix in which the filter matrix shown in step S204 is shifted up, down, left and right by one pixel of the target pixel. Then, the respective convolved values are added according to Equation (4) and divided by 2. This will be described with reference to FIG. The result of convolution of the pixel position 603 processed in the row before the target pixel position 601 is considered as follows. That is, it is equivalent to the result of convolving the following filter E in which the lower two rows 0 and the left and right columns are filled with 0 in the pixel in the 5 × 5 window 604 indicated by a broken line with the pixel position 603 as the center. is there,
同様に注目画素の位置601の後ろの行で処理した画素の位置605の畳み込みの結果は、次のように考えられる。すなわち、画素の位置605を中心とした5x5ウィンドウ606内の画素に対して、上2行0と、左右0とを埋めた下記のフィルタFを畳み込んだ結果と等価である。 Similarly, the result of convolution of the pixel position 605 processed in the row after the target pixel position 601 is considered as follows. That is, this is equivalent to the result of convolving the following filter F in which the upper two rows 0 and the left and right 0s are filled with respect to the pixels in the 5 × 5 window 606 centered on the pixel position 605.
同様に同様に注目画素の位置601の左の列で処理した画素の位置607の畳み込みの結果は次のように考えられる。すなわち、画素の位置607を中心とした5x5ウィンドウ608内の画素に対して、右2列0と、上下0とを埋めた下記のフィルタGを畳み込んだ結果と等価である。 Similarly, the result of convolution of the pixel position 607 processed in the left column of the target pixel position 601 is considered as follows. That is, it is equivalent to the result of convolution of the following filter G in which the right two columns 0 and the upper and lower 0 are filled in the pixels in the 5 × 5 window 608 centered on the pixel position 607.
同様に、注目画素の位置601の右の行で処理した画素の位置609の畳み込み結果は次のように考えられる。すなわち、画素の位置609を中心とした5x5ウィンドウ610内の画素に対して、左2列0と、上下0とを埋めた下記のフィルタHを畳み込んだ結果と等価である。 Similarly, the convolution result of the pixel position 609 processed in the right row of the target pixel position 601 is considered as follows. That is, it is equivalent to the result of convolving the following filter H in which the left two columns 0 and the upper and lower 0 are filled in the pixels in the 5 × 5 window 610 centered on the pixel position 609.
このように、式(4)は上下左右の各画素の位置における各フィルタを用いてそれぞれ対応するウィンドウ内の画素に畳み込みをした結果を足して、2で割ったものになる。 Thus, Expression (4) is obtained by adding the result of convolution to the pixels in the corresponding window using the filters at the positions of the upper, lower, left and right pixels, and dividing the result by 2.
つまり処理中の注目画素の位置601を中心とした7x7のウィンドウ602はすなわち、実数演算をしている限りフィルタE〜Hを足して2で割った下記のフィルタIを用いてウィンドウ602の画素に畳み込みをした結果と等価になる。 In other words, the 7 × 7 window 602 centered on the target pixel position 601 being processed is added to the pixels of the window 602 using the following filter I, which is obtained by adding the filters E to H and dividing by 2 as long as the real number calculation is performed. Equivalent to the result of convolution.
このフィルタIの周波数応答は縦横方向に均等な応答になり、演算量は5x5の25画素の乗加算に対して無視出来るレベルに減る。またここで先のステップS508で説明した式(4)で示したαを1以外の値例えばβとすれば、このフィルタマトリクスすべてにその値βが乗じられたものと等価になる。 The frequency response of the filter I becomes a uniform response in the vertical and horizontal directions, and the amount of calculation is reduced to a level that can be ignored with respect to the multiplication and addition of 5 × 5 25 pixels. Here, if α shown in the equation (4) described in the previous step S508 is a value other than 1, for example, β, this is equivalent to all the filter matrices multiplied by the value β.
図7を用いてフィルタIの周波数応答の例を示す。フィルタIのフィルタマトリクスは横方向および縦方向に完全に同じ値になっているためFFTした結果は同じになる。図7では横方向の1次元の周波数とその時のゲインを示した図としている。ステップS504で用いた(すなわち、実施形態1のステップS204で説明した)5x5のフィルタAのフィルタマトリクスが実線701の様な周波数応答を示している。これに対して、上で示した7x7のフィルタIのフィルタマトリクスの周波数応答は破線702の様になる。この場合ピークの周波数がマトリクスが大きくなることにより低周波側にずれ、そのピーク時のゲインも大きく変化している。式(4)で示したαを1未満、例えば0.8程度にした場合の周波数応答を線703に示す。αを制御することでそのピークゲインの調整が可能になり、この値を用いる事で周波数帯こそずれるがピークゲインは元の5x5のフィルタAのフィルタマトリクスと同等に制御することが可能になる。 An example of the frequency response of the filter I is shown using FIG. Since the filter matrix of the filter I has completely the same value in the horizontal direction and the vertical direction, the result of the FFT is the same. FIG. 7 shows the one-dimensional frequency in the horizontal direction and the gain at that time. The filter matrix of the 5 × 5 filter A used in step S504 (that is, described in step S204 of the first embodiment) shows a frequency response like a solid line 701. On the other hand, the frequency response of the filter matrix of the 7 × 7 filter I shown above is as shown by a broken line 702. In this case, the peak frequency shifts to the low frequency side as the matrix increases, and the gain at the peak also changes greatly. A line 703 shows a frequency response when α shown in the equation (4) is less than 1, for example, about 0.8. By controlling α, the peak gain can be adjusted. By using this value, the frequency band is shifted, but the peak gain can be controlled in the same manner as the filter matrix of the original 5 × 5 filter A.
ステップS509において画像処理部102は、このようにして求めた注目画素のエッジ成分dYをステップS507と同様に、ステップS501の処理で求めた注目画素の輝度信号Yに加算し、エッジ強調後の輝度信号Y’を生成する。 In step S509, the image processing unit 102 adds the edge component dY of the pixel of interest obtained in this way to the luminance signal Y of the pixel of interest obtained in the processing of step S501 in the same manner as in step S507, and luminance after edge enhancement A signal Y ′ is generated.
次に、ステップS510のステップにおいて画像処理部102は、輝度、色差の色空間から出力のRGBの色空間へ色変換する。この計算はステップS210で説明行った内容と同じであるため説明を割愛する。ステップS511では全ての画素について処理を行なったかを判定し、未処理の画素があれば注目画素を変更してステップS506に処理を戻す。 Next, in step S510, the image processing unit 102 performs color conversion from the luminance and color difference color space to the output RGB color space. Since this calculation is the same as that described in step S210, the description is omitted. In step S511, it is determined whether all pixels have been processed. If there is an unprocessed pixel, the target pixel is changed, and the process returns to step S506.
このように、本実施形態では、千鳥格子状に画像に対してフィルタ畳み込み演算によるエッジ強調を行い、残りの位置を簡単な演算で補間する。このような処理により、画像データを構成する全画素に対して畳み込み演算を行うのに対して演算量を半分程度に抑制することが可能になる。 Thus, in the present embodiment, edge enhancement is performed on the image in a staggered pattern by filter convolution, and the remaining positions are interpolated by simple calculation. By such processing, it is possible to suppress the calculation amount to about half compared to performing the convolution calculation for all the pixels constituting the image data.
また先の実施形態1に対して不揃いだった縦方向、横方向の周波数応答が揃い、また図7で示したように、フィルタゲインの調整も行われるため強調される周波数帯こそ異なるが、不自然な縞の発生も押さえる事が可能になる。 In addition, the vertical and horizontal frequency responses that were not uniform with respect to the previous embodiment 1 are aligned, and as shown in FIG. It is possible to suppress the occurrence of natural stripes.
[実施形態3]
実施形態1および2において簡単な補間演算を用いる事でフィルタ演算処理を間引いて計算量を削減する方法に関して説明した。しかしながら結果として得られる出力画像は全画素に対してフィルタ畳み込み演算を行った結果とは異なり、画像によっては縞や千鳥格子状のテクスチャが出る場合がある。これは実施形態1のステップS208では縦横の周波数応答差が、実施形態2のステップS508では強調される周波数帯が一致しない事に起因する。
[Embodiment 3]
In the first and second embodiments, the method of reducing the amount of calculation by thinning out the filter calculation processing by using a simple interpolation calculation has been described. However, the output image obtained as a result is different from the result obtained by performing the filter convolution operation on all the pixels, and depending on the image, there may be a stripe or a staggered texture. This is because the vertical and horizontal frequency response differences in step S208 of the first embodiment do not match the frequency bands emphasized in step S508 of the second embodiment.
そこで本実施形態3では画像に応じて、縦方向の補間を用いるか横方向の補間を用いるかを切り替えながら、エッジ強調におけるフィルタ畳み込み演算に必要な演算量を削減する構成に関して説明する。なお、実施形態1および2と同様である画像処理装置の構成に関しての記載および重複するフローの説明は割愛し、本実施形態においてポイントとなる点に主眼をおいて説明する。 Therefore, in the third embodiment, a configuration for reducing the amount of calculation necessary for the filter convolution calculation in edge enhancement while switching between using the vertical interpolation and the horizontal interpolation according to the image will be described. Note that description regarding the configuration of the image processing apparatus, which is the same as in the first and second embodiments, and description of overlapping flows are omitted, and the description will focus on points that are important in the present embodiment.
本実施形態の画像処理部102における画像へのエッジ強調処理に関して詳細に説明する。なおフロー図は先の実施形態2と変わらないためその説明は割愛し、本実施形態で大きく違いがあるステップS508のエッジ成分補間に関して詳細説明する。 An edge enhancement process for an image in the image processing unit 102 according to the present embodiment will be described in detail. Since the flowchart is the same as that of the second embodiment, the description thereof is omitted, and the edge component interpolation in step S508, which is greatly different in the present embodiment, will be described in detail.
本実施形態におけるステップS508のステップで画像処理部102は、処理中の注目画素の行の上下行の画素、または、左右列の画素から、注目画素の位置でのエッジ成分dYを補間生成する。注目画素の横方向の座標をx、縦方向の座標をyとした時のエッジ成分dYの値を実施形態2と同様にdY(x,y)と表現する。すなわち実施形態2同様に注目画素のエッジ成分dY(x,y)は未知でありる。一方、注目画素の上下左右の画素のエッジ成分dY(x−1,y),dY(x+1,y),dY(x,y−1),dY(x,y+1)はそれぞれステップS504で処理済みで既知となっている。本実施形態では、この未知の注目画素のエッジ成分dY(x,y)を実施形態2で説明した手法とは別の手法で補間推定する。 In step S508 in the present embodiment, the image processing unit 102 generates an edge component dY at the position of the target pixel by interpolation from the pixels in the upper and lower rows of the target pixel row being processed or the pixels in the left and right columns. The value of the edge component dY when the horizontal coordinate of the pixel of interest is x and the vertical coordinate is y is expressed as dY (x, y) as in the second embodiment. That is, the edge component dY (x, y) of the pixel of interest is unknown as in the second embodiment. On the other hand, the edge components dY (x-1, y), dY (x + 1, y), dY (x, y-1), and dY (x, y + 1) of the upper, lower, left, and right pixels of the target pixel have been processed in step S504. It is already known. In the present embodiment, the edge component dY (x, y) of this unknown target pixel is interpolated and estimated by a method different from the method described in the second embodiment.
処理中の画像が縦線であった場合、注目画素の上下に位置する画素のエッジ成分dY(x,y−1)およびdY(x,y+1)は近い値を取り、注目画素の左右に位置する画素のエッジ成分dY(x−1,y)およびdY(x+1,y)は大きく異なる値になる。逆に横線の場合は注目画素の左右に位置する画素のエッジ成分dY(x−1,y)およびdY(x+1,y)は近い値を取り、注目画素の上下に位置する画素のエッジ成分dY(x,y−1)およびdY(x,y+1)は大きく異なる値になる。 When the image being processed is a vertical line, the edge components dY (x, y−1) and dY (x, y + 1) of pixels located above and below the target pixel take close values and are positioned on the left and right sides of the target pixel. The edge components dY (x−1, y) and dY (x + 1, y) of the pixels to be processed have significantly different values. Conversely, in the case of a horizontal line, the edge components dY (x−1, y) and dY (x + 1, y) of the pixels located on the left and right of the target pixel take close values, and the edge components dY of the pixels positioned above and below the target pixel. (X, y-1) and dY (x, y + 1) are greatly different values.
これを図3を再度用いて説明する。この図の場合は1次元で表現されているが、実線302の変化はエッジの箇所にてエッジがある向きに対して大きく変化している。 This will be described using FIG. 3 again. In the case of this figure, it is expressed in one dimension, but the change of the solid line 302 changes greatly with respect to the direction in which the edge is located at the edge portion.
本実施形態においては図3の座標方向を横方向xとし、画像がy方向に続く縦線と仮定する。なお、画像が縦線の場合、y方向については変化がない。従って、画像が縦線の場合に仮に図3を、y方向を横軸の座標方向とした図(不図示)にすると、実線302はy方向には連続して同じ形になる。つまり、画像が縦線の場合、注目画素の左右の画素のエッジ成分dY(x−1)とdY(x+1)との差は大きくなる。一方で、上下の画素のエッジ成分dY(y−1)とdY(y+1)との差は小さい。 In the present embodiment, it is assumed that the coordinate direction in FIG. 3 is the horizontal direction x, and the image is a vertical line continuing in the y direction. When the image is a vertical line, there is no change in the y direction. Therefore, if the image is a vertical line, assuming that FIG. 3 is a diagram (not shown) in which the y direction is the coordinate direction of the horizontal axis, the solid line 302 has the same shape continuously in the y direction. That is, when the image is a vertical line, the difference between the edge components dY (x−1) and dY (x + 1) of the left and right pixels of the target pixel is large. On the other hand, the difference between the edge components dY (y−1) and dY (y + 1) of the upper and lower pixels is small.
この特徴を利用し、本実施形態では処理中のウィンドウに含まれる画像が縦方向のエッジなのか横方向のエッジなのかをこのエッジ成分dYの差から判定し、上下から結果を補間するか、左右から結果を補間するか切り替える。 Using this feature, in the present embodiment, whether the image included in the window being processed is a vertical edge or a horizontal edge is determined from the difference between the edge components dY, and the result is interpolated from above and below, Switch between interpolating the results from the left and right.
もし(dY(x,y−1) − dY(x,y+1))の絶対値が、(dY(x−1,y) − dY(x+1,y))の絶対値より小さい場合には、注目画素が含まれるウィンドウ内の画像は縦線と判定する。そして、注目画素のエッジ成分dY(x,y)の結果は類似の周波数応答を有すると考えられる上下の画素について求めたエッジ成分から下記の式(5)で導かれる値を用いる。
dY(x,y) = (dY(x,y-1) + dY(x,y+1)) / 2 … 式(5)
If the absolute value of (dY (x, y−1) −dY (x, y + 1)) is smaller than the absolute value of (dY (x−1, y) −dY (x + 1, y)) The image in the window including the pixel is determined as a vertical line. The result of the edge component dY (x, y) of the target pixel uses a value derived from the edge component obtained for the upper and lower pixels considered to have a similar frequency response by the following equation (5).
dY (x, y) = (dY (x, y-1) + dY (x, y + 1)) / 2 ... Equation (5)
もし逆に(dY(x−1,y) − dY(x+1,y))の絶対値が、(dY(x,y−1) − dY(x,y+1))の絶対値より小さい場合には横線と判定する。そして、注目画素のエッジ成分dY(x,y)の結果は類似の周波数応答を有すると考えられる左右の画素について求めたエッジ成分から下記の式(6)で導かれる値を用いる。
dY(x,y) = (dY(x-1,y) + dY(x+1,y)) / 2 … 式(6)
Conversely, if the absolute value of (dY (x-1, y) −dY (x + 1, y)) is smaller than the absolute value of (dY (x, y−1) −dY (x, y + 1)). Judged as a horizontal line. The result of the edge component dY (x, y) of the target pixel uses a value derived from the edge component obtained for the left and right pixels considered to have a similar frequency response by the following equation (6).
dY (x, y) = (dY (x-1, y) + dY (x + 1, y)) / 2 ... Equation (6)
こうすることで、画像が縦線であった場合の横方向の周波数応答は補間で作られた結果とほぼ同等になり、同様に横線であった場合の縦方向の周波数応答もほぼ同等になる。 By doing this, the horizontal frequency response when the image is a vertical line is almost the same as the result made by interpolation, and the vertical frequency response when the image is a horizontal line is also almost the same. .
このようなフローで千鳥格子状に画像に対してフィルタ畳み込み演算によりエッジ強調を行い、残りの位置を簡単な判定を用いて補間する。これにより、画像データを構成する全画素に対して畳み込み演算を行うのに対して演算量を半分程度に抑制することが可能になる。 With such a flow, edge emphasis is performed on the image in a staggered pattern by filter convolution, and the remaining positions are interpolated using simple determination. As a result, it is possible to reduce the calculation amount to about half compared to performing the convolution calculation for all the pixels constituting the image data.
また先の実施形態に対して画像特徴を用いて切り替えを行うことで、間引かれた画素とそうでない画素の周波数応答が揃い、不自然な縞や千鳥格子状のテクスチャの発生も押さえる事が可能になる。 In addition, by switching using the image feature for the previous embodiment, the frequency response of the thinned pixels and the pixels that are not the same are aligned, and generation of unnatural stripes and staggered textures can be suppressed. Is possible.
<その他の実施形態>
実施形態2や3では、千鳥格子状にエッジ成分を算出し、エッジ強調処理が行われていない画素については上下左右の画素について処理が行われたエッジ成分を用いて補間演算を行う例を説明した。しかしながら、この例に限られることはなく、エッジ強調処理が行われていない画素について周囲の画素について処理が行われたエッジ成分を用いて補間演算を行う形態であればよい。また、補間の態様によっては上下左右の画素を用いて補間するのではなく、斜めに位置する画素を用いて補間演算を行ってもよい。
<Other embodiments>
In the second and third embodiments, the edge components are calculated in a staggered pattern, and the interpolation calculation is performed on the pixels that have not been subjected to the edge enhancement processing using the edge components that have been processed on the upper, lower, left, and right pixels. explained. However, the present invention is not limited to this example, and any form may be used as long as the interpolation calculation is performed using the edge components that have been processed for the surrounding pixels for the pixels that have not been subjected to the edge enhancement processing. Further, depending on the mode of interpolation, interpolation may be performed using pixels located diagonally, instead of using upper, lower, left, and right pixels.
また、各実施形態の処理では、すべての画素についてエッジ成分を算出した後に、各画素についてエッジ成分を付加する処理を行う例を説明した。しかしながら、メモリ容量の関係でエッジ強調処理を画素ごとに逐次行うような形態であってもよい。たとえば、実施形態1の例を挙げて説明する。まず第0行目と第2行目については、エッジ強調処理が行われる。そして、第0行目と第2行目の各画素についてのエッジ成分が、エッジ強調処理後の画素値とエッジ強調処理前の画素値との差分から算出される。その後、第1行目の各画素については、第0行目と第2行目について算出されたエッジ成分を用いた補間処理と補間されたエッジ成分を付加するエッジ強調処理が行われる。このように、逐次処理によって同様の処理を行ってもよい。 In the processing of each embodiment, an example has been described in which processing for adding an edge component to each pixel is performed after the edge components have been calculated for all pixels. However, a form in which edge enhancement processing is sequentially performed for each pixel due to the memory capacity may be employed. For example, an example of the first embodiment will be described. First, edge enhancement processing is performed for the 0th and 2nd rows. Then, the edge component for each pixel in the 0th row and the 2nd row is calculated from the difference between the pixel value after the edge enhancement processing and the pixel value before the edge enhancement processing. Thereafter, for each pixel in the first row, interpolation processing using the edge components calculated for the 0th row and the second row and edge enhancement processing for adding the interpolated edge components are performed. In this way, similar processing may be performed by sequential processing.
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。 The present invention supplies a program that realizes one or more functions of the above-described embodiments to a system or apparatus via a network or a storage medium, and one or more processors in a computer of the system or apparatus read and execute the program This process can be realized. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.
Claims (13)
前記抽出手段で抽出されていない注目画素のエッジ成分を、前記注目画素に隣接する画素の前記抽出手段で抽出されたエッジ成分を用いた補間演算により算出する算出手段と
を有する画像処理装置。 An extracting means for extracting an edge component of a pixel having a constant period among the pixels included in the input image;
An image processing apparatus comprising: a calculation unit that calculates an edge component of a pixel of interest that has not been extracted by the extraction unit by interpolation using an edge component extracted by the extraction unit of a pixel adjacent to the pixel of interest.
前記算出手段は、前記注目画素の上下に位置する画素の前記抽出手段で抽出されたエッジ成分を用いた補間演算を行なうことを特徴とする請求項1から3のいずれか一項に記載の画像処理装置。 The fixed period is a row unit of the pixel array of the input image,
The image according to any one of claims 1 to 3, wherein the calculation means performs an interpolation operation using the edge components extracted by the extraction means for pixels located above and below the target pixel. Processing equipment.
前記算出手段は、前記注目画素の左右に位置する画素の前記抽出手段で抽出されたエッジ成分を用いた補間演算を行なうことを特徴とする請求項1から3のいずれか一項に記載の画像処理装置。 The fixed period is a column unit of the pixel array of the input image,
The image according to any one of claims 1 to 3, wherein the calculation means performs an interpolation operation using the edge components extracted by the extraction means for pixels located on the left and right of the target pixel. Processing equipment.
前記算出手段は、前記注目画素の上下左右に位置する画素の前記抽出手段で抽出されたエッジ成分を用いた補間演算を行なうことを特徴とする請求項1から3のいずれか一項に記載の画像処理装置。 The fixed period is a period of a staggered lattice of the pixel array of the input image,
The said calculation means performs the interpolation calculation using the edge component extracted by the said extraction means of the pixel located in the upper, lower, right, and left of the said attention pixel, The one of Claim 1 to 3 characterized by the above-mentioned. Image processing device.
前記抽出ステップで抽出されていない注目画素のエッジ成分を、前記注目画素に隣接する画素の前記抽出ステップで抽出されたエッジ成分を用いた補間演算により算出する算出ステップと
を有する画像処理方法。 An extraction step of extracting an edge component of a pixel having a certain period among the pixels included in the input image;
An image processing method comprising: calculating an edge component of a pixel of interest that has not been extracted in the extraction step by an interpolation operation using the edge component extracted in the extraction step of a pixel adjacent to the pixel of interest.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2015121084A JP2017005660A (en) | 2015-06-16 | 2015-06-16 | Image processing apparatus and image processing method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2015121084A JP2017005660A (en) | 2015-06-16 | 2015-06-16 | Image processing apparatus and image processing method |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2017005660A true JP2017005660A (en) | 2017-01-05 |
Family
ID=57751920
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2015121084A Pending JP2017005660A (en) | 2015-06-16 | 2015-06-16 | Image processing apparatus and image processing method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2017005660A (en) |
-
2015
- 2015-06-16 JP JP2015121084A patent/JP2017005660A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP6649750B2 (en) | Image processing apparatus and image processing method | |
| CN101902550B (en) | Image processing apparatus, image processing method | |
| JP6031286B2 (en) | Image processing apparatus and image processing method | |
| JP6418788B2 (en) | Image processing apparatus, image processing method, and program | |
| JP6489761B2 (en) | Image processing apparatus, image processing method, and program | |
| JP6417851B2 (en) | Image processing apparatus and computer program | |
| CN106303150B (en) | Image processing apparatus, control method for image processing apparatus, and storage medium | |
| US8619330B2 (en) | Image processing apparatus and image processing method | |
| JP6923037B2 (en) | Image processing equipment, image processing methods and programs | |
| JP6271874B2 (en) | Image processing apparatus and image processing method | |
| JP2019092101A (en) | Image processing apparatus, image processing method, and program | |
| JP2007336555A (en) | Image processing apparatus, image forming apparatus, and image processing method | |
| JP2022145776A (en) | Image processing device and image processing method | |
| JP6486082B2 (en) | Image processing apparatus, image processing method, and program | |
| JP4261201B2 (en) | Image processing apparatus, image processing method, image processing program, and storage medium | |
| JP2017005660A (en) | Image processing apparatus and image processing method | |
| JP6380763B2 (en) | Image forming apparatus, color conversion program, and color conversion method | |
| JP4792893B2 (en) | Image processing apparatus and program | |
| JP2014143512A (en) | Image processing device and image processing method | |
| US8537413B2 (en) | Image processing apparatus, image processing method, and computer-readable storage medium | |
| JP2008271131A (en) | Image processing method, image processing apparatus, and image forming apparatus | |
| JP2018174418A (en) | Image processing apparatus and computer program | |
| JP2015149545A (en) | Image processing apparatus, control method thereof, and program | |
| JP2022141319A (en) | IMAGE PROCESSING DEVICE, CONTROL METHOD FOR IMAGE PROCESSING DEVICE, AND PROGRAM | |
| JP5632937B2 (en) | Image processing apparatus and method, and computer program |