JP2004288198A - Expansion/reduction device and method of image data - Google Patents

Expansion/reduction device and method of image data Download PDF

Info

Publication number
JP2004288198A
JP2004288198A JP2004096463A JP2004096463A JP2004288198A JP 2004288198 A JP2004288198 A JP 2004288198A JP 2004096463 A JP2004096463 A JP 2004096463A JP 2004096463 A JP2004096463 A JP 2004096463A JP 2004288198 A JP2004288198 A JP 2004288198A
Authority
JP
Japan
Prior art keywords
pixel
value
pixels
input
magnification
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.)
Granted
Application number
JP2004096463A
Other languages
Japanese (ja)
Other versions
JP3962029B2 (en
Inventor
Koji Urasawa
康二 浦沢
Hideki Miura
英樹 三浦
Kazuhiko Ito
和彦 伊東
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Oki Electric Industry Co Ltd
Original Assignee
Oki Data Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oki Data Corp filed Critical Oki Data Corp
Priority to JP2004096463A priority Critical patent/JP3962029B2/en
Publication of JP2004288198A publication Critical patent/JP2004288198A/en
Application granted granted Critical
Publication of JP3962029B2 publication Critical patent/JP3962029B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Image Processing (AREA)
  • Studio Circuits (AREA)
  • Editing Of Facsimile Originals (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To execute a reduction process for an input image with a small amount of memory. <P>SOLUTION: The input image is divided into a plurality of small regions; each input image on the boundary between the small regions is included in any of the small regions according to a certain rule; and a pixel value of output pixels is calculated based on the output pixels in each small area. The calculation is carried out based on the pixel value obtained by sampling the input pixels in the small area at a predetermined interval. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は、情報処理装置を用いて表示したり印刷したりする画像データを、任意の倍率で拡大しあるいは縮小するために利用される、画像データの拡大/縮小装置及び方法に関する。   The present invention relates to an image data enlargement / reduction apparatus and method used for enlarging or reducing image data to be displayed or printed using an information processing apparatus at an arbitrary magnification.

パーソナルコンピュータやプリンタ、その他各種の情報処理装置において、画像データの解像度が相違するアプリケーション間で画像データを転送する場合には、画素数を増減して解像度を調整する画像データの拡大/縮小処理が行われる。また、画素数の多い画像データをメモリに記憶する場合、メモリの記憶容量削減のために、画素数を減少させる画像データの縮小処理が行われる。画像データを通信線を介して送受信する場合の送信速度スピードアップを図るためにも、画素数を減少させる画像データの縮小処理を行う場合がある。   When transferring image data between applications having different image data resolutions in personal computers, printers, and other various information processing devices, image data enlargement / reduction processing for adjusting the resolution by increasing or decreasing the number of pixels is performed. Done. When storing image data having a large number of pixels in the memory, a reduction process of the image data for reducing the number of pixels is performed to reduce the storage capacity of the memory. In order to increase the transmission speed when transmitting and receiving image data via a communication line, a reduction process of image data for reducing the number of pixels may be performed.

ここで、例えば、画像データの縦横の画素数をそれぞれ整数倍に拡大する場合には、各画素をその倍率分だけ縦横方向にコピーして画素数を増やす。従って、例えば各画素はX方向にN倍、Y方向にM倍だけコピーされてN×M倍の画素から成る画像データが得られる。
一方、1.5倍とか2.5倍というように、いずれかの方向に整数倍にならない倍率で拡大/縮小を行う場合には、コピーをして数を増やす画素と、コピーをしない画素を適当に混在させる。
Here, for example, when the number of pixels in the vertical and horizontal directions of the image data is respectively enlarged to an integral multiple, the number of pixels is increased by copying each pixel in the vertical and horizontal directions by the magnification. Therefore, for example, each pixel is copied N times in the X direction and M times in the Y direction to obtain image data composed of N × M pixels.
On the other hand, when performing enlargement / reduction at a magnification that does not become an integral multiple in either direction, such as 1.5 times or 2.5 times, a pixel whose number is increased by copying and a pixel which is not copied are determined. Mix appropriately.

画素をコピーする場合、同一の画素値の画素を隣に増やしていく方法がもっとも単純な方法である。しかしながら、それでは、中間調を表現する画像の場合に、不自然な濃淡が発生して、画質が劣化する。特に、整数倍にならない倍率で画像データの拡大/縮小を行う場合に、その傾向が著しい。
そこで、出力画像中のコピーによって増加した画素の画素値が互いに滑らかに変化するように、周辺の複数の画素を参照しながら適当な演算処理を行う。この方法は、リサンプリング処理と呼ばれ、各画素の画素値の計算には一次補間法や最近傍法等が採用される。
When copying pixels, the simplest method is to increase the number of pixels having the same pixel value next to each other. However, in that case, in the case of an image expressing a halftone, unnatural shading occurs and the image quality deteriorates. This tendency is particularly remarkable when image data is enlarged / reduced at a magnification that does not become an integral multiple.
Therefore, appropriate arithmetic processing is performed with reference to a plurality of peripheral pixels so that the pixel values of the pixels increased by copying in the output image change smoothly with each other. This method is called a resampling process, and a primary interpolation method, a nearest neighbor method, or the like is used for calculating a pixel value of each pixel.

ところで、上記のような従来の技術には、次のような解決すべき課題があった。
上記のようにして、入力する画像データをX軸方向やY軸方向に任意の実数倍率、即ち整数倍でない倍率で拡大/縮小処理しようとするときには、一次補間法や最近傍法による画素値の計算が行われる。このとき、予め画素値を求めるべき出力画素の周辺に存在する入力画素の画素値を、計算に利用できるように、準備しておかなければならない。従って、画像データをほぼ1ページ分あるいは画素値の参照に必要な分だけ読み取って、バッファメモリに予め格納し、その後再び同じ画像データを順に受け入れて処理をする必要がある。これでは、画像データをそのまま逐次処理をして出力を得るというわけにはいかない。
従って、従来の技術には、各種のシステムにおいてメモリを効率的に使用するという目的に反し、また処理時間も長くなるという問題があった。
By the way, the conventional techniques as described above have the following problems to be solved.
As described above, when the input image data is to be enlarged / reduced in the X-axis direction or the Y-axis direction at an arbitrary real magnification, that is, at a magnification other than an integral multiple, the pixel value of the primary interpolation method or the nearest neighbor method is used. A calculation is made. At this time, the pixel values of the input pixels existing around the output pixel whose pixel value is to be obtained must be prepared in advance so that they can be used for the calculation. Therefore, it is necessary to read almost one page of image data or an amount necessary for referring to a pixel value, store the image data in a buffer memory in advance, and then receive and process the same image data again in order. In this case, it is not possible to obtain the output by sequentially processing the image data as it is.
Therefore, the prior art has a problem that the processing time is long, contrary to the object of efficiently using the memory in various systems.

本発明は以上の点を解決するため次の構成を採用する。
〈構成1〉
入力画像データを形成する複数の入力画素を所定の倍率で複数の出力画素に縮小して出力画像データを生成する画像データの拡大/縮小方法において、前記入力画像データを小領域に分割し、小領域に含まれる入力画素と小領域の境界上の入力画素とを区別して認識し、前記小領域内の入力画素値と認識された境界上の入力画素値とに基づいて小領域内の入力画素値を演算して出力画素値を求めることを特徴とする画像データの拡大/縮小方法。
The present invention employs the following configuration to solve the above points.
<Configuration 1>
In a method of enlarging / reducing image data by generating a plurality of output pixels by reducing a plurality of input pixels forming input image data into a plurality of output pixels at a predetermined magnification, the input image data is divided into small areas. The input pixels included in the area and the input pixels on the boundary of the small area are distinguished and recognized, and the input pixels in the small area are determined based on the input pixel value in the small area and the input pixel value on the recognized boundary. A method for enlarging / reducing image data, comprising calculating an output pixel value by calculating a value.

〈構成2〉
構成1において、前記入力画素値の演算は、前記小領域内の入力画素を所定の間隔でサンプリングして得られた入力画素値により行われることを特徴とする画像データの拡大/縮小方法。
<Configuration 2>
In the configuration 1, the calculation of the input pixel value is performed based on an input pixel value obtained by sampling input pixels in the small area at a predetermined interval.

〈構成3〉
構成2において、前記小領域内の入力画素をサンプリングするサンプリング領域を指定し、サンプリング領域内の画素値を演算することにより出力画素値を求めることを特徴とする画像データの拡大/縮小方法。
<Configuration 3>
In a second aspect, there is provided an image data enlargement / reduction method, wherein a sampling area for sampling an input pixel in the small area is designated, and an output pixel value is obtained by calculating a pixel value in the sampling area.

〈構成4〉
入力画像データを形成する複数の入力画素を所定の倍率で複数の出力画素に縮小して出力画像を生成する画像データの拡大/縮小装置において、前記入力画像を複数の入力画素を含む小領域に区分し、隣接する小領域間を仕切る境界線上に位置する入力画素を検知して該入力画素を含むいずれかの小領域を一定条件に基づいて決定する境界線画素判定手段と、前記各小領域に含まれる複数の入力画素の各画素値に基づいて出力画素の画素値を演算する画素値演算手段と、を有することを特徴とする画像データの拡大/縮小装置。
<Configuration 4>
In an image data enlarging / reducing apparatus for generating an output image by reducing a plurality of input pixels forming input image data to a plurality of output pixels at a predetermined magnification, the input image is reduced to a small area including the plurality of input pixels. A boundary line pixel determining means for detecting an input pixel positioned on a boundary line that separates adjacent small regions and determining any of the small regions including the input pixel based on a predetermined condition; And a pixel value calculating means for calculating a pixel value of an output pixel based on each pixel value of a plurality of input pixels included in the image data.

〈構成5〉
構成4において、 前記画素値演算手段は、前記小領域の複数の入力画素をサンプリングし、サンプリングした入力画素に基づいて前記出力画素の画素値を演算することを特徴とする画像データの拡大/縮小装置。
<Configuration 5>
In the fourth aspect, the pixel value calculating means samples a plurality of input pixels in the small area and calculates a pixel value of the output pixel based on the sampled input pixels. apparatus.

〈構成6〉
構成5において、前記画素値演算手段は、前記小領域にサンプリング領域を設定し、該サンプリング領域内の入力画素に基づいて前記出力画素の画素値を演算することを特徴とする画像データの拡大/縮小装置。
<Configuration 6>
In the fifth aspect, the pixel value calculating means sets a sampling area in the small area and calculates a pixel value of the output pixel based on an input pixel in the sampling area. Reduction device.

〈構成7〉
入力画像を、主走査方向に平行な境界と副走査方向に平行な境界により小領域に等分割し、各領域中に含まれる画素の画素値を平均して出力画素の画素値を求めることにより、入力画像を縮小した出力画像を得るものにおいて、
入力画像を構成する画素の画素値を主走査方向にみて1ライン分受け入れて保持する入力画像バッファと、
前記入力画像バッファに受け入れた各画素の画素値を主走査方向に順に累積していき、副走査方向に平行な境界の手前で、この境界に最も近い境界画素を検出したときまでに求められた、同一小領域内の画素値の合計を、小領域単位で保持する途中結果バッファと、
副走査方向に1ライン分ずつ入力画像を処理していき、主走査方向に平行な境界の手前で、この境界に最も近い境界画素を検出したときまでに求められた各小領域内の画素値の合計を、途中結果バッファから読みだして、各小領域に含まれる画素数で割って、小領域毎の画素値の平均値を求め、その平均値を出力画像の画素の画素値とする制御部を備えたことを特徴とする画像データの拡大/縮小装置。
<Configuration 7>
The input image is equally divided into small regions by a boundary parallel to the main scanning direction and a boundary parallel to the sub-scanning direction, and the pixel values of the pixels included in each region are averaged to obtain the pixel value of the output pixel. , To obtain an output image obtained by reducing the input image,
An input image buffer that receives and holds one line of pixel values of pixels constituting the input image when viewed in the main scanning direction;
The pixel value of each pixel received in the input image buffer is sequentially accumulated in the main scanning direction, and is obtained before a boundary parallel to the sub-scanning direction and before a boundary pixel closest to this boundary is detected. An intermediate result buffer that holds the sum of pixel values in the same small area in small area units,
The input image is processed one line at a time in the sub-scanning direction, and a pixel value in each small area obtained before a boundary pixel closest to the boundary before the boundary parallel to the main scanning direction is detected. Is read from the intermediate result buffer, divided by the number of pixels included in each small area, an average value of the pixel values of each small area is obtained, and the average value is set as the pixel value of the pixel of the output image. A device for enlarging / reducing image data, comprising a unit.

〈構成8〉
構成7において、入力画像を分割した小領域に含まれる画素のうちの一部をサンプリングして、それらの画素値を集計するために、サンプリングの間隔を設定して保持するパラメータ保持部を設け、途中結果バッファは、前記パラメータ保持部を参照して、サンプリング間隔ごとに画素値を集計して保持することを特徴とする画像データの拡大/縮小装置。
<Configuration 8>
In the configuration 7, a parameter holding unit that sets and holds a sampling interval is provided in order to sample a part of the pixels included in the small region obtained by dividing the input image, and collect the pixel values, An image data enlargement / reduction device, wherein the intermediate result buffer refers to the parameter holding unit and totalizes and holds pixel values at each sampling interval.

〈構成9〉
構成8において、入力画像を分割した小領域に含まれる画素を、主走査方向に連続した任意の数の画素を含む複数のサンプリング領域で区分し、そのサンプリング領域毎に画素値を集計するために、サンプリング合計カウンタを設け、制御部は、サンプリング領域ごとに集計された画素値とそのサンプリング領域に含まれる画素数により、サンプリング領域における画素値の平均値を求め、途中結果バッファは、サンプリング領域における画素値の平均値を累積した、同一小領域内の画素値の合計を、小領域単位で保持することを特徴とする画像データの拡大/縮小装置。
<Configuration 9>
In the configuration 8, in order to divide the pixels included in the small region obtained by dividing the input image into a plurality of sampling regions including an arbitrary number of pixels that are continuous in the main scanning direction, and to collect pixel values for each of the sampling regions, , A sampling total counter is provided, and the control unit obtains an average value of pixel values in the sampling region based on the pixel values totalized for each sampling region and the number of pixels included in the sampling region. An apparatus for enlarging / reducing image data, wherein a sum of pixel values in the same small area, in which average values of pixel values are accumulated, is held in small area units.

〈構成10〉
処理対象となる整数値を実数倍した乗算結果のうちの小数点以下N桁の数値を保持する第1の記憶部と、前記実数の少数点以下N桁の数値を記憶する第2の記憶部と、前記第1の記憶部に格納された数値と第2の記憶部に格納された数値とを比較し、前者の数値が後者の数値以上のときは、前記乗算結果の整数部分を演算結果として出力し、前者の数値が後者の数値に満たないときは、前記乗算結果の少数点以下を切り上げた結果を演算結果として出力する演算部を備えたことを特徴とする整数倍率演算器。
<Configuration 10>
A first storage unit that holds a value of N digits after the decimal point in a multiplication result obtained by multiplying an integer value to be processed by a real number, and a second storage unit that stores a number of N digits after the decimal point of the real number Comparing the numerical value stored in the first storage unit with the numerical value stored in the second storage unit, and when the former numerical value is greater than or equal to the latter numerical value, the integer part of the multiplication result is used as the operation result. An integer magnification arithmetic unit, comprising: an arithmetic unit for outputting, and when the former numerical value is less than the latter numerical value, outputting a result obtained by rounding up the decimal point of the multiplication result below a decimal point as an arithmetic result.

〈構成11〉
入力画像中の各画素の座標値と、入力画像の拡大倍率を表す実数との積を求めて、この積の結果を越えない整数を、当該画素のコピー回数に決定して、出力画像データを得るものにおいて、前記積の結果のうち、小数点以下N桁により表される数値のみを保持し、小数点以上の数値をオーバーフローさせて無効にするレジスタを備え、前記積を求める演算を実行する度にこのレジスタに保持される数値と、前記拡大倍率を表す実数の少数点以下N桁により表される数値とを比較して、前者が後者以上のときは、前記積の結果のうち少数点以下を切り捨てた値を前記コピー回数に決定し、前者が後者未満のときは、前記積の結果の少数点以下を切り上げた値を前記コピー回数に決定する倍率計算部を備えたことを特徴とする画像データの拡大/縮小装置。
<Configuration 11>
A product of the coordinate value of each pixel in the input image and a real number representing the magnification of the input image is obtained, and an integer not exceeding the result of the product is determined as the number of times of copying the pixel, and the output image data is determined. In the obtaining, a register that holds only a numerical value represented by N digits after the decimal point among the results of the product, and that invalidates the numerical value after the decimal point by overflowing, is provided each time an operation for obtaining the product is performed. The numerical value held in this register is compared with the numerical value represented by N digits below the decimal point of the real number representing the enlargement magnification. An image characterized by comprising a magnification calculator for determining the value of the copy to be the number of copies, and when the former is less than the latter, to determine the value of the product obtained by rounding up the decimal point below the decimal point to the number of copies. Expansion of data / Small devices.

〈構成12〉
入力画像を所定の実数倍率で拡大して出力画像を得て、入力画素を出力画像上にマッピングし、マッピングされた出力画素によって作られる矩形の領域を近傍エリアとして、前記近傍エリアに含まれる、出力画素の座標軸方向に並んだ出力画素の数を求める場合に、前記近傍エリアの出力画像中の位置を示す座標値と、前記拡大倍率との積を求めて、この積の結果を越えない整数を、該当する近傍エリア中の前記出力画素の数に決定するものにおいて、前記積の結果のうち、小数点以下N桁により表される数値のみを保持し、小数点以上の数値をオーバーフローさせて無効にするレジスタを備え、前記積を求める演算を実行する度にこのレジスタに保持される数値と、前記拡大倍率を表す実数の少数点以下N桁により表される数値とを比較して、前者が後者以上のときは、前記積の結果のうち少数点以下を切り捨てた値を前記出力画素の数に決定し、前者が後者未満のときは、前記積の結果の少数点以下を切り上げた値を前記出力画素の数に決定する倍率計算部を備えたことを特徴とする画像データの拡大/縮小装置。
<Configuration 12>
An output image is obtained by enlarging the input image at a predetermined real number magnification, and the input pixels are mapped on the output image, and a rectangular area created by the mapped output pixels is included in the nearby area as a nearby area. When calculating the number of output pixels arranged in the coordinate axis direction of the output pixels, a product of a coordinate value indicating the position of the neighboring area in the output image and the magnification is obtained, and an integer not exceeding the result of the product Is determined to be the number of the output pixels in the corresponding neighboring area. In the result of the product, only the numerical value represented by N digits after the decimal point is retained, and the numerical value after the decimal point is overflowed and invalidated. Each time the calculation for obtaining the product is performed, a numerical value held in this register is compared with a numerical value represented by N digits below a decimal point of a real number representing the magnification. If the former is greater than or equal to the latter, a value obtained by rounding down the decimal point of the result of the product is determined as the number of the output pixels.If the former is less than the latter, the decimal point of the result of the product is rounded up. An image data enlargement / reduction apparatus, comprising: a magnification calculator for determining a value of the output pixel to the number of the output pixels.

〈構成13〉
構成12において、倍率計算部の出力の初期値を予め設定した定数としたことを特徴とする画像データの拡大/縮小装置。
<Configuration 13>
The image data enlargement / reduction apparatus according to configuration 12, wherein the initial value of the output of the magnification calculator is a preset constant.

〈構成14〉
入力画像中の各画素の座標値と、入力画像の拡大倍率を表す実数との積を求めて、この積の結果を越えない整数を、当該画素のコピー回数に決定して、出力画像データを得るものにおいて、前記積の結果のうち、小数点以下N桁により表される数値のみを保持し、小数点以上の数値をオーバーフローさせて無効にするレジスタを備え、前記積を求める演算を実行する度にこのレジスタに保持される数値と、前記拡大倍率を表す実数の少数点以下N桁により表される数値とを比較して、前者が後者以上のときは、前記積の結果のうち少数点以下を切り捨てた値を前記コピー回数に決定し、前者が後者未満のときは、前記積の結果の少数点以下を切り上げた値を前記コピー回数に決定する倍率計算部と、出力画像の端部が印字可能領域をはみ出る場合に、出力画像の端部の拡大倍率を印字可能領域の情報に基づいて演算し、前記コピー回数の初期値とするクリッピング計算装置を備えたことを特徴とする画像データの拡大/縮小装置。
<Configuration 14>
A product of the coordinate value of each pixel in the input image and a real number representing the magnification of the input image is obtained, and an integer not exceeding the result of the product is determined as the number of times of copying the pixel, and the output image data is determined. In the obtaining, a register that holds only a numerical value represented by N digits after the decimal point among the results of the product, and that invalidates the numerical value after the decimal point by overflowing, is provided each time an operation for obtaining the product is performed. The numerical value held in this register is compared with the numerical value represented by N digits below the decimal point of the real number representing the enlargement magnification. Determine the truncated value as the number of copies, if the former is less than the latter, a magnification calculation unit that determines the value of the product rounded up to the nearest decimal point as the number of copies, and the end of the output image is printed Extrudes out of possible area The case, calculated on the basis of the magnification of the end of the output image information of the printable area, enlargement / reduction device of the image data, characterized in that it comprises clipping computing device as an initial value of the number of times of copying.

本発明によれば、入力画像を小領域に区分し、小領域間の境界上の入力画素を一定規則でいずれかの小領域に含ませた上で各小領域毎に入力画素に基づいて出力画素値を演算するようにしたので、少ないメモリで入力画像の縮小処理を行うことができる。   According to the present invention, an input image is divided into small areas, input pixels on boundaries between the small areas are included in any of the small areas according to a certain rule, and output is performed based on the input pixels for each small area. Since the pixel value is calculated, the input image can be reduced with a small memory.

以下、本発明の実施の形態を具体例を用いて説明する。
〈具体例1〉
図1は、具体例1による拡大/縮小処理部の動作説明図である。
図の(a)は本発明の方法に使用する拡大/縮小テーブルを示し、(b)は入力画像データと出力画像データとを示している。
例えば入力画像データ3のX方向には(x2/x1)倍、Y方向には(y2/y1)倍に画像を拡大するとき、図の(b)に示すように、各画素をそれぞれX方向とY方向に所定の回数コピーする。画素値はそのままでコピーする。コピーする画素数は入力画像の画素の位置によって異なる。こうして、整数倍でない倍率の拡大を実現する。ここで、こうした拡大/縮小処理を効率良く実行するために、各画素毎の該当する方向の倍率を示す拡大/縮小テーブルを用意する。
Hereinafter, embodiments of the present invention will be described using specific examples.
<Specific example 1>
FIG. 1 is an explanatory diagram of the operation of the enlargement / reduction processing unit according to the first example.
FIG. 3A shows an enlargement / reduction table used in the method of the present invention, and FIG. 3B shows input image data and output image data.
For example, when the image is enlarged by (x2 / x1) times in the X direction and by (y2 / y1) times in the Y direction of the input image data 3, as shown in FIG. And a predetermined number of copies in the Y direction. The pixel values are copied as they are. The number of pixels to be copied differs depending on the positions of the pixels of the input image. In this way, enlargement of a magnification that is not an integral multiple is realized. Here, in order to efficiently execute such enlargement / reduction processing, an enlargement / reduction table indicating a magnification in a corresponding direction for each pixel is prepared.

図1の(a)に示した左側のテーブルがX方向の倍率を示し、右側のテーブルはY方向の倍率を示す。例えば入力画像データの第0列、第0行の画素、即ち(b)に1番と番号表示した画素は、これらのテーブルを参照すると、X方向に2倍、Y方向に3倍だけコピーされる。入力画像データの2行目の4番と番号表示した画素はX方向に2倍、Y方向に4倍コピーされる。
画像データは通常ビットストリームとして扱われ、1画素分ずつX軸方向(主走査方向)に処理し、その処理をY軸方向(副走査方向)に繰り返す。以上のような拡大/縮小テーブルを新たに設けたのは、入力画像データ3をこのように走査方向にシリアルに受け入れて、そのまま順に拡大/縮小処理することを可能にするためである。
The left table shown in FIG. 1A shows the magnification in the X direction, and the right table shows the magnification in the Y direction. For example, the pixels in the 0th column and the 0th row of the input image data, that is, the pixels numbered 1 in (b) are copied twice in the X direction and three times in the Y direction with reference to these tables. You. The pixels indicated as No. 4 in the second row of the input image data are copied twice in the X direction and four times in the Y direction.
The image data is usually handled as a bit stream, and is processed one pixel at a time in the X-axis direction (main scanning direction), and the processing is repeated in the Y-axis direction (sub-scanning direction). The reason why the enlargement / reduction table as described above is newly provided is that it is possible to serially receive the input image data 3 in the scanning direction in this way and perform the enlargement / reduction processing in that order.

図2には、具体例1による画像データ拡大/縮小装置のブロック図を示す。
図の装置は、外部記憶装置5に記憶された入力画像データを受け入れて、この画像データを拡大処理あるいは縮小処理するための装置である。拡大/縮小装置6には、現ラインバッファ7、拡大/縮小テーブル8、拡大/縮小処理部9及び出力画像フレームバッファ11が設けられている。現ラインバッファ7は、外部記憶装置5から走査方向に入力した画像データを1ラインずつ格納し保持するためのメモリである。拡大/縮小テーブル8には、図1(a)に示したX方向の倍率テーブル1XやY方向の倍率テーブル1Y等が格納されている。拡大/縮小処理部9は、拡大/縮小テーブル8を参照しながら図1(b)に示したような拡大/縮小処理を行う部分である。拡大/縮小処理後の画像データは、出力画像フレームバッファ11に格納される。出力画像フレームバッファ11には図示しない外部装置が接続され、そこに拡大/縮小された画像データが転送される。
FIG. 2 is a block diagram of an image data enlarging / reducing device according to the first embodiment.
The illustrated device is a device for receiving input image data stored in the external storage device 5 and performing enlargement processing or reduction processing on the image data. The enlargement / reduction device 6 includes a current line buffer 7, an enlargement / reduction table 8, an enlargement / reduction processing unit 9, and an output image frame buffer 11. The current line buffer 7 is a memory for storing and holding image data input from the external storage device 5 in the scanning direction line by line. The enlargement / reduction table 8 stores the magnification table 1X in the X direction and the magnification table 1Y in the Y direction shown in FIG. The enlargement / reduction processing unit 9 is a part that performs the enlargement / reduction processing as shown in FIG. 1B while referring to the enlargement / reduction table 8. The image data after the enlargement / reduction processing is stored in the output image frame buffer 11. An external device (not shown) is connected to the output image frame buffer 11, to which the enlarged / reduced image data is transferred.

ここで、画像データを整数倍で格納した場合と、整数倍以外の倍率で格納した場合とを比較して説明する。
図3に、整数倍率の拡大法説明図を示す。
図に示すように、例えばオリジナルの画素2が存在する場合、X方向に2倍、Y方向に2倍の拡大を行おうとすれば、図の(b)に示すようになる。また、X方向に3倍、Y方向に3倍の拡大を行おうとすれば(c)に示すようになり、X方向に4倍、Y方向に4倍の拡大を行おうとすれば(d)に示すようになる。もちろん、X方向とY方向の倍率を自由に変更しても同様の結果となる。整数倍ではすべての入力画素にこれと同一の処理を施す。
Here, a case where image data is stored at an integral multiple and a case where image data is stored at a magnification other than the integral multiple will be described in comparison.
FIG. 3 is a diagram illustrating an enlargement method of an integer magnification.
As shown in the figure, for example, when an original pixel 2 is present, if an attempt is made to double the size in the X direction and double the size in the Y direction, the result is as shown in FIG. Also, if an attempt is made to enlarge by a factor of 3 in the X direction and by a factor of 3 in the Y direction, the result is as shown in FIG. It becomes as shown in. Of course, the same result is obtained even if the magnification in the X direction and the Y direction is freely changed. At an integer multiple, the same processing is performed on all input pixels.

一方、図4には、最近傍法による拡大/縮小処理説明図を示す。
この例では、X方向とY方向と、それぞれ任意の実数倍率で画像データを拡大するために、画素毎にそのコピー倍率を変えている。例えば、図に示す(1)の画素は出力画像データ4において、X方向に3倍、Y方向に2倍になるようにコピーされている。また、(2)の画素は、X方向に2倍、Y方向に2倍となるようコピーされている。更に(5)の画素は、X方向に3倍、Y方向に3倍となるようにコピーされている。こうした組合せによって、全体として例えば1.2倍とか2.3倍といった拡大処理が可能となる。縮小処理としては、例えば出力画像データ4から入力画像データ3の方向への縮小が考えられる。このような場合には、1個の出力画素を得るたびに、続く画素をX方向に何個、Y方向に何個間引くかといった処理となる。
On the other hand, FIG. 4 shows an explanatory diagram of the enlargement / reduction processing by the nearest neighbor method.
In this example, the copy magnification is changed for each pixel in order to enlarge the image data at an arbitrary real magnification in the X and Y directions. For example, the pixel (1) shown in the figure is copied in the output image data 4 so as to be three times in the X direction and twice in the Y direction. The pixel of (2) is copied so as to be twice as large in the X direction and twice as much in the Y direction. Further, the pixel of (5) is copied so as to be three times in the X direction and three times in the Y direction. By such a combination, enlargement processing such as 1.2 times or 2.3 times as a whole is possible. As the reduction processing, for example, reduction in the direction from the output image data 4 to the input image data 3 can be considered. In such a case, each time one output pixel is obtained, processing is performed such as how many consecutive pixels are thinned out in the X direction and how many pixels are thinned out in the Y direction.

本発明の具体例1による処理では、入力画像データが図の(1)、(2)、(3)、…という順にシリアルに入力した場合に、直ちに出力画像データ4を得ることができるように図1(a)に示す拡大/縮小テーブルを用意した。   In the process according to the first embodiment of the present invention, when input image data is serially input in the order of (1), (2), (3),... In the drawing, output image data 4 can be obtained immediately. An enlargement / reduction table shown in FIG. 1A was prepared.

図5には、図2に示す装置の動作即ち具体例1の拡大/縮小方法を示すフローチャートを図示した。
まず、ステップS1において、拡大/縮小テーブルの作成を行う。これは拡大/縮小倍率を元に、予め経験的に得られたデータに従ってテーブルの作成を行う処理である。なお、このようなテーブルの内容は、各拡大/縮小倍率毎に予め用意されていてもよいし、その都度計算して作成されるようにしてもよい。また、オペレータが任意の適当な手段で作成し、情報処理装置のメモリ等に格納するようにしてもよい。
FIG. 5 is a flowchart showing the operation of the apparatus shown in FIG. 2, that is, the enlargement / reduction method of the first embodiment.
First, in step S1, an enlargement / reduction table is created. This is a process for creating a table based on data obtained empirically in advance based on the enlargement / reduction magnification. The contents of such a table may be prepared in advance for each enlargement / reduction ratio, or may be calculated and created each time. Further, the information may be created by an operator using any appropriate means and stored in a memory or the like of the information processing apparatus.

次のステップS2において、図2に示す外部記憶装置5から現ラインバッファ7に対し1ライン分のデータ(ビットストリーム)が読み込まれる。次のステップS3では、拡大/縮小処理部9は、拡大/縮小テーブルの縦方向、即ちY方向の倍率テーブルを参照する。更に、ステップS4において、横方向、即ちX方向の倍率テーブルを参照する。こうして、X方向とY方向の画素のコピー回数を認識すると、ステップS5において、入力画像の各画素についてドットコピーが行われる。ドットコピーというのは、同一の画素値のドットを縦方向や横方向にコピーして、必要な数だけ増加させることをいう。次にステップS6において、横方向倍率分をコピーしたかどうかを判断する。こうして、入力画素をX方向にテーブルで指定された数だけコピーする。   In the next step S2, one line of data (bit stream) is read from the external storage device 5 shown in FIG. In the next step S3, the enlargement / reduction processing unit 9 refers to the magnification table in the vertical direction of the enlargement / reduction table, that is, the Y direction. Further, in step S4, the magnification table in the horizontal direction, that is, the X direction is referred to. When the number of copies of the pixels in the X direction and the Y direction is recognized in this way, in step S5, dot copy is performed for each pixel of the input image. Dot copying refers to copying dots of the same pixel value in the vertical and horizontal directions and increasing the required number. Next, in step S6, it is determined whether or not the horizontal magnification has been copied. Thus, the input pixels are copied in the X direction by the number specified in the table.

次に同様の処理をX方向に順に行うために、ステップS7において、現ラインバッファ7中の全ての画素について処理をしたかどうかを判断する。こうして、ステップS4、S5、S6が現ラインバッファ7中の画素数分繰り返される。その処理が終了すれば、ステップS7からステップS8に進み、出力画像の次のラインの処理に進む。即ち、ステップS4、S5、S6、S7の処理が、Y方向の倍率テーブル分だけ繰り返される。この処理が終了すれば、入力画像データ1ライン分のX方向とY方向の拡大処理を終了する。そして、ステップS8から次のステップS9に進み、入力画像データの次のラインについて拡大/縮小処理を実行する。
ステップS2〜ステップS9の処理を入力が画像データのライン数分繰り返すことによって、入力画像データ全ての画素についての拡大/縮小処理を終了する。
Next, in order to perform the same processing sequentially in the X direction, it is determined in step S7 whether or not processing has been performed on all the pixels in the current line buffer 7. Thus, steps S4, S5, and S6 are repeated for the number of pixels in the current line buffer 7. When the process is completed, the process proceeds from step S7 to step S8, and proceeds to the process of the next line of the output image. That is, the processing of steps S4, S5, S6, and S7 is repeated by the number of magnification tables in the Y direction. When this process ends, the enlargement process in the X and Y directions for one line of the input image data ends. Then, the process proceeds from step S8 to the next step S9, in which enlargement / reduction processing is executed for the next line of the input image data.
By repeating the processing of steps S2 to S9 for the number of lines of the image data, the enlargement / reduction processing for all the pixels of the input image data is completed.

〈具体例1の効果〉
以上のように、任意の方向に任意の拡大/縮小倍率が設定されている場合に、その方向毎に各画素の拡大/縮小倍率を表示したテーブルを用意すると、入力する画像データを走査方向にシリアルに受け入れながら、順番に拡大/縮小処理を行うことが可能になる。即ち、演算処理の前に、予め入力画像データを1ページ分バッファメモリに格納しておくといった処理を必要とせず、限られたメモリ資源を有効に活用することができる。しかも、画像処理中にはテーブル参照だけで拡大/縮小処理を行うことが可能だから、処理の高速化が実現する。
<Effect of Specific Example 1>
As described above, when an arbitrary enlargement / reduction magnification is set in an arbitrary direction, if a table displaying the enlargement / reduction magnification of each pixel is prepared for each direction, input image data can be set in the scanning direction. Enlargement / reduction processing can be performed sequentially while receiving serially. That is, there is no need to perform a process of previously storing one page of input image data in the buffer memory before the arithmetic processing, and the limited memory resources can be effectively used. In addition, since the enlargement / reduction processing can be performed only by referring to the table during the image processing, the processing can be speeded up.

なお、上記の例では拡大を行うケースのみを示したが、拡大/縮小テーブルの、X方向の倍率の部分にゼロを表示すればその画素は削除され、Y方向の倍率の部分にゼロを表示すれば、そのラインは削除されるといった規則にすることによって、画素やラインを間引く縮小も容易に行える。また、上記拡大/縮小テーブルは、任意の方向に画素数を何倍拡大するかあるいは縮小するかといった情報を示すようなデータであればよく、その表現方法や構成は自由にして差し支えない。   In the above example, only the case where the enlargement is performed is shown. However, if zero is displayed in the magnification portion in the X direction of the enlargement / reduction table, the pixel is deleted and zero is displayed in the magnification portion in the Y direction. Then, by making a rule that the line is deleted, it is possible to easily reduce a pixel or a line by thinning. The enlargement / reduction table may be any data that indicates information such as how many times the number of pixels is enlarged or reduced in an arbitrary direction, and the expression method and configuration may be freely set.

〈具体例2〉
上記の具体例1では、各入力画素に割り振る整数倍率を拡大/縮小テーブルの形で保持することから、倍率や入力画像サイズによってはテーブルのデータ量が比較的大きくなる。この具体例2では、テーブルのデータ量を縮小する方法を提供する。
図6に、モジュロ演算を用いる画像拡大/縮小装置のブロック図を示す。
図の装置は、図2に示した具体例1の装置の拡大/縮小装置6の部分に、倍率演算部13を設けた点を特徴とする。この倍率演算部13には、拡大/縮小テーブル8とモジュロ演算部10が設けられる。なお、この拡大/縮小テーブル8の内容は具体例1の場合と異なり、十分に縮小された内容となる。
<Specific example 2>
In the above specific example 1, since the integer magnification allocated to each input pixel is held in the form of an enlargement / reduction table, the data amount of the table becomes relatively large depending on the magnification and the input image size. In the specific example 2, a method for reducing the data amount of the table is provided.
FIG. 6 shows a block diagram of an image enlargement / reduction apparatus using modulo arithmetic.
The device shown in the figure is characterized in that a magnification calculator 13 is provided in the portion of the enlargement / reduction device 6 of the device of the first embodiment shown in FIG. The magnification calculator 13 includes an enlargement / reduction table 8 and a modulo calculator 10. The contents of the enlargement / reduction table 8 are different from those of the first embodiment and are sufficiently reduced contents.

図7に、拡大/縮小テーブルの冗長性の説明図を示す。
(a)は、例えば図1に示したX方向の倍率テーブル1X、あるいはY方向の倍率テーブル1Yを示す。インデックス(Index)は、列番号または行番号のいずれかを示す。図の(a)の倍率テーブル1Xは、例えば横方向に整数倍(ここでは4倍)の拡大を行うことを示している。しかしながら、このテーブルでは、全ての画素の倍率が4であるから、画素数分の同一内容の倍率表示データがメモリに格納されることになり、実質的に極めて冗長である。(b)には、1.5倍の倍率にしたときのテーブルの内容を示す。この場合、各画素の倍率は1,2,1,2,…というように1と2を交互に繰り返す内容となる。このような規則性のあるデータを全てメモリに保持しておくことも冗長であり、資源の有効利用を妨げる。
FIG. 7 is a diagram for explaining the redundancy of the enlargement / reduction table.
(A) shows, for example, the magnification table 1X in the X direction or the magnification table 1Y in the Y direction shown in FIG. The index (Index) indicates either a column number or a row number. The magnification table 1 </ b> X in (a) of the drawing indicates that the magnification is, for example, an integral multiple (here, four times) in the horizontal direction. However, in this table, since the magnification of all pixels is 4, magnification display data of the same content as the number of pixels is stored in the memory, which is substantially extremely redundant. (B) shows the contents of the table when the magnification is 1.5 times. In this case, the magnification of each pixel is such that 1, 2 is alternately repeated as 1, 2, 1, 2,.... Keeping all such regular data in the memory is also redundant, and prevents effective use of resources.

そこで、こうした拡大/縮小テーブルを演算によって求める。即ち、画像データ中の各画素の位置と拡大/縮小倍率との規則的な対応関係を考慮して、画素毎の倍率を演算処理により求める。こうすれば、そのデータを使用して直ちに拡大/縮小処理をすることもできるし、またいったんその演算処理によって拡大/縮小テーブルを生成し、その後、実際の拡大/縮小処理をしてもよい。いずれの場合においても、拡大倍率ごとに作成した大量の拡大/縮小テーブルデータを、メモリ内部に予め全て保持しておく必要がないという効果がある。   Therefore, such an enlargement / reduction table is obtained by calculation. That is, the magnification for each pixel is obtained by arithmetic processing in consideration of the regular correspondence between the position of each pixel in the image data and the magnification / reduction magnification. In this way, the enlargement / reduction processing can be performed immediately using the data, or the enlargement / reduction table may be generated once by the arithmetic processing, and then the actual enlargement / reduction processing may be performed. In any case, there is an effect that it is not necessary to previously store a large amount of enlargement / reduction table data created for each enlargement magnification in the memory.

図8のモジュロ演算は、割り算の余りを求める計算である。図の左端にはライン番号を表示した。第0番目のラインは0、1番目のラインは1というように演算値を設定する。そして、これを2で割って余りを求めるモジュロ演算処理を%で表すことにする。このようにすると、図に示すように、0番目のラインについては演算結果は0、1番目のラインについては演算結果が1、2番目のラインについては演算結果が0というように、交互に0,1,0,1という演算結果が得られる。一方、図の(b)に示すように、例えば1.5倍の拡大を行うような場合、インデックスが0のときは1倍、インデックスが1のときは2倍というテーブルを用意する。これで、モジュロ演算結果によりライン毎に画素を何倍するかというデータが得られる。
以上のようにして、図8(b)に示すような少量のテーブルデータで、全ての拡大/縮小処理が可能となる。
The modulo operation in FIG. 8 is a calculation for obtaining the remainder of the division. The line number is displayed at the left end of the figure. The operation value is set so that the 0th line is 0 and the 1st line is 1. Then, modulo operation processing for obtaining the remainder by dividing this by 2 is represented by%. Thus, as shown in the figure, the operation result is 0 for the 0th line, the operation result is 1 for the first line, the operation result is 0 for the 2nd line, and so on. , 1, 0, 1 are obtained. On the other hand, as shown in (b) of the figure, for example, in the case of performing 1.5-times enlargement, a table is prepared in which the index is 1 when the index is 0 and 2 when the index is 1. Thus, data indicating how many pixels are to be multiplied for each line is obtained based on the result of the modulo operation.
As described above, all enlargement / reduction processing can be performed with a small amount of table data as shown in FIG.

図9に、具体例2の拡大/縮小方法動作フローチャートを示す。
この動作は、既に図5を用いて説明した具体例1の場合と類似している。まずステップS1において、拡大/縮小テーブルの作成を行う。そのテーブルの構成は、図8を用いて説明した通りのものである。次に、ステップS2において、1ライン分のデータを読み込み、ステップS3において、図8の(a)に示したようなモジュロ演算を実行する。そして、その結果をインデックスとし、拡大/縮小テーブルを参照する。この処理はステップS3では縦方向について行い、ステップS4では横方向について行う。そして、ステップS5において、テーブルで指示された通りドットコピーを行い、ステップS6では横方向倍率分コピーが終了したかどうかを判断し、ステップS7では入力画像ライン幅分コピーを終了したかを判断する。そして、ステップS8で、縦方向倍率分コピーしたかを判断し、1ライン分の処理が終了するとステップS9に移り、全ての入力ライン数分処理したかどうかの判断がされる。こうして、それぞれのループを処理し、全ての入力画像データについて拡大/縮小処理を行う。
FIG. 9 shows an operation flowchart of the enlargement / reduction method according to the second embodiment.
This operation is similar to the case of the specific example 1 already described with reference to FIG. First, in step S1, an enlargement / reduction table is created. The configuration of the table is as described with reference to FIG. Next, in step S2, one line of data is read, and in step S3, a modulo operation as shown in FIG. 8A is executed. Then, the result is used as an index and the enlargement / reduction table is referred to. This processing is performed in the vertical direction in step S3, and is performed in the horizontal direction in step S4. In step S5, dot copy is performed as instructed in the table. In step S6, it is determined whether the copy for the horizontal magnification is completed. In step S7, it is determined whether copy for the input image line width is completed. . Then, in step S8, it is determined whether or not copying has been performed for the vertical magnification. When the processing for one line is completed, the process proceeds to step S9, where it is determined whether or not processing has been performed for all input lines. Thus, each loop is processed, and the enlargement / reduction processing is performed on all the input image data.

以上のように、ステップS3とS4で、拡大/縮小テーブルを参照するべき処理のたびにモジュロ演算を実行し、該当部分(テーブルの一部)のテーブルを生成しながら処理をすると、拡大/縮小テーブルデータ全体を保持しておく必要がない。また、ステップS1でモジュロ演算を実行して、拡大/縮小テーブル全体を生成してもよい。少なくとも、こうした処理が要求される直前に拡大/縮小テーブルを生成するようにすれば、拡大倍率ごとにテーブル全体をメモリに保存しておく場合に比べて、十分にテーブル保存用メモリの節約ができる。   As described above, in steps S3 and S4, a modulo operation is executed each time processing to refer to the enlargement / reduction table is performed, and processing is performed while generating a table of a corresponding portion (part of the table). There is no need to keep the entire table data. Alternatively, the entire enlargement / reduction table may be generated by executing a modulo operation in step S1. At least, if the enlargement / reduction table is generated immediately before such processing is required, the table storage memory can be saved sufficiently compared to the case where the entire table is stored in the memory for each enlargement magnification. .

〈具体例2の効果〉
この例では、入力画像データの全ての画素について、それぞれ例えばX方向に何倍、Y方向に何倍といった表示をテーブルデータとして保持しなくても、各画素を拡大/縮小方向に見て、その入力画像データ中の各画素の位置と拡大/縮小倍率との間に規則的な対応関係が存在する場合、演算処理によって拡大/縮小テーブルを生成して参照することができる。従って、予めメモリに保存しておくべき拡大/縮小テーブルのサイズを十分少なくし、記憶容量の削減を図ることができる。
<Effect of Specific Example 2>
In this example, each pixel is viewed in the enlargement / reduction direction without displaying, for example, how many times in the X direction and how many times in the Y direction each of the pixels of the input image data. When there is a regular correspondence between the position of each pixel in the input image data and the enlargement / reduction magnification, an enlargement / reduction table can be generated and referred to by arithmetic processing. Therefore, the size of the enlargement / reduction table to be stored in the memory in advance can be sufficiently reduced, and the storage capacity can be reduced.

〈具体例3〉
図10に、具体例3による拡大/縮小装置のブロック図を示す。
この装置は、これまでの具体例の、拡大/縮小装置6の部分に、前ラインバッファ7Aと現ラインバッファ7Bの2ライン分のバッファを設ける。そしてさらに、これから説明する一次補間処理を行うための、一次補間拡大/縮小処理部16を設ける。
<Specific example 3>
FIG. 10 is a block diagram of an enlargement / reduction device according to the third embodiment.
In this apparatus, a buffer for two lines of a previous line buffer 7A and a current line buffer 7B is provided in the portion of the enlargement / reduction apparatus 6 in the specific examples so far. Further, a primary interpolation enlargement / reduction processing unit 16 for performing a primary interpolation process to be described below is provided.

図11に、従来から画像の拡大/縮小処理に採用されていた画素値補正のためのリサンプリングの説明図を示す。また、図12に、正方格子の説明図を示す。なお、正方格子というのは、縦横の各辺の長さは自由で、いわゆる矩形の頂点に画素が配置されたものをいう。従って、必ずしも4辺が等しい正方形でなくてよく、長方形であってもさしつかえない。
図11の入力画像データ3を拡大処理したものを出力画像データ4とする。拡大処理をすると、入力画素の各画素の間隔と出力画素の各画素の間隔とは、必ずしも一致しない。また、画像中の対応する画素の位置も正確には一致しないことがある。この場合に、出力画像データ4の各画素の画素値は、出力画像の画質を劣化させないために、次のようにして演算処理をして変換する。
FIG. 11 is an explanatory diagram of resampling for pixel value correction which has been conventionally used for image enlargement / reduction processing. FIG. 12 is an explanatory diagram of a square lattice. Note that a square lattice refers to one in which the length of each of the vertical and horizontal sides is free, and pixels are arranged at the vertices of a so-called rectangle. Therefore, the four sides do not necessarily have to be a square, and may be a rectangle.
Output image data 4 is obtained by enlarging input image data 3 in FIG. When the enlargement process is performed, the interval between the input pixels and the interval between the output pixels do not always match. Also, the positions of the corresponding pixels in the image may not exactly match. In this case, the pixel value of each pixel of the output image data 4 is converted by performing arithmetic processing as follows in order to prevent the image quality of the output image from deteriorating.

まず、出力画像データ4の各画素が、入力画像データ3中のどの位置にあるべき画素かを求める。この場合に、図12に示すように、X点の出力画素は、A、B、C、D点の入力画素の正方格子に囲まれた位置にあるものとする。このとき、A、B、C、D点の4つの画素の画素値と、X点とA、B、C、D点との距離の関係から、適切な画素値を演算処理し、これをX点の画素の画素値とする。   First, the position of each pixel of the output image data 4 in the input image data 3 is determined. In this case, as shown in FIG. 12, it is assumed that the output pixel at point X is located at a position surrounded by a square lattice of input pixels at points A, B, C, and D. At this time, an appropriate pixel value is calculated from the relationship between the pixel values of the four pixels at points A, B, C, and D and the distance between point X and points A, B, C, and D. The pixel value of the pixel at the point is used.

図13は、一次補間の一般的計算法説明図である。
例えば、図12に示すように、×印の点に出力画素が存在したとする。このとき、×点の上辺からの距離をq、左辺からの距離をpとする。pとqはいずれも0と1の間の小数で表す。このとき、×印の点の画素の出力値は図13(a)に示す式で表される。ここで、(b)に示すように、出力画素Fの出力画像上の座標と、入力画素Aの入力画像上の座標と、画像の拡大図をそれぞれ設定すると、p,q及び各座標値や拡大率との関係は(c)式に示すようになる。
このような処理をしようとすれば、予め処理対象となる画素の周辺の入力画像データを全てバッファメモリに格納した上で、出力画像データの画素値を演算処理する必要がある。
FIG. 13 is an explanatory diagram of a general calculation method of linear interpolation.
For example, as shown in FIG. 12, it is assumed that an output pixel exists at a point indicated by a cross. At this time, the distance from the upper side of the point x is q, and the distance from the left side is p. Both p and q are represented by decimal numbers between 0 and 1. At this time, the output value of the pixel at the point marked by x is represented by the equation shown in FIG. Here, as shown in (b), when the coordinates of the output pixel F on the output image, the coordinates of the input pixel A on the input image, and the enlarged view of the image are respectively set, p, q and each coordinate value, The relationship with the enlargement ratio is as shown in equation (c).
In order to perform such a process, it is necessary to store in advance all input image data around the pixel to be processed in the buffer memory, and then to calculate the pixel value of the output image data.

図14には、具体例3による一次補間の説明図を示す。
この具体例では、例えば具体例1を実施して、入力画像データ3をX軸方向に4倍、Y軸方向に3倍に拡大している。このとき、各画素数を増加させて得られた出力画像データ4の4×3画素のブロック(図中太い黒線の枠で囲んだマトリクス)中で、例えば右下端の画素が正方格子上の画素であると定義する。この画素を図では黒く塗りつぶしてある。
FIG. 14 is an explanatory diagram of the primary interpolation according to the third embodiment.
In this specific example, for example, the specific example 1 is performed to enlarge the input image data 3 four times in the X-axis direction and three times in the Y-axis direction. At this time, for example, in a 4 × 3 pixel block (matrix surrounded by a thick black line frame in the figure) of the output image data 4 obtained by increasing the number of pixels, for example, a pixel at the lower right is on a square lattice. It is defined as a pixel. This pixel is blacked out in the figure.

例えば入力画像データ3のX=3,Y=2の座標にある黒く塗りつぶした画素は、出力画像データ4のX=12,Y=6の座標にコピーされる。この画素を含むブロック中の各画素の画素値は、図に示すように塗りつぶした周囲4画素の画素値を用いて一次補間する。入力画像中で隣同士にあった画素の間に追加した新たな画素の画素値を、もともと隣同士にあった画素の間で滑らかに変化させて、高画質の出力画像を得るためである。   For example, a pixel painted black at coordinates of X = 3, Y = 2 of the input image data 3 is copied to coordinates of X = 12, Y = 6 of the output image data 4. The pixel value of each pixel in the block including this pixel is linearly interpolated using the pixel values of four surrounding pixels which are painted as shown in the figure. This is because a high-quality output image is obtained by smoothly changing the pixel value of a new pixel added between adjacent pixels in the input image between pixels that were originally adjacent to each other.

ここで、前ラインと現ラインの2ライン分の画像データ、即ち、入力画像データ3のハッチングを付した画素と黒く塗りつぶした画素の4個分の画素値を保持していれば、太い黒い線で囲んだ枠の中の、12個分の画素全てについて、その画素値を演算処理することが可能になる。その演算式は図の(b)に示した。各記号の意味はその下に示す通りである。   Here, if the image data of two lines of the previous line and the current line, that is, four pixel values of the hatched pixels and black pixels of the input image data 3 are held, a thick black line It becomes possible to perform arithmetic processing on the pixel values of all 12 pixels in the frame surrounded by. The calculation formula is shown in FIG. The meaning of each symbol is as shown below.

図15に、具体例3による一次補間の処理例説明図を示す。
ここには、上記の定義に従って実際に各画素に画素値を与えた場合の演算処理結果を数値で示した。入力画像は、格子点の画素の画素値が例えば“0”、“100”、“50”及び“200”という値とする。これを縦3倍横4倍に拡大すると、それぞれの画素値は対応するブロックの右下隅にコピーされる。そして、例えば画素値が“200”の画素を含むブロックについて、残りの11個の画素に具体的に一次補間により計算した値を書き込んだ。図の下側には一例として、P=2,Q=2の場合の画素値計算例を図示した。このようにして画素値を計算することによって、画質を低下させずに拡大処理を行うことができる。
FIG. 15 is an explanatory diagram of a processing example of the primary interpolation according to the third specific example.
Here, the results of arithmetic processing when pixel values are actually given to each pixel according to the above definition are shown by numerical values. In the input image, the pixel values of the pixels at the lattice points are, for example, “0”, “100”, “50”, and “200”. If this is enlarged three times vertically and four times horizontally, each pixel value is copied to the lower right corner of the corresponding block. Then, for example, for a block including a pixel having a pixel value of “200”, the value calculated by the primary interpolation is written in the remaining 11 pixels. In the lower part of the figure, an example of pixel value calculation in the case of P = 2 and Q = 2 is illustrated. By calculating the pixel values in this way, the enlargement process can be performed without deteriorating the image quality.

図16には、具体例3の装置の動作フローチャートを示す。
このフローチャートにおいて、ステップS1〜ステップS4は、図5を用いて説明した具体例1の処理と同様である。即ち、拡大/縮小テーブルを作成し、ラインデータを読み込み、その後拡大/縮小テーブルを参照する。そして、具体例3では、ステップS5において、上記の通り説明した一次補間処理を行う。この処理をブロック中の全ての画素について行い、更に走査方向に順に、全てのブロックついて実行する。その他の処理は具体例1と同様である。なお、ブロックの右下隅に入力画素の画素値をコピーしたが、これはシリアルに入力したバッファメモリ中の2ライン分の画像データだけを利用して演算処理できるようにするためである。
なお、こうした効果を得る画素の位置は、各ブロックの4つの角部であればよい。
FIG. 16 shows an operation flowchart of the device of the third embodiment.
In this flowchart, steps S1 to S4 are the same as the processing of the specific example 1 described with reference to FIG. That is, an enlargement / reduction table is created, line data is read, and then the enlargement / reduction table is referred to. Then, in the specific example 3, in step S5, the primary interpolation processing described above is performed. This processing is performed for all the pixels in the block, and further executed for all the blocks in the scanning direction. Other processes are the same as those in the first embodiment. Note that the pixel value of the input pixel is copied to the lower right corner of the block in order to enable arithmetic processing using only serially input image data for two lines in the buffer memory.
Note that the positions of the pixels that obtain such an effect may be any of the four corners of each block.

〈具体例3の効果〉
この具体例によれば、入力画像全体をバッファメモリに読み込んでからでなければ実現が不可能であった一次補間による拡大/縮小処理を、2ライン分のデータをバッファメモリに保持するだけで実行可能になった。これによって、高画質の拡大/縮小処理をバッファメモリの使用量を十分に少なくして実現できる。
<Effect of Specific Example 3>
According to this specific example, the enlargement / reduction processing by the primary interpolation, which cannot be realized until the entire input image is read into the buffer memory, is executed only by holding the data of two lines in the buffer memory. It is now possible. As a result, high-quality enlargement / reduction processing can be realized with a sufficiently small amount of buffer memory.

〈具体例4〉
図17は、具体例4の原理説明図である。
ここでは、入力画像データ3の正方格子の座標を出力画像データ4上の座標に変換し、出力画像データ4を対応する正方格子によって作られる領域で分割する。この領域のことを、以下近傍エリアと呼ぶ。この図では、入力画像データ3の破線で囲んだ4つの画素(丸印)によって正方格子を定義したとき、これに対応する近傍エリアを、出力画像データ4の中に実線の四角で書き込んだ。この四角で囲んだ領域を近傍エリアと呼ぶが、ここには図に示すように例えば9個の出力画素(四角印)が含まれる。これらの画素の画素値を入力画像データ3の4個の画素の画素値から上記の一次補間法によって求める。こうすれば、近傍エリアに含まれる各画素の画素値を入力画像データの4つの隣合った画素の画素値のみで求めることができる。従って、バッファメモリへは具体例3と同様に2ライン分程度のデータを格納すればよい。しかも、その演算処理は後で説明するように、これまでよりも更に容易になる。
<Specific example 4>
FIG. 17 is an explanatory view of the principle of the fourth embodiment.
Here, the coordinates of the square grid of the input image data 3 are converted into the coordinates on the output image data 4, and the output image data 4 is divided into regions formed by the corresponding square grid. This area is hereinafter referred to as a nearby area. In this figure, when a square grid is defined by four pixels (circles) surrounded by broken lines of the input image data 3, the corresponding neighboring areas are written in the output image data 4 by solid squares. The area surrounded by the square is called a neighborhood area, which includes, for example, nine output pixels (square marks) as shown in the figure. The pixel values of these pixels are obtained from the pixel values of the four pixels of the input image data 3 by the above-described linear interpolation method. In this way, the pixel value of each pixel included in the neighboring area can be obtained from only the pixel values of four adjacent pixels of the input image data. Therefore, data of about two lines may be stored in the buffer memory as in the third embodiment. In addition, the calculation process is easier than before, as described later.

図18に、具体例4の装置のブロック図を示す。
この装置の拡大/縮小装置6の部分には、処理対象となるデータを格納するために、ラインバッファ7Aと7Bとを設ける。そして、各ラインバッファ中の演算処理対象となる画素値を指定するために、前行ポインタ19Aと現行ポインタ19Bとが設けられる。更に、先に説明した近傍エリアを指定するための近傍エリアテーブル18が設けられ、一次補間拡大/縮小処理部16において、近傍エリア内の各画素の画素値を演算処理する。
FIG. 18 shows a block diagram of the device of the fourth embodiment.
Line buffers 7A and 7B are provided in the enlargement / reduction device 6 of this device in order to store data to be processed. In order to specify a pixel value to be processed in each line buffer, a previous line pointer 19A and a current pointer 19B are provided. Further, a neighborhood area table 18 for designating the neighborhood area described above is provided, and the primary interpolation enlargement / reduction processing unit 16 calculates the pixel value of each pixel in the neighborhood area.

図19には、近傍エリアテーブルの説明図を示す。
近傍エリアテーブルは、具体例1で説明した拡大/縮小テーブルと同様に、縦方向の演算処理をするためのものと、横方向の演算処理をするためのものと、それぞれ1個ずつ存在する。縦方向のためのテーブルを近傍エリア縦テーブル、横方向のためのテーブルを近傍エリア横テーブルと呼ぶ。この(a)に示す例では、3×3画素の入力画像を5×5画素に拡大している。近傍エリアは、図の出力画像中の破線の格子に示すように設定した。例えば出力画像の左上隅の近傍エリアには1個の画素が存在し、右下隅の近傍エリアには2×2個の画素が存在する。このように、各近傍エリア中の出力画素数を表示するために縦テーブル、横テーブルを設ける。なお、このテーブルの内容は、一般的には図の(b)に示すような式によって求めることができる。なお、図(b)中のAという記号は入力画像の縦方向の画素数あるいは横方向の画素数を示す。また、Bという記号は出力画像の横方向あるいは縦方向の画素数を示す。Xという記号は、最初から何番目の近傍エリアかを示すパラメータである。
FIG. 19 is an explanatory diagram of the neighborhood area table.
As with the enlargement / reduction table described in the first embodiment, there are one neighboring area table for performing a vertical operation and one for performing a horizontal operation. The table for the vertical direction is called a nearby area vertical table, and the table for the horizontal direction is called a nearby area horizontal table. In the example shown in (a), an input image of 3 × 3 pixels is enlarged to 5 × 5 pixels. The neighborhood area was set as shown by a broken-line grid in the output image of FIG. For example, one pixel exists in the area near the upper left corner of the output image, and 2 × 2 pixels exist in the area near the lower right corner. Thus, a vertical table and a horizontal table are provided to display the number of output pixels in each of the neighboring areas. The contents of this table can be generally obtained by an equation as shown in FIG. Note that the symbol A in FIG. 3B indicates the number of pixels in the vertical direction or the number of pixels in the horizontal direction of the input image. The symbol B indicates the number of pixels in the horizontal or vertical direction of the output image. The symbol X is a parameter indicating the number of the neighboring area from the beginning.

図20は、ラインバッファの説明図を示す。
上記のように、装置には拡大/縮小処理の演算処理中2ライン分の画像データが格納される。ラインバッファ7Aと7Bとは、それぞれ交互に新たな1ライン分の入力データを受け入れて格納する。前行ポインタ19Aと現行ポインタ19Bは、どちらのラインバッファが先にデータを格納されたものかを示すためのものである。従って、初期値はいずれもラインバッファ7Aを示している。前行ポインタ19Aと現行ポインタ19Bとが指すべきバッファは、例えば図の(b)に示すような演算で求めることができる。これは、先に説明したようなモジュロ演算による。これで、入力画像のどのラインがどのラインバッファに格納されるか明確になる。
FIG. 20 is an explanatory diagram of a line buffer.
As described above, the image data for two lines is stored in the device during the arithmetic processing of the enlargement / reduction processing. The line buffers 7A and 7B alternately receive and store one new line of input data. The previous line pointer 19A and the current pointer 19B are used to indicate which line buffer has previously stored data. Therefore, the initial values indicate the line buffer 7A. The buffer to be pointed to by the previous line pointer 19A and the current pointer 19B can be obtained by, for example, an operation shown in FIG. This is based on the modulo operation described above. This makes it clear which line of the input image is stored in which line buffer.

図の(c)は、各ラインバッファの構成を示す。各ラインバッファは、実際の入力画像の幅より1画素分だけ大きくしてある。先頭の画素、即ちバッファの最初の要素には、2番目の要素と同じ値が格納される。これは入力画像の幅が1である場合に、そのままでは一次補間を行うための4画素分のデータを用意することができないため、ダミードットを格納するようにしたためである。   FIG. 3C shows the configuration of each line buffer. Each line buffer is one pixel larger than the width of the actual input image. The first pixel, that is, the first element of the buffer, stores the same value as the second element. This is because when the width of the input image is 1, data for four pixels for performing primary interpolation cannot be prepared as it is, so that dummy dots are stored.

図21には、画像データ格納処理説明図を示す。
以上の構成により、この図に示すように、例えばラインバッファ17Aに直前に処理した行が格納され、ラインバッファ17Bに現在処理中の行が格納された状態で処理を進める。ラインバッファ17Bの処理が終了したときには、ラインバッファ17Aに次の新たな1ライン分のデータを格納する。従って、現行ポインタ19Bは、今度はラインバッファ17Aを指し、前行ポインタ19Aがラインバッファ17Bを指すことになる。
FIG. 21 is an explanatory diagram of the image data storage processing.
With the above configuration, as shown in this figure, for example, the line buffer 17A stores the line just processed, and the line buffer 17B proceeds with the line currently being processed stored. When the processing of the line buffer 17B is completed, the data of the next new line is stored in the line buffer 17A. Accordingly, the current pointer 19B now points to the line buffer 17A, and the previous line pointer 19A points to the line buffer 17B.

図22に、近傍エリアの拡大図を示す。
上記近傍エリアを、例えば画素値A,B,C,Dの画素によって構成するとすれば、その近傍エリア中に含まれる実線の四角印の出力画素の画素値Fは、この図の中に示すような演算処理によって求められる。この演算処理そのものは一次補間の処理で説明した式と全く同様である。なお、格子の間隔を横方向にα、縦方向にβとした。また、対象となる画素の上辺からの距離をq、左辺からの距離をpとした。ただし、α,βは、画像の拡大率をX方向、Y方向それぞれmx,myとしたときα=1/mx,β=1/myとすることができる。
FIG. 22 shows an enlarged view of the vicinity area.
Assuming that the above-mentioned neighboring area is constituted by, for example, pixels having pixel values A, B, C, and D, the pixel value F of the output pixel indicated by a solid square mark included in the neighboring area is as shown in FIG. It is determined by a simple arithmetic processing. This arithmetic processing itself is exactly the same as the equation described in the primary interpolation processing. Note that the grid spacing is α in the horizontal direction and β in the vertical direction. Further, the distance from the upper side of the target pixel is q, and the distance from the left side is p. However, α and β can be set to α = 1 / mx and β = 1 / my when the enlargement ratio of the image is mx and my in the X and Y directions, respectively.

図23に、具体例4の動作フローチャートを示す。
具体例4では、まず既に説明したような横テーブルと縦テーブルの作成をステップS1において行う。そして、ステップS2において、各ラインバッファの初期化を行う。その後、ステップS3においてラインデータを読み込み、ステップS4において上記の図22に示した出力画素値計算を実行する。ステップS5では、近傍エリアの横サイズ分を処理したかどうかを判断し、ステップS6では、入力画像幅分の処理を終了したかを判断する。ステップS6までで1ライン分の処理が終了するとステップS7において近傍エリアの縦サイズ分が終了したかどうかの判断をし、これが終了すると、ステップS8に進み、バッファを更新する。更に、次のラインに移り、ステップS9で入力画像ライン数分が終了したかどうかの判断をして処理を終える。
FIG. 23 shows an operation flowchart of the fourth embodiment.
In the specific example 4, first, the horizontal table and the vertical table as described above are created in step S1. Then, in step S2, each line buffer is initialized. Thereafter, the line data is read in step S3, and the output pixel value calculation shown in FIG. 22 is executed in step S4. In a step S5, it is determined whether or not the processing for the horizontal size of the neighboring area is performed, and in a step S6, it is determined whether or not the processing for the input image width is completed. When the processing for one line is completed up to step S6, it is determined in step S7 whether or not the vertical size of the neighboring area has been completed. When the processing has been completed, the process proceeds to step S8 to update the buffer. Further, the process proceeds to the next line, and in step S9, it is determined whether or not the number of input image lines has been completed, and the process ends.

〈具体例4の効果〉
図24は、具体例4の計算内容説明図である。
この図を用いて効果を説明する。
以上のようにして、近傍エリア内に含まれた9個の画素の画素値は全てこの図に示すように4個の画素値から計算される。これにより、入力画像を2ライン分だけ保持して、順番にその内容を入れ替えながら処理をすれば、全ての出力画素の画素値を一次補間法によって順に計算処理することが可能になり、使用するメモリ量を十分に減少させることができる。
<Effect of Specific Example 4>
FIG. 24 is an explanatory diagram of the calculation contents of the specific example 4.
The effect will be described with reference to FIG.
As described above, all the pixel values of the nine pixels included in the neighboring area are calculated from the four pixel values as shown in FIG. Accordingly, if the input image is held for two lines and the processing is performed while changing the contents in order, the pixel values of all the output pixels can be sequentially calculated by the primary interpolation method and used. The amount of memory can be sufficiently reduced.

〈具体例5〉
上記の場合には、各出力画素即ち近傍エリア内に含まれる出力画素について、それぞれ7回の足し算と10回の掛け算を行うことになる。ところが、これらの位置の規則的な関係を考慮すると、更に演算処理を簡略化することができる。
図25に、具体例5の装置のブロック図を示す。
この装置は、ラインバッファ31A,31Bに画素を格納し、具体例4と同様の演算処理を行う一方、更に演算処理を簡略化する。その目的のために、一次補間拡大/縮小処理部40をここに示すような構成とした。ここにはパラメータ計算装置41、左端画素値記憶装置42、加算器43、ΔYメモリ44、ΔX1メモリ45、加算器46、ΔΔXメモリ47、現画素メモリ48及び加算器49が設けられている。近傍エリアテーブル32の出力は、パラメータ計算装置41に入力する。一次補間拡大/縮小処理部40の出力は出力画像フレームバッファ34に格納するように構成されている。
<Example 5>
In the above case, seven additions and ten multiplications are performed on each output pixel, that is, the output pixel included in the neighboring area. However, considering the regular relationship between these positions, the arithmetic processing can be further simplified.
FIG. 25 shows a block diagram of the device of the fifth embodiment.
This device stores pixels in the line buffers 31A and 31B and performs the same arithmetic processing as that of the fourth embodiment, while further simplifying the arithmetic processing. For that purpose, the primary interpolation enlargement / reduction processing unit 40 is configured as shown here. Here, a parameter calculation device 41, a left end pixel value storage device 42, an adder 43, a ΔY memory 44, a ΔX1 memory 45, an adder 46, a ΔΔX memory 47, a current pixel memory 48, and an adder 49 are provided. The output of the neighborhood area table 32 is input to the parameter calculation device 41. The output of the primary interpolation enlargement / reduction processing unit 40 is configured to be stored in the output image frame buffer 34.

図26には、ドット間の相関関係説明図を示す。
この具体例5では、ドット間の相関関係を用いて計算を簡略化する。即ち、この図に示すように、例えば近傍エリアの中に先に説明した通りの9個の画素が含められているとする。この場合に、これらの画素の横方向の間隔はΔX1、縦方向の間隔はΔYというように表示できる。このように、各画素の間隔が規則的に一定であることから、左端即ち図に示すD1の出力画素の画素値とΔX1やΔY1を求めておくことによって、順次その右側あるいは下側の画素の画素値を換算処理することが可能になる。即ち、隣合う画素の画素値の差はΔX1、ΔY、ΔΔX等によって求めることが可能になる。この具体例では、その原理を利用して各画素値の演算処理を簡単にした。
FIG. 26 is a diagram for explaining the correlation between dots.
In this specific example 5, the calculation is simplified using the correlation between dots. That is, as shown in this drawing, it is assumed that, for example, nine pixels as described above are included in the vicinity area. In this case, the horizontal interval between these pixels can be displayed as ΔX1, and the vertical interval can be displayed as ΔY. As described above, since the interval between the pixels is regularly constant, by obtaining the pixel value of the left end, that is, the pixel value of the output pixel of D1 and ΔX1 and ΔY1 shown in FIG. Pixel values can be converted. That is, the difference between the pixel values of adjacent pixels can be obtained by ΔX1, ΔY, ΔΔX, and the like. In this specific example, the calculation process of each pixel value is simplified by utilizing the principle.

図27は、図26と同様のドット間の相関関係説明図である。
この図には、この具体例5を用いて行う各画素値の計算式を示した。
図のように、左端の画素B1の画素値を計算すれば、右方向あるいは縦方向に並んだ各画素の画素値を遥かに簡単な式により演算処理することが可能になる。
FIG. 27 is an explanatory diagram of the correlation between dots as in FIG.
This figure shows a calculation formula of each pixel value performed using the specific example 5.
As shown in the figure, if the pixel value of the leftmost pixel B1 is calculated, the pixel values of the pixels arranged in the right direction or the vertical direction can be calculated by a much simpler expression.

図28には、具体例5の装置の動作フローチャートを示す。
図のステップS1において、まず近傍エリア左上端の画素値を計算する。その計算方法は、既に図27を用いて示した。次に、ステップS2において、ΔX1の計算を行う。更に、ステップS3において、ΔYの計算を行う。次にステップS4において、ΔΔXの計算を行う。その後ステップS5において、出力画素値の設定を行い、ステップS6において、出力画素値を更新する。ステップS7では、近傍エリアの横サイズ分処理が終了したかを判断し、ステップS6,S7のループを繰り返す。次に、近傍エリアのすぐ下の行を処理する場合ステップS8に移り、ΔX1を更新し、ステップS9において、左端の画素値を更新する。その後、ステップS10において、近傍エリアの縦サイズ分の処理が終了したかどうかを判断し、終了していない場合には、ステップS5〜ステップS9の処理を繰り返す。これによって、図27に示す計算処理が完了する。
FIG. 28 shows an operation flowchart of the device of the specific example 5.
In step S1 in the figure, first, the pixel value of the upper left corner of the neighboring area is calculated. The calculation method has already been described with reference to FIG. Next, in step S2, calculation of ΔX1 is performed. Further, in step S3, ΔY is calculated. Next, in step S4, ΔΔX is calculated. Then, in step S5, the output pixel value is set, and in step S6, the output pixel value is updated. In step S7, it is determined whether the processing for the horizontal size of the neighboring area has been completed, and the loop of steps S6 and S7 is repeated. Next, when processing the line immediately below the neighboring area, the process proceeds to step S8, where ΔX1 is updated, and in step S9, the leftmost pixel value is updated. Thereafter, in step S10, it is determined whether or not the processing for the vertical size of the neighboring area has been completed, and if not completed, the processing of steps S5 to S9 is repeated. This completes the calculation process shown in FIG.

〈具体例5の効果〉
以上の処理によって、左端の画素について、7回の足し算と10回の掛け算を実行するが、その他の画素については、それ以下の数回の足し算によってその画素値を求めることができる。これによって、一次補間処理の向上を図ることができる。
<Effect of Specific Example 5>
Through the above processing, seven additions and ten multiplications are performed for the leftmost pixel, but for other pixels, the pixel value can be obtained by a few additional additions. Thereby, the primary interpolation processing can be improved.

〈具体例6〉
図29は、具体例6の装置のブロック図である。
以下の具体例は画像縮小処理に適するものである。
以下の具体例では、図に示す入力画像51を主走査方向に平行な境界51Hと副走査方向に平行な境界51Vとによって小領域51Zに等分割する。そして、これらの各小領域51Z中に含まれる画素の画素値を平均して、出力画素の画素値を求める。この場合に、全ての画素の画素値を実際の処理をする装置側のバッファに保持しようとすると大きなメモリを必要とする。そこで、この図29に示すような構成とする。
入力画像51の全ての画素の画素値は外部記憶装置52に格納されている。これらを処理するために、入力画像バッファ53、途中結果バッファ54、制御装置55、フレームバッファ57が設けられている。
<Example 6>
FIG. 29 is a block diagram of the device of the sixth embodiment.
The following specific example is suitable for image reduction processing.
In the following specific example, the input image 51 shown in the figure is equally divided into small regions 51Z by a boundary 51H parallel to the main scanning direction and a boundary 51V parallel to the sub-scanning direction. Then, the pixel values of the pixels included in each of the small areas 51Z are averaged to obtain the pixel value of the output pixel. In this case, a large memory is required to hold the pixel values of all the pixels in the buffer of the apparatus that performs the actual processing. Therefore, a configuration as shown in FIG. 29 is adopted.
The pixel values of all the pixels of the input image 51 are stored in the external storage device 52. In order to process these, an input image buffer 53, an intermediate result buffer 54, a control device 55, and a frame buffer 57 are provided.

入力画像バッファ53は、入力画像51を構成する画素を、主走査方向に1ライン分ずつ受け入れて保持する記憶装置である。また、途中結果バッファ54は、入力画像51を主走査方向に見たときに、等分割した小領域の数だけ画素値の集計値を格納するメモリとなっている。フレームバッファ57には、制御装置55によって処理された出力画像58が格納される。なお、制御装置55は、これらの処理の間に必要な、横方向のグループ内ドット数xnum、縦方向のグループ内ドット数ynum、入力画素横カウンタIX、入力画素縦カウンタIY、出力画素横カウンタOX、出力画素縦カウンタOY、横方向の合計カウンタHTを格納したパラメータ保持部60を備える。   The input image buffer 53 is a storage device that receives and holds pixels constituting the input image 51 one line at a time in the main scanning direction. The intermediate result buffer 54 is a memory that stores the total value of the pixel values for the number of equally divided small areas when the input image 51 is viewed in the main scanning direction. The output image 58 processed by the control device 55 is stored in the frame buffer 57. Note that the control device 55 controls the number of dots in the horizontal group xnum, the number of dots in the vertical group ynum, the input pixel horizontal counter IX, the input pixel vertical counter IY, and the output pixel horizontal counter required during these processes. OX, an output pixel vertical counter OY, and a horizontal direction total counter HT are stored.

横方向のグループ内ドット数xnumは、等分割した小領域51Zに含まれる画素数をカウントし、平均化処理のために保持しておくパラメータで、横方向というのは主走査方向、縦方向というのは副走査方向のことである。入力画素横カウンタIXは入力画像51を主走査方向に見た画素数をカウントし、1ライン分の処理を終了するかどうかを判断するためのパラメータである。入力画素縦カウンタIYは、副走査方向の画素数をカウントして1ページ分の処理が終了したかを判断するためのパラメータである。出力画素横カウンタOXは、フレームバッファ上の出力画素値を、主走査方向のどの位置に格納するかを示すパラメータである。カウンタOYは、出力画素値を、フレームバッファ上の副走査方向のどの位置に格納するかを示すパラメータである。横方向の合計カウンタHTは、入力画像バッファ53に格納された各画素の画素値を順番に合計し、その途中集計値を一時的に保持するデータ保持領域である。このデータは、1個の小領域分の合計を終了する都度、途中結果バッファ54に移される。   The number of dots in the horizontal direction xnum is a parameter that counts the number of pixels included in the equally divided small area 51Z and is stored for averaging processing. The horizontal direction is the main scanning direction and the vertical direction. In the sub-scanning direction. The input pixel horizontal counter IX is a parameter for counting the number of pixels of the input image 51 viewed in the main scanning direction and determining whether or not to end processing for one line. The input pixel vertical counter IY is a parameter for counting the number of pixels in the sub-scanning direction and determining whether processing for one page is completed. The output pixel horizontal counter OX is a parameter indicating at which position in the main scanning direction the output pixel value on the frame buffer is stored. The counter OY is a parameter indicating at which position in the sub-scanning direction the output pixel value is stored in the frame buffer. The horizontal sum counter HT is a data holding area for sequentially summing up the pixel values of the respective pixels stored in the input image buffer 53 and temporarily holding a total value on the way. This data is transferred to the intermediate result buffer 54 each time the summation for one small area is completed.

図30〜図33を用いて、入力画像を小領域に等分割した場合の、入力画像を構成する画素のグループ化について述べる。
図30に示した破線の格子点には、それぞれ入力画像の画素が存在するものとする。ここで、このような入力画像を、図の右側に四角印を並べて示すような画素配列の出力画像に縮小する場合を考える。このとき、各出力画素A毎に、対応する入力画像上の座標を求める。その位置は図の格子中に四角印で表示した。この出力画素Aの画素値は、その周辺に存在する入力画像の画素の画素値を平均して求める。
The grouping of pixels constituting the input image when the input image is equally divided into small areas will be described with reference to FIGS.
It is assumed that the pixels of the input image exist at the grid points indicated by broken lines in FIG. Here, consider a case where such an input image is reduced to an output image having a pixel array as shown by arranging square marks on the right side of the drawing. At this time, the coordinates on the input image corresponding to each output pixel A are obtained. The position is indicated by a square in the grid in the figure. The pixel value of the output pixel A is obtained by averaging the pixel values of the pixels of the input image existing around the output pixel A.

このために、図31に示すように、各出力画素Aの中間に線を引いて入力画像を等分割する。これによって、例えばこの図に示すように、副走査方向即ち縦方向に見た場合に、出力画素Aが2L間隔で配列されていたとすると、2L間隔で主走査方向に平行な境界51Hが設定される。同様にして、副走査方向に平行な境界51Lが設定される。こうして、入力画像を構成する各画素は、境界51Hと51Lによって小領域毎にグループ分けされる。   For this purpose, as shown in FIG. 31, a line is drawn in the middle of each output pixel A to divide the input image equally. Thus, as shown in this figure, for example, assuming that the output pixels A are arranged at 2L intervals when viewed in the sub-scanning direction, that is, in the vertical direction, boundaries 51H parallel to the main scanning direction are set at 2L intervals. You. Similarly, a boundary 51L parallel to the sub-scanning direction is set. In this way, the pixels constituting the input image are grouped into small areas by the boundaries 51H and 51L.

図32には、それぞれ出力画素Aに対応する入力画素を黒丸で示した。ここで、図の右下にある出力画素Aの画素値は、これに対応する4個の黒丸の、入力画素の画素値を平均したものになる。また、境界の選定上、図の左下に示された出力画素Bに対応する入力画素のグループは6個の黒丸となる。
即ち、入力画素が丁度境界上に存在する場合には、例えば図33に示すようなルールを設定する。図33に示すように、境界51Lあるいは51Hの真上に存在する画素はいずれも、例えば左側あるいは上側の領域に含まれる画素のグループに属するものと定義する。
In FIG. 32, input pixels corresponding to output pixels A are indicated by black circles. Here, the pixel value of the output pixel A at the lower right of the figure is the average of the pixel values of the input pixels of four corresponding black circles. In addition, in selecting a boundary, the group of input pixels corresponding to the output pixel B shown in the lower left of the figure is six black circles.
That is, when the input pixel exists exactly on the boundary, for example, a rule as shown in FIG. 33 is set. As shown in FIG. 33, any pixel existing directly above the boundary 51L or 51H is defined as belonging to, for example, a group of pixels included in the left or upper region.

図34には、グループの領域説明図を示す。
この図により、縦方向の境界画素71と横方向の境界画素72とを定義する。境界51Lと51Hによって囲まれた小領域には、図に示すような白丸と黒丸で表現される入力画素が含まれる。このとき、主走査方向に平行な境界51Hに最も近い1列の画素を横方向の境界画素72と定義する。また、副走査方向に平行な境界51Lに最も近い画素を縦方向の境界画素71と定義する。図29に示した装置は、これらの境界画素を他の画素と区別して認識し、境界画素を認識したとき、所定の集計処理や平均化処理を実行する。これによって、比較的小容量の途中結果バッファ54(図29)や入力画像バッファ53(図29)を利用して、領域毎に入力画素のグループに対する画素値の平均値を求める。
FIG. 34 is an explanatory diagram of the area of the group.
With this drawing, a boundary pixel 71 in the vertical direction and a boundary pixel 72 in the horizontal direction are defined. The small area surrounded by the boundaries 51L and 51H includes input pixels represented by white circles and black circles as shown in the figure. At this time, one row of pixels closest to the boundary 51H parallel to the main scanning direction is defined as a horizontal boundary pixel 72. A pixel closest to the boundary 51L parallel to the sub-scanning direction is defined as a vertical boundary pixel 71. The apparatus shown in FIG. 29 recognizes these boundary pixels differently from other pixels, and when the boundary pixels are recognized, executes a predetermined tabulation process and an averaging process. As a result, the average value of the pixel values for the group of input pixels is obtained for each area using the intermediate result buffer 54 (FIG. 29) and the input image buffer 53 (FIG. 29) having a relatively small capacity.

図35には、境界画素を利用した平均法の説明図を示す。
上記のような領域設定とグループ化を行うと、例えばこの図に示すように、枠73によって入力画素がそれぞれグループ化され、これらの平均値をとるために縦方向の境界画素71や横方向の境界画素72が読み込まれる。
FIG. 35 is an explanatory diagram of the averaging method using boundary pixels.
When the region setting and grouping as described above are performed, for example, as shown in this figure, input pixels are grouped by a frame 73, and a vertical boundary pixel 71 and a horizontal The boundary pixel 72 is read.

図36には、境界画素の判定基準説明図を示す。
上記のような境界画素を判定しようとする場合には、この図に示すような境界画素の判定基準が必要となる。図に示すように、入力画像51を横方向の境界51Hと縦方向の境界51Lとによって、それぞれグループの領域51Zという単位に等分割する。このとき、横方向の境界画素の判別関数をborder・x(X)とし、縦方向の境界画素判別関数をborder・y(Y)とする。border・x(X)は、図の(b)に示すように、dst・xとsrc・xとXの関数である。dst・xは出力画像の主走査方向の幅である。また、src・xは入力画像の主走査方向の幅である。Xは、入力画像を主走査方向に見た場合の着目する画素の順位である。入力画素の間隔を“1”とすれば、全ての小領域の幅はsrc・x/dst・xとなる。こうした条件で、左から数えてX番目の入力画素が境界画素になるための条件は、X番目とX+1番目の入力画素の間に領域の境界が来ることである。領域の境界は、src・x/dst・xの間隔で並んでいるから、X番目の入力画素が境界画素になるための条件は次の(1)式の通りになる。
X<((src・x*n)/dst・x)≦X+1 …(1)
FIG. 36 is an explanatory diagram of a criterion for determining a boundary pixel.
In order to determine the boundary pixel as described above, a criterion for determining the boundary pixel as shown in FIG. As shown in the figure, the input image 51 is equally divided into units of a group region 51Z by a horizontal boundary 51H and a vertical boundary 51L. At this time, the discrimination function of the horizontal boundary pixel is set to border · x (X), and the vertical boundary pixel discrimination function is set to border · y (Y). The border x (X) is a function of dst x, src x, and X, as shown in FIG. dst · x is the width of the output image in the main scanning direction. Src · x is the width of the input image in the main scanning direction. X is the order of the pixel of interest when the input image is viewed in the main scanning direction. Assuming that the interval between input pixels is “1”, the width of all small regions is src · x / dst · x. Under these conditions, the condition that the X-th input pixel counted from the left becomes the boundary pixel is that the boundary of the area comes between the X-th input pixel and the X + 1-th input pixel. Since the boundaries of the regions are arranged at intervals of src · x / dst · x, the condition for the X-th input pixel to be the boundary pixel is as in the following equation (1).
X <((src · x * n) / dst · x) ≦ X + 1 (1)

更に、X番目の入力画素が境界画素になるための条件は、次の(2)式を満たすような整数mが存在することである。
X<((src・x*m)/dst・x)≦X+1 …(2)
この(2)式において、まず両辺にdst・x/src・xを掛ける。dst・x/src・xは正なので不等号の向きは変わらない。
(dst・x*X)/src・x<m≦
(dst・x*(X+1))/src・x …(3)
ここで、mは整数なので両辺にガウス記号をつけてもこの関係は変わらないから次の(4)式の関係が成り立つ。
[(dst・x*X)/src・x]<m≦[(dst・x*(X+1))/src・x] …(4)
Further, a condition for the X-th input pixel to be a boundary pixel is that an integer m that satisfies the following equation (2) exists.
X <((src · x * m) / dst · x) ≦ X + 1 (2)
In this equation (2), first, both sides are multiplied by dst · x / src · x. Since dst · x / src · x is positive, the direction of the inequality sign does not change.
(Dst · x * X) / src · x <m ≦
(Dst · x * (X + 1)) / src · x (3)
Here, since m is an integer, this relationship does not change even if Gauss symbols are added to both sides, so that the relationship of the following equation (4) holds.
[(Dst · x * X) / src · x] <m ≦ [(dst · x * (X + 1)) / src · x] (4)

更に、[(dst・x*X)/src・x],[(dst・x*(X+1))/src・x]は整数なので、[(dst・x*X)/src・x]<[(dst・x*(X+1))/src・x]であれば[(dst・x*X)/src・x]<m≦[(dst・x*(X+1))/src・x]となるmが存在する。少なくともm=[(dst・x*(X+1))/src・x]は条件を満たす。
つまり、[(dst・x*X)/src・x]<[(dst・x*(X+1))/src・x]が、Xが境界画素になるための条件である。
以上のことから、border・x(X)の定義は次のようになる。
border・x(X)=1:[(dst・x*X)/src・x]<[(dst・x*(X+1))/src・x] …(5)
border・x(X)=0:[(dst・x*X)/src・x]≧[(dst・x*(X+1))/src・x] …(6)
Further, [(dst · x * X) / src · x] and [(dst · x * (X + 1)) / src · x] are integers, so [(dst · x * X) / src · x] <[ [(Dst · x * (X + 1)) / src · x], then ((dst · x * X) / src · x] <m ≦ [(dst · x * (X + 1)) / src · x] m exists. At least m = [(dst · x * (X + 1)) / src · x] satisfies the condition.
That is, [(dst · x * X) / src · x] <[(dst · x * (X + 1)) / src · x] is a condition for X to be a boundary pixel.
From the above, the definition of border · x (X) is as follows.
border · x (X) = 1: [(dst · x * X) / src · x] <[(dst · x * (X + 1)) / src · x] (5)
border · x (X) = 0: [(dst · x * X) / src · x] ≧ [(dst · x * (X + 1)) / src · x] (6)

同様に、副走査方向即ち縦方向に見た場合にも同様に判別関数を使用できる。
border・y(Y)=1:[(dst・y*Y)/src・y]<[(dst・y*(Y+1))/src・y] …(7)
border・y(Y)=0:[(dst・y*Y)/src・y]≧[(dst・y*(Y+1))/src・y] …(8)
Similarly, the discriminant function can be used similarly when viewed in the sub-scanning direction, that is, in the vertical direction.
border · y (Y) = 1: [(dst · y * Y) / src · y] <[(dst · y * (Y + 1)) / src · y] (7)
border · y (Y) = 0: [(dst · y * Y) / src · y] ≧ [(dst · y * (Y + 1)) / src · y] (8)

図37には、平均法のデータの流れ(横方向)の説明図を示す。
この図面を用いて、途中結果バッファ54の構成とこの具体例で実行される画素値の合計処理について説明する。
例えば、図に示すように、入力画像を構成する画素74が主走査方向に連続して、図29に示す入力画像バッファ53に格納されたものとする。これを順番に図に示した左端から処理する。最初の画素の画素値は図29に示した横方向の合計カウンタHTに格納する。次の画素の画素値はその合計カウンタHTに加算する。そして、次々に各画素の画素値を横方向の合計カウンタHTに累積して格納していくが、丁度そのグループの境界画素を検出すると、そこでレジスタ54Aへ画素値を転記して加算を終了する。境界画素の検出はborder・xの値から判断する。
FIG. 37 is an explanatory diagram of the data flow (horizontal direction) of the averaging method.
The configuration of the intermediate result buffer 54 and the pixel value summing process executed in this specific example will be described with reference to this drawing.
For example, as shown in the figure, it is assumed that the pixels 74 forming the input image are stored in the input image buffer 53 shown in FIG. 29 continuously in the main scanning direction. This is sequentially processed from the left end shown in the figure. The pixel value of the first pixel is stored in the horizontal sum counter HT shown in FIG. The pixel value of the next pixel is added to the sum counter HT. Then, the pixel value of each pixel is successively accumulated and stored in the horizontal sum counter HT. When the boundary pixel of the group is detected, the pixel value is transcribed to the register 54A and the addition is completed. . The detection of the boundary pixel is determined from the value of border · x.

従って、この図に示すように、border・xの値が“1”になると、途中結果バッファ54で使用するレジスタを54Aから54Bに切り換える。そして、次のグループの画素についてその画素値を順に加算していく。従って、1ライン分の処理が終了すると、途中結果バッファ54に設けられた主走査方向に見た小領域の数分のレジスタに、それぞれ同一の小領域に含まれる画素の画素値の合計が格納される。   Therefore, as shown in this figure, when the value of border · x becomes “1”, the register used in the intermediate result buffer 54 is switched from 54A to 54B. Then, the pixel values of the next group of pixels are sequentially added. Therefore, when the processing for one line is completed, the sum of the pixel values of the pixels included in the same small area is stored in registers corresponding to the number of small areas viewed in the main scanning direction provided in the intermediate result buffer 54. Is done.

図38には、平均法のデータの流れ(縦方向)の説明図を示す。
主走査方向に見る処理は図37に示すようにして進められる。そして、1ライン分の処理が終了すると、次の1ライン分の処理が進められる。この副走査方向の処理がこの図に示すように行われる。
副走査方向の処理を実行する場合、その処理開始前に必ずborder・yの値を参照する。border・yの値が“0”の場合には、図37で示した1ライン分の集計処理が実行される。途中結果バッファ54の各レジスタの内容は、1ライン毎に加算され累積される。ここで、border・yの値が“1”となったラインを処理することを考える。このラインは領域の最後に配置された画素値群であるから、領域毎にその画素値の集計を行うと、途中結果バッファを構成する各レジスタの保持する値は、このライン上にある全ての小領域のそれぞれ画素値の合計値である。これとは別に、図29に示したパラメータ保持部60の横方向のドット数xnumと、縦方向のドット数ynumとをカウントしているため、各領域を構成する画素数が計算できる。従って、各領域の画素値の合計を各領域に含まれる画素数で割ることによって、平均値を求めることができる。これがフレームバッファ57に格納されて出力画素の画素値となる。
FIG. 38 is an explanatory diagram of the data flow (vertical direction) of the averaging method.
The process of viewing in the main scanning direction proceeds as shown in FIG. When the processing for one line is completed, the processing for the next one line is advanced. The processing in the sub-scanning direction is performed as shown in FIG.
When processing in the sub-scanning direction is performed, the value of border · y is always referred to before starting the processing. When the value of border · y is “0”, the aggregation processing for one line shown in FIG. 37 is executed. The contents of each register of the intermediate result buffer 54 are added and accumulated line by line. Here, consider processing a line in which the value of border · y is “1”. Since this line is a group of pixel values arranged at the end of the area, when the pixel values are totaled for each area, the values held by the registers constituting the intermediate result buffer are all the values on this line. This is the sum of the pixel values of the small areas. Separately from this, the number of dots xnum in the horizontal direction and the number of dots ynum in the vertical direction of the parameter holding unit 60 shown in FIG. 29 are counted, so that the number of pixels constituting each area can be calculated. Therefore, an average value can be obtained by dividing the sum of the pixel values of each area by the number of pixels included in each area. This is stored in the frame buffer 57 and becomes the pixel value of the output pixel.

図39には、以上説明した具体例6の動作を順に説明するためのフローチャートを図示した。
ステップS1〜ステップS4は初期化の処理である。ステップS1では、入力画素縦カウンタIYと出力画素縦カウンタOYとを“0”にセットする。これによって、1ライン目からの読み出しを可能にする。ステップS2では、横方向の合計カウンタHTを“0”にする。これは画素値の中間的な集計結果を保存するためのものである。最初は1番左の画素を指定する。ステップS3では、縦方向のドット数ynumを“1”にし、横方向のドット数xnumを“1”にする。これによって、領域内の画素数を主走査方向と副走査方向に向かってカウント開始する。ステップS4では、途中結果バッファ54をクリアする。これで全ての小領域画素値集計結果に対応するレジスタがクリアされる。
FIG. 39 shows a flowchart for sequentially explaining the operation of the above-described specific example 6.
Steps S1 to S4 are initialization processing. In step S1, an input pixel vertical counter IY and an output pixel vertical counter OY are set to "0". This enables reading from the first line. In step S2, the horizontal total counter HT is set to "0". This is for storing an intermediate counting result of pixel values. First, the leftmost pixel is specified. In step S3, the number of dots ynum in the vertical direction is set to "1", and the number of dots xnum in the horizontal direction is set to "1". Thus, counting of the number of pixels in the area is started in the main scanning direction and the sub-scanning direction. In step S4, the intermediate result buffer 54 is cleared. This clears the registers corresponding to all small area pixel value aggregation results.

次のステップS5では、入力画素横カウンタIXが“0”にされ、出力画素横カウンタOXが“0”にされる。こうして左端の画素から以下の処理が繰り返される。ステップS6では、入力画像を1行(1ライン)分読み込む。ステップS7では、HTに画像バッファのIX番目の要素(画素値)を足す。こうしてHTには現在処理中の画素の画素値合計が一時保持される。次に、ステップS8において、border・xの値をチェックする。この値が“0”の場合にはステップS11に進み、入力画素横カウンタIXをインクリメントしてステップS12に進む。ステップS12では、IXが入力画像の幅を超えないかどうかを判断し、幅を超えなければステップS7に戻る。   In the next step S5, the input pixel horizontal counter IX is set to "0", and the output pixel horizontal counter OX is set to "0". Thus, the following processing is repeated from the leftmost pixel. In step S6, the input image is read for one line (one line). In step S7, the IX-th element (pixel value) of the image buffer is added to HT. Thus, the HT temporarily holds the total pixel value of the pixel currently being processed. Next, in step S8, the value of border · x is checked. If this value is "0", the flow proceeds to step S11, the input pixel horizontal counter IX is incremented, and the flow proceeds to step S12. In step S12, it is determined whether or not IX does not exceed the width of the input image, and if not, the process returns to step S7.

こうして画素値は順にHTに累積保持され、border・xの値が“1”になるとステップS9に進み、途中結果バッファ54のOX番目の要素(図36に示すレジスタ)にHTの値を足す。これで途中結果バッファ54の該当するレジスタに処理対象となる画素を含む領域の画素値についての合計が格納される。次に、出力画素横カウンタOXをインクリメントし、領域内集計用の横方向の合計カウンタHTを“0”にリセットする。そして、ステップS11に戻り、IXをインクリメントしてステップS12に進む。こうしてステップS7〜ステップS12の処理によって、1ライン分の画素値をそれぞれ領域毎に集計し、途中結果バッファ54に格納する。   In this way, the pixel values are sequentially accumulated and held in the HT, and when the value of border · x becomes “1”, the process proceeds to step S9, and the value of the HT is added to the OX-th element (the register shown in FIG. 36) of the intermediate result buffer 54. Thus, the sum of the pixel values of the area including the pixel to be processed is stored in the corresponding register of the intermediate result buffer 54. Next, the output pixel horizontal counter OX is incremented, and the horizontal total counter HT for totaling in the area is reset to “0”. Then, the process returns to step S11, increments IX, and proceeds to step S12. In this way, the pixel values of one line are totaled for each area by the processing of steps S7 to S12 and stored in the intermediate result buffer 54.

これらの処理が終了するとステップS13に進み、今度はborder・yの値をチェックする。border・yの値が“0”ならばステップS15に進み、IYをインクリメントして、次のラインの処理に進む。また、同時に縦方向のドット数ynumをインクリメントし、ステップS16に進む。ステップS16では、入力画素縦カウンタIYが入力画像の高さ以下であるかどうかを判断し、その高さ以下であればステップS5に戻る。これによって、1画面分の処理が終了したかどうかが判断される。
一方、ステップS13において、border・yの値が“1”になった場合には、ステップS14の割り算処理に進む。
When these processes are completed, the process advances to a step S13 to check the value of border · y. If the value of border · y is “0”, the process proceeds to step S15, IY is incremented, and the process proceeds to the next line. At the same time, the number of dots ynum in the vertical direction is incremented, and the process proceeds to step S16. In step S16, it is determined whether or not the input pixel vertical counter IY is equal to or less than the height of the input image. If the height is equal to or less than the height, the process returns to step S5. Thus, it is determined whether the processing for one screen is completed.
On the other hand, if the value of border · y becomes “1” in step S13, the process proceeds to the division process in step S14.

図40には、この割り算処理のフローチャートを示した。
割り算処理においては、まずステップS1において、横方向のドット数xnumに初期値“1”を代入する。また、入力画素横カウンタIXに初期値“0”を代入する。更に、ステップS2において、出力画素横カウンタOXに初期値“0”を代入する。
これらによって、1ライン分の最初の画素から処理を開始する準備を行う。
FIG. 40 shows a flowchart of the division processing.
In the division process, first, in step S1, an initial value "1" is substituted for the number xnum of dots in the horizontal direction. Further, an initial value “0” is substituted for the input pixel horizontal counter IX. Further, in step S2, an initial value “0” is substituted into the output pixel horizontal counter OX.
With these, preparations are made to start processing from the first pixel for one line.

次のステップS3において、border・xの値を判断する。border・xの値は主走査方向に見た場合に、2以上の画素が1つの領域に含まれる場合、最初は通常“0”である。従って、ステップS8に進み、入力画素横カウンタIXに“1”を加える。更に、領域内の横方向の画素数をカウントする横方向のドット数xnumをインクリメントする。そして、ステップS9に進み、IXが入力画像幅より大きくならなければ再びステップS3に戻る。こうしてborder・xの値が“1”になるまでステップS3,S8,S9の処理を繰り返す。この処理は、単に領域に含まれる主走査方向に配列された画素の数即ち差、横方向のドット数xnumをカウントするための処理である。   In the next step S3, the value of border.x is determined. When two or more pixels are included in one area when viewed in the main scanning direction, the value of border · x is usually “0” at first. Therefore, the process proceeds to step S8, where "1" is added to the input pixel horizontal counter IX. Further, the number of horizontal dots xnum for counting the number of horizontal pixels in the area is incremented. Then, the process proceeds to step S9, and if IX does not become larger than the input image width, the process returns to step S3 again. Thus, the processing of steps S3, S8 and S9 is repeated until the value of border · x becomes “1”. This process is a process for simply counting the number of pixels included in the region arranged in the main scanning direction, that is, the difference, and the number xnum of dots in the horizontal direction.

このラインの画素値の集計は、既に図39のステップS7〜ステップS12の処理によって終了している。ここで、border・xの値が“1”になるとステップS4に進み、途中結果バッファの該当するレジスタの値をテンポラリファイルTMPに格納する。更に、ステップS5において平均値を計算し、フレームバッファ上の該当する画素の画素値を決定する。途中結果バッファの値を横方向のドット数×縦方向のドット数で割った答が平均値となる。ステップS6では、横方向のドット数xnumをゼロクリアする。これは、次の領域のドット数をカウントするための準備である。ステップS7では、OXに“1”を加える。これは出力画素の横カウンタをインクリメントして、次の出力画素を指定する処理である。   The summation of the pixel values of this line has already been completed by the processing of steps S7 to S12 in FIG. Here, when the value of border · x becomes “1”, the process proceeds to step S4, and the value of the corresponding register of the intermediate result buffer is stored in the temporary file TMP. Further, in step S5, the average value is calculated, and the pixel value of the corresponding pixel on the frame buffer is determined. The answer obtained by dividing the value of the intermediate result buffer by the number of dots in the horizontal direction × the number of dots in the vertical direction is the average value. In step S6, the number of dots xnum in the horizontal direction is cleared to zero. This is a preparation for counting the number of dots in the next area. In step S7, "1" is added to OX. This is a process of incrementing the horizontal counter of the output pixel and designating the next output pixel.

ステップS8で入力画素を1つ右に進め、xnumに“1”を加えて初期化し、再びステップS9において、全ての1ライン分の処理が終了したかを判断する。次の領域が存在すれば再びステップS3に戻り、これまで説明した処理を繰り返す。こうして、border・yが“1”のラインについて、途中結果バッファの各レジスタに格納されたそれぞれの領域に含まれる画素値の合計を、それぞれの領域を構成する画素の数で割ることにより平均値を求める処理を終える。これらの処理が全て終了すると、ステップS10でynumをゼロクリアし、次の処理に備える。また、ステップS11では、途中結果バッファをクリアし、次のラインから再び新たな集計を開始する。   In step S8, the input pixel is moved right by one, "1" is added to xnum to initialize it, and it is determined again in step S9 whether the processing for all one line is completed. If the next area exists, the process returns to step S3, and the processing described so far is repeated. In this way, the average value is obtained by dividing the sum of the pixel values contained in each area stored in each register of the intermediate result buffer by the number of pixels constituting each area for the line where border · y is “1”. Is completed. When all of these processes are completed, ynum is cleared to zero in step S10 to prepare for the next process. Also, in step S11, the intermediate result buffer is cleared, and a new counting is started again from the next line.

〈具体例6の効果〉
以上の例によれば、入力画像を構成する画素を1ライン分ずつ保持し、主走査方向に見たときの小領域の境界画素を検出しながら、画素値の集計値を求めて途中結果バッファに格納し、副走査方向に見たときの境界画素を検出して、各小領域の画素値の集計値を領域に含まれる画素数で割ることによって、各領域における画素値の平均値を求める。このようにしたので、入力画像を構成する画素値を保持するためのメモリが、1ライン分の入力画像バッファと比較的小容量の途中結果バッファのみとなり、使用メモリ量を少なくすることができる。
<Effect of Specific Example 6>
According to the above example, the pixels constituting the input image are held for one line at a time, and while the boundary pixels of the small area when viewed in the main scanning direction are detected, the total value of the pixel values is obtained and the intermediate result buffer is obtained. And the boundary pixel when viewed in the sub-scanning direction is detected, and the average value of the pixel values in each area is obtained by dividing the total value of the pixel values of each small area by the number of pixels included in the area. . With this configuration, the memory for holding the pixel values constituting the input image is only the input image buffer for one line and the intermediate result buffer having a relatively small capacity, and the used memory amount can be reduced.

〈具体例7〉
図41に、具体例7の装置のブロック図を示す。
この装置は、具体例6の装置に対しパラメータ保持部60にサンプリングの間隔Aを保持するためのレジスタを設けたものである。そして、これによって、各小領域の全ての画素値を加算して平均するのでなく、一部サンプリングした画素の画素値を平均する。
<Specific Example 7>
FIG. 41 shows a block diagram of the device of the seventh embodiment.
This device is different from the device of Example 6 in that a register for holding the sampling interval A is provided in the parameter holding unit 60. Then, instead of adding and averaging all the pixel values of each small area, the pixel values of partially sampled pixels are averaged.

図42には、サンプリングされる入力画素の説明図を示す。
図に示すように、入力画像1は、副走査方向に平行な境界51Vと主走査方向に平行な境界51Hによって小領域に等分割されている。この小領域には多数の画素が含まれるが、図に示すように黒丸の画素74Aと白丸の画素74Bとを設定し、黒丸の画素74Aのみをサンプリングする。領域に含まれる画素の両端の画素間隔を図に示すように主走査方向Dx、副走査方向Dyとした。そして、サンプリング間隔をAとした。ここでは、実際には主走査方向も副走査方向もAの間隔で1個おきに画素がサンプリングされる。
FIG. 42 is an explanatory diagram of input pixels to be sampled.
As shown in the figure, the input image 1 is equally divided into small regions by a boundary 51V parallel to the sub-scanning direction and a boundary 51H parallel to the main scanning direction. Although this small area includes many pixels, as shown in the figure, a black circle pixel 74A and a white circle pixel 74B are set, and only the black circle pixel 74A is sampled. The pixel intervals at both ends of the pixels included in the area are set in the main scanning direction Dx and the sub-scanning direction Dy as shown in the figure. Then, the sampling interval was set to A. Here, in practice, every other pixel is sampled at intervals of A in both the main scanning direction and the sub-scanning direction.

図43には、サンプリング後の画像説明図を示す。
図の左側に示すものが元の入力画像であって、右側に示すものがサンプリングされた入力画素の集まりを示す。この図に示すように、サンプリング間隔を縦横同じに設定すると、サンプリングされた入力画素の集まりが元の入力画像と相似形の画像となる。
FIG. 43 shows an image explanatory diagram after sampling.
The one shown on the left side of the figure is the original input image, and the one shown on the right side is a collection of sampled input pixels. As shown in this figure, when the sampling interval is set to be the same in the vertical and horizontal directions, a group of sampled input pixels becomes an image similar in shape to the original input image.

図44には、具体例7の動作フローチャートを示す。
この処理は、大部分図39に示す具体例6の動作フローチャートと同様である。図44の具体例では、ステップS5とステップS8とステップS9を新たに追加している。他の部分は図39と同様の処理であるため、重複する説明を省略する。まず図44のステップS5ではAの値を求める。即ち、ここでサンプリングの間隔を読み込む。画素1個おきでサンプリングを行う場合には、このAの値は既に説明したように“2”となる。更に、ステップS7で入力画素を読み込んだ直後、ステップS8でIYをAで割った余りと0を比較することで、サンプリング行であるかどうかの判断をする。
FIG. 44 shows an operation flowchart of the seventh embodiment.
This processing is almost the same as the operation flowchart of the specific example 6 shown in FIG. In the specific example of FIG. 44, steps S5, S8, and S9 are newly added. The other parts are the same as those in FIG. 39, and thus the description thereof will not be repeated. First, in step S5 in FIG. 44, the value of A is obtained. That is, the sampling interval is read here. When sampling is performed for every other pixel, the value of A is "2" as described above. Further, immediately after the input pixel is read in step S7, it is determined in step S8 whether or not the pixel is a sampling row by comparing 0 with the remainder obtained by dividing IY by A.

これによって、今読み込んだラインがサンプリング間隔から見て合計処理をすべきラインか、スキップするラインかを判断する。スキップするラインであれば、ステップS8からステップS16まで進む。なお、サンプリング対象となっていないラインであっても領域の境界になる場合がある。従って、ステップS8からステップS16への処理に進んでborder・yの値を調べるようになっている。ステップS16以下は具体例1と同一のため図示を省略した。   Thus, it is determined whether the currently read line is a line to be summed or a line to be skipped in view of the sampling interval. If it is a line to be skipped, the process proceeds from step S8 to step S16. Note that a line that is not a sampling target may be a boundary of an area. Accordingly, the process proceeds from step S8 to step S16 to check the value of border · y. Step S16 and subsequent steps are the same as in the first embodiment, and are not shown.

ステップS8では読み込んだラインがスキップすべきものかを判断したが、ステップS9では、そのラインの処理に移った場合に、着目している画素がスキップすべきものかどうかを、IXをAで割った余りと0を比較することによって判断する。スキップすべきものであればステップS9からステップS11に進み、その画素が境界画素かどうかの判断に移る。サンプリングすべき画素と判断した場合には、ステップS9からステップS10に進み、その画素値がHTに加算され集計される。   In step S8, it was determined whether the read line should be skipped. In step S9, when the processing of the line was started, whether or not the pixel of interest should be skipped was obtained by dividing IX by A. It is determined by comparing 0 and 0. If the pixel should be skipped, the process proceeds from step S9 to step S11 to determine whether the pixel is a boundary pixel. If it is determined that the pixel should be sampled, the process proceeds from step S9 to step S10, and the pixel value is added to HT and totalized.

なお、IYとAあるいはIXとAの剰余を求める場合には、次のような処理を具体的に行う。
ここで、予めいくつかのパラメータを設定する。
(1)具体例1と同様に、平均は出力画素に対応する入力画素のグループ毎に求める。ただし、具体例1と異なり、グループ内全ての入力画素の合計を求めるわけではない。
(2)一定の間隔Aで、合計を取る入力画素をサンプリングする。A=1の場合は全ての入力画素をサンプリングすることになる。サンプリングの間隔Aは縦横一定である。これは、サンプリング後の画像が、元の画像と相似になるようにしたいためである。
When the remainder of IY and A or IX and A is obtained, the following processing is specifically performed.
Here, some parameters are set in advance.
(1) As in the first embodiment, an average is obtained for each group of input pixels corresponding to output pixels. However, unlike the specific example 1, the sum of all the input pixels in the group is not calculated.
(2) At regular intervals A, the input pixels to be summed are sampled. When A = 1, all input pixels are sampled. The sampling interval A is constant vertically and horizontally. This is because the image after sampling should be similar to the original image.

次にAの求め方を示す。求め方を示すにあたって、いくつかパラメータを設定する。
(1)合計できる入力画素の最大数をNとする。Nは合計の計算の精度と、入力画素の階調数によって求まる。例えば、画素値が256階調(この場合、画素値の最大数は255)で、16ビットで合計を求める場合、16ビットで表現できる最大数は65535なので、全ての画素が255である場合を考えるとN*255≦65535を満たす必要がある。つまり、N=257となる。
(2)グループ中の横方向の画素の数をDx、縦方向の画素の数をDyとする。Aの間隔でサンプリングする場合、サンプリングする画素数はグループ中には横方向にDx/A、縦方向にDy/Aである。そして、サンプリング数はNを超えてはいけないので、間隔Aは、次のような式を満たす必要がある。
(Dx/A)*(Dy/A)≦N …(9)
ただし、Aは整数である。
Next, how to obtain A will be described. To show how to find it, we set some parameters.
(1) Let N be the maximum number of input pixels that can be summed. N is determined by the accuracy of the total calculation and the number of gradations of the input pixel. For example, when the pixel value is 256 gradations (in this case, the maximum number of pixel values is 255) and the total is calculated by 16 bits, the maximum number that can be expressed by 16 bits is 65535. Considering this, it is necessary to satisfy N * 255 ≦ 65535. That is, N = 257.
(2) The number of pixels in the horizontal direction in the group is Dx, and the number of pixels in the vertical direction is Dy. When sampling at intervals of A, the number of pixels to be sampled is Dx / A in the horizontal direction and Dy / A in the vertical direction in the group. Since the sampling number must not exceed N, the interval A needs to satisfy the following expression.
(Dx / A) * (Dy / A) ≦ N (9)
Here, A is an integer.

また、Aを必要以上に大きくすることは、サンプリングする量を減らしてしまうことになるため、Aは(9)式を満たす最小の数である必要がある。つまり、A−1は(9)式を満たさないが、Aは(9)式を満たすような値がAの値である。このようなAは(Dx/A′)*(Dy/A′)=NとなるA′について小数部を切り上げることで求めることができる。
A′の値は、(Dx/A′)*(Dy/A′)=Nを解くことで、次のようになる。
A′=sqrt((Dx*Dy)/N) …(10)
Further, if A is made larger than necessary, the amount of sampling is reduced. Therefore, A needs to be the minimum number that satisfies the expression (9). That is, A-1 does not satisfy the expression (9), but A is a value that satisfies the expression (9). Such A can be obtained by rounding up the decimal part of A 'where (Dx / A') * (Dy / A ') = N.
The value of A ′ is as follows by solving (Dx / A ′) * (Dy / A ′) = N.
A ′ = sqrt ((Dx * Dy) / N) (10)

AはA′の小数部分を切り上げたものなので、次のようになる。
A=[A′]+1 (A′が整数でない場合) …(11)
A=A′ (A′が整数のとき) …(12)
ただし、[A′]はガウス記号でA′を超えない最大の整数の意味であり、sqrtは平方根の意味である。
A is obtained by rounding up the decimal part of A ', and is as follows.
A = [A '] + 1 (when A' is not an integer) (11)
A = A '(when A' is an integer) (12)
Here, [A '] means the largest integer not exceeding A' in a Gaussian symbol, and sqrt means square root.

なお、Dx,Dyの値は、グループによって異なる。つまり、あるグループのDx,Dyで求めたAは別のグループではオーバーフローを引き起こしてしまう可能性がある。
しかし、Aの計算の際に、Dx,Dyの最大値を用いることで、全てのグループで問題無く使用できるAの値を得ることができる。
Dx,Dyの最大値は、入力画像のサイズsrc・x,src・yから、次の式で求めることができる。
Dx:src・x/dst・xを切り上げたもの
Dy:src・y/dst・yを切り上げたもの
Note that the values of Dx and Dy differ depending on the group. That is, A obtained by Dx and Dy of a certain group may cause overflow in another group.
However, by using the maximum values of Dx and Dy when calculating A, it is possible to obtain a value of A that can be used without any problem in all groups.
The maximum values of Dx and Dy can be obtained from the input image sizes src · x and src · y by the following equations.
Dx: Rounded up src · x / dst · x Dy: Rounded up src · y / dst · y

〈具体例7の効果〉
以上のように、一定の間隔Aでサンプリングを行えば、小領域に含まれる画素数が多い場合に、これらのうちの任意の数の画素に絞って合計を行うことができる。これにより、途中結果バッファに合計を求めて保持する場合に、その合計値が必要以上に大きくならず、バッファのメモリ容量を十分に小さく抑えることができる。
<Effect of Specific Example 7>
As described above, if sampling is performed at a constant interval A, when the number of pixels included in the small area is large, the total can be performed by narrowing down to an arbitrary number of the pixels. As a result, when the total is obtained and stored in the intermediate result buffer, the total value does not increase more than necessary, and the memory capacity of the buffer can be sufficiently reduced.

〈具体例8〉
図45に、具体例8の装置のブロック図を示す。
この具体例では、具体例7の装置に対しサンプリングの間隔Aと共にサンプリング合計カウンタSTを記憶する領域を加える。他の部分は具体例7と同様の構成である。
<Specific Example 8>
FIG. 45 shows a block diagram of the device of the eighth embodiment.
In this specific example, an area for storing the sampling total counter ST together with the sampling interval A is added to the device of the specific example 7. Other parts have the same configuration as that of the seventh embodiment.

図46には、具体例8の処理説明図を示す。
上記の処理では、サンプリングを行うことによって途中結果バッファのレジスタがオーバーフローすることなく、画素値を合計しその平均を求めることができる。なお、この場合、サンプリングされない入力画素は無視されていた。この具体例でサンプリングされない画素についても平均をとるようにし、画質の向上を図る。この平均をとる範囲を定義するために、サンプリング領域という概念を導入する。サンプリング領域は、サンプリング対象になるラインについて、サンプリングの対象となっている入力画素から、すぐ右の隣のサンプリング対象となっている入力画素を含むいくつかの入力画素から構成される。これは幅がAで、高さが1ライン分の入力画像上の領域となる。図46に示す黒丸の画素は、サンプリング対象となるラインの画素である。そして、ここでは隣合う2個ずつの画素をサンプリング領域80に設定する。こうして、図の左側に示すような元の入力画像に対し画素を平均化することによって、図の右側に示すような、元の入力画像と相似形の入力画素の集まりができる。
FIG. 46 is a process explanatory diagram of the specific example 8.
In the above processing, the pixel values are summed and the average can be obtained without overflowing the register of the intermediate result buffer by performing sampling. In this case, input pixels that are not sampled have been ignored. In this specific example, an average is also taken for pixels that are not sampled, thereby improving the image quality. In order to define the range for taking the average, the concept of a sampling area is introduced. The sampling area includes, for a line to be sampled, several input pixels including an input pixel to be sampled and an input pixel to be sampled immediately adjacent to the line. This is an area on the input image having a width of A and a height of one line. The pixels indicated by black circles in FIG. 46 are pixels on the line to be sampled. Then, two adjacent pixels are set in the sampling area 80 here. In this way, by averaging the pixels with respect to the original input image as shown on the left side of the figure, a group of input pixels similar in shape to the original input image as shown on the right side of the figure can be formed.

図47には、サンプリング領域の説明図を示す。
例えば、この図に示すように、境界51Hと51Vとによって設定された1つの小領域に多数の画素が存在する場合、Aライン毎にサンプリングが行われるとする。このとき、最初のラインの黒丸の画素74Aとその右隣の画素47Bとは同一のサンプリング領域80に含まれる。この同一のサンプリング領域80に含まれる画素の画素値は図45に示すサンプリング合計カウンタSTでその都度加算され平均化され、その後図45に示す横方向の合計カウンタHTに累積される。このように、その都度サンプリング領域に含まれる画素値を平均化した上で、途中結果バッファ54にその画素値を累積するようにすれば、実質的にサンプリング数が多くても合計値がオーバーフローするおそれがない。
FIG. 47 shows an explanatory diagram of the sampling area.
For example, as shown in this drawing, when a large number of pixels exist in one small area set by the boundaries 51H and 51V, sampling is performed for each A line. At this time, the pixel 74A of the black circle on the first line and the pixel 47B on the right side thereof are included in the same sampling area 80. The pixel values of the pixels included in the same sampling area 80 are added and averaged each time by a sampling total counter ST shown in FIG. 45, and then accumulated in a horizontal total counter HT shown in FIG. In this way, by averaging the pixel values included in the sampling area each time, and accumulating the pixel values in the intermediate result buffer 54, the total value overflows even if the sampling number is substantially large. There is no fear.

図48には、具体例8の動作フローチャートを示す。
このフローチャートは、図39を用いて説明した具体例6のフローチャートと、ステップS5〜ステップS8の部分のみが異なる。まず、ステップS1〜ステップS4までで初期化処理が行われるが、ステップS5で、1ライン分の各画素の処理に移ったとき、図45に示したサンプリング合計カウンタSTに入力画素バッファのIX番目の要素を足す。次のステップS6で、IX+1番目、即ちその隣の画素とサンプリング数との比較を行う。サンプリング数よりも小さい場合には、サンプリング領域内部である。従って、このステップS6で、サンプリング合計カウンタSTに同一のサンプリング領域に含まれる画素の画素値全てを加算する処理を繰り返す。全ての加算処理が終えるとステップS6からステップS7に進み、ここではサンプリング合計カウンタSTをサンプリング数で割ることによって、サンプリング領域内の画素値の平均を求める。次に、これを横方向の合計カウンタHTに加算する。こうして、サンプリング領域内の画素値の平均をHTに加算した上で、ステップS8でサンプリング合計カウンタSTの初期化を行い、次の処理へ進む。
このようなステップS5〜ステップS8の処理をこれまでの具体例に含めることによって、サンプリング領域内の平均値算出が可能になる。
FIG. 48 shows an operation flowchart of the specific example 8.
This flowchart is different from the flowchart of the specific example 6 described with reference to FIG. 39 only in steps S5 to S8. First, the initialization processing is performed in steps S1 to S4. When the processing shifts to processing of each pixel for one line in step S5, the IX-th input pixel buffer of the input pixel buffer is stored in the sampling total counter ST shown in FIG. Element. In the next step S6, a comparison is made between the IX + 1-th pixel, that is, the pixel adjacent thereto and the sampling number. If it is smaller than the sampling number, it is inside the sampling area. Therefore, in step S6, the process of adding all the pixel values of the pixels included in the same sampling area to the sampling total counter ST is repeated. When all the adding processes are completed, the process proceeds from step S6 to step S7, where the average of the pixel values in the sampling area is obtained by dividing the sampling total counter ST by the number of samples. Next, this is added to the total counter HT in the horizontal direction. In this way, after adding the average of the pixel values in the sampling area to HT, the sampling total counter ST is initialized in step S8, and the process proceeds to the next processing.
By including the processing of steps S5 to S8 in the specific examples so far, it becomes possible to calculate the average value in the sampling area.

図49には、具体例8の初期化処理フローチャートを示す。
図48のステップS1では、この具体例8特有の初期化処理が行われる。その内容は、この図に示すように、ステップS31〜ステップS34については、図44のステップ1〜ステップS4のこれまでの初期化処理と全く同様である。また、ステップS35では、図44の具体例7の処理と同様に、サンプリング間隔Aの値を求める。そして、ステップS36では、サンプリング合計カウンタSTの初期化を行う。こうして、合計処理のための準備が終了する。
FIG. 49 shows a flowchart of the initialization process of the specific example 8.
In step S1 of FIG. 48, an initialization process unique to the specific example 8 is performed. As shown in this figure, the contents of steps S31 to S34 are exactly the same as those of the previous initialization processing of steps 1 to S4 in FIG. In step S35, the value of the sampling interval A is determined in the same manner as in the process of the specific example 7 in FIG. Then, in step S36, the sampling total counter ST is initialized. Thus, the preparation for the total processing is completed.

〈具体例8の効果〉
この具体例8によれば、小領域に含まれる画素数が多く、これらの画素値を合計した場合に、途中結果バッファの各レジスタが桁数の面でオーバーフローするような場合に、元の画像の画質を損なうことなく平均化処理が可能になる。即ち、サンプリング領域については予め平均化を行った後、途中結果バッファにその平均値を加算するような累積方法をとるため、途中結果バッファがオーバーフローしない。
なお、上記の例では、主走査方向についてのみサンプリング領域を設定する例を示したが、副走査方向についても同様のサンプリング領域を設定して、オーバーフローを防止することが可能である。
<Effect of Specific Example 8>
According to this specific example 8, when the number of pixels included in the small area is large and when these pixel values are summed up and each register of the intermediate result buffer overflows in terms of the number of digits, the original image Averaging processing can be performed without deteriorating the image quality of the image. That is, the sampling area is averaged in advance, and then an accumulation method is used in which the average value is added to the intermediate result buffer, so that the intermediate result buffer does not overflow.
In the above example, an example in which the sampling area is set only in the main scanning direction has been described. However, it is possible to prevent the overflow by setting the same sampling area in the sub-scanning direction.

〈具体例9〉
これまで説明した例では、例えば画像を拡大する場合、各行及び各列単位に画素を何回コピーするかという整数倍率を計算する必要があった。こうして計算した結果をもとに、まず、拡大/縮小テーブルを用意し、その後、このテーブルを参照しながら拡大/縮小処理を行う。こうすれば、テーブルの参照だけで画素ごとの拡大/縮小倍率を得られることから、画像拡大/縮小処理の高速化が図られる。しかしながら、拡大前後の画像サイズによっては、拡大/縮小テーブルのデータ量が大きくなり、メモリ効率を低下させる場合もある。この具体例では、拡大/縮小倍率の演算を高速に簡単に行えるようにして、これまでとは逆に、拡大/縮小テーブルを不要にして、メモリエリアを節約する。
この具体例では、以下、行とかラインとかいう用語を用いて説明を行うが、これは主走査方向を示す。列方向即ち、副走査方向についても同様の処理ができることはいうまでもない。
<Example 9>
In the examples described so far, for example, when an image is enlarged, it is necessary to calculate an integer magnification of how many times a pixel is copied for each row and each column. Based on the calculation result, an enlargement / reduction table is first prepared, and then enlargement / reduction processing is performed with reference to this table. In this case, since the enlargement / reduction magnification for each pixel can be obtained only by referring to the table, the speed of the image enlargement / reduction processing can be increased. However, depending on the image size before and after the enlargement, the data amount of the enlargement / reduction table becomes large, and the memory efficiency may be reduced. In this specific example, the calculation of the enlargement / reduction magnification can be performed easily at high speed, and conversely, the enlargement / reduction table is not required, and the memory area is saved.
In this specific example, description will be made below using terms such as a row and a line, which indicate the main scanning direction. It goes without saying that the same processing can be performed in the column direction, that is, in the sub-scanning direction.

図50には、この具体例において実施をする妥当なアルゴリズムの説明図を示す。
図の1番左に示す(1)が原画像であって、白または黒で塗り潰した部分は1ライン分の画素群である。図の真ん中に示した(2)は、(1)の画像を縦方向に丁度1.75倍した状態を示す。もし、各ラインが実数倍即ち1.75倍という倍率で縦方向にそのまま拡大できるならば、この(2)に示すような結果になる。
FIG. 50 is an explanatory diagram of an appropriate algorithm to be implemented in this specific example.
(1) shown on the leftmost side of the figure is the original image, and a portion filled with white or black is a pixel group for one line. (2) shown in the middle of the figure shows a state in which the image of (1) is exactly 1.75 times in the vertical direction. If each line can be directly enlarged in the vertical direction at a magnification of a real number, that is, 1.75 times, the result shown in (2) is obtained.

即ち、1ライン目は0.00〜1.75、2ライン目は1.75〜3.50、…というように拡大され、最後の8ライン目は12.25〜14.00という幅に拡大される。従って、原画像8ライン分が拡大画像では、14ライン分の幅に拡大されたことになる。しかしながら、画像データでは、各ラインは整数単位でしか拡大/縮小をすることができない。つまり、ライン間の境界は整数になる必要がある。そこで、ライン間の境界を実数倍率で得られた値を超えない整数と定義する。その結果、1ライン目はそのまま、2ライン目は2倍、3ライン目は2倍、4ライン目も2倍、5ライン目は1倍というように原画像の各ラインを整数倍にし、最終的に原画像7ライン分を14ライン分に拡大する。   That is, the first line is expanded to 0.00-1.75, the second line is expanded to 1.75-3.50, etc., and the last eighth line is expanded to width 12.25-14.00. Is done. Therefore, in the enlarged image, eight lines of the original image are enlarged to a width of 14 lines. However, in the image data, each line can be enlarged / reduced only in integer units. That is, the boundaries between lines must be integers. Therefore, a boundary between lines is defined as an integer that does not exceed a value obtained by a real magnification. As a result, each line of the original image is integer-multiplied so that the first line is unchanged, the second line is doubled, the third line is doubled, the fourth line is doubled, and the fifth line is doubled. The original image is expanded from 7 lines to 14 lines.

上記のような各ラインの整数倍率は以下の計算で求められる。
MUL(n)=[n*mul]−[(n−1)*mul]
但し、mul=(出力画像のサイズ)/(入力画像のサイズ)である。
また、式の中で使用した各記号の意味は次の通りである。
[]:ガウス記号(内部の実数を超えない整数)
n:行番号(n=1から始まるものとする)
The integer magnification of each line as described above is obtained by the following calculation.
MUL (n) = [n * mul]-[(n-1) * mul]
Here, mul = (size of output image) / (size of input image).
The meaning of each symbol used in the formula is as follows.
[]: Gaussian symbol (an integer not exceeding the internal real number)
n: line number (assume n = 1)

拡大処理の要領は、行方向も列方向も全く同様である。従って、各画素に割り振る整数倍率は、このように計算すれば、拡大処理ができる。ところが、この計算では、上記の整数倍率計算式に示すように、整数演算を2回、実数演算を2回、実数から整数への型変換を2回行う。こうした演算は非常に時間がかかり、1画素ずつ処理をする度にこの計算を実行すると、CPUの能力によっては、時間がかかり過ぎて現実的でない。   The procedure of the enlargement process is exactly the same in the row direction and the column direction. Therefore, if the integer magnification assigned to each pixel is calculated in this way, enlargement processing can be performed. However, in this calculation, an integer operation is performed twice, a real number operation is performed twice, and a type conversion from a real number to an integer is performed twice, as shown in the above-mentioned integer magnification calculation formula. Such an operation is very time-consuming, and if this calculation is performed each time one pixel is processed, it takes too much time and is not realistic depending on the capacity of the CPU.

上記のアルゴリズムによって、各ラインに分配される整数倍率を分析してみる。各ラインの倍率は最低でも実数倍率の整数部分となっている。つまり、1.75倍であれば、各ラインの倍率は最低でも1倍となり、2.5倍ならば2倍となる。また、小数部分が桁上がりした場合にのみ、倍率が1だけ増加する。つまり、指定された実数倍率をmulとすると、全てのラインは最低でもBASE=[mul]倍となり、小数部分が繰り上がった場合のみBASE+1倍となる。   The integer magnification distributed to each line will be analyzed by the above algorithm. The magnification of each line is at least an integral part of the real magnification. That is, at 1.75 times, the magnification of each line is at least 1 time, and at 2.5 times, 2 times. Also, the magnification is increased by 1 only when the decimal part carries. That is, assuming that the designated real number magnification is mul, all lines are at least BASE = [mul] times, and are BASE + 1 times only when the decimal part is raised.

そこで、小数部分が繰り上がったかどうかを判定する方法を考える。指定された実数倍率の小数部分をDEC、行番号nとした場合、n*DECの小数部分がDECより小さいときに、繰り上がりが発生したと判定できる。   Therefore, a method of determining whether the decimal part has been raised is considered. When the decimal part of the designated real number magnification is DEC and the row number is n, when the decimal part of n * DEC is smaller than DEC, it can be determined that carryover has occurred.

図51には、繰り上がり発生の判定方法説明図を示す。
例えば、ここでDEC=0.3の場合を考える。最初の1ライン目は小数部分が0.3である。2ライン目は小数部分が0.6になる。3番目は小数部分が0.9になる。そして、4番目は小数部分が0.2となり、1だけ繰り上がるから1ライン増やすことになる。ここで、1ライン目、2ライン目、3ライン目の小数部分は必ずDECより大きい。そして、繰り上がりが生じるときの小数部分は0.2となっている。このとき、初めて小数部分がDECより小さくなる。このアルゴリズムをまとめると次のようになる。
FIG. 51 is an explanatory diagram of a method for determining the occurrence of carryover.
For example, consider the case where DEC = 0.3. The first line has a decimal part of 0.3. The second line has a decimal part of 0.6. The third has a decimal part of 0.9. In the fourth case, the decimal part becomes 0.2, and the number is advanced by one, so that one line is added. Here, the decimal part of the first, second, and third lines is always larger than DEC. The fractional part when the carry-over occurs is 0.2. At this time, the decimal part becomes smaller than DEC for the first time. The algorithm is summarized as follows.

前処理として、以下の値を計算しておく。
BASE=[mul]
DEC =mul−BASE
各行毎の倍率は以下のように求める。
DEC*nの小数部≧DECの場合、倍率はBASE
DEC*nの小数部<DECの場合、倍率はBASE+1
以上のようなアルゴリズムは実数乗算が1回、実数比較(実数減算)が1回、実数から小数部分のみを取り出す処理(実数減算)が1回必要となるが、既に説明した処理に比べて演算回数が減少している。
The following values are calculated as preprocessing.
BASE = [mul]
DEC = mul-BASE
The magnification for each line is obtained as follows.
If the decimal part of DEC * n ≧ DEC, the magnification is BASE
If the decimal part of DEC * n <DEC, the magnification is BASE + 1
The algorithm described above requires one real number multiplication, one real number comparison (real number subtraction), and one process of extracting only a decimal part from a real number (real number subtraction). The number has decreased.

ここで、このアルゴリズムの演算処理をレジスタ幅の限界を利用して高速化する。例えば、CPU幅が32ビットであると仮定する。
前処理として、以下の値を計算しておく。
BASE=[mul]
DEC =(mul−BASE)*232+1
DECは32ビット幅の整数レジスタで保持する。
上記BASEは整数部分、DECは小数部分である。+1としたのは、さらに下位の小数部分が存在する場合に、切り上げ処理をするためである。
Here, the arithmetic processing of this algorithm is accelerated by utilizing the limit of the register width. For example, assume that the CPU width is 32 bits.
The following values are calculated as preprocessing.
BASE = [mul]
DEC = (mul-BASE) * 232 + 1
DEC is held in a 32-bit width integer register.
The BASE is an integer part, and the DEC is a decimal part. The reason why the value is set to +1 is to round up when a lower decimal part exists.

DECに処理対象ライン位置nをかける。この計算結果をDEC2とする。
DEC2=DEC*n
計算結果のDEC2は32ビット幅の整数レジスタで保持する。
DEC,DEC2の大小比較により、整数倍率を決定する。
DEC2≧DECの場合、倍率はBASE
DEC2<DECの場合、倍率はBASE+1
Multiply the DEC by the processing target line position n. This calculation result is DEC2.
DEC2 = DEC * n
DEC2 as a calculation result is held in a 32-bit integer register.
The integer magnification is determined by comparing the magnitudes of DEC and DEC2.
If DEC2≥DEC, the magnification is BASE
When DEC2 <DEC, the magnification is BASE + 1

以上の処理では32ビット幅の整数レジスタを利用し、小数部を0〜232−1までの整数で表現する。DEC*nの計算においては、整数部分を意図的にオーバーフローさせてしまう。これにより、計算結果として、整数部分を無効にし、小数部分だけが残るアルゴリズムを利用する。整数の乗算が1回、整数比較(整数減算)が1回行われるだけの高速なアルゴリズムである。但し、このアルゴリズムでは、小数部を0〜232−1までの整数に丸めてしまう。従って浮動小数点の精度で計算した場合とは厳密には一致しないことが有り得る。この処理は、インクリメントするCPUのレジスタ幅によって、64ビット、128ビット等に拡張でき、レジスタ幅が大きくなるほど精度が向上する。   In the above processing, a 32-bit integer register is used, and the decimal part is represented by an integer from 0 to 232-1. In the calculation of DEC * n, the integer part overflows intentionally. As a result, an algorithm is used in which the integer part is invalidated and only the decimal part remains as the calculation result. This is a high-speed algorithm in which only one integer multiplication and one integer comparison (integer subtraction) are performed. However, in this algorithm, the decimal part is rounded to an integer from 0 to 232-1. Therefore, it may not exactly match the case where the calculation is performed with floating point precision. This processing can be extended to 64 bits, 128 bits, or the like depending on the register width of the CPU to be incremented, and the accuracy increases as the register width increases.

図52に、具体例9の装置のブロック図を示す。
この装置は、外部記憶装置91と最近傍法拡大/縮小装置92を備える。この最近傍法拡大/縮小装置92には、倍率計算部93、最近傍法拡大/縮小処理部94及びラインバッファ95が設けられている。また、この装置の出力は、出力画像フレームバッファ96に取り出されるよう構成されている。
FIG. 52 shows a block diagram of the device of the ninth embodiment.
This device includes an external storage device 91 and a nearest-neighbor enlargement / reduction device 92. The nearest-neighbor enlargement / reduction device 92 includes a magnification calculator 93, a nearest-neighbor enlargement / reduction processing unit 94, and a line buffer 95. Further, the output of this device is configured to be taken out to the output image frame buffer 96.

外部記憶装置91は、拡大/縮小処理前の入力画像データを保持する装置である。出力画像フレームバッファ96は、最近傍法による拡大/縮小後の出力画像を保持する記憶装置である。   The external storage device 91 is a device that holds input image data before enlargement / reduction processing. The output image frame buffer 96 is a storage device that holds the output image after the enlargement / reduction by the nearest neighbor method.

最近傍法拡大/縮小処理部94は、ラインバッファ95内のラインデータに対して倍率計算部93により計算された整数倍率分だけ拡大/縮小を施して、画像データを出力画像フレームバッファ96に出力する装置である。倍率計算部93は、最近傍法拡大/縮小処理部94から入力画素の座標値を受け入れ、その画素に対応する整数倍率を演算する部分である。ラインバッファ95は、外部記憶装置91から1ライン分ずつ読み込んだ入力画像データを保持する記憶部である。   The nearest neighbor method enlargement / reduction processing unit 94 enlarges / reduces the line data in the line buffer 95 by the integer magnification calculated by the magnification calculation unit 93, and outputs image data to the output image frame buffer 96. It is a device to do. The magnification calculator 93 is a part that receives the coordinate value of the input pixel from the nearest neighbor enlarging / reducing processor 94 and calculates an integer magnification corresponding to the pixel. The line buffer 95 is a storage unit that stores input image data read one line at a time from the external storage device 91.

図53に、図52に示した倍率計算部93のブロック図を示す。
この倍率計算部93は、乗算部103,104、比較/選択部105,106及び倍率計算器107を備えている。倍率計算器107には、レジスタDECX1,DECX2,BASEX1,BASEX2,DECY1,DECY2,BASEY1,BASEY2が設けられている。乗算部103は、X座標101を受け入れて所定の整数乗算を行う計算部である。乗算部104は、Y座標102を受け入れて所定の整数乗算を行う計算部である。
FIG. 53 is a block diagram of the magnification calculator 93 shown in FIG.
The magnification calculator 93 includes multiplication units 103 and 104, comparison / selection units 105 and 106, and a magnification calculator 107. The magnification calculator 107 is provided with registers DECX1, DECX2, BASEX1, BASEX2, DECY1, DECY2, BASEY1, and BASEY2. The multiplication unit 103 is a calculation unit that receives the X coordinate 101 and performs a predetermined integer multiplication. The multiplication unit 104 is a calculation unit that receives the Y coordinate 102 and performs a predetermined integer multiplication.

比較/選択部105は、レジスタDECX1,DECX2,BASEX1,BASEX2の出力を受け入れてそのいずれかを選択し、X方向倍率108を出力する部分である。比較/選択部106は、レジスタDECY1,DECY2,BASEY1,BASEY2の出力を受け入れて、そのいずれかを選択し、Y方向倍率109を出力する部分である。X座標101、Y座標102は、図52に示した最近傍法拡大/縮小処理部94により指定された処理対象画素の座標値である。   The comparison / selection unit 105 is a unit that receives the outputs of the registers DECX1, DECX2, BASEX1, and BASEX2, selects one of them, and outputs the X-direction magnification 108. The comparison / selection unit 106 is a unit that receives the outputs of the registers DECY1, DECY2, BASEY1, and BASEY2, selects one of them, and outputs the Y-direction magnification 109. The X coordinate 101 and the Y coordinate 102 are the coordinate values of the processing target pixel specified by the nearest neighbor enlarging / reducing processing unit 94 shown in FIG.

X方向倍率108、Y方向倍率109は倍率計算部93から出力され、最近傍法拡大/縮小処理部94に向けて出力される計算結果である。これによって、指定された座標値に対応する整数倍率がX方向、Y方向について、それぞれ出力されることになる。   The X-direction magnification 108 and the Y-direction magnification 109 are calculation results output from the magnification calculation unit 93 and output to the nearest neighbor enlargement / reduction processing unit 94. As a result, an integer magnification corresponding to the designated coordinate value is output in each of the X direction and the Y direction.

図54には、具体例9の動作フローチャートを示す。
まず、ステップS1において、最初に指定された実数倍率に従って倍率計算部93内部のレジスタの設定を行う。レジスタ設定については後で詳細に説明する。次に、ステップS2において、外部記憶装置91からラインバッファ95へ入力画像1ライン分を読み込む。ステップS3において、読み込んだラインデータのY座標に対応する整数倍率を倍率計算部93によって計算する。ステップS4では、ラインバッファ中の処理対象画像データのX座標に対応する整数倍率を倍率計算部93により計算する。
FIG. 54 shows an operation flowchart of the ninth embodiment.
First, in step S1, a register in the magnification calculator 93 is set in accordance with the first specified real number magnification. The register setting will be described later in detail. Next, in step S2, one line of the input image is read from the external storage device 91 to the line buffer 95. In step S3, the magnification calculator 93 calculates an integer magnification corresponding to the Y coordinate of the read line data. In step S4, the magnification calculator 93 calculates an integer magnification corresponding to the X coordinate of the processing target image data in the line buffer.

次に、ステップS5に進み、画素を複製し、出力画像フレームバッファ96に出力する。ステップS6は、これをX方向倍率分繰り返すための処理である。ステップS7は、入力画像ライン幅分だけこの処理を繰り返す制御を行う部分である。ステップS8は、ステップS4〜ステップS7の処理をラインデータのY方向倍率分だけ繰り返す制御を行う。ステップS9で、入力画像ライン数分、上記の処理を繰り返す。
以上の処理によって、出力画像フレームバッファには、入力画像データの上から下、左から右に向かって順に各画素の複製が出力されていく。
Next, the process proceeds to step S5, where the pixel is copied and output to the output image frame buffer 96. Step S6 is a process for repeating this for the X-direction magnification. Step S7 is a part for performing control to repeat this processing for the input image line width. In step S8, control is performed to repeat the processing in steps S4 to S7 by the Y-direction magnification of the line data. In step S9, the above processing is repeated for the number of input image lines.
By the above processing, a copy of each pixel is sequentially output to the output image frame buffer from top to bottom of the input image data and from left to right.

図55には、拡大/縮小の処理過程の説明図を示す。
図の黒丸印で示した画素は出力画像の画素である。また、図の格子で仕切った各領域は入力画素の1画素に対応する。X軸方向、Y軸方向共に整数倍率でないため、入力画素1画素分の領域は、それぞれ異なる画素数の出力画素に対応している。
FIG. 55 is an explanatory diagram of the enlargement / reduction processing.
Pixels indicated by black circles in the figure are pixels of the output image. Each area partitioned by the grid in the figure corresponds to one input pixel. Since the magnification is not an integer in both the X-axis direction and the Y-axis direction, the area of one input pixel corresponds to an output pixel having a different number of pixels.

図56には、レジスタ設定のフローチャートを示す。
なお、以下のレジスタ設定動作と倍率計算方法については、X方向の説明のみを行う。Y方向については同様なので説明を省略する。
まず、図53に示すレジスタDECX1,DECX2,BASEX1,BASEX2の幅をNビットとする。また、指定された実数倍の倍率をmulで表す。具体例として、レジスタ幅を32ビット(N=32)、拡大倍率2.5倍(mul=2.5)について説明する。
FIG. 56 shows a flowchart of register setting.
The following register setting operation and magnification calculation method will be described only in the X direction. Since the Y direction is the same, the description is omitted.
First, the width of the registers DECX1, DECX2, BASEX1, and BASEX2 shown in FIG. 53 is set to N bits. Also, the designated real number magnification is represented by mul. As a specific example, a description will be given of a case where the register width is 32 bits (N = 32) and the magnification is 2.5 times (mul = 2.5).

図56のステップS11において、まず指定された実数倍率を整数部と小数部に分離する。具体例のmul=2.5では、BASE=2、DEC=0.5となる。そして、整数部を示すレジスタBASEの値をBASEX1に設定する(ステップS12)。また、繰り上がりの場合は、これより“1”だけ大きい倍率が設定されるから、ステップS13において、整数分の値に“1”を加算した値をレジスタBASEX2に設定する。具体例では、BASEX1=2、BASEX2=3になる。   In step S11 of FIG. 56, first, the designated real number magnification is separated into an integer part and a decimal part. When mul = 2.5 in the specific example, BASE = 2 and DEC = 0.5. Then, the value of the register BASE indicating the integer part is set to BASEX1 (step S12). Further, in the case of carry-up, since a magnification larger by "1" is set, a value obtained by adding "1" to an integer value is set in the register BASEX2 in step S13. In a specific example, BASEX1 = 2 and BASEX2 = 3.

次に小数部を格納したレジスタDECに2Nを掛け、1を加えた整数値をDECX1に設定する。即ち、具体例では、例えば次のような計算をする。
DECX1 = DEC*2N+1
= 0.5*232+1
= 2,147,483,649
Next, the register DEC storing the decimal part is multiplied by 2N, and an integer value obtained by adding 1 is set in DECX1. That is, in the specific example, for example, the following calculation is performed.
DECX1 = DEC * 2N + 1
= 0.5 * 232 + 1
= 2,147,483,649

次に、倍率計算を実行する。
図57には、X方向倍率計算のフローチャートを示した。
ここでは、具体例としてN=32、mul=2.5、X座標は2(X=2)の場合について説明する。図53に示した乗算部103は、図52に示す最近傍法拡大/縮小処理部94によって指定されたX座標とレジスタDECX1の内容とを掛け合わせ、レジスタDECX2に設定する(ステップS21)。次のステップS22では、判断処理(ステップS23)の結果により、ステップS24あるいはステップS25を実行する。
Next, a magnification calculation is performed.
FIG. 57 shows a flowchart of calculating the magnification in the X direction.
Here, a case where N = 32, mul = 2.5, and the X coordinate is 2 (X = 2) will be described as a specific example. The multiplication unit 103 shown in FIG. 53 multiplies the X coordinate specified by the nearest neighbor enlargement / reduction processing unit 94 shown in FIG. 52 by the contents of the register DECX1, and sets the result in the register DECX2 (step S21). In the next step S22, step S24 or step S25 is executed according to the result of the judgment processing (step S23).

即ち、X座標の積を求めた結果得られた小数部DECX2が実数倍率の小数部DECX1より大きいかあるいは等しい場合には繰り上げはしない。最初の小数部以下の場合には繰り上げをする。繰り上げをしない場合には、レジスタBASEX1の内容を出力する。繰り上げをする場合には、レジスタBASEX2の内容を出力する。こうして、X方向の倍率が、レジスタBASEX1あるいはBASEX2の内容のいずれか一方を選択して得られる。
以上のようにすれば、座標値に応じた整数倍率の計算が整数乗算と比較/選択のみにより実現する。
That is, when the decimal part DECX2 obtained as a result of obtaining the product of the X coordinates is larger than or equal to the decimal part DECX1 of the real number magnification, no increment is performed. If it is less than the first decimal part, it is rounded up. If not, the contents of the register BASEX1 are output. When carrying forward, the contents of the register BASEX2 are output. Thus, the magnification in the X direction is obtained by selecting one of the contents of the registers BASEX1 and BASEX2.
According to the above, the calculation of the integral magnification according to the coordinate value is realized only by the integer multiplication and the comparison / selection.

〈具体例9の効果〉
この具体例によれば、最近傍法による画像データの実数倍率の拡大/縮小をする場合に、各行/各列に割り振る整数倍率の計算を、レジスタ幅の限界を利用して高速化できる。これによって、拡大/縮小テーブルを予め全て用意する必要がなくなる。従って、拡大/縮小テーブルを保持するためのメモリが不用になり、コンピュータのメモリ使用効率が向上する。また、最近傍法による画像データの実数倍率の拡大/縮小処理を、少ないメモリ容量で高速に実行することを可能にする。
<Effect of Specific Example 9>
According to this specific example, when enlarging / reducing the real magnification of image data by the nearest neighbor method, the calculation of the integer magnification allocated to each row / each column can be accelerated by utilizing the limit of the register width. This eliminates the need to prepare all enlargement / reduction tables in advance. Therefore, a memory for holding the enlargement / reduction table becomes unnecessary, and the memory use efficiency of the computer is improved. In addition, it is possible to perform high-speed enlargement / reduction processing of image data by the nearest neighbor method with a small memory capacity.

〈具体例10〉
画像の拡大をした場合に、コピーした画素の画素値を決定する方法として、最近傍法と一次補間法とがある。具体例4等で説明した一次補間法では、周囲4画素の画素値と各画素までの距離を用いて、尤もらしい画素値を求める。これにより、拡大処理を行った際のジャギを目立たなくし、画質を向上させる。この方法では、例えば具体例4を説明する図19に示した近傍エリアテーブルを利用する。ここにも、具体例9で用いたアルゴリズムを採用することができる。
<Specific Example 10>
As a method of determining the pixel value of a copied pixel when an image is enlarged, there are a nearest neighbor method and a primary interpolation method. In the primary interpolation method described in Example 4 and the like, a likely pixel value is obtained using the pixel values of the four surrounding pixels and the distance to each pixel. As a result, jaggies when the enlargement processing is performed are made inconspicuous, and the image quality is improved. In this method, for example, a nearby area table shown in FIG. Here, the algorithm used in the specific example 9 can be adopted.

図58を用いて、既にいくつかの具体例で説明した近傍エリアについて再度説明を行う。
図58の左側には入力画像を示し、右側には出力画像を示した。
図に示すように、入力画素で作られる格子を出力画像にマッピングすると、入力画素で作られる格子で囲まれた領域が近傍エリアとなる。一次補間処理は、この近傍エリアと呼ばれる領域を単位に行う。この近傍エリアに含まれる出力画素の数は以下の式で得られる。
A=1のとき MUL(n)=B
A≠1のとき MUL(0)=1
MUL(n)=[n*mul]−[(n−1)*mul]
(n>0)
但し、mul=(B−1)/(A−1)である。
具体例4の図19においても同様の趣旨の説明をした。
With reference to FIG. 58, the neighboring areas already described in some specific examples will be described again.
An input image is shown on the left side of FIG. 58 and an output image is shown on the right side.
As shown in the figure, when the grid formed by the input pixels is mapped to the output image, the area surrounded by the grid formed by the input pixels becomes the neighboring area. The primary interpolation process is performed in units of an area called a nearby area. The number of output pixels included in this neighboring area is obtained by the following equation.
When A = 1 MUL (n) = B
When A ≠ 1, MUL (0) = 1
MUL (n) = [n * mul]-[(n-1) * mul]
(N> 0)
Here, mul = (B-1) / (A-1).
The same effect was described in FIG. 19 of the fourth embodiment.

また、式中の記号、及び演算子の意味は下記の通りである。
A:入力画像のサイズ
B:出力画像のサイズ
n:=近傍エリアの番号(n=0から始まるものとする)
MUL(X):X番目の近傍エリアの画素数
[]:ガウス記号(内部の実数を超えない最大の整数)
具体例4の図19においても同様の趣旨の説明をした。
The meanings of symbols and operators in the formulas are as follows.
A: The size of the input image B: The size of the output image n: = Nearest area number (assume n = 0)
MUL (X): Number of pixels in the X-th neighboring area []: Gaussian symbol (the largest integer not exceeding the internal real number)
The same effect was described in FIG. 19 of the fourth embodiment.

上記の式は、最近傍法の式と基本的には変わらない。しかし、上端と左端については一次補間では常に“1”になる。これも、図19に示したとおりである。一次補間における近傍エリアに含まれる出力画素の数と最近傍法における各入力画素毎の整数倍率は基本的に同じものである。   The above equation is basically the same as the equation of the nearest neighbor method. However, the top and left ends are always "1" in the primary interpolation. This is also as shown in FIG. The number of output pixels included in the neighborhood area in the primary interpolation and the integer magnification for each input pixel in the nearest neighbor method are basically the same.

図59には、最近傍法と一次補間との処理の順番の違いを示すフローチャートを図示した。
図59(a)において、最近傍法では、まずステップS31で、X方向の倍率計算を行う。そして、ステップS32において、1画素分画素を複製し、ステップS33において、X方向の倍率分画素の複製が終了したかを判断する。これによって、X方向の倍率分画素を複製する。更に、その複製が終了すると、ステップS34において、入力画像ライン幅分の画素複製が終了したかどうかを判断する。これによって、ライン幅方向の画素複製を実行する。こうしてX方向及びY方向の画素複製が終了する。
FIG. 59 is a flowchart illustrating the difference in the processing order between the nearest neighbor method and the primary interpolation.
In FIG. 59A, in the nearest neighbor method, first, in step S31, the magnification in the X direction is calculated. Then, in step S32, the pixel for one pixel is copied, and in step S33, it is determined whether the copying of the pixel for the magnification in the X direction is completed. Thus, the pixels corresponding to the magnification in the X direction are copied. Further, when the duplication is completed, it is determined in step S34 whether or not the duplication of pixels for the input image line width has been completed. Thus, pixel duplication in the line width direction is performed. Thus, the pixel duplication in the X direction and the Y direction is completed.

図の(b)における一次補間法では、まずステップS41において、現在の整数倍率を示すMULXに初期値“1”を設定する。次にステップS42において、一次補間を実行し、ステップS43においては、MULX分の処理が終了したかどうかを判断する。そして、ステップS42をこの回数分繰り返し、ステップS44に移る。ステップS44では、MULXを更新し、ステップS45で、入力画像ライン幅分の処理が終了したかどうかを判断する。これによって、ステップS42〜ステップS44の処理を繰り返し、X方向の幅分画素の一次補間処理を終了する。
上記倍率計算とMULXの計算は、同一の演算をしている。
In the primary interpolation method shown in FIG. 3B, first, in step S41, an initial value “1” is set to MULX indicating the current integer magnification. Next, in step S42, primary interpolation is performed, and in step S43, it is determined whether the processing for MULX has been completed. Then, step S42 is repeated for this number of times, and the process proceeds to step S44. In step S44, MULX is updated, and in step S45, it is determined whether the processing for the input image line width has been completed. Thus, the processing of steps S42 to S44 is repeated, and the primary interpolation processing for pixels corresponding to the width in the X direction is completed.
The same calculation is performed for the magnification calculation and the MULX calculation.

そこで、以下の説明では、近傍エリアに含まれる出力画素の数と整数倍率とを区別せず、一次補間の場合も整数倍率と表記する。一次補間の処理は、上端の近傍エリアから下へ、左端の近傍エリアから右へと行われる。従って、全ての近傍エリアを走査するループにおいて、ループの最初では拡大倍率は“1”となり、それ以後は最近傍法の場合と同様の計算方法で整数倍率を求める。最初の近傍エリアのみ整数倍率を“1”にするための方法は、次の2つが考えられる。   Therefore, in the following description, the number of output pixels included in the neighboring area and the integral magnification are not distinguished, and the case of the primary interpolation is also described as the integral magnification. The primary interpolation process is performed from the vicinity area at the upper end to the bottom and from the vicinity area at the left end to the right. Therefore, in the loop for scanning all the neighboring areas, the enlargement magnification is "1" at the beginning of the loop, and thereafter, the integer magnification is obtained by the same calculation method as in the nearest neighbor method. The following two methods are conceivable for setting the integer magnification to “1” only in the first neighboring area.

(1)上端または左端の場合とそうでない場合とにループを分ける。
(2)整数倍率を計算する式に条件判定を入れ、画素の位置が上端または左端の場合には整数倍率を“1”にするようにする。
しかしながら、上記(1)の方式は処理が複雑になり、プログラムサイズが大きくなる欠点がある。(2)の方式は条件判定が1つ増えるため、プログラムの実行速度が落ちてしまう。この具体例10では、プログラムサイズもあまり大きくならず、実行速度も落ちない方法を紹介する。これは次の考え方で実現できる。
(1) The loop is divided into the case of the upper end or the left end and the case of not.
(2) Conditional judgment is put into the formula for calculating the integer magnification, and when the pixel position is at the upper end or the left end, the integer magnification is set to "1".
However, the method (1) has a drawback that processing becomes complicated and a program size becomes large. In the method of (2), the condition determination is increased by one, so that the execution speed of the program is reduced. In this specific example 10, a method in which the program size does not become too large and the execution speed does not decrease is introduced. This can be achieved with the following concept.

(1)具体例9の最近傍法の場合に用いた変数の他に、現在の整数倍率を示す変数MULXを用意する。
(2)MULXは近傍エリアを走査するループの先頭で、“1”に初期化する。
(3)拡大率の計算のタイミングをループの先頭ではなく、後方で行うように変更する。
(1) In addition to the variables used in the case of the nearest neighbor method of the specific example 9, a variable MULX indicating the current integer magnification is prepared.
(2) MULX is initialized to "1" at the beginning of a loop for scanning a nearby area.
(3) The calculation timing of the enlargement ratio is changed not to be at the head of the loop but at the rear.

こうすることで、MULXにはループの始めでは“1”が、それ以降ではBASEX1またはBASEX2が入ることになる。
なお、これは横方向についてのみ説明したが、縦方向についても全く同様である。
By doing so, "1" is entered in MULX at the beginning of the loop, and BASEX1 or BASEX2 is entered thereafter.
Although this has been described only in the horizontal direction, the same applies to the vertical direction.

図60に、具体例10の装置のブロック図を示す。
この装置は、外部記憶装置111、一次補間拡大/縮小装置112及び出力画像フレームバッファ119から構成される。一次補間拡大/縮小装置112は、倍率計算部113、一次補間拡大/縮小処理部114、前行ポインタ115、現行ポインタ116、ラインバッファ117、ラインバッファ118により構成される。
FIG. 60 shows a block diagram of the device of the tenth embodiment.
This device includes an external storage device 111, a primary interpolation enlargement / reduction device 112, and an output image frame buffer 119. The primary interpolation enlargement / reduction device 112 includes a magnification calculation unit 113, a primary interpolation enlargement / reduction processing unit 114, a previous line pointer 115, a current pointer 116, a line buffer 117, and a line buffer 118.

この装置は、具体例9の装置と比較すると、前行ポインタ115、現行ポインタ116、ラインバッファ117及びラインバッファ118を備えた点が異なる。近傍エリアを作るためには、上下2ラインの画素が必要であるため、このように2ライン分のラインバッファを用意した。この2ライン分のラインバッファ117,118は、上下が交互に入れ替わるので、上の行を示すポインタを前行ポインタ115、下の行を示すポインタを現行ポインタ116として区別した。   This apparatus is different from the apparatus of the ninth embodiment in that a previous line pointer 115, a current pointer 116, a line buffer 117, and a line buffer 118 are provided. In order to form a neighboring area, two lines of pixels are required. Thus, a line buffer for two lines is prepared. Since the line buffers 117 and 118 for these two lines are alternately turned upside down, the pointer indicating the upper line is distinguished as the previous line pointer 115 and the pointer indicating the lower line is distinguished as the current pointer 116.

図61には、倍率計算部のブロック図を示す。
この倍率計算部113は、具体例9の場合と同様、X座標121、Y座標122を受け入れて、X方向倍率124及びY方向倍率125を出力する回路である。倍率計算部113の中には、乗算部126,127、比較/選択部128,129及び倍率計算部123が設けられている。具体例9の場合と異なるのは、比較/選択部128の出力側にMULX131が設けられ、比較/選択部129の出力側にMULY132が設けられた点である。
FIG. 61 shows a block diagram of the magnification calculator.
The magnification calculator 113 is a circuit that receives an X coordinate 121 and a Y coordinate 122 and outputs an X-direction magnification 124 and a Y-direction magnification 125, as in the case of the specific example 9. The magnification calculator 113 includes multiplication units 126 and 127, comparison / selection units 128 and 129, and a magnification calculation unit 123. The difference from the specific example 9 is that the MULX 131 is provided on the output side of the comparison / selection unit 128 and the MULY 132 is provided on the output side of the comparison / selection unit 129.

これらのレジスタMULX,MULYは、倍率を格納するレジスタである。このレジスタの初期値に“1”を入れておくことにより、最初の近傍エリアの拡大率を“1”にすることができる。   These registers MULX and MULY are registers for storing the magnification. By setting "1" in the initial value of this register, the enlargement ratio of the first neighboring area can be set to "1".

図62には、具体例10の動作フローチャートを示す。
まず、ステップS1において、倍率計算部のレジスタ設定を実行する。この各レジスタに格納される値は、後で詳しく説明するが、レジスタMULX及びMULYに、それぞれ“1”を入れておくことが重要である。次に、ステップS2において、外部記憶装置から現行ポインタ116が指し示すラインバッファ117あるいは118にデータを読み込む。
FIG. 62 shows an operation flowchart of the specific example 10.
First, in step S1, register setting of the magnification calculator is executed. The values stored in these registers will be described in detail later, but it is important that “1” is put in each of the registers MULX and MULY. Next, in step S2, data is read from the external storage device into the line buffer 117 or 118 indicated by the current pointer 116.

そして、ステップS3において、これらのラインバッファを使用して一次補間を行う。ステップS4は、このステップS3の処理をX方向の倍率分繰り返す制御である。倍率を示すレジスタMULXは、“1”に初期化されている。X方向の拡大/縮小のループが終了したら、次のX方向の拡大率を計算し、MULXに格納する。そして、ステップS6において、以上の処理を必要なライン幅だけ行ったかどうかを判断する。   Then, in step S3, primary interpolation is performed using these line buffers. Step S4 is control for repeating the processing of step S3 by the magnification in the X direction. The register MULX indicating the magnification is initialized to “1”. When the X-direction enlargement / reduction loop is completed, the next X-direction enlargement ratio is calculated and stored in MULX. Then, in step S6, it is determined whether or not the above processing has been performed for a required line width.

ステップS7では、次の行の処理を行うために、MULXを1に設定する。ステップS8は、ステップS3からステップS7までの1行分の一次補間処理をY方向の拡大幅分即ちMULY分実行する制御である。MULYも初期値は“1”に設定されている。
次に、ステップS9において、Y方向の倍率を計算し、MULYに格納する。ステップS10は、バッファポインタを入れ替えることによって更新する。そして、ステップS11において、ステップS2〜ステップS10までの処理を入力画像のライン数分繰り返す制御を行う。
In step S7, MULX is set to 1 in order to perform the processing of the next row. Step S8 is a control for executing the primary interpolation processing for one line from step S3 to step S7 for the enlarged width in the Y direction, that is, for MULY. The initial value of MULY is also set to “1”.
Next, in step S9, the magnification in the Y direction is calculated and stored in MULY. Step S10 updates by exchanging the buffer pointer. Then, in step S11, control is performed to repeat the processing from step S2 to step S10 for the number of lines of the input image.

図63には、倍率計算部のレジスタ設定フローチャートを示す。
ここでも、具体例9の場合と同様に、図61に示した倍率計算部113の各レジスタのビット幅をNビットとする。入力画像の幅Aと出力画像の幅Bから実数倍率mulを求める(ステップS11)。次に、求めた実数倍率mulを整数部と小数部とに分離する(ステップS12)。BASEは整数部、DECは小数部である。
FIG. 63 shows a register setting flowchart of the magnification calculator.
Here, as in the case of the specific example 9, the bit width of each register of the magnification calculator 113 shown in FIG. 61 is set to N bits. The real number magnification mul is obtained from the width A of the input image and the width B of the output image (step S11). Next, the obtained real number magnification mul is separated into an integer part and a decimal part (step S12). BASE is an integer part and DEC is a decimal part.

次に、BASEX1にBASEをセットする(ステップS13)。また、BASEX2にBASE+1を設定する(ステップS14)。更に、DECに2Nを掛け1を加えた値を設定する(ステップS15)。最後にステップS16において、MULXを“1”に初期化する。例えば、入力画像の幅が3で、出力画像の幅が6の場合には、mulは次の式で求められる。
mul=(6−1)/(3−1)
=2.5
更に、DECX1は、次の式で求められる。
DECX1=DEC*2N+1
=0.5*232+1
=2,147,483,649
Next, BASE is set to BASEX1 (step S13). Further, BASE + 1 is set in BASEX2 (step S14). Further, a value obtained by multiplying DEC by 2N and adding 1 is set (step S15). Finally, in step S16, MULX is initialized to "1". For example, when the width of the input image is 3 and the width of the output image is 6, mul is obtained by the following equation.
mul = (6-1) / (3-1)
= 2.5
Further, DECX1 is obtained by the following equation.
DECX1 = DEC * 2N + 1
= 0.5 * 232 + 1
= 2,147,483,649

図61に示した比較/選択部128は、DECX1とDECX2の大小関係に応じてBASEX1あるいはBASEX2のどちらかを選択し、X方向倍率としてMULXレジスタにセットする。但し、DEC2は一次補間拡大/縮小処理部で管理されるX座標とDECX1とを掛け合わせた結果である。検索結果が2Nを超える場合には、比較/選択の規則は次の通りになる。
DECX2≧DECX1の場合、倍率はBASEX1
DECX2<DECX1の場合、倍率はBASEX2
以上の計算を近傍エリアごとに行えば、図19で示した近傍エリアテーブルを保持しておく必要が無い。
The comparison / selection unit 128 shown in FIG. 61 selects either BASEX1 or BASEX2 according to the magnitude relationship between DECX1 and DECX2, and sets the selected value in the MULX register as the X-direction magnification. However, DEC2 is the result of multiplying the X coordinate managed by the primary interpolation enlargement / reduction processing unit with DECX1. If the search result exceeds 2N, the rules for comparison / selection are as follows.
When DECX2 ≧ DECX1, the magnification is BASEX1
When DECX2 <DECX1, the magnification is BASEX2
If the above calculation is performed for each neighboring area, it is not necessary to hold the neighboring area table shown in FIG.

〈具体例10の効果〉
以上の例によれば、一次補間法による画像データの実数倍率の拡大/縮小において、拡大倍率を保持するレジスタを利用し、具体例9で説明したアルゴリズムを併用して、近傍エリアテーブル保持によるメモリ効率の低下を解消した。なお、一次補間法による画像データの実数倍率の拡大/縮小をこれにより、高速でかつ省メモリにより実現できる。
<Effect of Specific Example 10>
According to the above example, in the enlargement / reduction of the real number magnification of the image data by the primary interpolation method, the register holding the enlargement magnification is used, and the algorithm described in the ninth embodiment is used together with the memory by the neighborhood area table retention Efficiency reduction was eliminated. In addition, enlargement / reduction of the real number magnification of the image data by the primary interpolation method can be realized at high speed and with memory saving.

〈具体例11〉
印字しようとするイメージが印字可能な領域をはみ出る場合、イメージを印字領域の大きさに合わせて切り取る必要がある。この切り取る作業をクリッピングと呼ぶ。
図64には、クリッピングが必要な例説明図を示す。
この例では、イメージを最近傍法で5倍に拡大して印字している。図の黒塗り部分135が最近傍法で5倍に拡大されたイメージである。そのドット構成を下側に示す。丸印は各画素である。
<Specific Example 11>
If the image to be printed extends beyond the printable area, it is necessary to cut out the image according to the size of the print area. This cutting operation is called clipping.
FIG. 64 shows an example explanatory diagram that requires clipping.
In this example, the image is printed by magnifying it five times by the nearest neighbor method. This is an image in which the black portion 135 in the figure is magnified 5 times by the nearest neighbor method. The dot configuration is shown below. Circles indicate each pixel.

ここで、図の上側に白枠で示した部分を印字可能領域とすると、黒塗りの領域135の左側は、印字可能領域をはみ出している。即ち、このイメージの左側は印字されずクリッピングされてしまう。領域138は、横方向に画素を5倍に拡大した有効な部分である。領域137と136とは、画素を横方向に5倍に拡大したものの、左側の領域136は印刷されないから捨てられる。このように、クリッピングされる境界は、拡大画像の途中に来ることが普通である。また、拡大処理は印字領域内にあるイメージ分だけ行えばよく、印字領域外で行う必要はない。即ち、領域136の黒丸のデータは、単に捨ててしまってもよい。以上の点から、クリッピングを考慮すると、イメージの端は通常と異なる拡大率であってもよいことになる。   Here, assuming that a portion indicated by a white frame on the upper side of the drawing is a printable area, the left side of the black area 135 extends beyond the printable area. That is, the left side of this image is not printed but is clipped. The area 138 is an effective portion obtained by magnifying a pixel five times in the horizontal direction. The areas 137 and 136 have pixels enlarged five times in the horizontal direction, but the left area 136 is discarded because it is not printed. As described above, the boundary to be clipped usually comes in the middle of the enlarged image. In addition, the enlargement process only needs to be performed for an image within the print area, and need not be performed outside the print area. That is, the data of the black circle in the area 136 may be simply discarded. In view of the above, when clipping is considered, the edge of the image may have a different magnification than usual.

図の例では、印字可能領域の境界線を139とした場合に、境界線の内側即ち領域138より右側の白丸のドットは全て印字されるから、5倍に拡大する。境界線139と接する領域137の白丸のドットは3倍に拡大する。また、境界139外の部分にある領域136の黒丸のドットは、印字されないから、拡大しない。こうしたクリッピングを実現するために、画像の部分的な拡大率が通常の拡大率と異なる制御をする必要がある。   In the example shown in the figure, when the boundary of the printable area is 139, all the white dots inside the boundary, that is, on the right side of the area 138, are printed, so that they are magnified five times. The white dot in the area 137 that is in contact with the boundary 139 is enlarged three times. Further, the dots of the black circles in the area 136 outside the boundary 139 are not printed and are not enlarged. In order to realize such clipping, it is necessary to control the partial magnification of the image differently from the normal magnification.

この具体例では、実数倍の拡大/縮小において、左側または上側のクリッピングを効率よく行う方法を提供する。なお、これから説明する例は、上側または左側のクリッピングにとくに適した方法である。   This specific example provides a method for efficiently clipping the left side or the upper side in real number magnification / reduction. Note that the example described below is a method particularly suitable for upper or left clipping.

以上の具体例11を実現するために、まず拡大率を保持するレジスタMULXまたはMULYを用意する。なお、これらのレジスタをまとめてレジスタMULと呼ぶ。画像の左端、上端については、拡大率を計算するのではなく、MULの初期値を拡大率として用いる。ここは、具体例10と同様である。MULの初期値は具体例10では常に“1”であったが、この具体例では条件によって異なる。従って、左端、上端の拡大率を予め計算する。   In order to realize the above specific example 11, first, a register MULX or MULY holding an enlargement ratio is prepared. Note that these registers are collectively called a register MUL. For the left end and the upper end of the image, the initial value of MUL is used as the enlargement ratio instead of calculating the enlargement ratio. This is the same as in Example 10. The initial value of MUL is always "1" in the specific example 10, but in this specific example, it differs depending on conditions. Therefore, the enlargement ratio of the left end and the upper end is calculated in advance.

図65には、具体例11の装置のブロック図を示す。
この装置は、外部記憶装置141、最近傍法拡大/縮小装置142及び出力画像フレームバッファ143から構成される。また、最近傍法拡大/縮小装置142は、倍率計算部144、クリッピング計算装置145、最近傍法拡大/縮小装置146及びラインバッファ147から構成される。
FIG. 65 shows a block diagram of the device of the eleventh embodiment.
This device includes an external storage device 141, a nearest neighbor enlarging / reducing device 142, and an output image frame buffer 143. The nearest neighbor enlarging / reducing device 142 includes a magnification calculator 144, a clipping calculator 145, a nearest neighbor enlarging / reducing device 146, and a line buffer 147.

この装置を具体例9の装置と比較した場合、クリッピング計算装置145が追加されている部分が異なる。このクリッピング計算装置145は、画素の位置情報と印字可能領域の情報をもとに、印字領域の上端と左端の画素の拡大倍率を計算する部分である。この結果は倍率計算部144の内部に設けられたレジスタMULX及びMULYに格納される。   When this apparatus is compared with the apparatus of the ninth embodiment, a difference is that a clipping calculation apparatus 145 is added. The clipping calculator 145 is a part that calculates the magnification of the pixels at the upper end and the left end of the print area based on the position information of the pixels and the information of the printable area. This result is stored in registers MULX and MULY provided inside the magnification calculator 144.

図66に、具体例11の動作フローチャートを示す。
まず、ステップS1において、上端、左端の拡大倍率をクリッピング計算装置145を用いて計算する。次にステップS2で、倍率計算部で用いるレジスタを初期化する。この場合、レジスタMULX及びMULYは、ステップS1で求めた値を設定する。次に、ステップS3において、外部記憶装置から1ライン分のデータを読み込み、ラインバッファに格納する。
FIG. 66 shows an operation flowchart of the eleventh embodiment.
First, in step S1, the enlargement magnification at the upper end and the left end is calculated using the clipping calculator 145. Next, in step S2, a register used in the magnification calculator is initialized. In this case, the values obtained in step S1 are set in the registers MULX and MULY. Next, in step S3, one line of data is read from the external storage device and stored in the line buffer.

次に、ステップS4において、現在の入力画像の画素を出力画像フレームバッファに複製する。次に、ステップS5において、X方向倍率分この処理を繰り返す制御を行う。また、ステップS6では、X方向倍率に相当するレジスタMULXの内容をアップデートする。なお、この倍率計算の仕方は、具体例10の場合と同様である。即ち、DECX2がDECX1よりも大きければ、BASEX1を選択し、そうでなければBASEX2を選択する。   Next, in step S4, the pixels of the current input image are copied to the output image frame buffer. Next, in step S5, control is performed to repeat this processing for the X-direction magnification. In step S6, the content of the register MULX corresponding to the magnification in the X direction is updated. The method of calculating the magnification is the same as that of the specific example 10. That is, if DECX2 is larger than DECX1, BASEX1 is selected; otherwise, BASEX2 is selected.

ステップS4〜ステップS6までの処理を入力画像ライン幅分繰り返す(ステップS7)。次の行の処理を行うために、MULXに左端の画素の拡大率を設定する(ステップS7)更に、ステップS4〜ステップS8までの処理をY方向倍率回数繰り返す(ステップS9)。また、Y方向倍率計算によりレジスタMULYの値をアップデートする(ステップS10)。倍率計算の仕方は具体例11の場合と同様で、DECY2がDECY1よりも大きければBASEY1を選択し、そうでなければBASEY2を選択する。ステップS4〜ステップS10の処理を入力ライン数分繰り返す制御を行い(ステップS11)、全てのライン数分を実行して処理を実行する。   The processing from step S4 to step S6 is repeated for the input image line width (step S7). In order to perform the processing of the next row, the enlargement ratio of the leftmost pixel is set in MULX (step S7). Further, the processing from step S4 to step S8 is repeated the number of times in the Y direction (step S9). Further, the value of the register MULY is updated by calculating the magnification in the Y direction (step S10). The method of calculating the magnification is the same as that of the specific example 11. If DECY2 is larger than DECY1, BASEY1 is selected; otherwise, BASEY2 is selected. Control is performed to repeat the processing of steps S4 to S10 for the number of input lines (step S11), and the processing is executed for all the lines.

図67に、倍率計算部レジスタ設定のフローチャートを示す。
図のステップS11〜ステップS14までの処理は、具体例9の処理と同一である。即ち、実数倍率mulの整数部をBASEに、小数部分をDECに設定する。そして、レジスタBASEX1にはBASEを、レジスタBASEX2にはBASE+1を設定する。その後、レジスタDECX1には、DEC*2N+1を設定し、MULXに、クリッピング計算装置を用いて計算した左端の画素の拡大率を設定する。
FIG. 67 shows a flowchart of the setting of the magnification calculation unit register.
The processing of steps S11 to S14 in the figure is the same as the processing of the specific example 9. That is, the integer part of the real number magnification mul is set to BASE, and the decimal part is set to DEC. Then, BASE is set in the register BASEX1, and BASE + 1 is set in the register BASEX2. After that, DEC * 2N + 1 is set in the register DECX1, and the enlargement ratio of the leftmost pixel calculated using the clipping calculator is set in MULX.

〈具体例11の効果〉
以上の例によれば、最近傍法による画像データの実数倍の拡大/縮小において、クリッピングが必要な場合においても、先頭の倍率計算を行うレジスタにその倍率を予め計算し、設定するようにしたので、実数倍率の拡大/縮小を高速かつ省メモリで実現することが可能になる。もちろん、一次補間による様々な拡大/縮小処理において、クリッピングに対処することが可能になる。
<Effect of Specific Example 11>
According to the above example, even when clipping is necessary in real-time enlargement / reduction of image data by the nearest neighbor method, the magnification is calculated in advance and set in the register for calculating the magnification at the head. Therefore, enlargement / reduction of the real number magnification can be realized at high speed with a small memory. Of course, it is possible to cope with clipping in various enlargement / reduction processes by primary interpolation.

具体例1による拡大/縮小処理部の動作説明図である。FIG. 9 is an explanatory diagram of an operation of an enlargement / reduction processing unit according to a specific example 1. 具体例1による画像データ拡大/縮小装置のブロック図である。FIG. 2 is a block diagram of an image data enlarging / reducing device according to a specific example 1. 整数倍率の拡大法説明図である。FIG. 4 is an explanatory diagram of an enlargement method of an integer magnification. 最近傍法による拡大/縮小処理説明図である。FIG. 11 is an explanatory diagram of the enlargement / reduction processing by the nearest neighbor method. 具体例1の拡大/縮小方法を示すフローチャートである。9 is a flowchart illustrating an enlargement / reduction method according to a specific example 1. モジュロ演算を用いる画像拡大/縮小装置のブロック図である。FIG. 3 is a block diagram of an image enlargement / reduction device using a modulo operation. 拡大/縮小テーブルの冗長性の説明図である。FIG. 4 is an explanatory diagram of redundancy of an enlargement / reduction table. 割り算の余りを求める計算(モジュロ演算)の説明図である。It is explanatory drawing of calculation (modulo operation) which calculates | requires the remainder of division. 具体例2の拡大/縮小方法動作フローチャートである。9 is an operation flowchart of an enlargement / reduction method according to a specific example 2. 具体例3による拡大/縮小装置のブロック図である。FIG. 11 is a block diagram of an enlargement / reduction device according to a third specific example. 従来より画像の拡大/縮小処理に採用されていた画素値補正のためのリサンプリングの説明図である。FIG. 9 is an explanatory diagram of resampling for pixel value correction which has been conventionally used for image enlargement / reduction processing. 正方格子の説明図である。It is explanatory drawing of a square lattice. 一次補間の一般的計算法説明図である。FIG. 3 is an explanatory diagram of a general calculation method of linear interpolation. 具体例3による一次補間の説明図である。FIG. 12 is an explanatory diagram of primary interpolation according to a specific example 3. 具体例3による一次補間の処理例説明図である。FIG. 13 is an explanatory diagram of a processing example of primary interpolation according to a specific example 3. 具体例3の装置の動作フローチャートである。14 is an operation flowchart of the device of the specific example 3. 具体例4の原理説明図である。FIG. 14 is a diagram illustrating the principle of specific example 4. 具体例4の装置のブロック図である。FIG. 14 is a block diagram of an apparatus of a specific example 4. 近傍エリアテーブルの説明図である。It is an explanatory view of a neighborhood area table. ラインバッファの説明図である。FIG. 3 is an explanatory diagram of a line buffer. 画像データ格納処理説明図である。It is an explanatory view of image data storage processing. 近傍エリアの拡大図である。It is an enlarged view of the vicinity area. 具体例4の動作フローチャートである。14 is an operation flowchart of a specific example 4. 具体例4の計算内容説明図である。FIG. 14 is an explanatory diagram of calculation contents of a specific example 4. 具体例5の装置のブロック図である。FIG. 15 is a block diagram of an apparatus of a specific example 5. ドット間の相関関係説明図である。FIG. 3 is an explanatory diagram of a correlation between dots. ドット間の相関関係説明図である。FIG. 3 is an explanatory diagram of a correlation between dots. 具体例5の装置の動作フローチャートである。15 is an operation flowchart of the device of the specific example 5. 具体例6の装置のブロック図である。FIG. 14 is a block diagram of an apparatus of a specific example 6. グループ定義説明図(その1)である。FIG. 6 is an explanatory diagram (part 1) of a group definition. グループ定義説明図(その2)である。It is a group definition explanatory view (the 2). グループ定義説明図(その3)である。It is a group definition explanatory view (the 3). グループ定義説明図(その4)である。FIG. 8 is a diagram (part 4) for explaining group definitions. グループの領域説明図である。FIG. 4 is an explanatory diagram of a group area. 境界画素を利用した平均法の説明図である。It is explanatory drawing of the averaging method using a boundary pixel. 境界画素の判定基準説明図である。FIG. 6 is an explanatory diagram of a criterion for determining a boundary pixel. 平均法のデータの流れ(横方向)の説明図である。FIG. 4 is an explanatory diagram of a data flow (horizontal direction) of the averaging method. 平均法のデータの流れ(縦方向)の説明図である。FIG. 4 is an explanatory diagram of a data flow (vertical direction) of the averaging method. サンプリングされる入力画素の説明図である。FIG. 4 is an explanatory diagram of input pixels to be sampled. 具体例6の動作フローチャートである。13 is an operation flowchart of a specific example 6. 割り算処理のフローチャートである。It is a flowchart of a division process. 具体例7の装置のブロック図である。FIG. 21 is a block diagram of the device of Example 7. サンプリング後の画像説明図である。It is an explanatory view of an image after sampling. 具体例7の動作フローチャートである。14 is an operation flowchart of a specific example 7. 具体例8の装置のブロック図である。It is a block diagram of the apparatus of the example 8. 具体例8の処理説明図である。FIG. 21 is an explanatory diagram of a process in a specific example 8. サンプリング領域の説明図である。It is an explanatory view of a sampling area. 具体例8の動作フローチャートである。15 is an operation flowchart of a specific example 8. 具体例8の初期化処理フローチャートである。15 is a flowchart of an initialization process in a specific example 8. 妥当なアルゴリズムの説明図である。It is explanatory drawing of a proper algorithm. 繰り上がり発生の判定方法説明図である。FIG. 4 is an explanatory diagram of a method of determining whether a carry-up has occurred. 具体例9の装置のブロック図である。FIG. 21 is a block diagram of an apparatus of a specific example 9. 具体例9の倍率計算部のブロック図である。FIG. 19 is a block diagram of a magnification calculator of a specific example 9; 具体例9の動作フローチャートである。15 is an operation flowchart of a specific example 9. 拡大/縮小の処理過程の説明図である。It is explanatory drawing of the process of enlargement / reduction. 倍率計算部レジスタ設定のフローチャートである。It is a flowchart of a magnification calculation part register setting. X方向倍率計算のフローチャートである。It is a flowchart of X direction magnification calculation. 近傍エリアの説明図である。It is explanatory drawing of a nearby area. 最近傍法と一次補間との処理の順番の違い説明図である。FIG. 9 is an explanatory diagram illustrating a difference in the order of processing between the nearest neighbor method and the primary interpolation. 具体例10の装置のブロック図である。It is a block diagram of the apparatus of the example 10. 具体例10の倍率計算部のブロック図である。It is a block diagram of the magnification calculation part of specific example 10. 具体例10の動作フローチャートである。14 is an operation flowchart of a specific example 10. 倍率計算部レジスタ設定のフローチャートである。It is a flowchart of a magnification calculation part register setting. クリッピングが必要な例説明図である。It is an example explanatory view which requires clipping. 具体例11の装置のブロック図である。FIG. 21 is a block diagram of an apparatus of a specific example 11. 具体例11の動作フローチャートである。31 is an operation flowchart of a specific example 11. 倍率計算部レジスタ設定のフローチャートである。It is a flowchart of a magnification calculation part register setting.

符号の説明Explanation of reference numerals

3 入力画像データ
4 出力画像データ
1X,1Y 拡大/縮小テーブル
3 input image data 4 output image data 1X, 1Y enlargement / reduction table

Claims (14)

入力画像データを形成する複数の入力画素を所定の倍率で複数の出力画素に縮小して出力画像データを生成する画像データの拡大/縮小方法において、
前記入力画像データを小領域に分割し、小領域に含まれる入力画素と小領域の境界上の入力画素とを区別して認識し、前記小領域内の入力画素値と認識された境界上の入力画素値とに基づいて小領域内の入力画素値を演算して出力画素値を求めることを特徴とする画像データの拡大/縮小方法。
In a method of enlarging / reducing image data for generating output image data by reducing a plurality of input pixels forming input image data to a plurality of output pixels at a predetermined magnification,
The input image data is divided into small areas, input pixels included in the small areas and input pixels on the boundaries of the small areas are distinguished and recognized, and the input pixel values in the small areas and the input on the recognized boundaries are recognized. A method for enlarging / reducing image data, comprising calculating an input pixel value in a small area based on a pixel value and obtaining an output pixel value.
請求項1記載の画像データの拡大/縮小方法において、
前記入力画素値の演算は、前記小領域内の入力画素を所定の間隔でサンプリングして得られた入力画素値により行われることを特徴とする画像データの拡大/縮小方法。
The method of claim 1, wherein the image data is enlarged / reduced.
The method of enlarging / reducing image data, wherein the calculation of the input pixel value is performed using an input pixel value obtained by sampling input pixels in the small area at a predetermined interval.
請求項2記載の画像データの拡大/縮小方法において、
前記小領域内の入力画素をサンプリングするサンプリング領域を指定し、サンプリング領域内の画素値を演算することにより出力画素値を求めることを特徴とする画像データの拡大/縮小方法。
3. The method of claim 2, wherein:
A method for enlarging / reducing image data, wherein a sampling area for sampling an input pixel in the small area is designated, and an output pixel value is obtained by calculating a pixel value in the sampling area.
入力画像データを形成する複数の入力画素を所定の倍率で複数の出力画素に縮小して出力画像を生成する画像データの拡大/縮小装置において、
前記入力画像を複数の入力画素を含む小領域に区分し、隣接する小領域間を仕切る境界線上に位置する入力画素を検知して該入力画素を含むいずれかの小領域を一定条件に基づいて決定する境界線画素判定手段と、
前記各小領域に含まれる複数の入力画素の各画素値に基づいて出力画素の画素値を演算する画素値演算手段と、
を有することを特徴とする画像データの拡大/縮小装置。
In an image data enlarging / reducing apparatus for reducing an input pixel forming input image data to a plurality of output pixels at a predetermined magnification to generate an output image,
The input image is divided into small areas including a plurality of input pixels, and any of the small areas including the input pixels is detected based on a predetermined condition by detecting an input pixel located on a boundary dividing an adjacent small area. A boundary pixel determining means for determining;
A pixel value calculating unit that calculates a pixel value of an output pixel based on each pixel value of a plurality of input pixels included in each of the small areas;
A device for enlarging / reducing image data, comprising:
請求項4記載の画像データの拡大/縮小装置において、
前記画素値演算手段は、前記小領域の複数の入力画素をサンプリングし、サンプリングした入力画素に基づいて前記出力画素の画素値を演算することを特徴とする画像データの拡大/縮小装置。
The image data enlarging / reducing device according to claim 4,
The image data enlargement / reduction device, wherein the pixel value calculation means samples a plurality of input pixels in the small area and calculates a pixel value of the output pixel based on the sampled input pixels.
請求項5記載の画像データの拡大/縮小装置において、
前記画素値演算手段は、前記小領域にサンプリング領域を設定し、該サンプリング領域内の入力画素に基づいて前記出力画素の画素値を演算することを特徴とする画像データの拡大/縮小装置。
The image data enlargement / reduction device according to claim 5,
The image data enlargement / reduction device, wherein the pixel value calculation means sets a sampling area in the small area and calculates a pixel value of the output pixel based on an input pixel in the sampling area.
入力画像を、主走査方向に平行な境界と副走査方向に平行な境界により小領域に等分割し、各領域中に含まれる画素の画素値を平均して出力画素の画素値を求めることにより、入力画像を縮小した出力画像を得るものにおいて、
入力画像を構成する画素の画素値を主走査方向にみて1ライン分受け入れて保持する入力画像バッファと、
前記入力画像バッファに受け入れた各画素の画素値を主走査方向に順に累積していき、副走査方向に平行な境界の手前で、この境界に最も近い境界画素を検出したときまでに求められた、同一小領域内の画素値の合計を、小領域単位で保持する途中結果バッファと、
副走査方向に1ライン分ずつ入力画像を処理していき、主走査方向に平行な境界の手前で、この境界に最も近い境界画素を検出したときまでに求められた各小領域内の画素値の合計を、途中結果バッファから読みだして、各小領域に含まれる画素数で割って、小領域毎の画素値の平均値を求め、その平均値を出力画像の画素の画素値とする制御部を備えたことを特徴とする画像データの拡大/縮小装置。
The input image is equally divided into small regions by a boundary parallel to the main scanning direction and a boundary parallel to the sub-scanning direction, and the pixel values of the pixels included in each region are averaged to obtain the pixel value of the output pixel. , To obtain an output image obtained by reducing the input image,
An input image buffer that receives and holds one line of pixel values of pixels constituting the input image when viewed in the main scanning direction;
The pixel value of each pixel received in the input image buffer is sequentially accumulated in the main scanning direction, and is obtained before a boundary parallel to the sub-scanning direction and before a boundary pixel closest to this boundary is detected. An intermediate result buffer that holds the sum of pixel values in the same small area in small area units,
The input image is processed one line at a time in the sub-scanning direction, and a pixel value in each small area obtained before a boundary pixel closest to the boundary before the boundary parallel to the main scanning direction is detected. Is read from the intermediate result buffer, divided by the number of pixels included in each small area, an average value of the pixel values of each small area is obtained, and the average value is set as the pixel value of the pixel of the output image. A device for enlarging / reducing image data, comprising a unit.
請求項7に記載の拡大/縮小装置において、
入力画像を分割した小領域に含まれる画素のうちの一部をサンプリングして、それらの画素値を集計するために、サンプリングの間隔を設定して保持するパラメータ保持部を設け、
途中結果バッファは、
前記パラメータ保持部を参照して、サンプリング間隔ごとに画素値を集計して保持することを特徴とする画像データの拡大/縮小装置。
The enlargement / reduction device according to claim 7,
Sampling a part of the pixels included in the small region obtained by dividing the input image, and providing a parameter holding unit that sets and holds a sampling interval to collect those pixel values,
The intermediate result buffer is
An image data enlargement / reduction apparatus, wherein pixel values are totalized and stored at each sampling interval with reference to the parameter storage unit.
請求項8に記載の拡大/縮小装置において、
入力画像を分割した小領域に含まれる画素を、主走査方向に連続した任意の数の画素を含む複数のサンプリング領域で区分し、そのサンプリング領域毎に画素値を集計するために、サンプリング合計カウンタを設け、
制御部は、
サンプリング領域ごとに集計された画素値とそのサンプリング領域に含まれる画素数により、サンプリング領域における画素値の平均値を求め、
途中結果バッファは、
サンプリング領域における画素値の平均値を累積した、同一小領域内の画素値の合計を、小領域単位で保持することを特徴とする画像データの拡大/縮小装置。
The enlargement / reduction device according to claim 8,
The sampling sum counter is used to divide the pixels included in the small area obtained by dividing the input image into a plurality of sampling areas including an arbitrary number of pixels that are continuous in the main scanning direction, and to aggregate pixel values for each of the sampling areas. And
The control unit is
The average value of the pixel values in the sampling area is obtained from the pixel values totaled for each sampling area and the number of pixels included in the sampling area,
The intermediate result buffer is
An apparatus for enlarging / reducing image data, wherein a total of pixel values in the same small area, in which average values of pixel values in a sampling area are accumulated, is held in small area units.
処理対象となる整数値を実数倍した乗算結果のうちの小数点以下N桁の数値を保持する第1の記憶部と、
前記実数の少数点以下N桁の数値を記憶する第2の記憶部と、
前記第1の記憶部に格納された数値と第2の記憶部に格納された数値とを比較し、
前者の数値が後者の数値以上のときは、前記乗算結果の整数部分を演算結果として出力し、前者の数値が後者の数値に満たないときは、前記乗算結果の少数点以下を切り上げた結果を演算結果として出力する演算部を備えたことを特徴とする整数倍率演算器。
A first storage unit that holds a value of N digits after the decimal point in a multiplication result obtained by multiplying an integer value to be processed by a real number;
A second storage unit that stores a number of N digits below the decimal point of the real number;
Comparing the numerical value stored in the first storage unit with the numerical value stored in the second storage unit,
When the former value is greater than or equal to the latter value, the integer part of the multiplication result is output as the operation result, and when the former value is less than the latter value, the result of rounding up the decimal point of the multiplication result is rounded down. An integer magnification calculator including a calculation unit that outputs a calculation result.
入力画像中の各画素の座標値と、入力画像の拡大倍率を表す実数との積を求めて、この積の結果を越えない整数を、当該画素のコピー回数に決定して、出力画像データを得るものにおいて、
前記積の結果のうち、小数点以下N桁により表される数値のみを保持し、小数点以上の数値をオーバーフローさせて無効にするレジスタを備え、
前記積を求める演算を実行する度にこのレジスタに保持される数値と、前記拡大倍率を表す実数の少数点以下N桁により表される数値とを比較して、
前者が後者以上のときは、前記積の結果のうち少数点以下を切り捨てた値を前記コピー回数に決定し、前者が後者未満のときは、前記積の結果の少数点以下を切り上げた値を前記コピー回数に決定する倍率計算部を備えたことを特徴とする画像データの拡大/縮小装置。
A product of the coordinate value of each pixel in the input image and a real number representing the magnification of the input image is obtained, an integer not exceeding the result of the product is determined as the number of times of copying of the pixel, and the output image data is determined. In what you get,
Among the results of the product, a register that holds only a numerical value represented by N digits after the decimal point and overflows and invalidates the numerical value after the decimal point,
Each time the calculation for calculating the product is executed, a numerical value held in this register is compared with a numerical value represented by N digits below a decimal point of a real number representing the magnification,
When the former is greater than or equal to the latter, a value obtained by rounding down the decimal point of the result of the product is determined as the number of copies, and when the former is less than the latter, a value obtained by rounding up the decimal point of the result of the product is rounded up. An apparatus for enlarging / reducing image data, comprising a magnification calculator for determining the number of copies.
入力画像を所定の実数倍率で拡大して出力画像を得て、入力画素を出力画像上にマッピングし、マッピングされた出力画素によって作られる矩形の領域を近傍エリアとして、
前記近傍エリアに含まれる、出力画素の座標軸方向に並んだ出力画素の数を求める場合に、
前記近傍エリアの出力画像中の位置を示す座標値と、前記拡大倍率との積を求めて、この積の結果を越えない整数を、該当する近傍エリア中の前記出力画素の数に決定するものにおいて、
前記積の結果のうち、小数点以下N桁により表される数値のみを保持し、小数点以上の数値をオーバーフローさせて無効にするレジスタを備え、
前記積を求める演算を実行する度にこのレジスタに保持される数値と、前記拡大倍率を表す実数の少数点以下N桁により表される数値とを比較して、
前者が後者以上のときは、前記積の結果のうち少数点以下を切り捨てた値を前記出力画素の数に決定し、前者が後者未満のときは、前記積の結果の少数点以下を切り上げた値を前記出力画素の数に決定する倍率計算部を備えたことを特徴とする画像データの拡大/縮小装置。
An input image is enlarged at a predetermined real number magnification to obtain an output image, input pixels are mapped on the output image, and a rectangular area created by the mapped output pixels is used as a neighborhood area.
When calculating the number of output pixels arranged in the coordinate axis direction of the output pixels included in the neighboring area,
A product of a coordinate value indicating a position in the output image of the neighboring area and the magnification is determined, and an integer not exceeding the result of the product is determined as the number of the output pixels in the corresponding neighboring area. At
Among the result of the product, a register that holds only a numerical value represented by N digits after the decimal point and overflows and invalidates the numerical value after the decimal point,
Each time the calculation for calculating the product is performed, a numerical value held in this register is compared with a numerical value represented by N decimal places or less of a real number representing the magnification,
When the former is greater than or equal to the latter, the value of the result of the product is rounded down to the decimal point and the number of the output pixels is determined.When the former is less than the latter, the decimal point of the result of the product is rounded up. An apparatus for enlarging / reducing image data, comprising a magnification calculator for determining a value to the number of output pixels.
請求項12に記載の拡大/縮小装置において、
倍率計算部の出力の初期値を予め設定した定数としたことを特徴とする画像データの拡大/縮小装置。
The enlargement / reduction device according to claim 12,
An image data enlarging / reducing device, wherein an initial value of an output of a magnification calculator is a preset constant.
入力画像中の各画素の座標値と、入力画像の拡大倍率を表す実数との積を求めて、この積の結果を越えない整数を、当該画素のコピー回数に決定して、出力画像データを得るものにおいて、
前記積の結果のうち、小数点以下N桁により表される数値のみを保持し、小数点以上の数値をオーバーフローさせて無効にするレジスタを備え、
前記積を求める演算を実行する度にこのレジスタに保持される数値と、前記拡大倍率を表す実数の少数点以下N桁により表される数値とを比較して、
前者が後者以上のときは、前記積の結果のうち少数点以下を切り捨てた値を前記コピー回数に決定し、前者が後者未満のときは、前記積の結果の少数点以下を切り上げた値を前記コピー回数に決定する倍率計算部と、
出力画像の端部が印字可能領域をはみ出る場合に、出力画像の端部の拡大倍率を印字可能領域の情報に基づいて演算し、前記コピー回数の初期値とするクリッピング計算装置を備えたことを特徴とする画像データの拡大/縮小装置。
A product of the coordinate value of each pixel in the input image and a real number representing the magnification of the input image is obtained, an integer not exceeding the result of the product is determined as the number of times of copying of the pixel, and the output image data is determined. In what you get,
Among the results of the product, a register that holds only a numerical value represented by N digits after the decimal point and overflows and invalidates the numerical value after the decimal point,
Each time the calculation for calculating the product is executed, a numerical value held in this register is compared with a numerical value represented by N digits below a decimal point of a real number representing the magnification,
When the former is greater than or equal to the latter, a value obtained by rounding down the decimal point of the result of the product is determined as the number of copies, and when the former is less than the latter, a value obtained by rounding up the decimal point of the result of the product is rounded up. A magnification calculator for determining the number of copies,
When the edge of the output image is outside the printable area, a clipping calculation device is provided that calculates the magnification of the edge of the output image based on the information of the printable area and sets the initial value of the number of copies. An image data enlargement / reduction device.
JP2004096463A 1996-10-30 2004-03-29 Image data reduction apparatus and method Expired - Fee Related JP3962029B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004096463A JP3962029B2 (en) 1996-10-30 2004-03-29 Image data reduction apparatus and method

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP30384496 1996-10-30
JP35878696 1996-12-27
JP2004096463A JP3962029B2 (en) 1996-10-30 2004-03-29 Image data reduction apparatus and method

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP27809197A Division JP3865165B2 (en) 1996-10-30 1997-09-24 How to enlarge / reduce image data

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2007062458A Division JP4069300B2 (en) 1996-10-30 2007-03-12 Image data enlargement device

Publications (2)

Publication Number Publication Date
JP2004288198A true JP2004288198A (en) 2004-10-14
JP3962029B2 JP3962029B2 (en) 2007-08-22

Family

ID=33303581

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004096463A Expired - Fee Related JP3962029B2 (en) 1996-10-30 2004-03-29 Image data reduction apparatus and method

Country Status (1)

Country Link
JP (1) JP3962029B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8675732B2 (en) 2007-08-06 2014-03-18 Samsung Electronics Co., Ltd. Method and apparatus of compressing image data
CN115239561A (en) * 2022-07-25 2022-10-25 广州市保伦电子有限公司 Processing method and processing terminal for preventing image shearing phenomenon under image reduction
CN116863861A (en) * 2023-09-05 2023-10-10 欣瑞华微电子(上海)有限公司 Image processing method and device based on non-explicit point judgment and readable storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8675732B2 (en) 2007-08-06 2014-03-18 Samsung Electronics Co., Ltd. Method and apparatus of compressing image data
CN115239561A (en) * 2022-07-25 2022-10-25 广州市保伦电子有限公司 Processing method and processing terminal for preventing image shearing phenomenon under image reduction
CN115239561B (en) * 2022-07-25 2023-04-18 广东保伦电子股份有限公司 Processing method and processing terminal for preventing image shearing phenomenon under image reduction
CN116863861A (en) * 2023-09-05 2023-10-10 欣瑞华微电子(上海)有限公司 Image processing method and device based on non-explicit point judgment and readable storage medium
CN116863861B (en) * 2023-09-05 2023-11-24 欣瑞华微电子(上海)有限公司 Image processing method and device based on non-explicit point judgment and readable storage medium

Also Published As

Publication number Publication date
JP3962029B2 (en) 2007-08-22

Similar Documents

Publication Publication Date Title
JP3865165B2 (en) How to enlarge / reduce image data
KR920001801B1 (en) Picture size magnification method and device
KR100243174B1 (en) Apparatus and method of generating sub-pixel mask
US7043091B2 (en) Method and apparatus for increasing spatial resolution of an image
US6833845B2 (en) Image object content generation device and padding device
US5161035A (en) Digital image processing device for enlarging original image with high fidelity
JPH05334427A (en) Method for expanding/contracting image
KR100818718B1 (en) Image processing device, and computer-readable recording medium having recorded thereon image processing program
JPH1049665A (en) Device and method for image processing
JP2001028051A (en) Device and method for image processing, and image processing program recording medium
JP3962029B2 (en) Image data reduction apparatus and method
JP4069300B2 (en) Image data enlargement device
JP2885999B2 (en) Image processing apparatus and method
JP4156194B2 (en) Method for converting first resolution raster digital data to second resolution digital data
JP2000187726A (en) Data interpolation method and its device and storage medium
JP2780405B2 (en) Digital image processing equipment
JP3517982B2 (en) Drawing device
JP2009122841A (en) Image list image construction device, recording medium and image forming apparatus
JP2691559B2 (en) Pixel density conversion device and method thereof
JP2001230929A (en) Reduction processing method and device for binary image
JPH10341334A (en) Image magnification method, device therefor and storage medium recording program
JPH05227413A (en) Binary picture variable magnification device
JP2691582B2 (en) Pixel density conversion device and method thereof
JP2857260B2 (en) Judgment method of rectangular area
JPH08297739A (en) Picture processor and method therefor

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20061220

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070109

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070308

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: 20070417

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20070517

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: 20100525

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110525

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120525

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130525

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140525

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees