JP5836109B2 - Image processing apparatus, imaging apparatus including the same, image processing method, and image processing program - Google Patents

Image processing apparatus, imaging apparatus including the same, image processing method, and image processing program Download PDF

Info

Publication number
JP5836109B2
JP5836109B2 JP2011284171A JP2011284171A JP5836109B2 JP 5836109 B2 JP5836109 B2 JP 5836109B2 JP 2011284171 A JP2011284171 A JP 2011284171A JP 2011284171 A JP2011284171 A JP 2011284171A JP 5836109 B2 JP5836109 B2 JP 5836109B2
Authority
JP
Japan
Prior art keywords
image data
image
boundary
data
image processing
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.)
Active
Application number
JP2011284171A
Other languages
Japanese (ja)
Other versions
JP2013135322A (en
Inventor
学 市川
学 市川
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.)
Olympus Corp
Original Assignee
Olympus Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Olympus Corp filed Critical Olympus Corp
Priority to JP2011284171A priority Critical patent/JP5836109B2/en
Publication of JP2013135322A publication Critical patent/JP2013135322A/en
Application granted granted Critical
Publication of JP5836109B2 publication Critical patent/JP5836109B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Editing Of Facsimile Originals (AREA)
  • Studio Devices (AREA)

Description

本発明は、複数の画像をタイル状に配列した画像を生成することが可能な画像処理装置、それを備えた撮像装置、画像処理方法、及び画像処理プログラムに関する。   The present invention relates to an image processing apparatus capable of generating an image in which a plurality of images are arranged in a tile shape, an imaging apparatus including the image processing apparatus, an image processing method, and an image processing program.

デジタルカメラは、撮影された画像を記録媒体に記録することができる。複数の記録された画像を縮小してインデックス画像として同時に表示させることで、記録されている画像を容易に確認する手段を提供する手法が知られている(例えば特許文献1参照)。このインデックス画像は、表示するだけではなく画像ファイルとして保存することも可能である。また、複数の画像を組み合わせることで、ある一枚の画像を生成するモザイク画像を生成する技術も公開されている(例えば特許文献2参照)。   The digital camera can record a captured image on a recording medium. A technique is known that provides means for easily confirming recorded images by reducing a plurality of recorded images and displaying them simultaneously as index images (see, for example, Patent Document 1). This index image can be stored as an image file as well as displayed. Also, a technique for generating a mosaic image that generates a single image by combining a plurality of images has been disclosed (for example, see Patent Document 2).

一方、デジタルカメラの中には、撮影された画像に対して従来とは異なる特殊効果画像処理を行うことで、従来にはない独特な印象を与える写真を撮影できるものがある。この特殊効果画像処理の中には、撮影された画像を分割して貼り合わせることで、そのシーンを複数の撮影により得られた複数の画像を組み合わせたかのような画像に変換する、ランダムタイルと呼ばれる処理がある。   On the other hand, some digital cameras can take a photograph that gives a unique impression that has not existed before by performing special effect image processing different from the conventional one on the photographed image. This special effect image processing is called random tiles, where the captured images are divided and pasted to convert the scene into an image that looks like a combination of multiple images obtained by multiple shootings. There is processing.

また、デジタルカメラで静止画や動画を記録する際、画像データのサイズをより小さくするために圧縮を行うのが一般的である。このとき、人間の視覚特性を利用して、輝度成分に比べ色差成分をより高圧縮にする手法が一般に用いられている。例えば、静止画の圧縮方式として一般的なJPEG方式では、輝度成分については全画素のデータを用い、色差成分については水平方向の1画素毎のデータを用いる、所謂YC422形式でサンプリングしたデータを用いて圧縮している。また、H.264形式等で圧縮される動画の場合、色差成分をさらに垂直方向に半分に減らした、YC420形式でサンプリングしてから圧縮している。これにより、自然な画質を維持しながら高圧縮を実現している。   Further, when recording a still image or a moving image with a digital camera, compression is generally performed in order to reduce the size of the image data. At this time, a method of making the color difference component more highly compressed than the luminance component by using human visual characteristics is generally used. For example, in a general JPEG method as a still image compression method, data of all pixels is used for the luminance component, and data sampled in a so-called YC422 format using data for each pixel in the horizontal direction for the color difference component. Compressed. H. In the case of a moving image compressed in the H.264 format or the like, compression is performed after sampling in the YC420 format in which the color difference component is further reduced by half in the vertical direction. This achieves high compression while maintaining natural image quality.

特開平5−2612号公報JP-A-5-2612 特開2000−298722号公報JP 2000-298722 A

インデックス画像、モザイク画像、及びランダムタイルで生成されたランダムタイル画像に共通する点として、背景画像(例えば黒一面等)に対して小さな画像を貼り合わせた、タイル状の画像である点が挙げられる。   A common point between index images, mosaic images, and random tile images generated with random tiles is that they are tile-shaped images that are made by pasting a small image onto a background image (for example, a black surface). .

このとき、このタイル状画像をYC422形式やYC420形式でダウンサンプリングしたデータを、再生のために、各画素が輝度成分と色差成分とを有するYC444形式にアップサンプリングするとき、色差成分がない画素のデータについては、隣接画素の色差成分を用いて補間する。この過程で、もとの画像に存在しなかった色が生じることがある。自然画であれば隣接画素間の相関が高いため、アップサンプリングしても元の画像に非常に近い結果が得られる。しかしながら、タイル状画像では貼り付けた画像と背景画像の相関が非常に低い場合が想定される。その場合、元の画像に存在しない色が見えてしまい、特に拡大表示や印刷を行った場合に違和感のある画像になってしまう。   At this time, when the data obtained by down-sampling the tiled image in the YC422 format or the YC420 format is upsampled to the YC444 format in which each pixel has a luminance component and a color difference component for reproduction, the pixel having no color difference component is reproduced. Data is interpolated using the color difference components of adjacent pixels. In this process, colors that did not exist in the original image may occur. Since a natural image has a high correlation between adjacent pixels, a result very close to the original image can be obtained even by upsampling. However, in the tiled image, a case where the correlation between the pasted image and the background image is very low is assumed. In that case, a color that does not exist in the original image can be seen, and the image becomes uncomfortable especially when enlarged display or printing is performed.

本発明は、前記の事情に鑑みてなされたものであり、特にタイル状画像を生成する際に再生をしても違和感が生じにくい画像を生成することが可能な画像処理装置、それを備えた撮像装置、画像処理方法、及び画像処理プログラムを提供することを目的とする。   The present invention has been made in view of the above circumstances, and in particular, includes an image processing apparatus capable of generating an image that does not cause a sense of incongruity even when played back when generating a tiled image. An object is to provide an imaging apparatus, an image processing method, and an image processing program.

前記の目的を達成するために、本発明の第1の態様の画像処理装置は、背景画像データに対して、水平方向又は垂直方向の一方向に直線状の境界を有する部分画像データを貼り付けて合成画像データを生成する画像合成部と、前記合成画像データを生成する際の、前記部分画像データの境界の前記背景画像データにおける位置を決定する境界位置決定部と、前記合成画像データに対し、前記合成画像データの輝度成分のデータ数よりも前記合成画像データの色差成分のデータ数を少なくするサンプリング処理を施す画像サンプリング部と、を具備し、前記境界位置決定部は、前記画像サンプリング部によるサンプリング処理の方式に応じて、前記部分画像データを拡大又は縮小することにより前記境界の位置を補正することを特徴とする。 In order to achieve the above object, the image processing apparatus according to the first aspect of the present invention pastes partial image data having a linear boundary in one horizontal or vertical direction to background image data. An image composition unit that generates composite image data, a boundary position determination unit that determines a position of the boundary of the partial image data in the background image data when the composite image data is generated, and the composite image data An image sampling unit that performs a sampling process for reducing the number of data of the color difference component of the composite image data than the number of luminance component data of the composite image data, and the boundary position determining unit includes the image sampling unit The boundary position is corrected by enlarging or reducing the partial image data according to the sampling processing method according to the above .

また、前記の目的を達成するために、本発明の第2の態様の撮像装置は、第1の態様の画像処理装置を備えることを特徴とする。   In order to achieve the above object, an imaging apparatus according to a second aspect of the present invention includes the image processing apparatus according to the first aspect.

また、前記の目的を達成するために、本発明の第3の態様の画像処理方法は、画像合成部が、背景画像データに対して、水平方向又は垂直方向の一方向に直線状の境界を有する部分画像データを貼り付けて合成画像データを生成し、境界位置決定部が、前記合成画像データを生成する際の、前記部分画像データの境界の前記背景画像データにおける位置を決定し、前記境界位置決定部が、画像サンプリング部によるサンプリング処理の方式に応じて、前記部分画像データを拡大又は縮小することにより前記境界の位置を補正し、前記画像サンプリング部が、前記合成画像データに対し、前記合成画像データの輝度成分のデータ数よりも前記合成画像データの色差成分のデータ数を少なくするサンプリング処理を施す、ことを特徴とする。 In order to achieve the above object, in the image processing method according to the third aspect of the present invention, the image composition unit sets a linear boundary in one horizontal or vertical direction with respect to the background image data. The partial image data is pasted to generate composite image data, and the boundary position determination unit determines the position of the boundary of the partial image data in the background image data when generating the composite image data, and the boundary The position determination unit corrects the position of the boundary by enlarging or reducing the partial image data according to the sampling processing method by the image sampling unit, and the image sampling unit A sampling process is performed to reduce the number of color difference components of the composite image data than the number of luminance components of the composite image data.

また、前記の目的を達成するために、本発明の第4の態様の画像処理プログラムは、画像合成部に、背景画像データに対して、水平方向又は垂直方向の一方向に直線状の境界を有する部分画像データを貼り付けて合成画像データを生成させる手順と、境界位置決定部に、前記合成画像データを生成する際の、前記部分画像データの境界の前記背景画像データにおける位置を決定させる手順と、前記境界位置決定部に、画像サンプリング部によるサンプリング処理の方式に応じて、前記部分画像データを拡大又は縮小することにより前記境界の位置を補正させる手順と、前記画像サンプリング部に、前記合成画像データに対し、前記合成画像データの輝度成分のデータ数よりも前記合成画像データの色差成分のデータ数を少なくするサンプリング処理を施させる手順と、をコンピュータに実行させる。 In order to achieve the above object, the image processing program according to the fourth aspect of the present invention provides the image composition unit with a linear boundary in one horizontal or vertical direction with respect to the background image data. A procedure of pasting the partial image data to generate composite image data, and a step of causing the boundary position determination unit to determine the position of the boundary of the partial image data in the background image data when generating the composite image data And a step of causing the boundary position determination unit to correct the position of the boundary by enlarging or reducing the partial image data according to a sampling processing method by the image sampling unit, and A sample that reduces the number of color difference components of the composite image data relative to the number of luminance components of the composite image data. To perform the procedure for subjected to processing, to the computer.

本発明によれば、特にタイル状画像を生成する際に再生をしても違和感が生じにくい画像を生成することが可能な画像処理装置、それを備えた撮像装置、画像処理方法、及び画像処理プログラムを提供することができる。   According to the present invention, in particular, an image processing device capable of generating an image that is unlikely to cause discomfort even when played back when generating a tiled image, an imaging device including the same, an image processing method, and image processing A program can be provided.

本発明の一実施形態に係る画像処理装置を備えた撮像装置の一例としてのデジタルカメラの構成を示すブロック図である。1 is a block diagram illustrating a configuration of a digital camera as an example of an imaging apparatus including an image processing apparatus according to an embodiment of the present invention. デジタルカメラのメイン動作を示すフローチャートである。It is a flowchart which shows the main operation | movement of a digital camera. インデックス画像生成処理の詳細を示したフローチャートである。It is the flowchart which showed the detail of the index image generation process. インデックス画像生成処理における配置パターンの例を示す図である。It is a figure which shows the example of the arrangement | positioning pattern in an index image generation process. 画像処理の詳細について示したフローチャートである。5 is a flowchart illustrating details of image processing. モザイク処理の詳細を示すフローチャートである。It is a flowchart which shows the detail of a mosaic process. モザイク処理におけるコマの分割の例を示す図である。It is a figure which shows the example of a division | segmentation in a mosaic process. ランダムタイル処理の詳細を示すフローチャートである。It is a flowchart which shows the detail of a random tile process. ランダムタイル処理におけるコマの分割の例を示す図である。It is a figure which shows the example of the division | segmentation of the flame | frame in a random tile process. ランダムタイル画像の生成例を示す図である。It is a figure which shows the example of a production | generation of a random tile image. 画像貼り付け処理について示すフローチャートである。It is a flowchart shown about an image paste process. 画像貼り付け処理の際の貼り付け位置の座標の補正の具体例について示すフローチャートである。It is a flowchart shown about the specific example of correction | amendment of the coordinate of the paste position in the case of an image paste process. YCデータのダウンサンプリングについて説明するための図である。It is a figure for demonstrating the downsampling of YC data. 部分画像データの貼り付け位置の座標の補正をしない場合の画像再生について示す図である。It is a figure shown about image reproduction | regeneration when not correcting the coordinate of the paste position of partial image data. 部分画像データの貼り付け位置の座標の補正をする場合の画像再生について示す図である。It is a figure shown about image reproduction in the case of amending the coordinates of the pasting position of partial image data.

以下、図面を参照して本発明の実施形態を説明する。
図1は、本発明の一実施形態に係る画像処理装置を備えた撮像装置の一例としてのデジタルカメラの構成を示すブロック図である。図1に示すデジタルカメラ1は、レンズ交換式のデジタルカメラである。しかしながら、必ずしもレンズ交換式のデジタルカメラである必要はなく、レンズ一体式のデジタルカメラであっても良い。
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
FIG. 1 is a block diagram illustrating a configuration of a digital camera as an example of an imaging apparatus including an image processing apparatus according to an embodiment of the present invention. A digital camera 1 shown in FIG. 1 is an interchangeable lens digital camera. However, it is not always necessary to be an interchangeable lens digital camera, and a lens-integrated digital camera may be used.

図1に示すデジタルカメラ1は、交換式レンズ100と、カメラ本体200と、を有している。交換式レンズ100は、カメラ本体200に対して着脱自在に構成されている。カメラ本体200に交換式レンズ100が装着された場合に、交換式レンズ100は、カメラ本体200と通信自在に接続される。これにより、交換式レンズ100は、カメラ本体200の制御に従って動作可能な状態となる。   A digital camera 1 shown in FIG. 1 has an interchangeable lens 100 and a camera body 200. The interchangeable lens 100 is configured to be detachable from the camera body 200. When the interchangeable lens 100 is attached to the camera body 200, the interchangeable lens 100 is connected to the camera body 200 so as to be able to communicate. As a result, the interchangeable lens 100 becomes operable according to the control of the camera body 200.

交換式レンズ100は、レンズ102と、絞り104と、ドライバ106と、マイクロコンピュータ108と、Flashメモリ110と、を有している。
レンズ102は、図示しない被写体からの光束をカメラ本体200内の撮像素子204に集光するための光学系である。このレンズ102は、フォーカスレンズ及びズームレンズ等の複数のレンズを有していても良い。
The interchangeable lens 100 includes a lens 102, a diaphragm 104, a driver 106, a microcomputer 108, and a flash memory 110.
The lens 102 is an optical system for condensing a light beam from a subject (not shown) on the image sensor 204 in the camera body 200. The lens 102 may include a plurality of lenses such as a focus lens and a zoom lens.

絞り104は、開閉自在に構成され、レンズ102を介して入射した光束の量を調整する。ドライバ106は、モータ等を有している。このドライバ106は、マイクロコンピュータ108の制御に従って、レンズ102内のフォーカスレンズやズームレンズをその光軸方向に駆動させたり、絞り104を開閉駆動させたりする。   The diaphragm 104 is configured to be openable and closable, and adjusts the amount of light incident through the lens 102. The driver 106 has a motor and the like. The driver 106 drives the focus lens and zoom lens in the lens 102 in the optical axis direction and drives the aperture 104 to open and close according to the control of the microcomputer 108.

マイクロコンピュータ108は、交換式レンズ100がカメラ本体200に装着された際にインターフェイス(I/F)112を介してカメラ本体200内のマイクロコンピュータ230と通信自在に接続される。このマイクロコンピュータ108は、マイクロコンピュータ230からの制御に従ってドライバ106を駆動させる。また、マイクロコンピュータ108は、Flashメモリ110に記憶されている交換式レンズ100のレンズ情報等を、I/F112を介してマイクロコンピュータ230に通信する。
Flashメモリ110は、レンズ102の収差情報等のレンズ情報や交換式レンズ100の動作を実行するために必要なプログラム等を記憶している。
The microcomputer 108 is communicably connected to the microcomputer 230 in the camera body 200 via the interface (I / F) 112 when the interchangeable lens 100 is attached to the camera body 200. The microcomputer 108 drives the driver 106 in accordance with control from the microcomputer 230. Further, the microcomputer 108 communicates lens information of the interchangeable lens 100 stored in the flash memory 110 to the microcomputer 230 via the I / F 112.
The flash memory 110 stores lens information such as aberration information of the lens 102, a program necessary for executing the operation of the interchangeable lens 100, and the like.

カメラ本体200は、メカシャッタ202と、撮像素子204と、アナログ処理部206と、アナログ/デジタル(A/D)変換部208と、バス210と、SDRAM212と、AE処理部214と、AF処理部216と、画像処理部218と、表示ドライバ220と、表示部222と、画像サンプリング部223と、画像圧縮伸張部224と、メモリインターフェイス(I/F)226と、記録媒体228と、マイクロコンピュータ230と、操作部232と、Flashメモリ234と、を有している。   The camera body 200 includes a mechanical shutter 202, an image sensor 204, an analog processing unit 206, an analog / digital (A / D) conversion unit 208, a bus 210, an SDRAM 212, an AE processing unit 214, and an AF processing unit 216. An image processing unit 218, a display driver 220, a display unit 222, an image sampling unit 223, an image compression / decompression unit 224, a memory interface (I / F) 226, a recording medium 228, a microcomputer 230, , An operation unit 232 and a flash memory 234.

メカシャッタ202は、撮像素子204の光電変換面を遮光状態又は露出状態とするように移動自在に構成されている。このメカシャッタ202を移動させることにより撮像素子204の露光時間が調整される。   The mechanical shutter 202 is configured to be movable so that the photoelectric conversion surface of the image sensor 204 is in a light shielding state or an exposed state. The exposure time of the image sensor 204 is adjusted by moving the mechanical shutter 202.

撮像素子204は、レンズ102を介して集光された被写体からの光束が結像される光電変換面を有している。光電変換面は、複数の画素が2次元状に配置されて構成されている。また、光電変換面の光入射側には、カラーフィルタが設けられている。このような撮像素子204は、光電変換面に結像された光束に対応した像(被写体像)を、その光量に応じた電気信号(以下、画像信号という)に変換して出力する。   The image sensor 204 has a photoelectric conversion surface on which a light beam from a subject condensed through the lens 102 is imaged. The photoelectric conversion surface is configured with a plurality of pixels arranged two-dimensionally. A color filter is provided on the light incident side of the photoelectric conversion surface. Such an image sensor 204 converts an image (subject image) corresponding to the light beam formed on the photoelectric conversion surface into an electrical signal (hereinafter referred to as an image signal) corresponding to the light amount and outputs the electrical signal.

ここで、撮像素子204は、CCD方式やCMOS方式等の種々の構成の撮像素子が知られている。また、カラーフィルタの色配列もベイヤ配列等の種々の配列が知られている。本実施形態は、撮像素子204の構成が特定の構成に限定されるものではなく、種々の構成の撮像素子を用いることが可能である。また、撮像素子204は、露光時間を電子的に制御する電子シャッタ機能を有していても良い。以下の説明においては撮像素子204が電子シャッタ機能を有しているものとする。   Here, as the imaging device 204, imaging devices having various configurations such as a CCD method and a CMOS method are known. Various color filters such as a Bayer array are also known. In the present embodiment, the configuration of the image sensor 204 is not limited to a specific configuration, and image sensors with various configurations can be used. The image sensor 204 may have an electronic shutter function that electronically controls the exposure time. In the following description, it is assumed that the image sensor 204 has an electronic shutter function.

アナログ処理部206は、撮像素子204により得られた画像信号に対してCDS(相関二重サンプリング)処理やAGC(自動利得制御)処理等のアナログ処理を施す。A/D変換部208は、アナログ処理部206においてアナログ処理された画像信号をデジタル信号(以下、画像データという)に変換する。   The analog processing unit 206 performs analog processing such as CDS (correlated double sampling) processing and AGC (automatic gain control) processing on the image signal obtained by the image sensor 204. The A / D converter 208 converts the image signal analog-processed by the analog processor 206 into a digital signal (hereinafter referred to as image data).

バス210は、カメラ本体200の内部で発生した各種のデータを転送するための転送路である。SDRAM212は、カメラ本体200内部で発生した各種のデータを一時的に記憶するための記憶部である。このSDRAM212は、画像処理部218における画像処理の際のバッファメモリとしても使用される。   The bus 210 is a transfer path for transferring various data generated in the camera body 200. The SDRAM 212 is a storage unit for temporarily storing various data generated inside the camera body 200. The SDRAM 212 is also used as a buffer memory at the time of image processing in the image processing unit 218.

AE処理部214は、画像データを用いて被写体輝度を算出する。なお、被写体輝度は、画像データから算出するだけでなく、例えば専用の測光センサで測定するようにしても良い。AF処理部216は、画像データから高周波成分の信号を取り出し、取り出した高周波成分の信号を積算してAF用の合焦評価値を取得する。   The AE processing unit 214 calculates subject brightness using the image data. Note that the subject luminance is not only calculated from the image data, but may be measured by a dedicated photometric sensor, for example. The AF processing unit 216 extracts high-frequency component signals from the image data, integrates the extracted high-frequency component signals, and acquires a focus evaluation value for AF.

画像処理部218は、画像データに対する各種の画像処理を行う。本実施形態における画像処理部218は、基本画像処理部2181と、特殊効果画像処理部2182と、を有している。
基本画像処理部2181は、画像の表示や記録のために必要な基本的な画像処理を画像データに対して施す。この基本的な画像処理とは、例えば、オプティカルブラック減算処理、ホワイトバランス補正処理、カラーマトリクス演算処理、ガンマ変換処理、色補正処理、エッジ強調処理、ノイズ低減処理が含まれる。
オプティカルブラック減算処理は、画像データの暗電流成分(オプティカルブラック)を減算して除去する処理である。ホワイトバランス補正処理は、画像データの色バランスを補正するためのゲインを乗じる処理である。カラーマトリクス演算処理は、画像データに対してホワイトバランス補正の結果に応じたカラーマトリクス演算を行うことによって、画像データを特定の色空間上にマッピングする処理である。ガンマ変換処理は、画像データの階調特性を所定の特性に変換する処理である。色補正処理は、色再現を適切なものとするために、YC形式に変換した画像データのうちのCデータに彩度補正係数、色相補正係数を乗じる処理である。エッジ強調処理は、画像データからバンドパスフィルタ等を用いて抽出したエッジ信号にエッジ強調係数を乗じて画像データのうちのYデータに加算することによって、画像データにおけるエッジ(輪郭)成分を強調する処理である。ノイズ低減処理は、画像データにおけるノイズ成分を除去する処理である。
また、カラーフィルタの色配列によっては、基本画像処理としてさらに同時化処理が必要な場合もある。同時化処理は、ベイヤ配列に対応した画像データ等の、1つの画素が1つの色成分に対応している画像データを、1つの画素が複数の色成分に対応している画像データに変換する処理である。
The image processing unit 218 performs various image processing on the image data. The image processing unit 218 in this embodiment includes a basic image processing unit 2181 and a special effect image processing unit 2182.
A basic image processing unit 2181 performs basic image processing necessary for image display and recording on image data. The basic image processing includes, for example, optical black subtraction processing, white balance correction processing, color matrix calculation processing, gamma conversion processing, color correction processing, edge enhancement processing, and noise reduction processing.
The optical black subtraction process is a process of subtracting and removing the dark current component (optical black) of the image data. The white balance correction process is a process of multiplying a gain for correcting the color balance of the image data. The color matrix calculation process is a process of mapping image data onto a specific color space by performing color matrix calculation corresponding to the result of white balance correction on the image data. The gamma conversion process is a process for converting the gradation characteristics of the image data into predetermined characteristics. The color correction process is a process of multiplying C data of the image data converted into the YC format by a saturation correction coefficient and a hue correction coefficient in order to make color reproduction appropriate. In the edge enhancement processing, an edge (contour) component in image data is enhanced by multiplying an edge signal extracted from the image data by using a bandpass filter or the like and multiplying the edge signal by Y with respect to the image data. It is processing. The noise reduction process is a process for removing noise components in the image data.
Further, depending on the color arrangement of the color filters, further synchronization processing may be required as basic image processing. The synchronization processing converts image data in which one pixel corresponds to one color component, such as image data corresponding to a Bayer array, into image data in which one pixel corresponds to a plurality of color components. It is processing.

特殊効果画像処理部2182は、画像に対して特殊な視覚効果を与えるための特殊効果画像処理を画像データに対して施す。この特殊効果画像処理としては、タイル状画像を生成するための画像合成処理が含まれる。ここで、タイル状画像とは、複数の部分画像を貼り合わせて構成される合成画像のことを言う。このタイル状画像の中には、例えばインデックス画像、モザイク画像、ランダムタイル画像が含まれる。
インデックス画像の生成処理は、記録媒体228に記録されている画像を示す部分画像(インデックス画像)を貼り合わせる処理である。モザイク画像の生成処理は、モザイク画像の生成対象の画像を複数のコマの部分画像データに分割し、分割したあるコマの部分画像データを別のコマの部分画像データに置き換えるように画像を貼り合わせる処理である。ランダムタイルの生成処理は、複数の部分画像データをランダムに貼り合わせる処理である。これらの処理の詳細については後述する。
The special effect image processing unit 2182 applies special effect image processing for giving a special visual effect to the image to the image data. This special effect image processing includes image composition processing for generating a tiled image. Here, the tiled image refers to a composite image configured by pasting a plurality of partial images. This tiled image includes, for example, an index image, a mosaic image, and a random tile image.
The index image generation process is a process of pasting partial images (index images) indicating images recorded on the recording medium 228. In the mosaic image generation process, the mosaic image generation target image is divided into partial image data of a plurality of frames, and the images are pasted so that the partial image data of a certain frame is replaced with the partial image data of another frame. It is processing. The random tile generation process is a process of randomly pasting a plurality of partial image data. Details of these processes will be described later.

また、特殊効果画像処理部2182は、境界位置決定部としての機能も有している。この機能は、部分画像データの貼り付け位置、即ち背景画像データにおける部分画像データの境界位置を決定及び補正する機能である。   The special effect image processing unit 2182 also has a function as a boundary position determination unit. This function is a function for determining and correcting the pasting position of the partial image data, that is, the boundary position of the partial image data in the background image data.

表示ドライバ220は、画像処理部218で得られた画像データ又は画像圧縮伸張部224で伸張された画像データを映像信号に変換して表示部222に出力する。表示部222は、例えば液晶ディスプレイ(LCD)である。この表示部222は、表示ドライバ220から入力された映像信号に基づく画像を表示する。   The display driver 220 converts the image data obtained by the image processing unit 218 or the image data expanded by the image compression / decompression unit 224 into a video signal and outputs the video signal to the display unit 222. The display unit 222 is, for example, a liquid crystal display (LCD). The display unit 222 displays an image based on the video signal input from the display driver 220.

