JP2006135566A - Image processing apparatus and image processing method - Google Patents

Image processing apparatus and image processing method Download PDF

Info

Publication number
JP2006135566A
JP2006135566A JP2004321422A JP2004321422A JP2006135566A JP 2006135566 A JP2006135566 A JP 2006135566A JP 2004321422 A JP2004321422 A JP 2004321422A JP 2004321422 A JP2004321422 A JP 2004321422A JP 2006135566 A JP2006135566 A JP 2006135566A
Authority
JP
Japan
Prior art keywords
image
reduction
processing unit
magnification
enlargement
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
JP2004321422A
Other languages
Japanese (ja)
Other versions
JP4887614B2 (en
Inventor
Atsushi Muraki
淳 村木
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.)
Casio Computer Co Ltd
Original Assignee
Casio Computer Co Ltd
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 Casio Computer Co Ltd filed Critical Casio Computer Co Ltd
Priority to JP2004321422A priority Critical patent/JP4887614B2/en
Publication of JP2006135566A publication Critical patent/JP2006135566A/en
Application granted granted Critical
Publication of JP4887614B2 publication Critical patent/JP4887614B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof
    • G06T3/4015Demosaicing, e.g. colour filter array [CFA], Bayer pattern

Abstract

<P>PROBLEM TO BE SOLVED: To provide an image processing apparatus and an image processing method, which obtain a reduced image with high quality even when reduction processing at any magnification is carried out, in a configuration provided with a data processing section for realizing reduction of image data by means of hardware. <P>SOLUTION: A magnification block 8 and a second reduction block 10 connected in series magnify or reduce an image comprising YUV data transferred from a Bayer interpolation block 5 or read from a memory 3 and transferred via a switch 7 into an image of a target size in response to a requested magnification. A combined magnification in response to the requested magnification is set to the magnification block 8 and the second reduction block 10. While attaining the magnification or reduction by the requested magnification, reduction processing at a reduction rate at which image deterioration is always caused can be carried out by the reduction processing section. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、デジタルカメラに用いて好適な画像処理装置及び画像処理方法に関するものである。   The present invention relates to an image processing apparatus and an image processing method suitable for use in a digital camera.

従来、例えば撮影により取得したデジタルの画像データを記録媒体に記録するデジタルカメラにおいては、最終的に記録する画像データを得る過程で複数段の画像処理が行われている。例えば撮影に際してメモリに一時記憶されたベイヤーデータ、すなわち原色ベイヤー配列の色フィルタに応じた色情報の画素からなる画像データを、画素毎のRGBデータからなるYUVデータに変換するベイヤ補間処理、変換後のYUVデータの画素数を増大させたり、減少させたりすることによりデジタルズーム機能等を実現させる変倍処理といった画像処理が行われている。また、そうした画像処理では、画像全体のデータ(ベイヤーデータやYUVデータ)を処理単位とするのではなく、画面全体Aを垂直方向に分割した帯状のベルトと呼ばれる複数ライン分のデータを処理単位とし、作業用のメモリからベルト毎にデータを順に読み出して処理することが行われていた(図2(a)参照)。なお、このベルトは、処理内容に応じて前のベルトと重複することもある(図2(b)参照)。   2. Description of the Related Art Conventionally, for example, in a digital camera that records digital image data acquired by photographing on a recording medium, multiple stages of image processing are performed in the process of finally obtaining image data to be recorded. For example, Bayer interpolation processing for converting Bayer data temporarily stored in a memory at the time of photographing, that is, image data including pixels of color information corresponding to a color filter of a primary color Bayer array into YUV data including RGB data for each pixel, after conversion Image processing such as scaling processing that realizes a digital zoom function or the like by increasing or decreasing the number of pixels of YUV data. Also, in such image processing, the data of the whole image (Bayer data or YUV data) is not used as a processing unit, but data for a plurality of lines called a belt-like belt obtained by dividing the entire screen A in the vertical direction is used as a processing unit. Then, data is read out from the working memory in order for each belt and processed (see FIG. 2A). Note that this belt may overlap the previous belt depending on the processing content (see FIG. 2B).

また、前記変倍処理の高速化を目的としてハードウェアにより行う場合においては、単一の処理ブロックで同一のアルゴリズムにより行われている。例えば元画像における2点あるいは数点間の補間により新たな画素を生成したり、上記処理ブロックに入力したベルトにおける画素ラインにおける2ラインあるいは数ライン間の補間により新たな画素ラインを生成したりといった手法により単一の処理ブロックによる拡大や縮小を可能としているものが多い(下記特許文献1等参照)。
特開2003−18610号公報
Further, when the processing is performed by hardware for the purpose of speeding up the scaling process, it is performed by the same algorithm in a single processing block. For example, a new pixel is generated by interpolation between two or several points in the original image, or a new pixel line is generated by interpolation between two or several lines of pixel lines in the belt input to the processing block. Many methods enable enlargement or reduction by a single processing block (see Patent Document 1 below).
JP 2003-18610 A

しかしながら、上記のように拡大や縮小を同一のアルゴリズムにより行う場合、拡大処理は別として、縮小処理においては、ある倍率以下の処理になると画素の間引き処理となるため、折返しによって縮小後の画像品質に低下が発生するという問題があった。例えば前述した2ライン間の補間で垂直方向の縮小を行う場合にあっては、倍率が1/2倍未満になると画質低下が生じていた。   However, when the enlargement and reduction are performed using the same algorithm as described above, apart from the enlargement process, the reduction process is a pixel thinning process when the process is performed at a certain magnification or lower. There was a problem that a drop occurred. For example, in the case where the reduction in the vertical direction is performed by the interpolation between the two lines described above, the image quality deteriorates when the magnification is less than 1/2.

本発明は、かかる従来の課題に鑑みてなされたものであり、ハードウェアにより画像データの縮小を実現するためのデータ処理部を備えた構成において、いかなる倍率による縮小処理を行ったとしても、高品質の縮小画像を得ることが可能となる画像処理装置及び画像処理方法を提供することを目的とする。   The present invention has been made in view of such a conventional problem, and in a configuration including a data processing unit for realizing reduction of image data by hardware, no matter what magnification reduction processing is performed, An object of the present invention is to provide an image processing apparatus and an image processing method capable of obtaining a reduced image of quality.

前記課題を解決するため請求項1の発明にあっては、転送された元画像の画像データを拡大処理する拡大処理部と、この拡大処理部の後段に直列で接続されるとともに、拡大処理部による拡大処理後の画像データを縮小処理する縮小処理部と、要求された倍率に応じた組み合わせの倍率を前記拡大処理部と前記縮小処理部とに設定する倍率設定手段とを備えたものとした。   In order to solve the above-mentioned problem, in the invention of claim 1, an enlargement processing unit for enlarging the image data of the transferred original image, and an enlargement processing unit are connected in series to the subsequent stage of the enlargement processing unit. And a reduction processing unit that performs reduction processing on the image data after the enlargement processing, and a magnification setting unit that sets a combination magnification according to the requested magnification in the enlargement processing unit and the reduction processing unit. .

かかる構成においては、連続した拡大処理と縮小処理とを経ることによって、元画像の画像データに要求された倍率での変倍が行われるため、縮小処理に際しては、常に画像劣化を生じさせるような縮小率での縮小処理を行わせることができる。   In such a configuration, by performing a continuous enlargement process and a reduction process, the image data of the original image is scaled at a required magnification. Therefore, in the reduction process, image degradation always occurs. Reduction processing at a reduction ratio can be performed.

また、請求項2の発明にあっては、前記縮小処理部は、前記拡大処理とは異なる画像処理アルゴリズムに基づいて、拡大処理部による拡大処理後の画像データを縮小処理するものとした。   According to the invention of claim 2, the reduction processing unit reduces the image data after the enlargement processing by the enlargement processing unit based on an image processing algorithm different from the enlargement processing.

かかる構成においては、画像データを、常に最も縮小処理に適した画像処理アルゴリズムに基づいて行うことができる。   In such a configuration, the image data can always be performed based on the image processing algorithm most suitable for the reduction process.

また、請求項3の発明にあっては、前記縮小処理部が、前記拡大処理部の後段に複数並列接続され、前記倍率設定手段は、複数の縮小処理部に互いに異なる縮小率をそれぞれ設定するものとした。   According to a third aspect of the present invention, a plurality of the reduction processing units are connected in parallel to the subsequent stage of the enlargement processing unit, and the magnification setting unit sets different reduction ratios to the plurality of reduction processing units, respectively. It was supposed to be.

かかる構成においては、1回の画像データの転送動作によって、複数サイズの縮小画像を同時に得ることができる。   In such a configuration, reduced images of a plurality of sizes can be obtained simultaneously by a single image data transfer operation.

また、請求項4の発明にあっては、前記縮小処理部は、画像データを圧縮符号化する圧縮手段に対して縮小処理後の画像データを出力するものとした。   According to a fourth aspect of the present invention, the reduction processing unit outputs the image data after the reduction process to a compression unit that compresses and encodes the image data.

かかる構成においては、元画像の画像データを倍率して圧縮符号化するとき、縮小処理部には、常に画像劣化を生じさせるような縮小率での縮小処理を行わせることができる。   In such a configuration, when the image data of the original image is compressed and encoded, the reduction processing unit can be made to perform reduction processing at a reduction rate that always causes image deterioration.

また、請求項5の発明にあっては、前記拡大処理部に前記元画像の画像データを複数ラインからなる処理単位に分けて転送する転送手段と、前記縮小処理部における画像データの出力ライン数を設定するライン数設定手段と、前記転送手段によって拡大処理部に転送される画像データの転送ライン数を、前記要求された倍率に基づき個々の処理単位毎に制御するライン数制御手段とを備えたものとした。   According to a fifth aspect of the present invention, transfer means for transferring the image data of the original image to the enlargement processing unit in units of processing consisting of a plurality of lines, and the number of output lines of image data in the reduction processing unit And a line number control means for controlling the number of transfer lines of image data transferred to the enlargement processing unit by the transfer means for each processing unit based on the requested magnification. It was assumed.

かかる構成においては、要求された倍率がいかなる場合であっても、拡大処理部に転送される画像データの転送ライン数が、要求された倍率に応じて個々の処理単位毎に調整されることにより、拡大処理部における画像データの出力ライン数を常に設定されている出力ライン数に制御することができる。   In such a configuration, the number of transfer lines of image data transferred to the enlargement processing unit is adjusted for each processing unit in accordance with the requested magnification regardless of the requested magnification. The number of output lines of image data in the enlargement processing unit can be controlled to the set number of output lines at all times.

また、請求項6の発明にあっては、前記ライン数制御手段は、前記要求された縮小率と、前記画像データによる画像における、前記転送手段が画像データを転送すべき前記要求された縮小率に応じた元画像領域の上端位置と、前記要求された縮小率による縮小後の大きさの画像における、前記出力ライン数に応じた処理単位毎の上端及び下端の座標位置とに基づき、前記転送手段によって拡大処理部に転送される画像データの転送ライン数を制御するものとした。   According to a sixth aspect of the present invention, the line number control means includes the requested reduction ratio and the requested reduction ratio to which the transfer means should transfer image data in an image based on the image data. Based on the upper end position of the original image area according to the above and the coordinate positions of the upper end and the lower end of each processing unit according to the number of output lines in the image having a size reduced by the requested reduction ratio. The number of transfer lines of image data transferred to the enlargement processing unit is controlled by the means.

また、請求項7の発明にあっては、画像データを要求された倍率で変倍処理する画像処理方法において、前記要求された倍率に応じた拡大率と縮小率との組み合わせを設定する工程と、設定した前記拡大率で前記画像データを拡大処理する工程と、拡大処理後の画像データを、設定した前記縮小率で縮小処理する工程とを含む方法とした。   In the invention of claim 7, in the image processing method for scaling the image data at the requested magnification, a step of setting a combination of an enlargement ratio and a reduction ratio according to the requested magnification. The method includes a step of enlarging the image data at the set enlargement rate and a step of reducing the image data after the enlargement processing at the set reduction rate.

かかる方法においては、連続した拡大処理と縮小処理とを経ることによって、元画像の画像データに要求された倍率での変倍が行われるため、縮小処理に際しては、常に画像劣化を生じさせるような縮小率での縮小処理を行わせることができる。   In such a method, by performing a continuous enlargement process and a reduction process, the image data of the original image is scaled at a required magnification. Therefore, in the reduction process, image degradation always occurs. Reduction processing at a reduction ratio can be performed.

また、請求項8の発明にあっては、転送された元画像の画像データを拡大処理する拡大処理部と、この拡大処理部の後段に直列で接続されるとともに、拡大処理部による拡大処理後の画像データをその拡大処理とは異なる画像処理アルゴリズムに基づき縮小処理する縮小処理部とを備えた画像処理装置が有するコンピュータを、要求された縮小率に応じた組み合わせの倍率を前記拡大処理部と前記縮小処理部とに設定する倍率設定手段として機能させるためのプログラムとした。   In the invention of claim 8, the enlargement processing unit for enlarging the image data of the transferred original image is connected in series with the subsequent stage of the enlargement processing unit, and after the enlargement processing by the enlargement processing unit A computer having an image processing apparatus including a reduction processing unit that reduces the image data based on an image processing algorithm different from the enlargement processing, and the enlargement processing unit with a combination ratio according to a requested reduction rate. A program for causing the reduction processing unit to function as a magnification setting unit is provided.

以上のように請求項1、8の発明においては、連続した拡大処理と縮小処理とを経ることによって、元画像の画像データに要求された倍率での変倍が行われるため、縮小処理に際しては、常に画像劣化を生じさせるような縮小率での縮小処理を行わせることができるようにした。よって、ハードウェアにより画像データの縮小を実現するためのデータ処理部を備えた構成において、いかなる倍率による縮小処理を行ったとしても、高品質の縮小画像を得ることが可能となる。   As described above, in the first and eighth aspects of the present invention, since the enlargement / reduction at the magnification required for the image data of the original image is performed through the continuous enlargement process and reduction process, Therefore, it is possible to perform reduction processing at a reduction rate that always causes image degradation. Therefore, in a configuration including a data processing unit for realizing image data reduction by hardware, a high-quality reduced image can be obtained regardless of the reduction processing at any magnification.

また、請求項2の発明においては、画像データを、常に最も縮小処理に適した画像処理アルゴリズムに基づいて行うことができるようにした。よって、より高品質の縮小画像を得ることが可能となる。   In the invention of claim 2, image data can always be performed based on an image processing algorithm most suitable for reduction processing. Therefore, it is possible to obtain a reduced image with higher quality.

また、請求項3の発明においては、1回の画像データの転送動作によって、複数サイズの縮小画像を同時に得ることができるようにした。よって、複数サイズの縮小画像を効率良く得ることができる。   According to a third aspect of the present invention, reduced images of a plurality of sizes can be obtained simultaneously by a single image data transfer operation. Therefore, a reduced image having a plurality of sizes can be obtained efficiently.

また、請求項4の発明においては、元画像の画像データを縮小して圧縮符号化するとき、縮小処理部には、常に画像劣化を生じさせるような縮小率での縮小処理を行わせることができる。よって、高品質の圧縮画像データを得ることが可能となる。   In the fourth aspect of the invention, when the image data of the original image is reduced and compressed and encoded, the reduction processing unit can always perform a reduction process at a reduction rate that causes image degradation. it can. Therefore, it is possible to obtain high-quality compressed image data.

また、請求項5,6の発明においては、要求された倍率がいかなる場合であっても、拡大処理部に転送される画像データの転送ライン数が、要求された倍率に応じて個々の処理単位毎に調整されることにより、拡大処理部における画像データの出力ライン数を常に設定されている出力ライン数に制御することができるようにした。よって、縮小処理部の後段側に、画像データの入力ライン数が制限される他の処理ブロックが存在する場合であっても、簡略な回路構成のままで、要求される多様な倍率に対応することが可能となる。   According to the fifth and sixth aspects of the invention, the number of transfer lines of image data transferred to the enlargement processing unit is determined according to the requested magnification regardless of the requested magnification. By adjusting each time, the number of output lines of the image data in the enlargement processing unit can be controlled to the set number of output lines at all times. Therefore, even if another processing block in which the number of input lines of image data is limited exists on the subsequent stage side of the reduction processing unit, the simple circuit configuration can be used and various required magnifications can be accommodated. It becomes possible.

以下、本発明の一実施の形態を図にしたがって説明する。図1は、本発明に係る画像処理装置1の構成を示すブロック図である。この画像処理装置1は、デジタルズーム機能を備えたデジタルカメラに組み込まれており、CCD等の撮像素子から出力されたベイヤーデータからYUVデータを生成する補間処理、生成したYUVデータの画素数を設定された倍率で増減させる変倍処理を行うためのものであり、以下の構成を備えている。なお、変倍処理は、例えば撮像素子の画素数よりも小さいサイズの画像の記録や、デジタルカメラのデジタルズーム機能による画像の拡大のための処理である。   Hereinafter, an embodiment of the present invention will be described with reference to the drawings. FIG. 1 is a block diagram showing a configuration of an image processing apparatus 1 according to the present invention. This image processing apparatus 1 is incorporated in a digital camera having a digital zoom function, and is set with interpolation processing for generating YUV data from Bayer data output from an image sensor such as a CCD, and the number of pixels of the generated YUV data. This is for performing a scaling process for increasing / decreasing at a different magnification, and has the following configuration. Note that the scaling process is a process for recording an image having a size smaller than the number of pixels of the image sensor, for example, and for enlarging the image using a digital zoom function of a digital camera.

本実施の形態において、制御部2はデジタルカメラの動作全体を制御するものであり、CPUやプログラムROM、RAM、及び入出力インターフェイスを含む周辺回路(図示せず)等から構成されている。そして、上記プログラムROMに格納されているプログラムに基づき画像処理装置1の各部を制御することにより本発明のライン数設定手段、倍率設定手段、ライン数制御手段、倍率制御手段として機能する。   In the present embodiment, the control unit 2 controls the entire operation of the digital camera, and includes a CPU, a program ROM, a RAM, a peripheral circuit (not shown) including an input / output interface, and the like. Then, by controlling each part of the image processing apparatus 1 based on the program stored in the program ROM, it functions as the line number setting means, magnification setting means, line number control means, and magnification control means of the present invention.

メモリ3は、CCD等から出力されたベイヤデータや、YUVデータが一時記憶されるDRAM等であって、JPEG符号化結果が出力される転送先でもあり、各データを一時記憶しておくのに十分な容量を有している。   The memory 3 is a DRAM or the like in which Bayer data output from a CCD or the like and YUV data are temporarily stored, and is also a transfer destination to which a JPEG encoding result is output, and is sufficient for temporarily storing each data. Have a large capacity.

第1DMA4は、前記制御部2からの指示に応じて、ベイヤデータの状態にある画像データを所定の処理単位でメモリ3上から読み出しベイヤ補間ブロック5に転送するデータ転送部である。また、第2DMA6は、YUVデータの状態にある画像データを所定の処理単位でメモリ3上から読み出しスイッチ7を介して拡大ブロック8に転送するデータ転送部である。スイッチ7は、前記制御部2からの指示に応じて、拡大ブロック8に入力する画像データを、ベイヤ補間ブロック5が出力するYUVデータと、第2DMA6から転送されるメモリ3上のYUVデータとに切り替える。   The first DMA 4 is a data transfer unit that reads image data in a Bayer data state from the memory 3 in a predetermined processing unit and transfers the image data to the Bayer interpolation block 5 in accordance with an instruction from the control unit 2. The second DMA 6 is a data transfer unit that transfers image data in the YUV data state from the memory 3 to the enlarged block 8 via the read switch 7 in a predetermined processing unit. In response to an instruction from the control unit 2, the switch 7 converts the image data input to the enlargement block 8 into YUV data output from the Bayer interpolation block 5 and YUV data on the memory 3 transferred from the second DMA 6. Switch.

前記第1DMA4及び第2DMA6(両者が共に本発明の転送手段である。)によってメモリ3から読み出される画像データは、図2(a)に示したように全画像Aを所定のサイズに垂直方向に分割した帯状の矩形部分の画像データであって、複数ライン分の画素のデータからなる画像データBである。これをベルトと呼ぶ。なお、各ベルトB(0,1,2,・・・)は、図2(b)に示したように処理に応じてその前のベルトとデータが重複する場合もある。また、前記第1DMA4及び第2DMA6においては、メモリ3から読み出したベルトのデータを自己内に一時保持するとともに、図3に示したように垂直方向に1画素ずつ走査して後段へ出力する。係るデータ走査をベルト走査と呼ぶ。   The image data read from the memory 3 by the first DMA 4 and the second DMA 6 (both are the transfer means of the present invention), the entire image A is vertically set to a predetermined size as shown in FIG. The image data B is the image data of the divided strip-like rectangular portion, and is composed of pixel data for a plurality of lines. This is called a belt. Each belt B (0, 1, 2,...) May overlap data with the preceding belt depending on the processing as shown in FIG. In the first DMA 4 and the second DMA 6, the belt data read from the memory 3 is temporarily stored in the self, and as shown in FIG. 3, it is scanned pixel by pixel in the vertical direction and output to the subsequent stage. Such data scanning is called belt scanning.

前記ベイヤ補間ブロック5は、第1DMA4から転送されたベイヤデータ(図4(a)参照)から補間処理を行い、最終的にはYUVデータとして出力する。本実施の形態では図4(b)に示したように5×5画素のベイヤデータから1画素のYUVデータを生成する。   The Bayer interpolation block 5 performs interpolation processing from the Bayer data (see FIG. 4A) transferred from the first DMA 4, and finally outputs it as YUV data. In this embodiment, as shown in FIG. 4B, YUV data of one pixel is generated from Bayer data of 5 × 5 pixels.

前記拡大ブロック8は、制御部2からの指示に応じて、スイッチ7を介して入力されたYUVデータを所望の倍率に拡大(画素数を増大)し、後段側に並列状態に直列接続されている第1縮小ブロック9または第2縮小ブロック10へ選択的に出力する。拡大ブロック8におけるデータの入出力はともにベルト走査である。倍率は水平、垂直が独立して設定可能であり、拡大アルゴリズムは、水平および垂直ともに、周辺6画素から1画素の補間結果を得る線形補間である。図5に垂直5/3倍の例を示す。例えば補間点が元画像における画素「2」と画素「3」の間にある場合(図で「2.3」や「2.9」)、「0〜5」の画素を用い補間係数としてLanczosを使用し補間点(出力画素)を求める。倍率の設定は、元画像における1画素間を16384分割したときの画素間隔で指定される。例えば2倍の場合は8192、4倍の場合は4096となる。したがってこの分解能で表現できる任意の倍率設定が可能となっている。   The enlargement block 8 enlarges the YUV data input via the switch 7 to a desired magnification (increases the number of pixels) in accordance with an instruction from the control unit 2 and is connected in series in a parallel state on the rear stage side. Selectively output to the first reduced block 9 or the second reduced block 10. Both the input and output of data in the enlargement block 8 is belt scanning. The magnification can be set independently for horizontal and vertical, and the enlargement algorithm is linear interpolation that obtains an interpolated result of one pixel from six neighboring pixels in both the horizontal and vertical directions. FIG. 5 shows an example of vertical 5/3 times. For example, when the interpolation point is between the pixel “2” and the pixel “3” in the original image (“2.3” or “2.9” in the figure), the pixel “0-5” is used as the interpolation coefficient Lanczos. Is used to find the interpolation point (output pixel). The setting of the magnification is designated by the pixel interval when one pixel in the original image is divided into 16384. For example, when it is 2 times, it is 8192, when it is 4 times. Therefore, an arbitrary magnification setting that can be expressed with this resolution is possible.

前記第1縮小ブロック9と第2縮小ブロック10は、入力されたYUVデータに対して縮小処理を行い、出力する。縮小アルゴリズムは平均操作法であり、データの入出力はともにベルト走査である。倍率は水平および垂直ともに独立に設定が可能である。倍率をn/mとするとき(ただし、n≦m)、水平倍率ではnが1〜256、mが1〜256の範囲内で設定でき、垂直倍率ではnが1〜16、mが1〜32の範囲内で設定できる。垂直倍率のm、nはそれぞれ処理するベルトの入力側のライン数、出力側のライン数そのものとなる。図6は、垂直6ラインを4ラインに縮小する場合の例である。   The first reduction block 9 and the second reduction block 10 reduce the input YUV data and output it. The reduction algorithm is an average operation method, and both data input and output is belt scanning. The magnification can be set independently for both horizontal and vertical. When the magnification is n / m (where n ≦ m), n can be set within the range of 1 to 256 and m is 1 to 256 for the horizontal magnification, and n is 1 to 16 and m is 1 to 1 for the vertical magnification. It can be set within the range of 32. The vertical magnifications m and n are the number of lines on the input side and the number of lines on the output side of the belt to be processed, respectively. FIG. 6 shows an example in which 6 vertical lines are reduced to 4 lines.

第1縮小ブロック9と第2縮小ブロック10は全く等価のブロックであるとともに、倍率設定は、双方の縮小ブロック9,10について、それぞれ倍率の分母(m)が共通であるという制約の中で、異なった倍率を設定することができる。ただし、第2縮小ブロック10の倍率の分子(=出力ベルトのライン数)については、後段のJPEG入力I/F12との接続の都合から、JPEG符号化の形式に応じて「8」または「16」からの選択となる。   The first reduced block 9 and the second reduced block 10 are completely equivalent blocks, and the magnification setting is such that both the reduced blocks 9 and 10 share the same denominator (m). Different magnifications can be set. However, the numerator of the magnification of the second reduction block 10 (= the number of lines of the output belt) is “8” or “16” depending on the JPEG encoding format because of the connection with the JPEG input I / F 12 at the subsequent stage. Will be selected from.

第3DMA11は、制御部2からの指示に応じて、第1縮小ブロック9からベルト走査による画像データを受け取り、それをメモリ3上の該当する部分に転送するデータ転送部である。   The third DMA 11 is a data transfer unit that receives image data by belt scanning from the first reduction block 9 in accordance with an instruction from the control unit 2 and transfers the image data to a corresponding portion on the memory 3.

