JP2005086687A - Method and program for interpolation processing, recording medium having recorded the same, image processor, and image forming apparatus provided with the same - Google Patents

Method and program for interpolation processing, recording medium having recorded the same, image processor, and image forming apparatus provided with the same Download PDF

Info

Publication number
JP2005086687A
JP2005086687A JP2003318763A JP2003318763A JP2005086687A JP 2005086687 A JP2005086687 A JP 2005086687A JP 2003318763 A JP2003318763 A JP 2003318763A JP 2003318763 A JP2003318763 A JP 2003318763A JP 2005086687 A JP2005086687 A JP 2005086687A
Authority
JP
Japan
Prior art keywords
pixel
interpolation
surrounding
pixels
correction coefficient
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
Application number
JP2003318763A
Other languages
Japanese (ja)
Inventor
Teruhiko Matsuoka
輝彦 松岡
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sharp Corp
Original Assignee
Sharp Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sharp Corp filed Critical Sharp Corp
Priority to JP2003318763A priority Critical patent/JP2005086687A/en
Publication of JP2005086687A publication Critical patent/JP2005086687A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4007Scaling of whole images or parts thereof, e.g. expanding or contracting based on interpolation, e.g. bilinear interpolation

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)
  • Editing Of Facsimile Originals (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide an interpolation processing method capable of suppressing an increase in processing time and obtaining a high-quality image, an interpolation processing program, and a recording medium for recording the interpolation processing program, and to provide an image processor capable of suppressing an increase in the scale of the processor and processing costs and generating the high-quality image, and an image forming apparatus provided with the image processor. <P>SOLUTION: The position of an interpolation pixel P in an original image is calculated for extracting the position of periphery pixels P1-P4 of the interpolation pixel P and 8 close pixels positioned around the periphery pixels (S2). The periphery pixel that is closest to the position of the interpolation pixel P is selected as a reference periphery pixel (S4). Based on the position of a plurality of extracted periphery pixels, the close pixels, and the image data, the amount of the vector in each periphery pixel other than the reference periphery pixel and the reference periphery pixel is calculated each (S5-S10). On the basis of the amount of vector, the pixel data of the interpolation pixel are outputted (S11). <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は、画像を構成する複数の画素の階調値を表す画素データを用いて、画素間に設定される補間画素の画素データを生成する補間処理方法および補間処理プログラムならびに補間処理プログラムを記録した記録媒体に関し、さらに画像を構成する複数の画素の階調値を表す画素データを用いて、画素間に設定される補間画素の画素データを生成する補間処理手段を備える画像処理装置およびこれを備えた画像形成装置に関する。   The present invention records an interpolation processing method, an interpolation processing program, and an interpolation processing program for generating pixel data of an interpolation pixel set between pixels using pixel data representing gradation values of a plurality of pixels constituting an image. In addition, the image processing apparatus further includes an interpolation processing unit that generates pixel data of an interpolation pixel set between pixels using pixel data representing gradation values of a plurality of pixels constituting the image. The present invention relates to an image forming apparatus provided.

画像処理の1つとして、画像を構成する既存の画素の画素データに基づいて新たな画素データを求めて補間画素を生成する補間処理が行われている。一般的な補間処理方法としては、画像中の一定領域に存在する複数の画素の画素データを用いて、その領域の内部に新たな画素データを生成する内挿補間法が用いられる。この内挿補間法の代表的なものとして、最近隣内挿法(ニアレストネイバ法:Nearest Neighbor、以下「NN」と表記する)、共1次線形内挿法(バイリニア法:Bi-liner、以下「BL」と表記する)および3次畳み込み内挿法(バイキュービック法:Bi-Cubic convolution、以下「BC」と表記する)などがある(たとえば、非特許文献1参照)。   As one of the image processes, an interpolation process is performed in which new pixel data is obtained based on pixel data of existing pixels constituting an image and an interpolation pixel is generated. As a general interpolation processing method, an interpolation method is used in which pixel data of a plurality of pixels existing in a certain area in an image is used to generate new pixel data within the area. As representative examples of this interpolation method, nearest neighbor interpolation method (Nearest Neighbor method: hereinafter referred to as “NN”), bilinear linear interpolation method (bilinear method: Bi-liner, (Hereinafter referred to as “BL”) and cubic convolution interpolation method (bi-cubic convolution, hereinafter referred to as “BC”) and the like (for example, see Non-Patent Document 1).

図11は、NNによる補間処理が施された画像の一部を示す図である。図12は、BLによる補間処理が施された画像の一部を示す図である。図13は、BCによる補間処理が施された画像の一部を示す図である。図11〜図13において、斜線を施した正方形は既存画素を表し、白地の正方形は補間画素を表している。また、正方形内の数字は、画素の濃度の階調値を表す画素データである。   FIG. 11 is a diagram illustrating a part of an image subjected to the interpolation processing by the NN. FIG. 12 is a diagram illustrating a part of an image subjected to the interpolation processing by BL. FIG. 13 is a diagram illustrating a part of an image subjected to interpolation processing by BC. In FIGS. 11 to 13, a hatched square represents an existing pixel, and a white square represents an interpolation pixel. The numbers in the square are pixel data representing the gradation value of the pixel density.

図11は、NNによる補間処理が施された画像の一部を示す図である。NNは、補間画素に1番近い既存画素、すなわち最近傍の既存画素の画素データを、補間画素の画素データとして生成する補間処理方法である。図11では、補間画素の最近傍となる既存画素として、補間画素の左、左上、あるいは真上の既存画素を選択している。たとえば、図中の右端から1番目で、かつ上端から2番目の補間画素x1の最近傍となる既存画素は、その真上の画素X1である。したがって、この真上の既存画素X1の画素データ「90」が、補間画素x1の画素データとして生成される。   FIG. 11 is a diagram illustrating a part of an image subjected to the interpolation processing by the NN. NN is an interpolation processing method for generating pixel data of an existing pixel closest to the interpolation pixel, that is, pixel data of the nearest existing pixel as pixel data of the interpolation pixel. In FIG. 11, the existing pixel that is the nearest neighbor of the interpolation pixel is selected from the left, upper left, or just above the interpolation pixel. For example, the existing pixel that is first from the right end and closest to the second interpolation pixel x1 from the upper end in the drawing is the pixel X1 directly above it. Therefore, the pixel data “90” of the existing pixel X1 directly above is generated as the pixel data of the interpolation pixel x1.

前述のように、NNは、最近傍の既存画素の画素データを補間画素の画素データとして生成するので、エッジ付近についてはエッジの鮮鋭性を保存するような画素データを生成することができる。また、NNによると、演算量が少なく、処理コストの抑制および処理の高速化が可能である。しかしながら、NNは単純な方法であるために、これによって生成された補間画素の画素データにはある程度の誤差が生じる。このため、NNによる補間処理が施された画像では、曲線および斜線が階段状になるいわゆるジャギーが発生し、画質が劣化する。   As described above, the NN generates the pixel data of the nearest existing pixel as the pixel data of the interpolated pixel. Therefore, pixel data that preserves the sharpness of the edge can be generated in the vicinity of the edge. Moreover, according to NN, the amount of calculation is small, processing cost can be suppressed and processing speed can be increased. However, since NN is a simple method, a certain amount of error occurs in the pixel data of the interpolation pixel generated thereby. For this reason, in an image that has been subjected to interpolation processing by NN, so-called jaggy in which curves and diagonal lines are stepped occurs, and the image quality deteriorates.

図12は、BLによる補間処理が施された画像の一部を示す図である。BLは、既存画素に対する補間画素の位置に基づいた重み係数を用いて2次の線形内挿補間を行い、補間画素の画素データを生成する補間処理方法である。図12では、補間画素の周囲にある4つの既存画素を用いて補間処理を行っている。たとえば、図中の右端から2番目で、かつ上端から2番目の補間画素x2についての4つの既存画素は、補間画素x2に対して、左上に位置する画素データ「80」の画素X2と、右上に位置する画素データ「90」の画素X3と、左下に位置する画素データ「20」の画素X4と、右下に位置する画素データ「30」の画素X5である。   FIG. 12 is a diagram illustrating a part of an image subjected to the interpolation processing by BL. BL is an interpolation processing method for generating pixel data of an interpolation pixel by performing a second-order linear interpolation using a weighting factor based on the position of the interpolation pixel with respect to an existing pixel. In FIG. 12, interpolation processing is performed using four existing pixels around the interpolation pixel. For example, the four existing pixels for the interpolation pixel x2 that is second from the right end and second from the upper end in the figure are the pixel X2 of the pixel data “80” positioned at the upper left with respect to the interpolation pixel x2, and the upper right The pixel X3 of the pixel data “90” located at the left, the pixel X4 of the pixel data “20” located at the lower left, and the pixel X5 of the pixel data “30” located at the lower right.

ここで、補間画素と周囲の4つの既存画素との距離は全て等しいものとし、4つの既存画素で構成される格子の一辺の距離を1とすると、線形内挿補間に用いる重み係数は、0.5(水平方向の距離)×0.5(垂直方向の距離)=0.25となる。したがって、補間画素x2の画素データは、周囲の既存画素X2〜X5の画素データ「80」、「90」、「20」および「30」それぞれに対して0.25を乗算し、乗算値の和を算出することによって、画素データ「55」が生成される。なお、ここでの演算では、小数点以下第1位を四捨五入している。   Here, assuming that all the distances between the interpolation pixel and the surrounding four existing pixels are equal, and the distance of one side of the grid formed by the four existing pixels is 1, the weighting coefficient used for linear interpolation is 0. 0.5 (horizontal distance) × 0.5 (vertical distance) = 0.25. Therefore, the pixel data of the interpolation pixel x2 is multiplied by 0.25 for each of the pixel data “80”, “90”, “20”, and “30” of the surrounding existing pixels X2 to X5, and the sum of the multiplication values is obtained. To calculate pixel data “55”. In this calculation, the first decimal place is rounded off.

前述のように、BLは、比較的少ない演算量で周囲の既存画素の画素データに近似した値を生成することができるので、画像を滑らかにすることができる。しかし、BLは、画像内のエッジ部分についても滑らかに処理するため、エッジを鈍らせてしまう。そのため、BLによる補間処理が施された画像では、画像がぼやけ、画質が劣化する。   As described above, BL can generate a value approximating the pixel data of the surrounding existing pixels with a relatively small amount of calculation, so that the image can be smoothed. However, since the BL processes the edge portion in the image smoothly, the edge becomes dull. For this reason, in the image subjected to the interpolation processing by BL, the image is blurred and the image quality is deteriorated.

図13は、BCによる補間処理が施された画像の一部を示す図である。BCは、3次の非線形内挿補間の1つであって、補間画素の周囲にある4つの既存画素と、その4つの既存画素の周囲にある12の既存画素を加えた合計16の既存画素を用いて演算処理を行う補間処理方法である。図13では、中央に位置する画素データ「18」の補間画素x3に対して、その周囲に位置する4つの既存画素X6〜X9と、その4つの既存画素X6〜X9の周囲に位置する12の既存画素X10〜X21、図13では最も外側に存在する12の既存画素とが用いられる。   FIG. 13 is a diagram illustrating a part of an image subjected to interpolation processing by BC. BC is one of the third-order nonlinear interpolations, and a total of 16 existing pixels including four existing pixels around the interpolation pixel and 12 existing pixels around the four existing pixels. This is an interpolation processing method for performing arithmetic processing using. In FIG. 13, with respect to the interpolation pixel x3 of the pixel data “18” located at the center, four existing pixels X6 to X9 positioned around the interpolation pixel x3 and twelve positions positioned around the four existing pixels X6 to X9. The existing pixels X10 to X21, and the 12 existing pixels existing on the outermost side in FIG. 13 are used.

BCは、正弦関数を用いて演算処理を行うため、画像を平滑化するとともに、エッジの鈍りも防止するので、滑らかで自然な画像を生成することができる。しかし、BCは、NNおよびBLに比べ、極めて複雑な演算処理を必要とするので、演算処理を実行する回路規模の増大を抑えることができず、結果として、装置規模の増大を抑えることができない。したがって、補間処理のためのコストがかさんでしまう。またBCは、複雑な演算処理を必要とするので、補間処理に要する時間が増大する。   Since BC performs arithmetic processing using a sine function, it smooths the image and prevents edge dullness, so that a smooth and natural image can be generated. However, since BC requires extremely complicated arithmetic processing as compared with NN and BL, an increase in the circuit scale for executing the arithmetic processing cannot be suppressed, and as a result, an increase in the device scale cannot be suppressed. . Therefore, the cost for the interpolation process is increased. Moreover, since BC requires complicated calculation processing, the time required for interpolation processing increases.

以上のように、前述の3つの内挿補間法にはそれぞれ欠点があるため、以下のような補間処理の技術が提案されている。   As described above, since each of the three interpolation methods described above has drawbacks, the following interpolation processing techniques have been proposed.

第1の従来技術は、画像処理の拡大、縮小倍率に応じて補間アルゴリズムを切替えることによって、特定の倍率付近で発生しやすくなるモアレ現象を抑制するように構成される。具体的には、モアレが発生しやすい倍率付近の補間処理にはBCを適用し、それ以外の倍率付近での補間処理にはNNおよびBLを適用する(たとえば、特許文献1参照)。   The first prior art is configured to suppress a moire phenomenon that tends to occur near a specific magnification by switching an interpolation algorithm according to the magnification and reduction magnification of image processing. Specifically, BC is applied to interpolation processing near the magnification at which moiré is likely to occur, and NN and BL are applied to interpolation processing near other magnifications (see, for example, Patent Document 1).

第2の従来技術は、中間調画像、あるいは、文字および線画などの非中間調画像といった画像の種類に応じて、画像処理の倍率を適宜切替えるように構成される(たとえば、特許文献2参照)。   The second prior art is configured to appropriately switch the magnification of image processing according to the type of image such as a halftone image or a non-halftone image such as a character and a line drawing (see, for example, Patent Document 2). .

特開2000−188689号公報Japanese Patent Laid-Open No. 2000-188689 特許第3190085号公報Japanese Patent No. 3190085 洪博哲著「お話・カラー画像処理」CQ出版、1999年4月1日、p.66−71Hirohiro Satoshi “Story / Color Image Processing” CQ Publishing, April 1, 1999, p. 66-71

前述のように、NNには、ジャギーの発生などによる画質の劣化という問題がある。また、BLには、画像のぼやけによる画質の劣化という問題がある。また、BCには、装置規模の増大、補間処理のためのコストの増大、処理時間の増大という問題がある。   As described above, the NN has a problem that the image quality is deteriorated due to the occurrence of jaggy. In addition, BL has a problem of image quality degradation due to image blurring. Further, BC has problems such as an increase in apparatus scale, an increase in cost for interpolation processing, and an increase in processing time.

また、特許文献1によると、モアレの発生を抑えることができるとともに、特定の倍率以外では演算量の少ないNNおよびBLを適用しているので、処理時間の増大をある程度抑えることができる。しかし、特定の倍率以外での補間処理には、NNおよびBLを適用するため、当該倍率の画質は劣化する。すなわち、特許文献1に記載の従来技術は、画像処理の拡大、縮小倍率によって、既存の補間処理方法を使い分けているだけであるので、画質改善が十分になされているとはいえない。   Further, according to Patent Document 1, it is possible to suppress the occurrence of moire and to apply NN and BL with a small amount of calculation other than a specific magnification, and thus it is possible to suppress an increase in processing time to some extent. However, since NN and BL are applied to interpolation processing other than a specific magnification, the image quality at that magnification deteriorates. That is, the prior art described in Patent Document 1 only uses the existing interpolation processing method properly depending on the enlargement / reduction ratio of the image processing, and it cannot be said that the image quality is sufficiently improved.

さらに、特許文献2によると、中間調画像、非中間調画像を異なる倍率で処理することによって、画像の特性に応じて補間処理を行うことができる。しかし、補間処理の倍率を切替えることによって、中間調画像と非中間調画像との境界が不連続となる場合があるので、高い画質が得られない。したがって、画質改善が十分になされているとはいえない。   Further, according to Patent Document 2, it is possible to perform interpolation processing according to image characteristics by processing halftone images and non-halftone images at different magnifications. However, since the boundary between the halftone image and the non-halftone image may become discontinuous by switching the magnification of the interpolation processing, high image quality cannot be obtained. Therefore, it cannot be said that the image quality has been sufficiently improved.

本発明の目的は、処理時間の増大を抑えつつ、高画質の画像を得ることができる補間処理方法および補間処理プログラムならびに補間処理プログラムを記録した記録媒体を提供することであり、また装置規模の増大および処理コストを抑えつつ、高画質の画像を生成することができる画像処理装置およびそれを備えた画像形成装置を提供することである。   An object of the present invention is to provide an interpolation processing method and an interpolation processing program capable of obtaining a high-quality image while suppressing an increase in processing time, and a recording medium on which the interpolation processing program is recorded. An image processing apparatus capable of generating a high-quality image while suppressing increase and processing cost, and an image forming apparatus including the image processing apparatus.

本発明は、画像を構成する複数の画素の階調値を表す画素データを用いて、前記画素間に設定される補間画素の画素データを生成する補間処理方法において、
前記補間画素の位置を算出する補間画素位置算出工程と、
前記補間画素の周囲に位置する複数の周囲画素の位置および画素データを抽出する周囲画素抽出工程と、
算出された補間画素の位置および抽出された複数の周囲画素の位置に基づいて、補間画素に最近接する周囲画素を基準の周囲画素として選択する基準周囲画素選択工程と、
前記周囲画素の周囲に位置する複数の近傍画素の位置および画素データを抽出する近傍画素抽出工程と、
抽出された複数の周囲画素およびその近傍画素に関連する画素情報に基づいて、一方の周囲画素と他方の周囲画素との関係を表す補正係数を算出する補正係数算出工程と、
算出された補正係数に基づいて、補間画素の画素データを生成する補間演算処理を行う補間演算処理工程とを含むことを特徴とする補間処理方法である。
The present invention relates to an interpolation processing method for generating pixel data of an interpolation pixel set between the pixels using pixel data representing gradation values of a plurality of pixels constituting an image.
An interpolation pixel position calculating step of calculating the position of the interpolation pixel;
A surrounding pixel extraction step of extracting the position and pixel data of a plurality of surrounding pixels located around the interpolation pixel;
A reference surrounding pixel selection step of selecting a surrounding pixel closest to the interpolation pixel as a reference surrounding pixel based on the calculated position of the interpolation pixel and the extracted positions of the plurality of surrounding pixels;
A neighboring pixel extracting step of extracting the positions and pixel data of a plurality of neighboring pixels located around the surrounding pixels;
A correction coefficient calculating step for calculating a correction coefficient representing a relationship between one peripheral pixel and the other peripheral pixel based on pixel information related to the plurality of extracted peripheral pixels and neighboring pixels;
And an interpolation calculation processing step of performing an interpolation calculation process for generating pixel data of the interpolation pixel based on the calculated correction coefficient.

さらに本発明は、前記補正係数算出工程は、
抽出された複数の周囲画素およびその近傍画素の画素データに対して量子化処理を行い、量子化データを算出する量子化処理工程と、
算出された周囲画素の量子化データと、近傍画素の量子化データとの差分絶対値を算出する差分絶対値算出工程と、
算出された差分絶対値と予め定める閾値とを比較し、予め定める閾値以下となる差分絶対値の算出に関わる近傍画素を選択する第1近傍画素選択工程と、
第1近傍画素選択工程で選択された近傍画素のうち、基準の周囲画素に最近接する近傍画素を選択する第2近傍画素選択工程と、
抽出された複数の周囲画素およびその近傍画素に関連する画素情報に基づいて、基準の周囲画素を除く各周囲画素の補正係数を算出する第1の補正係数算出工程と、
第1の補正係数算出工程で算出される各周囲画素の補正係数と予め定める閾値とを比較し、予め定める閾値以上となる補正係数を有する周囲画素を選択する周囲画素選択工程と、
抽出された複数の周囲画素およびその近傍画素に関連する画素情報に基づいて、基準の周囲画素の補正係数を算出する第2の補正係数算出工程とを含むことを特徴とする。
Further, in the present invention, the correction coefficient calculation step includes
A quantization processing step of performing quantization processing on the pixel data of the plurality of extracted surrounding pixels and the neighboring pixels, and calculating quantization data;
A difference absolute value calculating step of calculating a difference absolute value between the calculated quantized data of the surrounding pixels and the quantized data of neighboring pixels;
A first neighboring pixel selection step of comparing the calculated difference absolute value with a predetermined threshold and selecting neighboring pixels involved in calculating the difference absolute value that is equal to or less than the predetermined threshold;
A second neighboring pixel selecting step of selecting a neighboring pixel closest to the reference surrounding pixel among neighboring pixels selected in the first neighboring pixel selecting step;
A first correction coefficient calculation step of calculating a correction coefficient for each of the surrounding pixels excluding the reference surrounding pixel based on the pixel information related to the plurality of extracted surrounding pixels and its neighboring pixels;
A surrounding pixel selection step of comparing a correction coefficient of each surrounding pixel calculated in the first correction coefficient calculating step with a predetermined threshold and selecting a surrounding pixel having a correction coefficient equal to or greater than the predetermined threshold;
And a second correction coefficient calculating step of calculating a correction coefficient of the reference surrounding pixel based on the extracted pixel information related to the plurality of surrounding pixels and the neighboring pixels.

さらに本発明は、前記第1の補正係数算出工程では、基準の周囲画素を除く各周囲画素を始点とし、第2近傍画素選択工程で選択された近傍画素を終点とする第1ベクトルと、基準の周囲画素を除く各周囲画素を始点とし、基準の周囲画素を終点とする第2ベクトルとのなす角度に基づいて、基準の周囲画素を除く各周囲画素の補正係数を算出することを特徴とする。   In the first correction coefficient calculating step, the first vector having a surrounding pixel excluding the reference surrounding pixel as a starting point and a neighboring pixel selected in the second neighboring pixel selecting step as an end point, and a reference A correction coefficient of each surrounding pixel excluding the reference surrounding pixel is calculated based on an angle formed with the second vector having the surrounding pixel except the surrounding pixel as a starting point and the reference surrounding pixel as an end point. To do.

さらに本発明は、前記第2の補正係数算出工程では、周囲画素選択工程で選択されない各周囲画素の位置と補間画素の位置との距離に関する重み係数を求め、その総和に1を加算した数値を基準の周囲画素の補正係数として算出することを特徴とする。   Furthermore, in the second correction coefficient calculation step, the weight coefficient relating to the distance between the position of each surrounding pixel not selected in the surrounding pixel selection step and the position of the interpolation pixel is obtained, and a numerical value obtained by adding 1 to the sum is obtained. It is calculated as a correction coefficient for the reference surrounding pixels.

さらに本発明は、前記補間演算処理工程では、各周囲画素の補正係数と予め定める閾値とを比較し、予め定める閾値以上となる補正係数を有する周囲画素の画素データに基づいて、補間画素の画素データを生成する補間演算処理を行うことを特徴とする。   Further, according to the present invention, in the interpolation calculation processing step, the correction coefficient of each surrounding pixel is compared with a predetermined threshold, and the pixel of the interpolation pixel is based on the pixel data of the surrounding pixel having a correction coefficient equal to or greater than the predetermined threshold. Interpolation calculation processing for generating data is performed.

さらに本発明は、コンピュータに前記補間処理方法を実行させるための補間処理プログラムである。   Furthermore, the present invention is an interpolation processing program for causing a computer to execute the interpolation processing method.

さらに本発明は、前記補間処理プログラムを記録したコンピュータ読取り可能な記録媒体である。   Furthermore, the present invention is a computer-readable recording medium on which the interpolation processing program is recorded.

さらに本発明は、画像を構成する複数の画素の階調値を表す画素データを用いて、前記画素間に設定される補間画素の画素データを生成する補間処理手段を備え、入力された画像の画素間に設定された補間画素の画素データを求めて画像を出力する画像処理装置において、
前記補間処理手段は、
前記補間画素の位置を算出する補間画素位置算出手段と、
前記補間画素の周囲に位置する複数の周囲画素の位置および画素データを抽出する周囲画素抽出手段と、
算出された補間画素の位置および抽出された複数の周囲画素の位置に基づいて、補間画素に最近接する周囲画素を基準の周囲画素として選択する基準の周囲画素選択手段と、
前記周囲画素の周囲に位置する複数の近傍画素の位置および画素データを抽出する近傍画素抽出手段と、
抽出された複数の周囲画素およびその近傍画素に関連する画素情報に基づいて、一方の周囲画素と他方の周囲画素との関係を表す補正係数を算出する補正係数算出手段と、
算出された補正係数に基づいて、補間画素の画素データを生成する補間演算処理を行う補間演算処理手段とを含むことを特徴とする画像処理装置である。
The present invention further includes interpolation processing means for generating pixel data of interpolation pixels set between the pixels using pixel data representing gradation values of a plurality of pixels constituting the image, and In an image processing apparatus for obtaining pixel data of interpolated pixels set between pixels and outputting an image,
The interpolation processing means includes
Interpolation pixel position calculating means for calculating the position of the interpolation pixel;
Surrounding pixel extraction means for extracting the position and pixel data of a plurality of surrounding pixels located around the interpolation pixel;
A reference surrounding pixel selection means for selecting a surrounding pixel closest to the interpolation pixel as a reference surrounding pixel based on the calculated position of the interpolation pixel and the extracted positions of the plurality of surrounding pixels;
Neighboring pixel extracting means for extracting the position and pixel data of a plurality of neighboring pixels located around the surrounding pixel;
Correction coefficient calculating means for calculating a correction coefficient representing the relationship between one peripheral pixel and the other peripheral pixel based on the extracted pixel information related to the plurality of peripheral pixels and the neighboring pixels;
The image processing apparatus includes: an interpolation calculation processing unit that performs an interpolation calculation process for generating pixel data of an interpolation pixel based on the calculated correction coefficient.

さらに本発明は、前記補正係数算出手段は、
抽出された複数の周囲画素およびその近傍画素の画素データに対して量子化処理を行い、量子化データを算出する量子化処理手段と、
算出された周囲画素の量子化データと、近傍画素の量子化データとの差分絶対値を算出する差分絶対値算出手段と、
算出された差分絶対値と予め定める閾値とを比較し、予め定める閾値以下となる差分絶対値の算出に関わる近傍画素を選択する第1近傍画素選択手段と、
第1近傍画素選択手段によって選択された近傍画素のうち、基準の周囲画素に最近接する近傍画素を選択する第2近傍画素選択手段と、
抽出された複数の周囲画素およびその近傍画素に関連する画素情報に基づいて、基準の周囲画素を除く各周囲画素の補正係数を算出する第1の補正係数算出手段と、
第1の補正係数算出手段によって算出された各周囲画素の補正係数と予め定める閾値とを比較し、予め定める閾値以上となる補正係数を有する周囲画素を選択する周囲画素選択手段と、
抽出された複数の周囲画素およびその近傍画素に関連する画素情報に基づいて、基準の周囲画素の補正係数を算出する第2の補正係数算出手段とを含むことを特徴とする。
Further, according to the present invention, the correction coefficient calculation means includes
Quantization processing means for performing quantization processing on the extracted pixel data of a plurality of surrounding pixels and neighboring pixels and calculating quantization data;
A difference absolute value calculation means for calculating a difference absolute value between the calculated quantized data of the surrounding pixels and the quantized data of neighboring pixels;
A first neighboring pixel selecting unit that compares the calculated absolute difference value with a predetermined threshold value and selects neighboring pixels involved in calculating the absolute difference value that is equal to or smaller than the predetermined threshold value;
A second neighboring pixel selecting unit that selects a neighboring pixel closest to the reference surrounding pixel among neighboring pixels selected by the first neighboring pixel selecting unit;
First correction coefficient calculation means for calculating a correction coefficient for each of the surrounding pixels excluding the reference surrounding pixel, based on the extracted pixel information related to the plurality of surrounding pixels and its neighboring pixels;
A surrounding pixel selection unit that compares a correction coefficient of each surrounding pixel calculated by the first correction coefficient calculation unit with a predetermined threshold and selects a surrounding pixel having a correction coefficient that is equal to or greater than the predetermined threshold;
And second correction coefficient calculating means for calculating a correction coefficient of the reference surrounding pixel based on the pixel information related to the plurality of extracted surrounding pixels and its neighboring pixels.

さらに本発明は、前記画像処理装置を備え、前記画像処理装置によって補間処理が施された補間画像の画素データを用いて、画像を形成して出力することを特徴とする画像形成装置である。   Furthermore, the present invention is an image forming apparatus comprising the image processing apparatus, wherein an image is formed and output using pixel data of an interpolated image subjected to interpolation processing by the image processing apparatus.

本発明によれば、補間画素の位置を算出し、補間画素の周囲に位置する複数の周囲画素の位置および画素データを抽出する。そして、算出された補間画素の位置および抽出された複数の周囲画素の位置に基づいて、補間画素に最近接する周囲画素を基準の周囲画素として選択する。また、周囲画素の周囲に位置する複数の近傍画素の位置および画素データを抽出する。次に、抽出された複数の周囲画素およびその近傍画素に関連する画素情報、たとえば周囲画素および近傍画素の位置および画素データに基づいて、一方の周囲画素と他方の周囲画素との関係を表す補正係数を算出する。そして、算出された基準の周囲画素を除く各周囲画素の補正係数および基準の周囲画素の補正係数に基づいて、補間画素の画素データを生成する補間演算処理を行う。   According to the present invention, the position of an interpolation pixel is calculated, and the positions and pixel data of a plurality of surrounding pixels located around the interpolation pixel are extracted. Then, based on the calculated position of the interpolation pixel and the extracted positions of the plurality of surrounding pixels, the surrounding pixel closest to the interpolation pixel is selected as the reference surrounding pixel. In addition, the positions and pixel data of a plurality of neighboring pixels located around the surrounding pixels are extracted. Next, based on pixel information related to the plurality of extracted peripheral pixels and their neighboring pixels, for example, the position and pixel data of the neighboring pixels and neighboring pixels, a correction representing the relationship between one neighboring pixel and the other neighboring pixel Calculate the coefficient. Then, based on the calculated correction coefficient of each surrounding pixel excluding the reference surrounding pixel and the correction coefficient of the reference surrounding pixel, interpolation calculation processing for generating pixel data of the interpolation pixel is performed.

前述のように、抽出された複数の周囲画素およびその近傍画素に関連する画素情報、たとえば周囲画素および近傍画素の位置および画素データに基づいて、基準の周囲画素を除く各周囲画素の補正係数および基準の周囲画素の補正係数を算出し、この算出された補正係数を補間画素の画素データの生成に用いることによって、補間画素の階調値を表す画素データを、従来技術に比べて高精度で生成することができる。これによって、ジャギーの発生およびエッジの鈍りなどの画像の劣化を防止することができ、高画質の画像を得ることができる。   As described above, based on the pixel information related to the extracted plurality of surrounding pixels and their neighboring pixels, for example, the position and pixel data of the surrounding pixels and neighboring pixels, the correction coefficient of each surrounding pixel excluding the reference surrounding pixels and By calculating a correction coefficient for a reference surrounding pixel and using the calculated correction coefficient for generating pixel data of the interpolation pixel, pixel data representing the gradation value of the interpolation pixel can be obtained with higher accuracy than in the prior art. Can be generated. Thereby, it is possible to prevent image degradation such as jaggy and edge dullness, and a high-quality image can be obtained.

また本発明によれば、補正係数の算出にあたっては、まず、抽出された複数の周囲画素およびその近傍画素の画素データに対して量子化処理を行い、量子化データを算出する。次に、算出された周囲画素の量子化データと、近傍画素の量子化データとの差分絶対値を算出し、算出された差分絶対値と予め定める閾値とを比較し、予め定める閾値以下となる差分絶対値の算出に関わる近傍画素を選択する。そして、選択された近傍画素のうち、基準の周囲画素に最近接する近傍画素を選択する。   According to the present invention, in calculating the correction coefficient, first, quantization processing is performed on the pixel data of a plurality of extracted surrounding pixels and their neighboring pixels to calculate quantized data. Next, an absolute difference value between the calculated quantized data of the surrounding pixels and the quantized data of the neighboring pixels is calculated, and the calculated absolute difference value is compared with a predetermined threshold value, which is equal to or less than the predetermined threshold value. Neighboring pixels related to calculation of absolute difference are selected. Then, of the selected neighboring pixels, a neighboring pixel closest to the reference surrounding pixel is selected.

次に、抽出された複数の周囲画素およびその近傍画素に関連する画素情報に基づいて、基準の周囲画素を除く各周囲画素の補正係数を算出し、算出された補正係数と予め定める閾値とを比較し、予め定める閾値以上となる補正係数を有する周囲画素を選択する。そして、抽出された複数の周囲画素およびその近傍画素に関連する画素情報に基づいて、基準の周囲画素の補正係数を算出する。   Next, based on pixel information related to the plurality of extracted surrounding pixels and the neighboring pixels, a correction coefficient of each surrounding pixel excluding the reference surrounding pixels is calculated, and the calculated correction coefficient and a predetermined threshold value are calculated. A comparison is made and surrounding pixels having a correction coefficient equal to or greater than a predetermined threshold are selected. Then, based on the extracted pixel information related to the plurality of surrounding pixels and the neighboring pixels, a correction coefficient for the reference surrounding pixels is calculated.

前述の量子化データを算出する演算処理、周囲画素の量子化データと近傍画素の量子化データとの差分絶対値を算出する演算処理ならびに基準の周囲画素を除く各周囲画素の補正係数および基準の周囲画素の補正係数を算出する演算処理は、いずれも従来技術のバイキュービック法に比べて単純であるので、演算量を抑えることができ、処理時間を短縮することができる。   Arithmetic processing for calculating the above-mentioned quantized data, arithmetic processing for calculating a difference absolute value between the quantized data of the surrounding pixels and the quantized data of the neighboring pixels, and the correction coefficient of each surrounding pixel excluding the reference surrounding pixels and the reference Since all the calculation processes for calculating the correction coefficients for the surrounding pixels are simpler than the conventional bicubic method, the calculation amount can be suppressed and the processing time can be shortened.

また本発明によれば、基準の周囲画素を除く各周囲画素の補正係数は、基準の周囲画素を除く各周囲画素を始点とし、第2近傍画素選択工程で選択された近傍画素を終点とする第1ベクトルと、基準の周囲画素を除く各周囲画素を始点とし、基準の周囲画素を終点とする第2ベクトルとのなす角度に基づいて算出する。第1ベクトルの終点である第2近傍画素選択工程で選択された近傍画素の位置が、第2ベクトルの終点である基準の周囲画素の位置に近いほど、換言すれば、第1ベクトルと第2ベクトルとのなす角度が小さいほど補正係数が大きく、基準の周囲画素を除く各周囲画素と、基準の周囲画素との相関関係が高くなる。   Further, according to the present invention, the correction coefficient of each surrounding pixel excluding the reference surrounding pixel starts from each surrounding pixel except the reference surrounding pixel, and ends with the neighboring pixel selected in the second neighboring pixel selection step. The calculation is performed based on an angle formed by the first vector and a second vector having each surrounding pixel excluding the reference surrounding pixel as a start point and the reference surrounding pixel as an end point. The closer the position of the neighboring pixel selected in the second neighboring pixel selection step that is the end point of the first vector is to the position of the reference surrounding pixel that is the end point of the second vector, in other words, the first vector and the second vector. The smaller the angle made with the vector, the larger the correction coefficient, and the higher the correlation between the surrounding pixels excluding the reference surrounding pixels and the reference surrounding pixels.

したがって、このような相関関係が高い周囲画素に基づいて算出された補正係数を、補間画素の画素データを生成する補間演算に用いることによって、補間画素の画素データを、従来技術に比べて高精度で生成することができる。これによって、ジャギーの発生およびエッジの鈍りなどの画像の劣化を防止することができ、高画質の画像を得ることができる。   Therefore, by using the correction coefficient calculated based on the surrounding pixels having a high correlation as described above for the interpolation calculation for generating the pixel data of the interpolation pixel, the pixel data of the interpolation pixel is more accurately compared with the conventional technique. Can be generated. Thereby, it is possible to prevent image degradation such as jaggy and edge dullness, and a high-quality image can be obtained.

また本発明によれば、周囲画素選択工程で選択されない各周囲画素の位置と補間画素の位置との距離に関する重み係数を求め、その総和に1を加算した数値を基準の周囲画素の補正係数として算出する。これは、基準の周囲画素の補正係数の基準値を1とし、これに、周囲画素選択工程で選択されない各周囲画素の位置と補間画素の位置との距離に関する重み係数を加算した数値を基準の周囲画素の補正係数として算出することによって、補間演算処理では計算されない、周囲画素選択工程で選択されなかった周囲画素の位置と、補間画素の位置との距離に関する重み係数に基づく補間画素の画素データを補填する補正係数にするためである。   Further, according to the present invention, a weighting coefficient related to the distance between the position of each surrounding pixel not selected in the surrounding pixel selection step and the position of the interpolation pixel is obtained, and a numerical value obtained by adding 1 to the sum is used as a correction coefficient for the reference surrounding pixel. calculate. This is based on a numerical value obtained by adding a reference value of the correction coefficient of the reference surrounding pixel to 1 and adding a weighting coefficient related to the distance between the position of each surrounding pixel not selected in the surrounding pixel selection step and the position of the interpolation pixel. The pixel data of the interpolated pixel based on the weighting coefficient related to the distance between the position of the surrounding pixel not selected in the surrounding pixel selection step and the position of the interpolated pixel, which is not calculated in the interpolation calculation process, by calculating as the correction coefficient of the surrounding pixel This is to make the correction coefficient to compensate.

したがって、周囲画素選択工程で選択されなかった周囲画素の位置と、補間画素の位置との距離に関する重み係数に基づく補間画素の画素データを補填するように算出される基準の周囲画素の補正係数を、補間画素の画素データを生成する補間演算に用いることによって、補間画素の画素データを、従来技術に比べてより高精度で生成することができる。これによって、ジャギーの発生およびエッジの鈍りなどの画像の劣化を防止することができ、高画質の画像を得ることができる。   Therefore, the reference surrounding pixel correction coefficient calculated so as to compensate the pixel data of the interpolation pixel based on the weighting coefficient related to the distance between the position of the surrounding pixel not selected in the surrounding pixel selection step and the position of the interpolation pixel. By using this for the interpolation operation for generating the pixel data of the interpolation pixel, the pixel data of the interpolation pixel can be generated with higher accuracy than in the prior art. Thereby, it is possible to prevent image degradation such as jaggy and edge dullness, and a high-quality image can be obtained.

また本発明によれば、補間画素の周囲に位置する各周囲画素の補正係数と予め定める閾値とを比較し、予め定める閾値以上となる補正係数を有する周囲画素の画素データに基づいて、補間画素の画素データを生成する。このように、予め定める閾値以上となる補正係数を有する周囲画素の画素データを用いて補間画素の画素データを生成することによって、従来技術のようにエッジ付近の画像がぼやけて画像が劣化することを防止することができ、従来技術に比べて高画質の画像を得ることができる。   According to the present invention, the correction coefficient of each surrounding pixel located around the interpolation pixel is compared with a predetermined threshold value, and the interpolation pixel is determined based on the pixel data of the surrounding pixel having the correction coefficient equal to or greater than the predetermined threshold value. Pixel data is generated. In this way, by generating pixel data of interpolation pixels using pixel data of surrounding pixels having a correction coefficient equal to or greater than a predetermined threshold, the image near the edge is blurred and the image is deteriorated as in the prior art. Therefore, it is possible to obtain a high-quality image as compared with the prior art.

また本発明によれば、コンピュータに前記の補間処理方法を実行させることができる。また、前記の補間処理方法をコンピュータに実行させることによって、ジャギーおよびエッジの鈍りなどの画像の劣化の少ない高画質の画像を精度良く再現することができる。   Further, according to the present invention, it is possible to cause a computer to execute the interpolation processing method. In addition, by causing the computer to execute the above-described interpolation processing method, it is possible to accurately reproduce a high-quality image with little image degradation such as jaggy and edge dullness.

また本発明によれば、補間処理プログラムを、コンピュータによって読取り可能な記録媒体に記録させる。たとえば、フレキシブルディスクなどの持運び可能な記録媒体に補間処理プログラムを記録させることによって、補間処理プログラムを記録媒体から所望のコンピュータに容易に読込ませることができるとともに、記録媒体からコンピュータに補間処理プログラムを読込ませて、前記の補間処理方法をコンピュータに実行させることができる。   According to the invention, the interpolation processing program is recorded on a computer-readable recording medium. For example, by recording an interpolation processing program on a portable recording medium such as a flexible disk, the interpolation processing program can be easily read from the recording medium to a desired computer, and the interpolation processing program is recorded on the computer from the recording medium. And the above interpolation processing method can be executed by a computer.

また本発明によれば、前述の画像処理装置によって生成された高画質の画像を出力することができる。また、装置規模の増大が抑えられている前述の画像処理装置を備えることによって、画像形成装置の装置規模の増大を抑えることができる。   Further, according to the present invention, it is possible to output a high-quality image generated by the above-described image processing apparatus. Further, by providing the above-described image processing apparatus in which an increase in apparatus scale is suppressed, an increase in apparatus scale of the image forming apparatus can be suppressed.

図1は、本発明の実施の一形態である補間処理の処理手順を示すフローチャートである。本実施形態の補間処理は、後述する画像処理装置の補間処理部1によって行われる。図2は、補間処理の対象となる補間画素Pとその周囲画素P1〜P4を示す図である。   FIG. 1 is a flowchart showing a processing procedure of interpolation processing according to an embodiment of the present invention. The interpolation processing of this embodiment is performed by the interpolation processing unit 1 of the image processing apparatus described later. FIG. 2 is a diagram illustrating the interpolation pixel P and its surrounding pixels P1 to P4 that are to be subjected to the interpolation processing.

ステップS1では、画像を構成する複数の画素の階調値を表す画素データを補間処理部に入力する。画素データの入力の単位は、1画素ごと、1ラインごと、1プレーンごとなど、どのようなものであってもよい。ここでプレーンとは、色成分ごとの画素の集まりをいう。補間画素に対する所定の周囲画素の画素データが入力された時点で、次の処理が開始される。それまでは、随時画素データの入力が行われる。   In step S1, pixel data representing gradation values of a plurality of pixels constituting the image is input to the interpolation processing unit. The unit of input of pixel data may be any unit such as one pixel, one line, one plane, or the like. Here, the plane is a collection of pixels for each color component. The next process is started when pixel data of predetermined surrounding pixels for the interpolation pixel is input. Until then, pixel data is input at any time.

ステップS2では、補間倍率に応じて、原画像における補間画素Pの位置を算出するとともに、複数の周囲画素およびその近傍画素に関連する画素情報、たとえば補間画素Pの周囲に位置する4つの周囲画素P1〜P4の位置および画素データならびに各周囲画素P1〜P4の周囲に位置する8つの近傍画素の位置および画素データを抽出する。   In step S2, the position of the interpolation pixel P in the original image is calculated according to the interpolation magnification, and pixel information related to a plurality of surrounding pixels and its neighboring pixels, for example, four surrounding pixels located around the interpolation pixel P The positions and pixel data of P1 to P4 and the positions and pixel data of eight neighboring pixels located around each of the surrounding pixels P1 to P4 are extracted.

ステップS3では、ステップS2における4つの周囲画素P1〜P4の位置および画素データならびに8つの近傍画素の位置および画素データの抽出処理が完了したか否かを判断する。ステップS3において、ステップS2における周囲画素P1〜P4の位置および画素データならびに8つの近傍画素の位置および画素データの抽出処理が完了したと判断したときはステップS4に進み、前記抽出処理が完了していないと判断したときはステップS1に戻る。   In step S3, it is determined whether or not the extraction processing of the positions and pixel data of the four surrounding pixels P1 to P4 and the positions and pixel data of the eight neighboring pixels in step S2 is completed. If it is determined in step S3 that the extraction process of the positions and pixel data of the surrounding pixels P1 to P4 and the positions and pixel data of the eight neighboring pixels in step S2 is completed, the process proceeds to step S4, and the extraction process is completed. If it is determined that there is no, the process returns to step S1.

ステップS4では、ステップS2において抽出された4つの周囲画素P1〜P4の位置に基づいて、補間画素Pの位置に最近接する周囲画素を選択し、これを基準の周囲画素とする。本実施形態では、図2に示すように、補間画素Pの位置に最近接する周囲画素として周囲画素P2を選択し、この周囲画素P2を基準の周囲画素とする。以下の説明において、基準の周囲画素を「基準の周囲画素P2」と表記する場合がある。   In step S4, based on the positions of the four surrounding pixels P1 to P4 extracted in step S2, a surrounding pixel closest to the position of the interpolation pixel P is selected and set as a reference surrounding pixel. In the present embodiment, as shown in FIG. 2, the surrounding pixel P2 is selected as the surrounding pixel closest to the position of the interpolation pixel P, and this surrounding pixel P2 is set as the reference surrounding pixel. In the following description, the reference surrounding pixel may be referred to as “reference surrounding pixel P2”.

ステップS5では、ステップS2において抽出された周囲画素P1〜P4の画素データおよび周囲画素P1〜P4の周囲に位置する8つの近傍画素の階調値を表す画素データを離散的な整数値に変換する量子化処理を行う。本実施形態では、256階調で表される画素データ、すなわち8ビットのデータのうち、上位4ビットのデータのみを用いて、階調数を16とした量子化を行う。そして、ステップS5では、量子化を行うことによって算出された量子化データに基づいて、基準の周囲画素P2を除く周囲画素P1,P3,P4とその周囲にそれぞれ位置する8つの近傍画素との差分値の絶対値(以下、「差分絶対値」と表記する場合がある)を算出する。周囲画素P1の周囲に位置する8つの近傍画素は、図2において破線で囲まれた領域内の周囲画素P1を除いた画素である。   In step S5, the pixel data of the surrounding pixels P1 to P4 extracted in step S2 and the pixel data representing the gradation values of eight neighboring pixels located around the surrounding pixels P1 to P4 are converted into discrete integer values. Quantization processing is performed. In this embodiment, quantization is performed with the number of gradations set to 16 using only the upper 4 bits of pixel data represented by 256 gradations, that is, 8-bit data. In step S5, based on the quantized data calculated by performing the quantization, the difference between the surrounding pixels P1, P3, and P4 except the reference surrounding pixel P2 and the 8 neighboring pixels positioned around the surrounding pixels P1, P3, and P4. The absolute value of the value (hereinafter sometimes referred to as “difference absolute value”) is calculated. The eight neighboring pixels located around the surrounding pixel P1 are pixels excluding the surrounding pixel P1 in the region surrounded by the broken line in FIG.

ステップS6では、ステップS5で求めた差分絶対値と予め定める閾値との大小関係を比較し、差分絶対値が閾値以下となる近傍画素を選択する。差分絶対値が閾値以下となる近傍画素が複数存在する場合には、該当するすべての近傍画素を選択する。   In step S6, the magnitude relationship between the difference absolute value obtained in step S5 and a predetermined threshold is compared, and neighboring pixels whose difference absolute value is equal to or smaller than the threshold are selected. When there are a plurality of neighboring pixels whose difference absolute value is equal to or less than the threshold value, all corresponding neighboring pixels are selected.

ステップS7では、ステップS6において選択された近傍画素のうち、基準の周囲画素P2の位置に最近接する近傍画素を選択する。   In step S7, a neighboring pixel closest to the position of the reference surrounding pixel P2 is selected from the neighboring pixels selected in step S6.

ステップS8では、基準の周囲画素P2を除く各周囲画素P1,P3,P4を始点とし、ステップS7において選択された近傍画素を終点とする第1ベクトルと、基準の周囲画素を除く各周囲画素P1,P3,P4を始点とし、基準の周囲画素P2を終点とする第2ベクトルとのなす角度に基づいて、基準の周囲画素P2を除く各周囲画素P1,P3,P4の補正係数であるベクトル量を算出する。本実施形態では、第1ベクトルと第2ベクトルとのなす角度が0度、つまり2つのベクトルの向きが同じ場合には、ベクトル量を1とし、第1ベクトルと第2ベクトルとのなす角度が±45度の場合には、ベクトル量を0.5とする。また、第1ベクトルと第2ベクトルとのなす角度が+45度以上+180度以下または−180度以上−45度以下の場合には、ベクトル量を0とする。   In step S8, a first vector starting from the surrounding pixels P1, P3 and P4 excluding the reference surrounding pixel P2 and ending in the vicinity pixel selected in step S7, and each surrounding pixel P1 excluding the reference surrounding pixel P1. , P3, P4, and a vector amount that is a correction coefficient for each of the surrounding pixels P1, P3, and P4 excluding the reference surrounding pixel P2 based on an angle formed with the second vector having the reference surrounding pixel P2 as an end point Is calculated. In the present embodiment, when the angle formed by the first vector and the second vector is 0 degrees, that is, when the two vectors have the same direction, the vector amount is set to 1, and the angle formed by the first vector and the second vector is In the case of ± 45 degrees, the vector amount is set to 0.5. Further, when the angle formed by the first vector and the second vector is +45 degrees or more and +180 degrees or less or −180 degrees or more and −45 degrees or less, the vector amount is set to zero.

ベクトル量は、ステップS7において選択された近傍画素が、基準の周囲画素の近くに位置すればするほど大きな値となるように設定しており、本実施形態では、2つのベクトルのなす角度に対する余弦関数の2乗値をベクトル量としている。なお、ベクトル量は、前述の考えに基づいた値であれば、他の方法によって算出してもよい。ただし、ベクトル量は、0以上1以下の範囲で正規化した値を用いる。また、本実施形態における2つのベクトルのなす角度は、−180度以上+180度以下とする。   The vector amount is set so that the neighboring pixel selected in step S7 has a larger value as it is located closer to the reference surrounding pixel. In the present embodiment, the cosine with respect to the angle formed by the two vectors is set. The square value of the function is a vector quantity. The vector amount may be calculated by other methods as long as it is a value based on the above-described idea. However, the vector amount is a normalized value in the range of 0 to 1. In addition, the angle formed by the two vectors in the present embodiment is set to −180 degrees or more and +180 degrees or less.

第1および第2ベクトルの向きが同じ、すなわち2つのベクトルのなす角度が0度であれば、COS(0°)=1より、ベクトル量は1となる。また、2つのベクトルのなす角度が±45度であれば、COS(±45°)=0.5より、ベクトル量は0.5となる。さらに、2つのベクトルのなす角度が−180度以上−90度以下および+90度以上+180度以下であれば、COS(±90°)=0,COS(±180°)=−1より、ベクトル量は、−1以上0以下の範囲の値となる。なお、本実施形態では、前述のように0以上1以下に正規化した値をベクトル量として用いることにしているので、算出されたベクトル量が負である場合には、0としている。 If the directions of the first and second vectors are the same, that is, if the angle between the two vectors is 0 degree, the vector quantity is 1 because COS 2 (0 °) = 1. If the angle formed by the two vectors is ± 45 degrees, the vector quantity is 0.5 because COS 2 (± 45 °) = 0.5. Further, if the angle between the two vectors is −180 degrees or more and −90 degrees or less and +90 degrees or more and +180 degrees or less, COS 2 (± 90 °) = 0, COS 2 (± 180 °) = − 1, The vector amount is a value in a range from −1 to 0. In the present embodiment, as described above, a value normalized from 0 to 1 is used as the vector quantity. Therefore, when the calculated vector quantity is negative, 0 is set.

2つのベクトルのなす角度の算出では、種々の方法が考えられるが、1つの方法として、各周囲画素の座標値に基づいて、基準の周囲画素の相対座標値を算出し、各周囲画素の座標値に基づいて、選択された近傍画素の相対座標値を算出し、各相対座標値の差分値を求め、その値に応じて角度を一意に決定する方法が考えられる。   There are various methods for calculating the angle between the two vectors. As one method, the relative coordinate value of the reference surrounding pixel is calculated based on the coordinate value of each surrounding pixel, and the coordinates of each surrounding pixel are calculated. A method may be considered in which the relative coordinate value of the selected neighboring pixel is calculated based on the value, the difference value of each relative coordinate value is obtained, and the angle is uniquely determined according to the value.

2つのベクトルのなす角度が0度、つまり2つのベクトルの向きが同じ場合は、相対座標値も同じ値になるため、相対座標値の差分値は0となる。また、2つのベクトルのなす角度が±45度の場合は、画像のxy座標におけるx軸方向またはy軸方向のいずれか一方の差分値が1となり、他方の差分値は0となるので、相対座標値の差分値は1となる。2つのベクトルのなす角度が±90度の場合は、画像のx軸方向およびy軸方向の差分値が1となるので、相対座標値の差分値は2となる。2つのベクトルのなす角度が+90度以上+180度以下または−180度以上−90度以下の場合には、さらに相対座標値の差分値が大きくなる。   When the angle between the two vectors is 0 degrees, that is, when the directions of the two vectors are the same, the relative coordinate values are also the same value, so the difference value between the relative coordinate values is 0. When the angle formed by the two vectors is ± 45 degrees, the difference value of either the x-axis direction or the y-axis direction in the xy coordinates of the image is 1 and the other difference value is 0. The difference value of the coordinate value is 1. When the angle between the two vectors is ± 90 degrees, the difference value between the x-axis direction and the y-axis direction of the image is 1, so the difference value between the relative coordinate values is 2. When the angle formed by the two vectors is +90 degrees or more and +180 degrees or less or −180 degrees or more and −90 degrees or less, the difference value of the relative coordinate value further increases.

ここで、たとえば、注目している周囲画素の座標を(x,y)、基準の周囲画素の座標を(x−1,y)および選択された近傍画素の座標を(x,y−1)とすると、注目している周囲画素と基準の周囲画素との相対座標値は、((x−1−x),(y−y))=(−1,0)となる。また、注目している周囲画素と選択された近傍画素との相対座標値は、((x−x),(y−1−y))=(0,−1)となる。そして、この2つの相対座標値の距離を求めると、{(−1−0)+(0−(−1))}=2となるので、2つのベクトルのなす角度は90度ということになる。また、基準の周囲画素のベクトル量については、後述する補間演算に用いる周囲画素の選択処理の後に算出する。 Here, for example, the coordinates of the surrounding pixel of interest are (x, y), the coordinates of the reference surrounding pixel are (x-1, y), and the coordinates of the selected neighboring pixel are (x, y-1). Then, the relative coordinate values of the surrounding pixel of interest and the reference surrounding pixel are ((x−1−x), (y−y)) = (− 1, 0). In addition, the relative coordinate value between the surrounding pixel of interest and the selected neighboring pixel is ((xx), (y-1-y)) = (0, -1). When the distance between the two relative coordinate values is obtained, {(−1−0) 2 + (0 − (− 1)) 2 } = 2, and the angle formed by the two vectors is 90 degrees. become. Further, the vector amount of the reference surrounding pixel is calculated after the surrounding pixel selection process used for the interpolation calculation described later.

前述のように、ステップS8において、基準の周囲画素P2を除く周囲画素P1,P3,P4のベクトル量を算出した後は、ステップS9に進む。   As described above, after calculating the vector amounts of the surrounding pixels P1, P3, and P4 excluding the reference surrounding pixel P2 in step S8, the process proceeds to step S9.

ステップS9では、ステップS8において算出されたベクトル量に基づいて、基準の周囲画素P2を除く周囲画素P1,P3,P4の中から補間演算に用いる周囲画素を選択する。詳細には、ステップS8で算出された各周囲画素P1,P3,P4のベクトル量と予め定める閾値との大小関係を比較し、ベクトル量が閾値以上となる周囲画素を、補間演算に用いる周囲画素として選択する。   In step S9, based on the vector amount calculated in step S8, the surrounding pixels used for the interpolation calculation are selected from the surrounding pixels P1, P3, and P4 excluding the reference surrounding pixel P2. Specifically, the magnitude relationship between the vector amount of each of the surrounding pixels P1, P3, and P4 calculated in step S8 and a predetermined threshold value is compared, and the surrounding pixels whose vector amount is equal to or larger than the threshold value are used for the interpolation calculation. Select as.

ステップS9において、補間演算に用いる周囲画素の選択が完了した後は、ステップ10に進む。ステップS10では、基準の周囲画素のベクトル量を算出する。詳細には、ステップS9において選択されなかったすべての周囲画素の位置と補間画素Pの位置との距離に関する重み係数をそれぞれ求め、その総和に1を加算した値を基準の周囲画素P2のベクトル量とする。これは、基準の周囲画素P2のベクトル量の基準値を1とし、これに選択されなかった周囲画素の位置に応じた距離に関する重み係数を加算することによって、補間演算処理で計算されない、選択されなかった周囲画素の位置と補間画素の位置との距離に関する重み係数に基づく補間画素の画素データを補填するベクトル量にするためである。   In step S9, after selection of surrounding pixels used for the interpolation calculation is completed, the process proceeds to step 10. In step S10, the vector amount of the reference surrounding pixels is calculated. Specifically, each of the weighting factors related to the distances between the positions of all the surrounding pixels not selected in step S9 and the position of the interpolation pixel P is obtained, and a value obtained by adding 1 to the sum is used as the vector amount of the reference surrounding pixel P2. And This is selected by setting the reference value of the vector amount of the reference surrounding pixel P2 to 1, and adding a weighting factor related to the distance according to the position of the surrounding pixels not selected to this, which is not calculated in the interpolation processing. This is to make the vector amount to compensate the pixel data of the interpolation pixel based on the weighting coefficient related to the distance between the position of the surrounding pixel and the position of the interpolation pixel.

基準の周囲画素P2も含め、ステップS9において選択された周囲画素を用いて補間処理を行う場合には、ステップS11において、選択された周囲画素における線形補間演算にベクトル量を重み係数として用いた後述する式(1)に基づいて、補間画素Pの画素データを生成し、生成した補間画素Pの画素データを出力する。   When interpolation processing is performed using the surrounding pixels selected in step S9 including the reference surrounding pixel P2, in step S11, a vector amount is used as a weighting factor for the linear interpolation calculation in the selected surrounding pixels, which will be described later. Based on the equation (1), the pixel data of the interpolation pixel P is generated, and the generated pixel data of the interpolation pixel P is output.

図3は、補間処理の対象となる補間画素Pおよびその周囲画素P1〜P4の座標を示す図である。補間画素Pの座標をP(u,v)、補間画素Pの座標を基準としたときに補間画素Pの左上に位置する原画素の座標をP1(x,y)、補間画素Pの右上に位置する原画素の座標をP2(x+1,y)、補間画素Pの左下に位置する原画素の座標をP3(x,y+1)および補間画素Pの右下に位置する原画素の座標をP4(x+1,y+1)とし、座標P1における原画素のベクトル量をW1、座標P2における原画素のベクトル量をW2、座標P3における原画素のベクトル量をW3および座標P4における原画素のベクトル量をW4としたとき、補間処理における補間演算式は、以下の式(1)で表される。
P(u,v)={(x+1)−u}×{(y+1)−v}×P1(x,y)×W1
+{u−x}×{(y+1)−v}×P2(x+1,y)×W2
+{(x+1)−u}×{v−y}×P3(x,y+1)×W3
+{u−x}×{v−y}×P4(x+1,y+1)×W4 …(1)
FIG. 3 is a diagram illustrating the coordinates of the interpolation pixel P and its surrounding pixels P1 to P4 that are to be subjected to the interpolation processing. The coordinates of the interpolation pixel P are P (u, v), the coordinates of the original pixel located at the upper left of the interpolation pixel P when the coordinates of the interpolation pixel P are used as the reference, P1 (x, y), and the upper right of the interpolation pixel P. The coordinates of the original pixel located are P2 (x + 1, y), the coordinates of the original pixel located at the lower left of the interpolation pixel P are P3 (x, y + 1), and the coordinates of the original pixel located at the lower right of the interpolation pixel P are P4 ( x + 1, y + 1), the vector quantity of the original pixel at the coordinate P1 is W1, the vector quantity of the original pixel at the coordinate P2 is W2, the vector quantity of the original pixel at the coordinate P3 is W3, and the vector quantity of the original pixel at the coordinate P4 is W4 When this is done, the interpolation equation in the interpolation process is expressed by the following equation (1).
P (u, v) = {(x + 1) −u} × {(y + 1) −v} × P1 (x, y) × W1
+ {U−x} × {(y + 1) −v} × P2 (x + 1, y) × W2
+ {(X + 1) -u} * {v-y} * P3 (x, y + 1) * W3
+ {U−x} × {v−y} × P4 (x + 1, y + 1) × W4 (1)

ただし、x=[u],y=[v](「[ ]」は、小数点以下切捨てによる整数化を表す)
なお、ステップS9において選択されなかった周囲画素の重み係数であるベクトル量を0とすることによって、補間演算に用いる周囲画素が選択されたことにする。
However, x = [u], y = [v] (“[]” represents integerization by rounding down the decimal point)
Note that the surrounding pixel used for the interpolation calculation is selected by setting the vector amount, which is the weighting coefficient of surrounding pixels not selected in step S9, to 0.

ステップS12では、原画像の1つの走査線上に並ぶ補間画素Pに対する補間処理が完了したか否かを判断する。ステップS12において、原画像の1つの走査線上に並ぶ補間画素Pに対する補間処理が完了したと判断したときは、ステップS13に進み、前記補間処理が完了していないと判断したときは、補間画素を移動し、ステップS2に戻り、再度補間処理を行う。   In step S12, it is determined whether or not the interpolation processing for the interpolation pixels P arranged on one scanning line of the original image is completed. In step S12, when it is determined that the interpolation process for the interpolation pixels P arranged on one scanning line of the original image is completed, the process proceeds to step S13. When it is determined that the interpolation process is not completed, the interpolation pixel is selected. It moves, returns to step S2, and performs an interpolation process again.

ステップS13では、原画像のすべての走査線上に並ぶ補間画素Pに対する補間処理が完了したか否かを判断する。ステップS13において、原画像のすべての走査線上に並ぶ補間画素Pに対する補間処理が完了したと判断したときは、補間処理を終了する。ステップS13において、原画像のすべての走査線上に並ぶ補間画素Pに対する補間処理が完了していないと判断したときは、走査線を移動し、ステップS1に戻り、再度補間処理を行う。   In step S13, it is determined whether or not the interpolation processing for the interpolation pixels P arranged on all the scanning lines of the original image has been completed. In step S13, when it is determined that the interpolation processing for the interpolation pixels P arranged on all the scanning lines of the original image is completed, the interpolation processing is terminated. In step S13, when it is determined that the interpolation processing for the interpolation pixels P arranged on all the scanning lines of the original image is not completed, the scanning line is moved, the processing returns to step S1, and the interpolation processing is performed again.

以上のように本実施形態によれば、抽出された複数の周囲画素およびその近傍画素に関連する画素情報、たとえば4つの周囲画素P1〜P4の位置および画素データならびに各周囲画素P1〜P4の周囲に位置する8つの近傍画素の位置および画素データに基づいて、基準の周囲画素P2を除く周囲画素P1,P3,P4のベクトル量および基準の周囲画素P2のベクトル量を算出し、この算出されたベクトル量を補間画素Pの画素データの生成に用いることによって、補間画素Pの階調値を表す画素データを、従来技術に比べて高精度で生成することができる。これによって、ジャギーの発生およびエッジの鈍りなどの画像の劣化を防止することができ、高画質の画像を得ることができる。   As described above, according to the present embodiment, pixel information related to a plurality of extracted surrounding pixels and their neighboring pixels, for example, the positions and pixel data of the four surrounding pixels P1 to P4 and the surroundings of each surrounding pixel P1 to P4 Based on the positions and pixel data of the eight neighboring pixels located at, the vector amounts of the surrounding pixels P1, P3, P4 excluding the reference surrounding pixel P2 and the vector amount of the reference surrounding pixel P2 are calculated. By using the vector quantity for generation of pixel data of the interpolation pixel P, pixel data representing the gradation value of the interpolation pixel P can be generated with higher accuracy than in the prior art. Thereby, it is possible to prevent image degradation such as jaggy and edge dullness, and a high-quality image can be obtained.

また、量子化データ、周囲画素の量子化データと近傍画素の量子化データとの差分絶対値ならびに基準の周囲画素P2を除く周囲画素P1,P3,P4のベクトル量および基準の周囲画素P2のベクトル量を算出するための各演算処理は、いずれも従来技術に比べて単純であるので、演算量を抑えることができ、処理時間を短縮することができる。   The quantized data, the absolute value of the difference between the quantized data of the surrounding pixels and the quantized data of the neighboring pixels, the vector amounts of the surrounding pixels P1, P3 and P4 excluding the reference surrounding pixel P2, and the vector of the reference surrounding pixel P2 Since each calculation process for calculating the quantity is simpler than the conventional technique, the calculation quantity can be suppressed and the processing time can be shortened.

また本実施形態によれば、第1ベクトルの始点であって、ステップS7において選択された近傍画素の位置が、第2ベクトルの終点である基準の周囲画素P2の位置に近いほど、換言すれば、第1ベクトルと第2ベクトルとのなす角度が小さいほどベクトル量が大きく、基準の周囲画素P2を除く周囲画素P1,P3,P4のいずれか1つと、基準の周囲画素P2との相関関係が高くなる。   In addition, according to the present embodiment, the closer the position of the neighboring pixel that is the starting point of the first vector and selected in step S7 is to the position of the reference surrounding pixel P2 that is the ending point of the second vector, in other words, The smaller the angle formed by the first vector and the second vector, the larger the vector amount, and the correlation between any one of the surrounding pixels P1, P3 and P4 excluding the reference surrounding pixel P2 and the reference surrounding pixel P2 is Get higher.

したがって、このような相関関係が高い周囲画素に基づいて算出されたベクトル量を、補間画素Pの画素データを生成する補間演算に用いることによって、補間画素Pの画素データを、従来技術に比べて高精度で生成することができる。これによって、ジャギーの発生およびエッジの鈍りなどの画像の劣化を防止することができ、高画質の画像を得ることができる。   Therefore, by using the vector amount calculated based on the surrounding pixels having such a high correlation in the interpolation calculation for generating the pixel data of the interpolation pixel P, the pixel data of the interpolation pixel P is compared with the conventional technique. It can be generated with high accuracy. Thereby, it is possible to prevent image degradation such as jaggy and edge dullness, and a high-quality image can be obtained.

また本実施形態によれば、ステップS9において、補間画素Pの周囲に位置する各周囲画素のベクトル量と予め定める閾値とを比較し、予め定める閾値以上となるベクトル量を有する周囲画素を選択し、選択された周囲画素の画素データを用いて、補間画素Pの画素データを生成する。このように、予め定める閾値以上となるベクトル量を有する周囲画素の画素データを用いて補間画素Pの画素データを生成することによって、従来技術のようにエッジ付近の画像がぼやけて画像が劣化することを防止することができ、従来技術に比べて高画質の画像を得ることができる。   Further, according to the present embodiment, in step S9, the vector amount of each surrounding pixel located around the interpolation pixel P is compared with a predetermined threshold value, and a surrounding pixel having a vector amount equal to or greater than the predetermined threshold value is selected. The pixel data of the interpolation pixel P is generated using the pixel data of the selected surrounding pixels. As described above, by generating pixel data of the interpolated pixel P using pixel data of surrounding pixels having a vector amount equal to or greater than a predetermined threshold value, the image near the edge is blurred and the image is deteriorated as in the prior art. Therefore, it is possible to obtain a high-quality image as compared with the prior art.

次に、前述の実施形態について、具体的な数値を用いて説明する。図4は、補間画素Pの周囲画素P1〜P4およびその周囲の12画素と、それらの階調値を表す画素データとを示す図である。図中の破線で示す正方形は、補間画素が生成される領域を示している。ここで、図4に示す各周囲画素P1〜P4の画素データは8ビットデータであり、0以上256未満の範囲の整数値である。また、補間画素Pの座標を、P(20.7,10.2)とし、図4において左端から2番目でかつ上端から2番目の画素である周囲画素P1の座標を、P1(20,10)とする。   Next, the above-described embodiment will be described using specific numerical values. FIG. 4 is a diagram illustrating the surrounding pixels P1 to P4 of the interpolation pixel P and 12 surrounding pixels, and pixel data representing their gradation values. A square indicated by a broken line in the figure indicates a region where an interpolation pixel is generated. Here, the pixel data of each of the surrounding pixels P1 to P4 shown in FIG. 4 is 8-bit data, and is an integer value in the range of 0 to less than 256. Further, the coordinates of the interpolation pixel P is P (20.7, 10.2), and the coordinates of the surrounding pixel P1 which is the second pixel from the left end and the second pixel from the upper end in FIG. 4 are P1 (20, 10). ).

まず、補間画素Pの周囲に位置する複数の、本実施形態では4つの周囲画素の位置および画素データの抽出処理を行う。本実施形態では、補間画素Pを囲む4つの周囲画素P1〜P4の位置および画素データを抽出する。本実施形態において抽出される4つの周囲画素P1〜P4の座標は、それぞれP1(20,10)、P2(21,10)、P3(20,11)、P4(21,11)であり、周囲画素P1〜P4の画素データは、それぞれ、140,132,201,151である。   First, extraction processing is performed on the positions and pixel data of a plurality of surrounding pixels in this embodiment, which are located around the interpolation pixel P. In the present embodiment, the positions and pixel data of the four surrounding pixels P1 to P4 surrounding the interpolation pixel P are extracted. The coordinates of the four surrounding pixels P1 to P4 extracted in this embodiment are P1 (20, 10), P2 (21, 10), P3 (20, 11), and P4 (21, 11), respectively. The pixel data of the pixels P1 to P4 are 140, 132, 201, and 151, respectively.

周囲画素P1〜P4が抽出された後は、補間画素Pの位置に最近接する周囲画素を選択する。詳細には、補間画素Pの位置と各周囲画素P1〜P4の位置との距離を求めることによって、補間画素Pの位置に最近接する周囲画素を選択する。補間画素Pと周囲画素P1との距離をD(P1(20,10))、補間画素Pと周囲画素P2との距離をD(P2(21,10))、補間画素Pと周囲画素P3との距離をD(P3(20,11))および補間画素Pと周囲画素P4との距離をD(P4(21,11))とすると、
D(P1(20,10))=|20.7−20|+|10.2−10|=0.9
D(P2(21,10))=|20.7−21|+|10.2−10|=0.5
D(P3(20,11))=|20.7−20|+|10.2−11|=1.5
D(P4(21,11))=|20.7−21|+|10.2−11|=1.1
となる。補間画素Pと周囲画素P1〜P4との距離を計算した結果、D(P2(21,10))の値が最小であることから、補間画素Pの位置に最近接する周囲画素は、周囲画素P2となる。本実施形態では、補間画素Pの位置に最近接する周囲画素P2を、補間処理における基準の周囲画素とする。以下の説明では、基準の周囲画素を「基準の周囲画素P2」と表記する場合がある。
After the surrounding pixels P1 to P4 are extracted, the surrounding pixel closest to the position of the interpolation pixel P is selected. Specifically, the peripheral pixel closest to the position of the interpolation pixel P is selected by obtaining the distance between the position of the interpolation pixel P and the positions of the peripheral pixels P1 to P4. The distance between the interpolation pixel P and the surrounding pixel P1 is D (P1 (20, 10)), the distance between the interpolation pixel P and the surrounding pixel P2 is D (P2 (21, 10)), and the interpolation pixel P and the surrounding pixel P3 are Is D (P3 (20,11)) and the distance between the interpolation pixel P and the surrounding pixel P4 is D (P4 (21,11)).
D (P1 (20,10)) = | 20.7−20 | + | 10.2−10 | = 0.9
D (P2 (21,10)) = | 20.7-21 | + | 10.2-10 | = 0.5
D (P3 (20,11)) = | 20.7-20 | + | 10.2-11 | = 1.5
D (P4 (21,11)) = | 20.7-21 | + | 10.2-11 | = 1.1
It becomes. As a result of calculating the distance between the interpolation pixel P and the surrounding pixels P1 to P4, the value of D (P2 (21,10)) is the smallest, so the surrounding pixel closest to the position of the interpolation pixel P is the surrounding pixel P2. It becomes. In the present embodiment, the surrounding pixel P2 closest to the position of the interpolation pixel P is set as a reference surrounding pixel in the interpolation process. In the following description, the reference surrounding pixel may be referred to as “reference surrounding pixel P2”.

次に、基準の周囲画素P2を除く各周囲画素P1,P3,P4の周囲に位置する複数の、本実施形態では8つの近傍画素を選択する。以下、周囲画素P1とその近傍画素を一例として説明を行うが、他の周囲画素P3,P4についても同様の処理を行う。   Next, a plurality of neighboring pixels in the present embodiment, which are located around each of the surrounding pixels P1, P3, and P4 excluding the reference surrounding pixel P2, are selected. Hereinafter, the surrounding pixel P1 and its neighboring pixels will be described as an example, but the same processing is performed for the other surrounding pixels P3 and P4.

図5は、周囲画素P1およびその周囲の近傍画素Q1〜Q8を示す図である。同図において、周囲画素P1の近傍画素Q1〜Q8の座標は、それぞれQ1(19,9),Q2(20,9),Q3(21,9),Q4(19,10),Q5(21,10),Q6(19,11),Q7(20,11),Q8(21,11)である。また、近傍画素Q1〜Q8の階調値を表す画素データは、それぞれ141,137,131,200,132,210,201,151である。   FIG. 5 is a diagram showing the surrounding pixel P1 and neighboring pixels Q1 to Q8 around the surrounding pixel P1. In the figure, the coordinates of the neighboring pixels Q1 to Q8 of the surrounding pixel P1 are respectively Q1 (19, 9), Q2 (20, 9), Q3 (21, 9), Q4 (19, 10), Q5 (21, 10), Q6 (19, 11), Q7 (20, 11), Q8 (21, 11). The pixel data representing the gradation values of the neighboring pixels Q1 to Q8 are 141, 137, 131, 200, 132, 210, 201, and 151, respectively.

まず、周囲画素P1に関して、図5に示すように、周囲画素P1の周囲に位置する8つの近傍画素Q1〜Q8を選択する。   First, regarding the surrounding pixel P1, as shown in FIG. 5, eight neighboring pixels Q1 to Q8 positioned around the surrounding pixel P1 are selected.

次に、周囲画素P1とその近傍画素Q1〜Q8の画素データに対して量子化処理を行う。本実施形態の階調値を表す画素データは、0以上256未満の範囲の数値で表される8ビットのデータである。8ビットの画素データは、256階調で表されるので、階調差に基づいて周囲画素を選択しようとすると、周囲画素選択条件となる閾値の設定が多岐にわたり、周囲画素の選択が困難になる。そこで、本実施形態では、量子化を行うことによって8ビットの画素データを離散値に変換し、周囲画素選択条件となる閾値の設定を比較的容易にできるようにしている。   Next, a quantization process is performed on the pixel data of the surrounding pixel P1 and its neighboring pixels Q1 to Q8. The pixel data representing the gradation value of the present embodiment is 8-bit data represented by a numerical value in the range of 0 to less than 256. Since 8-bit pixel data is expressed in 256 gradations, when trying to select surrounding pixels based on the gradation difference, there are a wide variety of threshold settings as surrounding pixel selection conditions, making it difficult to select surrounding pixels. Become. Thus, in the present embodiment, quantization is performed to convert 8-bit pixel data into discrete values so that a threshold value as a surrounding pixel selection condition can be set relatively easily.

図6は、図4に示す補間画素Pの周囲画素P1〜P4とその周囲の近傍画素の画素データに対して量子化処理をそれぞれ行ったときの量子化データを示す図である。本実施形態の量子化処理では、8ビットのデータを4ビットのデータに変換する。詳細には、8ビットデータの下位4ビットを省き、上位4ビットのデータのみを用いる。たとえば、周囲画素P1の近傍画素の一つである近傍画素Q1(19,9)における画素データ141に対して量子化処理を行うことを考える。画素データ141を2進数で表すと、10001101となり、上位4ビットのみのデータに変換すると、2進数表示で1000となる。これを10進数で表すと8となるので、座標Q1(19,9)における量子化データは、Q1(19,9)=8となる。   FIG. 6 is a diagram illustrating the quantized data when the quantization processing is performed on the pixel data of the surrounding pixels P1 to P4 of the interpolation pixel P illustrated in FIG. In the quantization processing of the present embodiment, 8-bit data is converted into 4-bit data. Specifically, the lower 4 bits of 8-bit data are omitted and only the upper 4 bits of data are used. For example, consider that the quantization process is performed on the pixel data 141 in the neighboring pixel Q1 (19, 9), which is one of the neighboring pixels of the surrounding pixel P1. When the pixel data 141 is expressed in binary, it is 10001101, and when converted to data of only the upper 4 bits, it is 1000 in binary display. Since this is 8 in decimal, the quantized data at the coordinate Q1 (19,9) is Q1 (19,9) = 8.

前述の処理と同様にして、周囲画素P1〜P4およびその近傍画素に対して量子化処理を行うと、図6に示すように、0以上16未満の範囲の数値で表される量子化データが算出される。周囲画素P1に対する量子化データは8であり、周囲画素P1の近傍画素Q1〜Q8に対する量子化データは、8,8,8,12,8,13,12,9である。   When the quantization process is performed on the surrounding pixels P1 to P4 and the neighboring pixels in the same manner as described above, quantized data represented by numerical values in the range of 0 to less than 16 is obtained as shown in FIG. Calculated. The quantized data for the surrounding pixel P1 is 8, and the quantized data for the neighboring pixels Q1 to Q8 of the surrounding pixel P1 are 8, 8, 8, 12, 8, 13, 12, and 9.

次に、前述の量子化データに基づいて、周囲画素P1とその近傍画素Q1〜Q8との差分値の絶対値(以下、「差分絶対値D1〜D8」と表記する場合がある)を算出する。差分絶対値D1〜D8は、それぞれ以下のようになる。
D1=|P1(20,10)−Q1(19, 9)|=|8− 8|=0
D2=|P1(20,10)−Q2(20, 9)|=|8− 8|=0
D3=|P1(20,10)−Q3(21, 9)|=|8− 8|=0
D4=|P1(20,10)−Q4(19,10)|=|8−12|=4
D5=|P1(20,10)−Q5(21,10)|=|8− 8|=0
D6=|P1(20,10)−Q6(19,11)|=|8−13|=5
D7=|P1(20,10)−Q7(20,11)|=|8−12|=4
D8=|P1(20,10)−Q8(21,11)|=|8− 9|=1
Next, based on the quantized data described above, an absolute value of a difference value between the surrounding pixel P1 and its neighboring pixels Q1 to Q8 (hereinafter, may be referred to as “difference absolute value D1 to D8”) is calculated. . The difference absolute values D1 to D8 are as follows.
D1 = | P1 (20,10) -Q1 (19,9) | = | 8-8 | = 0
D2 = | P1 (20,10) -Q2 (20,9) | = | 8-8 | = 0
D3 = | P1 (20,10) -Q3 (21,9) | = | 8-8 | = 0
D4 = | P1 (20,10) -Q4 (19,10) | = | 8-12 | = 4
D5 = | P1 (20,10) −Q5 (21,10) | = | 8−8 | = 0
D6 = | P1 (20,10) -Q6 (19,11) | = | 8-13 | = 5
D7 = | P1 (20,10) -Q7 (20,11) | = | 8-12 | = 4
D8 = | P1 (20,10) -Q8 (21,11) | = | 8-9 | = 1

差分絶対値D1〜D8の中で、予め定める閾値以下となる差分絶対値の算出に関わる近傍画素を選択する。これによって、階調差の大きい画素情報を排除することができる。本実施形態では、閾値を1とし、1以下の差分絶対値の算出に関わる近傍画素を選択する。本実施形態では、差分絶対値D1,D2,D3,D5,D8がそれぞれ1以下となるので、座標がQ1(19, 9),Q2(20, 9),Q3(21, 9),Q5(21,10),Q8(21,11)の近傍画素Q1,Q2,Q3,Q5,Q8が選択される。   Among the absolute difference values D1 to D8, the neighboring pixels involved in calculating the absolute difference value that is equal to or less than a predetermined threshold value are selected. As a result, pixel information having a large gradation difference can be eliminated. In the present embodiment, the threshold value is set to 1, and the neighboring pixels involved in the calculation of the absolute difference value of 1 or less are selected. In the present embodiment, the absolute difference values D1, D2, D3, D5, and D8 are each 1 or less, so that the coordinates are Q1 (19, 9), Q2 (20, 9), Q3 (21, 9), Q5 ( 21,10), Q8 (21,11) neighboring pixels Q1, Q2, Q3, Q5, Q8 are selected.

図7は、周囲画素P1〜P4におけるベクトルの方向およびベクトル量を示す図である。同図に示す矢符は、ベクトルの方向を表し、矢符の真上または右側に示す数値は、ベクトル量を表す。前述のようにして、複数の近傍画素が選択された後は、選択された複数の近傍画素の中で、基準の周囲画素P2の位置に最近接する近傍画素を選択する。これによって、階調値の近い画素で、かつ補間画素Pの位置に関連する画素に絞込むことができる。本実施形態では、基準の周囲画素P2と実質的に同一である近傍画素Q5が既に選択されているので、ここでは近傍画素Q5が選択される。そして、周囲画素P1(20,10)を始点として、基準の周囲画素P2の位置に最近接する近傍画素として選択された周囲画素Q5(21,10)を終点とした第1ベクトルと、周囲画素P1(20,10)を始点として、基準の周囲画素P2(21,10)を終点とした第2ベクトルとのなす角度に基づいて、周囲画素P1のベクトル量を算出する。前記第1ベクトルと第2ベクトルとは同方向であるので、第1ベクトルと第2ベクトルとのなす角度は0度である。したがって、周囲画素P1のベクトル量は1となる。   FIG. 7 is a diagram illustrating vector directions and vector amounts in the surrounding pixels P1 to P4. The arrow shown in the figure represents the vector direction, and the numerical value shown immediately above or to the right of the arrow represents the vector quantity. As described above, after a plurality of neighboring pixels are selected, a neighboring pixel closest to the position of the reference surrounding pixel P2 is selected from the plurality of selected neighboring pixels. As a result, it is possible to narrow down to pixels that have similar gradation values and are related to the position of the interpolation pixel P. In the present embodiment, since the neighboring pixel Q5 that is substantially the same as the reference surrounding pixel P2 has already been selected, the neighboring pixel Q5 is selected here. A first vector having the surrounding pixel P1 (20, 10) as a starting point and the surrounding pixel Q5 (21, 10) selected as a neighboring pixel closest to the position of the reference surrounding pixel P2 as an end point, and the surrounding pixel P1 The vector amount of the surrounding pixel P1 is calculated based on the angle formed by the second vector with the reference surrounding pixel P2 (21, 10) as the end point, starting at (20, 10). Since the first vector and the second vector are in the same direction, the angle formed by the first vector and the second vector is 0 degree. Therefore, the vector amount of the surrounding pixel P1 is 1.

以上のことを整理すると、図7に示すように、周囲画素P1は、ベクトルの方向がP1(20,10)からP2(21,10)に向かう方向で、かつベクトル量が1である。基準の周囲画素P2および周囲画素P1を除く周囲画素P3,P4についても、周囲画素P1と同様にして、ベクトルの方向およびベクトル量を算出することができる。周囲画素P3は、図7に示すように、ベクトルの方向がP3(20,11)からR1(19,10)に向かう方向、またはP3(20,11)からR2(21,12)に向かう方向であり、ベクトル量は0となる。また、周囲画素P4(21,11)は、図7に示すように、ベクトルの方向がP4(21,11)からP2(21,10)に向かう方向であり、ベクトル量は1となる。   To summarize the above, as shown in FIG. 7, the surrounding pixel P1 has a vector direction from P1 (20, 10) to P2 (21, 10) and a vector amount of 1. For the surrounding pixels P3 and P4 excluding the reference surrounding pixel P2 and the surrounding pixel P1, the vector direction and the vector amount can be calculated in the same manner as the surrounding pixel P1. As shown in FIG. 7, the surrounding pixel P3 has a vector direction from P3 (20, 11) to R1 (19, 10), or from P3 (20, 11) to R2 (21, 12). And the vector quantity is zero. In the surrounding pixel P4 (21, 11), as shown in FIG. 7, the vector direction is the direction from P4 (21, 11) to P2 (21, 10), and the vector amount is 1.

周囲画素P3(20,11)については、図7において破線の矢符で示すように、2つのベクトル方向を選択可能であるが、いずれを選択した場合でも、ベクトル量は0となるので、ベクトルの方向はいずれであっても構わないし、選択する必要もない。また、複数のベクトル方向を選択可能な周囲画素で、かつ後述する補間演算に用いる周囲画素である場合、すなわち、ベクトル量が0ではなく、ベクトルの方向も基準の周囲画素に向いている周囲画素である場合には、元の8ビットの画素データ同士の差分絶対値を求め、その差分絶対値の小さい周囲画素を始点とし、基準の周囲画素を終点とするベクトルのベクトル方向を選択するようにする。差分絶対値が同じときには、いずれか一方のベクトル方向を所定の規則に従って選択するようにすればよい。   As for the surrounding pixel P3 (20, 11), two vector directions can be selected as indicated by broken arrows in FIG. 7, but the vector amount is 0 regardless of which one is selected. The direction may be any and need not be selected. Further, in the case of surrounding pixels that can be selected from a plurality of vector directions and are surrounding pixels that are used for an interpolation calculation described later, that is, surrounding pixels in which the vector amount is not 0 and the vector direction is also directed to the reference surrounding pixels The absolute value of the difference between the original 8-bit pixel data is obtained, and the vector direction of the vector starting from the surrounding pixel with the small difference absolute value as the start point and the reference surrounding pixel as the end point is selected. To do. When the difference absolute value is the same, one of the vector directions may be selected according to a predetermined rule.

図8は、補間演算に用いる周囲画素として選択された周囲画素を破線で囲んで示す図である。基準の周囲画素P2を除く周囲画素P1,P3,P4のベクトル量を算出した後は、周囲画素P1,P3,P4の中から、予め定める閾値に基づいて、補間演算に用いる周囲画素を選択する。本実施形態では閾値を1とし、閾値以上のベクトル量を有する周囲画素を選択する。本実施形態では、周囲画素P1,P4のベクトル量が1以上であるので、周囲画素P1,P4が選択される。また、これらの周囲画素に加えて、補間画素Pの位置に最近接する周囲画素、つまり基準の周囲画素P2も選択される。図8において、破線で囲んで示される周囲画素は、選択された周囲画素である。   FIG. 8 is a diagram showing surrounding pixels selected as surrounding pixels used for the interpolation calculation surrounded by a broken line. After calculating the vector amounts of the surrounding pixels P1, P3, and P4 excluding the reference surrounding pixel P2, the surrounding pixels used for the interpolation calculation are selected from the surrounding pixels P1, P3, and P4 based on a predetermined threshold value. . In the present embodiment, the threshold value is set to 1, and surrounding pixels having a vector amount equal to or greater than the threshold value are selected. In the present embodiment, since the vector amounts of the surrounding pixels P1 and P4 are 1 or more, the surrounding pixels P1 and P4 are selected. In addition to these peripheral pixels, a peripheral pixel closest to the position of the interpolation pixel P, that is, a reference peripheral pixel P2 is also selected. In FIG. 8, surrounding pixels indicated by a broken line are selected surrounding pixels.

次に、基準の周囲画素P2のベクトル方向およびベクトル量を算出する。ベクトル方向は自分自身への方向となり、ベクトル量は選択されなかった周囲画素P3の位置を示す座標P3(20,11)から補間画素Pの位置を示す座標P(20.7,10.2)までの距離Lに関する重み係数に1を加えた値、すなわち、{(20+1)−20.7}×{10.2−(11−1)}+1=1.06となる。   Next, the vector direction and vector amount of the reference surrounding pixel P2 are calculated. The vector direction is a direction toward itself, and the vector amount is a coordinate P (20.7, 10.2) indicating the position of the interpolation pixel P from a coordinate P3 (20, 11) indicating the position of the surrounding pixel P3 that is not selected. A value obtained by adding 1 to the weighting coefficient related to the distance L up to, that is, {(20 + 1) −20.7} × {10.2− (11−1)} + 1 = 1.06.

前述のように、補間演算に用いる周囲画素として選択された周囲画素P1,P2,P4における画素データと、これらのベクトル量を重み係数として用いて、前記式(1)に基づいて補間演算を行い、算出結果を補間画素Pの画素データとして生成する。   As described above, using the pixel data in the surrounding pixels P1, P2, and P4 selected as the surrounding pixels used for the interpolation calculation and their vector quantities as weighting factors, the interpolation calculation is performed based on the above equation (1). The calculation result is generated as pixel data of the interpolation pixel P.

補間画素Pの画素データをP(20.7,10.2)とすると、式(1)より、
P(20.7,10.2)
={21−20.7}×{11−10.2}×140×1
+{20.7−20}×{11−10.2}×132×1.06
+{21−20.7}×{10.2−10}×201×0
+{20.7−20}×{10.2−10}×151×1=133
ただし、算出結果は、小数点以下第1位を四捨五入している。
Assuming that the pixel data of the interpolation pixel P is P (20.7, 10.2), from Equation (1),
P (20.7, 10.2)
= {21-20.7} × {11-10.2} × 140 × 1
+ {20.7-20} × {11-10.2} × 132 × 1.06
+ {21-20.7} × {10.2-10} × 201 × 0
+ {20.7−20} × {10.2−10} × 151 × 1 = 133
However, the calculation results are rounded to the first decimal place.

以上の処理を、原画像の1つの走査線上に並ぶすべての補間画素に対して行う。原画像の1つの走査線上に並ぶ所定の補間画素に対して補間処理を行った後は、補間処理の対象を、同じ走査線上で画素データを生成していない補間画素に移動し、同様の補間処理を行う。原画像の1つの走査線における補間処理が完了したら、走査線を移動させ、移動した走査線において前述と同様の補間処理を繰返す。原画像のすべての走査線上に並ぶ補間画素に対する補間処理が完了したところで、本実施形態の補間処理が完了したことになる。   The above processing is performed for all the interpolated pixels arranged on one scanning line of the original image. After performing the interpolation processing on the predetermined interpolation pixels arranged on one scanning line of the original image, the interpolation processing target is moved to the interpolation pixel that does not generate pixel data on the same scanning line, and the same interpolation is performed. Process. When the interpolation process for one scan line of the original image is completed, the scan line is moved, and the same interpolation process as described above is repeated for the moved scan line. When the interpolation processing for the interpolation pixels arranged on all the scanning lines of the original image is completed, the interpolation processing of this embodiment is completed.

前述の実施形態では、量子化処理によって8ビットのデータを4ビットのデータに変換し、変換した4ビットのデータを用いているが、本発明はこれに限るものではなく、たとえば処理量と精度とに応じたビット数のデータを用いればよい。また、前述の実施形態では、補間処理において、周囲画素の周囲に位置する8つの画素を近傍画素として選択し、これらの画素データを用いているが、さらに広範囲の近傍画素を用いてもよいし、原画素間の画素データを計算し、これらのデータを用いるようにしてもよい。ただし、前述の場合には、ベクトル量および閾値を適宜変更する。   In the above-described embodiment, 8-bit data is converted into 4-bit data by quantization processing, and the converted 4-bit data is used. However, the present invention is not limited to this. It is sufficient to use data having the number of bits corresponding to. In the above-described embodiment, in the interpolation process, eight pixels located around the surrounding pixels are selected as the neighboring pixels and these pixel data are used. However, a wider range of neighboring pixels may be used. Alternatively, pixel data between original pixels may be calculated and used. However, in the above case, the vector amount and the threshold value are changed as appropriate.

図9は、補間処理を実行する補間処理部1の構成を示すブロック図である。補間処理部1は、補間処理手段100を含む。補間処理手段100は、補間画素位置決定手段101、周囲画素抽出手段102、基準の周囲画素選択手段103、近傍画素抽出手段104、補正係数算出手段105および補間演算処理手段113を含んで構成される。さらに、補正係数算出手段105は、量子化処理手段106、差分絶対値算出手段107、第1近傍画素選択手段108、第2近傍画素選択手段109、第1ベクトル量算出手段110、周囲画素選択手段111および第2ベクトル量算出手段112を含んで構成される。   FIG. 9 is a block diagram illustrating a configuration of the interpolation processing unit 1 that executes the interpolation processing. The interpolation processing unit 1 includes interpolation processing means 100. The interpolation processing unit 100 includes an interpolation pixel position determination unit 101, a surrounding pixel extraction unit 102, a reference surrounding pixel selection unit 103, a neighboring pixel extraction unit 104, a correction coefficient calculation unit 105, and an interpolation calculation processing unit 113. . Further, the correction coefficient calculating unit 105 includes a quantization processing unit 106, a difference absolute value calculating unit 107, a first neighboring pixel selecting unit 108, a second neighboring pixel selecting unit 109, a first vector amount calculating unit 110, and a surrounding pixel selecting unit. 111 and the second vector quantity calculation means 112.

補間処理部1に、空間フィルタ処理部2によってフィルタ処理が施された画素データが入力されると、補間画素位置決定手段101は、補間倍率に応じて、原画像における補間画素の位置を算出する。本実施形態の補間画素位置決定手段101は、補間画素位置算出手段である。   When the pixel data filtered by the spatial filter processing unit 2 is input to the interpolation processing unit 1, the interpolation pixel position determining unit 101 calculates the position of the interpolation pixel in the original image according to the interpolation magnification. . The interpolation pixel position determination unit 101 of this embodiment is an interpolation pixel position calculation unit.

周囲画素抽出手段102は、補間画素の周囲に位置する4つの周囲画素の位置および画素データを抽出する。基準の周囲画素選択手段103は、周囲画素抽出手段によって抽出された4つの周囲画素P1〜P4の位置に基づいて、補間画素Pの位置に最近接する周囲画素を選択し、これを補間処理の基準の周囲画素とする。   The surrounding pixel extraction means 102 extracts the positions and pixel data of four surrounding pixels located around the interpolation pixel. The reference surrounding pixel selection unit 103 selects a surrounding pixel closest to the position of the interpolation pixel P based on the positions of the four surrounding pixels P1 to P4 extracted by the surrounding pixel extraction unit, and uses this as a reference for interpolation processing. The surrounding pixels.

近傍画素抽出手段は、4つの周囲画素のそれぞれの周囲に位置する8つの近傍画素の位置および画素データを抽出する。量子化処理手段106は、周囲画素抽出手段102
によって抽出された4つの周囲画素の画素データおよび近傍画素抽出手段104によって抽出された8つの近傍画素の画素データに対して量子化処理を行い、8ビットのデータから4ビットのデータに変換した量子化データを算出する。
The neighboring pixel extraction unit extracts the positions and pixel data of eight neighboring pixels located around each of the four neighboring pixels. The quantization processing means 106 is a peripheral pixel extraction means 102.
Quantization processing is performed on the pixel data of the four surrounding pixels extracted by the above and the pixel data of the eight neighboring pixels extracted by the neighboring pixel extracting unit 104, and the quantum converted from the 8-bit data to the 4-bit data Calculation data is calculated.

差分絶対値算出手段107は、量子化処理手段106によって求められた4つの周囲画素の量子化データと周囲画素の周囲に位置する8つの近傍画素の量子化データとの差分値の絶対値(以下、「差分絶対値」と表記する場合がある)を算出する。   The difference absolute value calculation means 107 is the absolute value of the difference value between the quantized data of the four surrounding pixels obtained by the quantization processing means 106 and the quantized data of the eight neighboring pixels located around the surrounding pixels (hereinafter referred to as the absolute value). , Sometimes expressed as “difference absolute value”).