画像サンプリング部223は、画像データのデータ量を削減するために、画像圧縮伸張部224における圧縮処理に先立って、画像データの輝度成分(Yデータ)のデータ数よりも色差成分(Cデータ)のデータ数を少なくするサンプリング処理(ダウンサンプリング)を行う。また、画像サンプリング部223は、画像圧縮伸張部224における伸張処理によって伸張された画像データの輝度成分(Yデータ)のデータ数と色差成分(Cデータ)のデータ数とを同じにする復元処理(アップサンプリング)を行う。画像サンプリング部223の詳細については後述する。   In order to reduce the data amount of the image data, the image sampling unit 223 prior to the compression processing in the image compression / decompression unit 224, the color difference component (C data) rather than the number of luminance components (Y data) of the image data. Perform sampling processing (downsampling) to reduce the number of data. In addition, the image sampling unit 223 performs a restoration process (the restoration process for making the number of luminance components (Y data) and the number of color difference components (C data) of the image data decompressed by the decompression process in the image compression / decompression unit 224 equal ( Upsampling). Details of the image sampling unit 223 will be described later.

画像圧縮伸張部224は、画像の記録時においては、画像処理部218における画像処理によって得られた画像データに対してJPEG形式やTIFF形式等の静止画圧縮処理又はMPEG形式やH.264形式等の動画圧縮処理を施す。また、画像圧縮伸張部224は、画像の再生時においては、圧縮処理が施されたYCデータに対して伸張(デコード)処理を施す。   At the time of image recording, the image compression / decompression unit 224 performs still image compression processing such as JPEG format or TIFF format, MPEG format, H.264, or the like on image data obtained by image processing in the image processing unit 218. H.264 format moving image compression processing is performed. Further, the image compression / decompression unit 224 performs decompression (decoding) processing on the YC data subjected to the compression processing at the time of image reproduction.

メモリI/F226は、マイクロコンピュータ230等が記録媒体228にアクセスするためのインターフェイスである。記録媒体228は、例えばカメラ本体200に着脱自在になされたメモリカードである。この記録媒体228は、画像ファイル等を記録する。画像ファイルは、画像圧縮伸張部224によって圧縮された画像データに、ヘッダ情報が付加されたファイルである。   The memory I / F 226 is an interface for the microcomputer 230 or the like to access the recording medium 228. The recording medium 228 is a memory card that is detachably attached to the camera body 200, for example. The recording medium 228 records image files and the like. The image file is a file in which header information is added to the image data compressed by the image compression / decompression unit 224.

マイクロコンピュータ230は、メカシャッタ202、撮像素子204、表示ドライバ220といったカメラ本体200の各部の動作を統括的に制御する。また、マイクロコンピュータ230は、AE処理部214で演算された被写体輝度を用いてAE処理を行ったり、AF処理部216で演算されたAF評価値を用いてAF処理を行ったりもする。また、マイクロコンピュータ230は、交換式レンズ100の装着時には、交換式レンズ100の動作も制御する。   The microcomputer 230 comprehensively controls the operation of each part of the camera body 200 such as the mechanical shutter 202, the image sensor 204, and the display driver 220. Further, the microcomputer 230 performs AE processing using the subject brightness calculated by the AE processing unit 214 or performs AF processing using the AF evaluation value calculated by the AF processing unit 216. The microcomputer 230 also controls the operation of the interchangeable lens 100 when the interchangeable lens 100 is attached.

操作部232は、ユーザによって操作される各種の操作部材である。本実施形態における操作部232は、レリーズボタンと、動画ボタンと、メニューボタンと、再生ボタンと、インデックスボタンと、電源ボタンと、を有している。ここで、これらのボタンは、一部又は全部をタッチパネルによって操作される仮想的な操作部として構成しても良い。   The operation unit 232 is various operation members operated by the user. The operation unit 232 in the present embodiment includes a release button, a moving image button, a menu button, a playback button, an index button, and a power button. Here, some or all of these buttons may be configured as a virtual operation unit operated by a touch panel.

レリーズボタンは、ファースト(1st)レリーズスイッチとセカンド(2nd)レリーズスイッチの2段スイッチを有している。レリーズボタンが半押しされて、ファーストレリーズスイッチがオンされた場合に、マイクロコンピュータ230は、AE処理やAF処理等の撮影準備処理を実行する。また、レリーズボタンが全押しされて、セカンドレリーズスイッチがオンされた場合に、マイクロコンピュータ230は、静止画記録処理を実行する。   The release button has a two-stage switch including a first (1st) release switch and a second (2nd) release switch. When the release button is pressed halfway and the first release switch is turned on, the microcomputer 230 executes photographing preparation processing such as AE processing and AF processing. Further, when the release button is fully pressed and the second release switch is turned on, the microcomputer 230 executes a still image recording process.

動画ボタンは、マイクロコンピュータ230に対して動画撮影の実行を指示する。動画ボタンが押された場合、マイクロコンピュータ230は、動画記録処理を実行する。また、動画記録処理の実行中に動画ボタンが押された場合、マイクロコンピュータ230は、動画記録処理を終了する。   The moving image button instructs the microcomputer 230 to execute moving image shooting. When the moving image button is pressed, the microcomputer 230 executes a moving image recording process. When the moving image button is pressed during the moving image recording process, the microcomputer 230 ends the moving image recording process.

メニューボタンは、メニュー画面の表示を指示するための操作部である。メニュー画面上において、ユーザは、カメラ本体200の各種の設定を変更することが可能である。本実施形態においては、例えばメニュー画面上において、画像処理モードを設定する。この画像処理モードにより、タイル状画像を生成する処理として、モザイク画像を生成するかランダムタイム画像を生成するかを設定する。   The menu button is an operation unit for instructing display of a menu screen. On the menu screen, the user can change various settings of the camera body 200. In the present embodiment, for example, an image processing mode is set on a menu screen. In this image processing mode, whether to generate a mosaic image or a random time image is set as a process for generating a tiled image.

再生ボタンは、マイクロコンピュータ230に対して静止画ファイル又は動画ファイルの再生を指示するための操作部である。インデックスボタンは、マイクロコンピュータ230に対してインデックス画像の表示を指示するための操作部である。電源ボタンは、カメラ本体200の電源のオン又はオフを指示するための操作部である。   The play button is an operation unit for instructing the microcomputer 230 to play back a still image file or a moving image file. The index button is an operation unit for instructing the microcomputer 230 to display an index image. The power button is an operation unit for instructing to turn on or off the power of the camera body 200.

Flashメモリ234は、例えばホワイトバランス補正用のホワイトバランスゲイン、カラーマトリクス演算用のカラーマトリクス係数、ガンマ変換用のガンマテーブルといった画像処理部218の動作に必要なパラメータ等の、カメラ本体200の動作に必要な各種のパラメータを記憶している。また、Flashメモリ234は、マイクロコンピュータ230が実行する種々のプログラムも記憶している。   The flash memory 234 is used for operations of the camera body 200 such as parameters necessary for the operation of the image processing unit 218 such as a white balance gain for white balance correction, a color matrix coefficient for color matrix calculation, and a gamma table for gamma conversion. Various necessary parameters are stored. The flash memory 234 also stores various programs executed by the microcomputer 230.

以下、図1で示したデジタルカメラの動作について説明する。図2は、図1で示したデジタルカメラのメイン動作を示すフローチャートである。図2の動作は、例えば図1に示すデジタルカメラの電源がオンされた場合に行われる。   The operation of the digital camera shown in FIG. 1 will be described below. FIG. 2 is a flowchart showing the main operation of the digital camera shown in FIG. The operation of FIG. 2 is performed when the power of the digital camera shown in FIG. 1 is turned on, for example.

デジタルカメラの電源オン後において、マイクロコンピュータ230は、初期化処理を行う(ステップS101)。初期化処理において、マイクロコンピュータ230は、自身が有するレジスタに設定されている記録中フラグをOffにする等の処理を行う。記録中フラグは、動画記録中であるか否かを示すフラグである。記録中フラグがOffになっている間は、動画記録中でないことを示す。一方、記録中フラグがOnになっている間は、動画記録中であることを示す。   After powering on the digital camera, the microcomputer 230 performs an initialization process (step S101). In the initialization processing, the microcomputer 230 performs processing such as turning off the recording flag set in the register of the microcomputer 230. The recording flag is a flag indicating whether or not a moving image is being recorded. While the recording flag is Off, it indicates that the moving image is not being recorded. On the other hand, while the recording flag is On, it indicates that moving image recording is in progress.

次に、マイクロコンピュータ230は、ユーザによって操作部232の再生ボタンが押されたか否かを判定する(ステップS102)。ステップS102において、再生ボタンが押されたと判定した場合に、マイクロコンピュータ230は、再生処理を実行する(ステップS103)。
再生処理において、マイクロコンピュータ230は、ユーザによる画像ファイル(静止画像ファイル又は動画像ファイル)の選択を待つ。そして、画像ファイルが選択された場合に、マイクロコンピュータ230は、選択された画像ファイルを画像圧縮伸張部224によりデコードする。そして、マイクロコンピュータ230は、選択された画像ファイルからデコードされた画像データを画像サンプリング部223に入力する。画像サンプリング部223は、画像データをアップサンプリングし、アップサンプリングした画像データを表示ドライバ220に入力する。表示ドライバ220は、入力された画像データを映像信号に変換し、この映像信号に対応した画像を表示部222に表示させる。その後、ユーザによって再生終了の指示がなされた場合、例えば再生ボタンが再び押された場合に、マイクロコンピュータ230は、処理をステップS102に戻す。
Next, the microcomputer 230 determines whether or not the reproduction button of the operation unit 232 has been pressed by the user (step S102). If it is determined in step S102 that the playback button has been pressed, the microcomputer 230 executes playback processing (step S103).
In the reproduction process, the microcomputer 230 waits for the user to select an image file (still image file or moving image file). When the image file is selected, the microcomputer 230 decodes the selected image file by the image compression / decompression unit 224. The microcomputer 230 inputs the image data decoded from the selected image file to the image sampling unit 223. The image sampling unit 223 upsamples the image data and inputs the upsampled image data to the display driver 220. The display driver 220 converts the input image data into a video signal and causes the display unit 222 to display an image corresponding to the video signal. Thereafter, when the user gives an instruction to end reproduction, for example, when the reproduction button is pressed again, the microcomputer 230 returns the process to step S102.

また、ステップS102において再生ボタンが押されていないと判定した場合に、マイクロコンピュータ230は、インデックス画像を生成するか否かを判定する(ステップS104)。例えば、ユーザによって操作部232のインデックスボタンが押された場合に、マイクロコンピュータ230は、インデックス画像を生成すると判定する。   If it is determined in step S102 that the playback button has not been pressed, the microcomputer 230 determines whether to generate an index image (step S104). For example, when the index button of the operation unit 232 is pressed by the user, the microcomputer 230 determines to generate an index image.

ステップS104において、インデックス画像を生成すると判定した場合に、マイクロコンピュータ230は、画像処理部218により、インデックス画像生成処理を行う(ステップS105)。インデックス画像生成処理の詳細については後述する。   If it is determined in step S104 that an index image is to be generated, the microcomputer 230 performs an index image generation process using the image processing unit 218 (step S105). Details of the index image generation processing will be described later.

また、ステップS104においてインデックス画像を生成しないと判定した場合に、マイクロコンピュータ230は、カメラ設定をするか否かを判定する(ステップS106)。例えば、ユーザによって操作部232のメニューボタンが押された場合に、マイクロコンピュータ230は、カメラ設定をすると判定する。   If it is determined in step S104 that no index image is to be generated, the microcomputer 230 determines whether to perform camera settings (step S106). For example, when the menu button of the operation unit 232 is pressed by the user, the microcomputer 230 determines to set the camera.

ステップS106において、カメラ設定をすると判定した場合に、マイクロコンピュータ230は、表示ドライバ220を制御して表示部222にメニュー画面を表示させた後、カメラ設定処理を実行する(ステップS107)。
カメラ設定処理において、マイクロコンピュータ230は、ユーザからのカメラ設定の変更の指示を待つ。そして、何らかのカメラ設定の変更の指示がなされた場合に、マイクロコンピュータ230は、その指示に従ってカメラ設定を変更する。このカメラ設定処理においては、例えば静止画撮影時や動画撮影時の画像の記録モードの設定、画質の設定等が変更される。また、カメラ設定処理において、特殊効果画像処理を実行するか否か、及び特殊効果画像処理を実行する際の特殊効果画像処理モードとしてモザイクモードやランダムタイルモード等の各種のモードを設定することが可能である。ここで、モザイクモードは、モザイク画像を生成する特殊効果画像処理モードである。ランダムタイルモードは、ランダムタイル画像を生成する特殊効果画像処理モードである。なお、特殊効果画像処理モードとして、モザイクモード及びランダムタイルモード以外のモードがあっても良い。
If it is determined in step S106 that camera settings are to be made, the microcomputer 230 controls the display driver 220 to display a menu screen on the display unit 222, and then executes camera setting processing (step S107).
In the camera setting process, the microcomputer 230 waits for a camera setting change instruction from the user. When an instruction to change any camera setting is given, the microcomputer 230 changes the camera setting according to the instruction. In this camera setting process, for example, the setting of the image recording mode and the setting of the image quality at the time of still image shooting or moving image shooting are changed. In the camera setting process, whether or not to execute special effect image processing, and various modes such as a mosaic mode and a random tile mode can be set as a special effect image processing mode when executing the special effect image processing. Is possible. Here, the mosaic mode is a special effect image processing mode for generating a mosaic image. The random tile mode is a special effect image processing mode for generating a random tile image. Note that there may be modes other than the mosaic mode and the random tile mode as the special effect image processing mode.

ステップS106の判定において、カメラ設定をしないと判定した場合に、マイクロコンピュータ230は、ユーザによって操作部232の動画ボタンが押されたか否かを判定する(ステップS108)。ステップS108の判定において、動画ボタンが押された場合に、マイクロコンピュータ230は、記録中フラグを反転させる(ステップS109)。即ち、マイクロコンピュータ230は、記録中フラグがOffの場合にはOnに、Onの場合にはOffにする。その後、マイクロコンピュータ230は、現在、動画記録中であるか否か、即ち記録中フラグがOnであるか否かを判定する(ステップS110)。   If it is determined in step S106 that the camera setting is not performed, the microcomputer 230 determines whether or not the moving image button of the operation unit 232 is pressed by the user (step S108). If the moving image button is pressed in the determination in step S108, the microcomputer 230 inverts the recording flag (step S109). That is, the microcomputer 230 turns On when the recording flag is Off and turns Off when it is On. Thereafter, the microcomputer 230 determines whether the moving image is currently being recorded, that is, whether the recording flag is On (step S110).

ステップS110の判定において、記録中フラグがOnである場合に、マイクロコンピュータ230は、動画ファイルを生成し、生成した動画ファイルを記録媒体228に記録する(ステップS111)。動画ファイルは、ヘッダ情報記録部と動画像記録部とを有する。ヘッダ情報部には、動画ファイル用のヘッダ情報を記録する。このヘッダ情報としては、ファイル名や、動画撮影時の撮影情報(ISO感度、絞り値、撮影日時等)、動画像データを構成する複数の画像データのそれぞれの位置を特定するためのポインタ情報等を記録する。さらに、動画撮影によって得られた動画像データを示す部分画像データ(先頭のフレームのサムネイル画像データ)も記録する。また、動画像記録部には、動画像データ(動画記録用のYCデータ)を圧縮した状態で記録する。   If it is determined in step S110 that the recording flag is On, the microcomputer 230 generates a moving image file and records the generated moving image file on the recording medium 228 (step S111). The moving image file has a header information recording unit and a moving image recording unit. In the header information section, header information for a moving image file is recorded. The header information includes a file name, shooting information at the time of moving image shooting (ISO sensitivity, aperture value, shooting date, etc.), pointer information for specifying the position of each of a plurality of image data constituting moving image data, and the like. Record. Furthermore, partial image data (thumbnail image data of the first frame) indicating moving image data obtained by moving image shooting is also recorded. The moving image recording unit records moving image data (YC data for moving image recording) in a compressed state.

ステップS108の判定において動画ボタンが押されていない場合、ステップS110の判定において記録中フラグがOnでない場合、ステップS111において動画ファイルを生成した後、マイクロコンピュータ230は、現在、動画記録中であるか否か、即ち記録中フラグがOnであるか否かを判定する(ステップS112)。ステップS112の判定において、記録中フラグがOffである場合に、マイクロコンピュータ230は、ユーザによって操作部232のレリーズボタンが半押しされてレリーズボタンの状態がOff状態から1stレリーズスイッチのOn状態に遷移したか否かを判定する(ステップS113)。ステップS113において、レリーズボタンの状態が1stレリーズスイッチのOn状態に遷移したと判定した場合に、マイクロコンピュータ230は、AE処理及びAF処理を行う(ステップS114)。
AE処理において、マイクロコンピュータ230は、AE処理部214によって被写体輝度を算出させる。その後、マイクロコンピュータ230は、AE処理部214によって算出された被写体輝度に応じて静止画撮影の実行時におけるISO感度、絞り値、シャッタ速を決定する。なお、AE処理において、画像データにおける特定の部位の輝度が適正となるようにISO感度、絞り値、シャッタ速を決定するようにしても良い。
AF処理において、マイクロコンピュータ230は、AF処理部216によって合焦評価値を取得させる。そして、マイクロコンピュータ230は、AF処理部216で取得された合焦評価値により、画像データにおけるコントラストを評価しつつ、レンズ102のフォーカスレンズを微少量ずつ駆動させるようにマイクロコンピュータ108に指示する。その後、マイクロコンピュータ230は、コントラストが最大となった時点でフォーカスレンズの駆動を停止させるようにマイクロコンピュータ108に指示する。このようなAF処理は、所謂コントラスト方式のAF処理である。AF処理として位相差AF処理を用いるようにしても良い。なお、AF処理において、画像データにおける特定の部位において合焦するようにフォーカスレンズを駆動させるようにしても良い。
If the moving image button is not pressed in the determination in step S108, or if the recording flag is not On in the determination in step S110, after the moving image file is generated in step S111, the microcomputer 230 is currently recording the moving image. It is determined whether or not the recording flag is On (step S112). If it is determined in step S112 that the recording flag is OFF, the microcomputer 230 causes the release button of the operation unit 232 to be half-pressed by the user, and the state of the release button changes from the OFF state to the ON state of the 1st release switch. It is determined whether or not (step S113). If it is determined in step S113 that the state of the release button has transitioned to the ON state of the first release switch, the microcomputer 230 performs AE processing and AF processing (step S114).
In the AE process, the microcomputer 230 causes the AE processing unit 214 to calculate the subject brightness. Thereafter, the microcomputer 230 determines the ISO sensitivity, the aperture value, and the shutter speed at the time of executing the still image shooting according to the subject brightness calculated by the AE processing unit 214. In the AE process, the ISO sensitivity, the aperture value, and the shutter speed may be determined so that the luminance of a specific part in the image data is appropriate.
In the AF process, the microcomputer 230 causes the AF processing unit 216 to acquire a focus evaluation value. Then, the microcomputer 230 instructs the microcomputer 108 to drive the focus lens of the lens 102 little by little while evaluating the contrast in the image data based on the focus evaluation value acquired by the AF processing unit 216. Thereafter, the microcomputer 230 instructs the microcomputer 108 to stop driving the focus lens when the contrast reaches the maximum. Such AF processing is so-called contrast AF processing. A phase difference AF process may be used as the AF process. In the AF process, the focus lens may be driven so as to focus on a specific part in the image data.

ここで、図2の例におけるAE処理及びAF処理は、レリーズボタンの状態が1stレリーズスイッチのOn状態に遷移したタイミングにおいて実行されるものである。即ち、レリーズボタンの状態が1stレリーズスイッチのOn状態に遷移しないタイミング、例えば、レリーズボタンの状態がOff状態のままである場合、1stレリーズスイッチのOn状態のままである場合、後述する2ndレリーズスイッチのOn状態のままである場合等では、AE処理及びAF処理は実行されない。勿論、AE処理及びAF処理を実行するようにしても良い   Here, the AE process and the AF process in the example of FIG. 2 are executed at the timing when the state of the release button transitions to the On state of the 1st release switch. That is, when the state of the release button does not transition to the On state of the 1st release switch, for example, when the state of the release button remains in the Off state, when the 1st release switch remains in the On state, For example, when the On state is maintained, the AE process and the AF process are not executed. Of course, the AE process and the AF process may be executed.

ステップS114の後、マイクロコンピュータ230は、デジタルカメラの電源がオフされたか否かを判定する(ステップS115)。ステップS115において、デジタルカメラの電源がオフされていないと判定した場合に、マイクロコンピュータ230は、ステップS102以後の処理を実行する。一方、ステップS115において、デジタルカメラの電源がオフされたと判定した場合に、マイクロコンピュータ230は、図2の処理を終了させる。   After step S114, the microcomputer 230 determines whether the power of the digital camera is turned off (step S115). If it is determined in step S115 that the power of the digital camera is not turned off, the microcomputer 230 executes the processing after step S102. On the other hand, if it is determined in step S115 that the power of the digital camera has been turned off, the microcomputer 230 ends the processing in FIG.

また、ステップS113において、レリーズボタンの状態が1stレリーズスイッチのOn状態に遷移していないと判定した場合に、マイクロコンピュータ230は、ユーザによって操作部232のレリーズボタンが全押しされてレリーズボタンの状態が2ndレリーズスイッチのOn状態となっているか否かを判定する(ステップS116)。   If it is determined in step S113 that the state of the release button has not changed to the ON state of the first release switch, the microcomputer 230 causes the release button of the operation unit 232 to be fully depressed by the user. Is determined whether or not the 2nd release switch is in the ON state (step S116).

ステップS116において、レリーズボタンの状態が2ndレリーズスイッチのOn状態である場合に、マイクロコンピュータ230は、メカシャッタ202を用いた静止画記録処理を実行する(ステップS117)。このために、マイクロコンピュータ230は、ステップS114において決定したISO感度に応じてアナログ処理部206におけるゲイン制御量(増幅率)を設定するとともに、ステップS114において決定した絞り値をマイクロコンピュータ108に送信する。その後、マイクロコンピュータ230は、マイクロコンピュータ108の制御による絞り104の駆動と同期して、ステップS114において決定したシャッタ速に応じてメカシャッタ202を動作させて撮像素子204の露光量を制御する。このような静止画記録処理により、画像データがSDRAM212に記憶される。   In step S116, when the state of the release button is the ON state of the 2nd release switch, the microcomputer 230 executes a still image recording process using the mechanical shutter 202 (step S117). For this purpose, the microcomputer 230 sets the gain control amount (amplification factor) in the analog processing unit 206 according to the ISO sensitivity determined in step S114, and transmits the aperture value determined in step S114 to the microcomputer 108. . Thereafter, the microcomputer 230 controls the exposure amount of the image sensor 204 by operating the mechanical shutter 202 according to the shutter speed determined in step S114 in synchronization with the driving of the diaphragm 104 under the control of the microcomputer 108. Image data is stored in the SDRAM 212 by such still image recording processing.

静止画記録処理を実行した後、マイクロコンピュータ230は、静止画記録処理によってSDRAM212に記憶された画像データに対して画像処理部218を用いて画像処理を施すことによって静止画像データ(静止画記録用のYCデータ)を生成する(ステップS118)。この際、特殊効果画像処理を施すように予め設定されている場合には、基本画像処理部2181による基本画像処理と特殊効果画像処理部2182による特殊効果画像処理の両方を画像データに対して施す。一方、特殊効果画像処理を施すように予め設定されていない場合には、基本画像処理部2181による基本画像処理のみを画像データに対して施す。   After executing the still image recording process, the microcomputer 230 performs image processing on the image data stored in the SDRAM 212 by the still image recording process by using the image processing unit 218, thereby still image data (for still image recording). YC data) is generated (step S118). At this time, if it is set in advance to perform special effect image processing, both basic image processing by the basic image processing unit 2181 and special effect image processing by the special effect image processing unit 2182 are performed on the image data. . On the other hand, when it is not preset to perform special effect image processing, only basic image processing by the basic image processing unit 2181 is performed on the image data.