JPEG入力I/F12は、べルト走査によって入力された画像データ(YUVデータ)を画素ブロック単位(MCU)で一時保持し、JPEG符号化器13側の入力形式(Y:Cb:Cr)に則った形式で、4:2:2や4:2:0等へのデータ変換を行い出力するインターフェース部である。すなわち上記入力形式が4:2:0である場合には、図7に示したように16×16画素を画素ブロック単位として出力し、入力形式が4:2:2である場合には、8×8画素を画素ブロック単位として出力する。JPEG符号化器13は、入力されたYUVデータを4:2:2や4:2:0の形式でJPEG符号化し、コードデータを出力する。第4DMA14は、そのコードデータをメモリ3上の該当する部分に転送するデータ転送部である。   The JPEG input I / F 12 temporarily holds image data (YUV data) input by the belt scan in pixel block units (MCU), and conforms to the input format (Y: Cb: Cr) on the JPEG encoder 13 side. In this format, the interface unit converts the data into 4: 2: 2, 4: 2: 0, etc. and outputs the data. That is, when the input format is 4: 2: 0, 16 × 16 pixels are output as a pixel block unit as shown in FIG. 7, and when the input format is 4: 2: 2, Outputs 8 pixels as a pixel block unit. The JPEG encoder 13 JPEG-encodes the input YUV data in a 4: 2: 2 or 4: 2: 0 format, and outputs code data. The fourth DMA 14 is a data transfer unit that transfers the code data to a corresponding part on the memory 3.

次に、前記制御部2の処理内容について説明する。まず、前述した第1DMA4及び第2DMA6の制御によるデータ転送に関する処理内容を説明する。図8は、その手順を示すフローチャートである。制御部2は、処理開始とともに処理対象となるベルト番号iの初期化を行った後(ステップSA1)、i番目(処理開始当初は0番目)のベルトの左端、右端、上端、下端に対応する元画像(ベイヤデータ又はYUVデータ)上の座標(ys_left,ys_rgt,ys_top,ys_btm)を演算する(ステップSA2)。本実施の形態においては、以下のような演算を行う。   Next, processing contents of the control unit 2 will be described. First, processing contents relating to data transfer under the control of the first DMA 4 and the second DMA 6 will be described. FIG. 8 is a flowchart showing the procedure. The control unit 2 initializes the belt number i to be processed at the start of processing (step SA1), and then corresponds to the left end, right end, upper end, and lower end of the i-th belt (0th at the beginning of processing). The coordinates (ys_left, ys_rgt, ys_top, ys_btm) on the original image (Bayer data or YUV data) are calculated (step SA2). In the present embodiment, the following calculation is performed.

ここでは、一例としてデジタルズーム機能が設定されていた場合におけるYUVデータに対する拡大処理を行う場合を想定し、便宜上、拡大倍率が水平及び垂直ともに5倍、拡大画像のサイズは32×32画素で、各ベルトのライン数が8(=拡大画像のベルト数が4の構成)であるものとして説明する。図9は、その前提でのベルト処理時おける元画像(YUVデータ)と、それと対応する拡大画像(最終的にJPEG符号化器に入力する画像)Cにおけるベルト(0〜3)との関係を示した図である。図中、大きな丸は元画像の画素であり、そのうち薄塗りの丸が処理ベルト、すなわち同図(a)では0番目のベルト、同図(b)では1番目のベルトの範囲の画素である。また、小さな黒丸は処理ベルトに対する出力ベルトの範囲(32×8画素)の画素である。
・拡大画像Cにおける各画素の座標を(xb,yb)、
・水平および垂直方向の拡大率の逆数を(xstep,ystep)、
・拡大画像C上の左上端に対応する元画像上での位置を(x0,y0)
としたとき、
元画像対応座標(xs,ys)は、
xs = xb × xstep + x0
ys = yb × ystep + y0
で求めることができる。
Here, as an example, it is assumed that enlargement processing is performed on YUV data when the digital zoom function is set. For convenience, the enlargement magnification is 5 times both horizontally and vertically, and the size of the enlarged image is 32 × 32 pixels. The description will be made assuming that the number of belt lines is 8 (= the configuration in which the number of belts in the enlarged image is 4). FIG. 9 shows the relationship between the original image (YUV data) at the time of belt processing on the premise and the belt (0 to 3) in the corresponding enlarged image (image finally input to the JPEG encoder) C. FIG. In the figure, the large circles are pixels of the original image, and the lightly-painted circles are the processing belts, that is, the pixels in the range of the 0th belt in FIG. 5A and the 1st belt in FIG. . A small black circle is a pixel in the output belt range (32 × 8 pixels) with respect to the processing belt.
The coordinates of each pixel in the enlarged image C are (xb, yb),
The reciprocal of the magnification in the horizontal and vertical directions (xstep, ystep),
The position on the original image corresponding to the upper left corner on the enlarged image C is (x0, y0)
When
The coordinates corresponding to the original image (xs, ys) are
xs = xb × xstep + x0
ys = yb × ystep + y0
Can be obtained.

本実施の形態では、上記式により各ベルトの左端、右端、上端、下端の座標位置を計算するとともに、その際、左端と上端の計算結果については小数点以下を切り捨てる処理を行い、右端と下端の計算結果については小数点以下を切り捨てる処理を行って、最終的な計算結果とする。   In the present embodiment, the coordinate positions of the left end, the right end, the upper end, and the lower end of each belt are calculated according to the above formulas. The calculation result is rounded down to the final calculation result.

図10は、上記演算により得られる、図9に示した各ベルトにおける拡大画像Cの左端、右端、上端、下端の座標と、上記式から直接得られる元画像の左端、右端、上端、下端の座標、及びその最終的な計算結果となる入力範囲としての左端、右端、上端、下端の座標との対応関係を示した図である。なお、図示した各座標の値のうち、元画像対応座標(xs,ys)の計算に必要となる、拡大画像C上の左上端に対応する元画像上での位置(x0,y0)、つまりベルト0における元画像対応座標の上端(垂直座標:「0.8」)と左端(水平座標:「1.5」)は、拡大率との関係で決まる座標値であって、本実施の形態においては制御部2のプログラムROM等に予め用意されている対応テーブルから求められる座標値である。   FIG. 10 shows the coordinates of the left end, right end, upper end, and lower end of the enlarged image C in each belt shown in FIG. 9 obtained by the above calculation, and the left end, right end, upper end, and lower end of the original image obtained directly from the above formula. It is the figure which showed the correspondence with the coordinate of a coordinate and the left end, right end, upper end, and lower end as an input range used as the final calculation result. Of the values of each coordinate shown in the figure, the position (x0, y0) on the original image corresponding to the upper left end on the enlarged image C, which is necessary for calculating the original image corresponding coordinates (xs, ys), that is, The upper end (vertical coordinate: “0.8”) and the left end (horizontal coordinate: “1.5”) of the coordinates corresponding to the original image in the belt 0 are coordinate values determined by the relationship with the enlargement ratio, and this embodiment Is a coordinate value obtained from a correspondence table prepared in advance in the program ROM of the control unit 2 or the like.

引き続き、上記のようにして求めた座標に対して、拡大処理に必要な周辺画素分を広げた座標を求める(ステップSA3)。ここでは上下左右にそれぞれ3画素分広げるものとする。次に、元画像がベイヤデータであって、ベイヤ補間が必要なときには(ステップSA4でYES)、ベイヤ補間ブロック5におけるベイヤ補間処理に必要な周辺画素分を広げた座標を求める(ステップSA5)。ここでは上下左右にそれぞれ2画素分広げるものとする。そして、求めた座標を元画像の入力領域として第1DMA4に設定しベルト処理(ベルト走査によるデータ転送)を開始させる(ステップSA6)。また、元画像がベイヤデータでなくYUVデータであったときには(ステップSA4でNO)、ステップS3で求めた座標を元画像の入力領域として第2DMA6に設定してからベルト処理を開始させる(ステップSA7)。そして、当該ベルト処理が終了したら(ステップSA8でYES)、ベルト番号を更新(インクリメント)する(ステップSA9)。以後、ステップSA2へ戻り前述した処理を繰り返し、最後のベルト番号のベルトに対する処理、つまり1画像分の処理が終了した時点で(ステップSA10)、処理を終了する。   Subsequently, coordinates obtained by expanding the peripheral pixels necessary for the enlargement processing are obtained with respect to the coordinates obtained as described above (step SA3). Here, it is assumed that each pixel is expanded by three pixels vertically and horizontally. Next, when the original image is Bayer data and Bayer interpolation is required (YES in Step SA4), coordinates obtained by expanding peripheral pixels necessary for Bayer interpolation processing in the Bayer interpolation block 5 are obtained (Step SA5). Here, it is assumed that two pixels are expanded vertically and horizontally. Then, the obtained coordinates are set in the first DMA 4 as an input area of the original image, and belt processing (data transfer by belt scanning) is started (step SA6). If the original image is not Bayer data but YUV data (NO in step SA4), the coordinates obtained in step S3 are set in the second DMA 6 as the input area of the original image, and then belt processing is started (step SA7). . When the belt process is completed (YES in step SA8), the belt number is updated (incremented) (step SA9). Thereafter, returning to step SA2, the above-described processing is repeated, and when the processing for the belt with the last belt number, that is, processing for one image is completed (step SA10), the processing is terminated.