第1近傍画素選択手段108は、差分絶対値算出手段107によって算出される差分絶対値と予め定める閾値との大小関係を比較し、閾値以下となる差分絶対値の算出に関わる近傍画素を選択する。第2近傍画素選択手段109は、第1近傍画素選択手段108によって選択された近傍画素のうち、基準の周囲画素に最近接する近傍画素を選択する。   The first neighboring pixel selecting unit 108 compares the magnitude relationship between the absolute difference value calculated by the absolute difference value calculating unit 107 and a predetermined threshold value, and selects neighboring pixels involved in the calculation of the absolute difference value that is equal to or less than the threshold value. . The second neighboring pixel selecting unit 109 selects a neighboring pixel closest to the reference surrounding pixel among the neighboring pixels selected by the first neighboring pixel selecting unit 108.

第1ベクトル量算出手段110は、基準の周囲画素を除く各周囲画素を始点とし、第2近傍画素選択手段109によって各周囲画素ごとに選択された近傍画素を終点とする第1ベクトルと、基準の周囲画素を除く各周囲画素を始点とし、基準の周囲画素を終点とする第2ベクトルとのなす角度に基づいて、基準の周囲画素を除く各周囲画素のベクトル量を算出する第1の補正係数算出手段である。   The first vector amount calculation means 110 includes a first vector having a starting point for each surrounding pixel excluding the reference surrounding pixels and an end point for the neighboring pixels selected for each surrounding pixel by the second neighboring pixel selection means 109; A first correction for calculating a vector amount of each surrounding pixel excluding the reference surrounding pixel based on an angle formed with a second vector having the surrounding pixel except the surrounding pixel as a start point and the reference surrounding pixel as an end point Coefficient calculation means.

周囲画素選択手段111は、第1ベクトル算出手段110によって算出される各周囲画素のベクトル量に基づいて、基準の周囲画素を除く周囲画素の中から後述する補間演算に用いる周囲画素を選択する。詳細には、各周囲画素のベクトル量と予め定める閾値との大小関係を比較し、閾値以上となるベクトル量を有する周囲画素を選択する。   The surrounding pixel selection unit 111 selects a surrounding pixel to be used for an interpolation calculation described later from surrounding pixels excluding the reference surrounding pixel, based on the vector amount of each surrounding pixel calculated by the first vector calculation unit 110. Specifically, the magnitude relationship between the vector amount of each surrounding pixel and a predetermined threshold value is compared, and surrounding pixels having a vector amount equal to or greater than the threshold value are selected.

第2ベクトル量算出手段112は、基準の周囲画素のベクトル量を算出する第2の補正係数算出手段である。詳細には、周囲画素選択手段111によって選択されなかった各周囲画素の位置と補間画素の位置との距離に関する重み係数を算出し、その総和に1を加算した値を基準の周囲画素のベクトル量とする。   The second vector amount calculation unit 112 is a second correction coefficient calculation unit that calculates a vector amount of a reference surrounding pixel. More specifically, a weighting factor related to the distance between the position of each surrounding pixel and the position of the interpolation pixel that has not been selected by the surrounding pixel selection unit 111 is calculated, and a value obtained by adding 1 to the sum is used as the vector amount of the reference surrounding pixel And