画像処理の後、マイクロコンピュータ230は、画像処理の結果としてSDRAM212に記憶された静止画像データを、設定されている静止画記録形式で静止画ファイルとして記録する処理を行う(ステップS119)。この際、例えば設定されている静止画記録形式がJPEG形式の場合には、マイクロコンピュータ230は、静止画記録処理の結果としてSDRAM212に記憶された静止画像データを画像サンプリング部223においてダウンサンプリングした後、ダウンサンプリングされた画像データ(YCデータ)を画像圧縮伸張部224に入力して静止画圧縮処理を実行するように画像圧縮伸張部224に指示する。この指示を受けて画像圧縮伸張部224は、予め設定された記録モードに対応するように静止画圧縮処理を行い、圧縮された静止画像データをSDRAM212に記憶させる。その後、マイクロコンピュータ230は、画像圧縮伸張部224により圧縮された静止画像データをSDRAM212から読み出し、読み出した静止画像データに所定のヘッダ情報を付加して静止画ファイルを作成し、作成した静止画ファイルを記録媒体228に記録する。静止画ファイルは、ヘッダ情報記録部と静止画像記録部とを有する。ヘッダ情報部には、静止画ファイル用のヘッダ情報を記録する。このヘッダ情報としては、ファイル名や、静止画撮影時の撮影情報(ISO感度、絞り値、撮影日時等)等を記録する。さらに、静止画撮影によって得られた静止画像データを示す部分画像データ(サムネイル画像データ)も記録する。また、静止画像記録部には、静止画像データを圧縮状態で記録する。なお、前述した例では、画像処理部218において画像データをYC形式の画像データに変換してから記録するようにしている。これに対し、例えば設定されている静止画記録形式がTIFF形式の場合には、画像データをダウンサンプルせずに再度RGB形式に変換し画像データを記録する。   After the image processing, the microcomputer 230 performs processing for recording the still image data stored in the SDRAM 212 as a result of the image processing as a still image file in the set still image recording format (step S119). At this time, for example, when the set still image recording format is JPEG format, the microcomputer 230 downsamples still image data stored in the SDRAM 212 as a result of the still image recording processing in the image sampling unit 223. The downsampled image data (YC data) is input to the image compression / decompression unit 224 and instructs the image compression / decompression unit 224 to execute still image compression processing. In response to this instruction, the image compression / decompression unit 224 performs still image compression processing corresponding to a preset recording mode, and stores the compressed still image data in the SDRAM 212. Thereafter, the microcomputer 230 reads the still image data compressed by the image compression / decompression unit 224 from the SDRAM 212, adds predetermined header information to the read still image data, creates a still image file, and creates the created still image file. Is recorded on the recording medium 228. The still image file has a header information recording unit and a still image recording unit. In the header information section, header information for a still image file is recorded. As the header information, a file name, shooting information at the time of shooting a still image (ISO sensitivity, aperture value, shooting date, etc.) and the like are recorded. Further, partial image data (thumbnail image data) indicating still image data obtained by still image shooting is also recorded. The still image recording unit records still image data in a compressed state. In the above-described example, the image processing unit 218 converts the image data into YC format image data before recording. On the other hand, for example, when the set still image recording format is the TIFF format, the image data is converted again into the RGB format without down-sampling, and the image data is recorded.

また、ステップS116において、レリーズボタンの状態が2ndレリーズスイッチのOn状態でないと判定した場合に、マイクロコンピュータ230は、AE処理を実行する(ステップS120)。このAE処理は、動画撮影又はライブビュー表示のための処理である。AE処理の後、マイクロコンピュータ230は、電子シャッタを用いた動画撮影又はライブビュー表示用の撮影処理を実行する(ステップS121)。この撮影処理において、マイクロコンピュータ230は、AE処理によって決定したシャッタ速に応じて撮像素子204の電子シャッタ機能を動作させて撮像素子204の露光量を制御する。撮影処理の後、マイクロコンピュータ230は、撮影処理の結果としてSDRAM212に記憶された画像データに対して、画像処理部218を用いて画像処理を施す(ステップS122)。画像処理の後、マイクロコンピュータ230は、画像処理の結果としてSDRAM212に記憶された画像データを再生するように表示ドライバ220に指示する。この指示を受けて表示ドライバ220は、SDRAM212から画像データを読み出し、読み出した画像データを映像信号に変換して表示部222に出力する。表示部222は、この映像信号に基づいて画像を再生する(ステップS123)。このようなライブビュー表示により、ユーザは、表示部222を用いて構図の確認等を行うことができる。   If it is determined in step S116 that the state of the release button is not the ON state of the 2nd release switch, the microcomputer 230 executes AE processing (step S120). This AE process is a process for moving image shooting or live view display. After the AE process, the microcomputer 230 executes a shooting process for moving image shooting or live view display using an electronic shutter (step S121). In this photographing process, the microcomputer 230 controls the exposure amount of the image sensor 204 by operating the electronic shutter function of the image sensor 204 in accordance with the shutter speed determined by the AE process. After the photographing process, the microcomputer 230 performs image processing on the image data stored in the SDRAM 212 as a result of the photographing process using the image processing unit 218 (step S122). After the image processing, the microcomputer 230 instructs the display driver 220 to reproduce the image data stored in the SDRAM 212 as a result of the image processing. Upon receiving this instruction, the display driver 220 reads the image data from the SDRAM 212, converts the read image data into a video signal, and outputs it to the display unit 222. The display unit 222 reproduces an image based on this video signal (step S123). With such live view display, the user can check the composition using the display unit 222.

また、ライブビュー表示の後、マイクロコンピュータ230は、現在、動画記録中であるか否か、即ち記録中フラグがOnであるか否かを判定する(ステップS124)。ステップS124において、記録中フラグがOffであると判定した場合に、マイクロコンピュータ230は、ステップS115の判定を行う。また、ステップS124において、記録中フラグがOnであると判定した場合に、マイクロコンピュータ230は、動画記録処理を実行する(ステップS125)。その後、マイクロコンピュータ230は、ステップS115の判定を行う。動画記録処理においては、ステップS122で生成された画像データを、画像サンプリング部223においてダウンサンプリングした後、設定されている動画記録形式にあわせてダウンサンプリングされた画像データ(YCデータ)を画像圧縮伸張部224に入力して動画圧縮処理を実行するように画像圧縮伸張部224に指示する。そして、動画圧縮処理により得られた動画像データを動画像ファイルの動画像記録部に追記する。   Further, after the live view display, the microcomputer 230 determines whether or not the moving image is currently being recorded, that is, whether or not the recording flag is On (step S124). If it is determined in step S124 that the recording flag is Off, the microcomputer 230 performs the determination in step S115. If it is determined in step S124 that the recording flag is On, the microcomputer 230 executes a moving image recording process (step S125). Thereafter, the microcomputer 230 performs the determination in step S115. In the moving image recording process, after the image data generated in step S122 is down-sampled by the image sampling unit 223, the image data (YC data) down-sampled according to the set moving image recording format is subjected to image compression / decompression. The image compression / decompression unit 224 is instructed to input to the unit 224 and execute the moving image compression process. Then, the moving image data obtained by the moving image compression process is added to the moving image recording unit of the moving image file.

図3は、インデックス画像生成処理の詳細を示したフローチャートである。インデックス画像生成処理において、画像処理部218は、現在、記録媒体228に記録されている画像ファイル(静止画像ファイル及び動画像ファイル)の数をカウントし、記録枚数を取得する(ステップS201)。   FIG. 3 is a flowchart showing details of the index image generation process. In the index image generation process, the image processing unit 218 counts the number of image files (still image files and moving image files) currently recorded on the recording medium 228, and acquires the number of recordings (step S201).

続いて、画像処理部218は、部分画像データの配置パターンを決定する(ステップS202)。
図4は、配置パターンの例を示している。図4(a)は、16コマの部分画像を同時に配置する場合の例を示している。また、図4(b)は、64コマの部分画像を同時に配置する場合の例を示している。図4(a)及び図4(b)に付されている番号は、記録媒体228に記録されている画像データを用いてリサイズ等により作成される部分画像の貼り付け位置(後述のpの値に対応)を示している。ここで、図4(a)及び図4(b)の例では、部分画像間に間隔を設けるようにしているが、この間隔は必ずしも設ける必要はない。図4で示した配置パターンは例であって、必ずしも図4で示した配置パターンとする必要はない。例えば、インデックス画像として同時に配置する部分画像のコマ数は、必ずしも16コマ又は64コマとしなくとも良い。
Subsequently, the image processing unit 218 determines an arrangement pattern of partial image data (step S202).
FIG. 4 shows an example of an arrangement pattern. FIG. 4A shows an example in which 16-frame partial images are simultaneously arranged. FIG. 4B shows an example in which partial images of 64 frames are arranged at the same time. The numbers given in FIGS. 4A and 4B are the pasting positions of partial images created by resizing or the like using the image data recorded on the recording medium 228 (the value of p described later). Corresponding). Here, in the example of FIGS. 4A and 4B, an interval is provided between the partial images, but this interval is not necessarily provided. The arrangement pattern shown in FIG. 4 is an example, and the arrangement pattern shown in FIG. 4 is not necessarily required. For example, the number of frames of partial images arranged simultaneously as an index image does not necessarily need to be 16 frames or 64 frames.

マイクロコンピュータ230は、例えば記録枚数に応じて配置パターンを決定する。例えば、マイクロコンピュータ230は、記録枚数が16枚以下の場合に図4(a)の配置パターンを選択し、記録枚数が17枚以上の場合に図4(b)の配置パターンを選択する。この他、メニュー画面上でユーザが配置パターンを設定できるようにしても良い。   The microcomputer 230 determines an arrangement pattern according to the number of recordings, for example. For example, the microcomputer 230 selects the arrangement pattern shown in FIG. 4A when the number of recorded sheets is 16 or less, and selects the arrangement pattern shown in FIG. 4B when the number of recorded sheets is 17 or more. In addition, the user may be able to set the arrangement pattern on the menu screen.

配置パターンを決定した後、画像処理部218は、マイクロコンピュータ230に対してバッファ領域の確保を要求する(ステップS203)。これを受けてマイクロコンピュータ230は、SDRAM212にインデックス画像データを記憶しておくためのバッファ領域を確保する。バッファの確保は、例えばバッファ領域を、後述の画像貼り付けに用いる背景画像データを記憶させることで行う。背景画像データとしては、例えば単一色(例えば黒一色)の画像データや所定の絵柄の画像データ等、任意の画像データを用いることが可能である。   After determining the arrangement pattern, the image processing unit 218 requests the microcomputer 230 to secure a buffer area (step S203). In response to this, the microcomputer 230 secures a buffer area for storing index image data in the SDRAM 212. The buffer is secured by storing, for example, background image data used for pasting an image in the buffer area. As the background image data, it is possible to use arbitrary image data such as image data of a single color (for example, black one color) or image data of a predetermined pattern.

続いて、画像処理部218は、パラメータiを初期値1に設定する(ステップS204)。また、画像処理部218は、パラメータpを初期値1に設定する(ステップS205)。iは、部分画像データの順番を特定するためのパラメータである。一方、pは、部分画像の貼り付け位置を特定するためのパラメータである。   Subsequently, the image processing unit 218 sets the parameter i to the initial value 1 (step S204). Further, the image processing unit 218 sets the parameter p to the initial value 1 (step S205). i is a parameter for specifying the order of the partial image data. On the other hand, p is a parameter for specifying the pasting position of the partial image.

続いて、画像処理部218は、インデックス画像データにおける部分画像の貼り付け位置を決定する(ステップS206)。貼り付け位置は、インデックス画像データを構成する各部分画像データの境界の背景画像データ上での位置である。このステップS206において、画像処理部218は、インデックス画像データにおけるp番目の位置の左上座標と右下座標(左下座標と右上座標でも良い)を算出する。例えば、初回は、p=1であるので、図4(a)又は図4(b)で示した1番目の位置の左上座標と右上座標を算出する。配置位置が予め定められている場合には、その定められたp番目の位置の左上座標と右上座標を取得すれば良い。この他、インデックス画像のサイズと、インデックス画像の水平方向及び垂直方向のそれぞれに沿って貼り付ける部分画像データの枚数と、部分画像の間隔と、からp番目の位置の左上座標と右上座標を算出しても良い。   Subsequently, the image processing unit 218 determines a partial image pasting position in the index image data (step S206). The pasting position is a position on the background image data at the boundary of each partial image data constituting the index image data. In step S206, the image processing unit 218 calculates upper left coordinates and lower right coordinates (may be lower left coordinates and upper right coordinates) of the p-th position in the index image data. For example, since p = 1 at the first time, the upper left coordinates and upper right coordinates of the first position shown in FIG. 4A or 4B are calculated. When the arrangement position is determined in advance, the upper left coordinates and upper right coordinates of the determined p-th position may be acquired. In addition, the upper left and upper right coordinates of the p-th position are calculated from the size of the index image, the number of partial image data to be pasted along the horizontal and vertical directions of the index image, and the interval between the partial images. You may do it.

p番目の貼り付け位置を決定した後、画像処理部218は、記録媒体228に記録されたi番目の画像ファイルからインデックス画像用の画像データを読み込む(ステップS207)。画像ファイルの順番は、例えば記録時間の順とする。   After determining the p-th pasting position, the image processing unit 218 reads image data for an index image from the i-th image file recorded on the recording medium 228 (step S207). The order of image files is, for example, the order of recording time.

i番目の画像ファイルからインデックス画像用の画像データを読み込んだ後、画像処理部218は、特殊効果画像処理部2182により、画像貼り付け処理を行う(ステップS208)。画像貼り付け処理の詳細については後述する。   After reading the image data for the index image from the i-th image file, the image processing unit 218 performs an image pasting process using the special effect image processing unit 2182 (step S208). Details of the image pasting process will be described later.

画像貼り付け処理の後、画像処理部218は、pに1を加える(ステップS209)。その後、画像処理部218は、pがコマ数以上であるか否かを判定する(ステップS210)。配置パターンが、図4(a)のパターンである場合にはpが16以上であるか否かを判定する。配置パターンが、図4(b)のパターンである場合にはpが64以上であるか否かを判定する。ステップS210の判定において、pがコマ数未満である場合、貼り付け位置が残っていることを意味する。この場合、画像処理部218は、iに1を加える(ステップS214)。その後、画像処理部218は、iがステップS201で取得した記録枚数以下であるか否かを判定する(ステップS215)。ステップS215において、iが記録枚数以下でない場合には、まだ貼り付けるべき部分画像データが残っていることを意味する。この場合、画像処理部218は、処理をステップS206に戻して次の部分画像データの貼り付け位置を決定する。   After the image pasting process, the image processing unit 218 adds 1 to p (step S209). Thereafter, the image processing unit 218 determines whether p is equal to or greater than the number of frames (step S210). When the arrangement pattern is the pattern of FIG. 4A, it is determined whether p is 16 or more. When the arrangement pattern is the pattern of FIG. 4B, it is determined whether p is 64 or more. If it is determined in step S210 that p is less than the number of frames, it means that the pasting position remains. In this case, the image processing unit 218 adds 1 to i (step S214). Thereafter, the image processing unit 218 determines whether i is equal to or smaller than the number of recordings acquired in step S201 (step S215). In step S215, if i is not equal to or smaller than the number of recording sheets, it means that partial image data to be pasted still remains. In this case, the image processing unit 218 returns the process to step S206 to determine the pasting position of the next partial image data.

また、ステップS210において、pがコマ数以上であると判定した場合に、画像処理部218は、画像貼り付け処理を経て生成されたインデックス画像データを出力する。これを受けてマイクロコンピュータ230は、画像処理部218によって生成されたインデックス画像データを、画像サンプリング部223でダウンサンプリングし、さらに画像圧縮伸張部224において圧縮した後、静止画像ファイルとして記録媒体228に記録する(ステップS211)。続いて、画像処理部218は、マイクロコンピュータ230に対してバッファ領域をクリアする旨を要求する(ステップS212)。これを受けてマイクロコンピュータ230は、SDRAM212において確保したバッファ領域に記憶されているデータをクリアする。バッファのクリアは、例えばバッファ領域のデータを、後述の画像貼り付けに用いる背景画像データに置き換えることで行う。   If it is determined in step S210 that p is equal to or greater than the number of frames, the image processing unit 218 outputs the index image data generated through the image pasting process. In response to this, the microcomputer 230 down-samples the index image data generated by the image processing unit 218 by the image sampling unit 223, further compresses the index image data by the image compression / decompression unit 224, and then stores it on the recording medium 228 as a still image file. Recording is performed (step S211). Subsequently, the image processing unit 218 requests the microcomputer 230 to clear the buffer area (step S212). In response to this, the microcomputer 230 clears the data stored in the buffer area secured in the SDRAM 212. The buffer is cleared, for example, by replacing the data in the buffer area with background image data used for image pasting described later.

その後、画像処理部218は、pを1に戻す(ステップS213)。そして、画像処理部218は、ステップS214以後の処理を行う。コマ数以上の画像ファイルが記録媒体228に記録されている場合には、ステップS214以後の処理により2枚目以上のインデックス画像データが生成される。   Thereafter, the image processing unit 218 returns p to 1 (step S213). Then, the image processing unit 218 performs processing subsequent to step S214. When image files of the number of frames or more are recorded on the recording medium 228, the second or more index image data is generated by the processing after step S214.

また、ステップS215において、iが記録枚数を超えたと判定した場合に、画像処理部218は、pが1を超えているか否かを判定する(ステップS216)。ステップS216において、pが1を超えていると判定した場合に、画像処理部218は、それまでの画像貼り付け処理を経て生成されたインデックス画像データを出力する。これを受けてマイクロコンピュータ230は、画像処理部218によって生成されたインデックス画像データを、画像サンプリング部223でダウンサンプリングし、さらに画像圧縮伸張部224において圧縮した後、静止画像ファイルとして記録媒体228に記録する(ステップS217)。ステップS216において、pが1を超えている場合とは、ステップS213においてpが1に戻されていないことを示している。この場合には、コマ数の部分画像の貼り付けが終了しておらず、ステップS211においてインデックス画像データが記録されていない。したがって、ステップS217において、コマ数よりも少ない枚数の部分画像が貼り付けられた状態のインデックス画像データを記録する。   If it is determined in step S215 that i exceeds the number of recording sheets, the image processing unit 218 determines whether p exceeds 1 (step S216). If it is determined in step S216 that p is greater than 1, the image processing unit 218 outputs the index image data generated through the image pasting process so far. In response to this, the microcomputer 230 down-samples the index image data generated by the image processing unit 218 by the image sampling unit 223, further compresses the index image data by the image compression / decompression unit 224, and then stores it on the recording medium 228 as a still image file. Recording is performed (step S217). The case where p exceeds 1 in step S216 indicates that p has not been returned to 1 in step S213. In this case, pasting of the partial images for the number of frames has not been completed, and no index image data has been recorded in step S211. Accordingly, in step S217, the index image data in a state where a partial image smaller than the number of frames is pasted is recorded.

ステップS216においてpが1以下であると判定した場合又はステップS217の後、画像処理部218は、マイクロコンピュータ230に対してバッファ領域を開放する旨を要求する(ステップS218)。これを受けてマイクロコンピュータ230は、SDRAM212に確保していたバッファ領域を開放し、図3の処理を終了させる。   When it is determined in step S216 that p is 1 or less, or after step S217, the image processing unit 218 requests the microcomputer 230 to release the buffer area (step S218). In response to this, the microcomputer 230 releases the buffer area reserved in the SDRAM 212, and ends the processing of FIG.

