JP2022086187A - Image processing device, image processing device, image processing method, and program - Google Patents
Image processing device, image processing device, image processing method, and program Download PDFInfo
- Publication number
- JP2022086187A JP2022086187A JP2020198070A JP2020198070A JP2022086187A JP 2022086187 A JP2022086187 A JP 2022086187A JP 2020198070 A JP2020198070 A JP 2020198070A JP 2020198070 A JP2020198070 A JP 2020198070A JP 2022086187 A JP2022086187 A JP 2022086187A
- Authority
- JP
- Japan
- Prior art keywords
- image data
- output
- input
- processing
- lines
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000012545 processing Methods 0.000 title claims abstract description 285
- 238000003672 processing method Methods 0.000 title claims description 5
- 238000012546 transfer Methods 0.000 claims abstract description 19
- 238000000034 method Methods 0.000 claims description 63
- 230000008569 process Effects 0.000 claims description 58
- 230000015654 memory Effects 0.000 claims description 36
- 230000006870 function Effects 0.000 claims description 8
- 238000007906 compression Methods 0.000 claims description 7
- 230000006835 compression Effects 0.000 claims description 6
- MHABMANUFPZXEB-UHFFFAOYSA-N O-demethyl-aloesaponarin I Natural products O=C1C2=CC=CC(O)=C2C(=O)C2=C1C=C(O)C(C(O)=O)=C2C MHABMANUFPZXEB-UHFFFAOYSA-N 0.000 abstract 1
- 230000000052 comparative effect Effects 0.000 description 23
- 238000006243 chemical reaction Methods 0.000 description 12
- 238000004364 calculation method Methods 0.000 description 11
- 238000010586 diagram Methods 0.000 description 9
- 230000009467 reduction Effects 0.000 description 7
- 230000008859 change Effects 0.000 description 4
- 230000004048 modification Effects 0.000 description 4
- 238000012986 modification Methods 0.000 description 4
- 238000013139 quantization Methods 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 230000006837 decompression Effects 0.000 description 2
- 238000011946 reduction process Methods 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 230000006866 deterioration Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000003936 working memory Effects 0.000 description 1
Images
Landscapes
- Image Processing (AREA)
- Editing Of Facsimile Originals (AREA)
Abstract
Description
本発明は、入力画像データに対して変倍処理を行う画像処理装置、画像処理方法、及びプログラムに関する。 The present invention relates to an image processing apparatus, an image processing method, and a program for performing scaling processing on input image data.
デジタル複写機等に設けられている画像処理装置では、原稿画像データの縮小・拡大等の変倍処理を行う機能が備えられている。原稿画像データの変倍処理では、画像全体のデータを処理単位とせず、画面全体を垂直方向に帯状に分割したバンドと称する複数ライン分の画像データを処理単位とし、作業用のメモリからバンド毎にデータを順に読み出して変倍処理することが行われている。また、画像処理装置では、変倍処理された画像データに対し、圧縮処理、量子化処理等の処理を行う処理部が変倍処理部の後段に設けられているものがある。 The image processing device provided in a digital copier or the like is provided with a function of performing scaling processing such as reduction / enlargement of original image data. In the scaling processing of the original image data, the data of the entire image is not used as the processing unit, but the image data of multiple lines called bands in which the entire screen is vertically divided into bands is used as the processing unit, and each band is used from the working memory. The data is read out in order and scaled. Further, in some image processing devices, a processing unit that performs processing such as compression processing and quantization processing on the image data that has been scaled is provided after the scaling processing unit.
変倍処理部の後段に設けられた処理部(以下、後段処理部という)としては、例えば、JPEG圧縮部やディザ処理部などがあるが、これらの後段処理部では、一定ライン数(8か16ライン)単位で処理を行うものがある。このため、変倍処理部で変倍処理した画像データを、後段処理部に直接入力させるためには、変倍処理部から出力される画像データを後段処理の処理単位にあわせた一定ライン数からなる画像データを出力させる必要がある。 Examples of the processing unit provided after the variable magnification processing unit (hereinafter referred to as the post-stage processing unit) include a JPEG compression unit and a dither processing unit. In these post-stage processing units, a fixed number of lines (8 or more) 16 lines) There are some that perform processing in units. Therefore, in order to directly input the image data that has been scaled by the scaling processing unit to the post-stage processing unit, the image data output from the scaling processing unit is input from a fixed number of lines according to the processing unit of the post-stage processing. It is necessary to output the image data.
特許文献1には、変倍処理部から常に一定ライン数の画像データを出力する技術が開示されている。具体的には、変倍後の出力ライン数が一定になるように、変倍処理部へ入力するライン数を入力バンド毎に変更している。これによれば、変倍処理部から出力された画像データをバッファメモリを介さずに、直接、後段処理に入力することが可能になる。
しかしながら、特許文献1においては、変倍処理部へ入力する各入力バンドのライン数を変化させるための回路構成または処理工程が必要になり、装置コストの増大や処理性能の低下を招くという課題がある。
However,
そこで、本発明は、処理性能及びに優れ、低コストに構成することが可能な画像処理装置及び画像処理方法の提供を目的とする。 Therefore, an object of the present invention is to provide an image processing apparatus and an image processing method which are excellent in processing performance and can be configured at low cost.
本発明は、元画像を表す元画像データを主走査方向に沿った一定数のラインからなる画像データに分割して転送する転送手段と、前記転送手段から転送された前記画像データを処理単位の入力画像データとし、当該入力画像データに対して予め設定された倍率で変倍処理を施し、変倍画像データを生成可能とする変倍処理手段と、前記変倍処理手段から出力させるべき出力ライン数を設定する出力設定手段と、を備え、前記変倍処理手段は、前記入力画像データを用いて生成可能な変倍画像データのうち、前記出力設定手段により設定された出力ライン数に制限した画像データを出力画像データとして出力することを特徴とする画像処理装置である。 The present invention has a transfer means for dividing and transferring the original image data representing the original image into image data consisting of a certain number of lines along the main scanning direction, and the image data transferred from the transfer means as a processing unit. A scaling processing means that can generate scaling image data by performing scaling processing on the input image data at a preset magnification as input image data, and an output line to be output from the scaling processing means. The variable magnification processing means includes an output setting means for setting the number, and the scaling processing means is limited to the number of output lines set by the output setting means among the variable magnification image data that can be generated using the input image data. It is an image processing device characterized by outputting image data as output image data.
本発明によれば、処理性能に優れ、低コストに構成することが可能な画像処理装置及び画像処理方法を提供することができる。 According to the present invention, it is possible to provide an image processing apparatus and an image processing method which are excellent in processing performance and can be configured at low cost.
以下、本発明の実施の形態について、図面を参照しつつ詳細に説明する。 Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
(第1実施形態)
図1は、本発明の第1実施形態における画像処理装置100の全体構成を示すブロック図である。本実施形態では、画像処理装置として、原稿画像を読み取って元画像データを生成し、その生成した元画像データを記録媒体に出力する複写機としての機能を有するものを例に採り説明する。
(First Embodiment)
FIG. 1 is a block diagram showing the overall configuration of the
図1において、画像処理装置100は、後述の各部の動作を統括的に制御するCPU101を有する。また、画像処理装置100には、スキャナ102、入力DMAC103、スキャナ画像処理部104、JPEG圧縮器105、JPEG伸張器106、プリンタ画像処理部107、プリンタ108、メインメモリ130、及びバス150を備える。
In FIG. 1, the
スキャナ102は、原稿をスキャンしてRGB多値の画素からなるビットマップ画像データ(元画像データ)を得る画像取得手段として機能する。但し、画像取得手段は、スキャナに限らず、ラスタ順に他の装置から画像データを得ることのできるi/fであってもよい。スキャナ102によって取得したビットマップ画像データは、メインメモリ130に一旦格納される。また、メインメモリ130は、後述の各部での各部の処理結果を一時的に保存するもの記憶手段であり、通常はDRAMで構成される。
The
入力DMAC(Direct Memory Access Controller)103は、メインメモリ130に格納されたRGBビットマップデータを、メインメモリ130からバンド単位で読み出してスキャナ画像処理部104へ供給する。ここでバンドとは、スキャナ102によって取得される原稿画像全体のデータを、縦方向において帯状に分割した画像データを指す。このバンドは、縦方向と交差する横方向に並ぶ画素からなる横ラインを複数備え、これが後述の画像処理の処理単位となる。なお、以下の説明において、横ラインは、単にラインともいう。また、このライン(横ライン)と区別するため、画像データにおいて縦方向に並ぶ画素からなるラインについては縦ラインと称す。
The input DMAC (Direct Memory Access Controller) 103 reads RGB bitmap data stored in the
スキャナ画像処理部104は、メインメモリ130から読み出されたRGB画像データに対して、色調整やエッジ強調、変倍などの画像処理を所定数のバンド毎に行う。なお、本実施形態において変倍処理は1バンド毎に処理を行う。また、スキャナ画像処理部104の内部には、各バンド毎にRGB画像データの補間変倍処理を行う変倍処理部(変倍処理手段)1041が設けられている。変倍処理部1041は、入力DMAC103から入力された一定ライン数のバンドに対して変倍処理を行い、所定数の横ラインからなる変倍処理後の画像データ(変倍画像データ)を後段のJPEG圧縮器105に出力する。
The scanner
JPEG圧縮器105は、MCU(Minimum Code Unit)の高さに等しい所定ライン数の画像データ(出力バンドデータ)に対してJPEG圧縮を行う。このため、スキャナ画像処理部104からJPEG圧縮器105へと出力される処理後のRGB画像データのライン数は、MCUの高さに等しいライン数を出力することが必要となる。JPEG圧縮器105から出力される圧縮後の画像データ(JPEGデータ)は、メインメモリ130に格納される。JPEG伸張器106は、メインメモリ130に格納されたJPEGデータを読み出してこれを伸長してRGBデータに戻す。このRGBデータは再びメインメモリ130に格納される。
The
プリンタ画像処理部107は、RGBデータをメインメモリ130から読み出して、プリンタ108で使用されるCMYK色空間への変換及び量子化等の処理を行う。プリンタ108は、プリンタ画像処理部107で量子化されたCMYKデータに基づいて記録用紙等の記録媒体に画像の記録を行う。プリンタ108としては、インクを吐出して記録を行うインクジェットプリンタ等がある。但し、プリンタの種類は特に限定されるものではなく、他の形態のプリンタ、例えば電子写真方式を用いたプリンタ等も適用可能である。
The printer
図2は、本実施形態における入力DMAC103が、メインメモリ130に格納されている画像データを読み出し、入力DMAC103の後段のスキャナ画像処理部104へ画素単位のデータを転送する転送処理を示す図である。
FIG. 2 is a diagram showing a transfer process in which the
メインメモリ130には、入力画像幅のRGB画像データを複数ライン分(後述の入力バンドの2バンドB1、B2分)格納できる領域が確保されている。この領域をスキャンバッファ1301と称す。スキャナ102からは、横ライン毎に出力されるデータが、スキャンバッファへ順次格納される。
The
入力DMAC103は、内部にHV変換メモリ1031を持つ。このHV変換メモリ1031は、「DRAMバースト長のバイト数」×「入力バンドの高さ(入力バンドの横ライン数)」分の容量を持つ。この容量に相当する画像データを、ここではHV(Horizontal-Vertical)ブロックと称す。
The
入力DMAC103は、スキャンバッファ1301内に格納された入力バンドB1の左上端からDRAMバースト長(32バイト等)の単位で画像データを読み出してHV変換メモリ1031へ書き込む。このときの、スキャンバッファ1301からの画像データの読み出しは、図2(a)の破線矢印に示すように、入力バンドB1において、DRAMバースト長に相当するバイト数分の画像データ(1つの横ライン分の画像データ)を読み出す。そして、DRAMバースト長分の画像データを読み出す毎に、バンド内の次の横ライン(図中、下の横ライン)へと移動して、その横ラインの画像データを読み出す。この処理を入力バンドB1の高さ分(横ライン数分)繰り返す。そして、入力バンドB1の下端のラインの読み出しが行われると(つまり、HVブロック1つ分の読み出しが行われると)、次の入力バンドB2の最初の横ラインに移行し、その入力バンドB2の画像データを入力バンドB1と同様に順次読み出す。
The
スキャンバッファ1301から読み出された画像データは、図2(b)の破線矢印に示されるように、HV変換メモリ1031に順次格納される。入力DMAC103は、内部のHV変換メモリ1031に1つのHVブロック分のデータが格納されると、次に、図2(c)の破線矢印に示すように、HVブロックの左上端から画像の縦ライン方向に1画素ずつ画像データ(画素データ)を読み出す。そして、読み出した画像データを次段に設けられているスキャナ画像処理部104へ転送する。なお、ここでいう縦ラインとは、前述の横ラインと直交する方向に沿って配列された複数の画素からなるラインを指す。また、以下の説明において、縦ラインに沿う方向を副走査方向、横ラインに沿う方向を主走査方向ともいう。
The image data read from the
HV変換メモリ1031に格納されている1バンド分の画像データの中の1番目の縦ライン(図中、左端に位置するライン)の画像データの読み出し・転送が終了すると、その1番目の縦ラインの右側に隣接する2番目の縦ラインへ移行する。そして、2番目のラインの上端の画素データから順次画素データの読み出し・転送を行う。この処理を繰り返し、1つのHVブロック分の画像データ、すなわち1バンド分の画像データがスキャナ画像処理部104に転送する。
When the reading / transfer of the image data of the first vertical line (the line located at the left end in the figure) in the image data for one band stored in the
以上の処理によって、例えば、図2(a)に示す1つの入力バンドB1の画像データがスキャナ画像処理部104に転送されると、次に、1つ右の入力バンドB2分の画像データ(HVブロック分の画像データ)をスキャンバッファ1301から読み出す。そして、読み出したデータをHV変換メモリ1031に一旦格納する。そして、先に転送したバンドB1に対する画像処理の進行に応じて、HV変換メモリ1031に格納された入力バンドB2分の画像データが読み出され、スキャナ画像処理部104へ転送される。この処理を入力バンドの右下端まで繰り返す。
By the above processing, for example, when the image data of one input band B1 shown in FIG. 2A is transferred to the scanner
このように、入力DMAC103からスキャナ画像処理部104へは入力バンド毎に縦ラインを構成する画像データが、1画素ずつのRGBデータとして転送される。この際、スキャナ画像処理部104では、変倍処理部1041も含めた複数のサブブロック(変倍処理部以外は図示せず)の各々では、入力された画素データに対して順次処理を行う。すなわち、1つのサブブロックで処理された結果を次段のサブブロックへ転送するという処理を、1画素毎にパイプラインで繰り返し処理を行う。
In this way, the image data constituting the vertical line for each input band is transferred from the
図3は、変倍処理部1041における入出力バンド、及び変倍処理における入力画素と出力画素との関係を示す図である。ここではHV変換メモリ1031に格納された6本の横ラインからなる入力バンドの画像データを、図2(c)に示すように変倍処理部1041へ縦ライン順に入力し、その画像データを変倍処理部1041で縮小する場合を示している。ここでいう縮小とは、画素数を減らすことであり、これはすなわち、解像度を小さくすることであるため、各画素の大きさは大きくなると考えることができる。以下、変倍処理について、縮小処理を例に採り説明する。
FIG. 3 is a diagram showing an input / output band in the
図3(a)は、変倍処理部1041への入力画素Piの位置を示し、図3(b)は、変倍処理部1041から出力される出力画素Poの位置を示している。図3(a)では、縦ライン方向(Y方向)に6画素(0番~5番の画素)の画像データが変倍処理部1041に入力された時点で、入力画素Piの入力位置を右へ1画素分、上へ5画素分移動し、その後、6~11の入力画素が縦ライン方向に沿って順次入力される。この動作を1入力バンド分の画像データが入力されるまで繰り返す。また、図3(b)は、入力バンドの画像データに変倍処理を施すことによって得られる出力バンドを示している。ここでは、図3(a)に示す6本の横ラインからなる入力バンドに対し、4本の横ラインからなる出力バンドを出力する。すなわち、図3(b)では、縦ライン方向(Y方向)に沿って、0番~3番の4つの出力画素が出力された時点で、出力画素Poの出力位置を右へ1画素分、上へ3画素分移動し、その後、4番~7番の出力画素を出力する。この動作を1入力バンド分の入力画像データを用いて繰り返す。
FIG. 3A shows the position of the input pixel Pi to the
ここで、図3(c)を参照しつつ、入力画素Piの画素値に対する出力画素Poの画素値の計算方法を説明する。なお、図3(c)において、Pi(0)は、図3(a)における0番の入力画素Piを示している。同様に、Pi(1)、Pi(6)、Pi(7)は、1番、6番、7番の入力画素Piをそれぞれ示している。また、Po(0)は、図3(b)に示す0番の出力画素Poを示している。以下の説明では、不図示の他の画素についても同様の表記を行う。 Here, a method of calculating the pixel value of the output pixel Po with respect to the pixel value of the input pixel Pi will be described with reference to FIG. 3 (c). In addition, in FIG. 3C, Pi (0) shows the 0th input pixel Pi in FIG. 3A. Similarly, Pi (1), Pi (6), and Pi (7) indicate the input pixels Pi of Nos. 1, 6, and 7, respectively. Further, Po (0) indicates the 0th output pixel Po shown in FIG. 3 (b). In the following description, the same notation is used for other pixels (not shown).
出力画素Poの画素値は、当該出力画素Poを包含する4つの入力画素Piが入力されることによって計算することができる。図3(a)、(b)の例では、7番の入力画素Pi(7)が入力されることによって出力画素Po(0)の画素値を計算することができる。同様に、入力画素Pi(8)が入力された時点で出力画素Po(1)の画素値を、入力画素Pi(13)が入力された時点で出力画素Po(4)の画素値を計算することができる。 The pixel value of the output pixel Po can be calculated by inputting four input pixels Pi including the output pixel Po. In the examples of FIGS. 3A and 3B, the pixel value of the output pixel Po (0) can be calculated by inputting the 7th input pixel Pi (7). Similarly, the pixel value of the output pixel Po (1) is calculated when the input pixel Pi (8) is input, and the pixel value of the output pixel Po (4) is calculated when the input pixel Pi (13) is input. be able to.
また、図3(c)では、出力画素Po(0)の周辺の4つの画素Pi(0)、Pi(1)、Pi(6)、Pi(7)のそれぞれの中心の点をA、B、C、Dとし、出力画素Po(0)の中心の点をPとする。さらに、点Eは、点A、Bそれぞれの主走査方向に一次元の線形補間を行った点、点Fは、点C、Dの主走査方向に一次元の線形補間を行った点とする。この場合、点Pは点E、Fの副走査方向に一次元の線形補間を行うことにより求められる。 Further, in FIG. 3C, the central points of the four pixels Pi (0), Pi (1), Pi (6), and Pi (7) around the output pixel Po (0) are A and B. , C, D, and let P be the center point of the output pixel Po (0). Further, point E is a point where one-dimensional linear interpolation is performed in the main scanning directions of points A and B, and point F is a point where one-dimensional linear interpolation is performed in the main scanning directions of points C and D. .. In this case, the point P is obtained by performing one-dimensional linear interpolation in the sub-scanning direction of the points E and F.
点Pの位置は、点AB間の距離をbase(固定値、例えば8192)、点AC間の距離を同じくbaseとした平面上の座標で表され、点Aを原点とすると、点Aの座標は(0,0)、点Dの座標は(base,base)となる。 The position of the point P is represented by coordinates on a plane in which the distance between the points AB is a base (fixed value, for example, 8192) and the distance between the points AC is also a base. Is (0,0), and the coordinates of the point D are (base, base).
この座標系での画素Pの画素値は、以下の計算で求められる。点A、B、C、D、E、F、Pの画素値をそれぞれa、b、c、d、e、f、pとする。また、点Pの主走査方向(X方向)の位置は、点AB間をbaseとしたときの点Aからの距離hphaseで表し、点Pの副走査方向の位置は、点AC間をbaseとした時の点Aからの距離vphaseで表す。 The pixel value of the pixel P in this coordinate system is obtained by the following calculation. Let the pixel values of points A, B, C, D, E, F, and P be a, b, c, d, e, f, and p, respectively. Further, the position of the point P in the main scanning direction (X direction) is represented by the distance hphase from the point A when the point AB is the base, and the position of the point P in the sub-scanning direction is the base between the points AC. It is expressed by the distance vphase from the point A at the time of.
ここで、点Pの画素値は以下の式で表される。
e=a+(b-a)×hphase/base
f=c+(d-c)×vphase/base
p=e+(f-e)×vphase/base
なお、図3(c)では各画素の位置を、各画素の中心の座標で示しているが、各画素の左上端の座標で示したとしても各画素の相対位置は同じであり、前述の計算結果は同じとなる。このため、以降の説明では各画素の左上位置(Aに対するA’)をその画素の位置を示す座標とする。
Here, the pixel value of the point P is expressed by the following equation.
e = a + (baa) × hphase / base
f = c + (dc) × vphase / base
p = e + (fe) × vface / base
Although the position of each pixel is shown by the coordinates of the center of each pixel in FIG. 3C, the relative position of each pixel is the same even if it is shown by the coordinates of the upper left end of each pixel, as described above. The calculation result is the same. Therefore, in the following description, the upper left position of each pixel (A'with respect to A) is used as the coordinates indicating the position of the pixel.
また、入力バンドの左上端の入力画素においては、初期座標値を(hphase_base,vphase_base)として指定することも可能である。初期座標値を0として処理を開始すると、1/n(nは整数)の縮小時に各phase値が常に0となって補間演算が行われず、結果的に間引き縮小となって出力画像の画質が低下する。初期座標値を(hphase_base,vphase_base)として指定すれば画質低下を回避することがでる。但し、hphase_baseの指定は本実施形態の特徴的処理とは無関係であるため、0として以降の説明を行う。なお、vphase_baseの値は、入力バンド毎に生成される出力画像の位相を合わせるため、入力バンド毎に、直前の入力バンドにおいて生成された出力画像のラインの座標値を基準に設定される。 Further, in the input pixel at the upper left end of the input band, the initial coordinate value can be specified as (hphase_base, vphase_base). When the processing is started with the initial coordinate value set to 0, each phase value is always 0 at the time of reduction of 1 / n (n is an integer) and the interpolation calculation is not performed, resulting in thinning reduction and the image quality of the output image. descend. If the initial coordinate values are specified as (hphase_base, vphase_base), deterioration of image quality can be avoided. However, since the designation of hphase_base is irrelevant to the characteristic processing of this embodiment, the following description will be given with 0. The value of vphase_base is set for each input band based on the coordinate value of the line of the output image generated in the immediately preceding input band in order to match the phase of the output image generated for each input band.
次に、複数のバンドの画像データに対する変倍処理について説明する。なお、以下の説明では、本実施形態において実行する変倍処理の特徴を明確にするため、まず、本実施形態の比較例において実行されている従来の変倍処理を説明し、その後、本実施形態において実行する変倍処理を説明する。 Next, scaling processing for image data of a plurality of bands will be described. In the following description, in order to clarify the characteristics of the scaling process executed in the present embodiment, first, the conventional scaling process executed in the comparative example of the present embodiment will be described, and then the present embodiment will be described. The scaling process executed in the form will be described.
<第1比較例の変倍処理>
図4は、第1比較例によって複数の入力バンドを変倍処理を模式的に示す図である。ここでは、副走査方向(Y方向)における変倍率(倍率)を、baseに対する相対値magvで与える。例えば、base=8192とすると、80%の縮小を行う場合は、magv=8192/0.8=10240を設定する。図4に示す例では、75%の縮小、つまりmagv=base/0.75=10922を設定したときの処理を示している。ここでは、1バンド目のvphase_base=base/3としている。また、図4~図6において、入力画像及び出力画像の左端の画素に付している番号は、図3のように各画素の処理順を示す番号ではなく、入画像及び出力画像全体における横ラインのライン番号を示している。以下の説明において、ライン番号0のラインを1ライン目のライン、ライン番号1のラインを2ライン目のラインと称し、以下同様とする。
<Scale processing of the first comparative example>
FIG. 4 is a diagram schematically showing scaling processing for a plurality of input bands according to the first comparative example. Here, the variable magnification (magnification) in the sub-scanning direction (Y direction) is given as a relative value magv with respect to the base. For example, if base = 8192 and 80% reduction is to be performed, magv = 8192 / 0.8 = 10240 is set. The example shown in FIG. 4 shows a reduction of 75%, that is, a process when magv = base / 0.75 = 10922 is set. Here, vphase_base = base / 3 of the first band is set. Further, in FIGS. 4 to 6, the numbers attached to the leftmost pixels of the input image and the output image are not the numbers indicating the processing order of each pixel as in FIG. 3, but are horizontal in the entire input image and output image. Shows the line number of the line. In the following description, the line with
図4の左上端に示すように、入力画像の左上端の座標を(0,0)とし、入力バンド高さを6ラインとする。入力画像の副走査方向の座標値は、0から始まり1画素ごとにbaseずつ加算される。出力画像の副走査方向の座標値は、vphase_baseから始まりmagvずつ加算される。副走査方向の入力により、入力画素の座標値がvphase_base+magv以上になったときに出力画素を取得するための出力処理が可能となる。図4の例では、入力画像の2ライン目のライン(ライン番号1のライン)まで入力されることにより、出力画像の1ライン目(ライン番号0)の出力が可能になる。さらに、入力画像の3ライン目のライン(ライン番号2のライン)まで入力されることにより、出力画像の2ライン目(ライン番号1)の出力が可能となる。同様にLライン目(図では6ライン目)まで入力すると、入力の座標値はL×baseとなり、出力ライン数Mは
M=(L×base-vphase_base)/magv (計算結果は切り捨て)
という計算で得られる。
As shown in the upper left corner of FIG. 4, the coordinates of the upper left corner of the input image are (0,0), and the height of the input band is 6 lines. The coordinate values in the sub-scanning direction of the input image start from 0 and are added by base for each pixel. The coordinate values in the sub-scanning direction of the output image start from vphase_base and are added in magv increments. The input in the sub-scanning direction enables an output process for acquiring an output pixel when the coordinate value of the input pixel becomes vphase_base + magv or more. In the example of FIG. 4, by inputting up to the second line (line number 1) of the input image, the first line (line number 0) of the output image can be output. Further, by inputting up to the third line (line number 2) of the input image, the second line (line number 1) of the output image can be output. Similarly, when inputting up to the Lth line (6th line in the figure), the input coordinate value becomes L × base, and the number of output lines M is M = (L × base-vphase_base) / magv (calculation result is rounded down).
It can be obtained by the calculation.
図4の例では、M=4であり、出力画像の5ライン目は、図示のように入力ライン数が不足しているため、出力することができない。例えば、出力画像の5ライン目を出力するためには、入力画像の7ライン目(ライン番号5のライン)の入力が必要となるが、第1バンドの入力ライン数は6ライン(ライン番号0~5の6ライン)である。このため、第1バンドの入力では入力ライン数が不足し、5ライン目を出力することができない。よって、この第1バンドでは、6ラインの入力に対して、4ラインが出力されることになる。 In the example of FIG. 4, M = 4, and the fifth line of the output image cannot be output because the number of input lines is insufficient as shown in the figure. For example, in order to output the 5th line of the output image, it is necessary to input the 7th line (line number 5) of the input image, but the number of input lines in the first band is 6 lines (line number 0). ~ 5 6 lines). Therefore, the number of input lines is insufficient for the input of the first band, and the fifth line cannot be output. Therefore, in this first band, 4 lines are output for 6 lines of input.
また、前の入力バンドに続く次の入力バンドの変倍処理では、図示のように、前の入力バンドより常に1ライン戻ったラインから入力を行い、次の入力バンドの処理開始時のvphase_baseの値を、
(vphase_base+magv×M)-base×(L-1)
として、前の入力バンドと同様の処理を行う。これにより、前の入力バンドの出力画像に連続して次の出力画像を出力することができる。
Further, in the scaling process of the next input band following the previous input band, as shown in the figure, input is always performed from the line one line back from the previous input band, and vphase_base at the start of processing of the next input band. The value,
(Vphase_base + magv × M) -base × (L-1)
, The same processing as the previous input band is performed. As a result, the next output image can be continuously output to the output image of the previous input band.
以上の処理においては、各入力バンドの入力ライン数は一定であり、かつ、入力バンド間のオフセット(offset)アドレス(ある入力バンドと次の入力バンドの読み出し開始アドレスの差、図4の例では入力画像5ライン分)も一定である。このため、入力DMAC103は比較的単純なアドレス計算で連続動作を行うことが可能である。
In the above processing, the number of input lines of each input band is constant, and the offset address between the input bands (the difference between the read start address of one input band and the next input band, in the example of FIG. 4). (For 5 lines of input image) is also constant. Therefore, the
ところが、上述の変倍処理を繰り返すと、入力バンドに対応する出力画像のライン数が、magvの値によって一定ではなくなる。これは、入力バンドの処理が進むに従ってvphase_baseの値がバンドごとに変わるため、出力ライン数Mの値
M=(int)(L×base-vphase_base)/magv
が一定ではなくなるためである。図4の例では第3バンドで出力ライン数が3となり、第1バンド及び第2バンドとは出力ライン数が変化してしまう。
However, when the above-mentioned scaling process is repeated, the number of lines of the output image corresponding to the input band is not constant depending on the value of magv. This is because the value of vphase_base changes for each band as the processing of the input band progresses, so the value of the number of output lines M M = (int) (L × base-vbase_base) / magv
Is not constant. In the example of FIG. 4, the number of output lines is 3 in the third band, and the number of output lines is different from that of the first band and the second band.
すなわち第1比較例では、変倍処理部1041に一定のライン数の入力バンドを入力し、バンド毎のオフセットライン数も一定(ここでは、(入力バンドのライン数)-(1ライン))としてバンドごとの変倍処理を行っている。その結果、変倍率magvの値によっては変倍処理部から出力される出力バンドのライン数は一定にならず、ばらつきが生じる。このため、変倍処理部1041の後に一定のライン数の入力を必要とする処理、例えばJPEG圧縮処理に対して、変倍処理部の出力を直接入力させることができないという問題が生じる。この問題を解消する方法として、次に述べる第2比較例が知られている。
That is, in the first comparative example, an input band having a fixed number of lines is input to the
<第2比較例>
第2比較例では、一定の出力ライン数が出せるだけの入力ライン数を入力バンド毎に計算し、入力バンド毎に算出したライン数分の画像データをメインメモリから読み出して、変倍処理部に供給することにより、上記の第1比較例における問題を解決している。
<Second comparative example>
In the second comparative example, the number of input lines that can output a certain number of output lines is calculated for each input band, and the image data for the number of lines calculated for each input band is read from the main memory and stored in the scaling processing unit. By supplying the data, the problem in the first comparative example described above is solved.
図5に、第2比較例において実行される変倍処理を示す。ここでは、図4と同様にBase、及びmagvを設定して変倍処理を行う。前述のように、図4に示す処理を行うと、第3バンドで入力ライン数が不足し、出力ライン数が一定(図3では4ライン)ではなくなる。このため、第2比較例では、3バンド目の入力ライン数を、第1、第2バンドと同様の6ラインではなく、1ライン増加させた7ラインとする。すなわち、ライン番号10~15の7ラインを第3バンドとして入力する。これにより、ライン番号14、15の2ラインによってライン番号11の出力ラインの画像データを出力することが可能になり、4ライン(ライン番号8~11の出力ライン)の出力画像を出力することが可能になる。
FIG. 5 shows the scaling process executed in the second comparative example. Here, the scaling process is performed by setting Base and magv in the same manner as in FIG. As described above, when the process shown in FIG. 4 is performed, the number of input lines is insufficient in the third band, and the number of output lines is not constant (4 lines in FIG. 3). Therefore, in the second comparative example, the number of input lines in the third band is 7 lines, which is increased by 1 line, instead of the same 6 lines as in the 1st and 2nd bands. That is, 7 lines of
しかしながら、第2比較例では次のような問題が生じる。すなわち、第2比較例では、変倍処理部1041への入力バンドのライン数をバンド毎に異ならせる必要がある。このため、変倍処理部(図1の構成では、変倍処理部1041を内包するスキャナ画像処理部104)へ入力バンドの画像データを供給する入力DMAC103の回路構成が、各バンドのライン数を一定とする第2比較例より複雑になる。例えば、入力DMAC103内のHV変換メモリ1031において、図2(b)、(c)に示す画像データの入出力動作を、各バンド毎に変える必要がある。
However, in the second comparative example, the following problems occur. That is, in the second comparative example, it is necessary to make the number of lines of the input band to the
さらに、入力バンド毎にライン数を異ならせることに伴い、隣接する入力バンド間のオフセットライン数も入力バンド毎に変化させる必要があるという問題も生じる。図5の例では、第1バンドから第2バンドの間に設定するオフセットライン数と第2バンドからの第3バンドの間のオフセットライン数は、いずれも5ラインである。しかし、第3バンドから第4バンドの間のオフセットライン数は6ラインであり、オフセットライン数が変化している。このような処理を行うためには、入力バンド毎にオフセットアドレスを計算する必要がある。しかし、オフセットアドレスの計算を入力DMAC103において自動的に行い得るようにするには多くの困難を伴う。
Further, as the number of lines differs for each input band, there arises a problem that the number of offset lines between adjacent input bands also needs to be changed for each input band. In the example of FIG. 5, the number of offset lines set between the first band and the second band and the number of offset lines between the second band and the third band are both five lines. However, the number of offset lines between the third band and the fourth band is 6, and the number of offset lines is changing. In order to perform such processing, it is necessary to calculate the offset address for each input band. However, there are many difficulties in allowing the calculation of the offset address to be performed automatically at the
そこで、DMAC103自体はオフセットアドレスの計算をせず、CPU101が入力バンド毎にオフセットアドレスを計算し、計算した値を入力DMAC101にその都度設定する構成とすれば、入力DMAC103の回路構成は単純で済む。しかし、その場合には、各バンドを出力する間に、CPUがオフセットアドレスの計算及び設定を行う時間が必要となる。このため、入力DMAC103が自動計算を行う場合に比べて総処理時間が長くなってしまい、装置全体の処理性能に影響を及ぼすという問題が生じる。そこで、本実施形態では、以下のような変倍処理を実行する。
Therefore, if the
<第1実施形態における変倍処理>
本実施形態では、以下に挙げる構成により、上記の第1比較例及び第2比較例の問題を解決している。
<Variable magnification processing in the first embodiment>
In the present embodiment, the problems of the first comparative example and the second comparative example described above are solved by the configurations listed below.
i)入力DMAC103によってメインメモリ130から一定数の入力ラインを読み出し、当該読み出した一定数の入力ラインからなる入力バンドを、スキャナ画像処理部104に内包される変倍処理部1041に入力する。
i) Input A fixed number of input lines are read from the
ii)変倍処理部1041では、入力された一定ライン数の入力バンドに基づいて生成可能な出力ラインのうち、予め設定した出力ライン数を超える出力ラインに対しては、不要な出力ラインとして出力せず、内部で消滅させる。すなわち、第1変形例及び第2変形例のような既存の変倍処理部では、一定ライン数の入力バンドを入力した場合、変倍後の出力ライン数はNまたはN+1となって出力ライン数にばらつきが生じる。これに対し、本実施形態では、予め定めた設定出力ライン数を上回る数の出力ラインを生成可能な場合であっても、設定した出力ライン数を超える出力ラインは余計な出力ラインとして変倍処理部から出力せず、内部で消滅させる。これにより、変倍処理部の後段へ供給する出力ライン数を一定数(ここではN)とする。
ii) In the
なお、出力ライン数Nの値は、変倍処理部1041から出力された画像データに対して所定の画像処理を行う後段処理部の画像処理単位に応じて、予め変倍処理部1041内の出力設定手段により一定の出力ライン数に固定されている。但し、画像処理装置100の入力部等によって任意の出力ライン数を設定し得るように構成することも可能である。
The value of the number of output lines N is output in the
iii)変倍処理部1041において、変倍処理で消費する入力ライン数をカウントしておき、そのカウント値を示す情報を入力DMAC103へ伝達する。入力DMAC103では、その変倍処理部1041から伝達された情報に基づき、次に入力される入力バンドのオフセットアドレスを自動計算し、次の入力バンドの入力ラインを定める。
iii) The
ここで、図6及び図7を用いて、本実施形態における入力DMAC103及び変倍処理部1041で実行される処理を説明する。
Here, with reference to FIGS. 6 and 7, the processing executed by the
画像処理装置100の入力部(倍率設定手段)によって設定された倍率(magv)で変倍処理を行うに際し、全ての入力バンドで同一の出力ライン数Mの出力が可能になるような、各バンドの入力ライン数Lを、CPU101により予め計算しておく。vphase_baseの最大値は、base-1であるため、Lは以下の式1によって算出することができる。
L=(int)(((base-1+magv×(M-1))/base)+1) (式1)
ここで、(int)は切り捨て処理を意味する。図5に示す例では、M=4に対してL=7となる。
When performing scaling processing at the magnification (magv) set by the input unit (magnification setting means) of the
L = (int) (((base-1 + magv × (M-1)) / base) +1) (Equation 1)
Here, (int) means a truncation process. In the example shown in FIG. 5, L = 7 with respect to M = 4.
入力DMAC103は、入力バンド毎に常にライン数Lの画像データをメインメモリ130から読み出す。これにより、入力DMAC103は常にLライン分の画像データをスキャナ画像処理部104へ供給すればよくなる。このため、図2に示すHV変換メモリ1031におけるデータの読み出し動作を、第2変形例のように、バンド毎に変える必要がなくなる。従って、本実施形態によれば、第2比較例の動作を実現しようとする場合に比べ、入力DMAC103の構成を大幅に単純化することができる。
The
また、変倍処理部1041にLライン分のデータを常に入力して、第1比較例と同様の変倍処理を行った場合には、各入力バンドにおけるvphase_baseの値によって、出力バンドのライン数がMまたはM+1となる。このため、一定数の出力ラインを後段に供給することができない。
Further, when the data for L lines is always input to the
これに対し、本実施形態の変倍処理部1041では、各縦ラインの出力画素数をMで打ち切り、M+1ライン目の出力画素を生成可能な場合には、その出力画素を後段へ出力せず消滅させる。そして、出力座標を1つ右上へ移動し、次の縦ラインの出力画素を上から順次生成し、出力していく。この処理を、入力バンドの全入力画素に対して繰り返す。これにより、各入力バンドに対し変倍処理を施した一定力ライン数の画像データを出力することができる。つまり、本実施形態によれば、変倍処理部1041から後段の処理部(本例では、JPEG圧縮器105)に対し、常に一定ライン数に制限した変倍処理後の画像データを後段に出力することができる。
On the other hand, in the
また、本実施形態では、次のバンドの入力を、第1、第2比較例のように、前の入力バンドの最後から1ラインだけ戻ったラインから行うのではなく、図6に示すように、消滅させた出力ラインを生成可能なラインまで戻して行う。 Further, in the present embodiment, the input of the next band is not performed from the line returned by one line from the end of the previous input band as in the first and second comparative examples, as shown in FIG. , Return the extinguished output line to the line that can be generated.
さらに、次のバンドの初期位相値vphase_baseは、消滅させたライン(出力画像の各縦ラインの上からM+1番目の画素から構成される横ライン)の値ではなく、直前の最終出力ライン(M番目の画素から構成される横ライン)のvphase値とする。 Further, the initial phase value vphase_base of the next band is not the value of the disappeared line (horizontal line composed of M + 1st pixel from the top of each vertical line of the output image), but the last output line immediately before (the horizontal line). Let it be the vphase value of the horizontal line composed of the Mth pixel).
以上の処理を行うことにより、ある出力バンドで消滅させた出力ラインを、次の出力バンドで補うことができるようになる。このため、変倍後の複数の出力バンドをスムーズにつなげることができる。 By performing the above processing, the output line disappeared in one output band can be supplemented by the next output band. Therefore, it is possible to smoothly connect a plurality of output bands after scaling.
図6では、M=4、magv=base×4/3、vphase_base=base/4とした場合の変倍処理を示す。この場合、第1、第2、第3入力バンドそれぞれの入力ライン数Lは7となる。この入力ライン数Lは、前述の式1の計算をCPU101が行うことによって算出される。
FIG. 6 shows the scaling process when M = 4, magv = base × 4/3, and vphase_base = base / 4. In this case, the number of input lines L for each of the first, second, and third input bands is 7. The number of input lines L is calculated by the
第1入力バンドが変倍処理部1041に入力された場合、本来生成することが可能な出力ライン数は5ラインとなるが、本実施形態では、出力バンドの最下位ラインを消滅させて4本の出力ラインを生成し、第1出力バンドとして出力する。
When the first input band is input to the
また、第2入力バンドの入力は、消滅させた5ライン目の出力ライン(ライン番号4の出力ライン)を生成する際に使用する入力ラインから行う。すなわち、第1入力バンドの最終ラインである7ライン目のライン(ライン番号6の入力ライン)を含めて2ライン分戻ったラインである6ライン目のライン(ライン番号5のライン))から第2入力バンドの入力を行う。この場合、オフセットライン数は5ラインとなる。第2入力バンドに対応する出力バンドの初期位相値vphase_baseは、消滅させた5ライン目の位相値vphaseとする。 Further, the input of the second input band is performed from the input line used when generating the disappeared fifth output line (output line of line number 4). That is, from the 6th line (line number 5), which is the line returned by 2 lines including the 7th line (input line of line number 6) which is the final line of the 1st input band. 2 Input the input band. In this case, the number of offset lines is five. The initial phase value vphase_base of the output band corresponding to the second input band is the phase value vphase of the fifth line that has been extinguished.
図7のフローチャートを用いて、入力バンド毎に変倍処理部1041内で変倍処理を行ってMラインの出力画像を出力するまでの処理内容を詳細に説明する。但し、走査の変倍処理においては、特許文献1等に開示の周知の技術であるため、本実施形態では詳細な記述を省き、副走査方向における変倍処理のみについて説明する。なお、図7のフローチャートにおいて、各工程番号に付したSは、ステップを意味する。
Using the flowchart of FIG. 7, the processing contents from performing the scaling processing in the
フローチャートに示す処理を実行する前に、CPU101が前述の式1に従って、各入力バンドの入力ライン数Lを予め計算しておく。入力DMAC103は、常に、算出されたライン数Lの画像データを1バンドとしてメインメモリ130から読み出し、図2(c)に示すように縦ライン順に変倍処理部1041へ供給する。
Before executing the process shown in the flowchart, the
S700では、初期設定を行う。ここでは、第1入力バンドの位相値vphase_baseとして1以上base未満の任意の値を設定し、第1入力バンドの変倍処理を開始する。 In S700, the initial setting is performed. Here, an arbitrary value of 1 or more and less than base is set as the phase value vphase_base of the first input band, and the scaling process of the first input band is started.
S701では、以下のように変倍処理部1041の内部変数を初期化する。
vphase=vphase_base
in_ctr=out_ctr=0
ここで、vphaseは画素出力時点の副走査位相値、in_ctrは副走査方向の入力画素数をカウントする入力カウンタのカウント値、out_ctrは副走査方向の出力画素数をカウントする出力カウンタのカウント値をそれぞれ示している。初期化処理の後、入力バンドの変倍処理を開始する。
In S701, the internal variables of the
vface = vface_base
in_ctr = out_ctr = 0
Here, vphase is the sub-scanning phase value at the time of pixel output, in_ctr is the count value of the input counter that counts the number of input pixels in the sub-scanning direction, and out_ctr is the count value of the output counter that counts the number of output pixels in the sub-scanning direction. Each is shown. After the initialization process, the input band scaling process is started.
S702では、入力画素が変倍処理部1041に入力される毎に、入力カウンタのカウント値in_ctrを1増す。
In S702, the count value in_ctr of the input counter is incremented by 1 each time the input pixel is input to the
S703では、カウント値in_ctrに基づき、変倍処理部1041に入力された入力画素を用いて出力画素を生成することが可能であるか否かの判定を行う。この判定は、入力画素の副走査位相値の合計値(in_ctr×base)が、vphase_baseとmagvとの合計値以上であるか否かを判定することにより行う。すなわち、
in_ctr×base≧vphase+magv (式2)
の関係を満たすか否かの判定を行う。ここで、式2の関係を満たす場合(Yesの場合)には、S704へ進み、満たさない場合(Noの場合)にはS702に戻る。
In S703, it is determined whether or not it is possible to generate an output pixel by using the input pixel input to the
in_ctr × base ≧ vphase + magv (Equation 2)
Judgment as to whether or not the relationship of is satisfied. Here, if the relation of the
S704では、vphaseの値をvphase+magvに更新する。
S705では、変倍処理部1041から出力画素が出力される毎に、出力カウンタのカウント値out_ctrを1増やす。
In S704, the value of vphase is updated to vphase + magv.
In S705, the count value out_ctr of the output counter is incremented by 1 each time the output pixel is output from the scaling
S706では、出力バンドの上からout_ctr番目の画素値を計算し、結果を次段へ出力する。ここで、出力値out_valは、次の式3によって求められる。
out_val
=(in_val[in_ctr-1]×vphase
+in_val[in_ctr]×(base-vphase))/base (式3)
なお、in_val[x]は、出力バンドの上からx+1番目の画素の画素値を表す。
In S706, the out_ctrth pixel value from the top of the output band is calculated, and the result is output to the next stage. Here, the output value out_val is obtained by the
out_val
= (In_val [in_ctr-1] × vphase
+ In_val [in_ctr] × (base-vphase)) / base (Equation 3)
In addition, in_val [x] represents the pixel value of the x + 1th pixel from the top of the output band.
S707では、次の式4の計算を行う。
next_vphase=vphase-in_ctr×base (式4)
ここで、next_vphaseは次のバンドでのvphase_baseの初期値であり、変倍処理部1041内にレジスタとして次バンドの処理まで保持している。
In S707, the following
next_vphase = vphase-in_ctr × base (Equation 4)
Here, next_vphase is an initial value of vphase_base in the next band, and is held in the
S708では、1つの縦ラインの最後の出力画素が出力されたか否かの判定を行う。この判定は、出力カウンタのカウント値out_ctrが、予め設定した出力ライン数Mに達したか否かを判定することにより行う。すなわち、
out_ctr=M
であるか否かを判定することによって行う。判定の結果、out_ctr=Mであれば(Yesであれば)S709へ進み、そうでなければ(Noであれば)S703に戻る。この判定を行うことにより、変倍後の出力ライン数が一定値Mになる。なお、変倍処理部1041の次段が、図1に示すようにJPEG圧縮器105である場合、変倍処理部1041から出力すべきライン数Mは、通常はM=8またはM=16である。
In S708, it is determined whether or not the last output pixel of one vertical line is output. This determination is performed by determining whether or not the count value out_ctr of the output counter has reached the preset number of output lines M. That is,
out_ctr = M
It is performed by determining whether or not it is. As a result of the determination, if out_ctr = M, the process proceeds to S709 (if Yes), and if not, the process returns to S703 (if No). By making this determination, the number of output lines after scaling becomes a constant value M. When the next stage of the
この後、S709では、次の式5の計算を行う。
offset=in_ctr-1 (式5)
式5におけるin_ctrとは、ある入力バンドの中の1つの縦ラインにおいて、M番目の出力画素を生成した時点の入力画素数である。つまり、offset(オフセット)とは、現在処理中の入力バンドと次の入力バンドとの開始アドレスの差(ライン数)を意味している。また、S709では、ある入力バンドに含まれる1つの縦ラインにおいて、M番目の出力画素の生成を可能とする入力画素が入力されると、それ以降に入力される入力画素は無視する。
After that, in S709, the following
offset = in_ctr-1 (Equation 5)
The in_ctr in the
ステップS710では、入力バンドの1つの縦ラインにおいて、M番目の出力画素を生成した時の入力画素が、入力バンドの右端に位置するかどうかを判定する。すなわち、Mラインの出力画像データを生成するための入力画素が全て入力されたか否かを判定する。ここで、判定結果がYesである場合には、S712へ移行し、NOである場合にはS711へ進む。 In step S710, it is determined whether or not the input pixel at the time of generating the Mth output pixel is located at the right end of the input band in one vertical line of the input band. That is, it is determined whether or not all the input pixels for generating the output image data of the M line have been input. Here, if the determination result is Yes, the process proceeds to S712, and if NO, the process proceeds to S711.
S711では、入力バンドの全ての縦ラインが入力されていない状態にあるため、入力バンド及び出力バンドのそれぞれにおいて、処理対象となる縦ラインを1ライン分だけ右に移した後、S701へと移行する。そして、再びS704~S710において縦ラインの一番上の画素から変倍処理を行う。 In S711, since all the vertical lines of the input band are not input, in each of the input band and the output band, the vertical line to be processed is moved to the right by one line, and then the process proceeds to S701. do. Then, in S704 to S710, the scaling process is performed again from the top pixel of the vertical line.
また、S712では、次の式6の処理を行った後、入力バンドの処理を終了する。
vphase_base=next_vphase (式6)
なお、式6におけるvphase_baseは、次の出力バンドの副走査方向における初期位相値vphaseとなる。
Further, in S712, after the processing of the
vface_base = next_vface (Equation 6)
The vphase_base in
以上の処理を行うことにより、本実施形態における変倍処理部1401では、入力されるLラインの入力バンドに対して、変倍処理を施したMラインの出力バンドを常に出力することができる。 By performing the above processing, the scaling processing unit 1401 in the present embodiment can always output the output band of the M line subjected to the scaling processing to the input band of the input L line.
なお、第1、第2比較例では、S708に相当する出力ライン数の判断を行わず、入力バンドの各縦ラインの最後の画素まで用いて変倍処理を行う。これに対し、本実施形態では、S708でM番目の出力画素が出力されたと判断した場合、縦ラインの中で使用されていない入力画素は無視し、入力バンドの次の縦ライン(右の縦ライン)を用いた処理へと移行する。すなわち、入力バンドの全ての入力画素を用いれば、第1出力バンドにおいて出力できるはずの画素を出力させずに消滅させる。この消滅画素は、図6において1バンド目の5ライン目の出力画素、つまり(4)の画素に相当する。 In the first and second comparative examples, the number of output lines corresponding to S708 is not determined, and the scaling process is performed using up to the last pixel of each vertical line of the input band. On the other hand, in the present embodiment, when it is determined that the Mth output pixel is output in S708, the input pixel that is not used in the vertical line is ignored, and the next vertical line (right vertical) of the input band is ignored. Shift to processing using line). That is, if all the input pixels of the input band are used, the pixels that should be able to be output in the first output band are extinguished without being output. This disappearing pixel corresponds to the output pixel of the fifth line of the first band in FIG. 6, that is, the pixel of (4).
また、次のバンドでの初期位相値vphase_baseは、消滅画素の処理により計算される値ではなく、あくまで出力バンドの各縦ラインの最終画素(M番目の画素)が出力された時点でのnext_vphaseの値を用いる(S712)。また、このバンドについては、入力DMAC103は、前のバンドからオフセットライン数分のアドレスだけ進んだ位置から読み出しを開始する。具体的には、前の入力バンドの読み出し開始位置のアドレスをA、入力画像1ラインのバイト数をKとすると、次の入力バンドは、(A+offset×K)のアドレスから読み出しを開始する。これにより、消滅画素(図6の(4)の画素)を含む横ラインの画素を、次のバンドの処理で出力させることができる。
Further, the initial phase value vphase_base in the next band is not a value calculated by processing the disappearing pixels, but is the next_vphase at the time when the final pixel (Mth pixel) of each vertical line of the output band is output. The value is used (S712). Further, for this band, the
なお、以上の説明では、変倍処理として縮小処理を例に採り説明したが、上記の処理は、拡大処理についても同様に適用可能であり、有効である。つまり、拡大処理においても、一定ライン数の入力画像データを入力した場合、第1変形例においては、出力画像データのライン数が一定とならず、ばらつきが生じる。これに対し、本実施形態における上述の処理を適用することで、一定のライン数の出力画像データを得ることが可能になる。 In the above description, the reduction process is taken as an example of the scaling process, but the above process can be similarly applied to the enlargement process and is effective. That is, even in the enlargement process, when a fixed number of input image data is input, the number of lines of the output image data is not constant in the first modification, and variations occur. On the other hand, by applying the above-mentioned processing in the present embodiment, it becomes possible to obtain output image data of a certain number of lines.
(第2実施形態)
次に、本発明の第2実施形態を説明する。前述の第1実施形態では、magvや最初のvphase_base等の設定値に応じてオフセットライン数を入力バンドによって変化させることが必要になる。このため入力DMAC103には、アドレス進み量(offset×K)を設定する必要があるが、入力DMAC103自身にアドレス進み量の算出機能を持たせることは困難である。そこで、アドレス進み量あるいは読み出し開始のアドレス値の計算をCPU101で行い、算出した値を入力DMAC103に設定することが考えられているが、この場合にはCPU101の処理に多くの時間が必要となる。すなわち、CPU101は、ある入力バンドの処理終了後に変倍処理部1041からオフセット(offset)値を読み出し、その値に基づいてアドレス進み量を計算し、計算した値を入力DMAC103に設定するという処理を行う。このため、CPU101における処理に多くの時間がかかり、その分システム全体の処理時間が増大する可能性がある。
(Second Embodiment)
Next, a second embodiment of the present invention will be described. In the above-mentioned first embodiment, it is necessary to change the number of offset lines depending on the input band according to the set value such as magv or the first vphase_base. Therefore, it is necessary to set the address advance amount (offset × K) in the
このような処理時間の増大を避けるため、この第2実施形態では次のような構成を採る。図1において、スキャナ画像処理部104内の変倍処理部1041から入力DMAC103への通信線1043(図1内の破線矢印)を情報送信手段として設ける。そして、変倍処理部1041内で行われる上述の処理により得られるオフセットライン数に関連する情報を通信線1043を介して送信する。入力DMAC103は、この情報に基づきオフセットアドレス(offset×K[バイト])を計算し、その値を用いて自動で次のバンドの読み出し開始アドレスを導出する。
In order to avoid such an increase in processing time, the following configuration is adopted in this second embodiment. In FIG. 1, a communication line 1043 (broken line arrow in FIG. 1) from the scaling
このように、オフセットライン数に関する情報を変倍処理部1041から、変倍処理部1041へと送信することにより、アドレス計算及び設定のためのCPUの割り込み応答時間やCPU101の計算にかかる時間を無視できるようになる。このため、スキャナ画像処理部104は1ページ分をバンドごとに止まることなく連続処理することが可能になる。
In this way, by transmitting the information regarding the number of offset lines from the scaling
(第3実施形態)
次に本発明の第3実施形態を説明する。上記の各実施形態では、スキャナ画像処理部104に内包される変倍処理部1041で無段階変倍処理を行った出力一定ライン数の画像データをJPEG圧縮器105に直接入力させる構成を採る。しかし、変倍処理自体はRGB多値状態であればいずれの処理フローで行ってもよい。従って、上記実施形態のように、JPEG圧縮前にスキャナ画像処理部104に内包される変倍処理部1041で変倍処理を行うものに限らず、JPEG伸張後にプリンタ画像処理部107内で変倍処理を行う処理フローも考えられる。
(Third Embodiment)
Next, a third embodiment of the present invention will be described. In each of the above embodiments, the
例えば、プリンタ画像処理部107の最終段で必要となる量子化処理では、4×4画素等のタイル単位にディザ処理を行う構成を採る場合がある。この場合、ディザ処理への入力は4ラインの倍数でなければならない。よって、ディザ処理の直前に無段階変倍処理を行う処理フローである場合も、上記実施形態に示した変倍処理を適用することが有効である。本実施形態では、上記第1実施形態に示した変倍処理を、プリンタ画像処理部において行う例を示す。
For example, in the quantization processing required in the final stage of the printer
以下、図8を用いて、本実施形態における画像処理装置を、従来の画像処理装置と対比しつつ説明する。 Hereinafter, the image processing apparatus according to the present embodiment will be described with reference to FIG. 8 in comparison with the conventional image processing apparatus.
図8(a)は、従来の画像処理装置を示すブロック図、図8(b)は本実施形態における画像処理装置を示すブロック図である。図8(a)に示す画像処理装置には、前述の第1比較例と同様の変倍処理を行う変倍処理部107bがプリンタ画像処理部107に設けられている。これに対し、本実施形態における画像処理装置には、第1実施形態と同様の変倍処理を行う変倍処理部107bがプリンタ画像処理部107に設けられている。
FIG. 8A is a block diagram showing a conventional image processing apparatus, and FIG. 8B is a block diagram showing an image processing apparatus according to the present embodiment. In the image processing apparatus shown in FIG. 8A, the printer
図8(a)の従来の画像処理装置では、JPEG伸張後のプリンタ画像処理部107の入力DMAC107aが固定ライン数及び固定送り量でメインメモリ130から画像データを読み出し、プリンタ画像処理部107内の変倍処理部107bで変倍処理を行う。この場合、変倍処理部107bの出力ライン数は出力バンドごとに可変となる。このため、変倍処理部から出力された出力バンドをそのまま4×4タイルの画像データを処理単位とするディザ処理部へ入力することはできない。そこで、ライン数調節のためにインメモリ130に一旦格納し、その後ディザ処理部で処理可能なライン数の画像データを読み出す必要がある。この場合、変倍処理部の後に出力DMAC107cが必要となり、さらに、ディザ処理部107eの前に入力DMAC107dが必要となり、ハードウェアリソース及びメモリ帯域を消費することとなる。
In the conventional image processing apparatus of FIG. 8A, the input DMAC107a of the printer
これに対し図8(a)に示す本実施形態では、プリンタ画像処理部107内の変倍処理部107bにおいて、第1実施形態と同様の変倍処理を行うことによって一定出力ライン数の画像データ(出力バンド)を出力することが可能になる。すなわち、本実施形態では、入力DMAC107aの入力ライン数を一定にした上で、変倍処理部107bにおいて生成可能な出力ラインのうち、予め設定したライン数の出力ライン以外は消滅させる。これにより、変倍処理部107bの変倍処理を施した一定ライン数の画像データ(出力バンド)を出力することが可能になる。このため、変倍処理された画像データをディザ処理部107eに直接供給することが可能になり、ライン数調整のためのDMAC107c及び107d等のハードウェアリソースが不要となると共に、メモリ帯域を低減することも可能になる。また、本実施形態においても、第2実施例と同様に、バンドごとのオフセットライン数の情報を変倍処理部107bから入力DMAC107aへ送るようにすることも可能である。これによれば、入力DMAC107aがバンドごとに自動動作可能となるため、処理時間の向上を図ることが可能になる。
On the other hand, in the present embodiment shown in FIG. 8A, the scaling
(他の実施形態)
上記実施形態では、変倍処理部に入力する入力画像データのライン数の算出、設定を行う入力設定手段としての機能を、CPU101によって実現する例を示したが、本発明はこれに限定されない。変倍処理部に入力する画像データのライン数は、画像処理装置に設けられた入力装置等からユーザが設定することも可能である。但し、ユーザが設定した入力ライン数では、変倍処理部から出力させるべきライン数が得られない可能性もあり、その場合には、ライン数または変倍率の再設定を促すような通知を行うようにしてもよい。また、変倍処理部から出力させるべきライン数に比べ、ユーザが過剰な入力ライン数を設定した場合に、入力ライン数の削減または変倍率の変更(増加)を促すような通知を行うようにしてもよい。
(Other embodiments)
In the above embodiment, an example is shown in which the
また、本発明は、上記実施形態の1以上の機能を実現するプログラムをネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。 Further, the present invention supplies a program that realizes one or more functions of the above embodiment to a system or an apparatus via a network or a storage medium, and one or more processors in the computer of the system or the apparatus read and execute the program. It can also be realized by the processing to be performed. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.
100 画像処理装置
101 CPU
103 入力DMAC(転送手段)
1041 変倍処理部(変倍処理手段)
100
103 Input DMAC (transfer means)
1041 scaling processing unit (magnification processing means)
Claims (11)
前記転送手段から転送された前記画像データを処理単位の入力画像データとし、当該入力画像データに対して予め設定された倍率で変倍処理を施し、変倍画像データを生成可能とする変倍処理手段と、
前記変倍処理手段から出力させるべき出力ライン数を設定する出力設定手段と、を備え、
前記変倍処理手段は、前記入力画像データを用いて生成可能な変倍画像データのうち、前記出力設定手段により設定された出力ライン数に制限した画像データを出力画像データとして出力することを特徴とする画像処理装置。 A transfer means for dividing the original image data representing the original image into image data consisting of a certain number of lines along the main scanning direction and transferring the data.
The image data transferred from the transfer means is used as input image data for a processing unit, and the input image data is subjected to scaling processing at a preset magnification to generate scaling image data. Means and
An output setting means for setting the number of output lines to be output from the scaling processing means is provided.
The scaling processing means is characterized in that, of the variable magnification image data that can be generated using the input image data, image data limited to the number of output lines set by the output setting means is output as output image data. Image processing device.
前記変倍処理の倍率を設定する倍率設定手段と、
をさらに備えることを特徴とする請求項1に記載の画像処理装置。 An input setting means for setting the number of lines of the input image data to be transferred to the scaling processing means by the transfer means, and an input setting means.
A magnification setting means for setting the magnification of the variable magnification process and
The image processing apparatus according to claim 1, further comprising.
前記変倍処理手段は、所定の処理単位の次の処理単位の入力画像データの変倍処理において、前記記憶手段に記憶された前記位相値を前記次の処理単位の入力画像データに対応する出力画像データの初期位相値として用いることを特徴とする請求項1ないし3のいずれか1項に記載の画像処理装置。 When the scaling processing means outputs the output image data of the number of output lines set by the output setting means according to the input image data of a predetermined processing unit, the output image data is said to be the same. A storage means for storing the phase value in the sub-scanning direction intersecting the main scanning direction is provided.
The scaling processing means outputs the phase value stored in the storage means corresponding to the input image data of the next processing unit in the scaling processing of the input image data of the next processing unit of the predetermined processing unit. The image processing apparatus according to any one of claims 1 to 3, wherein the image processing apparatus is used as an initial phase value of image data.
前記転送手段は、前記元画像データを格納したメモリから前記処理単位の入力画像データを読み出すためのアドレスを前記情報に基づいて導出し、当該導出したアドレスの入力画像データを前記変倍処理手段へ転送することを特徴とする請求項1ないし4のいずれか1項に記載の画像処理装置。 An information transmitting means for transmitting information related to the amount of the input image data used for generating the output image data consisting of the number of output lines set by the output setting means to the transfer means is provided.
The transfer means derives an address for reading the input image data of the processing unit from the memory storing the original image data based on the information, and transfers the input image data of the derived address to the scaling processing means. The image processing apparatus according to any one of claims 1 to 4, wherein the image processing apparatus is to be transferred.
前記変倍処理手段は、前記出力画像データを前記後段処理手段に直接入力させることを特徴とする請求項1に記載の画像処理装置。 The output setting means sets the number of lines corresponding to the image processing unit in the post-stage processing means that performs predetermined image processing.
The image processing apparatus according to claim 1, wherein the scaling processing means directly inputs the output image data to the post-stage processing means.
前記転送工程によって転送された前記画像データを処理単位の入力画像データとし、当該入力画像データに対して予め設定された倍率で変倍処理を施し、変倍画像データを生成可能とする変倍処理工程と、
前記変倍処理工程により出力させるべき出力ライン数を設定する出力設定工程と、を備え、
前記変倍処理工程は、前記入力画像データを用いて生成可能な変倍画像データのうち、前記出力設定工程により設定された出力ライン数に制限した画像データを出力画像データとして出力することを特徴とする画像処理方法。 A transfer process in which the original image data representing the original image is divided into image data consisting of a certain number of lines along the main scanning direction and transferred.
The image data transferred by the transfer step is used as input image data for a processing unit, and the input image data is subjected to scaling processing at a preset magnification to generate scaling image data. Process and
It is provided with an output setting step of setting the number of output lines to be output by the scaling processing step.
The variable magnification processing step is characterized in that, of the variable magnification image data that can be generated using the input image data, image data limited to the number of output lines set by the output setting step is output as output image data. Image processing method.
元画像を表す元画像データを主走査方向に沿った一定数のラインからなる画像データに分割して転送する転送手段と、
前記転送手段から転送された前記画像データを処理単位の入力画像データとし、当該入力画像データに対して予め設定された倍率で変倍処理を施し、変倍画像データを生成可能とする変倍処理手段と、
前記変倍処理手段から出力させるべき出力ライン数を設定する出力設定手段と、
前記変倍処理手段により前記入力画像データを用いて生成可能な変倍画像データのうち、前記出力設定手段により設定された出力ライン数に制限した画像データを出力画像データとして出力する制限手段と、
して機能させること特徴とするプログラム。 Computer,
A transfer means for dividing the original image data representing the original image into image data consisting of a certain number of lines along the main scanning direction and transferring the data.
The image data transferred from the transfer means is used as input image data for a processing unit, and the input image data is subjected to scaling processing at a preset magnification to generate scaling image data. Means and
An output setting means for setting the number of output lines to be output from the variable magnification processing means, and an output setting means.
Among the variable magnification image data that can be generated by the variable magnification processing means using the input image data, the limiting means for outputting the image data limited to the number of output lines set by the output setting means as the output image data, and the limiting means.
A program that is characterized by its function.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2020198070A JP2022086187A (en) | 2020-11-30 | 2020-11-30 | Image processing device, image processing device, image processing method, and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2020198070A JP2022086187A (en) | 2020-11-30 | 2020-11-30 | Image processing device, image processing device, image processing method, and program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2022086187A true JP2022086187A (en) | 2022-06-09 |
Family
ID=81894180
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2020198070A Pending JP2022086187A (en) | 2020-11-30 | 2020-11-30 | Image processing device, image processing device, image processing method, and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2022086187A (en) |
-
2020
- 2020-11-30 JP JP2020198070A patent/JP2022086187A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8659793B2 (en) | Image processing apparatus and image processing method | |
JP6029344B2 (en) | Image processing apparatus, image processing method, and program | |
JP4725336B2 (en) | Image processing apparatus and image processing program | |
JP4382000B2 (en) | Print control system and print control method | |
US8488893B2 (en) | Image compression apparatus and image compression method | |
JP2004289667A (en) | Image processor | |
JP2022086187A (en) | Image processing device, image processing device, image processing method, and program | |
JP5020998B2 (en) | Image processing apparatus and image processing method | |
EP1383081A2 (en) | Image processing apparatus and method | |
JP2020145661A (en) | Image processing device, control method thereof, and program | |
EP1154632A2 (en) | Method, system, program and data structure for generating raster objects | |
US8654394B2 (en) | Image processing apparatus, control method, and computer-readable medium | |
JP4336470B2 (en) | Drawing control apparatus, drawing control method and program | |
JPH11203071A (en) | Picture processor | |
JP5441676B2 (en) | Image processing apparatus and processing method thereof | |
JPH11127339A (en) | Image processor | |
JP4031442B2 (en) | Image processing apparatus and image forming apparatus having the same | |
JP2020088694A (en) | Image processing apparatus and image processing method | |
JP3190118B2 (en) | Image processing device | |
JPH08123939A (en) | Picture processor | |
JP3997851B2 (en) | Image coding apparatus and image coding program | |
JP4368280B2 (en) | Image processing device | |
JP2017087514A (en) | Image processing device, image processing method, and program | |
JP6809158B2 (en) | Image processing equipment and programs | |
JP2016225794A (en) | Copying device |