補間演算処理手段113は、周囲画素選択手段111によって選択された各周囲画素の画素データおよびベクトル量を重み係数とし、線形補間式に前記重み係数を乗算した式に基づいて、補間画素の画素データを生成する。   The interpolation calculation processing unit 113 uses the pixel data and vector amount of each surrounding pixel selected by the surrounding pixel selection unit 111 as a weighting factor, and based on an equation obtained by multiplying the linear interpolation equation by the weighting factor, the pixel data of the interpolation pixel Is generated.

後述するカラー画像処理装置AのCPU(Central Processing Unit)は、原画像の1つの走査線上に並ぶ補間画素に対する補間処理が完了したか否かを判定する。CPUによって、原画像の1つの走査線上に並ぶ補間画素に対する補間処理が完了していないと判定されたときは、補間処理手段による補間処理が行われる。CPUによって、原画像の1つの走査線上に並ぶ補間画素に対する補間処理が完了したと判定されると、色判定部3へ補間画素の画素データが出力され、CPUによって、原画像のすべての走査線上に並ぶ補間画素に対する補間処理が完了したか否かが判定される。CPUによって、原画像のすべての補間走査線上に並ぶ補間画素Pに対する補間処理が完了していないと判定されたときは、補間処理手段による補間処理が行われる。CPUによって、原画像のすべての走査線上に並ぶ補間画素に対する補間処理が完了したと判定されたときは、補間処理を終了する。   A CPU (Central Processing Unit) of the color image processing apparatus A, which will be described later, determines whether or not interpolation processing for interpolation pixels arranged on one scanning line of the original image has been completed. When the CPU determines that the interpolation processing for the interpolation pixels arranged on one scanning line of the original image has not been completed, the interpolation processing by the interpolation processing means is performed. When the CPU determines that the interpolation processing for the interpolation pixels arranged on one scanning line of the original image has been completed, the pixel data of the interpolation pixel is output to the color determination unit 3, and the CPU outputs the pixel data on all the scanning lines of the original image. It is determined whether or not the interpolation processing for the interpolated pixels arranged in is completed. When the CPU determines that the interpolation processing for the interpolation pixels P arranged on all the interpolation scanning lines of the original image is not completed, the interpolation processing by the interpolation processing means is performed. When the CPU determines that the interpolation processing for the interpolation pixels arranged on all the scanning lines of the original image is completed, the interpolation processing ends.