図5は、画像処理の詳細について示したフローチャートである。図5において、画像処理部218は、基本画像処理部2181により、OB減算処理を行う(ステップS301)。OB減算処理において、基本画像処理部2181は、入力された画像データからオプティカルブラック(OB)値を減算することで画像データにおける暗電流成分を除去する。OB減算の後、画像処理部218は、基本画像処理部2181により、WB補正処理を行う(ステップS302)。WB補正処理において、基本画像処理部2181は、入力された画像データの色成分毎にWB(ホワイトバランス)ゲインを乗じることで画像データの色バランスを補正する。WB補正処理の後、画像処理部218は、基本画像処理部2181により、同時化処理を行う(ステップS303)。同時化処理において、基本画像処理部2181は、入力された画像データを、補間処理を用いて同時化する。これにより、1画素がRGBのうちの1つの色成分を有している画像データを1画素がRGB3つの色成分を有する画像データに変換する。   FIG. 5 is a flowchart showing details of the image processing. In FIG. 5, the image processing unit 218 performs OB subtraction processing by the basic image processing unit 2181 (step S <b> 301). In the OB subtraction process, the basic image processing unit 2181 removes a dark current component in the image data by subtracting an optical black (OB) value from the input image data. After the OB subtraction, the image processing unit 218 performs WB correction processing by the basic image processing unit 2181 (step S302). In the WB correction process, the basic image processing unit 2181 corrects the color balance of the image data by multiplying each color component of the input image data by a WB (white balance) gain. After the WB correction process, the image processing unit 218 performs a synchronization process using the basic image processing unit 2181 (step S303). In the synchronization processing, the basic image processing unit 2181 synchronizes the input image data using interpolation processing. Thereby, image data in which one pixel has one color component of RGB is converted into image data in which one pixel has three color components of RGB.

同時化処理の後、画像処理部218は、基本画像処理部2181により、カラーマトリクス演算を行う(ステップS304)。カラーマトリクス演算において、基本画像処理部2181は、入力された画像データの各画素にカラーマトリクス係数を乗じることで画像データの色を変換する。カラーマトリクス演算の後、画像処理部218は、基本画像処理部2181により、ガンマ変換処理及び色補正処理を行う(ステップS305)。この際、基本画像処理部2181は、画像データに対し、マイクロコンピュータ230によって設定されたガンマテーブルを用いてガンマ変換処理を行う。さらに、基本画像処理部2181は、所定のマトリクス演算を行って画像データをYC形式に変換する。詳細は後述するが、静止画記録時の画像処理においては、例えばYC422形式のデータに変換する。YC422形式のデータとは、Y:Cb:Crが4:2:2のデータのことである。また、動画記録時の画像処理においては、例えばYC420形式のデータに変換する。YC420形式のデータとは、Y:Cb:Crが4:1:1のデータのことである。また、色補正処理において、基本画像処理部2181は、YC形式に変換された画像データのうちのC(Cb、Cr)データに彩度補正係数、色相補正係数を乗じることで画像データの色補正を行う。   After the synchronization processing, the image processing unit 218 performs color matrix calculation by the basic image processing unit 2181 (step S304). In the color matrix calculation, the basic image processing unit 2181 converts the color of the image data by multiplying each pixel of the input image data by a color matrix coefficient. After the color matrix calculation, the image processing unit 218 performs gamma conversion processing and color correction processing using the basic image processing unit 2181 (step S305). At this time, the basic image processing unit 2181 performs gamma conversion processing on the image data using a gamma table set by the microcomputer 230. Further, the basic image processing unit 2181 performs a predetermined matrix operation to convert the image data into the YC format. Although details will be described later, in the image processing at the time of recording a still image, for example, the data is converted into YC422 format data. The YC422 format data is data in which Y: Cb: Cr is 4: 2: 2. In the image processing at the time of moving image recording, for example, the data is converted into YC420 format data. The YC420 format data is data in which Y: Cb: Cr is 4: 1: 1. In the color correction process, the basic image processing unit 2181 multiplies C (Cb, Cr) data in the image data converted into the YC format by the saturation correction coefficient and the hue correction coefficient, thereby correcting the color of the image data. I do.

色補正処理の後、画像処理部218は、基本画像処理部2181により、エッジ強調処理を行う(ステップS306)。エッジ強調処理において、基本画像処理部2181は、色補正されたYCデータにおけるYデータに対してバンドパスフィルタ処理を施して画像データにおけるエッジ成分を抽出し、抽出したエッジ成分にエッジ強調量に応じた係数を乗じる。そして、基本画像処理部2181は、係数を乗じたエッジ成分をもとのYデータに加算することで画像データのエッジ成分を強調する。エッジ強調処理の後、画像処理部218は、基本画像処理部2181により、ノイズ低減(NR)処理を行う(ステップS307)。ノイズ低減処理において、基本画像処理部2181は、エッジ強調処理がされたYデータに対してコアリング処理等を施して画像データにおけるノイズ成分を低減させる。Cデータに対してノイズ成分を低減させても良い。ノイズ低減処理後のデータは、記録形式がTIFF形式の場合には所定のマトリクス演算を行って再度RGB形式に変換する。   After the color correction processing, the image processing unit 218 performs edge enhancement processing using the basic image processing unit 2181 (step S306). In the edge enhancement processing, the basic image processing unit 2181 performs bandpass filter processing on the Y data in the color-corrected YC data to extract edge components in the image data, and the extracted edge components according to the edge enhancement amount. Multiply the coefficient. Then, the basic image processing unit 2181 emphasizes the edge component of the image data by adding the edge component multiplied by the coefficient to the original Y data. After the edge enhancement processing, the image processing unit 218 performs noise reduction (NR) processing using the basic image processing unit 2181 (step S307). In the noise reduction process, the basic image processing unit 2181 performs a coring process or the like on the Y data subjected to the edge enhancement process to reduce noise components in the image data. You may reduce a noise component with respect to C data. When the recording format is TIFF format, the data after the noise reduction processing is converted into RGB format again by performing a predetermined matrix calculation.

ノイズ低減処理の後、画像処理部218は、マイクロコンピュータ230により、特殊効果画像処理モードとしてモザイクモードが設定されているか否かを判定する(ステップS308)。前述したように、特殊効果画像処理モードをモザイクモードとする設定は、カメラ設定において行われる。   After the noise reduction process, the image processing unit 218 determines whether the mosaic mode is set as the special effect image processing mode by the microcomputer 230 (step S308). As described above, the setting for setting the special effect image processing mode to the mosaic mode is performed in the camera setting.

ステップS308において、特殊効果画像処理モードとしてモザイクモードが設定されていると判定した場合に、画像処理部218は、特殊効果画像処理部2182により、モザイク処理を行う(ステップS309)。その後、画像処理部218は、図5の処理を終了させる。ここで、モザイク処理の詳細については後述する。   When it is determined in step S308 that the mosaic mode is set as the special effect image processing mode, the image processing unit 218 performs mosaic processing by using the special effect image processing unit 2182 (step S309). Thereafter, the image processing unit 218 ends the process of FIG. Here, details of the mosaic processing will be described later.

ステップS308において、特殊効果画像処理モードとしてモザイクモードが設定されていないと判定した場合に、画像処理部218は、特殊効果画像処理モードとしてランダムタイルモードが設定されているか否かを判定する(ステップS310)。前述したように、特殊効果画像処理モードをモランダムタイルモードとする設定は、カメラ設定において行われる。   When it is determined in step S308 that the mosaic mode is not set as the special effect image processing mode, the image processing unit 218 determines whether or not the random tile mode is set as the special effect image processing mode (step S308). S310). As described above, the setting for setting the special effect image processing mode to the Moranda tile mode is performed in the camera setting.

ステップS310において、特殊効果画像処理モードとしてランダムタイルモードが設定されていると判定した場合に、画像処理部218は、特殊効果画像処理部2182により、ランダムタイル処理を行う(ステップS311)。その後、画像処理部218は、図5の処理を終了させる。ここで、ランダムタイル処理の詳細については後述する。   If it is determined in step S310 that the random tile mode is set as the special effect image processing mode, the image processing unit 218 performs random tile processing by the special effect image processing unit 2182 (step S311). Thereafter, the image processing unit 218 ends the process of FIG. Here, details of the random tile processing will be described later.

また、ステップS310において、特殊効果画像処理モードとしてランダムタイルモードが設定されていないと判定した場合にも、画像処理部218は、図5の処理を終了させる。なお、モザイクモード及びランダムタイルモード以外の特殊効果画像処理モードが存在する場合には、各特殊効果画像処理モードについてステップS308及びS310で示した判定と同様の判定を行う。   Further, when it is determined in step S310 that the random tile mode is not set as the special effect image processing mode, the image processing unit 218 also ends the process of FIG. Note that, when there are special effect image processing modes other than the mosaic mode and the random tile mode, the same determination as the determinations shown in steps S308 and S310 is performed for each special effect image processing mode.

ここで、図5の処理の順番は、一例であって適宜変更可能である。例えば、WB補正処理の前に同時化処理を行っても良い。   Here, the order of the processing in FIG. 5 is an example and can be changed as appropriate. For example, the synchronization process may be performed before the WB correction process.

図6は、モザイク処理の詳細を示すフローチャートである。モザイク処理において、画像処理部218は、ノイズ低減処理後の画像データを、各々が1つ以上の画素を有する複数のコマの部分画像データに分割する(ステップS401)。図7は、分割の例を示している。図7は、画像データを垂直300コマ、水平400コマに分割した例を示している。ここで、分割数は、図7で示した例に限るものではない。また、図7の例では、各コマの間に間隔を設けるようにしている。この間隔を設けないようにしても良い。   FIG. 6 is a flowchart showing details of the mosaic process. In the mosaic processing, the image processing unit 218 divides the image data after the noise reduction processing into partial image data of a plurality of frames each having one or more pixels (step S401). FIG. 7 shows an example of division. FIG. 7 shows an example in which image data is divided into vertical 300 frames and horizontal 400 frames. Here, the number of divisions is not limited to the example shown in FIG. In the example of FIG. 7, an interval is provided between the frames. This interval may not be provided.

続いて、画像処理部218は、それぞれのコマの平均色を算出する(ステップS402)。YC形式の場合、平均色は、各コマを構成する色差データを成分(Cb、Cr)毎に加算した結果を、各コマを構成する画素数で除算した値である。また、RGB形式の場合、平均色は、各コマを構成する画素データを成分(R、G、B)毎に加算した結果を、各コマを構成する画素数で除算した値である。   Subsequently, the image processing unit 218 calculates the average color of each frame (step S402). In the case of the YC format, the average color is a value obtained by dividing the result of adding the color difference data constituting each frame for each component (Cb, Cr) by the number of pixels constituting each frame. In the case of the RGB format, the average color is a value obtained by dividing the result of adding the pixel data constituting each frame for each component (R, G, B) by the number of pixels constituting each frame.

平均色を算出した後、画像処理部218は、マイクロコンピュータ230に対してバッファ領域を確保するように要求する(ステップS403)。これを受けてマイクロコンピュータ230は、SDRAM212にバッファ領域を確保する。バッファ領域の確保の手法は、インデックス画像生成処理の説明の際に述べた手法を適用できる。   After calculating the average color, the image processing unit 218 requests the microcomputer 230 to secure a buffer area (step S403). In response to this, the microcomputer 230 secures a buffer area in the SDRAM 212. As a method for securing the buffer area, the method described in the description of the index image generation process can be applied.

続いて、画像処理部218は、パラメータiを初期値1に設定する(ステップS404)。iは、コマの順番を特定するためのパラメータである。このiによって貼り付け位置が特定される。貼り付け位置は、モザイク画像データを構成する各部分画像データの境界の背景画像データ上での位置である。   Subsequently, the image processing unit 218 sets the parameter i to the initial value 1 (step S404). i is a parameter for specifying the order of frames. This i identifies the pasting position. The pasting position is a position on the background image data at the boundary of each partial image data constituting the mosaic image data.

iを設定した後、画像処理部218は、i番目のコマと置き換えるコマの部分画像データを選択する(ステップS405)。モザイク処理においては、図7に示すように、i番目のコマの部分画像データを別のコマの部分画像データと置き換えることによってモザイク画像データを生成する。置き換えるコマは、例えばi番目のコマの平均色と最も近い平均色を有するコマとする。このような置き換えを行うことにより、置き換え前のコマが、平均して類似の色を有する別のコマと置き換わる。これにより、モザイク画像が生成される。   After setting i, the image processing unit 218 selects partial image data of a frame to be replaced with the i-th frame (step S405). In the mosaic process, as shown in FIG. 7, mosaic image data is generated by replacing the partial image data of the i-th frame with the partial image data of another frame. The frame to be replaced is, for example, a frame having an average color closest to the average color of the i-th frame. By performing such replacement, the frame before replacement is replaced with another frame having a similar color on average. Thereby, a mosaic image is generated.

また、同一の画像内のコマと置き換えるのではなく、記録媒体228に記録されている別の画像データから平均色の近いコマを探索して置き換えるようにしても良い。   Further, instead of replacing a frame in the same image, a frame having a similar average color may be searched for and replaced from another image data recorded on the recording medium 228.

置き換えるコマの部分画像データを選択した後、画像処理部218は、特殊効果画像処理部2182により、画像貼り付け処理を行う(ステップS406)。画像貼り付け処理の詳細については後述する。   After selecting the partial image data of the frame to be replaced, the image processing unit 218 performs image pasting processing using the special effect image processing unit 2182 (step S406). Details of the image pasting process will be described later.

画像貼り付け処理の後、画像処理部218は、iに1を加える(ステップS407)。その後、画像処理部218は、iがコマ数(垂直のコマ数×水平のコマ数。図7の場合には120000コマ)以下であるか否かを判定する(ステップS408)。ステップS408において、iがコマ数以下である場合、置き換えるコマの部分画像データが残っていることを意味する。この場合、画像処理部218は、処理をステップS405に戻して次の部分画像データと置き換えるコマの部分画像データを選択する。   After the image pasting process, the image processing unit 218 adds 1 to i (step S407). Thereafter, the image processing unit 218 determines whether i is equal to or less than the number of frames (vertical frame number × horizontal frame number, 120,000 frames in FIG. 7) (step S408). If i is equal to or less than the number of frames in step S408, it means that partial image data of the replaced frame remains. In this case, the image processing unit 218 returns the process to step S405 and selects the partial image data of the frame to be replaced with the next partial image data.

また、ステップS408において、iがコマ数を超えていると判定した場合に、画像処理部218は、画像貼り付け処理を経て生成されたモザイク画像データを、ノイズ低減処理後の画像データが格納されていたバッファ領域にコピー(バッファ領域の画像データを上書き)する(ステップS409)。続いて、画像処理部218は、マイクロコンピュータ230に対してバッファ領域を開放する旨を要求する(ステップS410)。これを受けてマイクロコンピュータ230は、SDRAM212に確保していたバッファ領域を開放し、図6の処理を終了させる。   If it is determined in step S408 that i exceeds the number of frames, the image processing unit 218 stores the mosaic image data generated through the image pasting process and the image data after the noise reduction process. Copying is performed (overwriting the image data in the buffer area) in the buffer area (step S409). Subsequently, the image processing unit 218 requests the microcomputer 230 to release the buffer area (step S410). In response to this, the microcomputer 230 releases the buffer area reserved in the SDRAM 212 and ends the processing of FIG.

図8は、ランダムタイル処理の詳細を示すフローチャートである。ランダムタイル処理において、画像処理部218は、ノイズ低減処理後の画像データを、各々が1つ以上の画素を有する複数のコマの部分画像データに分割する(ステップS501)。図9は、分割の例を示している。図9は、画像データを垂直6コマ、水平8コマに分割した例を示している。ここで、分割数は、図9で示した例に限るものではない。また、図9の例では、各コマの間に間隔を設けないようにしている。間隔を設けるようにしても良い。   FIG. 8 is a flowchart showing details of the random tile process. In the random tile process, the image processing unit 218 divides the image data after the noise reduction process into partial image data of a plurality of frames each having one or more pixels (step S501). FIG. 9 shows an example of division. FIG. 9 shows an example in which image data is divided into 6 vertical frames and 8 horizontal frames. Here, the number of divisions is not limited to the example shown in FIG. In the example of FIG. 9, no interval is provided between the frames. An interval may be provided.

続いて、画像処理部218は、部分画像データのコピー順を決定する(ステップS502)。コピー順は、例えば1からコマ数までの数が格納された配列において、各要素をランダムに入れ替えることによって生成する。なお、画像データが動画像データである場合には、隣接するフレーム間での各画素のデータの差が所定量以下となるように配列順を決めるようにしても良い。   Subsequently, the image processing unit 218 determines the copy order of the partial image data (step S502). The copy order is generated by, for example, randomly replacing each element in an array in which numbers from 1 to the number of frames are stored. When the image data is moving image data, the arrangement order may be determined so that the difference in data of each pixel between adjacent frames is less than or equal to a predetermined amount.

コピー順を決定した後、画像処理部218は、マイクロコンピュータ230に対してバッファ領域を確保するように要求する(ステップS503)。これを受けてマイクロコンピュータ230は、SDRAM212にバッファ領域を確保する。バッファ領域の確保の手法は、インデックス画像生成処理の説明の際に述べた手法を適用できる。   After determining the copy order, the image processing unit 218 requests the microcomputer 230 to secure a buffer area (step S503). In response to this, the microcomputer 230 secures a buffer area in the SDRAM 212. As a method for securing the buffer area, the method described in the description of the index image generation process can be applied.