図11は、上述した制御部2の処理に伴う、画像処理装置1の各部における各ベルトのデータ内容の変化を示した遷移図である。すなわちメモリ3から転送された元画像Aにおける補間入力ベルトベイヤデータaは、ベイヤ補間ブロック5で画素補間された後、拡大入力ベルトYUVデータbとして拡大ブロック8へ転送される。また、そこで拡大(画素数を増大)処理が施された拡大出力ベルト(ベースベルト)YUVデータcが第1縮小ブロック9及び第2縮小ブロック10へ転送され、異なる縮小率で縮小された後、第1出力ベルトYUVデータd、及び第2出力ベルトYUVデータeとして出力され、そのうちの第2出力ベルトYUVデータeがJPEG入力I/F12を介してJPEG符号化器13に入力される。   FIG. 11 is a transition diagram showing changes in the data content of each belt in each unit of the image processing apparatus 1 due to the processing of the control unit 2 described above. That is, the interpolation input belt Bayer data a in the original image A transferred from the memory 3 is subjected to pixel interpolation in the Bayer interpolation block 5 and then transferred to the enlargement block 8 as the enlargement input belt YUV data b. Further, the enlarged output belt (base belt) YUV data c subjected to enlargement (increasing the number of pixels) processing is transferred to the first reduction block 9 and the second reduction block 10 and reduced at different reduction ratios. The first output belt YUV data d and the second output belt YUV data e are output, and the second output belt YUV data e is input to the JPEG encoder 13 via the JPEG input I / F 12.

そして、上述したベルト処理(データ転送)においては、前述したステップSA2における演算によって、図10に示したように各ベルトの左端、右端、上端、下端(図10で、垂直側の元画像対応座標)が個別に決定される、つまりライン数が個別に制御されることにより、第2縮小ブロック10からJPEG入力I/F12を介してJPEG符号化器13に入力される第2出力ベルトYUVデータeにおけるライン数が、JPEG符号化器13側の入力形式に応じたライン数(ここでは8ライン)に維持される。無論、上記の演算が拡大率に基づくものであって、制御されるライン数には拡大率が反映されるため、前述した拡大率に限らず、いかなる拡大率(又は縮小率)が設定されている場合であっても、第2出力ベルトYUVデータeのライン数をJPEG符号化器13側の入力形式に応じたライン数とすることができる。   Then, in the above-described belt processing (data transfer), the left end, the right end, the upper end, and the lower end of each belt (in FIG. 10, the coordinates corresponding to the original image on the vertical side) as shown in FIG. ) Are individually determined, that is, the number of lines is individually controlled, whereby the second output belt YUV data e input from the second reduction block 10 to the JPEG encoder 13 via the JPEG input I / F 12 The number of lines is maintained at the number of lines (eight lines here) according to the input format on the JPEG encoder 13 side. Of course, the above calculation is based on the enlargement factor, and the enlargement factor is reflected in the number of lines to be controlled. Therefore, any enlargement factor (or reduction factor) is set, not limited to the aforementioned enlargement factor. Even in such a case, the number of lines of the second output belt YUV data e can be set to the number of lines according to the input format on the JPEG encoder 13 side.

次に、制御部2が、前述した拡大ブロック8と第1縮小ブロック9及び第2縮小ブロック10に倍率を設定するときの処理内容について説明する。図12はその手順を示したフローチャートである。設定する倍率は、元画像(ベイヤデータ、又はYUVデータ)のサイズを、例えばその時のデジタルズーム機能により要求される倍率に応じたものである。なお、ここでは垂直方向の倍率の設定についてのみの説明とする。   Next, processing contents when the control unit 2 sets the magnification for the above-described enlarged block 8, first reduced block 9, and second reduced block 10 will be described. FIG. 12 is a flowchart showing the procedure. The magnification to be set corresponds to the size of the original image (Bayer data or YUV data), for example, according to the magnification required by the digital zoom function at that time. Here, only the setting of the magnification in the vertical direction will be described.

制御部2は、処理開始に伴い、そのときのJPEG符号化形式によって決まるベルトの高さつまりライン数(「16」又は「8」)と、要求されているJPEG入力画像(JPEG符号化器13に入力する画像)のサイズから、そのベルト数を計算する(ステップSB1)。次に、計算したベルト数と元画像の高さから、元画像の平均ベルト高さを算出し(ステップSB2)、それがJPEG入力画像のベルト高さよりも大きいか否かを判別する(ステップSB3)。   As the process starts, the control unit 2 determines the height of the belt determined by the JPEG encoding format at that time, that is, the number of lines (“16” or “8”), and the requested JPEG input image (JPEG encoder 13 The number of belts is calculated from the size of the image input to (step SB1). Next, the average belt height of the original image is calculated from the calculated number of belts and the height of the original image (step SB2), and it is determined whether or not it is larger than the belt height of the JPEG input image (step SB3). ).

かかる判別の結果がNOであり、元画像の平均ベルト高さがJPEG入力画像のベルト高さ以下であったときには、拡大処理のみが必要と判断し、拡大画像のベルト高さをJPEG入力画像のベルト高さとするものとして(ステップSB4)、拡大ブロック8の垂直倍率を、JPEG入力画像のベルト高さと元画像の平均ベルト高さとの比率から求めた倍率に設定し(ステップSB5)、第2縮小ブロック10の垂直倍率を「1倍」に設定する(ステップSB6)。   If the result of this determination is NO and the average belt height of the original image is equal to or less than the belt height of the JPEG input image, it is determined that only enlargement processing is necessary, and the belt height of the enlarged image is determined based on the height of the JPEG input image. As the belt height (step SB4), the vertical magnification of the enlargement block 8 is set to the magnification obtained from the ratio between the belt height of the JPEG input image and the average belt height of the original image (step SB5), and the second reduction. The vertical magnification of the block 10 is set to “1 ×” (step SB6).

また、ステップSB3の判別結果がYESであり、元画像の平均ベルト高さがJPEG入力画像のベルト高さを超えていたときには、さらに、ステップSB2における元画像の平均ベルト高さの算出結果が割り切れた値か否かを判別する(ステップSB7)。なお、このとき使用する関数int(r)は小数点以下を切り捨てる関数である。そして、割り切れたときには(ステップSB7でYES)、縮小処理のみが必要と判断し、拡大画像のベルト高さを元画像の平均ベルト高さそのままとするものとして(ステップSB8)、拡大ブロック8の垂直倍率を「1倍」とし(ステップSB9)、第2縮小ブロック10の垂直倍率を、拡大画像のベルト高さをJPEG入力画像のベルト高さとする倍率に設定する(ステップSB10)。   When the determination result in step SB3 is YES and the average belt height of the original image exceeds the belt height of the JPEG input image, the calculation result of the average belt height of the original image in step SB2 is further divisible. It is determined whether or not the value is the same (step SB7). Note that the function int (r) used at this time is a function for truncating the decimal part. If it is divisible (YES in step SB7), it is determined that only the reduction process is necessary, and the belt height of the enlarged image is left as it is (average of belt height of the original image) (step SB8). The magnification is set to “1 ×” (step SB9), and the vertical magnification of the second reduction block 10 is set to a magnification that makes the belt height of the enlarged image the belt height of the JPEG input image (step SB10).

また、ステップSB7の判別結果がNOであって、ステップSB2における元画像の平均ベルト高さの算出結果が割り切れない値であったときには、拡大して縮小する必要があると判断し、拡大画像のベルト高さを切り上げた値に変更する(ステップSB11)。なお、このとき使用する関数roundup(r)は小数点以下を切り上げる関数である。次に、変更後の拡大画像のベルト高さとベルト数とから計算上の拡大画像の高さを算出する(ステップSB12)。そして、拡大ブロック8の垂直倍率を、計算上の拡大画像の高さと元画像の高さとの比率から求めた倍率に設定し(ステップSB13)、さらに第2縮小ブロック10の垂直倍率を、拡大画像のベルト高さをJPEG入力画像のベルト高さとする倍率に設定する(ステップSB14)。   If the determination result in step SB7 is NO and the calculation result of the average belt height of the original image in step SB2 is a value that cannot be divided, it is determined that the image needs to be enlarged and reduced. The belt height is changed to a rounded up value (step SB11). Note that the function roundup (r) used at this time is a function that rounds up after the decimal point. Next, the calculated height of the enlarged image is calculated from the belt height and the number of belts of the enlarged image after the change (step SB12). Then, the vertical magnification of the enlarged block 8 is set to a magnification obtained from the ratio between the height of the enlarged image calculated and the height of the original image (step SB13), and the vertical magnification of the second reduced block 10 is set to the enlarged image. Is set to a magnification that sets the belt height of the JPEG input image as the belt height (step SB14).

このように、拡大ブロック8と第2縮小ブロック10の各々に、その時点で要求されている倍率に応じた組み合わせの倍率が設定されることにより、最終的に第2縮小ブロック10から出力される拡大画像のベルト数とベルト高さとが要求されている倍率に応じた値となる。すなわち拡大画像のサイズが、要求されている倍率に応じた処理目標のサイズとなる。   In this way, a combination of magnifications corresponding to the magnifications requested at that time is set for each of the enlarged block 8 and the second reduced block 10, and finally output from the second reduced block 10. The number of belts and the belt height of the enlarged image are values corresponding to the required magnification. That is, the size of the enlarged image becomes the size of the processing target corresponding to the requested magnification.

