JP4470775B2 - Pixel interpolation device and pixel interpolation program - Google Patents
Pixel interpolation device and pixel interpolation program Download PDFInfo
- Publication number
- JP4470775B2 JP4470775B2 JP2005079561A JP2005079561A JP4470775B2 JP 4470775 B2 JP4470775 B2 JP 4470775B2 JP 2005079561 A JP2005079561 A JP 2005079561A JP 2005079561 A JP2005079561 A JP 2005079561A JP 4470775 B2 JP4470775 B2 JP 4470775B2
- Authority
- JP
- Japan
- Prior art keywords
- pixel
- value
- interpolation point
- original
- distance value
- 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.)
- Expired - Fee Related
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/40—Scaling of whole images or parts thereof, e.g. expanding or contracting
- G06T3/4007—Scaling 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)
Description
本発明は、画像の画素間に画素を補って画像の解像度を高める画素補間装置と、このような画素補間装置としてコンピュータを動作させる画素補間プログラムとに、関する。 The present invention relates to a pixel interpolation device that compensates pixels between pixels of an image to increase the resolution of the image, and a pixel interpolation program that causes a computer to operate as such a pixel interpolation device.
周知のように、画像の解像度を高めることによって画像を拡大する場合、原画像を構成する原画素の間に新たな画素を幾つか補う必要がある。新たな画素を原画素間に補う場合、新たな画素の画素値を、それに最も近い座標にある原画素の画素値をコピーしたものとする方法があるが、その方法によって解像度が高められた画像は、虫眼鏡で拡大して見たときのようなモザイク状となってしまう。そこで、拡大画像を滑らかな画像にするため、通常は、原画像を構成する原画素の間隙に新たな画素のものとして定義した各座標(これを補間点という)での画素値を、その補間点の周囲にある幾つかの原画素の画素値から数学的に推定するという方法が、採られている。 As is well known, when an image is enlarged by increasing the resolution of the image, it is necessary to supplement some new pixels between the original pixels constituting the original image. When a new pixel is compensated between the original pixels, there is a method in which the pixel value of the new pixel is a copy of the pixel value of the original pixel at the closest coordinates. Will look like a mosaic when viewed with a magnifying glass. Therefore, in order to make the enlarged image smooth, normally, the pixel value at each coordinate (this is called an interpolation point) defined as that of a new pixel in the gap between the original pixels constituting the original image is interpolated. A method of mathematically estimating from the pixel values of several original pixels around the point is adopted.
そして、補間点での画素値を数学的に推定する方法としては、双三次補間法(バイキュービック法)と双一次補間法(バイリニア法)とが、良く知られている。何れの補間法とも、基本的には、一つの補間点の周囲に配置されている幾つかの原画素の画素値のそれぞれに対し、それら原画素からその補間点までの距離に応じた重みを付け、重み付けがなされた各画素値の総和をその補間点の画素値とするものとなっている。 As a method for mathematically estimating the pixel value at the interpolation point, a bicubic interpolation method (bicubic method) and a bilinear interpolation method (bilinear method) are well known. In any of the interpolation methods, basically, a weight corresponding to the distance from the original pixel to the interpolation point is assigned to each of the pixel values of several original pixels arranged around one interpolation point. The sum of the weighted pixel values is used as the pixel value of the interpolation point.
具体的には、双三次補間法は、補間関数(sinπz)/πzのテイラー展開式における四次以降の項を無視してなる三次式の変数zに対して距離値を代入することによってその原画素の画素値に対する重みを算出するという演算を、縦方向と横方向とについて行い、縦方向の重みと横方向の重みとを互いに乗じて得た値を、その原画素の画素値に乗ぜられる最終的な重みとするというものである。そして、この双三次補間法においては、このような重み付けの対象が補間点の周囲にある16個の原画素となっており、それら16個の原画素のそれぞれについて縦成分の三次の演算と横成分の三次の演算とを行うようになっている。このため、この双三次補間法によると、演算に非常に時間が掛かるものの、補間精度が高く滑らかな画像が得られる。 Specifically, the bicubic interpolation method is obtained by substituting a distance value into a variable z of a cubic expression ignoring the fourth and subsequent terms in the Taylor expansion equation of the interpolation function (sinπz) / πz. An operation for calculating a weight for a pixel value of a pixel is performed in the vertical direction and the horizontal direction, and a value obtained by multiplying the vertical weight and the horizontal weight by each other is multiplied by the pixel value of the original pixel. The final weight. In this bicubic interpolation method, the weighting targets are 16 original pixels around the interpolation point, and for each of the 16 original pixels, the vertical calculation and horizontal calculation are performed. It is designed to perform the third order calculation of components. For this reason, according to this bicubic interpolation method, although calculation takes a very long time, a smooth image with high interpolation accuracy can be obtained.
一方、双一次補間法は、4個の原画素にて補間点が囲まれる矩形領域の縦方向と横方法の距離とをそれぞれ1に規格化し、原画素から補間点までの逆距離(その原画素の対角側にある原画素とその補間点との距離)を算出するという演算を、縦方向と横方向とについて行い、縦方向の重みと横方向の重みとを互いに乗じて得た値を、その原画素の画素値に乗ぜられる最終的な重みとするというものである。つまり、この双一次補間法は、補間点を囲む4個の原画素の画素値についてのその補間点でのいわゆる逆距離加重平均を算出する方法である。そして、前述したように、この双一次補間法においては、このような重み付けの対象が補間点の周囲にある4個の原画素となっており、それら4個の原画素のそれぞれについて縦成分の一次の演算と横成分の一次の演算と行うようになっている。このため、この双一次補間法によれば、補間精度はさほど高くないものの、演算を比較的早く終えることができる。 On the other hand, the bilinear interpolation method normalizes the vertical direction and the horizontal method distance of the rectangular area where the interpolation point is surrounded by four original pixels to 1 respectively, and the inverse distance from the original pixel to the interpolation point (the original distance). The value obtained by calculating the distance between the original pixel on the diagonal side of the pixel and its interpolation point in the vertical and horizontal directions and multiplying the vertical and horizontal weights together. Is the final weight multiplied by the pixel value of the original pixel. That is, this bilinear interpolation method is a method of calculating a so-called inverse distance weighted average at the interpolation point for the pixel values of four original pixels surrounding the interpolation point. As described above, in this bilinear interpolation method, the weighting target is four original pixels around the interpolation point, and the vertical component of each of the four original pixels is obtained. The primary calculation and the horizontal calculation are performed. For this reason, according to this bilinear interpolation method, although the interpolation accuracy is not so high, the calculation can be completed relatively quickly.
なお、新たな画素を原画素間に補充する場合において、原画像内での補間点の座標の採り方によって、拡大画像の境界(辺縁)に隣接する位置に原画素が配置されない場合がある。この場合、原画素と境界との間に幾つかの補間点が存在することとなるが、このような補間点について上記の双一次補間法を用いて画素値を演算しようにも、その補間点の周囲に4個の原画素が揃っていないため、画素値を算出できない。そこで、このように原画素と境界との間に隣接する補間点については、周囲にある原画素と同じ画素値を持つ原画素が、境界の外側にあるものと仮定して、4個の原画素の画素値についてのその補間点での逆距離加重平均が算出されることとなる。このような処理は、境界値処理と称されている。
ところで、プリンタのようなメモリの容量が十分でない情報処理装置において、画像の拡大を行う場合、原画像の画像データに対して一度に画素補間処理を行うことができないことがある。この場合、情報処理装置は、原画像の画像データを幾つかに分割し、分割された画像データのそれぞれに対して順に前述の画素補間処理を行うことがある。 Incidentally, when an image is enlarged in an information processing apparatus such as a printer that does not have sufficient memory capacity, pixel interpolation processing may not be performed on image data of an original image at a time. In this case, the information processing apparatus may divide the image data of the original image into several parts and sequentially perform the above-described pixel interpolation processing on each of the divided image data.
ところが、分割された画像データのそれぞれに対して別々に画素補間処理を行ってしまうと、処理後の各画像データによる画像を一つの拡大画像として結合したときに、その拡大画像に、画像の繋ぎ目が現れてしまう場合がある。 However, if pixel interpolation processing is performed separately for each of the divided image data, when the images based on the processed image data are combined as one enlarged image, the images are connected to the enlarged image. Eyes may appear.
例えば、図18(a)に示されるような横縞と縦縞とからなる画像を、E−E線に沿って二分割し、分割後の画像をそれぞれ双一次補間法を用いて別個に拡大し、拡大後の画像を結合すると、図18(b)に示されるように、結合後の拡大画像内の縦縞模様におけるE−E線上にある白縞と黒縞との境界が、他の境界における濃淡の変化と異なる濃淡の変化を持ってしまい、繋ぎ目が目立ってしまう。この繋ぎ目が現れる現象は、縦縞における白縞と黒縞との境界で画像の分割が行われ、なおかつ、その分割線に隣接する補間点において前述した境界値処理が行われると、生じてしまう。従って、この現象は、図18(a)に示されるような市松模様だけでなく、例えば、図21に示されるような市松模様においても生じ得る。 For example, an image composed of horizontal stripes and vertical stripes as shown in FIG. 18A is divided into two along the line EE, and the divided images are separately enlarged using bilinear interpolation, When the images after enlargement are combined, as shown in FIG. 18B, the boundary between the white stripes and the black stripes on the EE line in the vertical stripe pattern in the enlarged image after combination is light and shade at other boundaries. It will have a change of light and shade different from the change of the seam, and the joint will be conspicuous. The phenomenon in which the joint appears is generated when the image is divided at the boundary between the white stripe and the black stripe in the vertical stripe, and the boundary value processing described above is performed at the interpolation point adjacent to the division line. . Therefore, this phenomenon can occur not only in the checkered pattern as shown in FIG. 18A but also in the checkered pattern as shown in FIG.
本発明は、前述したような従来技術の有する問題点に鑑みてなされたものであり、その課題は、濃淡の変化が鋭い画像におけるその濃淡の境界部分において画像が分割されて、その分割された画像をそれぞれを双一次補間法を用いて拡大してから互いに結合するという場合であっても、最終的な拡大画像において、画像の繋ぎ目をできるだけ目立たせないようにすることにある。 The present invention has been made in view of the problems of the prior art as described above, and the problem is that the image is divided at the boundary portion of the light and shade in an image having a sharp change in light and shade, and the divided image is divided. Even when the images are enlarged using a bilinear interpolation and then combined with each other, it is to make the joints of the images as inconspicuous as possible in the final enlarged image.
上記の課題を解決するために発明された画素補間装置は、二次元的に配列された多数の画素により構成される原画像の画像データを処理対象として取得する画像データ取得部, 前記画像データ取得部が取得した画像データの原画像についての拡大倍率を取得する倍率取得部,前記倍率取得部が取得した拡大倍率により定まる出力画像の座標における補間点の座標値を、前記倍率取得部が取得した拡大倍率に基づいて算出した逆変換倍率を用いて前記原画像の座標における座標値に変換し、原画像の半画素分だけ左側及び上側にずらすことにより補間点を前記原画像の座標上に定義する補間点定義部,前記補間点定義部が定義した全ての補間点のそれぞれについて、その補間点の周囲にある4個の原画素にて規定される矩形領域の縦方向の距離と横方向の距離とに基づいて、それら4個の原画素からその補間点までの縦方向の逆距離の値と横方向の逆距離の値とを算出する処理を行う逆距離値生成部,前記補間点定義部が定義した全ての補間点のうち、前記原画像を構成する原画素が占める領域の外側にあって、なおかつ、周囲の4個の原画素の画素値に所定の濃度差がある補間点については、逆距離値と補正逆距離値とを対応付けて記憶する記憶装置から、その補間点のために前記逆距離値生成部が算出した逆距離値に対応する補正逆距離値を読み出して、その逆距離値を補正逆距離値に置換する逆距離値補正部,前記補間点定義部が定義した全ての補間点のそれぞれについて、その補間点のために前記逆距離値生成部が算出した逆距離値,又は、前記逆距離値補正部によって置換された後の補正逆距離値と、その補間点の周囲の4個の原画素の画素値とに基づいて、その補間点の逆距離加重平均を算出する処理を行う画素値生成部,及び、前記画素値生成部が前記各補間点について生成した画素値からなる画像データを、拡大画像の画像データとして出力する画像データ出力部を備えることを、特徴としている。
A pixel interpolation device invented to solve the above-described problem is an image data acquisition unit that acquires, as a processing target, image data of an original image composed of a large number of pixels arranged two-dimensionally, the image data acquisition A magnification acquisition unit that acquires an enlargement magnification for an original image of image data acquired by the unit, and the magnification acquisition unit acquires a coordinate value of an interpolation point in the coordinates of an output image determined by the enlargement magnification acquired by the magnification acquisition unit Using the inverse transformation magnification calculated based on the enlargement magnification, it is converted to the coordinate value in the coordinates of the original image, and the interpolation point is defined on the coordinates of the original image by shifting it to the left and the upper side by the half pixel of the original image Interpolation point definition unit to be used, and for each of all the interpolation points defined by the interpolation point definition unit, the vertical distance of the rectangular area defined by the four original pixels around the interpolation point And a reverse distance value generation unit for performing a process of calculating a vertical reverse distance value and a horizontal reverse distance value from the four original pixels to the interpolation point based on the horizontal distance and the horizontal distance, Out of all the interpolation points defined by the interpolation point definition unit, the pixel values of the surrounding four original pixels are outside the area occupied by the original pixels constituting the original image, and there is a predetermined density difference. For a certain interpolation point, a corrected reverse distance value corresponding to the reverse distance value calculated by the reverse distance value generation unit for the interpolation point from a storage device that stores the reverse distance value and the corrected reverse distance value in association with each other. The reverse distance value correction unit that replaces the reverse distance value with the corrected reverse distance value, and for each of all the interpolation points defined by the interpolation point definition unit, the reverse distance value generation unit for the interpolation point The reverse distance value calculated by or replaced by the reverse distance value correction unit A pixel value generation unit that performs processing for calculating a reverse distance weighted average of the interpolation point based on the corrected reverse distance value after the correction and the pixel values of the four original pixels around the interpolation point; An image data output unit that outputs image data including pixel values generated by the pixel value generation unit for each interpolation point as image data of an enlarged image is provided.
このように、一つの補間点について画素値を生成する際に、その補間点が、原画像を構成する原画素が占める領域の外側にあって、なおかつ、その周囲にある4個の原画素の画素値に所定の濃度差がある場合には、一般的な双一次補間法によって求まる逆距離値の代わりに、補正された逆距離値を使うようにすれば、拡大後の画像における濃淡が変化する境界と画像の分割線とが重なった部分における濃淡の変化が緩和され、最終的な拡大画像における画像の繋ぎ目がさほど目立たなくなる。 In this way, when generating a pixel value for one interpolation point, the interpolation point is outside the area occupied by the original pixel constituting the original image, and the four original pixels around it are also located. If the pixel value has a certain density difference, the density of the enlarged image will change if the corrected inverse distance value is used instead of the inverse distance value obtained by a general bilinear interpolation method. The change in shading in the portion where the boundary between the image and the dividing line of the image overlaps is alleviated, and the joint of the image in the final enlarged image becomes less noticeable.
また、上記の課題を解決するために発明された画素補間プログラムは、コンピュータを、 二次元的に配列された多数の画素により構成される原画像の画像データを処理対象として取得する画像データ取得手段,前記画像データ取得手段によって取得された画像データの原画像についての拡大倍率を取得する倍率取得手段,前記倍率取得手段によって取得された拡大倍率により定まる出力画像の座標における補間点の座標値を、前記倍率取得手段が取得した拡大倍率に基づいて算出した逆変換倍率を用いて前記原画像の座標における座標値に変換し、原画像の半画素分だけ左側及び上側にずらすことにより補間点を前記原画像の座標上に定義する補間点定義手段,前記補間点定義手段によって定義された全ての補間点のそれぞれについて、その補間点の周囲にある4個の原画素にて規定される矩形領域の縦方向の距離と横方向の距離とに基づいて、それら4個の原画素からその補間点までの縦方向の逆距離の値と横方向の逆距離の値とを算出する処理を行う逆距離値生成手段,
前記補間点定義手段によって定義された全ての補間点のうち、前記原画像を構成する原画素が占める領域の外側にあって、なおかつ、周囲の4個の原画素の画素値に所定の濃度差がある補間点については、逆距離値と補正逆距離値とを対応付けて記憶する記憶装置から、その補間点のために前記逆距離値生成手段によって算出された逆距離値に対応する補正逆距離値を読み出して、その逆距離値を補正逆距離値に置換する逆距離値補正手段,
前記補間点定義手段によって定義された全ての補間点のそれぞれについて、その補間点のために前記逆距離値生成手段によって算出された逆距離値,又は、前記逆距離値補正手段によって置換された後の補正逆距離値と、その補間点の周囲の4個の原画素の画素値とに基づいて、その補間点の逆距離加重平均を算出する処理を行う画素値生成手段,及び、 前記画素値生成手段によって前記各補間点について生成された画素値からなる画像データを、拡大画像の画像データとして出力する画像データ出力手段として機能させることを、特徴としている。
In addition, a pixel interpolation program invented to solve the above-described problem is an image data acquisition unit that acquires, as a processing target, image data of an original image composed of a large number of pixels arranged two-dimensionally. , A magnification acquisition means for acquiring an enlargement magnification for the original image of the image data acquired by the image data acquisition means, a coordinate value of an interpolation point in the coordinates of the output image determined by the enlargement magnification acquired by the magnification acquisition means , Using the inverse conversion magnification calculated based on the enlargement magnification acquired by the magnification acquisition means, the coordinate value in the coordinates of the original image is converted, and the interpolation point is shifted to the left and the upper side by half a pixel of the original image For each of the interpolation points defined by the interpolation point definition means defined on the coordinates of the original image and the interpolation point definition means, Based on the vertical distance and the horizontal distance of the rectangular area defined by the four original pixels around the interpolation point, the vertical reverse distance from the four original pixels to the interpolation point A reverse distance value generating means for performing a process of calculating a value of and a reverse distance value in the horizontal direction;
Of all the interpolation points defined by the interpolation point defining means, outside the area occupied by the original pixels constituting the original image, and a predetermined density difference between the pixel values of the four surrounding original pixels For a certain interpolation point, a corrected inverse corresponding to the inverse distance value calculated by the inverse distance value generating means for the interpolation point from the storage device storing the inverse distance value and the corrected inverse distance value in association with each other. A reverse distance value correcting means for reading out the distance value and replacing the reverse distance value with a corrected reverse distance value;
After all of the interpolation points defined by the interpolation point defining means are replaced by the inverse distance value calculated by the inverse distance value generating means for the interpolation point or by the inverse distance value correcting means. A pixel value generating means for performing a process of calculating a reverse distance weighted average of the interpolation point based on the corrected reverse distance value of the interpolation point and the pixel values of the four original pixels around the interpolation point; and the pixel value It is characterized by functioning as image data output means for outputting image data consisting of pixel values generated for each interpolation point by the generating means as image data of an enlarged image.
従って、この画素補間プログラムは、前述した本発明による画素補間装置と同等に機能する装置としてコンピュータを動作させることができることになる。 Therefore, the pixel interpolation program can operate the computer as a device that functions in the same manner as the pixel interpolation device according to the present invention described above.
このようなことから、本発明によれば、濃淡の変化が鋭い絵柄を含む画像におけるその濃淡の境界部分において画像が分割されて、その分割された画像をそれぞれを双一次補間法を用いて拡大してから互いに結合するという場合であっても、最終的な拡大画像において、画像の繋ぎ目がさほど目立たなくなるようになる。 For this reason, according to the present invention, an image is divided at the boundary portion of the light and shade in an image including a pattern with sharp changes in light and shade, and each of the divided images is enlarged using a bilinear interpolation method. Even if the images are combined with each other, the joints of the images become less noticeable in the final enlarged image.
以下、添付図面に基づいて、本発明を実施するための一つの形態である印刷装置について説明する。 Hereinafter, a printing apparatus according to one embodiment for carrying out the present invention will be described with reference to the accompanying drawings.
図1は、本実施形態の印刷装置10の構成図である。印刷装置10は、図示せぬホストコンピュータから印刷要求を受信したり図示せぬ外部機器から画像データを受信したりして印刷を行う装置である。 FIG. 1 is a configuration diagram of a printing apparatus 10 according to the present embodiment. The printing device 10 is a device that performs printing by receiving a print request from a host computer (not shown) or image data from an external device (not shown).
なお、図示せぬ外部機器としては、カメラ装置,及び、スキャナがある。このうち、カメラ装置は、静止画の画像データを取得することができるUSBポート付き装置であり、具体的には、デジタルスチルカメラ,デジタルビデオカメラ,カメラ付き携帯電話機などである。また、スキャナは、原稿台上に載置された原稿から画像を読み取って画像データに変換する装置である。印刷装置10は、図示せぬスキャナに接続されたときには、複写機又は複合機における印刷を行うユニットとして機能する。 Note that external devices (not shown) include a camera device and a scanner. Among these, the camera device is a device with a USB port that can acquire image data of a still image, and specifically, a digital still camera, a digital video camera, a mobile phone with a camera, and the like. The scanner is a device that reads an image from a document placed on a document table and converts it into image data. When connected to a scanner (not shown), the printing apparatus 10 functions as a unit that performs printing in a copying machine or a multifunction machine.
この印刷装置10は、主要な構成として、外部I/F装置11,操作表示盤12,給紙機構13,印刷機構14,DRAM15,ROM16,CPU17,EEPROM18,及び、ASIC19を、内蔵している。 The printing apparatus 10 includes an external I / F device 11, an operation display board 12, a paper feeding mechanism 13, a printing mechanism 14, a DRAM 15, a ROM 16, a CPU 17, an EEPROM 18, and an ASIC 19 as main components.
外部I/F装置11は、図示せぬホストコンピュータからの印刷要求の受信,又は、図示せぬ外部機器からの画像データの受信を行うためのいわゆる通信インターフェースポートである。具体的には、外部I/F装置11は、IEEE1284規格に従った通信を行うためのパラレルポート,セントロニクス仕様のパラレルポート,イーサネット(米ゼロックス社,米インテル社,米コンパックコンピュータ社商標)仕様のLANボード,IEEE1394規格に従った通信を行うためのシリアルポート,USB規格に従った通信を行うためのUSBポートなどである。 The external I / F device 11 is a so-called communication interface port for receiving a print request from a host computer (not shown) or receiving image data from an external device (not shown). Specifically, the external I / F device 11 includes a parallel port for performing communication in accordance with the IEEE 1284 standard, a parallel port of Centronics specification, and Ethernet (trademark of Xerox Corporation, Intel Corporation, USA, Compaq Computer Corporation) specifications. A LAN board, a serial port for performing communication according to the IEEE 1394 standard, a USB port for performing communication according to the USB standard, and the like.
操作表示盤12は、利用者からの各種の指示を受け付けたり各種の画面を表示したりするための機器であり、押しボタンやタッチスクリーンを備えている。 The operation display panel 12 is a device for receiving various instructions from the user and displaying various screens, and includes a push button and a touch screen.
給紙機構13は、印刷機構14に一種類以上の用紙を供給する機構であり、用紙カセットが着脱自在に装着されるスロットを幾つか備えている。印刷機構14は、給紙機構13から供給された用紙に対して実際に印刷を行なう機構である。 The paper feed mechanism 13 is a mechanism that supplies one or more types of paper to the printing mechanism 14 and includes several slots in which paper cassettes are detachably mounted. The printing mechanism 14 is a mechanism that actually performs printing on the paper supplied from the paper feeding mechanism 13.
DRAM[Dynamic Random Access Memory]15は、図示せぬホストコンピュータからの印刷要求,又は、図示せぬ外部機器からの画像データの一時的な保管領域として、及び、その画像データについて各種の処理が行われる際の作業領域として使用される揮発性メモリである。 A DRAM (Dynamic Random Access Memory) 15 serves as a temporary storage area for print requests from a host computer (not shown) or image data from an external device (not shown), and various processes are performed on the image data. It is a volatile memory that is used as a work area when being read.
ROM[Read Only Memory]16は、印刷装置10を制御するためのプログラムや、印刷要求中の印刷データに基づいて画像データを生成する際に使用されるフォントデータを記憶した不揮発性メモリである。 A ROM [Read Only Memory] 16 is a non-volatile memory that stores a program for controlling the printing apparatus 10 and font data used when generating image data based on print data requested to be printed.
CPU[Central Processing Unit]17は、ROM16内のプログラムに従って各部を統合的に制御する制御回路である。具体的には、このCPU17は、この印刷装置10の上面に設けられている操作表示盤12のボタンやタッチスクリーンに対する操作を通じて利用者から実行すべき処理についての指示を取得する処理,図示せぬホストコンピュータからの印刷要求又は図示せぬ外部機器からの画像データに基づいて印刷機構14へ引き渡すべき画像データを生成する処理,その画像データに基づく画像の印刷が行われるよう印刷機構14を制御する印刷制御処理を、行うものとなっている。 The CPU [Central Processing Unit] 17 is a control circuit that controls each part in an integrated manner in accordance with a program in the ROM 16. Specifically, the CPU 17 obtains an instruction about a process to be executed from the user through an operation on a button or a touch screen of the operation display panel 12 provided on the upper surface of the printing apparatus 10, not shown. A process for generating image data to be delivered to the printing mechanism 14 based on a print request from a host computer or image data from an external device (not shown), and the printing mechanism 14 is controlled so that an image is printed based on the image data. The print control process is performed.
EEPROM[Electrically Erasable and Programmable Read Only Memory]18は、印刷に係る各種の設定を電源切断後にも保持しておくためのいわゆるフラッシュメモリである。 An EEPROM [Electrically Erasable and Programmable Read Only Memory] 18 is a so-called flash memory for holding various settings relating to printing even after the power is turned off.
ASIC[Application Specific Integrated Circuit]19は、各ハードウエア11〜18間のデータや指示の遣り取りを制御する半導体集積回路であり、各ハードウエア11〜18に接続されている。このASIC19は、各ハードウエア11〜18との間のインターフェースとして、ビデオコントローラ191,IOコントローラ192,及び、メモリコントローラ193を、備えている。 An ASIC [Application Specific Integrated Circuit] 19 is a semiconductor integrated circuit that controls exchange of data and instructions between the hardware 11 to 18, and is connected to the hardware 11 to 18. The ASIC 19 includes a video controller 191, an IO controller 192, and a memory controller 193 as interfaces between the hardware units 11 to 18.
ビデオコントローラ191は、印刷機構14へ供給すべき画像データをその印刷機構14内の図示せぬ走査ユニットが処理可能な形態の電気信号に変換するための回路モジュールである。 The video controller 191 is a circuit module for converting image data to be supplied to the printing mechanism 14 into an electrical signal in a form that can be processed by a scanning unit (not shown) in the printing mechanism 14.
IOコントローラ192は、外部I/F装置11,操作表示盤12,及び、給紙機構13を制御するための回路モジュールである。なお、このIOコントローラ192は、図示せぬホストコンピュータから送信されてきた印刷要求や、図示せぬ外部機器から送信されてきた画像データを、外部I/F装置11からDRAM15へ直接転送する処理を行う回路モジュールにもなっている。 The IO controller 192 is a circuit module for controlling the external I / F device 11, the operation display panel 12, and the paper feed mechanism 13. The IO controller 192 performs a process of directly transferring a print request transmitted from a host computer (not shown) and image data transmitted from an external device (not shown) from the external I / F device 11 to the DRAM 15. It is also a circuit module to perform.
メモリコントローラ193は、DRAM15に対するプログラムやデータの読み書きを制御する機能,ROM16からのプログラムやデータの読み出しを制御する機能,及び、印刷機構14内の図示せぬコントローラを制御する機能を有する回路モジュールである。 The memory controller 193 is a circuit module having a function of controlling reading and writing of programs and data with respect to the DRAM 15, a function of controlling reading of programs and data from the ROM 16, and a function of controlling a controller (not shown) in the printing mechanism 14. is there.
以上のようなハードウエアにて構成されている本実施形態の印刷装置10では、DRAM15の記憶容量が十分でないため、その記憶容量で対処できるように、処理内容が適宜構築されている。具体的には、ページ記述言語にて作成された印刷データを含む印刷要求が図示せぬホストコンピュータから送られてきたときには、1頁分の画像データを生成してからビデオコントローラ191へ出力するのではなく、その画像データの一部を生成してからビデオコントローラ191へ出力するという処理を、その画像データの各部について順に行うようになっている。 Since the storage capacity of the DRAM 15 is not sufficient in the printing apparatus 10 according to the present embodiment configured with the hardware as described above, the processing contents are appropriately constructed so that the storage capacity can be dealt with. Specifically, when a print request including print data created in a page description language is sent from a host computer (not shown), image data for one page is generated and then output to the video controller 191. Instead, a process of generating a part of the image data and then outputting the generated image data to the video controller 191 is sequentially performed for each part of the image data.
同様に、画像データを含む印刷要求が図示せぬホストコンピュータが送られてきたときには、その画像データの一部の受信してビデオコントローラ191へ出力するという処理を、その画像データの各部について順に行うようになっている。また、図示せぬ外部機器から画像データが送られてきた場合においても、同様である。 Similarly, when a print request including image data is sent from a host computer (not shown), a part of the image data is received and output to the video controller 191 for each part of the image data. It is like that. The same applies when image data is sent from an external device (not shown).
なお、このように、印刷要求から画像データを生成する処理,及び、図示せぬホストコンピュータや図示せぬ外部機器から送られてきた画像データをDRAM15に取り込む処理は、前述した画像データ取得手段に相当している。また、これら処理を実行するCPU17,外部I/F装置11,IOコントローラ121は、前述した画像データ取得部に相当している。 Note that the processing for generating image data from a print request and the processing for fetching image data sent from a host computer (not shown) or an external device (not shown) into the DRAM 15 are performed by the above-described image data acquisition means. It corresponds. The CPU 17, the external I / F device 11, and the IO controller 121 that execute these processes correspond to the above-described image data acquisition unit.
ところで、図示せぬホストコンピュータからの印刷要求中の画像データに基づく画像や、図示せぬ外部機器からの画像データに基づく画像において、その解像度が低すぎて、ビデオコントローラ191へ出力するのに適さない場合がある。この場合、CPU17は、ROM16から所定のプログラムを読み込んで、この画像データに基づく画像の解像度を高める処理を行うようになっている。図2は、この処理の流れを示す図である。 By the way, an image based on image data for which a print request from a host computer (not shown) or an image based on image data from an external device (not shown) is too low in resolution and suitable for output to the video controller 191. There may not be. In this case, the CPU 17 reads a predetermined program from the ROM 16 and performs a process for increasing the resolution of the image based on the image data. FIG. 2 is a diagram showing the flow of this process.
処理開始後、CPU17は、解像度を高める対象となる画像(以下、原画像と表記する)の大きさ(ここでは、横の画素数をIh、縦の画素数をIvと定義する)を示す情報を、その原画像の画像データのヘッダから取得する(S101)。 After the start of processing, the CPU 17 indicates information indicating the size of the image whose resolution is to be increased (hereinafter referred to as an original image) (here, the number of horizontal pixels is defined as Ih and the number of vertical pixels is defined as Iv). Is acquired from the header of the image data of the original image (S101).
続いて、CPU17は、ビデオコントローラ191へ出力するのに最適なものとして設定されている画像の大きさ(ここでは、横の画素数をOh、縦の画素数をOvと定義する)を示す情報を、EEPROM18などから取得する(S102)。 Subsequently, the CPU 17 indicates information indicating an image size (here, the horizontal pixel number is defined as Oh and the vertical pixel number is defined as Ov) set to be optimal for output to the video controller 191. Is obtained from the EEPROM 18 or the like (S102).
その後、CPU17は、取得した大きさの情報に基づいて、縦方向と横方向の拡大倍率を算出するとともに、算出した拡大倍率に基づいて、逆変換倍率を算出する(S103)。 After that, the CPU 17 calculates the vertical and horizontal magnifications based on the acquired size information, and calculates the inverse conversion magnification based on the calculated magnifications (S103).
ここで、逆変換倍率について説明する。なお、ここでの説明においては、原画像の各画素の座標を(x,y)と表現し、拡大後の出力画像の各画素の座標を(X,Y)と表現する。また、出力画像のX,Y座標値は、何れも、最小単位を1とする整数をとるものとする(隣接する画素同士の間の距離が1であるという意味である)。 Here, the inverse conversion magnification will be described. In the description here, the coordinates of each pixel of the original image are expressed as (x, y), and the coordinates of each pixel of the enlarged output image are expressed as (X, Y). In addition, the X and Y coordinate values of the output image both take an integer having a minimum unit of 1 (meaning that the distance between adjacent pixels is 1).
原画像の拡大を行う場合、通常、出力画像の各画素のX座標値とY座標値にそれぞれ拡大倍率(Oh/Ih,Ov/Iv)の逆数を乗じることによって原画像における対応するx座標値とy座標値とが算出され、それらx座標値とy座標値がともに整数であった場合には、原画像におけるその座標(x,y)の画素値が出力画像の座標(X,Y)の画素値として決定され、それらx座標値とy座標値の何れか又は両方が小数であった場合には、その座標(x,y)を補間点として、その座標(x,y)の画素値が後述のように推定され、その推定された画素値が出力画像の座標(X,Y)の画素値として決定されるようになっている。 When enlarging the original image, the corresponding x coordinate value in the original image is usually obtained by multiplying the X coordinate value and Y coordinate value of each pixel of the output image by the reciprocal of the enlargement magnification (Oh / Ih, Ov / Iv), respectively. And the y coordinate value are calculated, and when both the x coordinate value and the y coordinate value are integers, the pixel value of the coordinate (x, y) in the original image is the coordinate (X, Y) of the output image. If either or both of these x-coordinate values and y-coordinate values are decimal numbers, the coordinates (x, y) are used as interpolation points, and the pixel at the coordinates (x, y). The value is estimated as described later, and the estimated pixel value is determined as the pixel value of the coordinates (X, Y) of the output image.
但し、出力画像のX,Y座標値の最小単位が1であると、x,y座標値が、小数点より上の値が小さい小数となってしまう場合がある。すると、これらx,y座標値に基づいて双一次補間法による重みを算出する際に、処理に負荷が掛かることとなる。このため、本実施形態では、前述した拡大倍率の逆数に256という数値を乗じてなる数を、逆変換倍率として規定している。 However, if the minimum unit of the X and Y coordinate values of the output image is 1, the x and y coordinate values may be decimals with a value smaller than the decimal point. Then, when calculating the weight by the bilinear interpolation method based on these x and y coordinate values, the processing is burdened. For this reason, in this embodiment, a number obtained by multiplying the reciprocal of the magnification described above by a numerical value of 256 is defined as the inverse conversion magnification.
この256という数値は、実質的には、原画像において隣接する画素同士の間の長さを1ではなく256として表現するものとして機能する。このように原画像における一区間の長さが256と表現されると、拡大倍率が16以下である場合において、出力画像の座標(X,Y)に対応する原画像の座標(x,y)の座標値における小数点より上の値を大きくすることができ、小数点以下の値を切り捨てて演算することができるようになる。但し、原画像におけるx,y座標値が、256という値を累積したものとして表現してしまうと、x,y座標値が極端に大きくなってしまう。このため、以下の処理では、x,y座標値が256に達するたびに、それら値を0にリセットして、256という値を、隣接画素同士の一区間の長さのみを表すものとして限定的に使用している(二区間以上の長さを表すのに用いない)。 This numerical value of 256 substantially functions as expressing the length between adjacent pixels in the original image as 256 instead of 1. In this way, when the length of one section in the original image is expressed as 256, when the enlargement magnification is 16 or less, the coordinates (x, y) of the original image corresponding to the coordinates (X, Y) of the output image The value above the decimal point in the coordinate value of can be increased, and the value after the decimal point can be rounded down for calculation. However, if the x and y coordinate values in the original image are expressed as a cumulative value of 256, the x and y coordinate values become extremely large. Therefore, in the following processing, whenever the x and y coordinate values reach 256, the values are reset to 0, and the value 256 is limited to represent only the length of one section between adjacent pixels. (Not used to represent a length of two or more intervals).
なお、ステップS101〜S103は、前述した倍率取得手段に相当し、これらステップS101〜S103を実行するCPU17は、前述した倍率取得部に相当している。 Steps S101 to S103 correspond to the above-described magnification acquisition unit, and the CPU 17 that executes these steps S101 to S103 corresponds to the above-described magnification acquisition unit.
以上に説明した逆変換倍率((Ih/Oh)×256,(Iv/Ov)×256)を算出した後(S103)、CPU17は、原画像の画像データが所定の大きさ毎に分割されたうちの一つ(以下、分割原画像データと表記する)を記憶しておくための記憶領域をDRAM15内に確保し(S104),その分割原画像データをその記憶領域に取り込む(S105)。 After calculating the inverse transformation magnification ((Ih / Oh) × 256, (Iv / Ov) × 256) described above (S103), the CPU 17 divides the image data of the original image into predetermined sizes. A storage area for storing one of them (hereinafter referred to as divided original image data) is secured in the DRAM 15 (S104), and the divided original image data is taken into the storage area (S105).
続いて、CPU17は、DRAM15内の上記記憶領域に取り込まれた分割原画像データに基づいて後述のように作成される画像データ(以下、分割出力画像データと表記する)を記憶するための記憶領域を確保する(S106)。 Subsequently, the CPU 17 stores a storage area for storing image data (hereinafter referred to as divided output image data) created as described later based on the divided original image data taken into the storage area in the DRAM 15. Is secured (S106).
その後、CPU17は、DRAM15に取り込んだ分割原画像データについて、後述の画素補間処理を実行する(S107)。 Thereafter, the CPU 17 performs pixel interpolation processing described later on the divided original image data captured in the DRAM 15 (S107).
そして、この画素補間処理の実行が終了すると、CPU17は、完成した分割出力画像データをビデオコントローラ191へ出力する処理を実行し(S108)、次の分割原画像データの有無を判別する(S109)。CPU17は、次の分割原画像データがあれば(S109;NO)、再度、その分割原画像データの記憶領域の確保(S104)、その分割原画像データの取り込み(S105),及び、分割出力画像データの記憶領域の確保(S106)を行って、その分割原画像データについての後述の画素補間処理を実行する(S107)。そして、このような処理を繰り返すことによって、処理すべき分割原画像データがなくなると(S109;YES)、CPU17は、図2に係る処理を終了する。 When the execution of the pixel interpolation process is completed, the CPU 17 executes a process of outputting the completed divided output image data to the video controller 191 (S108), and determines whether there is the next divided original image data (S109). . If there is next divided original image data (S109; NO), the CPU 17 again secures the storage area of the divided original image data (S104), fetches the divided original image data (S105), and the divided output image. A data storage area is secured (S106), and pixel interpolation processing described later is executed for the divided original image data (S107). Then, by repeating such processing, when there is no divided original image data to be processed (S109; YES), the CPU 17 ends the processing according to FIG.
なお、ステップS108は、前述した画像データ出力手段に相当しており、このステップS108を実行するCPU17は、前述した画像データ出力部に相当している。 Step S108 corresponds to the above-described image data output means, and the CPU 17 that executes this step S108 corresponds to the above-described image data output unit.
次に、画素補間処理について説明する。図3乃至図8は、画素補間処理の流れを示す図である。 Next, pixel interpolation processing will be described. 3 to 8 are diagrams showing the flow of pixel interpolation processing.
まず、CPU17は、図3に示されるように、変数Xにゼロを代入するとともに、変数Yにゼロを代入する(S201)。 First, as shown in FIG. 3, the CPU 17 assigns zero to the variable X and assigns zero to the variable Y (S201).
続いて、CPU17は、分割出力画像における座標値Yに対応する分割原画像でのy座標値を算出する(S202)。具体的には、CPU17は、座標値Xに横方向の逆変換倍率((Ih/Oh)×256)を乗じ、その結果からさらに128を引いて得られる値を、y座標値とする。 Subsequently, the CPU 17 calculates the y coordinate value in the divided original image corresponding to the coordinate value Y in the divided output image (S202). Specifically, the CPU 17 multiplies the coordinate value X by the horizontal reverse conversion magnification ((Ih / Oh) × 256), and further subtracts 128 from the result to obtain the y coordinate value.
なお、この128という値は、256に0.5を乗じて得た値であり、すなわち、互いに隣接する原画素同士の一区間の半分(半画素)を示している。つまり、逆変換後の座標値から128を引くことによって、出力画像の座標(X,Y)について参照する原画素の座標を、半画素分だけ負側(左側)にずらしていることになる。 The value of 128 is a value obtained by multiplying 256 by 0.5, that is, a half (half pixel) of one section between adjacent original pixels. That is, by subtracting 128 from the coordinate value after the inverse transformation, the coordinates of the original pixel referred to the coordinates (X, Y) of the output image are shifted to the negative side (left side) by half a pixel.
ここで、半画素分だけ負側にずらす理由について説明する。なお、ここでは、理解し易くするため、原画像の座標値に256を乗じない状態で説明する。例えば、図9(a)に示されるように原画像が3×3個の画素からなるとして、この原画像を縦三倍横三倍に拡大するときに、図9(b)に示されるように、出力画像の座標(0,0)に対応する原画像での座標が(0,0)にあると規定したとする(図9(b)の座標(0,0)に黒丸が配置されているのが、この規定を意味する)。この場合において、原画像の座標(0,1)の画素Aと座標(2,1)の画素Bとに注目する。図9(b)において白丸にて示される補間点は、双一次補間法においては、原画像上における原画素(黒丸)との距離に反比例した重みをその原画素の画素値に乗じて得た値を、自己の画素値の一部として取得する。従って、逆に言えば、例えば画素Bは、自己の右上,右下,左上,左下の領域にある補間点(図9(b)において一点鎖線で囲まれた補間点)に、自己の画素値を分配することとなる。一方、画素Aは、自己の右上,右下の領域にある補間点(図9(b)において破線で囲まれた補間点)にしか、自己の画素値を分配しない。すなわち、画素Aは、自己の画素値の半分しか、補間点の画素値の積み上げに利用しないこととなる。このため、本実施形態では、図9(c)に示されるように、出力画像の座標(X,Y)に対応する原画素の座標を半画素分だけ負側(左側及び上側)ずらすことによって、画素Aに対しても、画素値を分配すべき補間点のある左上,左下領域を、与えるようにしている。この結果、出力画像の座標(0,0)に対応する原画像での座標は、(−0.5,−0.5)となり、また、出力画像上の補間点は、原画像におけるx,y座標値がともに整数である座標上に、必ずしも、対応する座標を持たないこととなる。 Here, the reason for shifting to the negative side by half a pixel will be described. Here, in order to facilitate understanding, the coordinate value of the original image is not multiplied by 256. For example, assuming that the original image is composed of 3 × 3 pixels as shown in FIG. 9A, when the original image is enlarged three times vertically and three times horizontally, as shown in FIG. 9B. Suppose that the coordinates in the original image corresponding to the coordinates (0,0) of the output image are defined as (0,0) (a black circle is placed at the coordinates (0,0) in FIG. 9B). That means this provision). In this case, attention is paid to a pixel A at coordinates (0, 1) and a pixel B at coordinates (2, 1) in the original image. In the bilinear interpolation method, the interpolation point indicated by a white circle in FIG. 9B is obtained by multiplying the pixel value of the original pixel by a weight inversely proportional to the distance from the original pixel (black circle) on the original image. The value is obtained as part of its own pixel value. Therefore, conversely, for example, the pixel B has its own pixel value at the interpolation point in the upper right, lower right, upper left, and lower left regions (interpolation point surrounded by a one-dot chain line in FIG. 9B). Will be distributed. On the other hand, the pixel A distributes its own pixel value only to the interpolation points (interpolation points surrounded by a broken line in FIG. 9B) in the upper right and lower right regions of the pixel A. That is, the pixel A uses only half of its own pixel value for accumulating the pixel value at the interpolation point. For this reason, in this embodiment, as shown in FIG. 9C, the coordinates of the original pixel corresponding to the coordinates (X, Y) of the output image are shifted by the negative side (left side and upper side) by half a pixel. Also for the pixel A, the upper left and lower left regions having the interpolation points to which the pixel values are to be distributed are given. As a result, the coordinates in the original image corresponding to the coordinates (0, 0) of the output image are (−0.5, −0.5), and the interpolation points on the output image are x, The y coordinate value does not necessarily have a corresponding coordinate on a coordinate whose integers are both integers.
続いて、CPU17は、分割出力画像における座標値Yに対応するx座標値を算出する(S203)。具体的には、CPU17は、座標値Xに縦方向の逆変換倍率((Iv/Ov)×256)を乗じ、その結果からさらに128を引いて得られる値を、x座標値とする。 Subsequently, the CPU 17 calculates an x coordinate value corresponding to the coordinate value Y in the divided output image (S203). Specifically, the CPU 17 multiplies the coordinate value X by the vertical reverse conversion magnification ((Iv / Ov) × 256), and further subtracts 128 from the result to obtain an x coordinate value.
なお、これらステップS202,S203は、前述した補間点定義手段に相当しており、これらステップS202,S203を実行するCPU17は、前述した補間点定義部に相当している。 Note that these steps S202 and S203 correspond to the above-described interpolation point defining means, and the CPU 17 executing these steps S202 and S203 corresponds to the above-described interpolation point defining unit.
続いて、CPU17は、原画像における座標(X,Y)に対応する座標(x,y)の画素値を双一次補間法によって算出する際に参照すべき原画素の座標を特定するためのサブルーチンを行う(S204)。図10は、このサブルーチンの流れを示す図である。 Subsequently, the CPU 17 is a subroutine for specifying the coordinates of the original pixel to be referred to when the pixel value of the coordinate (x, y) corresponding to the coordinate (X, Y) in the original image is calculated by the bilinear interpolation method. (S204). FIG. 10 shows the flow of this subroutine.
このサブルーチンの開始後、CPU17は、原画像上における整数(負を含む)の座標値を持つ座標のうち、座標(x,y)を囲む4つの座標を特定した後、それら4つの座標のうち、座標(x,y)の左上及び左下にある座標のx座標値を、処理対象範囲左端位置を示す変数xlに代入し、座標(x,y)の右上及び右下にある座標のx座標値を、処理対象範囲右端位置を示す変数xrに代入し、座標(x,y)の左上及び右上にある座標のy座標値を、処理対象範囲上端位置を示す変数ytに代入し、座標(x,y)の左下及び右下にある座標のy座標値を、処理対象範囲下端位置を示す変数ybに代入する(S301)。 After starting this subroutine, the CPU 17 specifies four coordinates surrounding the coordinate (x, y) among the coordinates having integer (including negative) coordinate values on the original image, and then, among these four coordinates. The x coordinate values of the coordinates at the upper left and lower left of the coordinates (x, y) are substituted into the variable xl indicating the left end position of the processing target range, and the x coordinates of the coordinates at the upper right and lower right of the coordinates (x, y) The value is substituted into the variable xr indicating the right end position of the processing target range, the y coordinate value of the coordinates at the upper left and upper right of the coordinates (x, y) is substituted into the variable yt indicating the upper end position of the processing target range, and the coordinates ( The y-coordinate values of the coordinates at the lower left and lower right of x, y) are substituted into a variable yb indicating the lower end position of the processing target range (S301).
続いて、CPU17は、処理対象範囲左端位置を示す変数xlが0よりも小さいか否かを、判別する(S302)。そして、変数xlが0よりも小さかった場合(S302;YES)、CPU17は、処理対象範囲左端位置を示す変数xlの代入値と処理対象範囲右端位置を示す変数xrの代入値とを1だけ増やす(S303)。一方、変数xlが0よりも小さくなかった場合(S302;NO)、CPU17は、処理対象範囲右端位置を示す変数xrが分割原画像のx方向の最大値xmaxよりも大きいか否かを、判別する(S304)。そして、CPU17は、処理対象範囲右端位置を示す変数xrが最大値xmaxよりも大きかった場合(S304;YES)、処理対象範囲左端位置を示す変数xlの代入値と処理対象範囲右端位置を示す変数xrの代入値とを1だけ減らし(S305)、処理対象範囲右端位置を示す変数xrが最大値xmaxよりも大きくなかった場合(S304;NO)、処理対象範囲左端位置を示す変数xlの代入値と処理対象範囲右端位置を示す変数xrの代入値とをそのままにする。 Subsequently, the CPU 17 determines whether or not the variable xl indicating the left end position of the processing target range is smaller than 0 (S302). When the variable xl is smaller than 0 (S302; YES), the CPU 17 increases the substitution value of the variable xl indicating the left end position of the processing target range and the substitution value of the variable xr indicating the right end position of the processing target range by one. (S303). On the other hand, if the variable xl is not smaller than 0 (S302; NO), the CPU 17 determines whether or not the variable xr indicating the right end position of the processing target range is larger than the maximum value xmax in the x direction of the divided original image. (S304). When the variable xr indicating the processing target range right end position is larger than the maximum value xmax (S304; YES), the CPU 17 assigns the variable xl indicating the processing target range left end position and the variable indicating the processing target range right end position. If the variable xr indicating the right end position of the processing target range is not larger than the maximum value xmax (S304; NO), the substituting value of the variable xl indicating the left end position of the processing target range is decreased by 1 (S305). And the substitution value of the variable xr indicating the right end position of the processing target range are left as they are.
続いて、CPU17は、処理対象範囲上端位置を示す変数ytが0よりも小さいか否かを、判別する(S306)。そして、変数ytが0よりも小さかった場合(S306;YES)、CPU17は、処理対象範囲上端位置を示す変数ytの代入値と処理対象範囲下端位置を示す変数ybの代入値とを1だけ増やす(S307)。一方、変数ytが0よりも小さくなかった場合(S306;NO)、CPU17は、処理対象範囲下端位置を示す変数ybが分割原画像のy方向の最大値ymaxよりも大きいか否かを、判別する(S308)。そして、CPU17は、処理対象範囲下端位置を示す変数ybが最大値xmaxよりも大きかった場合(S308;YES)、処理対象範囲上端位置を示す変数ytの代入値と処理対象範囲下端位置を示す変数ybの代入値とを1だけ減らし(S309)、処理対象範囲下端位置を示す変数ybが最大値ymaxよりも大きくなかった場合(S308;NO)、処理対象範囲上端位置を示す変数ytの代入値と処理対象範囲下端位置を示す変数ybの代入値とをそのままにする。 Subsequently, the CPU 17 determines whether or not the variable yt indicating the processing target range upper end position is smaller than 0 (S306). When the variable yt is smaller than 0 (S306; YES), the CPU 17 increases the substitution value of the variable yt indicating the processing target range upper end position and the substitution value of the variable yb indicating the processing target range lower end position by one. (S307). On the other hand, if the variable yt is not smaller than 0 (S306; NO), the CPU 17 determines whether or not the variable yb indicating the lower end position of the processing target range is larger than the maximum value ymax in the y direction of the divided original image. (S308). When the variable yb indicating the processing target range lower end position is greater than the maximum value xmax (S308; YES), the CPU 17 assigns the variable yt indicating the processing target range upper end position and the variable indicating the processing target range lower end position. When the variable yb indicating the lower end position of the processing target range is not larger than the maximum value ymax (S308; NO), the substituting value of the variable yt indicating the upper end position of the processing target range is decremented by 1 (S309). And the substitution value of the variable yb indicating the lower end position of the processing target range are left as they are.
CPU17は、以上のようにして、変数xl,xr,yt,ybの代入値を特定して、図10に係る処理を終了する。なお、この図10に示される参照原画素特定サブルーチンは、前述した逆距離生成手段に相当しており、このサブルーチンを実行するCPU17は、前述した逆距離生成部に相当している。 As described above, the CPU 17 specifies substitution values for the variables xl, xr, yt, and yb, and ends the processing according to FIG. Note that the reference original pixel specifying subroutine shown in FIG. 10 corresponds to the above-described reverse distance generation means, and the CPU 17 that executes this subroutine corresponds to the above-described reverse distance generation unit.
図10に係る処理の終了後、CPU17は、図3に示されるように、ROM16に記録されている三つのテーブルのうちの何れを以降の処理に使用するかを決定するテーブル決定処理を行う(S205〜S209)。 After the process according to FIG. 10 is completed, the CPU 17 performs a table determination process for determining which of the three tables recorded in the ROM 16 is used for the subsequent processes as shown in FIG. S205 to S209).
なお、ROM16に記録されている三つのテーブルは、何れも、x座標値からxl座標値を差し引いて得られる距離値(これは、x座標値からxr座標値を差し引いて得られる距離値を256から引いた値(逆距離値)に等しい),及び、y座標値からyt座標値を差し引いて得られる距離値(これは、y座標値からyb座標値を差し引いて得られる距離値を256から引いた値(逆距離値)に等しい)を、別の値に置換する際に使用されるテーブルである。これら三つのテーブルは、後述するように、座標(x,y)の原画像内での位置の違いに応じて、使い分けられることとなる。 Note that each of the three tables recorded in the ROM 16 has a distance value obtained by subtracting the xl coordinate value from the x coordinate value (this is a distance value obtained by subtracting the xr coordinate value from the x coordinate value is 256. And the distance value obtained by subtracting the yt coordinate value from the y coordinate value (this is the distance value obtained by subtracting the yb coordinate value from the y coordinate value from 256. This is a table used when replacing a subtracted value (equal to a reverse distance value) with another value. As will be described later, these three tables are selectively used according to the difference in the position of the coordinates (x, y) in the original image.
具体的に説明すると、CPU17は、まず、x座標値とy座標値の何れか一方が0より小さい値であるか否かを、判別する(S205)。 Specifically, the CPU 17 first determines whether one of the x-coordinate value and the y-coordinate value is a value smaller than 0 (S205).
そして、x座標値とy座標値の何れか一方が0より小さかった場合(S205;YES)、CPU17は、ROM16に記録されている後述の三つのテーブルのうち、原画像の左縁又は上縁にある補間点に対して用いるための左上縁用テーブルを後述の距離値決定処理に使用することを、決定する(S207)。なお、原画像の左縁とは、原画像のx方向の最小値0を下回る領域を言い、図9(c)の例で言えば、座標(0,0)〜座標(0,8)と座標(1,0)〜(1,8)とがある領域である。また、原画像の上縁とは、原画像のy方向の最小値0を下回る領域を言い、図9(c)の例で言えば、座標(0,0)〜座標(8,0)と座標(0,1)〜(8,1)とがある領域である。 If either the x-coordinate value or the y-coordinate value is smaller than 0 (S205; YES), the CPU 17 selects the left edge or upper edge of the original image from the three tables described later recorded in the ROM 16. It is determined that the upper left edge table for use with respect to the interpolation point at is used for the distance value determination process described later (S207). Note that the left edge of the original image refers to an area below the minimum value 0 in the x direction of the original image. In the example of FIG. 9C, coordinates (0,0) to coordinates (0,8) This is an area with coordinates (1, 0) to (1, 8). Further, the upper edge of the original image refers to an area below the minimum value 0 in the y direction of the original image. In the example of FIG. 9C, coordinates (0,0) to coordinates (8,0) This is an area having coordinates (0, 1) to (8, 1).
一方、x座標値とy座標値の何れもが0より小さくなかった場合(S205;NO)、CPU17は、x座標値がxmaxよりも大きいか、y座標値がymaxよりも大きい状態にあるか否かを、判別する(S206)。 On the other hand, if neither the x coordinate value nor the y coordinate value is smaller than 0 (S205; NO), the CPU 17 determines whether the x coordinate value is larger than xmax or the y coordinate value is larger than ymax. It is determined whether or not (S206).
そして、x座標値がxmaxよりも大きいか、y座標値がymaxよりも大きい状態にあった場合(S206;YES)、CPU17は、ROM16に記録されている後述の三つのテーブルのうち、原画像の右縁又は下縁にある補間点に対して用いるための右下縁用テーブルを後述の距離値決定処理に使用することを、決定する(S208)。なお、原画像の右縁とは、原画像のx方向の最大値xmaxを上回る領域を言い、図9(c)の例で言えば、座標(8,2)〜座標(8,8)がある領域である。また、原画像の下縁とは、原画像のy方向の最大値ymaxを上回る領域を言い、図9(c)の例で言えば、座標(2,8)〜座標(8,8)がある領域である。 If the x-coordinate value is larger than xmax or the y-coordinate value is larger than ymax (S206; YES), the CPU 17 selects the original image from the three tables described later recorded in the ROM 16. It is determined that the table for the lower right edge to be used for the interpolation point at the right edge or the lower edge is used for the distance value determination process described later (S208). The right edge of the original image means a region exceeding the maximum value xmax in the x direction of the original image. In the example of FIG. 9C, the coordinates (8, 2) to the coordinates (8, 8) are It is a certain area. Further, the lower edge of the original image means a region exceeding the maximum value ymax in the y direction of the original image. In the example of FIG. 9C, the coordinates (2, 8) to the coordinates (8, 8) are It is a certain area.
一方、x座標値がxmaxよりも大きくなく、且つ、y座標値がymaxよりも大きくない状態にあった場合(S206;NO)、CPU17は、ROM16に記録されている後述の三つのテーブルのうち、原画像の内部にある補間点に対して用いるための内部用テーブルを後述の距離置換処理に使用することを、決定する(S209)。なお、原画像の内部とは、原画像のx方向の最小値0から最大値xmaxまでの範囲であって、なおかつ、原画像のy方向の最小値0から最大値ymaxまでの範囲にある領域を言う。図9(c)の例で言えば、座標(2,2)〜(7,7)がある領域を言う。 On the other hand, when the x-coordinate value is not larger than xmax and the y-coordinate value is not larger than ymax (S206; NO), the CPU 17 selects the following three tables recorded in the ROM 16: Then, it is determined that an internal table for use with the interpolation points in the original image is used for the distance replacement process described later (S209). The inside of the original image is a region in the range from the minimum value 0 to the maximum value xmax in the x direction of the original image, and in the range from the minimum value 0 to the maximum value ymax in the y direction of the original image. Say. In the example of FIG. 9C, it refers to an area having coordinates (2, 2) to (7, 7).
以上のようにして、後述の距離値決定処理に使用するテーブルを決定した後、CPU17は、図4に示されるように、座標(xl,yt),(xr,yt),(xl,yb),(xr,yb)におけるRGBの各色成分の画素値を、分割原画素データの記憶領域から読み取る(S210)。 After determining the table used for the distance value determination process described later as described above, the CPU 17 coordinates (xl, yt), (xr, yt), (xl, yb) as shown in FIG. , (Xr, yb), the pixel values of the respective RGB color components are read from the storage area of the divided original pixel data (S210).
続いて、CPU17は、x方向エッジフラグ情報とy方向エッジフラグ情報とを、オフを示す状態でDRAM15内に記録する(S211)。なお、エッジフラグ情報とは、これ以降の判定処理(S212〜S235)における判定結果を記憶するためのフラグ情報となっている。その判定処理とは、詳しくは後述するが、簡単に説明すると、座標(x,y)の周囲にある4個の原画素からなる微少画像において画素値の濃度差が、図11に示されるようなパターンの何れかにあるか否かを判定するための処理を言う。 Subsequently, the CPU 17 records the x-direction edge flag information and the y-direction edge flag information in the DRAM 15 in a state indicating OFF (S211). The edge flag information is flag information for storing determination results in subsequent determination processes (S212 to S235). The determination process will be described in detail later, but will be briefly described. As shown in FIG. 11, the density difference of pixel values in a minute image composed of four original pixels around the coordinates (x, y) is shown. A process for determining whether or not any of the patterns is present.
このようにオフの状態のエッジフラグ情報をDRAM15に記録した後(S211)、CPU17は、左上座標(xl,yt)にある原画素のR画素値及びG画素値の和と、右上座標(xr,yt)にある原画素のR画素値及びG画素値の和とについて、差分の絶対値を算出する(S212)。 After the edge flag information in the off state is recorded in the DRAM 15 as described above (S211), the CPU 17 determines the sum of the R pixel value and G pixel value of the original pixel at the upper left coordinates (xl, yt) and the upper right coordinates (xr , Yt), the absolute value of the difference is calculated for the sum of the R pixel value and G pixel value of the original pixel (S212).
その後、CPU17は、その絶対値が所定の閾値を超えているか否かを、判別する(S213)。そして、CPU17は、その絶対値が所定の閾値を超えていた場合(S213;YES)、x方向エッジフラグ情報をオフ状態からオン状態に切り替え(S214)、その絶対値が所定の閾値を超えていなかった場合(S213;NO)、x方向エッジフラグ情報をオフ状態のままにする。 Thereafter, the CPU 17 determines whether or not the absolute value exceeds a predetermined threshold (S213). If the absolute value exceeds the predetermined threshold (S213; YES), the CPU 17 switches the x-direction edge flag information from the off state to the on state (S214), and the absolute value exceeds the predetermined threshold. If not (S213; NO), the x-direction edge flag information remains in the OFF state.
続いて、CPU17は、左上座標(xl,yt)にある原画素のR画素値及びG画素値の和と、左下座標(xl,yb)にある原画素のR画素値及びG画素値の和とについて、差分の絶対値を算出する(S215)。 Subsequently, the CPU 17 sums the R pixel value and the G pixel value of the original pixel at the upper left coordinate (xl, yt) and the sum of the R pixel value and the G pixel value of the original pixel at the lower left coordinate (xl, yb). The absolute value of the difference is calculated with respect to (S215).
その後、CPU17は、その絶対値が所定の閾値を超えているか否かを、判別する(S216)。そして、CPU17は、その絶対値が所定の閾値を超えていた場合(S216;YES)、y方向エッジフラグ情報をオフ状態からオン状態に切り替え(S217)、その絶対値が所定の閾値を超えていなかった場合(S216;NO)、y方向エッジフラグ情報をオフ状態のままにする。 Thereafter, the CPU 17 determines whether or not the absolute value exceeds a predetermined threshold (S216). If the absolute value exceeds the predetermined threshold (S216; YES), the CPU 17 switches the y-direction edge flag information from the off state to the on state (S217), and the absolute value exceeds the predetermined threshold. If not (S216; NO), the y-direction edge flag information remains in the OFF state.
続いて、CPU17は、図5に示されるように、左下座標(xl,yb)にある原画素のR画素値及びG画素値の和と、右下座標(xr,yb)にある原画素のR画素値及びG画素値の和とについて、差分の絶対値を算出する(S218)。 Next, as shown in FIG. 5, the CPU 17 sums the R pixel value and G pixel value of the original pixel at the lower left coordinate (xl, yb) and the original pixel at the lower right coordinate (xr, yb). The absolute value of the difference is calculated for the sum of the R pixel value and the G pixel value (S218).
その後、CPU17は、その絶対値が所定の閾値を超えているか否かを、判別する(S219)。そして、CPU17は、その絶対値が所定の閾値を超えていた場合(S219;YES)、x方向エッジフラグ情報の状態をオン状態に切り替え(S220)、その絶対値が所定の閾値を超えていなかった場合(S219;NO)、x方向エッジフラグ情報の状態を変更しない。 Thereafter, the CPU 17 determines whether or not the absolute value exceeds a predetermined threshold (S219). When the absolute value exceeds the predetermined threshold (S219; YES), the CPU 17 switches the state of the x-direction edge flag information to the on state (S220), and the absolute value does not exceed the predetermined threshold. If this happens (S219; NO), the state of the x-direction edge flag information is not changed.
続いて、CPU17は、右上座標(xr,yt)にある原画素のR画素値及びG画素値の和と、右下座標(xr,yb)にある原画素のR画素値及びG画素値の和とについて、差分の絶対値を算出する(S221)。 Subsequently, the CPU 17 calculates the sum of the R pixel value and the G pixel value of the original pixel located at the upper right coordinate (xr, yt) and the R pixel value and the G pixel value of the original pixel located at the lower right coordinate (xr, yb). The absolute value of the difference is calculated for the sum (S221).
その後、CPU17は、その絶対値が所定の閾値を超えているか否かを、判別する(S222)。そして、CPU17は、その絶対値が所定の閾値を超えていた場合(S222;YES)、y方向エッジフラグ情報の状態をオン状態に切り替え(S223)、その絶対値が所定の閾値を超えていなかった場合(S222;NO)、y方向エッジフラグ情報の状態を変更しない。 Thereafter, the CPU 17 determines whether or not the absolute value exceeds a predetermined threshold (S222). If the absolute value exceeds the predetermined threshold (S222; YES), the CPU 17 switches the state of the y-direction edge flag information to the on state (S223), and the absolute value does not exceed the predetermined threshold. If this happens (S222; NO), the state of the y-direction edge flag information is not changed.
続いて、CPU17は、左上座標(xl,yt)にある原画素のG画素値及びB画素値の和と、右上座標(xr,yt)にある原画素のG画素値及びB画素値の和とについて、差分の絶対値を算出する(S224)。 Subsequently, the CPU 17 sums the G pixel value and the B pixel value of the original pixel at the upper left coordinate (xl, yt) and the sum of the G pixel value and the B pixel value of the original pixel at the upper right coordinate (xr, yt). Then, the absolute value of the difference is calculated (S224).
その後、CPU17は、その絶対値が所定の閾値を超えているか否かを、判別する(S225)。そして、CPU17は、その絶対値が所定の閾値を超えていた場合(S225;YES)、x方向エッジフラグ情報の状態をオン状態に切り替え(S226)、その絶対値が所定の閾値を超えていなかった場合(S225;NO)、x方向エッジフラグ情報の状態を変更しない。 Thereafter, the CPU 17 determines whether or not the absolute value exceeds a predetermined threshold (S225). When the absolute value exceeds the predetermined threshold (S225; YES), the CPU 17 switches the state of the x-direction edge flag information to the on state (S226), and the absolute value does not exceed the predetermined threshold. If it is detected (S225; NO), the state of the x-direction edge flag information is not changed.
続いて、CPU17は、図6に示されるように、左上座標(xl,yt)にある原画素のG画素値及びB画素値の和と、左下座標(xl,yb)にある原画素のG画素値及びB画素値の和とについて、差分の絶対値を算出する(S227)。 Subsequently, as shown in FIG. 6, the CPU 17 sums the G pixel value and the B pixel value of the original pixel at the upper left coordinate (xl, yt) and the G of the original pixel at the lower left coordinate (xl, yb). The absolute value of the difference is calculated for the sum of the pixel value and the B pixel value (S227).
その後、CPU17は、その絶対値が所定の閾値を超えているか否かを、判別する(S228)。そして、CPU17は、その絶対値が所定の閾値を超えていた場合(S228;YES)、y方向エッジフラグ情報の状態をオン状態に切り替え(S229)、その絶対値が所定の閾値を超えていなかった場合(S228;NO)、y方向エッジフラグ情報の状態を変更しない。 Thereafter, the CPU 17 determines whether or not the absolute value exceeds a predetermined threshold (S228). When the absolute value exceeds the predetermined threshold (S228; YES), the CPU 17 switches the state of the y-direction edge flag information to the on state (S229), and the absolute value does not exceed the predetermined threshold. If this is the case (S228; NO), the state of the y-direction edge flag information is not changed.
続いて、CPU17は、左下座標(xl,yb)にある原画素のG画素値及びB画素値の和と、右下座標(xr,yb)にある原画素のG画素値及びB画素値の和とについて、差分の絶対値を算出する(S230)。 Subsequently, the CPU 17 calculates the sum of the G pixel value and the B pixel value of the original pixel at the lower left coordinate (xl, yb) and the G pixel value and the B pixel value of the original pixel at the lower right coordinate (xr, yb). The absolute value of the difference is calculated for the sum (S230).
その後、CPU17は、その絶対値が所定の閾値を超えているか否かを、判別する(S231)。そして、CPU17は、その絶対値が所定の閾値を超えていた場合(S231;YES)、x方向エッジフラグ情報の状態をオン状態に切り替え(S232)、その絶対値が所定の閾値を超えていなかった場合(S231;NO)、x方向エッジフラグ情報の状態を変更しない。 Thereafter, the CPU 17 determines whether or not the absolute value exceeds a predetermined threshold (S231). If the absolute value exceeds the predetermined threshold (S231; YES), the CPU 17 switches the state of the x-direction edge flag information to the on state (S232), and the absolute value does not exceed the predetermined threshold. If it is detected (S231; NO), the state of the x-direction edge flag information is not changed.
続いて、CPU17は、右上座標(xr,yt)にある原画素のG画素値及びB画素値の和と、右下座標(xr,yb)にある原画素のG画素値及びB画素値の和とについて、差分の絶対値を算出する(S233)。 Subsequently, the CPU 17 calculates the sum of the G pixel value and the B pixel value of the original pixel at the upper right coordinate (xr, yt) and the G pixel value and the B pixel value of the original pixel at the lower right coordinate (xr, yb). The absolute value of the difference is calculated for the sum (S233).
その後、CPU17は、その絶対値が所定の閾値を超えているか否かを、判別する(S234)。そして、CPU17は、その絶対値が所定の閾値を超えていた場合(S234;YES)、y方向エッジフラグ情報の状態をオン状態に切り替え(S235)、その絶対値が所定の閾値を超えていなかった場合(S234;NO)、y方向エッジフラグ情報の状態を変更しない。 Thereafter, the CPU 17 determines whether or not the absolute value exceeds a predetermined threshold (S234). If the absolute value exceeds the predetermined threshold (S234; YES), the CPU 17 switches the state of the y-direction edge flag information to the on state (S235), and the absolute value does not exceed the predetermined threshold. If this occurs (S234; NO), the state of the y-direction edge flag information is not changed.
以上に示した判定処理(S212〜S235)を終えた後、CPU17は、図7に示されるように、座標(x,y)からその周囲にある4個の原画素までの距離の値を決定する距離決定処理を行う(S236〜S243)。 After completing the determination processing (S212 to S235) described above, the CPU 17 determines the distance value from the coordinates (x, y) to the four original pixels around it as shown in FIG. Distance determination processing is performed (S236 to S243).
具体的に説明すると、CPU17は、まず、x方向エッジフラグ情報がオン状態にあるかオフ状態にあるかを、判別する(S236)。 Specifically, the CPU 17 first determines whether the x-direction edge flag information is in an on state or an off state (S236).
そして、x方向エッジフラグ情報がオフ状態にあった場合(S236;YES)、CPU17は、x座標値からxl座標値を差し引き、その結果を256で割って得られる値を、距離値として変数pに代入する(S237)。 If the x-direction edge flag information is in the off state (S236; YES), the CPU 17 subtracts the xl coordinate value from the x coordinate value, and divides the result by 256 to obtain the value p as the distance value. (S237).
一方、x方向エッジフラグ情報がオン状態にあった場合(S236;NO)、CPU17は、ROM16に記録されている三つのテーブルのうち、この時点で使用することを決定しているテーブル(S205〜S209参照)を参照して、x座標値からxl座標値を差し引いて得られる値に対応する値を読み取り(S238)、読み取った値を256で割って得られる値を、距離値として変数pに代入する(S239)。 On the other hand, when the x-direction edge flag information is in the ON state (S236; NO), the CPU 17 among the three tables recorded in the ROM 16 is determined to be used at this time (S205 to S205). Referring to S209), the value corresponding to the value obtained by subtracting the xl coordinate value from the x coordinate value is read (S238), and the value obtained by dividing the read value by 256 is set as the distance value in the variable p. Substitute (S239).
続いて、CPU17は、y方向エッジフラグ情報がオン状態にあるかオフ状態にあるかを、判別する(S240)。 Subsequently, the CPU 17 determines whether the y-direction edge flag information is on or off (S240).
そして、y方向エッジフラグ情報がオフ状態にあった場合(S240;YES)、CPU17は、y座標値からyt座標値を差し引き、その結果を256で割って得られる値を、距離値として変数qに代入する(S241)。 If the y-direction edge flag information is in the off state (S240; YES), the CPU 17 subtracts the yt coordinate value from the y coordinate value, and divides the result by 256 to obtain a variable q (S241).
一方、y方向エッジフラグ情報がオン状態にあった場合(S240;NO)、CPU17は、ROM16に記録されている三つのテーブルのうち、この時点で使用することを決定しているテーブル(S205〜S209参照)を参照して、y座標値からyt座標値を差し引いて得られる値に対応する値を読み取り(S242)、読み取った値を256で割って得られる値を、距離値として変数qに代入する(S243)。 On the other hand, when the y-direction edge flag information is in the ON state (S240; NO), the CPU 17 among the three tables recorded in the ROM 16 is determined to be used at this time (S205 to S205). Referring to S209), the value corresponding to the value obtained by subtracting the yt coordinate value from the y coordinate value is read (S242), and the value obtained by dividing the read value by 256 is set as a distance value to the variable q. Substitute (S243).
なお、ステップS237,S241は、前述した逆距離値生成手段に相当しており、ステップS212〜S235,S238,S239,S242,S243は、前述した逆距離値補正手段に相当している。また、ステップS237,S241を実行するCPU17は、前述した逆距離値生成部に相当しており、ステップS212〜S235,S238,S239,S242,S243を実行するCPU17は、前述した逆距離値補正部に相当している。 Note that steps S237 and S241 correspond to the above-described reverse distance value generation unit, and steps S212 to S235, S238, S239, S242, and S243 correspond to the above-described reverse distance value correction unit. The CPU 17 that executes steps S237 and S241 corresponds to the above-described reverse distance value generation unit, and the CPU 17 that executes steps S212 to S235, S238, S239, S242, and S243 includes the above-described reverse distance value correction unit. It corresponds to.
以上のようにして、変数p,qの代入値を決定した後、CPU17は、これら変数p,qを用いて、座標(x,y)の画素値をRGBの各成分について算出する(S244)。なお、算出式は、一般的な双一次補間法に用いられる算出式『補間点の画素値=(1−p)(1−9)×(左上原画素の画素値)+p(1−q)×(右上原画素の画素値)+(1−p)q×(左下原画素の画素値)+pq×(右下原画素の画素値)』と同じである。 After determining the substituted values of the variables p and q as described above, the CPU 17 calculates the pixel value of the coordinates (x, y) for each component of RGB using these variables p and q (S244). . The calculation formula is a calculation formula used in a general bilinear interpolation method: “pixel value of interpolation point = (1−p) (1−9) × (pixel value of upper left original pixel) + p (1−q)” × (pixel value of the upper right original pixel) + (1-p) q × (pixel value of the lower left original pixel) + pq × (pixel value of the lower right original pixel) ”.
なお、pの値は、右上原画素と右下原画素のx方向の逆距離値であり、(1−p)の値は、左上原画素と左下原画素のx方向の逆距離値である。また、qの値は、左下原画素と右下原画素のy方向の逆距離値であり、(1−q)の値は、左上原画素と右上原画素のy方向の逆距離値である。 The value p is the reverse distance value in the x direction between the upper right original pixel and the lower right original pixel, and the value (1-p) is the reverse distance value in the x direction between the upper left original pixel and the lower left original pixel. . The q value is the reverse distance value in the y direction between the lower left original pixel and the lower right original pixel, and the value (1-q) is the reverse distance value in the y direction between the upper left original pixel and the upper right original pixel. .
そして、CPU17は、算出したRGBの画素値を、分割出力画像データの記憶領域としてDRAM15に確保した領域における当該座標(x,y)の位置に、保存する(S245)。 Then, the CPU 17 stores the calculated RGB pixel values at the position of the coordinates (x, y) in the area secured in the DRAM 15 as the storage area for the divided output image data (S245).
なお、ステップS244,S245は、前述した画素値生成手段に相当しており、ステップS244,S245を実行するCPU17は、前述した画素値生成部に相当している。 Note that steps S244 and S245 correspond to the above-described pixel value generation means, and the CPU 17 that executes steps S244 and S245 corresponds to the above-described pixel value generation unit.
その後、CPU17は、図8に示されるように、変数Xが分割出力画像のX方向の最大値Xmaxに達しているか否かを、判別する(S246)。このとき、変数Xが最大値Xmaxに達していなかった場合(S246;NO)、CPU17は、変数Xの代入値を1だけ増やして(S247)、再度、ステップS203〜S245の処理を実行する。 Thereafter, as shown in FIG. 8, the CPU 17 determines whether or not the variable X has reached the maximum value Xmax in the X direction of the divided output image (S246). At this time, if the variable X has not reached the maximum value Xmax (S246; NO), the CPU 17 increases the substitution value of the variable X by 1 (S247), and executes the processes of steps S203 to S245 again.
そして、ステップS203〜S247の処理を繰り返し行うことによって、変数Xが最大値Xmaxに達したときには(S246;YES)、CPU17は、変数Xに0を代入して(S248)、変数Yが分割出力画像のY方向の最大値Ymaxに達しているか否かを、判別する(S249)。このとき、変数Yが最大値Ymaxに達していなかった場合(S249;NO)、CPU17は、変数Yの代入値を1だけ増やして(S250)、再度、ステップS202〜S248の処理を実行する。 When the variable X reaches the maximum value Xmax by repeating the processing of steps S203 to S247 (S246; YES), the CPU 17 substitutes 0 for the variable X (S248), and the variable Y is divided and output. It is determined whether or not the maximum value Ymax in the Y direction of the image has been reached (S249). At this time, if the variable Y has not reached the maximum value Ymax (S249; NO), the CPU 17 increases the substitution value of the variable Y by 1 (S250), and executes the processes of steps S202 to S248 again.
そして、ステップS202〜S250の処理を繰り返し行うことによって、変数Yが最大値Ymaxに達したときには(S249;YES)、CPU17は、図3乃至図8に係る処理を終了する。 When the variable Y reaches the maximum value Ymax by repeatedly performing the processes of steps S202 to S250 (S249; YES), the CPU 17 ends the processes according to FIGS.
本実施形態の印刷装置10は、以上に説明したような処理が行われるように構成されているため、以下に説明するような作用及び効果を有する。 The printing apparatus 10 according to the present embodiment is configured to perform the processing as described above, and thus has the operations and effects described below.
前述したように、本実施形態の印刷装置10において、分割原画像データがDRAM15に取り込まれると、その分割原画像の各画素の画素値に基づいて、分割出力画像の各画素の画素値が順次生成される(S201〜S250)。 As described above, in the printing apparatus 10 of the present embodiment, when the divided original image data is taken into the DRAM 15, the pixel values of the pixels of the divided output image are sequentially set based on the pixel values of the pixels of the divided original image. It is generated (S201 to S250).
このとき、その分割原画像が、風景画のように濃淡の変化が緩やかな部分を含む場合、その部分には、濃淡が鋭く変化する境界部分がないため、印刷装置10は、その部分における何れの補間点についても、その補間点の画素値を作成するために参照される4個の原画素の濃度差がないと判断する(S213;NO,S216;NO,S219;NO,S222;NO,S225;NO,S228;NO,S231;NO,且つ、S234;NO)。このため、この場合には、x方向エッジフラグ情報もy方向エッジフラグ情報も何れもオフ状態のままとなるため、一つの補間点の画素値を作成するために4個の原画素の画素値に乗ぜられる重みには、一般的な双一次補間法と同様に、距離に反比例する逆距離値が、用いられることとなる(S237,S241)。 At this time, if the divided original image includes a portion where the change in shading is gentle like a landscape image, the printing apparatus 10 does not have any boundary portion where the shading changes sharply in that portion. It is also determined that there is no density difference between the four original pixels that are referred to for creating the pixel value of the interpolation point (S213; NO, S216; NO, S219; NO, S222; NO, S225; NO, S228; NO, S231; NO, and S234; NO). For this reason, in this case, since both the x-direction edge flag information and the y-direction edge flag information remain in the off state, the pixel values of the four original pixels are used to create the pixel value of one interpolation point. As the weight multiplied by, an inverse distance value inversely proportional to the distance is used as in the general bilinear interpolation method (S237, S241).
一方、その分割原画像が、市松模様や漫画などのベタ画のような部分を含む場合、その部分には、濃淡が鋭く変化する境界部分があるため、印刷装置10は、その部分における何れかの補間点について、その補間点の画素値を作成するために参照される4個の原画素の濃度差があると判断する(S213;YES,S216;YES,S219;YES,S222;YES,S225;YES,S228;YES,S231;YES,又は、S234;YES)。このため、このように判断された補間点については、x方向エッジフラグ情報かy方向エッジフラグ情報の何れか、若しくは、双方がオン状態となるため、その補間点の画素値を作成するために4個の原画素の画素値に乗ぜられる重みには、一般的な双一次補間法と同様の距離に反比例する逆距離値が用いられるのではなく、補正された逆距離値が用いられるようになる(S238,S239,S242,S243)。 On the other hand, when the divided original image includes a portion such as a solid image such as a checkered pattern or a cartoon, since there is a boundary portion where the shading changes sharply in the portion, the printing apparatus 10 is any of the portions. It is determined that there is a density difference between the four original pixels referred to for creating the pixel value of the interpolation point (S213; YES, S216; YES, S219; YES, S222; YES, S225). YES, S228; YES, S231; YES, or S234; YES). For this reason, since either or both of the x-direction edge flag information and the y-direction edge flag information are turned on for the interpolation point determined in this manner, the pixel value of the interpolation point is created. The weight multiplied by the pixel values of the four original pixels is not the inverse distance value inversely proportional to the distance as in the general bilinear interpolation method, but the corrected inverse distance value is used. (S238, S239, S242, S243).
図12及び図13は、逆距離値の補正に用いられるテーブルの値を座標上にプロットしてなるグラフを示している。これらグラフにおいて、横軸は、補正前の逆距離値、縦軸は、補正後の逆距離値を示している。 12 and 13 show graphs obtained by plotting the values of the table used for correcting the reverse distance value on the coordinates. In these graphs, the horizontal axis represents the reverse distance value before correction, and the vertical axis represents the reverse distance value after correction.
このうち、図12の破線のグラフは、原画像の内部にある補間点について補正を行うときの補正前の逆距離値と補正後の逆距離値との関係を示している。この図12の破線にて示される内部用テーブルによると、原画素と補間点との距離の値が約80を下回っているときには、その逆距離値がそれより小さい逆距離値となるように補正され、逆距離値が約175を上回っているときには、その逆距離値がそれより大きい逆距離値となるように補正される。なお、図12の実線のグラフは、比較のため、テーブルを使用した補正を行わないときの逆距離値の関係(仮に補正の手続を踏んだとした場合の補正前の逆距離値と補正後の逆距離値との関係)を示している。 Among these, the broken line graph in FIG. 12 shows the relationship between the reverse distance value before the correction and the reverse distance value after the correction when the interpolation points in the original image are corrected. According to the internal table indicated by the broken line in FIG. 12, when the distance value between the original pixel and the interpolation point is less than about 80, the reverse distance value is corrected to be a smaller reverse distance value. When the reverse distance value exceeds about 175, the reverse distance value is corrected so as to become a larger reverse distance value. Note that, for comparison, the solid line graph in FIG. 12 shows the relationship between the reverse distance values when correction using the table is not performed (the reverse distance value before correction when the correction procedure is taken and the correction after correction). The relationship with the inverse distance value).
原画像の内部にある補間点について、原画素の画素値に対する重みを算出するための逆距離値が、このように補正されると、拡大後の画像における濃淡が変化する境界部分(エッジ)がさほど暈けないようになる。例えば、図14(a)に示されるような市松模様が、原画像の内部に存在したとして、この原画像を本実施形態の印刷装置10が拡大すると、拡大後の画像は、図14(b)に示されるような画像となる。この図14(b)の画像と、一般的な双一次補間法により拡大した結果を示す図16(b)の拡大画像とを比較して明らかなように、図14(b)の拡大画像では、白格子と黒格子との境界がやや強調されている。 When the inverse distance value for calculating the weight with respect to the pixel value of the original pixel is corrected in this way for the interpolation point inside the original image, the boundary portion (edge) in which the shading changes in the enlarged image is obtained. I won't make much money. For example, assuming that a checkered pattern as shown in FIG. 14A exists inside the original image, when the printing apparatus 10 of the present embodiment enlarges this original image, the enlarged image is shown in FIG. ). As is clear by comparing the image of FIG. 14B with the enlarged image of FIG. 16B showing the result of enlargement by a general bilinear interpolation method, the enlarged image of FIG. The boundary between the white lattice and the black lattice is slightly emphasized.
また、図15は、図14(b)に示される拡大画像のC線上での画素値分布を示したグラフである。この図15に示される画素値分布と、図16の一般的な双一次補間法による拡大画像のD線上での画素値分布として図17に示されるものとを比較して明らかなように、本実施形態の印刷装置10によると、白格子と黒格子との境界及びその近傍にある画素の画素値が正弦曲線状に分布している。このグラフからも、白格子と黒格子との境界に現れる暈けの程度が低減されていることが明らかとなっている。 FIG. 15 is a graph showing the pixel value distribution on the C line of the enlarged image shown in FIG. The pixel value distribution shown in FIG. 15 is compared with the pixel value distribution shown in FIG. 17 as the pixel value distribution on the D line of the enlarged image by the general bilinear interpolation method shown in FIG. According to the printing apparatus 10 of the embodiment, the pixel values of the pixels at and near the boundary between the white lattice and the black lattice are distributed in a sinusoidal shape. From this graph, it is clear that the degree of blur appearing at the boundary between the white lattice and the black lattice is reduced.
また、図13の実線のグラフは、原画像の左縁又は上縁にある補間点について補正を行うときの補正前の逆距離値と補正後の逆距離値との関係を示している。この図13の実線のグラフにて示される左上縁用テーブルによると、原画素と補間点との逆距離値が約50を下回っているときには、その逆距離値がそれより大きい逆距離値となるように補正され、逆距離値が約175を上回っているときにも、その逆距離値がそれより大きい逆距離値となるように補正される。 The solid line graph in FIG. 13 shows the relationship between the reverse distance value before correction and the reverse distance value after correction when correction is performed on the interpolation point at the left edge or the upper edge of the original image. According to the upper left edge table shown in the solid line graph of FIG. 13, when the reverse distance value between the original pixel and the interpolation point is less than about 50, the reverse distance value is a larger reverse distance value. Even when the reverse distance value exceeds about 175, the reverse distance value is corrected so as to be a larger reverse distance value.
さらに、図13の破線のグラフは、原画像の右縁又は下縁にある補間点について補正を行うときの補正前の逆距離値と補正後の逆距離値との関係を示している。この図13の破線にて示される右下縁用テーブルによると、原画素と補間点との逆距離値が約80を下回っているときには、その逆距離値がそれより小さい逆距離値となるように補正され、逆距離値が約210を上回っているときにも、その逆距離値がそれより小さい逆距離値となるように補正される。 Furthermore, the broken line graph of FIG. 13 shows the relationship between the reverse distance value before correction and the reverse distance value after correction when correction is performed for the interpolation point at the right edge or the lower edge of the original image. According to the table for the lower right edge indicated by the broken line in FIG. 13, when the reverse distance value between the original pixel and the interpolation point is less than about 80, the reverse distance value is smaller than that. Even when the reverse distance value exceeds about 210, the reverse distance value is corrected so as to be a reverse distance value smaller than that.
原画像の左右縁及び上下縁にある補間点について、原画素の画素値に対する重みを算出するための逆距離値が、これらのように補正されると、濃淡の変化が鋭い絵柄を含む画像におけるその濃淡の境界部分において画像が分割されて、その分割された画像をそれぞれ別個に拡大してから互いに結合するという場合であっても、最終的な拡大画像において、画像の繋ぎ目がさほど目立たなくなるようになる。例えば、図18(a)に示されるように、横縞模様と縦縞模様とからなる原画像がE−E線(縦線)に沿って分割されて、分割された画像がそれぞれ一般的な双一次補間法にて別個に拡大されて、その後互いに結合されると、図18(b)及びその拡大図である図19(a)に示されるように、結合後の拡大画像内の縦縞模様におけるE−E線上にある白縞と黒縞との境界が、他の境界における濃淡の変化と異なる濃淡の変化を持ってしまい、繋ぎ目が目立ってしまう。しかし、同じ原画像について、本実施形態の印刷装置10が、同様の処理(分割,別個に拡大,結合)を行って得た拡大画像においては、図19(b)に示されるように、E−E線の左側にある白縞の灰色部分の領域が広がり、また、E−E線の右側にある黒縞の黒の濃さがやや薄くなっている。 For the interpolation points at the left and right edges and the top and bottom edges of the original image, when the inverse distance value for calculating the weight for the pixel value of the original pixel is corrected as described above, in an image including a picture with sharp changes in shading Even when the image is divided at the shading boundary portion, and the divided images are separately enlarged and then combined with each other, the joints of the images are not so noticeable in the final enlarged image. It becomes like this. For example, as shown in FIG. 18A, an original image composed of a horizontal stripe pattern and a vertical stripe pattern is divided along the EE line (vertical line), and the divided images are respectively general bilinear. When separately enlarged by the interpolation method and then combined with each other, as shown in FIG. 18 (b) and FIG. 19 (a) which is an enlarged view thereof, E in the vertical stripe pattern in the enlarged image after the combination is obtained. The boundary between the white stripe and the black stripe on the −E line has a light / dark change different from the light / dark change at the other boundary, and the joint becomes conspicuous. However, in the enlarged image obtained by performing the same processing (division, separate enlargement, and combination) on the same original image by the printing apparatus 10 according to the present embodiment, as shown in FIG. The region of the gray portion of the white stripe on the left side of the −E line is widened, and the darkness of the black stripe on the right side of the EE line is slightly lighter.
また、図20は、図18(b)に示される拡大画像のF線上での画素値分布を示したグラフである。この図20には、実線のグラフと破線のグラフとが示されているが、実線のグラフは、一般的な双一次補間法を用いて得た拡大画像(すなわち図19(a)の拡大画像)の画素値分布を示し、破線のグラフは、本実施形態の印刷装置10にて得た拡大画像(すなわち図19(b)の拡大画像)の画素値分布を示している。この図20に示されるように、本実施形態の印刷装置10によると、白縞が原画像の右縁にあるときには、その白縞の明るさが低減され、黒縞が原画像の左縁にあるときには、その黒縞の暗さが低減される。逆に、図示していないが、黒縞が原画像の右縁にあるときには、その黒縞の暗さが低減され、白縞が原画像の右縁にあるときには、その白縞の明るさが低減される。つまり、左上縁用テーブルと右下縁用テーブルを用いると、分割線を挟む両側の画像におけるその分割線近傍の部分の濃淡の変化が緩やかとなり、分割線による繋ぎ目が余り目立たなくなる。 FIG. 20 is a graph showing the pixel value distribution on the F line of the enlarged image shown in FIG. In FIG. 20, a solid line graph and a broken line graph are shown. The solid line graph is an enlarged image obtained by using a general bilinear interpolation method (that is, an enlarged image of FIG. 19A). ), And the broken line graph shows the pixel value distribution of the enlarged image (that is, the enlarged image of FIG. 19B) obtained by the printing apparatus 10 of the present embodiment. As shown in FIG. 20, according to the printing apparatus 10 of the present embodiment, when the white stripe is at the right edge of the original image, the brightness of the white stripe is reduced and the black stripe is at the left edge of the original image. In some cases, the darkness of the black stripe is reduced. Conversely, although not shown, when the black stripe is at the right edge of the original image, the darkness of the black stripe is reduced, and when the white stripe is at the right edge of the original image, the brightness of the white stripe is reduced. Reduced. In other words, when the upper left edge table and the lower right edge table are used, the change in shading of the portion in the vicinity of the dividing line in the images on both sides sandwiching the dividing line becomes gradual, and the joint by the dividing line becomes less conspicuous.
なお、左上縁用テーブルと右下縁用テーブルとを用いた補正は、繋ぎ目における濃淡の変化を緩めるように作用するものであるが、これに対し、前述した内部用テーブルを用いた補正は、濃淡の変化を目立たせるように作用するものである。従って、左上縁用テーブルと右下縁用テーブルとを用いた補正は、内部用テーブルを用いた補正とは、逆に作用するものとなっている。 The correction using the table for the upper left edge and the table for the lower right edge acts to loosen the change in shading at the joint, whereas the correction using the internal table described above is It works to make the change in light and dark stand out. Accordingly, the correction using the upper left edge table and the lower right edge table is opposite to the correction using the internal table.
10 印刷装置
11 外部I/F装置
12 操作表示盤
13 給紙機構
14 印刷機構
15 DRAM
16 ROM
17 CPU
18 EEPROM
19 ASIC
DESCRIPTION OF SYMBOLS 10 Printing apparatus 11 External I / F apparatus 12 Operation display panel 13 Paper feed mechanism 14 Printing mechanism 15 DRAM
16 ROM
17 CPU
18 EEPROM
19 ASIC
Claims (3)
前記画像データ取得部が取得した画像データの原画像についての拡大倍率を取得する倍率取得部,
前記倍率取得部が取得した拡大倍率により定まる出力画像の座標における補間点の座標値を、前記倍率取得部が取得した拡大倍率に基づいて算出した逆変換倍率を用いて前記原画像の座標における座標値に変換し、原画像の半画素分だけ左側及び上側にずらすことにより補間点を前記原画像の座標上に定義する補間点定義部,
前記補間点定義部が定義した全ての補間点のそれぞれについて、その補間点の周囲にある4個の原画素にて規定される矩形領域の縦方向の距離と横方向の距離とに基づいて、それら4個の原画素からその補間点までの縦方向の逆距離の値と横方向の逆距離の値とを算出する処理を行う逆距離値生成部,
前記補間点定義部が定義した全ての補間点のうち、前記原画像を構成する原画素が占める領域の外側にあって、なおかつ、周囲の4個の原画素の画素値に所定の濃度差がある補間点については、逆距離値と補正逆距離値とを対応付けて記憶する記憶装置から、その補間点のために前記逆距離値生成部が算出した逆距離値に対応する補正逆距離値を読み出して、その逆距離値を補正逆距離値に置換する逆距離値補正部,
前記補間点定義部が定義した全ての補間点のそれぞれについて、その補間点のために前記逆距離値生成部が算出した逆距離値,又は、前記逆距離値補正部によって置換された後の補正逆距離値と、その補間点の周囲の4個の原画素の画素値とに基づいて、その補間点の逆距離加重平均を算出する処理を行う画素値生成部,及び、
前記画素値生成部が前記各補間点について生成した画素値からなる画像データを、拡大画像の画像データとして出力する画像データ出力部
を備えることを特徴とする画素補間装置。 An image data acquisition unit for acquiring, as a processing target, image data of an original image composed of a number of pixels arranged two-dimensionally;
A magnification acquisition unit for acquiring an enlargement magnification for the original image of the image data acquired by the image data acquisition unit;
The coordinates in the coordinates of the original image using the inverse transform magnification calculated based on the magnification of the magnification acquired by the magnification acquisition unit, the coordinate value of the interpolation point in the coordinates of the output image determined by the magnification obtained by the magnification acquisition unit An interpolation point defining unit that defines an interpolation point on the coordinates of the original image by converting it into a value and shifting it to the left and upper sides by half a pixel of the original image ;
For each of all the interpolation points defined by the interpolation point definition unit, based on the vertical distance and the horizontal distance of the rectangular area defined by the four original pixels around the interpolation point, A reverse distance value generation unit for performing processing for calculating a vertical reverse distance value and a horizontal reverse distance value from the four original pixels to the interpolation point;
Out of all the interpolation points defined by the interpolation point definition unit, the pixel values of the surrounding four original pixels are outside the area occupied by the original pixels constituting the original image, and there is a predetermined density difference. For a certain interpolation point, a corrected reverse distance value corresponding to the reverse distance value calculated by the reverse distance value generation unit for the interpolation point from a storage device that stores the reverse distance value and the corrected reverse distance value in association with each other. , And a reverse distance value correction unit that replaces the reverse distance value with a corrected reverse distance value,
For each of all the interpolation points defined by the interpolation point definition unit, the reverse distance value calculated by the reverse distance value generation unit for the interpolation point or the correction after being replaced by the reverse distance value correction unit A pixel value generation unit that performs a process of calculating a reverse distance weighted average of the interpolation point based on the reverse distance value and the pixel values of the four original pixels around the interpolation point; and
A pixel interpolation device comprising: an image data output unit that outputs image data including pixel values generated by the pixel value generation unit for each interpolation point as image data of an enlarged image.
ことを特徴とする請求項1記載の画素補間装置。 For the interpolation point outside the area occupied by the original pixel constituting the original image, the pixel value generation unit uses the interpolation point as the pixel value of the original pixel for calculating the inverse distance weighted average of the interpolation point. 2. The pixel interpolating apparatus according to claim 1, wherein a pixel value of an original pixel inside the pixel and a pixel value of an original pixel inside the pixel are further used.
二次元的に配列された多数の画素により構成される原画像の画像データを処理対象として取得する画像データ取得手段,
前記画像データ取得手段によって取得された画像データの原画像についての拡大倍率を取得する倍率取得手段,
前記倍率取得手段によって取得された拡大倍率により定まる出力画像の座標における補間点の座標値を、前記倍率取得手段が取得した拡大倍率に基づいて算出した逆変換倍率を用いて前記原画像の座標における座標値に変換し、原画像の半画素分だけ左側及び上側にずらすことにより補間点を前記原画像の座標上に定義する補間点定義手段,
前記補間点定義手段によって定義された全ての補間点のそれぞれについて、その補間点の周囲にある4個の原画素にて規定される矩形領域の縦方向の距離と横方向の距離とに基づいて、それら4個の原画素からその補間点までの縦方向の逆距離の値と横方向の逆距離の値とを算出する処理を行う逆距離値生成手段,
前記補間点定義手段によって定義された全ての補間点のうち、前記原画像を構成する原画素が占める領域の外側にあって、なおかつ、周囲の4個の原画素の画素値に所定の濃度差がある補間点については、逆距離値と補正逆距離値とを対応付けて記憶する記憶装置から、その補間点のために前記逆距離値生成手段によって算出された逆距離値に対応する補正逆距離値を読み出して、その逆距離値を補正逆距離値に置換する逆距離値補正手段,
前記補間点定義手段によって定義された全ての補間点のそれぞれについて、その補間点のために前記逆距離値生成手段によって算出された逆距離値,又は、前記逆距離値補正手段によって置換された後の補正逆距離値と、その補間点の周囲の4個の原画素の画素値とに基づいて、その補間点の逆距離加重平均を算出する処理を行う画素値生成手段,及び、 前記画素値生成手段によって前記各補間点について生成された画素値からなる画像データを、拡大画像の画像データとして出力する画像データ出力手段
として機能させる
ことを特徴とする画素補間プログラム。 Computer
Image data acquisition means for acquiring, as a processing target, image data of an original image composed of a plurality of pixels arranged two-dimensionally;
A magnification acquisition means for acquiring an enlargement magnification for the original image of the image data acquired by the image data acquisition means;
The coordinate value of the interpolation point in the coordinates of the output image determined by the magnification obtained by the magnification obtaining unit is calculated using the inverse transformation magnification calculated based on the magnification obtained by the magnification obtaining unit in the coordinates of the original image. Interpolation point defining means for converting into coordinate values and defining an interpolation point on the coordinates of the original image by shifting to the left and upper sides by half a pixel of the original image ,
For each of all the interpolation points defined by the interpolation point defining means, based on the vertical distance and the horizontal distance of the rectangular area defined by the four original pixels around the interpolation point. Reverse distance value generating means for performing processing for calculating the value of the reverse distance in the vertical direction and the value of the reverse distance in the horizontal direction from the four original pixels to the interpolation point;
Of all the interpolation points defined by the interpolation point defining means, outside the area occupied by the original pixels constituting the original image, and a predetermined density difference between the pixel values of the four surrounding original pixels For a certain interpolation point, a corrected inverse corresponding to the inverse distance value calculated by the inverse distance value generating means for the interpolation point from the storage device storing the inverse distance value and the corrected inverse distance value in association with each other. A reverse distance value correcting means for reading out the distance value and replacing the reverse distance value with a corrected reverse distance value;
After all of the interpolation points defined by the interpolation point defining means are replaced by the inverse distance value calculated by the inverse distance value generating means for the interpolation point or by the inverse distance value correcting means. A pixel value generating means for performing a process of calculating a reverse distance weighted average of the interpolation point based on the corrected reverse distance value of the interpolation point and the pixel values of the four original pixels around the interpolation point; and the pixel value A pixel interpolation program that functions as image data output means for outputting image data composed of pixel values generated for each interpolation point by the generating means as image data of an enlarged image.
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2005079561A JP4470775B2 (en) | 2005-03-18 | 2005-03-18 | Pixel interpolation device and pixel interpolation program |
| US11/378,451 US7826686B2 (en) | 2005-03-18 | 2006-03-20 | Pixel interpolation apparatus and pixel interpolation program product |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2005079561A JP4470775B2 (en) | 2005-03-18 | 2005-03-18 | Pixel interpolation device and pixel interpolation program |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2006262306A JP2006262306A (en) | 2006-09-28 |
| JP4470775B2 true JP4470775B2 (en) | 2010-06-02 |
Family
ID=37101016
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2005079561A Expired - Fee Related JP4470775B2 (en) | 2005-03-18 | 2005-03-18 | Pixel interpolation device and pixel interpolation program |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP4470775B2 (en) |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109919842A (en) * | 2019-01-28 | 2019-06-21 | 努比亚技术有限公司 | Image amplification control method, terminal and computer readable storage medium |
| CN113284050A (en) * | 2021-06-25 | 2021-08-20 | 江苏新通达电子科技股份有限公司 | Image pixel value model, high-resolution display method and system and automobile instrument |
| JP7845109B2 (en) * | 2022-08-22 | 2026-04-14 | セイコーエプソン株式会社 | Image processing device, printing system, and image processing method |
-
2005
- 2005-03-18 JP JP2005079561A patent/JP4470775B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2006262306A (en) | 2006-09-28 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP5094601B2 (en) | Image processing apparatus, image processing method, and program | |
| JP5493438B2 (en) | Projector and projected image correction program | |
| US20140177010A1 (en) | Image scanning apparatus, image compensation method and computer-readable recording medium | |
| JP5388559B2 (en) | Image processing apparatus, image processing method, program for executing image processing method, and storage medium | |
| JP4470775B2 (en) | Pixel interpolation device and pixel interpolation program | |
| JP2006262305A (en) | Pixel interpolation device and pixel interpolation program | |
| US7826686B2 (en) | Pixel interpolation apparatus and pixel interpolation program product | |
| JP4274238B2 (en) | Image processing apparatus, image processing method, and computer program | |
| JP6985931B2 (en) | An image processing apparatus, an image processing program, an image processing method, and an image forming apparatus including the image processing apparatus. | |
| JP5340021B2 (en) | Image processing apparatus, image processing method, and program | |
| JP4687667B2 (en) | Image processing program and image processing apparatus | |
| JP7541862B2 (en) | Image processing device and image processing method | |
| JP6444049B2 (en) | Image processing apparatus, method, and program | |
| JP5134585B2 (en) | Scaling image generating apparatus and scaling image generating method | |
| JP4710508B2 (en) | Image processing program and image processing apparatus | |
| JP4345027B2 (en) | Image processing program and image processing apparatus | |
| JP4407218B2 (en) | Medium storing image processing program, image processing apparatus, and image processing method | |
| JP2016095667A (en) | Image processing device and electronics apparatus | |
| JP2008300974A (en) | Data interpolating method, image enlarging/reducing method, and image forming apparatus | |
| JP6157234B2 (en) | Image processing apparatus, image processing method, and program | |
| JP2000076430A (en) | Image data interpolation device, image data interpolation method, and medium recording image data interpolation program | |
| JP2012205190A (en) | Image processing apparatus and program | |
| JP4353234B2 (en) | Image processing program and image processing apparatus | |
| JP2011135302A (en) | Image processor, and image processing program | |
| JP2009265896A (en) | Image processor |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20071115 |
|
| RD03 | Notification of appointment of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7423 Effective date: 20071207 |
|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20080222 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20091006 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20091124 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20100115 |
|
| TRDD | Decision of grant or rejection written | ||
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20100209 |
|
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20100222 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130312 Year of fee payment: 3 |
|
| R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140312 Year of fee payment: 4 |
|
| LAPS | Cancellation because of no payment of annual fees |