なお、補間演算処理手段113によって生成された画素データは、後述するカラー画像処理装置の色補正部3へ出力される。   The pixel data generated by the interpolation calculation processing unit 113 is output to the color correction unit 3 of the color image processing apparatus described later.

図10は、カラー画像処理装置Aを含む画像形成装置Bの構成を示すブロック図である。画像形成装置Bは、たとえばデジタルカラー複写機であり、カラー画像入力装置12、カラー画像処理装置A、カラー画像出力装置13、外部入力インターフェース14および外部出力インターフェース15を含んで構成される。   FIG. 10 is a block diagram illustrating a configuration of an image forming apparatus B including the color image processing apparatus A. The image forming apparatus B is, for example, a digital color copying machine, and includes a color image input device 12, a color image processing device A, a color image output device 13, an external input interface 14, and an external output interface 15.

カラー画像入力装置12は、入力させる画像を読取って画像データに変換する装置であり、CCD(Charge Coupled Device)などを備えたスキャナ部を含んで構成され、画像からの反射光像をCCDによって読取り、画素ごとにRGB(R:赤、G:緑、B:青)のアナログ信号に変換し、このアナログ信号をカラー画像処理装置Aに入力する。   The color image input device 12 is a device that reads an input image and converts it into image data. The color image input device 12 includes a scanner unit having a CCD (Charge Coupled Device) and the like, and reads a reflected light image from the image by the CCD. Each pixel is converted into an analog signal of RGB (R: red, G: green, B: blue), and this analog signal is input to the color image processing apparatus A.