そして、上述したステップSB6,SB10,SB14のいずれかの処理が終了したら、図13に示したプレビュー用縮小設定処理を行う(ステップSB15)。係る処理では、まずステップSB1で取得したJPEG入力画像のベルト数と、決められているプレビュー画像(表示用YUVデータ)の高さから、プレビュー元画像の平均ベルト高さを算出し(ステップSB101)。その算出結果が割り切れた値か否かを判別する(ステップSB102)。そして、割り切れた場合には(ステップSB102でYES)、第1縮小ブロック9の垂直倍率を、プレビュー元画像のベルト高さをJPEG入力画像のベルト高さとする倍率に設定する(ステップSB104)。また、割り切れなかった場合には(ステップSB102でNO)、プレビュー元画像の平均ベルト高さを切り上げ、プレビュー元画像のベルト高さを切り上げた値に変更した後(ステップSB103)、それをJPEG入力画像のベルト高さとする倍率に設定する(ステップSB104)。これにより、制御部2は倍率設定を終了する。   When any of the above-described steps SB6, SB10, and SB14 is completed, the preview reduction setting process shown in FIG. 13 is performed (step SB15). In such processing, first, the average belt height of the preview original image is calculated from the number of belts of the JPEG input image acquired in step SB1 and the height of the determined preview image (display YUV data) (step SB101). . It is determined whether or not the calculation result is a divisible value (step SB102). If it is divisible (YES in step SB102), the vertical magnification of the first reduction block 9 is set to a magnification that makes the belt height of the preview original image the belt height of the JPEG input image (step SB104). If it is not divisible (NO in step SB102), the average belt height of the preview original image is rounded up and changed to a value obtained by rounding up the belt height of the preview original image (step SB103), and then input to JPEG The magnification is set as the belt height of the image (step SB104). Thereby, the control part 2 complete | finishes magnification setting.

図14は、以上の倍率設定処理に際して拡大して縮小する必要があると判断され、ステップSB11〜SB14の処理が行われた場合における拡大ブロック8、第1縮小ブロック9、第2縮小ブロック10の具体的な設定倍率の組み合わせと、そのときの元画像a、拡大画像b、JPEG入力画像c、プレビュー元画像dのデータ内容を示した図である。ここではJPEG符号化形式が4:2:0で、元画像aのサイズが300万画素(2048×1536)、要求された倍率(縮小)に応じたJPEG入力画像cのサイズが200万画素(1600×1200)、プレビュー元画像dがQVGA(240×320)である場合を示す。   In FIG. 14, it is determined that it is necessary to enlarge and reduce in the above magnification setting process, and when the processes of steps SB11 to SB14 are performed, the enlarged block 8, the first reduced block 9, and the second reduced block 10 are processed. It is the figure which showed the data content of the combination of a specific setting magnification, the original image a at that time, the enlarged image b, the JPEG input image c, and the preview original image d. Here, the JPEG encoding format is 4: 2: 0, the size of the original image a is 3 million pixels (2048 × 1536), and the size of the JPEG input image c corresponding to the requested magnification (reduction) is 2 million pixels ( 1600 × 1200) and the preview original image d is QVGA (240 × 320).

かかる場合には、拡大ブロック8の水平倍率は等倍、垂直倍率は1.025・・倍となり、拡大画像bのサイズが2048×1575で、そのベルト数が75でベルト高さが21となる。また、第2縮小ブロック10の水平倍率は100/128倍、垂直倍率は16/21倍となり、JPEG入力画像cのサイズが要求された1600×1200で、そのベルト数が75、ベルト高さが16となる。同時に、第1縮小ブロック9の水平倍率は20/128倍、垂直倍率は4/21倍となり、プレビュー元画像dのサイズがQVGAよりもやや大きな320×300で、そのベルト数が75、ベルト高さが4となる。   In such a case, the horizontal magnification of the enlargement block 8 is the same magnification, the vertical magnification is 1.025 ..times, the size of the enlarged image b is 2048 × 1575, the number of belts is 75, and the belt height is 21. . The second reduction block 10 has a horizontal magnification of 100/128 times and a vertical magnification of 16/21 times. The size of the JPEG input image c is 1600 × 1200, the number of belts is 75, the belt height is 16 At the same time, the horizontal magnification of the first reduction block 9 is 20/128 times, the vertical magnification is 4/21 times, the size of the preview original image d is 320 × 300 which is slightly larger than QVGA, the number of belts is 75, the belt height Is 4.

次に、デジタルカメラにおける静止画撮影時に、制御部2が前述したデータ転送処理、倍率設定処理に基づき実施する静止画符号化処理について説明する。図15はその手順を示したフローチャートである。すなわち制御部2は、前述した一連のデータ転送に基づくデータ変換により、まず、1回目のデータ変換により、第1縮小ブロック9を使用する系によってベイヤデータから表示用YUVデータ(プレビュー画像)を生成し、それをメモリ3へ出力すると同時に、第2縮小ブロック10を使用する系によってベイヤデータから主画像のJPEG符号化を実施し、符号化したデータをメモリ3へ出力する(ステップSC1)。引き続き2回目のデータ変換により、第2縮小ブロック10を使用する系によって、1回目の変換でメモリ3に記憶された表示用YUVデータから、前記主画像に付随するサムネイル画像のJPEG符号化を実施し、符号化したデータをメモリ3へ出力する(ステップSC2)。   Next, a still image encoding process performed by the control unit 2 based on the above-described data transfer process and magnification setting process at the time of still image shooting with a digital camera will be described. FIG. 15 is a flowchart showing the procedure. That is, the control unit 2 generates display YUV data (preview image) from the Bayer data by the system using the first reduction block 9 by the first data conversion by the data conversion based on the series of data transfer described above. At the same time, the main image is JPEG-encoded from the Bayer data by the system using the second reduced block 10, and the encoded data is output to the memory 3 (step SC1). In the second data conversion, JPEG encoding of the thumbnail image associated with the main image is performed from the display YUV data stored in the memory 3 by the first conversion by the system using the second reduced block 10. Then, the encoded data is output to the memory 3 (step SC2).

ここで以上説明した画像処理装置1においては、前述したようにメモリ3に記憶されている画像データをベルト毎に拡大又は縮小してJPEG符号化するとき、いかなる拡大率(又は縮小率)が設定されている場合であっても、JPEG符号化器13に入力するベルト(第2出力ベルトYUVデータe)のライン数を、JPEG符号化器13に設定されているライン数とすることができる。したがって、第2縮小ブロック10の後段側に、JPEG符号化器13が存在する構成であっても、第2縮小ブロック10にライン数の整合性を確保するためのバッファメモリ等の回路を設ける必要がなく、簡略な回路構成によって多様な倍率設定による変倍処理を高速に行うことができる。   In the image processing apparatus 1 described above, when the image data stored in the memory 3 is enlarged or reduced for each belt and JPEG encoding is performed as described above, any enlargement ratio (or reduction ratio) is set. Even if it is, the number of lines of the belt (second output belt YUV data e) input to the JPEG encoder 13 can be set to the number of lines set in the JPEG encoder 13. Therefore, it is necessary to provide a circuit such as a buffer memory for ensuring the consistency of the number of lines in the second reduced block 10 even if the JPEG encoder 13 exists on the subsequent stage side of the second reduced block 10. In other words, it is possible to perform zooming processing with various magnification settings at high speed with a simple circuit configuration.

なお、かかる効果については、例えば図16に示した画像処理装置51のように、画像の拡大又は縮小のための処理ブロックとして単一の変倍ブロック52が設けられている構成においても得ることができる。また、本実施の形態においては、第1DMA4及び第2DMA6が1画素ずつのベルト走査を行うものとしたが、2画素以上でベルト走査を行うものとしてもよい。また、ベイヤ補間ブロック5とスイッチ7(拡大ブロック8)に2つの第1DMA4及び第2DMA6を用いて画像データを別々に転送するようにしたが、それらを1つにまとめてもよい。また、拡大ブロック8の前段にベイヤ補間ブロック5のみが存在するものを示したが、拡大ブロック8の前段には複数の処理ブロックが直列に設けられていてもよいし、並列に設けられるとともに切り替えスイッチ等により選択的に接続される構成であってもよい。   Such an effect can also be obtained in a configuration in which a single scaling block 52 is provided as a processing block for enlarging or reducing an image, such as the image processing apparatus 51 shown in FIG. it can. In the present embodiment, the first DMA 4 and the second DMA 6 perform belt scanning for each pixel. However, the belt scanning may be performed with two or more pixels. Further, although the image data is transferred separately to the Bayer interpolation block 5 and the switch 7 (enlarged block 8) using the two first DMAs 4 and the second DMA 6, they may be combined into one. In addition, although only the Bayer interpolation block 5 exists in the preceding stage of the enlarged block 8, a plurality of processing blocks may be provided in series in the preceding stage of the enlarged block 8, or may be provided in parallel and switched. It may be configured to be selectively connected by a switch or the like.