続いて、画像処理部218は、パラメータiを初期値1に設定する(ステップS504)。iは、配列のインデックスを示すパラメータである。   Subsequently, the image processing unit 218 sets the parameter i to the initial value 1 (step S504). i is a parameter indicating the index of the array.

iを設定した後、画像処理部218は、配列におけるi番目の要素と同じ番号のコマの部分画像データの貼り付け位置を算出する(ステップS505)。貼り付け位置は、ランダムタイル画像データを構成する各部分画像データの境界の背景画像データ上での位置である。貼り付け位置の算出においては、配列におけるi番目の要素と同じ番号のコマの左上座標と右下座標とを検出し、各座標を、部分画像データのアスペクト比が変わらないように一定量だけランダムで移動させる。例えば、図9に示すように、各座標を、部分画像データの元のサイズの10%以内のサイズでずらす。このようにして貼り付け位置を設定することにより、図10(a)で示すようなランダムタイル画像が生成される。   After setting i, the image processing unit 218 calculates the pasting position of the partial image data of the frame having the same number as the i-th element in the array (step S505). The pasting position is a position on the background image data at the boundary between the partial image data constituting the random tile image data. In calculating the pasting position, the upper left coordinate and lower right coordinate of the frame having the same number as the i-th element in the array are detected, and each coordinate is randomly random by a certain amount so that the aspect ratio of the partial image data does not change. Move with. For example, as shown in FIG. 9, each coordinate is shifted by a size within 10% of the original size of the partial image data. By setting the pasting position in this way, a random tile image as shown in FIG. 10A is generated.

貼り付け位置の算出後、画像処理部218は、特殊効果画像処理部2182により、画像貼り付け処理を行う(ステップS506)。画像貼り付け処理の詳細については後述する。   After calculating the pasting position, the image processing unit 218 performs an image pasting process using the special effect image processing unit 2182 (step S506). Details of the image pasting process will be described later.

画像貼り付け処理の後、画像処理部218は、iに1を加える(ステップS507)。その後、画像処理部218は、iがコマ数(垂直のコマ数×水平のコマ数。図9の場合には48コマ)以下であるか否かを判定する(ステップS508)。ステップS508において、iがコマ数以下である場合、貼り付けるコマの部分画像データが残っていることを意味する。この場合、画像処理部218は、処理をステップS505に戻して次の部分画像データの貼り付け位置を算出する。   After the image pasting process, the image processing unit 218 adds 1 to i (step S507). Thereafter, the image processing unit 218 determines whether i is equal to or less than the number of frames (vertical frame number × horizontal frame number, 48 frames in the case of FIG. 9) (step S508). If i is equal to or less than the number of frames in step S508, it means that partial image data of the frame to be pasted remains. In this case, the image processing unit 218 returns the process to step S505 to calculate the pasting position of the next partial image data.

また、ステップS508において、iがコマ数を超えていると判定した場合に、画像処理部218は、画像貼り付け処理を経て生成されたランダムタイル画像データを、ノイズ低減処理後の画像データが格納されていたバッファ領域にコピー(バッファ領域の画像データを上書き)する(ステップS509)。続いて、画像処理部218は、マイクロコンピュータ230に対してバッファ領域を開放する旨を要求する(ステップS510)。これを受けてマイクロコンピュータ230は、SDRAM212に確保していたバッファ領域を開放し、図8の処理を終了させる。   If it is determined in step S508 that i exceeds the number of frames, the image processing unit 218 stores the random tile image data generated through the image pasting process in the image data after the noise reduction process. Copying is performed (overwriting the image data in the buffer area) in the buffer area that has been made (step S509). Subsequently, the image processing unit 218 requests the microcomputer 230 to release the buffer area (step S510). In response to this, the microcomputer 230 releases the buffer area secured in the SDRAM 212, and ends the processing of FIG.

ここで、図10(a)の例では、貼り付ける部分画像データの形状が矩形であるが、必ずしも貼り付ける部分画像データの形状を矩形とする必要はない。例えば図10(b)に示すような四隅が面取りされたような形状の部分画像データを貼り付けるようにしても良いし、図10(c)に示すような略半円の形状の部分画像データを貼り付けるようにしても良い。このように、部分画像データは、水平方向又は垂直方向に直線状の境界を有していれば良い。なお、図10(b)に示す部分画像データや図10(c)に示す部分画像データは、分割された部分画像データ内で面取りすべき部分のデータを、背景画像データでマスクすることによって生成できる。   Here, in the example of FIG. 10A, the shape of the partial image data to be pasted is a rectangle, but the shape of the partial image data to be pasted is not necessarily a rectangle. For example, partial image data having a shape in which four corners are chamfered as shown in FIG. 10B may be pasted, or partial image data having a substantially semicircular shape as shown in FIG. 10C. You may make it stick. As described above, the partial image data only needs to have a linear boundary in the horizontal direction or the vertical direction. The partial image data shown in FIG. 10B and the partial image data shown in FIG. 10C are generated by masking the data to be chamfered in the divided partial image data with the background image data. it can.

次に、本実施形態の画像処理方法としての画像貼り付け処理について図11を参照して説明する。画像貼り付け処理は、インデックス画像生成処理、モザイク処理、ランダムタイル処理で共通である。画像貼り付け処理においては、YC形式にダウンサンプリングされた画像データから生成される合成画像データ(インデックス画像データ、モザイク画像データ、又はランダムタイル画像データ)が、再生時に適切にアップサンプリングされるように、部分画像データの貼り付け位置又はサイズを補正してから貼り付けを行う。   Next, an image pasting process as an image processing method of the present embodiment will be described with reference to FIG. The image pasting process is common to the index image generation process, the mosaic process, and the random tile process. In the image pasting process, composite image data (index image data, mosaic image data, or random tile image data) generated from image data down-sampled in the YC format is appropriately up-sampled during playback. Then, the pasting is performed after correcting the pasting position or size of the partial image data.

画像貼り付け処理において、特殊効果画像処理部2182は、コピー元の画像データとして、背景画像データにコピーする部分画像データを読み込む(ステップS601)。この部分画像データは、インデックス画像生成処理の場合には、i番目の画像ファイルから読み込まれた画像データからリサイズ処理等によって生成される部分画像データである。また、モザイク処理の場合には、i番目のコマと置き換えるコマの部分画像データである。さらに、ランダムタイル処理の場合には、1からコマ数までの数がランダムに格納された配列におけるi番目要素と同じ番号のコマの部分画像データである。   In the image pasting process, the special effect image processing unit 2182 reads partial image data to be copied to the background image data as copy source image data (step S601). In the case of index image generation processing, this partial image data is partial image data generated by resizing processing or the like from image data read from the i-th image file. In the case of mosaic processing, it is partial image data of a frame that replaces the i-th frame. Further, in the case of random tile processing, the partial image data of the frame having the same number as the i-th element in the array in which the numbers from 1 to the number of frames are randomly stored.

コピー元の画像データの読み込み後、特殊効果画像処理部2182は、コピー先の画像データをダウンサンプリングする際の形式がYC422形式又はYC420形式であるか否かを判定する(ステップS602)。コピー先の画像データのダウンサンプリング形式は、例えばマイクロコンピュータ230によって通知される。   After reading the copy source image data, the special effect image processing unit 2182 determines whether the format for down-sampling the copy destination image data is the YC422 format or the YC420 format (step S602). The downsampling format of the copy destination image data is notified by the microcomputer 230, for example.

ステップS602において、ダウンサンプリング形式がYC422形式又はYC420形式であると判定した場合、特殊効果画像処理部2182は、部分画像データの貼り付け位置又はサイズを補正することによって貼り付け位置のX座標(水平方向座標)を補正する(ステップS603)。この補正については後述する。   If it is determined in step S602 that the downsampling format is the YC422 format or the YC420 format, the special effect image processing unit 2182 corrects the pasting position or size of the partial image data to correct the pasting position X coordinate (horizontal The direction coordinates are corrected (step S603). This correction will be described later.

ステップS602においてダウンサンプリング形式がYC422形式又はYC420形式でないと判定した場合又はステップS603の後、特殊効果画像処理部2182は、コピー先の画像データをダウンサンプリングする際の形式がYC420形式であるか否かを判定する(ステップS604)。   When it is determined in step S602 that the downsampling format is not the YC422 format or the YC420 format, or after step S603, the special effect image processing unit 2182 determines whether the format at the time of downsampling the copy destination image data is the YC420 format. Is determined (step S604).

ステップS604において、ダウンサンプリング形式がYC420形式であると判定した場合、特殊効果画像処理部2182は、部分画像データの貼り付け位置又はサイズを補正することによって貼り付け位置のY座標(垂直方向座標)を補正する(ステップS605)。この補正については後述する。   When it is determined in step S604 that the downsampling format is the YC420 format, the special effect image processing unit 2182 corrects the pasting position or size of the partial image data to correct the pasting position Y coordinate (vertical coordinate). Is corrected (step S605). This correction will be described later.

ステップS604においてダウンサンプリング形式がYC420形式でないと判定した場合又はステップS605の後、特殊効果画像処理部2182は、部分画像データを、バッファ領域にコピーされている背景画像データにおける貼り付け位置の座標にコピー(合成)する(ステップS606)。その後、特殊効果画像処理部2182は、図11の処理を終了させる。なお、ランダムタイル生成処理で説明したように、部分画像データを拡大又は縮小する必要がある場合には、部分画像データのリサイズを行ってからコピーする。また、部分画像データの形状を矩形以外とする場合には、不要な画素のデータをマスクしてからコピーする。   When it is determined in step S604 that the downsampling format is not the YC420 format or after step S605, the special effect image processing unit 2182 sets the partial image data to the coordinates of the pasting position in the background image data copied to the buffer area. Copy (synthesize) (step S606). Thereafter, the special effect image processing unit 2182 ends the process of FIG. As described in the random tile generation process, when it is necessary to enlarge or reduce the partial image data, the partial image data is resized and then copied. When the partial image data has a shape other than rectangular, unnecessary pixel data is masked before copying.

図12を参照して貼り付け位置の座標の補正について説明する。図12に示す数字は、画素の座標を示しており、座標(1,1)が原点座標である左上端の画素位置に対応している。さらに、図12の黒点は、貼り付け位置の補正前の部分画像データの各画素を示している。また、図12のハッチングを施した点は、貼り付け位置の補正のために拡張した画素を示している。
まず、座標(1,1)を左上端の画素位置と定義した場合、部分画像データの貼り付け位置のX座標は、左端の貼り付け位置の座標が奇数(1+2i(iは0以上の整数))となり、右端の貼り付け位置の座標が偶数(2j(jは1以上の整数))となるように補正する。例えば、図12の例では、補正前の部分画像データの左端の画素の貼り付け位置の座標が4であり、右端の画素の貼り付け位置の座標が14である。したがって、左端の画素の貼り付け位置の座標が奇数となるように、部分画像データを左方向に1画素だけ拡大する。これにより、左端の画素の貼り付け位置の座標が3(1+2×1)となる。図12の例において、左端の画素の座標が5となるように部分画像データを右方向に1画素だけ縮小しても良い。また、補正前の部分画像データの左端の画素の貼り付け位置の座標が偶数であり、右端の画素の貼り付け位置の座標が奇数である場合には、部分画像データの拡大や縮小を行わずに単に貼り付け位置の座標をずらすだけで良い。
The correction of the coordinates of the pasting position will be described with reference to FIG. The numbers shown in FIG. 12 indicate the coordinates of the pixel, and the coordinates (1, 1) correspond to the pixel position at the upper left corner, which is the origin coordinate. Furthermore, the black dots in FIG. 12 indicate the pixels of the partial image data before the pasting position is corrected. Further, the hatched points in FIG. 12 indicate pixels expanded for correcting the pasting position.
First, when the coordinates (1, 1) are defined as the pixel position at the upper left corner, the X coordinate of the partial image data pasting position is an odd number (1 + 2i (i is an integer of 0 or more)). ) And the coordinates of the paste position at the right end are corrected to be an even number (2j (j is an integer of 1 or more)). For example, in the example of FIG. 12, the coordinates of the pasting position of the leftmost pixel of the partial image data before correction are 4, and the coordinates of the pasting position of the rightmost pixel are 14. Therefore, the partial image data is enlarged by one pixel in the left direction so that the coordinates of the pasting position of the leftmost pixel are odd. As a result, the coordinates of the pasting position of the leftmost pixel are 3 (1 + 2 × 1). In the example of FIG. 12, the partial image data may be reduced by one pixel in the right direction so that the coordinate of the leftmost pixel is 5. If the coordinates of the pasting position of the leftmost pixel of the partial image data before correction are an even number and the coordinates of the pasting position of the rightmost pixel are an odd number, the partial image data is not enlarged or reduced. You can simply shift the coordinates of the pasting position.

一方、部分画像データの貼り付け位置のY座標は、上端の貼り付け位置の座標が奇数(1+2i(iは0以上の整数))となり、下端の貼り付け位置の座標が偶数(2j(jは1以上の整数))となるように補正する。例えば、図12の例では、補正前の部分画像データの上端の画素の貼り付け位置の座標が4であり、下端の画素の貼り付け位置の座標が14である。したがって、上端の画素の貼り付け位置の座標が奇数となるように、部分画像データを上方向に1画素だけ拡大する。これにより、上端の画素の貼り付け位置の座標が3となる。なお、図12の例において、上端の画素の座標が5となるように部分画像データを下方向に1画素だけ縮小しても良い。また、補正前の部分画像データの上端の画素の貼り付け位置の座標が偶数であり、下端の画素の貼り付け位置の座標が奇数である場合には、部分画像データの拡大や縮小を行わずに単に貼り付け位置の座標をずらすだけで良い。   On the other hand, as for the Y coordinate of the pasting position of the partial image data, the uppermost pasting position coordinate is an odd number (1 + 2i (i is an integer of 0 or more)), and the lowermost pasting position coordinate is an even number (2j (j is It is corrected to be an integer of 1 or more)). For example, in the example of FIG. 12, the coordinates of the pasting position of the pixel at the upper end of the partial image data before correction are 4, and the coordinates of the pasting position of the pixel at the lower end are 14. Therefore, the partial image data is enlarged by one pixel in the upward direction so that the coordinates of the attachment position of the uppermost pixel are odd. Thereby, the coordinate of the pasting position of the pixel at the upper end becomes 3. In the example of FIG. 12, the partial image data may be reduced by one pixel in the downward direction so that the coordinate of the uppermost pixel is 5. In addition, when the coordinates of the pasting position of the top pixel of the partial image data before correction are an even number and the coordinates of the pasting position of the bottom pixel are an odd number, the partial image data is not enlarged or reduced. You can simply shift the coordinates of the pasting position.

座標(1,1)を左上端の画素位置と定義した場合において、左端の画素から水平方向に2画素間隔で組を作るとする。このとき、部分画像データの左端の画素のX座標を奇数とし、右端の画素のX座標を偶数とすると、同一の部分画像データの範囲内で組を作ることが可能である。同様に、上端の画素から垂直方向に2画素間隔で組を作るとする。このとき、部分画像データの上端の画素のY座標を奇数とし、下端の画素のY座標を偶数とすると、同一の部分画像データの範囲内で組を作ることが可能である。   When the coordinates (1, 1) are defined as the pixel position at the upper left corner, it is assumed that pairs are formed at intervals of two pixels in the horizontal direction from the leftmost pixel. At this time, if the X coordinate of the leftmost pixel of the partial image data is an odd number and the X coordinate of the rightmost pixel is an even number, it is possible to create a set within the range of the same partial image data. Similarly, it is assumed that pairs are formed at intervals of two pixels in the vertical direction from the upper end pixel. At this time, if the Y coordinate of the uppermost pixel of the partial image data is an odd number and the Y coordinate of the lowermost pixel is an even number, a set can be created within the range of the same partial image data.

以下、本実施形態の効果について説明する。
効果の説明の理解を容易にするためにまず、ダウンサンプリング形式について説明する。画像データに対してマトリクス演算を施してYCデータを生成した場合、図13(a)で示すような各画素がY、Cb、Crの情報を有するYCデータ(YC444形式)が得られる。YC444形式の場合、図13(a)に示すように、Yデータの位置とCbデータ及びCrデータの位置とが完全に一致する。
Hereinafter, the effect of this embodiment will be described.
In order to facilitate understanding of the explanation of the effect, first, the downsampling format will be explained. When YC data is generated by performing matrix calculation on image data, YC data (YC444 format) in which each pixel has Y, Cb, and Cr information as shown in FIG. 13A is obtained. In the case of the YC444 format, as shown in FIG. 13A, the position of the Y data completely matches the positions of the Cb data and the Cr data.

図13(a)に示すようなYC444形式の画像データをそのまま記録媒体228に記録すると容量が大きくなりやすい。このため、通常は、YC形式の画像データを記録するに当たり、Yデータのデータ数に対してCデータのデータ数を少なくするサンプリング処理(ダウンサンプリング)を施す。ここで、Yデータに対してCデータを少なくするのは、人間の目の特性が、輝度に対する感度が高く、色差に対する感度が低い特性を有しているためである。   If image data in the YC444 format as shown in FIG. 13A is recorded on the recording medium 228 as it is, the capacity tends to increase. For this reason, normally, when recording image data in YC format, sampling processing (downsampling) is performed to reduce the number of C data with respect to the number of Y data. Here, the reason why the C data is reduced with respect to the Y data is that the characteristics of the human eye have characteristics that are high in sensitivity to luminance and low in sensitivity to color difference.

図13(b)及び図13(c)は、YC422形式である。本実施形態では、静止画記録時のダウンサンプリング形式にYC422形式を用いる。YC422形式は、Yデータに対してCbデータ及びCrデータを半減させる形式である。YC422形式のダウンサンプリングでは、Cbデータ及びCrデータの左端から2画素単位の組を作成し、各組から1つずつのCbデータ及びCrデータを生成する。   FIG. 13B and FIG. 13C are in the YC422 format. In this embodiment, the YC422 format is used as the downsampling format when recording a still image. The YC422 format is a format that halves Cb data and Cr data with respect to Y data. In the YC422 format downsampling, a pair of 2 pixel units is created from the left end of the Cb data and Cr data, and one Cb data and one Cr data are generated from each pair.