カラー画像出力装置13は、カラー画像処理装置Aによって画像処理された画像データに基づいて、紙などの記録媒体上に画像を形成する。画像形成は、たとえば電子写真方式およびインクジェット方式によって行われる。   The color image output device 13 forms an image on a recording medium such as paper based on the image data processed by the color image processing device A. Image formation is performed by, for example, an electrophotographic method and an inkjet method.

外部入力インターフェース14は、たとえばイーサネット(登録商標)を介してネットワークプリンタに接続するために用いるインターフェースであり、外部出力インターフェース15は、たとえばファクシミリ送受信を行うために電話回線に接続するために用いるインターフェースである。以下、カラー画像処理装置Aの構成について説明する。   The external input interface 14 is an interface used to connect to a network printer via, for example, Ethernet (registered trademark), and the external output interface 15 is an interface used to connect to a telephone line to perform facsimile transmission / reception, for example. is there. Hereinafter, the configuration of the color image processing apparatus A will be described.

カラー画像処理装置Aは、A/D(アナログ/デジタル)変換部4、シェーディング補正部5、入力階調補正部6、領域分離処理部7、色空間変換部8、空間フィルタ処理部2、補間処理部1、色補正部3、黒生成下色除去部9、出力階調補正部10および階調再現処理部11を含む。   The color image processing apparatus A includes an A / D (analog / digital) conversion unit 4, a shading correction unit 5, an input tone correction unit 6, a region separation processing unit 7, a color space conversion unit 8, a spatial filter processing unit 2, and an interpolation. A processing unit 1, a color correction unit 3, a black generation and under color removal unit 9, an output tone correction unit 10, and a tone reproduction processing unit 11 are included.

カラー画像入力装置12から入力されたRGBのアナログ信号の画像データは、A/D変換部4、シェーディング補正部5、入力階調補正部6、領域分離処理部7、色空間変換部8、空間フィルタ処理部2、補間処理部1、色補正部3、黒生成下色除去部9、出力階調補正部10および階調再現処理部11の順で処理され、CMYK(C:シアン、M:マゼンタ、Y:イエロー、K:ブラック)のデジタルカラー信号として、カラー画像出力装置13へ出力される。   RGB analog signal image data input from the color image input device 12 includes an A / D conversion unit 4, a shading correction unit 5, an input tone correction unit 6, a region separation processing unit 7, a color space conversion unit 8, and a space. The filter processing unit 2, the interpolation processing unit 1, the color correction unit 3, the black generation and under color removal unit 9, the output gradation correction unit 10, and the gradation reproduction processing unit 11 are processed in this order, and CMYK (C: cyan, M: Magenta, Y: yellow, K: black) are output to the color image output device 13 as digital color signals.

