本発明の実施の形態を、添付の図面を参照して以下に詳細に説明するが、本発明は、以下の実施形態に限定されるものではない。
Embodiments of the present invention will be described below in detail with reference to the accompanying drawings, but the present invention is not limited to the following embodiments.
[第1実施形態]
第1実施形態による画像処理装置及び画像処理方法について、図面を参照して詳細に説明する。図1は、本実施形態による画像処理装置を示す外観図である。本実施形態による画像処理装置100は、撮影レンズ111(図2参照)によって撮像部112(図2参照)の画素アレイ(図示せず)に結像される被写体像を、操作部104を介してユーザによって行われる撮影指示に応じて撮影する。また、本実施形態による画像処理装置100は、撮像部112によって取得される画像、即ち、画像データを符号化することによって、画像データのサイズを圧縮する。画像処理装置100によって符号化された画像データは、例えば、着脱式の不揮発性の記録媒体120(図2参照)に記録されてもよいし、無線通信等を用いて外部機器127に転送されてもよい。この場合、外部機器127としては、画像ファイルを記録し得る機器等が挙げられる。また、本実施形態による画像処理装置100は、撮影済みの画像や、撮影前のプレビュー画像等を表示部116の表示画面125に表示し得る。
[First Embodiment]
The image processing apparatus and the image processing method according to the first embodiment will be described in detail with reference to the drawings. FIG. 1 is an external view showing the image processing apparatus according to the present embodiment. The image processing apparatus 100 according to the present embodiment causes a subject image formed on a pixel array (not shown) of the imaging unit 112 (see FIG. 2) by the photographing lens 111 (see FIG. 2) via the operation unit 104. Shooting is performed according to a shooting instruction given by the user. Further, the image processing apparatus 100 according to the present embodiment compresses the size of the image data by encoding the image acquired by the imaging unit 112, that is, the image data. The image data encoded by the image processing apparatus 100 may be recorded on, for example, a removable nonvolatile recording medium 120 (see FIG. 2), or transferred to the external device 127 using wireless communication or the like. Also good. In this case, examples of the external device 127 include a device that can record an image file. Further, the image processing apparatus 100 according to the present embodiment can display a captured image, a preview image before photographing, and the like on the display screen 125 of the display unit 116.
本実施形態による画像処理装置100、即ち、画像符号化装置は、撮像部(取得手段、撮像手段、撮像素子、イメージセンサ)112の姿勢(傾き)とは無関係に、縦長の画像、即ち、縦画像を常に撮影する縦撮影モード(縦画像撮影モード)を備えている。縦撮影モードにおいては、撮像部112が横長に保持されている場合であっても、縦長に保持されている場合であっても、縦長の画像が少なくとも取得される。本実施形態による画像処理装置100は、縦撮影モードにおいては、撮像部112によって順次取得されるプレビュー画像が、表示部116の表示画面125に表示される。また、縦撮影モードにおいては、撮像部112によって取得される画像の少なくとも一部を選択する選択領域122が、表示部116の表示画面125に表示される。所望の縦長の画像を得ることができるように、選択領域122は例えば縦長の矩形に設定される。選択領域122は、後述するように、変更可能である。より具体的には、選択領域122は、後述するように、移動、拡大、縮小等が可能である。縦撮影モードにおいて、本実施形態による画像処理装置100は、縦長の画像、即ち、縦画像のみならず、横長の画像、即ち、横画像をも同時に取得し得る。
The image processing apparatus 100 according to the present embodiment, that is, the image encoding apparatus, has a vertically long image, that is, a vertical image, regardless of the attitude (inclination) of the imaging unit (acquisition unit, imaging unit, imaging element, image sensor) 112. It has a vertical shooting mode (vertical image shooting mode) that always takes images. In the vertical photographing mode, at least a vertically long image is acquired regardless of whether the imaging unit 112 is held horizontally or vertically. In the image processing apparatus 100 according to the present embodiment, the preview images sequentially acquired by the imaging unit 112 are displayed on the display screen 125 of the display unit 116 in the vertical shooting mode. In the vertical shooting mode, a selection area 122 for selecting at least a part of an image acquired by the imaging unit 112 is displayed on the display screen 125 of the display unit 116. The selection area 122 is set to a vertically long rectangle, for example, so that a desired vertically long image can be obtained. The selection area 122 can be changed as will be described later. More specifically, the selection area 122 can be moved, enlarged, reduced, etc., as will be described later. In the vertical shooting mode, the image processing apparatus 100 according to the present embodiment can simultaneously acquire not only a vertically long image, that is, a vertical image but also a horizontally long image, that is, a horizontal image.
本実施形態による画像処理装置100のボディ(筐体、本体)123には、各種の操作ボタン等を含む操作部104が備えられている。ユーザは、これらの操作ボタンを適宜操作することによって、動画像の撮影の指示、静止画像の撮影の指示、撮影モードの変更、撮影済みの画像の表示等を行い得る。なお、ここでは、本実施形態による画像処理装置100が、撮像装置、具体的には、デジタルスチルカメラである場合を例に説明するが、これに限定されるものではない。例えば、画像処理装置100は、スマートフォン、カメラ付き携帯電話、デジタルビデオカメラ等であってもよい。
The body (housing, main body) 123 of the image processing apparatus 100 according to the present embodiment includes an operation unit 104 including various operation buttons. By appropriately operating these operation buttons, the user can perform an instruction to shoot a moving image, an instruction to shoot a still image, change a shooting mode, display a shot image, and the like. Here, the case where the image processing apparatus 100 according to the present embodiment is an imaging apparatus, specifically, a digital still camera will be described as an example, but the present invention is not limited thereto. For example, the image processing apparatus 100 may be a smartphone, a mobile phone with a camera, a digital video camera, or the like.
図2は、本実施形態による画像処理装置100を示すブロック図である。図2に示すように、本実施形態による画像処理装置100は、CPU101と、メモリ102と、不揮発性メモリ103と、操作部104と、撮像部112と、画像処理部113と、符号化処理部114と、表示制御部115と、表示部116とを有している。更に、本実施形態による画像処理装置100は、通信制御部117と、通信部118と、記録媒体制御部119と、傾き検知部121と、内部バス130とを有している。画像処理装置100は、撮影レンズ111を用いて被写体の光学像を撮像部112の画素アレイに結像するが、撮影レンズ111は、画像処理装置100のボディ123から、着脱不能であってもよいし、着脱可能であってもよい。また、画像処理装置100は、記録媒体制御部119を介して画像データの書き込みや読み出しを記録媒体120に対して行うが、かかる記録媒体120は、画像処理装置100から着脱可能であってもよいし、着脱不能であってもよい。
FIG. 2 is a block diagram illustrating the image processing apparatus 100 according to the present embodiment. As shown in FIG. 2, the image processing apparatus 100 according to the present embodiment includes a CPU 101, a memory 102, a nonvolatile memory 103, an operation unit 104, an imaging unit 112, an image processing unit 113, and an encoding processing unit. 114, a display control unit 115, and a display unit 116. Furthermore, the image processing apparatus 100 according to the present embodiment includes a communication control unit 117, a communication unit 118, a recording medium control unit 119, a tilt detection unit 121, and an internal bus 130. The image processing apparatus 100 forms an optical image of a subject on the pixel array of the imaging unit 112 using the photographing lens 111, but the photographing lens 111 may be detachable from the body 123 of the image processing apparatus 100. However, it may be detachable. The image processing apparatus 100 writes and reads image data to and from the recording medium 120 via the recording medium control unit 119. However, the recording medium 120 may be detachable from the image processing apparatus 100. However, it may be non-detachable.
CPU101は、不揮発性メモリ103に記憶されているコンピュータプログラムを実行することによって、内部バス130を介して画像処理装置100の各部(各機能ブロック)の動作を制御する。CPU101は、後述するように、撮像部112によって取得される画像の少なくとも一部を選択する選択領域122を設定する設定手段として機能し得る。また、CPU101、即ち、設定手段は、表示画面125に収まるように選択領域122のサイズを設定する。また、CPU101、即ち、設定手段は、所定条件下では、撮像部112の姿勢が変化した場合であっても、選択領域122のサイズを一定に保持する。また、CPU101、即ち、設定手段は、複数の画像を含むグループ・オブ・ピクチャの切り替わりの際に選択領域122を変更する。また、CPU101、即ち、設定手段は、表示画面125が被写体に向いている場合に、縦撮像モードでの動作、具体的には、選択領域122の設定等を行うようにすることもできる。また、CPU101、即ち、設定手段は、外部機器127との通信が確立されている場合に、縦撮影モードでの動作を行うようにすることもできる。また、CPU101は、ファイル生成手段としても機能し得る。かかるファイル生成手段は、選択領域122に対応するタイル126を順次符号化することによって第1の画像群を生成し得る。また、かかるファイル生成手段は、少なくとも選択領域122以外の領域に対応するタイル126を順次符号化することによって第2の画像群を生成し得る。
The CPU 101 controls the operation of each unit (each functional block) of the image processing apparatus 100 via the internal bus 130 by executing a computer program stored in the nonvolatile memory 103. As will be described later, the CPU 101 can function as a setting unit that sets a selection area 122 for selecting at least a part of an image acquired by the imaging unit 112. In addition, the CPU 101, that is, the setting unit sets the size of the selection area 122 so that it fits on the display screen 125. In addition, the CPU 101, that is, the setting unit, keeps the size of the selection region 122 constant even when the posture of the imaging unit 112 changes under a predetermined condition. In addition, the CPU 101, that is, the setting unit changes the selection area 122 when a group of pictures including a plurality of images is switched. In addition, the CPU 101, that is, the setting unit, can perform the operation in the vertical imaging mode, specifically, the setting of the selection area 122, etc., when the display screen 125 faces the subject. Further, the CPU 101, that is, the setting unit, can perform an operation in the vertical shooting mode when communication with the external device 127 is established. The CPU 101 can also function as a file generation unit. Such file generation means can generate the first image group by sequentially encoding the tiles 126 corresponding to the selected area 122. In addition, the file generation unit can generate the second image group by sequentially encoding the tiles 126 corresponding to at least the area other than the selected area 122.
メモリ102は、書き換え可能な揮発性メモリである。メモリ102は、画像処理装置100の各部の動作を制御するためのコンピュータプログラム、画像処理装置100の各部の動作に関するパラメータ等の情報、通信制御部117によって受信される情報等を一時的に記録する。また、メモリ102は、撮像部112によって取得された画像、画像処理部113や符号化処理部114等によって処理された画像や情報等を一時的に記録する。メモリ102は、これらを一時的に記録するために十分な記憶容量を備えている。
The memory 102 is a rewritable volatile memory. The memory 102 temporarily records a computer program for controlling the operation of each unit of the image processing apparatus 100, information such as parameters relating to the operation of each unit of the image processing apparatus 100, information received by the communication control unit 117, and the like. . The memory 102 temporarily records an image acquired by the imaging unit 112, an image processed by the image processing unit 113, the encoding processing unit 114, and the like, information, and the like. The memory 102 has a sufficient storage capacity for temporarily recording these.
不揮発性メモリ103は、電気的に消去や記録が可能なメモリであり、例えばEEPROM等が用いられる。不揮発性メモリ103は、画像処理装置100の各部の動作を制御するコンピュータプログラムや、画像処理装置100の各部の動作に関するパラメータ等の情報を記憶する。かかるコンピュータプログラムによって、本実施形態による画像処理装置100によって行われる各種動作が実現される。
The nonvolatile memory 103 is an electrically erasable and recordable memory. For example, an EEPROM or the like is used. The nonvolatile memory 103 stores information such as a computer program that controls the operation of each unit of the image processing apparatus 100 and parameters related to the operation of each unit of the image processing apparatus 100. By such a computer program, various operations performed by the image processing apparatus 100 according to the present embodiment are realized.
操作部104は、画像処理装置100を操作するためのユーザインターフェースを提供する。操作部104は、電源ボタン、メニューボタン、シャッターボタン等の各種ボタンを含んでおり、各種ボタンはスイッチやタッチパネル等により構成される。CPU101は、操作部104を介して入力されたユーザの指示に従って画像処理装置100を制御する。なお、ここでは、操作部104を介して入力される操作に基づいてCPU101が画像処理装置100を制御する場合を例に説明したが、これに限定されるものではない。例えば、不図示のリモートコントローラや不図示の携帯端末等から通信部118を介して入力される要求に基づいて、CPU101が画像処理装置100を制御してもよい。
The operation unit 104 provides a user interface for operating the image processing apparatus 100. The operation unit 104 includes various buttons such as a power button, a menu button, and a shutter button, and the various buttons include switches, a touch panel, and the like. The CPU 101 controls the image processing apparatus 100 in accordance with a user instruction input via the operation unit 104. Here, the case where the CPU 101 controls the image processing apparatus 100 based on an operation input via the operation unit 104 has been described as an example, but the present invention is not limited to this. For example, the CPU 101 may control the image processing apparatus 100 based on a request input via a communication unit 118 from a remote controller (not shown), a portable terminal (not shown), or the like.
撮影レンズ(レンズユニット)111は、ズームレンズやフォーカスレンズを含む不図示のレンズ群、不図示のレンズ制御部、不図示の絞り等によって構成される。撮影レンズ111は、後述するように、画角を変更するズーム手段として機能し得る。レンズ制御部は、CPU101から送信される制御信号により、焦点の調整や絞り値(F値)の制御を行う。撮像部112は、動画像を構成する複数の画像を順次取得する取得手段として機能し得る。撮像部112としては、例えば、CCD(電荷結合素子)やCMOS(相補型金属酸化膜半導体)素子等のエリアイメージセンサが用いられる。撮像部112は、被写体の光学像を電気信号に変換する不図示の光電変換部が行列状、即ち、2次元的に配列された不図示の画素アレイを有している。かかる画素アレイには、被写体の光学像が撮影レンズ111によって結像される。撮像部112は、撮像した画像を画像処理部113又はメモリ102に出力する。なお、撮像部112は、静止画像を取得することも可能である。
The photographing lens (lens unit) 111 includes a lens group (not shown) including a zoom lens and a focus lens, a lens control unit (not shown), a diaphragm (not shown), and the like. The photographic lens 111 can function as zoom means for changing the angle of view, as will be described later. The lens control unit performs focus adjustment and aperture value (F value) control by a control signal transmitted from the CPU 101. The imaging unit 112 can function as an acquisition unit that sequentially acquires a plurality of images constituting a moving image. As the imaging unit 112, for example, an area image sensor such as a CCD (charge coupled device) or a CMOS (complementary metal oxide semiconductor) device is used. The imaging unit 112 has a pixel array (not shown) in which photoelectric conversion units (not shown) that convert an optical image of a subject into an electric signal are arranged in a matrix, that is, two-dimensionally. An optical image of the subject is formed on the pixel array by the photographing lens 111. The imaging unit 112 outputs the captured image to the image processing unit 113 or the memory 102. Note that the imaging unit 112 can also acquire a still image.
画像処理部113は、撮像部112から出力される画像データ、又は、メモリ102から読み出された画像データに対し、所定の画像処理を行う。かかる画像処理としては、例えば、補間処理、縮小処理(リサイズ処理)、色変換処理等が挙げられる。また、画像処理部113は、撮像部112によって取得された画像データを用いて、露光制御や測距制御等のための所定の演算処理を行う。画像処理部113による演算処理によって得られた演算結果に基づいて、露光制御や測距制御等がCPU101によって行われる。具体的には、AE(自動露出)処理、AWB(オートホワイトバランス)処理、AF(オートフォーカス)処理等がCPU101によって行われる。
The image processing unit 113 performs predetermined image processing on the image data output from the imaging unit 112 or the image data read from the memory 102. Examples of such image processing include interpolation processing, reduction processing (resizing processing), color conversion processing, and the like. In addition, the image processing unit 113 performs predetermined calculation processing for exposure control, distance measurement control, and the like, using the image data acquired by the imaging unit 112. Based on the calculation result obtained by the calculation processing by the image processing unit 113, the CPU 101 performs exposure control, distance measurement control, and the like. Specifically, the CPU 101 performs AE (automatic exposure) processing, AWB (auto white balance) processing, AF (autofocus) processing, and the like.
符号化処理部114は、画像データに対してフレーム内予測符号化(画面内予測符号化)やフレーム間予測符号化(画面間予測符号化)等を行うことによって、画像データのサイズを圧縮する。符号化処理部114は、例えば、H.265(ITU H.265又はISO/IEC23008−2)方式によって符号化処理を行う。符号化処理部114は、後述するように、選択領域122の設定に基づいて、画像を複数のタイル126に分割する分割手段として機能し得る。また、符号化処理部114は、後述するように、選択領域122に対応するタイル126を符号化する符号化手段として機能し得る。また、符号化処理部114は、後述するように、選択領域122以外の領域に対応するタイル126をも符号化することができる。また、符号化処理部114は、後述するように、撮像部112の姿勢が変化した場合に、選択領域122以外の部分に対応するタイル126に所定データを用いるようにすることもできる。また、符号化処理部114は、後述するように、画像が撮像された際の撮像部112の姿勢に依存することなく、選択領域122を同一の方向にスキャンする。ただし、画像データの回転等が、CPU101によって事前に適宜行われる。なお、符号化処理部114の詳細については、図3を用いて後述することとする。
The encoding processing unit 114 compresses the size of the image data by performing intra-frame prediction encoding (intra-screen prediction encoding), inter-frame prediction encoding (inter-frame prediction encoding), and the like on the image data. . The encoding processing unit 114 is, for example, H.264. The encoding process is performed according to the H.265 (ITU H.265 or ISO / IEC 23008-2) method. As will be described later, the encoding processing unit 114 can function as a dividing unit that divides an image into a plurality of tiles 126 based on the setting of the selection region 122. In addition, the encoding processing unit 114 can function as an encoding unit that encodes the tile 126 corresponding to the selection region 122, as will be described later. In addition, the encoding processing unit 114 can also encode the tile 126 corresponding to an area other than the selected area 122, as will be described later. In addition, as described later, the encoding processing unit 114 can use predetermined data for the tile 126 corresponding to a portion other than the selection region 122 when the posture of the imaging unit 112 changes. Further, as will be described later, the encoding processing unit 114 scans the selection region 122 in the same direction without depending on the posture of the imaging unit 112 when the image is captured. However, rotation of image data and the like are appropriately performed in advance by the CPU 101. The details of the encoding processing unit 114 will be described later with reference to FIG.
表示制御部115は、表示部116を制御する。表示部116は、表示画面125を備えている。表示制御部115は、画像データに対してリサイズ処理や色変換処理等を行うことにより、表示部116の表示画面125に表示可能な画像を生成し、かかる画像、即ち、画像信号を表示部116に出力する。表示部116は、表示制御部115から送られてくる画像信号に基づいて、表示画面125に画像を表示する。表示部116は、表示画面125にメニュー等の設定画面を表示する機能であるOSD(On Screen Display)機能を備えている。表示制御部115は、画像信号にOSD画像を重畳して表示部116に出力し得る。表示部116は、例えばバリアングルの表示部であり、例えば180度回転することができる。表示部116が例えば180度回転していることを示す情報が、表示部116から表示制御部115を介してCPU101に通知される。なお、表示部116が例えば180度回転している場合には、画像処理装置100を例えば自撮り用、即ち、自分撮り用に用いることができる。なお、自撮り、即ち、自分撮りとは、撮影者が自分自身を被写体として撮影することである。表示部116は、例えば、液晶ディスプレイや有機EL等によって構成されている。表示部116は、例えばタッチパネルであってもよい。表示部116がタッチパネルである場合、表示部116は操作部104としても機能し得る。表示制御部115は、選択領域122を表示画面125に表示する表示制御手段として機能し得る。選択領域122は、上述したように、例えば縦長の矩形に設定される。表示部116は、後述するように、表示画面125が横長の状態である場合には、横長の状態の表示画面125に縦長の選択領域122を表示する。また、表示部116は、後述するように、表示画面125が縦長の状態である場合には、縦長の状態の表示画面125に縦長の選択領域122を表示する。
The display control unit 115 controls the display unit 116. The display unit 116 includes a display screen 125. The display control unit 115 generates an image that can be displayed on the display screen 125 of the display unit 116 by performing resizing processing, color conversion processing, and the like on the image data, and displays the image, that is, the image signal. Output to. The display unit 116 displays an image on the display screen 125 based on the image signal sent from the display control unit 115. The display unit 116 has an OSD (On Screen Display) function that is a function for displaying a setting screen such as a menu on the display screen 125. The display control unit 115 can superimpose the OSD image on the image signal and output it to the display unit 116. The display unit 116 is, for example, a vari-angle display unit, and can rotate, for example, 180 degrees. Information indicating that the display unit 116 is rotated, for example, 180 degrees is notified from the display unit 116 to the CPU 101 via the display control unit 115. Note that when the display unit 116 is rotated, for example, 180 degrees, the image processing apparatus 100 can be used, for example, for self-portrait, that is, for self-portrait. Note that self-shooting, that is, self-shooting, means that a photographer takes a picture of himself as a subject. The display unit 116 is configured by, for example, a liquid crystal display or an organic EL. The display unit 116 may be a touch panel, for example. When the display unit 116 is a touch panel, the display unit 116 can also function as the operation unit 104. The display control unit 115 can function as display control means for displaying the selection area 122 on the display screen 125. As described above, the selection area 122 is set to a vertically long rectangle, for example. As will be described later, when the display screen 125 is in the horizontally long state, the display unit 116 displays the vertically long selection area 122 on the horizontally long display screen 125. Further, as will be described later, when the display screen 125 is in the vertically long state, the display unit 116 displays the vertically long selection area 122 on the display screen 125 in the vertically long state.
通信制御部117は、CPU101によって制御される。通信制御部117は、例えばIEEE802.11等で予め定められた無線通信規格に適合する変調信号を生成して、かかる変調信号を通信部118に出力する。また、通信制御部117は、無線通信規格に適合する変調信号を、通信部118を介して受信し、受信した変調信号を復号し、復号した信号に応じた信号をCPU101に出力する。通信制御部117は、通信設定を記憶するためのレジスタを備えている。通信制御部117は、CPU101からの制御によって、通信時の送受信感度を調整し得る。通信制御部117は、所定の変調方式で送受信を行うことができる。通信部118は、通信制御部117から供給される変調信号を外部に出力し、また、外部からの変調信号を受信するアンテナを備えている。また、通信部118には、通信用の回路等が備えられている。なお、ここでは、通信部118によって無線通信が行われる場合を例に説明したが、通信部118によって行われる通信は無線通信に限定されるものではない。例えば、配線等を用いた電気的な接続によって通信部118と外部機器127とが接続されてもよい。
The communication control unit 117 is controlled by the CPU 101. The communication control unit 117 generates a modulation signal that conforms to a wireless communication standard predetermined by IEEE 802.11 or the like, for example, and outputs the modulation signal to the communication unit 118. In addition, the communication control unit 117 receives a modulated signal conforming to the wireless communication standard via the communication unit 118, decodes the received modulated signal, and outputs a signal corresponding to the decoded signal to the CPU 101. The communication control unit 117 includes a register for storing communication settings. The communication control unit 117 can adjust the transmission / reception sensitivity during communication under the control of the CPU 101. The communication control unit 117 can perform transmission / reception with a predetermined modulation method. The communication unit 118 includes an antenna that outputs the modulation signal supplied from the communication control unit 117 to the outside and receives the modulation signal from the outside. The communication unit 118 includes a communication circuit and the like. Here, the case where wireless communication is performed by the communication unit 118 has been described as an example, but the communication performed by the communication unit 118 is not limited to wireless communication. For example, the communication unit 118 and the external device 127 may be connected by electrical connection using wiring or the like.
記録媒体制御部119は、記録媒体120を制御する。記録媒体制御部119は、CPU101からの要求に基づいて、記録媒体120を制御するための制御信号を記録媒体120に出力する。記録媒体120としては、例えば不揮発性メモリや磁気ディスク等が用いられる。記録媒体120は、上述したように、着脱可能であってもよいし、着脱不能であってもよい。記録媒体120は、符号化された画像データ等を記録する。記録媒体120のファイルシステムに適合した形式で画像データ等がファイルとして保存される。かかるファイルとしては、例えば、MP4ファイル(ISO/IEC 14496−14:2003)やMXF(Material eXchange Format)ファイル等が挙げられる。
The recording medium control unit 119 controls the recording medium 120. The recording medium control unit 119 outputs a control signal for controlling the recording medium 120 to the recording medium 120 based on a request from the CPU 101. As the recording medium 120, for example, a nonvolatile memory or a magnetic disk is used. As described above, the recording medium 120 may be detachable or non-detachable. The recording medium 120 records encoded image data and the like. Image data or the like is saved as a file in a format compatible with the file system of the recording medium 120. Examples of such files include MP4 files (ISO / IEC 14496-14: 2003) and MXF (Material eXchange Format) files.
傾き検知部(センサ傾き検知部)121は、撮像部112の傾き(姿勢)を検知する。傾き検知部121としては、例えば加速度センサが用いられる。加速度センサとしては、静電容量検出方式、ピエゾ抵抗方式等、様々な方式の加速度センサを適宜用い得る。静電容量検出方式の加速度センサは、センサ素子可動部と固定部との間の容量変化を検出する。ピエゾ抵抗方式の加速度センサは、センサ素子可動部と固定部とをつなぐバネ部分に配置されたピエゾ抵抗素子により、加速度によってバネ部分に発生した歪みを検出する。各々の機能ブロック101〜104,112〜115,117,119,121は、内部バス130を介しては互いにアクセス可能となっている。
The tilt detection unit (sensor tilt detection unit) 121 detects the tilt (posture) of the imaging unit 112. As the inclination detection unit 121, for example, an acceleration sensor is used. As the acceleration sensor, various types of acceleration sensors such as a capacitance detection method and a piezoresistive method can be used as appropriate. The capacitance detection type acceleration sensor detects a change in capacitance between the sensor element movable portion and the fixed portion. A piezoresistive acceleration sensor detects strain generated in a spring portion due to acceleration by a piezoresistive element disposed in a spring portion that connects a sensor element movable portion and a fixed portion. The respective functional blocks 101 to 104, 112 to 115, 117, 119 and 121 can be accessed with each other via the internal bus 130.
<符号化処理部>
図3は、本実施形態による画像処理装置100に備えられている符号化処理部114を示すブロック図である。図3においては、符号化処理部114とメモリ102とが抜き出して示されている。符号化処理部114は、例えば、動画圧縮規格の1つであるH.265の符号化方式によって符号化を行う。
<Encoding processing unit>
FIG. 3 is a block diagram illustrating the encoding processing unit 114 provided in the image processing apparatus 100 according to the present embodiment. In FIG. 3, the encoding processing unit 114 and the memory 102 are extracted and shown. The encoding processing unit 114 is, for example, H.264, which is one of moving image compression standards. Encoding is performed according to the H.265 encoding method.
画像分割部301は、選択領域122に基づいて、符号化の対象となる画像を複数の矩形領域、即ち、複数のタイルに分割する。H.265の符号化方式においては、タイルを用いた画面分割を行うことが可能である。タイルを用いれば、画像を任意の位置で縦横方向に分割することができる。タイルにおいては、フレーム内予測やフレーム間予測等の画素値の参照が途切れる。即ち、タイルは、他のタイル、即ち、他の矩形領域の画素値を参照することなく復号可能な矩形領域である。このため、各々のタイルは、独立して用いることが可能である。選択領域122の位置についての情報は、CPU101から画像分割部301に与えられる。画像分割部301は、CPU101から与えられる選択領域122についての情報に基づいて、符号化の対象となる画像を複数のタイルに分割する。画面分割においては、水平方向のタイル分割数num_tile_columns_minus1や、垂直方向のタイル分割数num_tile_rows_minus1等が適宜設定される。タイル構造が固定であるか任意であるかを示すタイル構造固定フラグtiles_fixed_structure_flagは、例えば、タイル構造が可変であることを示す0に設定される。矩形領域のサイズ、即ち、タイルのサイズは、水平方向の画素数と垂直方向の画素数とによって表される。但し、矩形領域の一つの辺に対応する画素数とアスペクト比とによって矩形領域のサイズ、即ち、タイルのサイズは特定することができるので、この限りではない。画像分割部301は、画面分割によって画定した各々のタイルに番号、即ち、タイル番号を付す。符号化対象の画像における各々のタイルの位置は、タイル番号によって特定し得る。なお、各々のタイルのサイズは、例えばCTB(Cording Tree Block)の数を示す情報によっても決定し得る。画像分割部301は、符号化処理中に、タイル毎の予測符号化条件を予測符号化方法決定部302に出力する。かかる予測符号化条件には、あるタイル内の着目画素ブロックを符号化する際、当該着目画素ブロック(符号化対象ブロック)の予測画素ブロックを取得する範囲を規定する情報が含まれる。なお、この点については、後に詳述することとする。
The image dividing unit 301 divides an image to be encoded into a plurality of rectangular regions, that is, a plurality of tiles based on the selection region 122. H. In the H.265 encoding method, it is possible to perform screen division using tiles. If tiles are used, an image can be divided vertically and horizontally at an arbitrary position. In the tile, reference to pixel values such as intra-frame prediction and inter-frame prediction is interrupted. That is, the tile is a rectangular area that can be decoded without referring to the pixel values of other tiles, that is, other rectangular areas. For this reason, each tile can be used independently. Information about the position of the selection region 122 is given from the CPU 101 to the image dividing unit 301. The image dividing unit 301 divides an image to be encoded into a plurality of tiles based on information about the selection area 122 given from the CPU 101. In the screen division, a horizontal tile division number num_tile_columns_minus1, a vertical tile division number num_tile_rows_minus1, and the like are set as appropriate. A tile structure fixed flag tiles_fixed_structure_flag indicating whether the tile structure is fixed or arbitrary is set to 0 indicating that the tile structure is variable, for example. The size of the rectangular area, that is, the tile size is represented by the number of pixels in the horizontal direction and the number of pixels in the vertical direction. However, the size of the rectangular area, that is, the size of the tile can be specified by the number of pixels corresponding to one side of the rectangular area and the aspect ratio. The image dividing unit 301 assigns a number to each tile defined by the screen division, that is, a tile number. The position of each tile in the image to be encoded can be specified by the tile number. Note that the size of each tile can also be determined by information indicating the number of CTBs (Cording Tree Blocks), for example. The image division unit 301 outputs the prediction encoding condition for each tile to the prediction encoding method determination unit 302 during the encoding process. Such prediction encoding conditions include information that defines a range in which a prediction pixel block of the target pixel block (encoding target block) is acquired when encoding the target pixel block in a certain tile. This point will be described in detail later.
予測符号化方法決定部302は、画像分割部301から入力される画面分割情報と予測符号化条件とに基づいて、符号化対象領域内の各画素ブロックに対する予測符号化方法を決定する。予測符号化方法決定部302は、入力される画像信号と、メモリ102から読み出した符号化済みの画素値とから、簡易的なフレーム内予測又は動き検出を含むフレーム間予測処理を行うことによって、符号化効率を示す評価値を算出する。そして、予測符号化方法決定部302は、符号化効率が最良となる予測符号化方式を決定する。符号化対象の画素ブロックがIスライスの場合には、予測符号化方法決定部302は、フレーム内の予測画素のブロックサイズと予測モードとを決定する。符号化画素ブロックがPスライス又はBスライスの場合には、フレーム内予測又はフレーム間予測の内、符号化効率の高い方を選択する。なお、フレーム内の全てのスライスがIスライスであるフレームはIフレームと称され、フレーム内の全てのスライスがPスライスであるフレームはPフレームと称され、フレーム内の全てのスライスがBスライスであるフレームはBフレームと称される。予測符号化方法決定部302は、フレーム内予測の場合には、フレーム内の予測画素のブロックサイズ、フレーム内予測モード等のフレーム内予測符号化用パラメータを決定する。また、予測符号化方法決定部302は、フレーム間予測の場合には、参照フレーム、画素ブロックの分割パターン、動きベクトル等のフレーム間予測符号化用パラメータを決定する。予測符号化方法決定部302は、決定した予測符号化用パラメータを予測符号化処理部303に出力する。
The prediction encoding method determination unit 302 determines a prediction encoding method for each pixel block in the encoding target region based on the screen division information input from the image division unit 301 and the prediction encoding condition. The predictive encoding method determination unit 302 performs simple inter-frame prediction or inter-frame prediction processing including motion detection from the input image signal and the encoded pixel value read from the memory 102, An evaluation value indicating the coding efficiency is calculated. Then, the predictive encoding method determination unit 302 determines the predictive encoding scheme that provides the best encoding efficiency. When the pixel block to be encoded is an I slice, the prediction encoding method determination unit 302 determines the block size and prediction mode of the prediction pixel in the frame. When the encoding pixel block is a P slice or a B slice, the one with higher encoding efficiency is selected from among intra-frame prediction and inter-frame prediction. A frame in which all slices in the frame are I slices is called an I frame, a frame in which all slices in the frame are P slices is called a P frame, and all slices in the frame are B slices. A certain frame is called a B frame. In the case of intra-frame prediction, the predictive encoding method determination unit 302 determines intra-frame predictive encoding parameters such as a block size of a predicted pixel in a frame and an intra-frame prediction mode. Also, in the case of inter-frame prediction, the predictive coding method determining unit 302 determines inter-frame predictive coding parameters such as a reference frame, a pixel block division pattern, and a motion vector. The predictive coding method determining unit 302 outputs the determined predictive coding parameter to the predictive coding processing unit 303.
予測符号化処理部303は、符号化対象のフレーム中の着目タイル内の着目画素ブロックを符号化する際、以下のように動作する。即ち、予測符号化処理部303は、かかる際には、予測符号化方法決定部302によって決定された予測符号化用パラメータに応じて、メモリ102から読出した符号化済み画像から予測画素ブロックを生成する。そして、予測符号化処理部303は、着目画素ブロックと予測画素ブロックとの差分である予測残差ブロックを、直交変換・量子化部305に出力する。また、予測符号化処理部303は、予測画素ブロックを局所復号化部306にも出力する。
The predictive coding processing unit 303 operates as follows when coding the pixel block of interest in the tile of interest in the encoding target frame. That is, in this case, the predictive encoding processing unit 303 generates a predictive pixel block from the encoded image read from the memory 102 in accordance with the predictive encoding parameter determined by the predictive encoding method determining unit 302. To do. Then, the predictive coding processing unit 303 outputs a prediction residual block that is a difference between the target pixel block and the predicted pixel block to the orthogonal transform / quantization unit 305. Further, the predictive coding processing unit 303 also outputs the predicted pixel block to the local decoding unit 306.
直交変換・量子化部305は、予測符号化処理部303から供給される予測残差ブロックに対して直交変換処理を行う。また、直交変換・量子化部305は、符号量制御部307によって設定された量子化パラメータに応じた量子化ステップを用いて、直交変換処理により得られた係数を量子化する。直交変換・量子化部305は、量子化後の係数、即ち、量子化データを、エントロピー符号化部308と局所復号化部306とに出力する。
The orthogonal transform / quantization unit 305 performs orthogonal transform processing on the prediction residual block supplied from the predictive coding processing unit 303. Further, the orthogonal transform / quantization unit 305 quantizes the coefficient obtained by the orthogonal transform process using a quantization step according to the quantization parameter set by the code amount control unit 307. The orthogonal transform / quantization unit 305 outputs the quantized coefficient, that is, the quantized data, to the entropy encoding unit 308 and the local decoding unit 306.
局所復号化部306は、直交変換・量子化部305から入力される量子化データに対して、逆量子化処理や逆直交変換処理を行うことによって、予測残差データを生成する。そして、局所復号化部306は、生成した予測残差データに、予測符号化処理部303から入力される予測画像を加算して復号化処理を行い、復号化処理によって得られた画素ブロックによって示される画像データをメモリ102に格納する。メモリ102に格納された復号化処理後の画像データは、フレーム内予測処理に利用される。更に、デブロッキングフィルタ処理が施された復号化データがメモリ102に保持される。メモリ102に保持されたデブロッキングフィルタ処理後の復号化データは、フレーム間予測処理にも利用される。
The local decoding unit 306 generates prediction residual data by performing inverse quantization processing and inverse orthogonal transformation processing on the quantized data input from the orthogonal transformation / quantization unit 305. Then, the local decoding unit 306 performs decoding processing by adding the prediction image input from the prediction encoding processing unit 303 to the generated prediction residual data, and indicates the pixel block obtained by the decoding processing. The image data to be stored is stored in the memory 102. The decoded image data stored in the memory 102 is used for intra-frame prediction processing. Further, the decoded data that has been subjected to the deblocking filter processing is held in the memory 102. The decoded data after the deblocking filter process held in the memory 102 is also used for the inter-frame prediction process.
符号量制御部307は、符号化ピクチャバッファがオーバーフロー又はアンダーフローしないように、符号化データの符号量を制御する。符号量制御部307は、エントロピー符号化部308から供給されるエントロピー符号化後の発生符号量に基づいて、後続のフレームに対する量子化パラメータを生成し、生成した量子化パラメータを直交変換・量子化部305に供給する。
The code amount control unit 307 controls the code amount of the encoded data so that the encoded picture buffer does not overflow or underflow. The code amount control unit 307 generates a quantization parameter for the subsequent frame based on the generated code amount after entropy encoding supplied from the entropy encoding unit 308, and orthogonally transforms / quantizes the generated quantization parameter. Supplied to the unit 305.
エントロピー符号化部308は、入力される量子化データに対してスライス単位にCABAC(コンテキスト適応型2値算術符号化)によるエントロピー符号化処理を行う。エントロピー符号化部308は、入力される多値の量子化データを2値のデータに変換する2値化部と、2値化部によって生成される2値化データを格納する2値化データメモリとを有している。また、エントロピー符号化部308は、2値化データの発生確率をコンテキストに応じて計算し、計算によって求められた2値データの発生確率を保持するコンテキスト計算部を有する。また、エントロピー符号化部308は、コンテキスト計算部から供給される2値データの発生確率に応じて算術符号化を行う算術符号化部を有する。エントロピー符号化部308は、こうして符号化されたデータをタイル単位で多重化処理部309に出力するとともに、エントロピー符号化後の発生符号量を符号量制御部307に出力する。
The entropy coding unit 308 performs entropy coding processing by CABAC (context adaptive binary arithmetic coding) on the input quantized data in units of slices. The entropy encoding unit 308 includes a binarizing unit that converts input multi-level quantized data into binary data, and a binarized data memory that stores binarized data generated by the binarizing unit And have. The entropy encoding unit 308 includes a context calculation unit that calculates the occurrence probability of the binarized data according to the context and holds the occurrence probability of the binary data obtained by the calculation. The entropy encoding unit 308 includes an arithmetic encoding unit that performs arithmetic encoding according to the occurrence probability of binary data supplied from the context calculation unit. The entropy encoding unit 308 outputs the encoded data to the multiplexing processing unit 309 in units of tiles, and outputs the generated code amount after entropy encoding to the code amount control unit 307.
多重化処理部309は、画像の符号化の開始の際には、符号化対象のフレームのサイズ、タイルの分割位置、タイルサイズ、タイル番号、主被写体が位置するタイル番号等の情報をファイルヘッダに格納する。なお、タイルを単位とするラスタースキャン順にタイル番号が付されることが、符号化、復号化を行う装置双方の共通事項である場合には、タイル番号を不要としてもよい。
At the start of image encoding, the multiplexing processing unit 309 sends information such as the size of the frame to be encoded, the tile division position, the tile size, the tile number, and the tile number where the main subject is located to the file header. To store. Note that if it is common to both the encoding and decoding apparatuses that tile numbers are assigned in the order of raster scanning in units of tiles, the tile numbers may be unnecessary.
<選択領域の表示例>
図4は、選択領域の表示の例を示す図である。図4は、プレビュー画面に選択領域122が表示されている状態を示している。図4(a)から図4(c)は、撮像部112を横長にした状態で撮影が行われる場合、即ち、撮像部112によって横長の画像が取得される場合の例を示している。図4(a)に示す例においては、撮像部112によって取得される横長の画像、即ち、全体画像124が表示部116の表示画面125に表示され、当該全体画像124の範囲内に縦長の矩形の選択領域122が表示される。図4(a)に示す例においては、選択領域122の長辺のサイズと全体画像124の短辺のサイズとが一致している。このように、表示画面125に収まるように選択領域122のサイズが設定される。図4(a)に示す例においては、ユーザによる指示によって、選択領域122を左右に移動させることが可能である。また、図4(a)に示す例においては、選択領域122を横方向に拡大することも可能である。また、図4(a)に示す例においては、選択領域122を縮小することも可能である。なお、選択領域122の移動、拡大、縮小等は、操作部104に含まれる操作ボタン等をユーザが操作することによって行われてもよいし、ユーザによるタッチパネルの操作によって行われてもよい。選択領域122の縮小の方向は、縦方向のみであってもよいし、横方向のみであってもよいし、縦横両方向であってもよい。全体画像124と選択領域122とは、相似形であってもよいし、相似形でなくてもよい。
<Display example of selection area>
FIG. 4 is a diagram illustrating a display example of the selection area. FIG. 4 shows a state in which the selection area 122 is displayed on the preview screen. FIG. 4A to FIG. 4C illustrate an example in which shooting is performed in a state where the imaging unit 112 is horizontally long, that is, a horizontally long image is acquired by the imaging unit 112. In the example illustrated in FIG. 4A, a horizontally long image acquired by the imaging unit 112, that is, the entire image 124 is displayed on the display screen 125 of the display unit 116, and a vertically long rectangle is included in the range of the entire image 124. A selection area 122 is displayed. In the example shown in FIG. 4A, the size of the long side of the selection region 122 and the size of the short side of the entire image 124 are the same. Thus, the size of the selection area 122 is set so as to fit on the display screen 125. In the example shown in FIG. 4A, the selection area 122 can be moved left and right in accordance with an instruction from the user. Further, in the example shown in FIG. 4A, the selection region 122 can be expanded in the horizontal direction. In addition, in the example shown in FIG. 4A, the selection area 122 can be reduced. Note that movement, enlargement, reduction, and the like of the selection area 122 may be performed by a user operating an operation button or the like included in the operation unit 104, or may be performed by a user operating a touch panel. The reduction direction of the selection region 122 may be only the vertical direction, may be only the horizontal direction, or may be both the vertical and horizontal directions. The entire image 124 and the selection region 122 may be similar or may not be similar.
図4(b)は、選択領域122のサイズを縮小した例を示している。図4(b)に示す例においては、選択領域122の長辺のサイズが全体画像124の短辺のサイズよりも小さくなっている。このため、図4(b)に示す例においては、ユーザによる指示によって、上下方向にも、左右方向にも選択領域122を移動させることが可能である。また、図4(b)に示す例においては、選択領域122の拡大や縮小を行うことも可能である。なお、選択領域122の拡大や縮小は、縦方向のみであってもよいし、横方向のみであってもよいし、縦横両方向であってもよい。また、上述したように、全体画像124と選択領域122とは、相似形であってもよいし、相似形でなくてもよい。
FIG. 4B shows an example in which the size of the selection area 122 is reduced. In the example shown in FIG. 4B, the size of the long side of the selection region 122 is smaller than the size of the short side of the entire image 124. For this reason, in the example shown in FIG. 4B, the selection area 122 can be moved both in the vertical direction and in the horizontal direction in accordance with an instruction from the user. Further, in the example shown in FIG. 4B, the selection area 122 can be enlarged or reduced. Note that the selection area 122 may be enlarged or reduced only in the vertical direction, only in the horizontal direction, or in both the vertical and horizontal directions. Further, as described above, the whole image 124 and the selection region 122 may be similar or may not be similar.
図4(c)は、選択領域122を複数の候補のうちから選択できるようにした場合を示している。ここでは、3つの選択領域122、即ち、選択領域122a〜122cが表示部116の表示画面125に表示される場合を例に示している。なお、個々の選択領域について説明する際には、符号122a〜122cを用い、選択領域一般について説明する際には符号122を用いることとする。ユーザによる指示によって、複数の選択領域122a〜122cのうちのいずれかが選択される。複数の選択領域122a〜122cは、相似形であってもよいし、相似形でなくてもよい。また、上述したように、全体画像124と選択領域122とは、相似形であってもよいし、相似形でなくてもよい。また、複数の選択領域122a〜122cのうちから選択された選択領域122を、移動してもよいし、拡大又は縮小してもよい。
FIG. 4C shows a case where the selection area 122 can be selected from a plurality of candidates. Here, a case where three selection regions 122, that is, selection regions 122a to 122c are displayed on the display screen 125 of the display unit 116 is shown as an example. It should be noted that reference numerals 122a to 122c are used when describing individual selection areas, and reference numeral 122 is used when general selection areas are described. One of the plurality of selection areas 122a to 122c is selected by an instruction from the user. The plurality of selection regions 122a to 122c may be similar or may not be similar. Further, as described above, the whole image 124 and the selection region 122 may be similar or may not be similar. In addition, the selection area 122 selected from the plurality of selection areas 122a to 122c may be moved, or may be enlarged or reduced.
図4(d)は、撮像部112を縦長の姿勢にした状態で撮影が行われる場合、即ち、撮像部112によって縦長の画像が取得される場合の例を示している。図4(d)に示す例においては、選択領域122の長辺のサイズと全体画像124の短辺のサイズとが一致している。図4(d)に示す例においては、図4(b)に示す例と同様に、ユーザによる指示によって、上下方向にも、左右方向にも選択領域122を移動させることが可能である。また、選択領域122の拡大や縮小を行うことも可能である。なお、選択領域122の拡大や縮小は、縦方向のみであってもよいし、横方向のみであってもよいし、縦横両方向であってもよい。また、上述したように、全体画像124と選択領域122とは、相似形であってもよいし、相似形でなくてもよい。また、全体画像124が選択領域122と同様に縦長であるため、選択領域122を最大化すれば、選択領域122のサイズと全体画像124のサイズとが一致する。なお、図4(d)に示す例においては、全体画像124のうちの選択領域122以外の部分が表示画面125に表示されているが、全体画像124のうちの選択領域122以外の部分を撮影対象外として表示画面125に表示しないようにしてもよい。また、全体画像124のうちの選択領域122以外の部分に、所定のデータを用いた画像、即ち、所定の画像を表示するようにしてもよい。かかる所定のデータとしては、例えば黒色の画像等が挙げられる。即ち、全体画像124のうちの選択領域122以外の部分を、例えば黒色で塗りつぶすようにしてもよい。また、撮像部112の姿勢が変化した際に、選択領域122以外の部分に所定のデータを用いるようにしてもよい。例えば、撮像部112が横長の状態から縦長の状態に変化した際に、選択領域122以外の部分に所定のデータを用いるようにしてもよい。また、選択領域122を複数の候補のうちから選択できるようにしてもよい。更に、複数の候補のうちから選択した選択領域122を、移動してもよいし、拡大又は縮小してもよい。
FIG. 4D illustrates an example in which shooting is performed in a state where the imaging unit 112 is in a vertically long posture, that is, a vertically long image is acquired by the imaging unit 112. In the example shown in FIG. 4D, the size of the long side of the selection area 122 and the size of the short side of the entire image 124 are the same. In the example shown in FIG. 4D, as in the example shown in FIG. 4B, the selection area 122 can be moved both in the vertical direction and in the horizontal direction by an instruction from the user. In addition, the selection area 122 can be enlarged or reduced. Note that the selection area 122 may be enlarged or reduced only in the vertical direction, only in the horizontal direction, or in both the vertical and horizontal directions. Further, as described above, the whole image 124 and the selection region 122 may be similar or may not be similar. In addition, since the entire image 124 is vertically long like the selection region 122, the size of the selection region 122 and the size of the entire image 124 match if the selection region 122 is maximized. In the example shown in FIG. 4D, a portion of the entire image 124 other than the selected region 122 is displayed on the display screen 125, but a portion of the entire image 124 other than the selected region 122 is photographed. You may make it not display on the display screen 125 as a target. In addition, an image using predetermined data, that is, a predetermined image may be displayed in a portion other than the selection area 122 in the entire image 124. Examples of such predetermined data include a black image. That is, a portion other than the selection region 122 in the entire image 124 may be filled with, for example, black. Further, when the posture of the imaging unit 112 is changed, predetermined data may be used for a portion other than the selection region 122. For example, when the imaging unit 112 changes from a horizontally long state to a vertically long state, predetermined data may be used for a portion other than the selection region 122. Further, the selection region 122 may be selected from a plurality of candidates. Furthermore, the selection area 122 selected from among a plurality of candidates may be moved, or may be enlarged or reduced.
<タイルの構成>
図5は、タイルの構成の例を示す図である。図5(a)は、撮像部112を横長にした状態で画像が取得された場合、即ち、撮像部112に備えられた画素アレイの長辺を水平にした状態で画像が取得された場合の例を示している。図5(a)の例においては、撮像部112によって取得される画像、即ち、全体画像124が、3つのタイル126に分割されている。なお、個々のタイルについて説明する際には、符号126A1,126A2,126Bを用い、タイル一般について説明する際には符号126を用いることとする。タイル126Bは、選択領域122に対応している。タイル126A1とタイル126A2とは、全体画像124のうちの選択領域122以外の部分に対応している。図5(a)における矢印の方向は、符号化の際に行われるラスタースキャンのスキャン方向を示している。例えば、タイル126A1、タイル126A2、タイル126Bの順にラスタースキャンが行われる。符号化処理は、CTU(Coding Tree Unit)単位で行われる。
<Tile composition>
FIG. 5 is a diagram illustrating an example of a tile configuration. FIG. 5A illustrates a case where an image is acquired with the imaging unit 112 in a horizontally long state, that is, an image is acquired with the long side of the pixel array included in the imaging unit 112 being horizontal. An example is shown. In the example of FIG. 5A, the image acquired by the imaging unit 112, that is, the entire image 124 is divided into three tiles 126. Note that reference numerals 126A1, 126A2, and 126B are used when describing individual tiles, and reference numerals 126 are used when general tiles are described. The tile 126B corresponds to the selection area 122. The tile 126A1 and the tile 126A2 correspond to portions other than the selection area 122 in the entire image 124. The direction of the arrow in FIG. 5A indicates the scan direction of the raster scan performed at the time of encoding. For example, the raster scan is performed in the order of the tile 126A1, the tile 126A2, and the tile 126B. The encoding process is performed in units of CTU (Coding Tree Unit).
図5(b)は、撮像部112を縦長にした状態で画像が取得された場合、即ち、撮像部112に備えられた画素アレイの長辺を垂直にした状態で画像が取得された場合を示している。図5(b)の例においては、撮像部112によって取得される画像、即ち、全体画像124が5つのタイルに分割されている。なお、個々のタイルについて説明する際には、符号126C1,126C2,126C3,126C4,126Dを用い、タイル一般について説明する際には符号126を用いることとする。タイル126Dは、選択領域122に対応している。タイル126C1、タイル126C2、タイル126C3、タイル126C4は、全体画像124のうちの選択領域122以外の部分に対応している。図5(b)における矢印の方向は、符号化の際に行われるラスタースキャンのスキャン方向を示している。例えば、タイル126C1、タイル126C2、タイル126C3、タイル126C4、タイル126Dの順にラスタースキャンが行われる。図5(a)と図5(b)とから分かるように、画像が撮像された際の撮像部112の姿勢に依存することなく、選択領域122は同一の方向にスキャンされる。ただし、画像データの回転等が、符号化の前に適宜行われる。
FIG. 5B shows a case where an image is acquired in a state where the imaging unit 112 is vertically long, that is, a case where an image is acquired in a state where the long side of the pixel array provided in the imaging unit 112 is vertical. Show. In the example of FIG. 5B, the image acquired by the imaging unit 112, that is, the entire image 124 is divided into five tiles. Note that reference numerals 126C1, 126C2, 126C3, 126C4, and 126D are used when describing individual tiles, and reference numerals 126 are used when general tiles are described. The tile 126D corresponds to the selection area 122. The tile 126C1, the tile 126C2, the tile 126C3, and the tile 126C4 correspond to portions other than the selection region 122 in the entire image 124. The direction of the arrow in FIG. 5B indicates the scan direction of the raster scan performed at the time of encoding. For example, the raster scan is performed in the order of the tile 126C1, the tile 126C2, the tile 126C3, the tile 126C4, and the tile 126D. As can be seen from FIGS. 5A and 5B, the selection region 122 is scanned in the same direction without depending on the posture of the imaging unit 112 when the image is captured. However, rotation or the like of image data is appropriately performed before encoding.
このように、撮像部112を横長にした状態で取得された画像の分割の態様と、撮像部112を縦長にした状態で取得された画像の分割の態様とは異なっている。なお、図5(a)に示すタイル126Bのサイズと図5(b)に示すタイル126Dのサイズとは同一であってもよいし、同一でなくてもよい。撮像部112を横長にした状態で撮影が開始され、その後、撮像部112を縦長の状態にした場合には、タイル126Dのサイズとタイル126Bのサイズとを変化させることなく撮影を継続させることが可能である。このような場合には、撮像部112の姿勢が変化した場合であっても、選択領域122のサイズは一定に保持される。タイル126の構成は、図5(a)、図5(b)に示す例に限定されるものではない。例えば、選択領域122が複数のタイル126によって構成されてもよい。
As described above, the mode of image division acquired in the state where the imaging unit 112 is horizontally long is different from the mode of image division acquired in the state where the imaging unit 112 is vertically long. Note that the size of the tile 126B shown in FIG. 5A and the size of the tile 126D shown in FIG. 5B may or may not be the same. When shooting is started with the image pickup unit 112 set in the landscape orientation, and then the image pickup unit 112 is set in the portrait orientation, shooting can be continued without changing the size of the tile 126D and the size of the tile 126B. Is possible. In such a case, even when the posture of the imaging unit 112 is changed, the size of the selection region 122 is kept constant. The configuration of the tile 126 is not limited to the example illustrated in FIGS. 5A and 5B. For example, the selection area 122 may be configured by a plurality of tiles 126.
<画像処理装置の動作>
図6は、本実施形態による画像処理装置100の動作を示すフローチャートである。不揮発性メモリ103に格納されているプログラムがメモリ102に展開され、当該プログラムがCPU101によって実行されることによって、本実施形態による画像処理装置100の動作が実現される。
<Operation of Image Processing Device>
FIG. 6 is a flowchart showing the operation of the image processing apparatus 100 according to the present embodiment. The program stored in the non-volatile memory 103 is expanded in the memory 102 and the program is executed by the CPU 101, whereby the operation of the image processing apparatus 100 according to the present embodiment is realized.
ステップS601において、CPU101は、撮影モードが縦撮影モードであるか否かを判定する。縦撮影モードとは、上述したように、撮像部112が横長の状態であっても、撮像部112が縦長の状態であっても、縦長の画像を取得する動作モードである。縦撮影モードであるか否かは、不揮発性メモリ103に記録されたモード設定値に基づいて判定される。縦撮影モードである場合には(ステップS601においてYES)、ステップS602に移行する。縦撮影モードでない場合には(ステップS601においてNO)、選択領域122を設定しないことを示す情報をCPU101がメモリ102に記録し、ステップS603に移行する。なお、以下のような場合に、縦撮影モードでの動作を行うようにしてもよい。即ち、外部機器127との通信が確立されている際に、縦撮影モードでの動作を行うようにしてもよい。この場合、外部機器127としては、例えば、自撮り用の機器、より具体的には、自撮り棒等が挙げられる。自撮り棒とは、撮影者が自分自身を被写体として撮影することができるようにするための棒状の機器である。自撮り棒の先端部に、本実施形態による画像処理装置100が備え付けられる。例えば、通信制御部117及び通信部118を介して自撮り棒と画像処理装置100との通信が確立されている場合に、縦撮影モードでの動作が実行されるようにしてもよい。また、表示部116の表示画面125が被写体、即ち、撮影者に向いている場合に、縦撮影モードでの動作が行われるようにしてもよい。
In step S601, the CPU 101 determines whether or not the shooting mode is the vertical shooting mode. As described above, the vertical shooting mode is an operation mode in which a vertically long image is acquired regardless of whether the imaging unit 112 is in a horizontally long state or the imaging unit 112 is in a vertically long state. Whether or not the vertical shooting mode is set is determined based on the mode setting value recorded in the nonvolatile memory 103. If it is the vertical shooting mode (YES in step S601), the process proceeds to step S602. If the vertical shooting mode is not set (NO in step S601), the CPU 101 records information indicating that the selection area 122 is not set in the memory 102, and the process proceeds to step S603. In the following cases, the operation in the vertical shooting mode may be performed. That is, the operation in the vertical shooting mode may be performed when communication with the external device 127 is established. In this case, examples of the external device 127 include a device for self-shooting, more specifically, a self-shooting stick. A self-shooting stick is a stick-shaped device that allows a photographer to take a picture of himself as a subject. The image processing apparatus 100 according to the present embodiment is provided at the tip of the self-taking stick. For example, when communication between the selfie stick and the image processing apparatus 100 is established via the communication control unit 117 and the communication unit 118, the operation in the vertical shooting mode may be executed. Further, when the display screen 125 of the display unit 116 faces the subject, that is, the photographer, the operation in the vertical shooting mode may be performed.
ステップS602において、CPU101は、表示制御部115を制御することによって、図4を用いて上述したような選択領域122を、表示部116の表示画面125に表示する。複数の候補のうちから選択領域122を選択する場合には、選択領域122の複数の候補が表示部116の表示画面125に表示される。この場合、CPU101は、操作部104を介してユーザによって行われる選択指示に基づいて、いずれかの選択領域122を選択する。また、CPU101は、操作部104を介してユーザによって行われる選択領域122の変更の指示に基づいて、選択領域122の変更を行う。かかる変更としては、移動、拡大、縮小等が挙げられる。CPU101は、複数の画像を含むグループ・オブ・ピクチャの切り替わりの際に選択領域122を変更する。こうして、操作部104を介してのユーザによる指示に基づいて、CPU101が、選択領域122を設定する。CPU101は、選択領域122の位置についての情報をメモリ102に記録する。この後、ステップS603に移行する。
In step S <b> 602, the CPU 101 controls the display control unit 115 to display the selection area 122 as described above with reference to FIG. 4 on the display screen 125 of the display unit 116. When the selection area 122 is selected from a plurality of candidates, the plurality of candidates for the selection area 122 are displayed on the display screen 125 of the display unit 116. In this case, the CPU 101 selects one of the selection regions 122 based on a selection instruction given by the user via the operation unit 104. Further, the CPU 101 changes the selection area 122 based on an instruction to change the selection area 122 performed by the user via the operation unit 104. Such changes include movement, enlargement, reduction, and the like. The CPU 101 changes the selection area 122 when a group of pictures including a plurality of images is switched. Thus, the CPU 101 sets the selection area 122 based on an instruction from the user via the operation unit 104. The CPU 101 records information about the position of the selection area 122 in the memory 102. Thereafter, the process proceeds to step S603.
ステップS603において、CPU101は、撮影を実行するか否かを判定する。操作部104に含まれる画像記録開始ボタンが押されたか否かによって、撮影を実行するか否かが判定される。画像記録開始ボタンが押された場合には(ステップS603においてYES)、ステップS604に移行する。画像記録開始ボタンが押されていない場合には(ステップS603においてNO)、ステップS603が繰り返される。
In step S603, the CPU 101 determines whether to perform shooting. Whether or not shooting is to be executed is determined based on whether or not an image recording start button included in the operation unit 104 has been pressed. If the image recording start button has been pressed (YES in step S603), the process proceeds to step S604. If the image recording start button has not been pressed (NO in step S603), step S603 is repeated.
ステップS604において、CPU101は、符号化処理部114によって行われる符号化処理の前段階の設定、即ち、符号化処理の準備段階における設定を行う。具体的には、例えば、CPU101は、図5を用いて上述したようなタイル126の構成の設定を行う。また、CPU101は、どのようなファイルを記録するかについても決定する。第1の態様は、選択領域122についての画像群を含むファイルのみを記録するものであり、この場合には、1つのファイルが生成される。第2の態様は、選択領域122についての画像群を含む第1のファイルと、選択領域122以外の領域についての画像群を含む第2のファイルとを記録するものであり、この場合には、2つのファイルが生成される。第3の態様は、選択領域122についての画像群を含む第1のファイルと、全体画像124についての画像群を含む第2のファイルとを記録するものであり、この場合には2つのファイルが生成される。更に、CPU101は、符号化処理を行うための各種レジスタの設定等を行い、符号化処理部114を動作させることが可能な状態にする。この後、ステップS605に移行する。
In step S <b> 604, the CPU 101 performs setting at the previous stage of the encoding process performed by the encoding processing unit 114, that is, setting at the preparation stage of the encoding process. Specifically, for example, the CPU 101 sets the configuration of the tile 126 as described above with reference to FIG. The CPU 101 also determines what file is to be recorded. In the first mode, only the file including the image group for the selection area 122 is recorded. In this case, one file is generated. The second mode is to record a first file including an image group for the selected area 122 and a second file including an image group for an area other than the selected area 122. In this case, Two files are generated. In the third mode, a first file including an image group for the selected area 122 and a second file including an image group for the entire image 124 are recorded. In this case, two files are recorded. Generated. Further, the CPU 101 sets various registers for performing the encoding process, etc., so that the encoding processing unit 114 can be operated. Thereafter, the process proceeds to step S605.
ステップS605において、CPU101は、画像処理部113によってメモリ102に格納された画像データのアドレスを符号化処理部114に通知し、符号化処理部114に符号化処理の実行を命令する。なお、符号化処理部114において行われる符号化処理の詳細については、図7を用いて後述することとする。この後、ステップS606に移行する。
In step S605, the CPU 101 notifies the encoding processing unit 114 of the address of the image data stored in the memory 102 by the image processing unit 113, and instructs the encoding processing unit 114 to execute the encoding process. The details of the encoding process performed in the encoding processing unit 114 will be described later with reference to FIG. Thereafter, the process proceeds to step S606.
ステップS606において、CPU101は、符号化処理部114により得られた符号化画像とシンタックス情報とを、記録媒体制御部119を介してストリームデータとして記録媒体120に記録する。上述した第1の態様の場合、即ち、選択領域122についての画像群を含むファイルのみを記録する場合には、選択領域122に対応する符号化画像と、当該符号化画像に関してのシンタックス情報とを、ストリームデータとして記録媒体120に記録する。上述した第2の態様の場合、即ち、選択領域122についての画像群を含む第1のファイルと、選択領域122以外の領域についての画像群を含む第2のファイルとを記録する場合には、以下のような動作が行われる。この場合、選択領域122に対応する符号化画像と、当該符号化画像に関してのシンタックス情報と、選択領域122以外の領域に対応する符号化画像と、当該符号化画像に対してのシンタックス情報とが、ストリームデータとして記録媒体120に記録される。上述した第3の態様の場合、即ち、選択領域122についての画像群を含む第1のファイルと、全体画像124についての画像群を含む第2のファイルとを記録する場合には、以下のような動作が行われる。この場合には、選択領域122に対応する符号化画像と、当該符号化画像に関してのシンタックス情報と、全体画像124に対応する符号化画像と、当該符号化画像に関してのシンタックス情報とが、ストリームデータとして記録媒体120に記録される。この後、ステップS607に移行する。
In step S606, the CPU 101 records the encoded image and syntax information obtained by the encoding processing unit 114 on the recording medium 120 as stream data via the recording medium control unit 119. In the case of the first aspect described above, that is, when only a file including an image group for the selection area 122 is recorded, an encoded image corresponding to the selection area 122, syntax information regarding the encoded image, and Are recorded on the recording medium 120 as stream data. In the case of the second mode described above, that is, when the first file including the image group for the selected area 122 and the second file including the image group for the area other than the selected area 122 are recorded, The following operations are performed. In this case, the encoded image corresponding to the selected area 122, the syntax information regarding the encoded image, the encoded image corresponding to the area other than the selected area 122, and the syntax information for the encoded image. Are recorded on the recording medium 120 as stream data. In the case of the third mode described above, that is, when the first file including the image group for the selected area 122 and the second file including the image group for the entire image 124 are recorded, the following is performed. Operation is performed. In this case, the encoded image corresponding to the selected area 122, the syntax information regarding the encoded image, the encoded image corresponding to the entire image 124, and the syntax information regarding the encoded image are as follows: It is recorded on the recording medium 120 as stream data. Thereafter, the process proceeds to step S607.
ステップS607において、CPU101は、撮影が終了したか否かを判定する。CPU101は、ユーザによって操作される操作部104からの信号に基づいて、撮影が終了したか否かを判定する。撮影が終了したとCPU101が判定した場合には(ステップS607においてYES)、ステップS608に移行する。撮影が終了していないとCPU101が判定した場合には(ステップS607においてNO)、ステップS601に移行する。
In step S <b> 607, the CPU 101 determines whether shooting has ended. The CPU 101 determines whether or not shooting has been completed based on a signal from the operation unit 104 operated by the user. If CPU 101 determines that shooting has ended (YES in step S607), the process proceeds to step S608. If the CPU 101 determines that shooting has not ended (NO in step S607), the process proceeds to step S601.
ステップS608において、CPU101は、符号化処理部114に対して符号化処理の終了処理を行う。具体的には、符号化処理の終了を示す値を、符号化処理部114に備えられた不図示のレジスタに記録する。この後、ステップS609に移行する。
In step S <b> 608, the CPU 101 performs an encoding process end process on the encoding processing unit 114. Specifically, a value indicating the end of the encoding process is recorded in a register (not shown) provided in the encoding processing unit 114. Thereafter, the process proceeds to step S609.
ステップS609において、CPU101は、記録媒体制御部119を介して、記録媒体120に記録されているストリームデータ、即ち、符号化処理部114によって符号化された画像群を含むファイルを生成する。これにより、記録媒体120に記録された動画像データが、ファイルとして読み取り可能な状態となる。なお、上述した第1の態様の場合には、例えば1つのファイルが生成され、上述した第2の態様や第3の態様の場合には、例えば2つのファイルが生成される。こうして、本実施形態による画像処理装置100の動作が終了する。なお、CPU101は、こうして得られたファイル、即ち、動画像ファイルを、通信制御部117と通信部118とを介して、外部機器127に送信するようにしてもよい。この場合、外部機器127としては、例えば、ファイルを記録することが可能な機器等が挙げられる。CPU101は、かかるファイルを外部機器127に送信する場合、かかるファイルを記録媒体120に記録しておくようにしてもよいし、記録しておかなくてもよい。
In step S <b> 609, the CPU 101 generates a file including the stream data recorded on the recording medium 120, that is, the image group encoded by the encoding processing unit 114, via the recording medium control unit 119. As a result, the moving image data recorded on the recording medium 120 can be read as a file. In the case of the first mode described above, for example, one file is generated, and in the case of the second mode and the third mode described above, for example, two files are generated. Thus, the operation of the image processing apparatus 100 according to the present embodiment is completed. Note that the CPU 101 may transmit the file thus obtained, that is, the moving image file, to the external device 127 via the communication control unit 117 and the communication unit 118. In this case, examples of the external device 127 include a device that can record a file. When the CPU 101 transmits the file to the external device 127, the file may be recorded on the recording medium 120 or may not be recorded.
<符号化処理>
図7は、本実施形態による画像処理装置100によって行われる符号化処理の例を示すフローチャートである。図7に示す符号化処理は、図6のステップS605に対応するものであり、CPU101からの命令によって実行される。なお、ここでは、上述した第3の態様の場合、即ち、選択領域122についての画像群を含む第1のファイルと、全体画像124についての画像群を含む第2のファイルとが記録される場合を例に説明する。
<Encoding process>
FIG. 7 is a flowchart illustrating an example of the encoding process performed by the image processing apparatus 100 according to the present embodiment. The encoding process shown in FIG. 7 corresponds to step S605 in FIG. 6, and is executed by an instruction from the CPU 101. Here, in the case of the third aspect described above, that is, when the first file including the image group for the selected area 122 and the second file including the image group for the entire image 124 are recorded. Will be described as an example.
ステップS701において、符号化処理部114は、画像分割部301によって画像の分割処理を行う。具体的には、符号化処理部114は、ステップS602においてメモリ102に記録された選択領域122の位置情報に基づいて、選択領域122をタイル126として設定する。例えば、図5(a)のような場合には、選択領域122がタイル126Bとして設定される。図5(b)のような場合には、選択領域122がタイル126Dとして設定される。また、符号化処理部114は、選択領域122以外の部分をタイル126として設定する。例えば、図5(a)のような場合には、選択領域122以外の領域がタイル126A1、126A2として設定される。また、図5(b)のような場合には、選択領域122以外の領域がタイル126C1、126C2、126C3、126C4として設定される。符号化処理部114は、こうして設定された各々のタイル126についての領域情報を、メモリ102に記録する。この後、ステップS702に移行する。
In step S <b> 701, the encoding processing unit 114 performs image division processing using the image dividing unit 301. Specifically, the encoding processing unit 114 sets the selection area 122 as the tile 126 based on the position information of the selection area 122 recorded in the memory 102 in step S602. For example, in the case of FIG. 5A, the selection area 122 is set as the tile 126B. In the case shown in FIG. 5B, the selection area 122 is set as the tile 126D. In addition, the encoding processing unit 114 sets a portion other than the selection region 122 as the tile 126. For example, in the case of FIG. 5A, areas other than the selection area 122 are set as tiles 126A1 and 126A2. In the case shown in FIG. 5B, areas other than the selected area 122 are set as tiles 126C1, 126C2, 126C3, and 126C4. The encoding processing unit 114 records the area information for each tile 126 set in this way in the memory 102. Thereafter, the process proceeds to step S702.
ステップS702において、符号化処理部114は、符号量制御部307において設定される量子化テーブルにおける値、即ち、量子化値を設定する。選択領域122に対応するタイル126B、126Dに対する量子化値は、十分な画質が得られるように、小さ目に設定してもよい。一方、選択領域122以外の領域に対応するタイル126A1,126A2,126C1,126C2,126C3,126C4に対する量子化値は、符号量を抑制すべく、大き目に設定してもよい。この後、ステップS703に移行する。なお、量子化値の設定は、このような態様に限定されるものではない。例えば、十分な符号量を得たい領域に対して、量子化値を小さく設定するようにしてもよい。
In step S702, the encoding processing unit 114 sets a value in the quantization table set in the code amount control unit 307, that is, a quantization value. The quantized values for the tiles 126B and 126D corresponding to the selection area 122 may be set small so that sufficient image quality can be obtained. On the other hand, the quantized values for the tiles 126A1, 126A2, 126C1, 126C2, 126C3, and 126C4 corresponding to the areas other than the selected area 122 may be set large to suppress the code amount. Thereafter, the process proceeds to step S703. The setting of the quantization value is not limited to such an aspect. For example, the quantization value may be set small for a region where it is desired to obtain a sufficient code amount.
ステップS703において、符号化処理部114は、画像に対する符号化処理を実行する。符号化処理の詳細に関しては、図3を用いて上述したため、ここでは省略する。符号化処理部114は、符号化された画像データをメモリ102に格納する。この後、ステップS704に移行する。
In step S703, the encoding processing unit 114 executes an encoding process on the image. Details of the encoding process have been described above with reference to FIG. The encoding processing unit 114 stores the encoded image data in the memory 102. Thereafter, the process proceeds to step S704.
ステップS704において、符号化処理部114は、シンタックス情報に様々な情報、即ち、諸情報を含める。選択領域122についての画像群を含む第1のファイルに用いられるシンタックス情報には、タイル126の構成を示す情報、選択領域122に対応するタイル126の範囲情報等を含める。全体画像124についての画像群を含む第2のファイルに用いられるシンタックス情報には、タイル126の構成を示す情報、選択領域122に対応する画像の有無を示す情報、選択領域122に対応するタイル126の範囲情報等を含める。そして、符号化処理部114は、かかるシンタックス情報をメモリ102に格納する。なお、ここでは、選択領域122に対応する画像の有無を示す情報、選択領域122に対応するタイル126の範囲情報をシンタックス情報に含める場合を例に説明したが、これに限定されるものではない。例えば、これらの情報を、コンテナ情報に含めてもよい。こうして、本実施形態による画像処理装置100によって符号化処理が行われる。
In step S704, the encoding processing unit 114 includes various information, that is, various information, in the syntax information. The syntax information used for the first file including the image group for the selection area 122 includes information indicating the configuration of the tile 126, range information of the tile 126 corresponding to the selection area 122, and the like. The syntax information used for the second file including the image group for the entire image 124 includes information indicating the configuration of the tile 126, information indicating the presence / absence of an image corresponding to the selection area 122, and a tile corresponding to the selection area 122. 126 range information and the like are included. Then, the encoding processing unit 114 stores the syntax information in the memory 102. Here, the case where the information indicating the presence / absence of the image corresponding to the selection area 122 and the range information of the tile 126 corresponding to the selection area 122 is included in the syntax information has been described as an example, but the present invention is not limited to this. Absent. For example, these pieces of information may be included in the container information. Thus, the encoding process is performed by the image processing apparatus 100 according to the present embodiment.
なお、図7に示すような符号化処理は、CPU101によって行うようにしてもよい。また、ここでは、選択領域122に対応する符号化データと全体画像124についての符号化データとを生成する場合を例に説明したが、これに限定されるものではない。例えば、選択領域122についての符号化データを生成することなく、全体画像124についての符号化データのみを生成するようにしてもよい。また、全体画像124についての符号化データを生成することなく、選択領域122についての符号化データのみを生成するようにしてもよい。また、タイル126の中にスライスが含まれていてもよい。
Note that the encoding process as shown in FIG. 7 may be performed by the CPU 101. Further, here, the case where the encoded data corresponding to the selection region 122 and the encoded data for the entire image 124 are generated has been described as an example, but the present invention is not limited to this. For example, only the encoded data for the entire image 124 may be generated without generating the encoded data for the selected region 122. Alternatively, only the encoded data for the selected region 122 may be generated without generating the encoded data for the entire image 124. Further, the tile 126 may include a slice.
このように、本実施形態によれば、選択領域の設定に基づいて画像を分割し、選択領域に対応するタイルを符号化する。このため、選択領域に対応する画像を得ることができる。そして、選択領域以外の領域に対応するタイルをも符号化すれば、選択領域に対応する画像のみならず、全体画像をも得ることができる。このため、本実施形態によれば、横画像と縦画像の両方の符号化データを得ることができる。従って、本実施形態によれば、所定の画像と選択領域の画像とを良好に取得し得る画像処理装置を提供することができる。
Thus, according to the present embodiment, the image is divided based on the setting of the selection area, and the tile corresponding to the selection area is encoded. For this reason, an image corresponding to the selected region can be obtained. If a tile corresponding to an area other than the selected area is also encoded, not only the image corresponding to the selected area but also the entire image can be obtained. Therefore, according to the present embodiment, encoded data of both a horizontal image and a vertical image can be obtained. Therefore, according to the present embodiment, it is possible to provide an image processing apparatus that can satisfactorily acquire a predetermined image and an image of a selected area.
[第2実施形態]
第2実施形態による画像処理装置及び画像処理方法について図面を参照して詳細に説明する。図1から図7に示す第1実施形態による画像処理装置及び画像処理方法と同一の構成要素には、同一の符号を付して説明を省略または簡潔にする。
本実施形態による画像処理装置は、撮像部112の傾き(姿勢)に基づいた処理を行うものである。図8は、本実施形態による画像処理装置100の動作を示すフローチャートである。不揮発性メモリ103に格納されているプログラムがメモリ102に展開され、当該プログラムがCPU101によって実行されることによって、本実施形態による画像処理装置100の動作が実現される。
[Second Embodiment]
An image processing apparatus and an image processing method according to the second embodiment will be described in detail with reference to the drawings. The same components as those in the image processing apparatus and the image processing method according to the first embodiment shown in FIGS. 1 to 7 are denoted by the same reference numerals, and description thereof is omitted or simplified.
The image processing apparatus according to the present embodiment performs processing based on the inclination (posture) of the imaging unit 112. FIG. 8 is a flowchart showing the operation of the image processing apparatus 100 according to the present embodiment. The program stored in the non-volatile memory 103 is expanded in the memory 102, and the program is executed by the CPU 101, whereby the operation of the image processing apparatus 100 according to the present embodiment is realized.
ステップS801において、CPU101は、図6を用いて上述したステップS601と同様に、撮影モードが縦撮影モードであるか否かを判定する。縦撮影モードである場合には(ステップS801においてYES)、ステップS802に移行する。縦撮影モードでない場合には(ステップS801においてNO)、選択領域122を設定しないことを示す情報をCPU101がメモリ102に記録し、ステップS804に移行する。
In step S801, the CPU 101 determines whether or not the shooting mode is the vertical shooting mode, as in step S601 described above with reference to FIG. If it is the vertical shooting mode (YES in step S801), the process proceeds to step S802. If the vertical shooting mode is not set (NO in step S801), the CPU 101 records information indicating that the selection area 122 is not set in the memory 102, and the process proceeds to step S804.
ステップS802において、CPU101は、傾き検知部121によって撮像部112の傾きを示す情報を取得し、撮像部112の傾きを示す情報、即ち、センサ傾き情報をメモリ102に格納する。この後、ステップS803に移行する。
In step S <b> 802, the CPU 101 acquires information indicating the tilt of the imaging unit 112 by the tilt detection unit 121, and stores information indicating the tilt of the imaging unit 112, i.e., sensor tilt information, in the memory 102. Thereafter, the process proceeds to step S803.
ステップS803において、CPU101は、ステップS802においてメモリ102に格納されたセンサ傾き情報に基づいて、表示部116の表示画面125に選択領域122を表示する。選択領域122の表示は、上述したように、CPU101が、表示制御部115を制御することによって行われる。具体的には、撮像部112が横長の状態であることをセンサ傾き情報が示している場合には、CPU101は、例えば図4(a)から図4(c)のいずれかのように選択領域122を表示する。撮像部112が縦長の状態であることをセンサ傾き情報が示している場合には、CPU101は、例えば図4(d)のように選択領域122を表示する。なお、図4(d)に示す例においては、全体画像124のうちの選択領域122以外の部分が表示画面125に表示されているが、全体画像124のうちの選択領域122以外の部分を撮影対象外として表示画面125に表示しないようにしてもよい。また、全体画像124のうちの選択領域122以外の部分に、特定の画像を表示するようにしてもよい。かかる特定の画像としては、例えば黒色の画像等が挙げられる。即ち、全体画像124のうちの選択領域122以外の部分を、例えば黒色で塗りつぶすようにしてもよい。また、選択領域122を複数の候補のうちから選択できるようにしてもよい。更に、選択した選択領域122を、移動してもよいし、拡大又は縮小してもよい。また、CPU101は、撮像部112が縦長の状態である場合には、選択領域122を表示しなくてもよい。CPU101は、ユーザによって操作部104を介して行われる選択領域122の設定に基づいて、メモリ102に選択領域122の位置情報を記録する。この後、ステップS804に移行する。
In step S803, the CPU 101 displays the selection region 122 on the display screen 125 of the display unit 116 based on the sensor tilt information stored in the memory 102 in step S802. As described above, the selection area 122 is displayed by the CPU 101 controlling the display control unit 115. Specifically, when the sensor tilt information indicates that the imaging unit 112 is in the horizontally long state, the CPU 101 selects the selection area as shown in, for example, any one of FIGS. 4A to 4C. 122 is displayed. When the sensor tilt information indicates that the imaging unit 112 is in the vertically long state, the CPU 101 displays the selection area 122 as shown in FIG. 4D, for example. In the example shown in FIG. 4D, a portion of the entire image 124 other than the selected region 122 is displayed on the display screen 125, but a portion of the entire image 124 other than the selected region 122 is photographed. You may make it not display on the display screen 125 as a target. Further, a specific image may be displayed in a portion other than the selection area 122 in the entire image 124. An example of such a specific image is a black image. That is, a portion other than the selection region 122 in the entire image 124 may be filled with, for example, black. Further, the selection region 122 may be selected from a plurality of candidates. Furthermore, the selected selection area 122 may be moved, or may be enlarged or reduced. In addition, the CPU 101 may not display the selection area 122 when the imaging unit 112 is in the vertically long state. The CPU 101 records the position information of the selection area 122 in the memory 102 based on the setting of the selection area 122 performed by the user via the operation unit 104. Thereafter, the process proceeds to step S804.
ステップS804において、CPU101は、図6を用いて上述したステップS603と同様に、撮影を実行するか否かを判定する。画像記録開始ボタンが押された場合には(ステップS804においてYES)、ステップS805に移行する。画像記録開始ボタンが押されていない場合には(ステップS804においてNO)、ステップS804が繰り返される。
In step S <b> 804, the CPU 101 determines whether or not to perform shooting, similar to step S <b> 603 described above with reference to FIG. 6. If the image recording start button has been pressed (YES in step S804), the process proceeds to step S805. If the image recording start button has not been pressed (NO in step S804), step S804 is repeated.
ステップS805において、CPU101は、ステップS802においてメモリ102に格納されたセンサ傾き情報に基づいて、撮像部112が縦長の状態であるか否かを判定する。CPU101は、撮像部112が縦長の状態である場合には(ステップS805においてYES)、ステップS806に移行する。撮像部112が縦長の状態でない場合(ステップS805においてNO)、ステップS807に移行する。
In step S805, the CPU 101 determines whether or not the imaging unit 112 is in a vertically long state based on the sensor tilt information stored in the memory 102 in step S802. If the imaging unit 112 is in the vertically long state (YES in step S805), the CPU 101 proceeds to step S806. If the imaging unit 112 is not in the vertically long state (NO in step S805), the process proceeds to step S807.
ステップS806において、CPU101は、撮影レンズ111の画角の変更に応じて選択領域122を拡大又は縮小する。なお、画角の変更は、撮影レンズ111に備えられているズームレンズを制御することによって行われる。例えば、撮影レンズ111のズームレンズが望遠側の終端まで到達している場合には、CPU101は、表示部116に表示されている選択領域122のサイズを拡大する。撮像部112が縦長の状態となっているため、選択領域122のサイズは全体画像124のサイズまで拡大することが可能である。この後、ステップS807に移行する。
In step S <b> 806, the CPU 101 enlarges or reduces the selection area 122 according to the change in the angle of view of the photographing lens 111. Note that the angle of view is changed by controlling a zoom lens provided in the photographing lens 111. For example, when the zoom lens of the photographic lens 111 has reached the end on the telephoto side, the CPU 101 enlarges the size of the selection area 122 displayed on the display unit 116. Since the imaging unit 112 is in a vertically long state, the size of the selection area 122 can be expanded to the size of the entire image 124. Thereafter, the process proceeds to step S807.
ステップS807において、CPU101は、傾き検知部121によって撮像部112の傾きを示す情報を取得し、撮像部112の傾きを示す情報、即ち、センサ傾き情報をメモリ102に格納する。そして、CPU101は、前回メモリ102に格納したセンサ傾き情報と、今回メモリ102に格納したセンサ傾き情報とが一致しているか否かを判断する。これらが一致していない場合には、撮影中において撮像部112の傾きが変更されたこととなる。CPU101は、前回メモリ102に格納したセンサ傾き情報と今回メモリ102に格納したセンサ傾き情報とが一致してない場合には(ステップS807においてYES)、ステップS808に移行する。CPU101は、前回メモリ102に格納したセンサ傾き情報と今回メモリ102に格納したセンサ傾き情報とが一致している場合には(ステップS807においてNO)、ステップS809に移行する。
In step S <b> 807, the CPU 101 acquires information indicating the tilt of the imaging unit 112 by the tilt detection unit 121, and stores information indicating the tilt of the imaging unit 112, that is, sensor tilt information in the memory 102. Then, the CPU 101 determines whether or not the sensor tilt information stored in the previous memory 102 matches the sensor tilt information stored in the current memory 102. If they do not match, the inclination of the imaging unit 112 is changed during shooting. If the sensor tilt information stored in the previous memory 102 does not match the sensor tilt information stored in the current memory 102 (YES in step S807), the CPU 101 proceeds to step S808. If the sensor tilt information stored in the previous memory 102 matches the sensor tilt information stored in the current memory 102 (NO in step S807), the CPU 101 proceeds to step S809.
ステップS808において、CPU101は、図6を用いて上述したステップS604と同様に、符号化処理部114による符号化処理を行う前段階の設定を行う。この際、CPU101は、撮像部112が横長の状態から縦長の状態に変化したか否かを、センサ傾き情報に基づいて判定する。そして、横長の状態から縦長の状態への変化が撮像部112において生じた場合には、CPU101は、横長の状態から縦長の状態への変化が撮像部112において生じたことを示す情報を符号化処理部114のレジスタに設定する。CPU101は、撮像部112の姿勢に応じて、図5を用いて上述したようなタイル126の構成の設定を行う。この後、ステップS809に移行する。
In step S808, the CPU 101 performs the previous setting for performing the encoding process by the encoding processing unit 114, similarly to step S604 described above with reference to FIG. At this time, the CPU 101 determines whether the imaging unit 112 has changed from the horizontally long state to the vertically long state based on the sensor tilt information. When a change from the horizontally long state to the vertically long state occurs in the imaging unit 112, the CPU 101 encodes information indicating that the change from the horizontally long state to the vertically long state occurs in the image pickup unit 112. Set in the register of the processing unit 114. The CPU 101 sets the configuration of the tile 126 as described above with reference to FIG. 5 according to the attitude of the imaging unit 112. Thereafter, the process proceeds to step S809.
ステップS809において、CPU101は、図6を用いて上述したステップS605と同様に、符号化処理を実行する。なお、符号化処理部114において行われる符号化処理の詳細については、図9を用いて後述することとする。この後、ステップS810に移行する。
In step S809, the CPU 101 executes an encoding process in the same manner as in step S605 described above with reference to FIG. Details of the encoding process performed in the encoding processing unit 114 will be described later with reference to FIG. Thereafter, the process proceeds to step S810.
ステップS810において、CPU101は、図6を用いて上述したステップS606と同様に、符号化処理部114により生成された符号化画像とシンタックス情報とを、記録媒体制御部119を介してストリームデータとして記録媒体120に記録する。この後、ステップS811に移行する。
In step S810, as in step S606 described above with reference to FIG. 6, the CPU 101 converts the encoded image generated by the encoding processing unit 114 and syntax information into stream data via the recording medium control unit 119. Recording is performed on the recording medium 120. Thereafter, the process proceeds to step S811.
ステップS811において、CPU101は、図6を用いて上述したステップS607と同様に、撮影が終了したか否かを判定する。撮影が終了したとCPU101が判定した場合には(ステップS811においてYES)、ステップS812に移行する。撮影が終了していないとCPU101が判定した場合には(ステップS811においてNO)、ステップS801に移行する。
In step S811, the CPU 101 determines whether or not shooting has been completed, as in step S607 described above with reference to FIG. If CPU 101 determines that shooting has ended (YES in step S811), the process proceeds to step S812. If the CPU 101 determines that shooting has not ended (NO in step S811), the process proceeds to step S801.
ステップS812において、CPU101は、図6を用いて上述したステップS608と同様に、符号化処理部114に対して符号化処理の終了処理を行う。この後、ステップS813に移行する。
In step S812, the CPU 101 performs an encoding process end process on the encoding processing unit 114 in the same manner as in step S608 described above with reference to FIG. Thereafter, the process proceeds to step S813.
ステップS813において、CPU101は、図6を用いて上述したステップS609と同様に、ファイルを生成する処理を行う。こうして、本実施形態による画像処理装置100の動作が終了する。
In step S813, the CPU 101 performs processing for generating a file, similar to step S609 described above with reference to FIG. Thus, the operation of the image processing apparatus 100 according to the present embodiment is completed.
<符号化処理>
図9は、本実施形態による画像処理装置100によって行われる符号化処理の例を示すフローチャートである。図9に示す符号化処理は、図8のステップS809に対応するものであり、CPU101からの命令によって実行される。なお、ここでは、上述した第3の態様の場合、即ち、選択領域122についての画像群を含む第1のファイルと、全体画像124についての画像群を含む第2のファイルとが記録される場合を例に説明する。
<Encoding process>
FIG. 9 is a flowchart illustrating an example of the encoding process performed by the image processing apparatus 100 according to the present embodiment. The encoding process shown in FIG. 9 corresponds to step S809 in FIG. 8, and is executed by an instruction from the CPU 101. Here, in the case of the third aspect described above, that is, when the first file including the image group for the selected area 122 and the second file including the image group for the entire image 124 are recorded. Will be described as an example.
ステップS901において、符号化処理部114は、レジスタに設定された情報に基づいて、横長の状態から縦長の状態への変化が撮像部112に生じたか否かを判定する。横長の状態から縦長の状態への変化が撮像部112に生じた場合には(ステップS901においてYES)、ステップS902に移行する。横長の状態から縦長の状態への変化が撮像部112に生じていない場合には(ステップS901においてNO)、ステップS903に移行する。
In step S901, the encoding processing unit 114 determines whether or not the imaging unit 112 has changed from the horizontally long state to the vertically long state based on the information set in the register. When a change from the horizontally long state to the vertically long state occurs in the imaging unit 112 (YES in step S901), the process proceeds to step S902. If no change from the horizontally long state to the vertically long state has occurred in the imaging unit 112 (NO in step S901), the process proceeds to step S903.
ステップS902において、符号化処理部114は、全体画像124のうちの選択領域122以外の部分を、所定のデータに変更する。この後、ステップS903に移行する。かかる所定のデータとしては、例えば黒色の画像等が挙げられる。即ち、全体画像124のうちの選択領域122以外の部分が、例えば黒色で塗りつぶされる。
In step S902, the encoding processing unit 114 changes a part other than the selection area 122 in the entire image 124 to predetermined data. Thereafter, the process proceeds to step S903. Examples of such predetermined data include a black image. That is, the part other than the selection area 122 in the entire image 124 is painted black, for example.
ステップS903において、符号化処理部114は、図7を用いて上述したステップS701と同様に、画像分割部301によって画像の分割処理を行う。この後、ステップS904に移行する。
In step S903, the encoding processing unit 114 performs image division processing by the image dividing unit 301 in the same manner as in step S701 described above with reference to FIG. Thereafter, the process proceeds to step S904.
ステップS904において、符号化処理部114は、処理方向の決定を行う。横長の状態の撮像部112によって画像が撮像された場合には、図5(a)における左上の画素に対応するデータが画像データの先頭データであり、図5(a)における右下の画素に対応するデータが画像データの最終データである。この場合、メモリ102に格納されている画像データに対して回転させる処理を行うことを要しない。この場合、メモリ102に保持されている画像データに対して、例えば、タイル126A1、タイル126A2、タイル126Bの順に符号化処理が行われるように設定する。一方、図5(b)に示すように、縦長の状態の撮像部112によって画像が撮像された場合、図5(b)における左下の画素に対応するデータが画像データの先頭データであり、図5(b)における右上の画素に対応するデータが画像データの最終データである。この場合、メモリ102に保持されている画像データに対して左方向に90度回転させる処理が行われるような設定が行われる。そして、メモリ102に保持されている画像データに対して、例えば、タイル126C1、タイル126C2、タイル126C3、タイル126C4、タイル126Dの順に符号化処理が行われるような設定が行われる。この後、ステップS905に移行する。
In step S904, the encoding processing unit 114 determines a processing direction. When an image is captured by the horizontally long imaging unit 112, the data corresponding to the upper left pixel in FIG. 5A is the head data of the image data, and the lower right pixel in FIG. Corresponding data is the final data of the image data. In this case, it is not necessary to rotate the image data stored in the memory 102. In this case, the image data held in the memory 102 is set to be encoded in the order of the tile 126A1, the tile 126A2, and the tile 126B, for example. On the other hand, as shown in FIG. 5B, when an image is picked up by the vertically long image pickup unit 112, the data corresponding to the lower left pixel in FIG. 5B is the head data of the image data. The data corresponding to the upper right pixel in 5 (b) is the final data of the image data. In this case, setting is performed such that the image data stored in the memory 102 is rotated 90 degrees to the left. Then, for example, setting is performed on the image data held in the memory 102 such that the encoding process is performed in the order of the tile 126C1, the tile 126C2, the tile 126C3, the tile 126C4, and the tile 126D. Thereafter, the process proceeds to step S905.
ステップS905において、符号化処理部114は、図7を用いて上述したステップS702と同様に、符号量制御部307において設定される量子化テーブルにおける値、即ち、量子化値を設定する。この後、ステップS906に移行する。
In step S905, the encoding processing unit 114 sets a value in the quantization table set in the code amount control unit 307, that is, a quantization value, as in step S702 described above with reference to FIG. Thereafter, the process proceeds to step S906.
ステップS906において、符号化処理部114は、図7を用いて上述したステップS703と同様に、符号化処理部114は、全体画像124に対して符号化処理を実行する。この後、ステップS907に移行する。
In step S906, the encoding processing unit 114 performs the encoding process on the entire image 124 in the same manner as in step S703 described above with reference to FIG. Thereafter, the process proceeds to step S907.
ステップS907において、符号化処理部114は、図7を用いて上述したステップS704と同様に、シンタックス情報に様々な情報、即ち、諸情報を含める。こうして、本実施形態における符号化処理が行われる。
In step S907, the encoding processing unit 114 includes various information, that is, various kinds of information, in the syntax information, similarly to step S704 described above with reference to FIG. Thus, the encoding process in the present embodiment is performed.
このように、本実施形態によれば、撮像部112の傾きに基づいて、画像の分割の態様が適宜設定される。このため、本実施形態によれば、撮像部112の傾きが変化した場合であっても、縦長の画像と横長の画像とを並行且つ的確に取得することができる。従って、本実施形態によれば、所定の画像と選択領域の画像とを良好且つ的確に取得し得る画像処理装置を提供することができる。
As described above, according to the present embodiment, the mode of image division is appropriately set based on the inclination of the imaging unit 112. For this reason, according to the present embodiment, a vertically long image and a horizontally long image can be accurately and accurately acquired even when the inclination of the imaging unit 112 changes. Therefore, according to the present embodiment, it is possible to provide an image processing apparatus that can obtain a predetermined image and an image of a selected area in a good and accurate manner.
[変形実施形態]
以上、好適な実施形態に基づいて本発明について詳述したが、本発明はこれらの実施形態に限定されるものではなく、要旨を逸脱しない範囲での様々な形態も本発明に含まれる。
例えば、上記実施形態では、選択領域122が縦長である場合を例に説明したが、これに限定されるものではない。例えば、横長の選択領域122を設定するようにしてもよい。この場合にも、縦長の画像と横長の画像とを並行して取得することができる。
また、上記実施形態では、画像処理装置100が撮像部112を備えている場合を例に説明したが、画像処理装置100は撮像部112を有していなくてもよい。例えば、画像処理装置100の外部から入力手段(取得手段)を介して入力される画像を、本実施形態による画像処理装置100によって符号化処理するようにしてもよい。
また、上記実施形態では、画像処理装置100が表示部116を備えている場合を例に説明したが、表示部116が画像処理装置100と別個に設けられていてもよい。
[Modified Embodiment]
As mentioned above, although this invention was explained in full detail based on suitable embodiment, this invention is not limited to these embodiment, Various forms in the range which does not deviate from a summary are also contained in this invention.
For example, in the above embodiment, the case where the selection region 122 is vertically long has been described as an example, but the present invention is not limited to this. For example, a horizontally long selection area 122 may be set. Also in this case, a vertically long image and a horizontally long image can be acquired in parallel.
In the above embodiment, the case where the image processing apparatus 100 includes the imaging unit 112 has been described as an example. However, the image processing apparatus 100 may not include the imaging unit 112. For example, an image input from the outside of the image processing apparatus 100 via an input unit (acquisition unit) may be encoded by the image processing apparatus 100 according to the present embodiment.
In the above embodiment, the case where the image processing apparatus 100 includes the display unit 116 has been described as an example. However, the display unit 116 may be provided separately from the image processing apparatus 100.
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
The present invention supplies a program that realizes one or more functions of the above-described embodiments to a system or apparatus via a network or a storage medium, and one or more processors in a computer of the system or apparatus read and execute the program This process can be realized. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.