図13(b)は、各組の左側座標のCbデータ及びCrデータを残し、各組の右側座標のCbデータ及びCrデータを破棄している。この場合、Yデータの位置とCb及びCrデータの位置とが一致していると考えることができる。ここで、以下の説明においては、図13(b)の形式をYC422(一致)形式と記す。   In FIG. 13B, the Cb data and Cr data of the left coordinate of each set are left, and the Cb data and Cr data of the right coordinate of each set are discarded. In this case, it can be considered that the position of the Y data matches the position of the Cb and Cr data. Here, in the following description, the format of FIG. 13B is referred to as a YC422 (match) format.

また、図13(c)は、各組のCbデータ及びCrデータをそれぞれ平均して1つにしている。この場合、水平方向に隣接するYデータの中心にCb及びCrデータが位置していると考えることができる。ここで、以下の説明においては、図13(c)の形式をYC422(中心)形式と記す。   In FIG. 13C, each set of Cb data and Cr data is averaged to be one. In this case, it can be considered that Cb and Cr data are located at the center of Y data adjacent in the horizontal direction. Here, in the following description, the format of FIG. 13C is referred to as a YC422 (center) format.

このようなYC422形式の画像データを再生する際には、YC422形式の画像データをYC444形式の画像データに復元する必要がある。YC422(一致)形式を復元する場合には、ダウンサンプリングの際に組とした2画素のうちの破棄していない左側座標のCbデータ及びCrデータを右側座標にコピーする。一方、YC422(中心)を復元する場合には、ダウンサンプリングの際に組とした2画素に平均値をコピーする。   When reproducing such image data in the YC422 format, it is necessary to restore the image data in the YC422 format to image data in the YC444 format. When restoring the YC422 (coincidence) format, Cb data and Cr data of the left coordinates that are not discarded among the two pixels that were paired at the time of downsampling are copied to the right coordinates. On the other hand, when restoring YC422 (center), the average value is copied to the two pixels that were paired during downsampling.

図13(d)及び図13(e)は、YC420形式である。本実施形態では、動画記録時のダウンサンプリング形式にYC420形式を用いる。YC420形式は、Yデータに対してCbデータ及びCrデータを1/4とする形式である。YC420形式のダウンサンプリングでは、Cbデータ及びCrデータの左上端から垂直方向2画素及び水平方向2画素の計4画素単位の組を作成し、各組から1つずつのCbデータ及びCrデータを生成する。   FIG.13 (d) and FIG.13 (e) are YC420 formats. In this embodiment, the YC420 format is used as the downsampling format when recording a moving image. The YC420 format is a format in which Cb data and Cr data are 1/4 with respect to Y data. In YC420 format downsampling, a set of 4 pixels in total, 2 pixels in the vertical direction and 2 pixels in the horizontal direction, is created from the upper left corner of the Cb data and Cr data, and one Cb data and one Cr data are generated from each set To do.

図13(d)は、各組の左上側座標のCbデータ及びCrデータを残し、残りのCbデータ及びCrデータを破棄している。この場合、Yデータの位置とCb及びCrデータの位置とが一致していると考えることができる。以下の説明においては、図13(d)の形式をYC420(一致)形式と記す。   In FIG. 13D, the Cb data and Cr data of the upper left coordinates of each set remain, and the remaining Cb data and Cr data are discarded. In this case, it can be considered that the position of the Y data matches the position of the Cb and Cr data. In the following description, the format of FIG. 13D is referred to as a YC420 (match) format.

また、図13(e)は、YC422(一致)と同様にして水平方向に隣接する2画素のうちの右側座標のCbデータ及びCrデータを破棄しつつ、さらに垂直方向に隣接する2画素をそれぞれ平均して1つにしている。この場合、水平方向に関してはYデータとCbデータ及びCrデータの位置が一致し、垂直方向に関してはYデータの中心にCb及びCrデータが位置していると考えることができる。ここで、以下の説明においては、図13(e)の形式をYC420(動画)形式と記す。   Further, FIG. 13E shows two pixels adjacent in the vertical direction while discarding the right-side coordinate Cb data and Cr data of the two pixels adjacent in the horizontal direction in the same manner as YC422 (match). The average is one. In this case, it can be considered that the positions of Y data, Cb data, and Cr data coincide with each other in the horizontal direction, and that Cb and Cr data are located at the center of the Y data in the vertical direction. Here, in the following description, the format of FIG. 13E is referred to as a YC420 (moving image) format.

このようなYC420形式の画像データを再生する際には、YC420形式の画像データをYC444形式の画像データに復元する必要がある。YC420(一致)形式を復元する場合には、ダウンサンプリングの際に組とした4画素のうちの破棄していない左上座標のCbデータ及びCrデータをその他の3つの座標にコピーする。一方、YC420(動画)を復元する場合には、ダウンサンプリングの際に組とした4画素に平均値をコピーする。   When reproducing such image data in the YC420 format, it is necessary to restore the image data in the YC420 format to image data in the YC444 format. When restoring the YC420 (coincidence) format, the Cb data and Cr data of the upper left coordinates that have not been discarded among the four pixels that were paired at the time of downsampling are copied to the other three coordinates. On the other hand, when restoring YC420 (moving image), the average value is copied to the four pixels that were paired during downsampling.

図14は、部分画像データの貼り付け位置の座標の補正をしない場合の画像再生について示す図である。ここで、図14の例は、YC422(一致)形式でダウンサンプリングを行った画像データを再生する例を示している。   FIG. 14 is a diagram showing image reproduction when the coordinates of the pasting position of the partial image data are not corrected. Here, the example of FIG. 14 shows an example of reproducing image data that has been down-sampled in the YC422 (match) format.

図14(a)は、ダウンサンプリング前のYC444形式の画像データを示している。前述したように、YC422(形式)のダウンサンプリングの際には、図14(a)で示した画素を水平方向2画素間隔の組に分ける。このとき、貼り付け位置の補正が行われていない場合には、Cbデータ及びCrデータの中で水平方向2画素の値が大きく異なる組が生じる可能性がある。図14(a)の例では、3列目と4列目の組がこのような組に対応している。このような組は、背景画像データと部分画像データとの境界部分等の隣接する画素間の相関が無い組であり、原点座標を(1,1)とした場合に、部分画像データの左端の貼り付け位置の座標が偶数である場合又は右端の貼り付け位置が奇数である場合にこのような組が生じる。   FIG. 14A shows image data in YC444 format before downsampling. As described above, at the time of YC422 (format) downsampling, the pixels shown in FIG. 14A are divided into sets of two-pixel intervals in the horizontal direction. At this time, when the pasting position is not corrected, there is a possibility that a pair of Cb data and Cr data having greatly different values of two pixels in the horizontal direction is generated. In the example of FIG. 14A, the groups in the third column and the fourth column correspond to such groups. Such a set is a set having no correlation between adjacent pixels such as a boundary portion between the background image data and the partial image data. When the origin coordinates are (1, 1), the left end of the partial image data. Such a group occurs when the coordinates of the pasting position are even numbers or when the pasting position at the right end is an odd number.

図14(a)に示す画像データを、YC422(一致)形式でダウンサンプリングした場合、図14(b)に示す画像データが得られる。図14(b)に示すように、Yデータは、図14(a)と同一のデータである。一方、Cbデータ及びCrデータは、水平方向2画素間隔の組のうち、左側座標のデータが残り、右側座標のデータが破棄される。   When the image data shown in FIG. 14A is down-sampled in the YC422 (coincidence) format, the image data shown in FIG. 14B is obtained. As shown in FIG. 14B, the Y data is the same data as FIG. On the other hand, as for Cb data and Cr data, left coordinate data remains in the set of two pixel intervals in the horizontal direction, and right coordinate data is discarded.

再生のために、図14(b)に示す画像データをYC444形式に復元すると、図14(c)に示す画像データが得られる。ここで、図14(c)の4列目のCbデータ及びCrデータは、3列目のデータをコピーしたものであり、この3列目のデータは、図14(a)の4列目のデータと大きく異なるものである。このため、図14(c)の4列目のCbデータ及びCrデータも、図14(a)の4列目のCbデータ及びCrデータと大きく異なるものとなる。図14(a)の4列目のYCデータは、RGBに変換すると黒色を示す。これに対し、図14(c)の4列目のYCデータは、RGBに変換すると暗い赤色を示す。このような画像データを再生すると、本来、黒色の表示がなされるべき画素で赤色の表示がなされ、ユーザに違和感を与えることになる。   For reproduction, when the image data shown in FIG. 14B is restored to the YC444 format, the image data shown in FIG. 14C is obtained. Here, the Cb data and Cr data in the fourth column in FIG. 14C are a copy of the data in the third column, and the data in the third column is the fourth column in FIG. It is very different from the data. For this reason, the Cb data and Cr data in the fourth column in FIG. 14C are also significantly different from the Cb data and Cr data in the fourth column in FIG. The YC data in the fourth column in FIG. 14A shows black when converted to RGB. On the other hand, the YC data in the fourth column in FIG. 14C shows dark red when converted to RGB. When such image data is reproduced, a red display is made at a pixel that should originally be displayed in black, and the user feels uncomfortable.

図15は、貼り付け位置の座標の補正をした場合の画像再生について示す図である。図15の例も、YC422(一致)形式でダウンサンプリングを行った場合を示している。   FIG. 15 is a diagram illustrating image reproduction when the coordinates of the pasting position are corrected. The example of FIG. 15 also shows a case where downsampling is performed in the YC422 (match) format.

図15(a)は、ダウンサンプリング前のYC444形式の画像データを示している。本実施形態では、原点座標を(1,1)とした場合に、部分画像データの左端の貼り付け位置の座標を奇数とし、部分画像データの右端の貼り付け位置の座標を偶数とするように貼り付け位置のX座標を補正している。このようにして貼り付け位置を補正することにより、同一の部分画像データ内で水平方向2画素間隔の組を作ることが可能である。同一の部分画像データ内であれば隣接する画素の相関が高いと考えられる。したがって、Cbデータ及びCrデータの中で水平方向2画素の値が大きく異なる組が生じる可能性を低減することが可能である。   FIG. 15A shows image data in YC444 format before downsampling. In the present embodiment, when the origin coordinates are (1, 1), the coordinates of the leftmost pasting position of the partial image data are set to odd numbers, and the coordinates of the rightmost pasting position of the partial image data are set to even numbers. The X coordinate of the pasting position is corrected. By correcting the pasting position in this way, it is possible to create a set of two pixel intervals in the horizontal direction within the same partial image data. If within the same partial image data, it is considered that the correlation between adjacent pixels is high. Therefore, it is possible to reduce the possibility that a pair having a significantly different value of two horizontal pixels in Cb data and Cr data will be generated.

図15(a)に示す画像データを、YC422(一致)形式でダウンサンプリングした場合、図15(b)に示す画像データが得られる。図15(b)に示すように、Yデータは、図15(a)と同一のデータとなる。一方、Cbデータ及びCrデータは、水平方向2画素間隔の組のうち、左側座標のデータのみが残り、右側座標のデータが破棄される。   When the image data shown in FIG. 15A is down-sampled in the YC422 (coincidence) format, the image data shown in FIG. 15B is obtained. As shown in FIG. 15B, the Y data is the same data as FIG. On the other hand, as for the Cb data and Cr data, only the left coordinate data remains in the set of two pixel intervals in the horizontal direction, and the right coordinate data is discarded.

再生のために、図15(b)に示す画像データをYC444形式に復元すると、図15(c)に示す画像データが得られる。ここで、図15(c)の4列目のCbデータ及びCrデータは、3列目のデータをコピーしたものであり、この3列目のデータは、図15(a)の4列目のデータとの相関が高いデータである。このような画像データを再生すると、黒色の表示がなされるべき画素で正しく黒色の表示がなされ、ユーザに違和感を与えることがない。   When the image data shown in FIG. 15B is restored to the YC444 format for reproduction, the image data shown in FIG. 15C is obtained. Here, the Cb data and Cr data in the fourth column in FIG. 15C are a copy of the data in the third column, and the data in the third column is the fourth column in FIG. 15A. The data is highly correlated with the data. When such image data is reproduced, the pixels that should be displayed in black are correctly displayed in black, and the user does not feel uncomfortable.

ここで、図14及び図15は、YC422(一致)形式を例にしているが、その他の形式でダウンサンプリングを行った場合にも、図14及び図15を参照して行った説明が適用される。例えば、YC420(一致)形式の場合、復元時には、組となる4画素のうちの左上端の画素のデータが、他の3画素にコピーされる。したがって、左上端の画素に対して相関が低い画素があると、その相関の低い画素のCデータは、復元の前後での差異が大きくなる。このような画像を表示させると、ユーザに違和感を与える。また、YC422(中心)やYC420(動画)形式の場合、復元時には組となる画素のデータの平均値が各組の画素にコピーされる。この場合、組となる4画素の相関が低いと、組となる全ての画素のCデータが復元の前後での差異が大きくなる可能性がある。これに対し、本実施形態では、組となる画素の相関を高くすることが可能であるので、ダウンサンプリングの形式によらずにユーザに対して違和感のない再生を行うことが可能である。   Here, FIGS. 14 and 15 exemplify the YC422 (coincidence) format, but the description given with reference to FIGS. 14 and 15 is also applied when downsampling is performed in other formats. The For example, in the case of the YC420 (match) format, at the time of restoration, the data of the upper left pixel of the four pixels forming a set is copied to the other three pixels. Therefore, if there is a pixel having a low correlation with respect to the upper left pixel, the difference between the C data of the low correlation pixel before and after the restoration becomes large. When such an image is displayed, the user feels uncomfortable. In the case of the YC422 (center) or YC420 (moving image) format, the average value of the data of a pair of pixels is copied to each pair of pixels at the time of restoration. In this case, if the correlation of the four pixels constituting the set is low, the difference between the C data of all the pixels constituting the set before and after the restoration may increase. On the other hand, in this embodiment, it is possible to increase the correlation of the pixels that form a pair, so that it is possible to perform reproduction without feeling uncomfortable for the user regardless of the downsampling format.

以上説明したように、本実施形態によれば、インデックス画像データ、モザイク画像データ、ランダムタイル画像データといった、複数の部分画像データを合成して(貼り付けて)構成される合成画像データを生成する際に、部分画像データの貼り付け位置の座標又は部分画像データのサイズを補正するようにしている。これにより、同一の部分画像データ内の画素でダウンサンプリング及びアップサンプリングを行うことができる。したがって、ダウンサンプリングとアップサンプリングとの間での色差データの差異を少なくして画像再生の際の違和感を低減させることが可能である。   As described above, according to the present embodiment, composite image data configured by combining (pasting) a plurality of partial image data such as index image data, mosaic image data, and random tile image data is generated. At this time, the coordinates of the pasting position of the partial image data or the size of the partial image data is corrected. Thereby, downsampling and upsampling can be performed with pixels in the same partial image data. Therefore, it is possible to reduce the difference in color difference data between downsampling and upsampling, and to reduce the uncomfortable feeling during image reproduction.

[変形例]
以下、本発明の変形例について説明する。
まず、前述の例では、YCデータを例としているが、別の色空間のデータであっても本実施形態の手法を適用することができる。例えば、HD規格では、RGBの画像データを、輝度(Y)と色差(Pb、Pr)に変換している。この場合にも、YCデータと同様のダウンサンプリングが行われるので、本実施形態の技術は有効である。
[Modification]
Hereinafter, modifications of the present invention will be described.
First, in the above example, YC data is taken as an example, but the method of this embodiment can be applied even to data in another color space. For example, in the HD standard, RGB image data is converted into luminance (Y) and color differences (Pb, Pr). Also in this case, since the same downsampling as YC data is performed, the technique of this embodiment is effective.

また、前述した例では、原点座標に近い側の端の座標を奇数とし、原点座標に遠い側の端の座標を偶数とするように貼り付け位置の座標の補正をしている。これは、原点座標が奇数であるためである。原点座標が偶数(例えば(0,0))である場合には、原点座標に近い側の端の座標を偶数とし、原点座標に遠い側の端の座標を奇数とするように貼り付け位置の座標の補正をする。   In the above-described example, the coordinates of the pasting position are corrected so that the coordinates of the end closer to the origin coordinates are odd numbers and the coordinates of the end far from the origin coordinates are even numbers. This is because the origin coordinates are odd numbers. If the origin coordinates are even (for example, (0, 0)), the coordinates of the pasting position are set so that the coordinates of the end closer to the origin coordinates are even and the coordinates of the end far from the origin coordinates are odd. Correct the coordinates.

また、前述した例は、画像データを水平方向又は垂直方向に2画素間隔の組に分けてダウンサンプリングを行う例について説明している。実際には、本実施形態の技術は、画像データを垂直方向にm画素(mは2以上の整数)間隔又は水平方向にn画素間隔(nは2以上の整数)の組に分けてダウンサンプリングを行う場合に対して適用可能である。この場合、部分画像データの貼り付け位置のX座標は、原点座標を(1,1)とした場合に、左端の貼り付け位置の座標が1+n×i(iは0以上の整数))となり、右端の貼り付け位置の座標がn×j(jは1以上の整数))となるように補正する。また、部分画像データの貼り付け位置のY座標は、原点座標を(1,1)とした場合に上端の貼り付け位置の座標が1+m×i(iは0以上の整数))となり、下端の貼り付け位置の座標がm×j(jは1以上の整数))となるように補正する。   The above-described example describes an example in which image data is down-sampled by dividing it into sets of two-pixel intervals in the horizontal direction or the vertical direction. In practice, the technique of the present embodiment down-samples image data by dividing the image data into groups of m pixels in the vertical direction (m is an integer of 2 or more) or n pixels in the horizontal direction (n is an integer of 2 or more). It is applicable to the case where In this case, the X coordinate of the pasting position of the partial image data is 1 + n × i (i is an integer of 0 or more) when the origin coordinate is (1, 1). Correction is made so that the coordinates of the paste position on the right end are n × j (j is an integer of 1 or more). Further, the Y coordinate of the pasting position of the partial image data is 1 + m × i (i is an integer of 0 or more) when the origin coordinate is (1, 1), and the lower end Correction is performed so that the coordinates of the pasting position are m × j (j is an integer of 1 or more).