A/D変換部4は、カラー画像入力装置12から入力されるRGBのアナログ信号をデジタル信号に変換して、シェーディング補正部5に出力する。シェーディング補正部5は、A/D変換部4から入力されたRGBのデジタル信号に対して、カラー画像入力装置12の照明系、結像系、撮像系で生じる各種の歪みを取除く処理を施し、RGBの反射率信号として出力する。入力階調補正部6は、シェーディング補正部5によって各種の歪みが取除かれたRGBの反射率信号に対して、カラーバランスを整えるとともに、濃度などカラー画像処理装置Aに採用されている画像処理システムに適した濃度信号に変換する。   The A / D conversion unit 4 converts RGB analog signals input from the color image input device 12 into digital signals and outputs the digital signals to the shading correction unit 5. The shading correction unit 5 performs processing for removing various distortions generated in the illumination system, imaging system, and imaging system of the color image input device 12 on the RGB digital signal input from the A / D conversion unit 4. And output as RGB reflectance signals. The input tone correction unit 6 adjusts the color balance of the RGB reflectance signal from which various distortions have been removed by the shading correction unit 5 and also performs image processing such as density used in the color image processing apparatus A. Convert to a density signal suitable for the system.

領域分離処理部7は、入力階調補正部6から入力されたRGB信号の画像データに基づいて、画像を構成する各画素を文字領域、網点領域および写真領域のいずれかに分離する領域分離処理を行う。領域分離処理部7は、領域分離処理の結果に基づき、各画素がいずれの領域に属しているかを示す領域識別信号を空間フィルタ処理部2、黒生成下色除去部9および階調再現処理部11へ出力するとともに、入力階調補正部6から入力されたRGBデジタル信号をそのまま色空間変換部8に出力する。色空間変換部8は、RGBデジタル信号をLCC(L:輝度、C:色度)のデジタル信号に変換し、これを空間フィルタ処理部2に出力する。   The region separation processing unit 7 separates each pixel constituting the image into one of a character region, a halftone dot region, and a photographic region based on the RGB signal image data input from the input tone correction unit 6. Process. Based on the result of the region separation processing, the region separation processing unit 7 outputs a region identification signal indicating which region each pixel belongs to the spatial filter processing unit 2, the black generation and under color removal unit 9, and the gradation reproduction processing unit. 11 and the RGB digital signal input from the input tone correction unit 6 is output to the color space conversion unit 8 as it is. The color space conversion unit 8 converts the RGB digital signal into an LCC (L: luminance, C: chromaticity) digital signal, and outputs this to the spatial filter processing unit 2.

空間フィルタ処理部2は、色空間変換部8から入力されたLCC信号に対して、デジタルフィルタによる空間フィルタ処理を行い、空間周波数特性を補正することによって、出力画像のぼやけおよび粒状性劣化を防止する。この空間フィルタ処理は、領域分離処理部7から出力される領域識別信号に基づいて行われる。すなわち、領域識別信号によって、処理対象となる画素がいずれの領域に属するかを識別し、領域に応じて最適な処理を行う。   The spatial filter processing unit 2 performs spatial filter processing using a digital filter on the LCC signal input from the color space conversion unit 8 and corrects the spatial frequency characteristics, thereby preventing blurring and graininess degradation of the output image. To do. This spatial filter processing is performed based on the region identification signal output from the region separation processing unit 7. That is, the region identification signal identifies which region the pixel to be processed belongs to, and performs optimal processing according to the region.

たとえば、領域分離処理部7によって文字に分離された領域に関しては、黒文字あるいは色文字の再現性を高めるために、空間フィルタ処理の鮮鋭強調処理によって高周波数の強調量を増大させる。また、領域分離処理部7によって網点に分離された領域に関しては、入力網点成分を除去するためのローパス・フィルタ処理が施される。空間フィルタ処理部2は、空間フィルタ処理を施したLCC信号を補間処理部1に出力する。   For example, for the region separated into characters by the region separation processing unit 7, the high frequency enhancement amount is increased by the sharp enhancement processing of the spatial filter processing in order to improve the reproducibility of the black characters or the color characters. The region separated into halftone dots by the region separation processing unit 7 is subjected to low-pass filter processing for removing input halftone components. The spatial filter processing unit 2 outputs the LCC signal subjected to the spatial filter processing to the interpolation processing unit 1.

補間処理部1は、空間フィルタ処理が行われたLCC信号に対して、前述のように、補間画素の画素データを生成する補間処理を施し、画像を補間する。   As described above, the interpolation processing unit 1 performs interpolation processing for generating pixel data of the interpolation pixels on the LCC signal that has been subjected to the spatial filter processing, and interpolates the image.

色補正部3は、色を忠実に再現するために、LCC信号からCMY信号に変換するとともに、カラー画像出力装置13に応じた色補正を行い、補正後のCMY信号を黒生成下色除去部9に出力する。   The color correction unit 3 converts the LCC signal into a CMY signal in order to faithfully reproduce the color, performs color correction according to the color image output device 13, and converts the corrected CMY signal into a black generation and under color removal unit. Output to 9.

黒生成下色除去部9は、色補正部3からのCMYの3色信号からK(ブラック)信号を生成する黒生成処理と、色補正部3からのCMY信号から黒生成処理で得られたK信号を差し引いて新たなCMY信号を生成する処理とを行い、CMYの3色信号をCMYKの4色信号に変換する。黒生成下色除去処理は、一般的な方法であるスケルトンブラックによって行われる。スケルトンブラックによる黒生成下色除去処理は、スケルトンカーブの入出力特性をy=f(x)とし、入力される信号をC,M,Yとし、出力される信号をC’,M’,Y’,K’とし、UCR(Under Color Removal)率をα(0<α<1)とすると、以下の式(2)〜式(5)で表される。なお、式(2)におけるminは、最小値(
minimum)を表す。
The black generation and lower color removal unit 9 is obtained by black generation processing for generating a K (black) signal from the CMY three-color signals from the color correction unit 3 and black generation processing from the CMY signals from the color correction unit 3. A process of generating a new CMY signal by subtracting the K signal is performed to convert the CMY three-color signal into a CMYK four-color signal. The black generation and under color removal processing is performed by skeleton black which is a general method. In the black generation and under color removal processing using skeleton black, the input / output characteristics of the skeleton curve are set to y = f (x), the input signals are set to C, M, and Y, and the output signals are set to C ′, M ′, and Y. When “, K” is assumed and the UCR (Under Color Removal) rate is α (0 <α <1), these are expressed by the following equations (2) to (5). In the equation (2), min is the minimum value (
minimum).

K’=f{min(C,M,Y)} …(2)
C’=C−αK’ …(3)
M’=M−αK’ …(4)
Y’=Y−αK’ …(5)
K ′ = f {min (C, M, Y)} (2)
C ′ = C−αK ′ (3)
M ′ = M−αK ′ (4)
Y ′ = Y−αK ′ (5)

出力階調補正部10は、濃度信号であるCMYK信号を、カラー画像出力装置13の特性値である網点面積率に変換する出力階調補正処理を行う。階調再現処理部11は、領域識別信号に基づいて領域の識別がなされた画素のCMYK信号に対して、階調補正処理と、多値誤差拡散処理などの中間調生成処理とを施す。   The output tone correction unit 10 performs output tone correction processing for converting the CMYK signal that is a density signal into a halftone dot area ratio that is a characteristic value of the color image output device 13. The gradation reproduction processing unit 11 performs gradation correction processing and halftone generation processing such as multilevel error diffusion processing on the CMYK signals of the pixels whose regions are identified based on the region identification signals.

領域分離処理部7において文字領域に分離された画素に関しては、特に黒文字あるいは色文字の再現性を高めるために、空間フィルタ処理部2によって鮮鋭強調処理が施され、高周波数の強調量を増大した後、階調再現処理部11で、高域周波数の再現に適した高解像度のスクリーンでの2値化処理または多値化処理のいずれかが施される。領域分離処理部7にて写真領域に分離された画素に関しては、階調再現処理部11で、階調再現性を重視したスクリーンでの2値化処理または多値化処理のいずれかの処理が施される。そして、最終的に階調再現処理部11にて画像を複数の画素に分離し、各画素の階調を再現することができるようにする中間調生成処理が施される。   For the pixels separated into the character areas in the area separation processing unit 7, sharp enhancement processing is performed by the spatial filter processing unit 2 to increase the reproducibility of black characters or color characters in particular, and the amount of high-frequency enhancement is increased. Thereafter, the gradation reproduction processing unit 11 performs either binarization processing or multi-value quantization processing on a high-resolution screen suitable for high frequency reproduction. For the pixels separated into the photographic regions by the region separation processing unit 7, the gradation reproduction processing unit 11 performs either binarization processing or multi-value quantization processing on the screen with an emphasis on gradation reproducibility. Applied. Then, finally, the gradation reproduction processing unit 11 separates the image into a plurality of pixels, and halftone generation processing is performed so that the gradation of each pixel can be reproduced.

以上の各処理が施された画素データから成る画像データは、カラー画像処理装置Aの有する画像メモリに一旦記憶され、所定のタイミングで読み出されてカラー画像出力装置13に入力される。   The image data composed of the pixel data subjected to the above processes is temporarily stored in the image memory of the color image processing apparatus A, read out at a predetermined timing, and input to the color image output apparatus 13.

前述のように、補間処理を行う補間処理部1は、空間フィルタ処理部2の後に処理を行うよう構成されているが、本発明はこの形態に限定されるものではなく、色補正部3および黒生成下色処除去部9の後など、入力階調補正部6以降で、かつ階調再現処理部11以前ならばいずれの時点で処理を行うように構成されていてもよい。   As described above, the interpolation processing unit 1 that performs the interpolation processing is configured to perform the processing after the spatial filter processing unit 2. However, the present invention is not limited to this embodiment, and the color correction unit 3 and The processing may be performed at any time point after the input tone correction unit 6 and before the tone reproduction processing unit 11 such as after the black generation and lower color processing removing unit 9.

なお、補間処理部1における補間処理は、補間処理部1あるいはカラー画像処理装置AのDSP(Digital Signal Processor)を用いることによって行うこともできるが、補間処理プログラムを用いて、補間処理部1あるいはカラー画像処理装置AのCPUに行わせることもできる。   The interpolation processing in the interpolation processing unit 1 can be performed by using the interpolation processing unit 1 or the DSP (Digital Signal Processor) of the color image processing apparatus A. However, using the interpolation processing program, the interpolation processing unit 1 or It can also be performed by the CPU of the color image processing apparatus A.

このような画像形成装置Bを用いることによって、カラー画像処理装置Aによって生成された高画質の画像を出力することができる。また、装置規模の増大が抑えられているカラー画像処理装置Aを備えることによって、画像形成装置Bの装置規模の増大も抑えることができる。   By using such an image forming apparatus B, a high-quality image generated by the color image processing apparatus A can be output. Further, by providing the color image processing apparatus A in which the increase in apparatus scale is suppressed, the increase in apparatus scale of the image forming apparatus B can also be suppressed.

この補間処理プログラムは、コンピュータ読取り可能な記録媒体に記録され、コンピュータに実行させるようなものでもよい。これによって、補間処理プログラムを記録した記録媒体を持ち運び自在に提供することができる。   The interpolation processing program may be recorded on a computer-readable recording medium and executed by a computer. Accordingly, it is possible to provide a portable recording medium on which the interpolation processing program is recorded.

この補間処理プログラムを記録したコンピュータ読取り可能な記録媒体としては、コンピュータで処理を行うためのメモリ、たとえばROM(Read Only Memory)のようなプログラムメディアであってもよい。また、外部記憶装置として設けられたプログラム読取り装置に挿入することで、読取られるプログラムメディアであってもよい。   The computer-readable recording medium on which the interpolation processing program is recorded may be a memory for performing processing by the computer, for example, a program medium such as a ROM (Read Only Memory). Further, it may be a program medium that is read by being inserted into a program reading device provided as an external storage device.

いずれの場合においても、格納されているプログラムはマイクロプロセッサがアクセスして実行させる構成であってもよいし、あるいは、いずれの場合もプログラムを読み出し、読み出されたプログラムは、コンピュータのプログラム記憶エリアにダウンロードされて、そのプログラムが実行される方式であってもよい。このダウンロード用のプログラムは予め本体装置に格納されているものとする。   In any case, the stored program may be configured to be accessed and executed by the microprocessor, or in any case, the program is read and the read program is stored in the program storage area of the computer. The program may be downloaded and executed by the program. It is assumed that this download program is stored in the main device in advance.

ここで、前述のプログラムメディアは、本体と分離可能に構成される記録媒体であり、磁気テープおよびカセットテープによって固定的にプログラムを担持する媒体であってもよい。また、フレキシブルディスクおよびハードディスクなどの磁気ディスク、ならびにCD−ROM(Compact Disk Read Only Memory)、MO(Magneto Optical)ディスク、MD(Mini Disk)およびDVD(Digital Versatile Disk)などの光ディスクを記録媒体として用いてもよい。また、IC(Integrated Circuits)カード(メモリカードを含む)および光カードなどを記録媒体として用いてもよい。さらに、マスクROM、EPROM(Erasable Programmable Read Only Memory)、EEPROM(Electrically
Erasable Programmable Read Only Memory)およびフラッシュROMなどの半導体メモリを記録媒体として用いてもよい。
Here, the program medium described above is a recording medium configured to be separable from the main body, and may be a medium that carries the program fixedly by a magnetic tape and a cassette tape. Further, magnetic disks such as flexible disks and hard disks, and optical disks such as CD-ROM (Compact Disk Read Only Memory), MO (Magneto Optical) disks, MD (Mini Disk) and DVD (Digital Versatile Disk) are used as recording media. May be. Further, an IC (Integrated Circuits) card (including a memory card) and an optical card may be used as a recording medium. Furthermore, mask ROM, EPROM (Erasable Programmable Read Only Memory), EEPROM (Electrically
A semiconductor memory such as an Erasable Programmable Read Only Memory) or a flash ROM may be used as a recording medium.

また、本実施形態においては、インターネットを含む通信ネットワークを接続可能なシステム構成であることから、通信ネットワークから補間処理プログラムをダウンロードするように流動的にプログラムを担持する媒体であってもよい。なお、このように通信ネットワークから、補間処理プログラムをダウンロードする場合には、そのダウンロード用のプログラムを予め本体装置に格納しておくか、あるいは、別の記録媒体からインストールされるものであってもよい。   In the present embodiment, since the system configuration is capable of connecting a communication network including the Internet, the medium may be a medium that carries the program in a fluid manner so as to download the interpolation processing program from the communication network. When the interpolation processing program is downloaded from the communication network as described above, the download program may be stored in the main device in advance or may be installed from another recording medium. Good.

前述の記録媒体は、デジタルカラー画像形成装置およびコンピュータシステムに備えられるプログラム読取り装置により読取られることによって、補間処理方法を実行する。   The above-described recording medium is read by a digital color image forming apparatus and a program reading device provided in a computer system, thereby executing an interpolation processing method.

コンピュータシステムは、フラットベッドスキャナ、フィルムスキャナおよびデジタルカメラなどの画像入力装置、所定のプログラムがロードされることによって前述の画像処理方法など様々な処理が行われるコンピュータ、コンピュータの処理結果を表示するCRT(Cathode Ray Tube)ディスプレイおよび液晶ディスプレイなどの画像表示装置ならびにコンピュータの処理結果を紙などに出力するプリンタを含んで構成される。さらには、このコンピュータシステムには、ネットワークを介してサーバなどに接続するための通信手段としてのモデムなどが備えられる。   The computer system includes an image input device such as a flatbed scanner, a film scanner, and a digital camera, a computer that performs various processes such as the above-described image processing method by loading a predetermined program, and a CRT that displays the processing results of the computer. (Cathode Ray Tube) An image display device such as a display and a liquid crystal display, and a printer that outputs the processing result of the computer to paper or the like are included. Furthermore, this computer system is provided with a modem or the like as a communication means for connecting to a server or the like via a network.

本発明の実施の一形態である補間処理の処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of the interpolation process which is one Embodiment of this invention. 補間処理の対象となる補間画素Pとその周囲画素P1〜P4を示す図である。It is a figure which shows the interpolation pixel P used as the object of an interpolation process, and its surrounding pixels P1-P4. 補間処理の対象となる補間画素Pおよびその周囲画素P1〜P4の座標を示す図である。It is a figure which shows the coordinate of the interpolation pixel P used as the object of an interpolation process, and its surrounding pixels P1-P4. 補間画素Pの周囲画素P1〜P4およびその周囲の12画素と、それらの階調値を表す画素データとを示す図である。It is a figure which shows the surrounding pixels P1-P4 of the interpolation pixel P, 12 surrounding pixels, and the pixel data showing those gradation values. 周囲画素P1およびその周囲の近傍画素Q1〜Q8を示す図である。It is a figure which shows surrounding pixel P1 and the surrounding pixels Q1-Q8 of the circumference | surroundings. 補間画素Pの周囲画素P1〜P4とその周囲の近傍画素の画素データに対して量子化処理を行ったときの量子化データを示す図である。It is a figure which shows the quantization data when a quantization process is performed with respect to the pixel data of the surrounding pixels P1-P4 of the interpolation pixel P, and its surrounding vicinity pixel. 周囲画素P1〜P4におけるベクトルの方向およびベクトル量を示す図である。It is a figure which shows the direction and vector amount of the vector in surrounding pixels P1-P4. 補間演算に用いる周囲画素として選択された周囲画素を破線で囲んで示す図である。It is a figure which shows the surrounding pixel selected as a surrounding pixel used for interpolation calculation enclosed with a broken line. 補間処理を実行する補間処理部1の構成を示すブロック図である。It is a block diagram which shows the structure of the interpolation process part 1 which performs an interpolation process. カラー画像処理装置Aを含む画像形成装置Bの構成を示すブロック図である。2 is a block diagram illustrating a configuration of an image forming apparatus B including a color image processing apparatus A. FIG. NNによる補間処理が施された画像の一部を示す図である。It is a figure which shows a part of image by which the interpolation process by NN was performed. BLによる補間処理が施された画像の一部を示す図である。It is a figure which shows a part of image by which the interpolation process by BL was performed. BCによる補間処理が施された画像の一部を示す図である。It is a figure which shows a part of image by which the interpolation process by BC was performed.

符号の説明Explanation of symbols