そして、本実施の形態においては、前述しように拡大ブロック8と第2縮小ブロック10の双方における連続した拡大処理と縮小処理とを経ることによって、元画像に対する要求された倍率での縮小及び/又は拡大を行う構成である。そのため、仮に要求された倍率が、第2縮小ブロック10において画像劣化を生じさせるような縮小率であった場合においては、拡大ブロック8と第2縮小ブロック10とに割り当てる倍率を、そのような縮小率を第2縮小ブロック10に設定しないように調整することにより、画像劣化が生じない縮小処理を行わせることができる。よって、常に高画質の縮小画像を得ることができる。しかも、拡大ブロック8における拡大処理と第2縮小ブロック10における縮小処理とを、各々の処理に適したアルゴリズムで行うため、より高品質の拡大画像や縮小画像を得ることができる。なお、拡大ブロック8において使用する補間係数をLanczosとしたが、それ以外の補間係数を用いることもできる。   In the present embodiment, as described above, the original image is reduced and / or reduced at the required magnification by performing the continuous enlargement process and the reduction process in both the enlargement block 8 and the second reduction block 10. It is the structure which expands. Therefore, if the requested magnification is a reduction ratio that causes image degradation in the second reduction block 10, the magnification assigned to the enlargement block 8 and the second reduction block 10 is set to such reduction. By adjusting the rate so as not to set the second reduced block 10, it is possible to perform a reduction process that does not cause image degradation. Therefore, a high-quality reduced image can always be obtained. In addition, since the enlargement process in the enlargement block 8 and the reduction process in the second reduction block 10 are performed using algorithms suitable for each process, a higher-quality enlarged image or reduced image can be obtained. Although the interpolation coefficient used in the enlarged block 8 is Lanczos, other interpolation coefficients can be used.

しかも、本実施の形態においては、拡大ブロック8に第1縮小ブロック9と第2縮小ブロック10を並列に接続したことから、同一の元画像から異なるサイズの画像を同時に、つまり短時間に効率良く生成することができる。その結果、前述したように静止画撮影時には、2回のデータ変換によって主画像と、それに付随するサムネイル画像と、プレビュー画像とを生成することができ、それに伴いデジタルカメラにおける撮影間隔を短縮することができる。なお、本実施の形態では、1回目のデータ変換によって主画像とプレビュー画像とを生成するものとしたが、目的の異なるそれ以外の画像を生成するようにしてもよい。例えばサムネイル画像に代えて符号量計測用の画像を生成させ、それをJPEG符号化器13で符号化させるようにしてもよく、その場合、主画像を2回目のデータ変換によって生成するようにしてもよい。さらに、図示しないが第1縮小ブロック9と第2縮小ブロック10に加え、他の縮小ブロックをそれらと並列に設けても構わない。その場合には、前述した2回のデータ変換での処理を1回のデータ変換で済ませることができる。   Moreover, in the present embodiment, since the first reduced block 9 and the second reduced block 10 are connected in parallel to the enlarged block 8, images of different sizes from the same original image can be efficiently processed in a short time. Can be generated. As a result, at the time of still image shooting, as described above, the main image, the accompanying thumbnail image, and the preview image can be generated by two data conversions, and accordingly, the shooting interval in the digital camera can be shortened. Can do. In the present embodiment, the main image and the preview image are generated by the first data conversion. However, other images having different purposes may be generated. For example, an image for code amount measurement may be generated instead of a thumbnail image and encoded by the JPEG encoder 13, and in this case, the main image is generated by the second data conversion. Also good. Furthermore, although not shown, in addition to the first reduced block 9 and the second reduced block 10, other reduced blocks may be provided in parallel therewith. In such a case, the above-described two data conversion processes can be completed with one data conversion.

また、本実施の形態では、拡大又は縮小後の画像データがYUVデータであるものを示したが、拡大又は縮小後の画像データはRGBの画像データであってもよい。また、拡大又は縮小後の画像データをJPEG符号化するものを示したが、それをMPEG等の他の方式により圧縮符号化する構成としてもよく、また、JPEG符号化器13が、入力ライン数が規制されている他の処理ブロックであっても構わない。   In the present embodiment, the enlarged or reduced image data is YUV data, but the enlarged or reduced image data may be RGB image data. Further, although the image data after enlargement or reduction is JPEG encoded, it may be compressed and encoded by another method such as MPEG, and the JPEG encoder 13 may have the number of input lines. It may be another processing block in which is restricted.

さらに、本実施の形態においては、デジタルカメラに組み込まれている画像処理装置1について説明したが、本発明は他の映像機器や画像認識装置等に組み込まれているものや、単独で使用されるものにも適用することができる。   Furthermore, in the present embodiment, the image processing apparatus 1 incorporated in a digital camera has been described. However, the present invention is incorporated in other video equipment, an image recognition apparatus, or the like, or used alone. It can also be applied to things.

本発明に係る画像処理装置の概略構成を示す回路図である。1 is a circuit diagram showing a schematic configuration of an image processing apparatus according to the present invention. 画像処理単位となるベルトを示す模式図である。It is a schematic diagram which shows the belt used as an image processing unit. メモリから読み出したデータの転送方法を示す図である。It is a figure which shows the transfer method of the data read from memory. (a)はベイヤデータの例を示す図、(b)はベイヤデータからYUVデータを生成するときの概念図である。(A) is a figure which shows the example of Bayer data, (b) is a conceptual diagram when producing | generating YUV data from Bayer data. 拡大処理における元画像の画素と補間点との対応関係の具体例を示す図である。It is a figure which shows the specific example of the correspondence of the pixel of an original image in an expansion process, and an interpolation point. 縮小処理における入力側ベルトと出力側ベルトとのライン数の具体例を示す図である。It is a figure which shows the specific example of the number of lines of the input side belt and output side belt in a reduction process. JPEG符号化形式が4:2:0のときのJPEG符号化器における入出力データを示す模式図である。It is a schematic diagram which shows the input / output data in a JPEG encoder when a JPEG encoding format is 4: 2: 0. 制御部によるデータ転送に関する処理内容を示すフローチャートである。It is a flowchart which shows the processing content regarding the data transfer by a control part. 元画像に対して各ベルトの入力範囲を設定するときの具体例を示す説明図である。It is explanatory drawing which shows the specific example when setting the input range of each belt with respect to an original image. 図9の各ベルトにおける拡大画像の座標位置と元画像の座標位置との関係を示した図である。It is the figure which showed the relationship between the coordinate position of the enlarged image in each belt of FIG. 9, and the coordinate position of an original image. 画像処理装置の各部における各ベルトのデータ内容の変化を示した遷移図である。It is the transition figure which showed the change of the data content of each belt in each part of the image processing device. 制御部による倍率設定に関する処理内容を示すフローチャートである。It is a flowchart which shows the processing content regarding the magnification setting by a control part. 制御部によるプレビュー用縮小設定処理を示すフローチャートである。It is a flowchart which shows the reduction setting process for a preview by a control part. 倍率設定処理で設定される倍率とデータ転送に伴い生成される画像データの具体例を示す図である。It is a figure which shows the specific example of the image data produced | generated with the magnification set by a magnification setting process and data transfer. 制御部による静止画符号化処理を示すフローチャートである。It is a flowchart which shows the still image encoding process by a control part. 他の画像処理装置の概略構成を示す回路図である。It is a circuit diagram which shows schematic structure of another image processing apparatus.

符号の説明Explanation of symbols

1 画像処理装置
2 制御部
3 メモリ
4 第1DMA
5 ベイヤ補間ブロック
6 第2DMA
7 スイッチ
8 拡大ブロック
9 第1縮小ブロック
10 第2縮小ブロック
11 第3DMA
12 JPEG入力I/F
13 JPEG符号化器
14 第4DMA
A 全画像
B 画像データ(ベルト)
DESCRIPTION OF SYMBOLS 1 Image processing apparatus 2 Control part 3 Memory 4 1st DMA
5 Bayer interpolation block 6 2nd DMA
7 Switch 8 Enlarged block 9 First reduced block 10 Second reduced block 11 Third DMA
12 JPEG input I / F
13 JPEG encoder 14 4th DMA
A All images B Image data (belt)

Claims (8)