また、前述の実施形態では、画像サンプリング部223を独立したブロックとして設けるようにしている。これに対し、画像サンプリング部223を画像処理部218内に設けたり、表示ドライバ220内に設けたりしても良い。   In the above-described embodiment, the image sampling unit 223 is provided as an independent block. On the other hand, the image sampling unit 223 may be provided in the image processing unit 218 or in the display driver 220.

また、前述の実施形態では、貼り付け位置のX座標(水平方向)及びY座標(垂直方向)を補正している。これは、画素の配列方向が水平方向及び垂直方向に沿った方向であるためである。画素の配列方向が斜め方向の撮像素子204や表示部222等を用いる場合には、貼り付け位置の補正方向も画素の配列方向に沿った斜め方向とする。   In the above-described embodiment, the X coordinate (horizontal direction) and Y coordinate (vertical direction) of the pasting position are corrected. This is because the arrangement direction of the pixels is a direction along the horizontal direction and the vertical direction. In the case of using the image sensor 204 or the display unit 222 in which the pixel arrangement direction is oblique, the correction direction of the attachment position is also an oblique direction along the pixel arrangement direction.

さらに、上述した実施形態における画像処理装置による各処理の手法、即ち、各フローチャートに示す処理は、何れもマイクロコンピュータ230に実行させることができるプログラムとして記憶させておくこともできる。この他、メモリカード(ROMカード、RAMカード等)、磁気ディスク(フロッピディスク、ハードディスク等)、光ディスク(CD−ROM、DVD等)、半導体メモリ等の外部記憶装置の記憶媒体に格納して配布することができる。そして、マイクロコンピュータ230は、この外部記憶装置の記憶媒体に記憶されたプログラムを読み込み、この読み込んだプログラムによって動作が制御されることにより、上述した処理を実行することができる。   Furthermore, each processing method performed by the image processing apparatus in the above-described embodiment, that is, the processing shown in each flowchart can be stored as a program that can be executed by the microcomputer 230. In addition, memory cards (ROM cards, RAM cards, etc.), magnetic disks (floppy disks, hard disks, etc.), optical disks (CD-ROM, DVD, etc.), storage media of external storage devices such as semiconductor memories, etc. are distributed. be able to. The microcomputer 230 reads the program stored in the storage medium of the external storage device, and the operation is controlled by the read program, so that the above-described processing can be executed.

以上実施形態に基づいて本発明を説明したが、本発明は上述した実施形態に限定されるものではなく、本発明の要旨の範囲内で種々の変形や応用が可能なことは勿論である。また、前述の各動作フローチャートの説明において、便宜上「まず」、「次に」等を用いて動作を説明しているが、この順で動作を実施することが必須であることを意味するものではない。   Although the present invention has been described above based on the embodiments, the present invention is not limited to the above-described embodiments, and various modifications and applications are naturally possible within the scope of the gist of the present invention. Further, in the description of each operation flowchart described above, the operation is described using “first”, “next”, and the like for convenience, but this does not mean that it is essential to perform the operations in this order. Absent.

さらに、上記した実施形態には種々の段階の発明が含まれており、開示される複数の構成要件の適当な組合せにより種々の発明が抽出され得る。例えば、実施形態に示される全構成要件からいくつかの構成要件が削除されても、上述したような課題を解決でき、上述したような効果が得られる場合には、この構成要件が削除された構成も発明として抽出され得る。   Further, the above-described embodiments include various stages of the invention, and various inventions can be extracted by appropriately combining a plurality of disclosed constituent elements. For example, even if some configuration requirements are deleted from all the configuration requirements shown in the embodiment, the above-described problem can be solved, and this configuration requirement is deleted when the above-described effects can be obtained. The configuration can also be extracted as an invention.

1…デジタルカメラ、100…交換式レンズ、102…レンズ、104…絞り、106…ドライバ、108…マイクロコンピュータ、110…Flashメモリ、112…インターフェイス(I/F)、200…カメラ本体、202…メカシャッタ、204…撮像素子、206…アナログ処理部、208…アナログ/デジタル(A/D)変換部、210…バス、212…SDRAM、214…AE処理部、216…AF処理部、218…画像処理部、220…表示ドライバ、222…表示部、223…画像サンプリング部、224…画像圧縮伸張部、226…メモリインターフェイス(I/F)、228…記録媒体、230…マイクロコンピュータ、232…操作部、234…Flashメモリ、2181…基本画像処理部、2182…特殊効果画像処理部   DESCRIPTION OF SYMBOLS 1 ... Digital camera, 100 ... Interchangeable lens, 102 ... Lens, 104 ... Aperture, 106 ... Driver, 108 ... Microcomputer, 110 ... Flash memory, 112 ... Interface (I / F), 200 ... Camera body, 202 ... Mechanical shutter , 204... Image sensor, 206. Analog processing unit, 208. Analog / digital (A / D) conversion unit, 210. Bus, 212. SDRAM, 214. AE processing unit, 216 ... AF processing unit, 218. , 220 ... Display driver, 222 ... Display unit, 223 ... Image sampling unit, 224 ... Image compression / decompression unit, 226 ... Memory interface (I / F), 228 ... Recording medium, 230 ... Microcomputer, 232 ... Operation unit, 234 ... Flash memory, 2181 ... Basic image processing unit, 2182 ... Special effect picture Image processing unit

Claims (12)

背景画像データに対して、水平方向又は垂直方向の一方向に直線状の境界を有する部分画像データを貼り付けて合成画像データを生成する画像合成部と、
前記合成画像データを生成する際の、前記部分画像データの境界の前記背景画像データにおける位置を決定する境界位置決定部と、
前記合成画像データに対し、前記合成画像データの輝度成分のデータ数よりも前記合成画像データの色差成分のデータ数を少なくするサンプリング処理を施す画像サンプリング部と、
を具備し、
前記境界位置決定部は、前記画像サンプリング部によるサンプリング処理の方式に応じて、前記部分画像データを拡大又は縮小することにより前記境界の位置を補正することを特徴とする画像処理装置。
An image composition unit for generating composite image data by pasting partial image data having a linear boundary in one direction in the horizontal direction or the vertical direction with respect to the background image data;
A boundary position determination unit that determines a position of the boundary of the partial image data in the background image data when generating the composite image data;
An image sampling unit that performs a sampling process on the composite image data to reduce the number of color difference components of the composite image data from the number of luminance components of the composite image data;
Comprising
The image processing apparatus according to claim 1, wherein the boundary position determination unit corrects the position of the boundary by enlarging or reducing the partial image data in accordance with a sampling process performed by the image sampling unit.
前記境界位置決定部は、前記合成画像データの輝度成分のデータ数よりも前記合成画像データの色差成分のデータ数を少なくするサンプリング処理が施された前記合成画像データに対し、前記合成画像データの輝度成分のデータ数と前記合成画像データの色差成分のデータ数とを同じにする復元処理を行った場合に、前記サンプリング処理の前の画像データと前記復元処理の後の画像データとの間で色差成分の差異が小さくなるように、前記境界の位置を補正することを特徴とする請求項1に記載の画像処理装置。   The boundary position determination unit performs the sampling process on the composite image data that has been subjected to the sampling process for reducing the number of color difference components of the composite image data than the number of luminance components of the composite image data. When restoration processing is performed to make the number of luminance component data and the number of color difference components of the composite image data the same, between the image data before the sampling processing and the image data after the restoration processing The image processing apparatus according to claim 1, wherein the position of the boundary is corrected so that a difference in color difference components is reduced. 前記境界位置決定部は、前記サンプリング処理の方式が、前記合成画像データの水平方向の色差成分を、前記合成画像データの水平方向の輝度成分のデータ数の1/n(nは2以上の整数)に減らす方式であって、前記境界が垂直方向に沿った直線状の境界である場合に、前記部分画像データの水平方向でn画素間隔の組が作られるように前記境界の位置を補正することを特徴とする請求項1又は2に記載の画像処理装置。   In the boundary position determination unit, the sampling processing method uses a horizontal color difference component of the composite image data as 1 / n of the number of horizontal luminance components of the composite image data (n is an integer of 2 or more). When the boundary is a linear boundary along the vertical direction, the position of the boundary is corrected so that a set of n pixel intervals is formed in the horizontal direction of the partial image data. The image processing apparatus according to claim 1, wherein the image processing apparatus is an image processing apparatus. 前記境界位置決定部は、前記背景画像データにおける左端原点を1とした場合に、前記部分画像データにおける左端の前記境界の位置を、1+n×i(iは0以上の整数)の座標とするように補正することを特徴とする請求項3に記載の画像処理装置。   When the left end origin in the background image data is 1, the boundary position determination unit sets the position of the left end of the partial image data as coordinates of 1 + n × i (i is an integer of 0 or more). The image processing apparatus according to claim 3, wherein the correction is performed as follows. 前記境界位置決定部は、前記背景画像データにおける左端原点を1とした場合に、前記部分画像データにおける右端の前記境界の位置を、n×j(jは1以上の整数)の座標とするように補正することを特徴とする請求項3に記載の画像処理装置。   The boundary position determination unit sets the position of the boundary at the right end in the partial image data to coordinates of n × j (j is an integer of 1 or more) when the left end origin in the background image data is 1. The image processing apparatus according to claim 3, wherein the correction is performed as follows. 前記境界位置決定部は、前記サンプリング処理の方式が、前記合成画像データの垂直方向の色差成分を、前記合成画像データの垂直方向の輝度成分のデータ数の1/m(mは2以上の整数)に減らす方式であって、前記境界が水平方向に沿った直線状の境界である場合に、前記部分画像データの垂直方向でm画素間隔の組が作られるように前記境界の位置を補正することを特徴とする請求項1乃至5の何れか1項に記載の画像処理装置。   In the boundary position determination unit, the sampling processing method may be configured such that the color difference component in the vertical direction of the composite image data is 1 / m (m is an integer of 2 or more) of the number of luminance components in the vertical direction of the composite image data. When the boundary is a linear boundary along the horizontal direction, the position of the boundary is corrected so that a set of m pixel intervals is formed in the vertical direction of the partial image data. The image processing apparatus according to claim 1, wherein the image processing apparatus is an image processing apparatus. 前記境界位置決定部は、前記背景画像データにおける上端原点を1とした場合に、前記部分画像データにおける上端の前記境界の位置を、1+m×i(iは0以上の整数)の座標とするように補正することを特徴とする請求項6に記載の画像処理装置。   The boundary position determination unit sets the position of the boundary at the upper end in the partial image data as coordinates of 1 + m × i (i is an integer equal to or greater than 0) when the upper end origin in the background image data is 1. The image processing apparatus according to claim 6, wherein the correction is performed as follows. 前記境界位置決定部は、前記背景画像データにおける上端原点を1とした場合に、前記部分画像データにおける下端の前記境界の位置を、m×j(jは1以上の整数)の座標とするように補正することを特徴とする請求項6に記載の画像処理装置。   The boundary position determination unit sets the position of the boundary at the lower end in the partial image data as coordinates of m × j (j is an integer equal to or greater than 1) when the upper end origin in the background image data is 1. The image processing apparatus according to claim 6, wherein the correction is performed as follows. 前記画像合成部は、複数の前記部分画像データを前記背景画像データに合成することを特徴とする請求項1乃至8の何れか1項に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the image synthesis unit synthesizes a plurality of partial image data with the background image data. 請求項1乃至9の何れか1項に記載の画像処理装置を備えた撮像装置。   An imaging apparatus comprising the image processing apparatus according to claim 1. 画像合成部が、背景画像データに対して、水平方向又は垂直方向の一方向に直線状の境界を有する部分画像データを貼り付けて合成画像データを生成し、
境界位置決定部が、前記合成画像データを生成する際の、前記部分画像データの境界の前記背景画像データにおける位置を決定し、
前記境界位置決定部が、画像サンプリング部によるサンプリング処理の方式に応じて、前記部分画像データを拡大又は縮小することにより前記境界の位置を補正し、
前記画像サンプリング部が、前記合成画像データに対し、前記合成画像データの輝度成分のデータ数よりも前記合成画像データの色差成分のデータ数を少なくするサンプリング処理を施す、
ことを特徴とする画像処理方法。
The image composition unit generates the composite image data by pasting the partial image data having a linear boundary in one direction in the horizontal direction or the vertical direction with respect to the background image data,
The boundary position determination unit determines the position of the boundary of the partial image data in the background image data when generating the composite image data;
The boundary position determination unit corrects the position of the boundary by enlarging or reducing the partial image data according to a sampling processing method by the image sampling unit,
The image sampling unit performs a sampling process on the composite image data so that the number of color difference components of the composite image data is less than the number of luminance components of the composite image data.
An image processing method.
画像合成部に、背景画像データに対して、水平方向又は垂直方向の一方向に直線状の境界を有する部分画像データを貼り付けて合成画像データを生成させる手順と、
境界位置決定部に、前記合成画像データを生成する際の、前記部分画像データの境界の前記背景画像データにおける位置を決定させる手順と、
前記境界位置決定部に、画像サンプリング部によるサンプリング処理の方式に応じて、前記部分画像データを拡大又は縮小することにより前記境界の位置を補正させる手順と、
前記画像サンプリング部に、前記合成画像データに対し、前記合成画像データの輝度成分のデータ数よりも前記合成画像データの色差成分のデータ数を少なくするサンプリング処理を施させる手順と、
をコンピュータに実行させる画像処理プログラム。
A procedure for pasting partial image data having a linear boundary in one direction in the horizontal direction or the vertical direction with respect to the background image data in the image composition unit to generate composite image data;
A procedure for causing the boundary position determination unit to determine the position of the boundary of the partial image data in the background image data when generating the composite image data;
A procedure for causing the boundary position determination unit to correct the position of the boundary by enlarging or reducing the partial image data according to a sampling processing method by the image sampling unit;
A procedure for causing the image sampling unit to perform a sampling process for reducing the number of color difference components of the composite image data relative to the number of luminance components of the composite image data with respect to the composite image data;
An image processing program for causing a computer to execute.
JP2011284171A 2011-12-26 2011-12-26 Image processing apparatus, imaging apparatus including the same, image processing method, and image processing program Active JP5836109B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011284171A JP5836109B2 (en) 2011-12-26 2011-12-26 Image processing apparatus, imaging apparatus including the same, image processing method, and image processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011284171A JP5836109B2 (en) 2011-12-26 2011-12-26 Image processing apparatus, imaging apparatus including the same, image processing method, and image processing program

Publications (2)

Publication Number Publication Date
JP2013135322A JP2013135322A (en) 2013-07-08
JP5836109B2 true JP5836109B2 (en) 2015-12-24

Family

ID=48911746

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011284171A Active JP5836109B2 (en) 2011-12-26 2011-12-26 Image processing apparatus, imaging apparatus including the same, image processing method, and image processing program

Country Status (1)

Country Link
JP (1) JP5836109B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7002056B2 (en) * 2016-09-12 2022-02-10 パナソニックIpマネジメント株式会社 3D model generator and 3D model generation method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3392474B2 (en) * 1992-10-02 2003-03-31 株式会社東芝 Image processing device including cut and paste editing
JP2011054080A (en) * 2009-09-04 2011-03-17 Sony Corp Image processing apparatus, method and program

Also Published As

Publication number Publication date
JP2013135322A (en) 2013-07-08

Similar Documents

Publication Publication Date Title
JP5186021B2 (en) Imaging apparatus, image processing apparatus, and imaging method
JP2009053748A (en) Image processing apparatus, image processing program, and camera
US9684988B2 (en) Imaging device, image processing method, and recording medium
JP5132495B2 (en) Imaging apparatus and image processing method
JP2007281546A (en) Imaging apparatus and imaging method
US9402037B2 (en) Imaging apparatus, image processing apparatus, and image processing method for generating random special effects
TW201120810A (en) Image processing apparatus, image processing method, and storage medium
JP6137800B2 (en) Image processing apparatus, image processing method, and image processing program
JP2014017579A (en) Imaging device, image processing method, and image processing program
JP5185085B2 (en) Image processing apparatus, image processing method, and image processing program
JP6929711B2 (en) Image processing device, image processing method, image processing program
JP5836109B2 (en) Image processing apparatus, imaging apparatus including the same, image processing method, and image processing program
US9171358B2 (en) Image editing device and image editing method
JP6091311B2 (en) Imaging device
JP2004287794A (en) Image processor
JP2010283504A (en) Imaging device, imaging method, and imaging program
JP5530304B2 (en) Imaging apparatus and captured image display method
JP2006319524A (en) Image sensing device
JP2005229280A (en) Image processing apparatus and method, and program
JP5185027B2 (en) Image display device, imaging device, image display method, and imaging method
JP5191941B2 (en) Imaging apparatus, image processing apparatus, image processing method, and image processing program
JP4133179B2 (en) Image signal processing device
JP5878063B2 (en) Imaging apparatus, imaging method, and imaging program
JP5653665B2 (en) Image processing apparatus, photographing apparatus, image processing method, and image processing program
JP5094686B2 (en) Image processing apparatus, image processing method, and image processing program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20141010

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20150423

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20150812

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20150818

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150918

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20151102

R151 Written notification of patent or utility model registration

Ref document number: 5836109

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313113

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250