1 補間処理部
2 空間フィルタ処理部
3 色補正部
4 A/D(アナログ/デジタル)変換部
5 シェーディング補正部
6 入力階調補正部
7 領域分離処理部
8 色空間変換部
9 黒生成下色除去部
10 出力階調補正部
11 階調再現処理部
12 カラー画像入力装置
13 カラー画像出力装置
14 外部入力インターフェース
15 外部出力インターフェース
100 補間処理手段
101 補間画素位置決定手段
102 周囲画素抽出手段
103 基準の周囲画素選択手段
104 近傍画素抽出手段
105 補正係数算出手段
106 量子化処理手段
107 差分絶対値算出手段
108 第1近傍画素選択手段
109 第2近傍画素選択手段
110 第1ベクトル量算出手段
111 周囲画素選択手段
112 第2ベクトル量算出手段
112 補間演算処理手段
A カラー画像処理装置
B 画像形成装置
DESCRIPTION OF SYMBOLS 1 Interpolation processing part 2 Spatial filter processing part 3 Color correction part 4 A / D (analog / digital) conversion part 5 Shading correction part 6 Input gradation correction part 7 Area separation processing part 8 Color space conversion part 9 Black generation under color removal Unit 10 output tone correction unit 11 tone reproduction processing unit 12 color image input device 13 color image output device 14 external input interface 15 external output interface 100 interpolation processing unit 101 interpolation pixel position determination unit 102 surrounding pixel extraction unit 103 reference surrounding Pixel selection means 104 Neighboring pixel extraction means 105 Correction coefficient calculation means 106 Quantization processing means 107 Difference absolute value calculation means 108 First neighborhood pixel selection means 109 Second neighborhood pixel selection means 110 First vector quantity calculation means 111 Ambient pixel selection means 112 Second vector quantity calculation means 112 Interpolation calculation processing Means A color image processing apparatus B image forming apparatus

Claims (10)

画像を構成する複数の画素の階調値を表す画素データを用いて、前記画素間に設定される補間画素の画素データを生成する補間処理方法において、
前記補間画素の位置を算出する補間画素位置算出工程と、
前記補間画素の周囲に位置する複数の周囲画素の位置および画素データを抽出する周囲画素抽出工程と、
算出された補間画素の位置および抽出された複数の周囲画素の位置に基づいて、補間画素に最近接する周囲画素を基準の周囲画素として選択する基準周囲画素選択工程と、
前記周囲画素の周囲に位置する複数の近傍画素の位置および画素データを抽出する近傍画素抽出工程と、
抽出された複数の周囲画素およびその近傍画素に関連する画素情報に基づいて、一方の周囲画素と他方の周囲画素との関係を表す補正係数を算出する補正係数算出工程と、
算出された補正係数に基づいて、補間画素の画素データを生成する補間演算処理を行う補間演算処理工程とを含むことを特徴とする補間処理方法。
In the interpolation processing method for generating pixel data of interpolation pixels set between the pixels using pixel data representing gradation values of a plurality of pixels constituting an image,
An interpolation pixel position calculating step of calculating the position of the interpolation pixel;
A surrounding pixel extraction step of extracting the position and pixel data of a plurality of surrounding pixels located around the interpolation pixel;
A reference surrounding pixel selection step of selecting a surrounding pixel closest to the interpolation pixel as a reference surrounding pixel based on the calculated position of the interpolation pixel and the extracted positions of the plurality of surrounding pixels;
A neighboring pixel extracting step of extracting the positions and pixel data of a plurality of neighboring pixels located around the surrounding pixels;
A correction coefficient calculating step for calculating a correction coefficient representing a relationship between one peripheral pixel and the other peripheral pixel based on pixel information related to the plurality of extracted peripheral pixels and neighboring pixels;
An interpolation processing method comprising: an interpolation calculation processing step for performing an interpolation calculation processing for generating pixel data of an interpolation pixel based on the calculated correction coefficient.
前記補正係数算出工程は、
抽出された複数の周囲画素およびその近傍画素の画素データに対して量子化処理を行い、量子化データを算出する量子化処理工程と、
算出された周囲画素の量子化データと、近傍画素の量子化データとの差分絶対値を算出する差分絶対値算出工程と、
算出された差分絶対値と予め定める閾値とを比較し、予め定める閾値以下となる差分絶対値の算出に関わる近傍画素を選択する第1近傍画素選択工程と、
第1近傍画素選択工程で選択された近傍画素のうち、基準の周囲画素に最近接する近傍画素を選択する第2近傍画素選択工程と、
抽出された複数の周囲画素およびその近傍画素に関連する画素情報に基づいて、基準の周囲画素を除く各周囲画素の補正係数を算出する第1の補正係数算出工程と、
第1の補正係数算出工程で算出される各周囲画素の補正係数と予め定める閾値とを比較し、予め定める閾値以上となる補正係数を有する周囲画素を選択する周囲画素選択工程と、
抽出された複数の周囲画素およびその近傍画素に関連する画素情報に基づいて、基準の周囲画素の補正係数を算出する第2の補正係数算出工程とを含むことを特徴とする請求項1記載の補間処理方法。
The correction coefficient calculation step includes
A quantization processing step of performing quantization processing on the pixel data of the plurality of extracted surrounding pixels and the neighboring pixels, and calculating quantization data;
A difference absolute value calculating step of calculating a difference absolute value between the calculated quantized data of the surrounding pixels and the quantized data of neighboring pixels;
A first neighboring pixel selection step of comparing the calculated difference absolute value with a predetermined threshold and selecting neighboring pixels involved in calculating the difference absolute value that is equal to or less than the predetermined threshold;
A second neighboring pixel selecting step of selecting a neighboring pixel closest to the reference surrounding pixel among neighboring pixels selected in the first neighboring pixel selecting step;
A first correction coefficient calculation step of calculating a correction coefficient for each of the surrounding pixels excluding the reference surrounding pixel based on the pixel information related to the plurality of extracted surrounding pixels and its neighboring pixels;
A surrounding pixel selection step of comparing a correction coefficient of each surrounding pixel calculated in the first correction coefficient calculating step with a predetermined threshold and selecting a surrounding pixel having a correction coefficient equal to or greater than the predetermined threshold;
2. The second correction coefficient calculation step of calculating a correction coefficient of a reference surrounding pixel based on pixel information related to a plurality of extracted surrounding pixels and its neighboring pixels. Interpolation method.
前記第1の補正係数算出工程では、基準の周囲画素を除く各周囲画素を始点とし、第2近傍画素選択工程で選択された近傍画素を終点とする第1ベクトルと、基準の周囲画素を除く各周囲画素を始点とし、基準の周囲画素を終点とする第2ベクトルとのなす角度に基づいて、基準の周囲画素を除く各周囲画素の補正係数を算出することを特徴とする請求項2記載の補間処理方法。   In the first correction coefficient calculating step, a first vector having each surrounding pixel excluding the reference surrounding pixel as a starting point and a neighboring pixel selected in the second neighboring pixel selecting step as an end point is excluded from the reference surrounding pixel. The correction coefficient of each surrounding pixel excluding the reference surrounding pixel is calculated based on an angle formed with a second vector having each surrounding pixel as a starting point and the reference surrounding pixel as an end point. Interpolation method. 前記第2の補正係数算出工程では、周囲画素選択工程で選択されない各周囲画素の位置と補間画素の位置との距離に関する重み係数を求め、その総和に1を加算した数値を基準の周囲画素の補正係数として算出することを特徴とする請求項2記載の補間処理方法。   In the second correction coefficient calculation step, a weighting factor relating to the distance between the position of each surrounding pixel not selected in the surrounding pixel selection step and the position of the interpolation pixel is obtained, and a numerical value obtained by adding 1 to the sum is used as the reference surrounding pixel. The interpolation processing method according to claim 2, wherein the interpolation processing method is calculated as a correction coefficient. 前記補間演算処理工程では、各周囲画素の補正係数と予め定める閾値とを比較し、予め定める閾値以上となる補正係数を有する周囲画素の画素データに基づいて、補間画素の画素データを生成する補間演算処理を行うことを特徴とする請求項1記載の補間処理方法。   In the interpolation calculation processing step, an interpolation that compares the correction coefficient of each surrounding pixel with a predetermined threshold and generates pixel data of the interpolation pixel based on the pixel data of the surrounding pixel having a correction coefficient that is equal to or greater than the predetermined threshold. 2. The interpolation processing method according to claim 1, wherein arithmetic processing is performed. コンピュータに請求項1〜5のいずれか1つに記載の補間処理方法を実行させるための補間処理プログラム。   An interpolation processing program for causing a computer to execute the interpolation processing method according to claim 1. 請求項6記載の補間処理プログラムを記録したコンピュータ読取り可能な記録媒体。   A computer-readable recording medium on which the interpolation processing program according to claim 6 is recorded. 画像を構成する複数の画素の階調値を表す画素データを用いて、前記画素間に設定される補間画素の画素データを生成する補間処理手段を備え、入力された画像の画素間に設定された補間画素の画素データを求めて画像を出力する画像処理装置において、
前記補間処理手段は、
前記補間画素の位置を算出する補間画素位置算出手段と、
前記補間画素の周囲に位置する複数の周囲画素の位置および画素データを抽出する周囲画素抽出手段と、
算出された補間画素の位置および抽出された複数の周囲画素の位置に基づいて、補間画素に最近接する周囲画素を基準の周囲画素として選択する基準の周囲画素選択手段と、
前記周囲画素の周囲に位置する複数の近傍画素の位置および画素データを抽出する近傍画素抽出手段と、
抽出された複数の周囲画素およびその近傍画素に関連する画素情報に基づいて、一方の周囲画素と他方の周囲画素との関係を表す補正係数を算出する補正係数算出手段と、
算出された補正係数に基づいて、補間画素の画素データを生成する補間演算処理を行う補間演算処理手段とを含むことを特徴とする画像処理装置。
Interpolation processing means for generating pixel data of interpolated pixels set between the pixels using pixel data representing gradation values of a plurality of pixels constituting the image is set between the pixels of the input image. In an image processing apparatus for obtaining pixel data of the interpolated pixels and outputting an image,
The interpolation processing means includes
Interpolation pixel position calculating means for calculating the position of the interpolation pixel;
Surrounding pixel extraction means for extracting the position and pixel data of a plurality of surrounding pixels located around the interpolation pixel;
A reference surrounding pixel selection means for selecting a surrounding pixel closest to the interpolation pixel as a reference surrounding pixel based on the calculated position of the interpolation pixel and the extracted positions of the plurality of surrounding pixels;
Neighboring pixel extracting means for extracting the position and pixel data of a plurality of neighboring pixels located around the surrounding pixel;
Correction coefficient calculating means for calculating a correction coefficient representing the relationship between one peripheral pixel and the other peripheral pixel based on the extracted pixel information related to the plurality of peripheral pixels and the neighboring pixels;
An image processing apparatus comprising: an interpolation calculation processing unit that performs an interpolation calculation process for generating pixel data of an interpolation pixel based on the calculated correction coefficient.
前記補正係数算出手段は、
抽出された複数の周囲画素およびその近傍画素の画素データに対して量子化処理を行い、量子化データを算出する量子化処理手段と、
算出された周囲画素の量子化データと、近傍画素の量子化データとの差分絶対値を算出する差分絶対値算出手段と、
算出された差分絶対値と予め定める閾値とを比較し、予め定める閾値以下となる差分絶対値の算出に関わる近傍画素を選択する第1近傍画素選択手段と、
第1近傍画素選択手段によって選択された近傍画素のうち、基準の周囲画素に最近接する近傍画素を選択する第2近傍画素選択手段と、
抽出された複数の周囲画素およびその近傍画素に関連する画素情報に基づいて、基準の周囲画素を除く各周囲画素の補正係数を算出する第1の補正係数算出手段と、
第1の補正係数算出手段によって算出された各周囲画素の補正係数と予め定める閾値とを比較し、予め定める閾値以上となる補正係数を有する周囲画素を選択する周囲画素選択手段と、
抽出された複数の周囲画素およびその近傍画素に関連する画素情報に基づいて、基準の周囲画素の補正係数を算出する第2の補正係数算出手段とを含むことを特徴とする請求項8記載の画像処理装置。
The correction coefficient calculation means includes
Quantization processing means for performing quantization processing on the extracted pixel data of a plurality of surrounding pixels and neighboring pixels and calculating quantization data;
A difference absolute value calculation means for calculating a difference absolute value between the calculated quantized data of the surrounding pixels and the quantized data of neighboring pixels;
A first neighboring pixel selecting unit that compares the calculated absolute difference value with a predetermined threshold value and selects neighboring pixels involved in calculating the absolute difference value that is equal to or smaller than the predetermined threshold value;
A second neighboring pixel selecting unit that selects a neighboring pixel closest to the reference surrounding pixel among neighboring pixels selected by the first neighboring pixel selecting unit;
First correction coefficient calculation means for calculating a correction coefficient for each of the surrounding pixels excluding the reference surrounding pixel, based on the extracted pixel information related to the plurality of surrounding pixels and its neighboring pixels;
A surrounding pixel selection unit that compares a correction coefficient of each surrounding pixel calculated by the first correction coefficient calculation unit with a predetermined threshold and selects a surrounding pixel having a correction coefficient that is equal to or greater than the predetermined threshold;
9. The second correction coefficient calculating means for calculating a correction coefficient for a reference surrounding pixel based on pixel information related to the plurality of extracted surrounding pixels and neighboring pixels. Image processing device.
請求項8または9記載の画像処理装置を備え、前記画像処理装置によって補間処理が施された補間画像の画素データを用いて、画像を形成して出力することを特徴とする画像形成装置。   An image forming apparatus comprising the image processing apparatus according to claim 8, wherein an image is formed and output using pixel data of an interpolated image subjected to interpolation processing by the image processing apparatus.
JP2003318763A 2003-09-10 2003-09-10 Method and program for interpolation processing, recording medium having recorded the same, image processor, and image forming apparatus provided with the same Pending JP2005086687A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003318763A JP2005086687A (en) 2003-09-10 2003-09-10 Method and program for interpolation processing, recording medium having recorded the same, image processor, and image forming apparatus provided with the same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003318763A JP2005086687A (en) 2003-09-10 2003-09-10 Method and program for interpolation processing, recording medium having recorded the same, image processor, and image forming apparatus provided with the same

Publications (1)

Publication Number Publication Date
JP2005086687A true JP2005086687A (en) 2005-03-31

Family

ID=34417955

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003318763A Pending JP2005086687A (en) 2003-09-10 2003-09-10 Method and program for interpolation processing, recording medium having recorded the same, image processor, and image forming apparatus provided with the same

Country Status (1)

Country Link
JP (1) JP2005086687A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008028763A (en) * 2006-07-21 2008-02-07 Sony Corp Image processor, image processing method, and program
CN112508790A (en) * 2020-12-16 2021-03-16 上海联影医疗科技股份有限公司 Image interpolation method, device, equipment and medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008028763A (en) * 2006-07-21 2008-02-07 Sony Corp Image processor, image processing method, and program
CN112508790A (en) * 2020-12-16 2021-03-16 上海联影医疗科技股份有限公司 Image interpolation method, device, equipment and medium
CN112508790B (en) * 2020-12-16 2023-11-14 上海联影医疗科技股份有限公司 Image interpolation method, device, equipment and medium

Similar Documents

Publication Publication Date Title
US8259357B2 (en) Image processing apparatus, image forming apparatus, image processing method, and computer readable recording medium
JP4173154B2 (en) Image processing method, image processing apparatus, image forming apparatus, computer program, and recording medium
JP4067532B2 (en) Color conversion apparatus, image forming apparatus, color conversion method, computer program, and recording medium
JP4568748B2 (en) Image processing method, image processing apparatus, image forming apparatus, computer program, and recording medium
JP4731595B2 (en) Image processing apparatus, image forming apparatus, computer program, recording medium, and image processing method
JP2004312387A (en) Image processing method, image processing device, image forming device, image pickup device, and computer program
JP3059205B2 (en) Image processing device
JP4596964B2 (en) Image processing apparatus, image forming apparatus, image processing method, computer program, and recording medium
JP2010278933A (en) Image processing device, image forming device, image processing method, program and recording medium
JP4053362B2 (en) Interpolation processing method, interpolation processing program, recording medium recording the same, image processing apparatus, and image forming apparatus provided with the same
JP2005086687A (en) Method and program for interpolation processing, recording medium having recorded the same, image processor, and image forming apparatus provided with the same
JP2004297617A (en) Image processing device, image forming device, image processing method, image processing program, and computer readable recording medium recorded with image processing program
JPH04365182A (en) Variable power picture processor
JP2008306400A (en) Image processing method, image processing device, image forming apparatus, computer program, and record medium
JP4230435B2 (en) Image processing method, image processing apparatus, and image forming apparatus including the same
JP2004272557A (en) Area separation processing method, area separation processing program and record medium recording it, and image processor and image forming device equipped therewith
JP2005191890A (en) Image processing device, image processing method, image processing program, recording medium stored with image processing program and image forming apparatus with image processor
JP4176053B2 (en) Image processing method, image processing apparatus, image forming apparatus, and computer program
JP4499685B2 (en) Image processing apparatus, image forming apparatus including the same, image processing method, image processing program, and recording medium
JP4101741B2 (en) Image processing apparatus, image forming apparatus, image processing method, image processing program, and recording medium
JP4176656B2 (en) Image processing apparatus, image processing method, image forming apparatus, image processing program, and recording medium recording the program
JP2010278924A (en) Image processing apparatus, image forming apparatus, image processing method, program, and recording medium
JP4118823B2 (en) Image processing apparatus, image forming apparatus, image processing method, image processing program, and recording medium
JP2008271131A (en) Method and device for image processing, and image forming apparatus
JP2007174243A (en) Image processor, image forming apparatus, image reader, image processing method, program, and recording medium