転送された元画像の画像データを拡大処理する拡大処理部と、
この拡大処理部の後段に直列で接続されるとともに、拡大処理部による拡大処理後の画像データを縮小処理する縮小処理部と、
要求された倍率に応じた組み合わせの倍率を前記拡大処理部と前記縮小処理部とに設定する倍率設定手段と
を備えたことを特徴とする画像処理装置。
An enlargement processing unit for enlarging the image data of the transferred original image;
A reduction processing unit that is connected in series to the subsequent stage of the enlargement processing unit, and that reduces the image data after the enlargement processing by the enlargement processing unit,
An image processing apparatus comprising: a magnification setting unit configured to set a combination magnification according to a requested magnification in the enlargement processing unit and the reduction processing unit.
前記縮小処理部は、前記拡大処理とは異なる画像処理アルゴリズムに基づいて、拡大処理部による拡大処理後の画像データを縮小処理することを特徴とする請求項1記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the reduction processing unit reduces the image data after the enlargement processing by the enlargement processing unit based on an image processing algorithm different from the enlargement processing. 前記縮小処理部が、前記拡大処理部の後段に複数並列接続され、前記倍率設定手段は、複数の縮小処理部に互いに異なる縮小率をそれぞれ設定することを特徴とする請求項1又は2記載の画像処理装置。   3. The reduction processing unit according to claim 1, wherein a plurality of the reduction processing units are connected in parallel at a subsequent stage of the enlargement processing unit, and the magnification setting unit sets different reduction ratios to the plurality of reduction processing units, respectively. Image processing device. 前記縮小処理部は、画像データを圧縮符号化する圧縮手段に対して縮小処理後の画像データを出力することを特徴とする請求項1又は2記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the reduction processing unit outputs the image data after the reduction process to a compression unit that compresses and encodes the image data. 前記拡大処理部に前記元画像の画像データを複数ラインからなる処理単位に分けて転送する転送手段と、
前記縮小処理部における画像データの出力ライン数を設定するライン数設定手段と、
前記転送手段によって拡大処理部に転送される画像データの転送ライン数を、前記要求された倍率に基づき個々の処理単位毎に制御するライン数制御手段と
を備えたことを特徴とする画像処理装置。
Transfer means for transferring the image data of the original image to the enlargement processing unit in units of processing consisting of a plurality of lines;
Line number setting means for setting the number of output lines of image data in the reduction processing unit;
An image processing apparatus comprising: a line number control unit configured to control the number of transfer lines of image data transferred to the enlargement processing unit by the transfer unit for each processing unit based on the requested magnification. .
前記ライン数制御手段は、前記要求された縮小率と、前記画像データによる画像における、前記転送手段が画像データを転送すべき前記要求された縮小率に応じた元画像領域の上端位置と、前記要求された縮小率による縮小後の大きさの画像における、前記出力ライン数に応じた処理単位毎の上端及び下端の座標位置とに基づき、前記転送手段によって拡大処理部に転送される画像データの転送ライン数を制御することを特徴とする請求項5記載の画像処理装置。   The line number control means includes the requested reduction ratio, an upper end position of an original image area corresponding to the requested reduction ratio to which the transfer means should transfer image data in an image based on the image data, Based on the coordinate positions of the upper end and the lower end of each processing unit corresponding to the number of output lines in the image having a reduced size with the requested reduction rate, the image data transferred to the enlargement processing unit by the transfer unit 6. The image processing apparatus according to claim 5, wherein the number of transfer lines is controlled. 画像データを要求された倍率で変倍処理する画像処理方法において、
前記要求された倍率に応じた拡大率と縮小率との組み合わせを設定する工程と、
設定した前記拡大率で前記画像データを拡大処理する工程と、
拡大処理後の画像データを、設定した前記縮小率で縮小処理する工程と
を含むことを特徴とする画像処理方法。
In the image processing method for scaling the image data at the requested magnification,
Setting a combination of an enlargement ratio and a reduction ratio according to the requested magnification;
A process of enlarging the image data at the set enlargement rate;
And a step of reducing the image data after the enlargement processing at the set reduction rate.
転送された元画像の画像データを拡大処理する拡大処理部と、この拡大処理部の後段に直列で接続されるとともに、拡大処理部による拡大処理後の画像データをその拡大処理とは異なる画像処理アルゴリズムに基づき縮小処理する縮小処理部とを備えた画像処理装置が有するコンピュータを、要求された倍率に応じた組み合わせの倍率を前記拡大処理部と前記縮小処理部とに設定する倍率設定手段として機能させるためのプログラム。
An enlargement processing unit for enlarging the transferred image data of the original image, and an image processing that is connected in series to the subsequent stage of the enlargement processing unit, and the image data after the enlargement processing by the enlargement processing unit is different from the enlargement processing A computer having an image processing apparatus including a reduction processing unit that performs reduction processing based on an algorithm functions as a magnification setting unit that sets a combination of magnifications according to a requested magnification in the enlargement processing unit and the reduction processing unit Program to let you.
JP2004321422A 2004-11-05 2004-11-05 Image processing apparatus and image processing method Active JP4887614B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004321422A JP4887614B2 (en) 2004-11-05 2004-11-05 Image processing apparatus and image processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004321422A JP4887614B2 (en) 2004-11-05 2004-11-05 Image processing apparatus and image processing method

Publications (2)

Publication Number Publication Date
JP2006135566A true JP2006135566A (en) 2006-05-25
JP4887614B2 JP4887614B2 (en) 2012-02-29

Family

ID=36728720

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004321422A Active JP4887614B2 (en) 2004-11-05 2004-11-05 Image processing apparatus and image processing method

Country Status (1)

Country Link
JP (1) JP4887614B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008131472A (en) * 2006-11-22 2008-06-05 Casio Comput Co Ltd Transfer apparatus, transfer control program, and imaging apparatus
JP2010045764A (en) * 2008-06-18 2010-02-25 Ricoh Co Ltd Control unit and method of controlling the same
JP2010185902A (en) * 2009-02-10 2010-08-26 Ricoh Co Ltd Imaging apparatus

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002077698A (en) * 2000-06-15 2002-03-15 Canon Inc Image pickup device, apparatus and method of image processing thereof, and recording medium
JP2003018610A (en) * 2001-07-03 2003-01-17 Casio Comput Co Ltd Digital camera and image processing method
JP2004140613A (en) * 2002-10-17 2004-05-13 Matsushita Electric Ind Co Ltd Image processor, image processing method, and communication terminal
JP2004297314A (en) * 2003-03-26 2004-10-21 Victor Co Of Japan Ltd Pixel density converter
JP2005006052A (en) * 2003-06-12 2005-01-06 Fuji Xerox Co Ltd Image processor and image processing method
JP2006135565A (en) * 2004-11-05 2006-05-25 Casio Comput Co Ltd Image processing apparatus and image processing method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002077698A (en) * 2000-06-15 2002-03-15 Canon Inc Image pickup device, apparatus and method of image processing thereof, and recording medium
JP2003018610A (en) * 2001-07-03 2003-01-17 Casio Comput Co Ltd Digital camera and image processing method
JP2004140613A (en) * 2002-10-17 2004-05-13 Matsushita Electric Ind Co Ltd Image processor, image processing method, and communication terminal
JP2004297314A (en) * 2003-03-26 2004-10-21 Victor Co Of Japan Ltd Pixel density converter
JP2005006052A (en) * 2003-06-12 2005-01-06 Fuji Xerox Co Ltd Image processor and image processing method
JP2006135565A (en) * 2004-11-05 2006-05-25 Casio Comput Co Ltd Image processing apparatus and image processing method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008131472A (en) * 2006-11-22 2008-06-05 Casio Comput Co Ltd Transfer apparatus, transfer control program, and imaging apparatus
JP2010045764A (en) * 2008-06-18 2010-02-25 Ricoh Co Ltd Control unit and method of controlling the same
JP2010185902A (en) * 2009-02-10 2010-08-26 Ricoh Co Ltd Imaging apparatus

Also Published As

Publication number Publication date
JP4887614B2 (en) 2012-02-29

Similar Documents

Publication Publication Date Title
KR100827052B1 (en) Image processing apparatus and image processing method
US6389180B1 (en) Resolution conversion system and method
US7433544B2 (en) Apparatus and method for producing thumbnail images and for improving image quality of re-sized images
WO2004068852A1 (en) Imaging system
JP4593820B2 (en) Imaging apparatus, image processing apparatus, and image processing method
KR20090050080A (en) Image processing device, image processing method, and program
JP2007109204A (en) Image processor and image processing method
JP4296032B2 (en) Image processing device
JP4887614B2 (en) Image processing apparatus and image processing method
US20050140990A1 (en) Image processing apparatus and method and image data display method for digital camera
JP2004354593A5 (en)
JP6524644B2 (en) Image processing apparatus and electronic device
JP3278936B2 (en) Zoom ratio calculation method
JP2006139697A (en) Image processor and image processing method
JP4424097B2 (en) Electronic zoom device
JP2000322566A (en) Image display device and its controlling method
JP2007219248A (en) Image display circuit and image display processing method
JP2006067513A (en) Image magnification/reduction converting apparatus and digital video system
JP2007213251A (en) Image correction processing device and image correction processing method
JP2009278655A (en) Image processing apparatus, image processing method, and digital camera
JP2003018399A (en) Device and method for magnifying/reducing image
WO2012011211A1 (en) Thumbnail image generation device, magnified image generation device, thumbnail image generation method, and magnified image generation method
JP2005182412A (en) Image processor and its method
JP2005303957A (en) Image processing apparatus
JPH0348584A (en) Electronic zooming device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20071005

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100106

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100119

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100317

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110118

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20111128

R150 Certificate of patent or registration of utility model

Ref document number: 4887614

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20141222

Year of fee payment: 3