JP6403628B2 - Mask processing apparatus and method, imaging apparatus and method, program, and recording medium - Google Patents

Mask processing apparatus and method, imaging apparatus and method, program, and recording medium Download PDF

Info

Publication number
JP6403628B2
JP6403628B2 JP2015084985A JP2015084985A JP6403628B2 JP 6403628 B2 JP6403628 B2 JP 6403628B2 JP 2015084985 A JP2015084985 A JP 2015084985A JP 2015084985 A JP2015084985 A JP 2015084985A JP 6403628 B2 JP6403628 B2 JP 6403628B2
Authority
JP
Japan
Prior art keywords
coordinates
area
mask
mask processing
unit
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.)
Expired - Fee Related
Application number
JP2015084985A
Other languages
Japanese (ja)
Other versions
JP2016208147A (en
JP2016208147A5 (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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2015084985A priority Critical patent/JP6403628B2/en
Publication of JP2016208147A publication Critical patent/JP2016208147A/en
Publication of JP2016208147A5 publication Critical patent/JP2016208147A5/ja
Application granted granted Critical
Publication of JP6403628B2 publication Critical patent/JP6403628B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Closed-Circuit Television Systems (AREA)
  • Image Analysis (AREA)

Description

本発明は、パン回転及びチルト動作のための回転駆動機構を有し、かつ、画像中の隠したい領域を覆い隠すマスクを撮像画像に重畳することが可能な撮像装置及び方法、並びにそのような撮像装置及び方法で用いられるマスク処理装置及び方法に関する。本発明はまたプログラム及び記録媒体に関する。   The present invention relates to an imaging apparatus and method having a rotation drive mechanism for pan rotation and tilt operations, and capable of superimposing a mask that covers an area to be hidden in an image on a captured image, and such The present invention relates to a mask processing apparatus and method used in an imaging apparatus and method. The present invention also relates to a program and a recording medium.

従来から、パン回転及びチルト動作のための回転駆動機構を有し、かつ画像中の隠したい領域を覆い隠すマスクパターンを撮像画像に重畳することが可能な撮像装置として、パン回転およびチルト動作に連動して、撮像画像に重畳するマスクパターンを移動させることで隠したい領域を覆い隠し続けるようにしたものがある。   Conventionally, as an imaging device that has a rotation drive mechanism for pan rotation and tilt operation and can superimpose a mask pattern that covers an area to be hidden in an image on a captured image, the pan rotation and tilt operation is performed. In some cases, a mask pattern to be superimposed on a captured image is moved in conjunction with the area to be hidden and kept hidden.

このような撮像装置では、特定の撮像方向を基準方向とし、隠したい領域を構成する頂点の方向を示す情報とから、カメラ部の位置を原点とする三次元座標空間内での隠したい領域を構成する頂点の座標を算出して保存する。保存後に基準方向とは異なる方向を撮像する場合に、基準方向に対する角度の違いに基づいて、隠したい領域を算出し、該隠したい領域に対するマスクパターンを撮像画像へ重畳する。
マスクパターンとして矩形のものしか選択できない場合には、隠したい領域に外接する矩形の領域に対してマスクパターンを重畳する。
In such an imaging apparatus, a region to be hidden in a three-dimensional coordinate space with the position of the camera unit as the origin is determined from information indicating the direction of the vertex constituting the region to be hidden with a specific imaging direction as a reference direction. Calculate and save the coordinates of the vertices that make up. When a direction different from the reference direction is imaged after storage, a region to be hidden is calculated based on a difference in angle with respect to the reference direction, and a mask pattern for the region to be hidden is superimposed on the captured image.
When only a rectangular pattern can be selected as the mask pattern, the mask pattern is superimposed on a rectangular area that circumscribes the area to be hidden.

特許第3996805号公報(段落0026、第9図)Japanese Patent No. 3996805 (paragraph 0026, FIG. 9)

しかしながら、そのような構成で、例えば、保存した座標で表される領域が横方向に長い矩形である場合には、保存した座標を用いて隠したい領域が斜め方向に長い領域となり、該斜め方向に長い領域に外接する矩形の領域が極めて大きなものとなり、本来表示したい領域も隠されてしまうことがあり、問題であった。   However, in such a configuration, for example, when the area represented by the saved coordinates is a rectangle that is long in the horizontal direction, the area that is desired to be hidden using the saved coordinates becomes a long area in the diagonal direction, and the diagonal direction In particular, a rectangular area circumscribing a long area becomes extremely large, and an area to be originally displayed may be hidden, which is a problem.

本発明は、上述の問題を解決するためになされたもので、本来表示したい領域ができるだけ隠れないように、かつ隠したい領域を確実に隠すことができるようにすることを目的とする。   The present invention has been made to solve the above-described problem, and an object of the present invention is to make it possible to reliably hide an area to be hidden so that the area to be originally displayed is not hidden as much as possible.

本発明の第1の態様のマスク処理装置は、
焦点距離が変更可能で、被写体からの光を集光して光学像を形成するズームレンズと、前記ズームレンズで形成された光学像を電気信号に変換して撮像画像を出力する撮像素子とを含むカメラ部と、前記カメラ部に対してパン駆動及びチルト駆動を行う回転駆動機構とを有する撮像装置のマスク処理装置であって、
前記カメラ部の撮像方向を示す方向情報と、前記ズームレンズの焦点距離を示す焦点距離情報とを取得する撮像条件取得部と、
前記カメラ部が前記ズームレンズの焦点距離を第1の焦点距離とし、撮像方向を第1の撮像方向として、撮像を行うことで得られた第1の撮像画像内で、マスク領域として指定された矩形の領域の座標を、第1の仮想平面上の座標に変換する指定領域変換部と、
前記第1の仮想平面上の座標で定義される矩形の領域の水平方向の辺及び垂直方向の辺の内の短い方に対する長い方の比が予め定められた上限値よりも大きいときに、前記矩形の領域の形状を変更し、変更によって生成された矩形の領域の頂点の座標を生成する指定領域補正部と、
前記指定領域補正部で生成された頂点の座標を、仮想球面上の座標に変換する球面座標算出部と、
前記球面座標算出部で算出された前記仮想球面上の座標を記憶するマスク領域記憶部と、
前記カメラ部が前記ズームレンズの焦点距離を第2の焦点距離とし、撮像方向を第2の撮像方向として、撮像を行うことで第2の撮像画像が生成されたとき、前記マスク領域記憶部から前記仮想球面上の座標を読出し、第2の仮想平面上の座標に変換する平面座標算出部と、
前記平面座標算出部における変換で得られた、前記第2の仮想平面上の座標を、前記第2の撮像画像内の座標に変換し、この変換により得られた座標で定義される領域に外接する矩形の領域をマスク処理領域として算出するマスク処理領域算出部とを有し、
前記指定領域補正部は、前記第1の仮想平面上の座標で定義される矩形の領域の水平方向の辺と垂直方向の辺のうち、長い方の長さを短い方の長さに一致するように変更する
ことを特徴とする。
The mask processing apparatus according to the first aspect of the present invention comprises:
A zoom lens that can change a focal length, collects light from a subject to form an optical image, and an imaging device that converts the optical image formed by the zoom lens into an electrical signal and outputs a captured image A mask processing apparatus for an imaging apparatus, comprising: a camera unit including: a rotation driving mechanism that performs pan driving and tilt driving with respect to the camera unit;
An imaging condition acquisition unit that acquires direction information indicating an imaging direction of the camera unit and focal length information indicating a focal length of the zoom lens;
The camera unit is designated as a mask region in a first captured image obtained by performing imaging with the focal length of the zoom lens as the first focal length and the imaging direction as the first imaging direction. A designated area conversion unit for converting the coordinates of the rectangular area into coordinates on the first virtual plane;
When the ratio of the longer side to the shorter side of the horizontal side and the vertical side of the rectangular region defined by the coordinates on the first virtual plane is larger than a predetermined upper limit value, A designated area correction unit that changes the shape of the rectangular area and generates the coordinates of the vertices of the rectangular area generated by the change;
A spherical coordinate calculation unit that converts the coordinates of the vertex generated by the specified region correction unit into coordinates on a virtual sphere,
A mask area storage unit for storing coordinates on the virtual sphere calculated by the spherical coordinate calculation unit;
When the camera unit generates a second captured image by performing imaging with the focal length of the zoom lens as the second focal length and the imaging direction as the second imaging direction, from the mask area storage unit A plane coordinate calculation unit that reads coordinates on the virtual sphere and converts them into coordinates on a second virtual plane;
The coordinates on the second virtual plane obtained by the conversion in the plane coordinate calculation unit are converted into coordinates in the second captured image, and circumscribed in the area defined by the coordinates obtained by the conversion. A mask processing area calculation unit that calculates a rectangular area to be used as a mask processing area,
The designated area correction unit matches a longer length with a shorter length of a horizontal side and a vertical side of a rectangular region defined by coordinates on the first virtual plane. It is characterized by changing as follows.

本発明の第2の態様のマスク処理装置は、
焦点距離が変更可能で、被写体からの光を集光して光学像を形成するズームレンズと、前記ズームレンズで形成された光学像を電気信号に変換して撮像画像を出力する撮像素子とを含むカメラ部と、
前記カメラ部に対してパン駆動及びチルト駆動を行う回転駆動機構とを有する撮像装置のマスク処理装置であって、
前記カメラ部の撮像方向を示す方向情報と、前記ズームレンズの焦点距離を示す焦点距離情報とを取得する撮像条件取得部と、
前記カメラ部が前記ズームレンズの焦点距離を第1の焦点距離とし、撮像方向を第1の撮像方向として、撮像を行うことで得られた第1の撮像画像内で、マスク領域として指定された矩形の領域の座標を、第1の仮想平面上の座標に変換する指定領域変換部と、
前記第1の仮想平面上の座標で定義される矩形の領域の水平方向の辺及び垂直方向の辺の内の短い方に対する長い方の比が予め定められた上限値よりも大きいときに、前記矩形の領域を複数の矩形の小領域に分割し、前記複数の小領域の各々の頂点の座標を生成する指定領域補正部と、
前記指定領域補正部で生成された、前記複数の小領域の各々についての前記頂点の座標を、仮想球面上の座標に変換する球面座標算出部と、
前記球面座標算出部で算出された、前記複数の小領域の各々についての、前記仮想球面上の座標を記憶するマスク領域記憶部と、
前記カメラ部が前記ズームレンズの焦点距離を第2の焦点距離とし、撮像方向を第2の撮像方向として、撮像を行うことで第2の撮像画像が生成されたとき、前記マスク領域記憶部から前記複数の小領域の各々についての前記仮想球面上の座標を読出し、第2の仮想平面上の座標に変換する平面座標算出部と、
前記平面座標算出部における変換で得られた、前記複数の小領域の各々についての、前記第2の仮想平面上の座標を、前記第2の撮像画像内の座標に変換し、この変換により得られた座標で定義される複数の小領域の各々に外接する複数の矩形の領域を複数のマスク処理領域として算出するマスク処理領域算出部とを有し、
前記指定領域補正部は、前記第1の仮想平面上の座標で定義される矩形の領域を、複数の矩形の小領域に分割し、
前記分割を、前記小領域の各々において、水平方向の辺と垂直方向の辺のうち、短い方の長さに対する長い方の長さの比が、予め定められた閾値以下となるように行う
ことを特徴とする。
The mask processing apparatus according to the second aspect of the present invention comprises:
A zoom lens that can change a focal length, collects light from a subject to form an optical image, and an imaging device that converts the optical image formed by the zoom lens into an electrical signal and outputs a captured image Including a camera part;
A mask processing apparatus of an imaging apparatus having a rotation drive mechanism that performs pan driving and tilt driving with respect to the camera unit,
An imaging condition acquisition unit that acquires direction information indicating an imaging direction of the camera unit and focal length information indicating a focal length of the zoom lens;
The camera unit is designated as a mask region in a first captured image obtained by performing imaging with the focal length of the zoom lens as the first focal length and the imaging direction as the first imaging direction. A designated area conversion unit for converting the coordinates of the rectangular area into coordinates on the first virtual plane;
When the ratio of the longer side to the shorter side of the horizontal side and the vertical side of the rectangular region defined by the coordinates on the first virtual plane is larger than a predetermined upper limit value, A designated area correction unit that divides a rectangular area into a plurality of rectangular small areas and generates coordinates of each vertex of the plurality of small areas;
A spherical coordinate calculation unit that converts the coordinates of the vertex for each of the plurality of small regions generated by the designated region correction unit into coordinates on a virtual sphere,
A mask area storage unit for storing coordinates on the virtual sphere for each of the plurality of small areas calculated by the spherical coordinate calculation unit;
When the camera unit generates a second captured image by performing imaging with the focal length of the zoom lens as the second focal length and the imaging direction as the second imaging direction, from the mask area storage unit A plane coordinate calculation unit that reads coordinates on the virtual sphere for each of the plurality of small regions and converts the coordinates to coordinates on a second virtual plane;
The coordinates on the second virtual plane for each of the plurality of small regions obtained by the conversion in the plane coordinate calculation unit are converted into coordinates in the second captured image, and obtained by this conversion. A mask processing area calculation unit that calculates a plurality of rectangular areas circumscribing each of the plurality of small areas defined by the given coordinates as a plurality of mask processing areas;
The designated area correction unit divides a rectangular area defined by coordinates on the first virtual plane into a plurality of rectangular small areas,
The division is performed so that, in each of the small regions, a ratio of a longer length to a shorter length of a horizontal side and a vertical side is equal to or less than a predetermined threshold value. It is characterized by.

本発明によれば、マスク領域の設定時とその後の撮像時とで撮像方向が異なるためにマスク処理を施す領域が極めて大きくなってしまい、そのために本来隠したくない領域が隠されてしまうのを防ぐことができる。   According to the present invention, since the imaging direction is different between the setting of the mask area and the subsequent imaging, the area to be masked becomes very large, so that the area that is not originally intended to be hidden is hidden. Can be prevented.

本発明の実施の形態1の撮像装置を示すブロック図である。It is a block diagram which shows the imaging device of Embodiment 1 of this invention. 図1の表示装置を用いて行われるマスク領域の指定の方法を示す概略図である。It is the schematic which shows the designation | designated method of the mask area | region performed using the display apparatus of FIG. 本発明の実施の形態1のマスク処理装置を示すブロック図である。It is a block diagram which shows the mask processing apparatus of Embodiment 1 of this invention. 撮像装置のカメラ部を原点とする三次元座標空間において、マスク領域の設定時に、撮像方向がZ軸方向に一致する場合の撮像画像と仮想球面の関係を示す図である。It is a figure which shows the relationship between the picked-up image and a virtual spherical surface in the case of the setting of a mask area | region in the three-dimensional coordinate space which makes the camera part of an imaging device the origin at the time of an imaging direction corresponding to a Z-axis direction. (a)及び(b)は、指定されたマスク領域の、撮像画像上の座標から仮想平面上の座標への変換を示す図である。(A) And (b) is a figure which shows the conversion from the coordinate on the picked-up image of the designated mask area | region to the coordinate on a virtual plane. (a)及び(b)は、マスク領域の補正を示す図である。(A) And (b) is a figure which shows correction | amendment of a mask area | region. マスク領域の、仮想平面から仮想球面への射影を示す図である。It is a figure which shows the projection from a virtual plane to a virtual spherical surface of a mask area | region. 基準方向とは異なる撮像方向の例を示す図である。It is a figure which shows the example of the imaging direction different from a reference direction. マスク領域の頂点の、撮像方向への回転移動を示す図である。It is a figure which shows the rotational movement to the imaging direction of the vertex of a mask area | region. マスク領域の頂点の、撮像方向から基準方向への回転移動を示す図である。It is a figure which shows the rotational movement of the vertex of a mask area | region from the imaging direction to a reference direction. マスク領域の頂点の、仮想球面から仮想平面への射影、及び仮想平面から撮像画像への写像を示す図である。It is a figure which shows the projection from the virtual spherical surface to a virtual plane, and the mapping from a virtual plane to a captured image of the vertex of a mask area | region. (a)及び(b)は、仮想平面から撮像画像への座標変換、及びマスク領域の決定方法を示す図である。(A) And (b) is a figure which shows the coordinate transformation from a virtual plane to a captured image, and the determination method of a mask area | region. (a)及び(b)は、本発明の実施の形態2における指定領域の補正の例を示す図である。(A) And (b) is a figure which shows the example of correction | amendment of the designated area | region in Embodiment 2 of this invention. 本発明の実施の形態3のマスク処理装置を示すブロック図である。It is a block diagram which shows the mask processing apparatus of Embodiment 3 of this invention. (a)から(e)は、実施の形態3における指定領域の補正、及び補正されたマスク領域を用いたマスク処理領域の算出の例、並びに従来例における処理を示す図である。(A) to (e) are diagrams showing an example of correction of a designated region and calculation of a mask processing region using the corrected mask region in Embodiment 3, and processing in a conventional example. (a)、(b)及び(c)は、実施の形態3における指定領域の分割の異なる例を示す図である。(A), (b) and (c) is a figure which shows the example from which the division | segmentation of the designated area | region in Embodiment 3 differs. 本発明の実施の形態4のマスク処理装置を示すブロック図である。It is a block diagram which shows the mask processing apparatus of Embodiment 4 of this invention. 実施の形態4におけるマスク領域の補正の例を示す図である。FIG. 10 is a diagram illustrating an example of mask area correction in the fourth embodiment. 実施の形態4におけるマスク領域の補正の他の例を示す図である。FIG. 20 is a diagram showing another example of mask area correction in the fourth embodiment. 本発明の処理を実行するコンピュータの例を示すブロック図である。It is a block diagram which shows the example of the computer which performs the process of this invention.

実施の形態1.
図1は本発明の実施の形態1の撮像装置の構成を示す図である。
図示の撮像装置は、回転駆動機構11と、ズームレンズ12と、撮像素子13と、第1の画像処理部としての前処理部15と、第2の画像処理部としての後処理部17と、映像信号出力端子18と、制御部19と、マスク処理装置20とを備える。映像信号出力端子18には表示装置22が接続され、表示装置22に設けられた操作入力部23が、制御部19に接続されている。
Embodiment 1 FIG.
FIG. 1 is a diagram showing a configuration of an imaging apparatus according to Embodiment 1 of the present invention.
The illustrated imaging apparatus includes a rotation drive mechanism 11, a zoom lens 12, an imaging element 13, a pre-processing unit 15 as a first image processing unit, a post-processing unit 17 as a second image processing unit, A video signal output terminal 18, a control unit 19, and a mask processing device 20 are provided. A display device 22 is connected to the video signal output terminal 18, and an operation input unit 23 provided in the display device 22 is connected to the control unit 19.

ズームレンズ12は、被写体からの光を集光し、撮像素子13の撮像面に光学像を形成する。   The zoom lens 12 condenses light from the subject and forms an optical image on the imaging surface of the imaging element 13.

撮像素子13は、CCDあるいはCMOSイメージセンサから成り、ズームレンズ12により形成された光学像を電気信号に変換し、撮像画像を表すアナログ画像信号Daを出力する。
ズームレンズ12と撮像素子13とで、カメラ部14が構成される。
The image sensor 13 is composed of a CCD or a CMOS image sensor, converts an optical image formed by the zoom lens 12 into an electric signal, and outputs an analog image signal Da representing a captured image.
The zoom lens 12 and the image sensor 13 constitute a camera unit 14.

制御部19は、カメラ部14による撮像方向(ズームレンズ12の光軸の方向)を制御するために、撮像方向の指定値SDR、即ち、パン角度の指定値φd及びチルト角度の指定値θdを回転駆動機構11に出力する。このパン角度の指定値φd及びチルト角度の指定値θdは、カメラ部14がある特定の方向を向いているときの撮像方向を基準方向とする相対的な値で表されるものである。   The control unit 19 controls the imaging direction designation value SDR, that is, the pan angle designation value φd and the tilt angle designation value θd, in order to control the imaging direction by the camera unit 14 (the direction of the optical axis of the zoom lens 12). Output to the rotation drive mechanism 11. The pan angle specified value φd and the tilt angle specified value θd are expressed as relative values with the imaging direction when the camera unit 14 is facing a certain direction as a reference direction.

回転駆動機構11は、制御部19から出力される撮像方向の指定値SDR、即ちパン角度の指定値φd及びチルト角度の指定値θdに応じて、カメラ部14のパン角度及びチルト角度を変更する。   The rotation drive mechanism 11 changes the pan angle and tilt angle of the camera unit 14 according to the designated value SDR of the imaging direction output from the control unit 19, that is, the designated value φd of the pan angle and the designated value θd of the tilt angle. .

制御部19はまた、ズームレンズ12の焦点距離の指定値FLDをズームレンズ12に出力する。焦点距離を変えることで、ズームレンズの光学倍率を変更することができる。ズームレンズ12の光学倍率は、ズームレンズ12が最広角状態にあるときの焦点距離を基準焦点距離として表される。即ち、光学倍率は、基準焦点距離に対する撮像時の焦点距離の比に対応する。   The control unit 19 also outputs a designated value FLD of the focal length of the zoom lens 12 to the zoom lens 12. The optical magnification of the zoom lens can be changed by changing the focal length. The optical magnification of the zoom lens 12 is expressed by using the focal length when the zoom lens 12 is in the widest angle state as a reference focal length. That is, the optical magnification corresponds to the ratio of the focal length at the time of imaging to the reference focal length.

ズームレンズ12は、制御部19から出力される焦点距離の指定値FLDに応じてその焦点距離を変える。   The zoom lens 12 changes the focal length according to the designated value FLD of the focal length output from the control unit 19.

前処理部15は、撮像素子13からのアナログ画像信号Daに対して、CDS(相関二重サンプリング)処理、ゲイン処理、A/D変換処理等を行い、撮像画像を表すデジタル画像信号Dbを出力する。
撮像素子13と前処理部15とで、被写体を撮像し、撮像画像を表すデジタル画像信号Dbを出力する撮像部16が構成されている。
The preprocessing unit 15 performs CDS (correlated double sampling) processing, gain processing, A / D conversion processing, and the like on the analog image signal Da from the image sensor 13, and outputs a digital image signal Db representing the captured image. To do.
The imaging device 13 and the preprocessing unit 15 constitute an imaging unit 16 that images a subject and outputs a digital image signal Db representing the captured image.

制御部19はさらに、表示装置22の操作入力部23からマスク領域指定情報MRDを受けて、出力する。マスク領域は、撮像画像中の、例えばプライバシー保護のために、或いはセキュリティー上の理由で、表示等の出力の際に覆い隠したい領域である。プライバシー保護のために覆い隠したい領域の例として住居の窓の部分がある。セキュリティー上の理由で覆い隠したい領域の例としては、入場が制限される管理区域の入口でパスワード入力のための利用されるキー操作部がある。   The control unit 19 further receives and outputs the mask region designation information MRD from the operation input unit 23 of the display device 22. The mask area is an area in the captured image that is desired to be covered when outputting for display or the like for privacy protection or for security reasons. An example of an area to be covered for privacy protection is a window portion of a residence. An example of an area to be covered for security reasons is a key operation unit used for password entry at the entrance of a management area where entry is restricted.

マスク領域の指定は、撮像装置で撮像した画像の一部の領域を指定することで行われる。例えば、図2に示されるように、撮像した画像を表示装置22の表示画面24に表示し、操作入力部23(図1)を用いてマスク領域Mjの頂点の、例えば撮像画像内における位置が指定される。   The mask area is designated by designating a partial area of the image picked up by the image pickup apparatus. For example, as shown in FIG. 2, the captured image is displayed on the display screen 24 of the display device 22, and the position of the vertex of the mask region Mj in the captured image is determined using the operation input unit 23 (FIG. 1), for example. It is specified.

指定されるマスク領域Mjは、例えば、矩形の領域とされる。この場合、マスク領域指定情報MRDは、指定されたマスク領域(マスク指定領域)Mjの4頂点の座標Jn(Jnx,Jny)(n=1,2,3,4)で構成される。   The designated mask area Mj is, for example, a rectangular area. In this case, the mask area designation information MRD is composed of coordinates Jn (Jnx, Jny) (n = 1, 2, 3, 4) of the four vertices of the designated mask area (mask designation area) Mj.

矩形のマスク領域Mjは、例えば表示画面24の水平方向及び垂直方向に延びた辺から成る矩形の領域とされる。この場合、ユーザーがマスク領域Mjの対角位置にある2つの頂点、例えば、左上の頂点及び右下の頂点の位置を指定すると、これによって、マスク領域Mjの他の2つの頂点の位置も自動的に指定される。   The rectangular mask area Mj is, for example, a rectangular area composed of sides extending in the horizontal direction and the vertical direction of the display screen 24. In this case, when the user designates the positions of two vertices at the diagonal position of the mask area Mj, for example, the upper left vertex and the lower right vertex, this also automatically positions the other two vertices of the mask area Mj. Specified.

マスク処理装置20は、マスク領域Mjの指定によって生成されたマスク領域指定情報MRDと、当該マスク領域Mjの指定の際に用いられた画像の撮像の際の撮像方向の指定値SDR、即ち、パン角度の指定値φd及びチルト角度の指定値θdと、焦点距離の指定値FLDとから、当該マスク領域指定情報MRDで示されるマスク領域を補正し、座標変換を施し、座標変換後のマスク領域の4頂点の座標Rnを登録する。頂点の座標Rnを登録する処理を、当該頂点で構成されるマスク領域の設定、或いは設定マスク領域の登録と言う。登録された座標Rnは、その後の撮像で得られた撮像画像中のマスクすべき領域の決定に利用される。   The mask processing device 20 includes the mask area designation information MRD generated by the designation of the mask area Mj and the designation value SDR of the imaging direction at the time of imaging of the image used at the time of designation of the mask area Mj, that is, panning The mask area indicated by the mask area specifying information MRD is corrected from the specified angle φd and tilt angle specified value θd, and the specified focal length FLD, coordinate conversion is performed, and the mask area after the coordinate conversion is corrected. The coordinates Rn of the four vertices are registered. The process of registering the vertex coordinate Rn is referred to as setting of a mask area constituted by the vertex or registration of a set mask area. The registered coordinates Rn are used for determining a region to be masked in a captured image obtained by subsequent imaging.

マスク処理装置20は、マスク領域の設定後の撮像時には、当該撮像時の撮像方向の指定値SDR、即ちパン角度の指定値φd及びチルト角度の指定値θdと、焦点距離の指定値FLDと、設定されたマスク領域の4頂点の座標Rnとから、撮像画像中のマスク処理領域を算出し、後処理部17へ出力する。   At the time of imaging after setting the mask area, the mask processing device 20 specifies the specified value SDR of the imaging direction at the time of imaging, that is, the specified value φd of the pan angle and the specified value θd of the tilt angle, the specified value FLD of the focal length, From the coordinates Rn of the four vertices of the set mask area, a mask processing area in the captured image is calculated and output to the post-processing unit 17.

後処理部17は、マスク領域の設定の際には、操作入力部23を用いて指定されたマスク領域、又は指定されたマスク領域に対してマスク処理装置20で後述のように補正を加えることで生成された、補正後のマスク領域を示す画像(例えば領域の輪郭線を示す画像)MPAを、前処理部15から出力される撮像画像に重畳する。   When setting the mask area, the post-processing unit 17 applies correction to the mask area designated using the operation input unit 23 or the designated mask area as described later by the mask processing apparatus 20. The image indicating the mask area after correction (for example, the image indicating the outline of the area) MPA generated in step S is superimposed on the captured image output from the preprocessing unit 15.

後処理部17は、マスク領域の設定後の撮像の際には、前処理部15から出力された画像に対して、マスク処理装置20から出力されるマスク処理領域を示す情報MPBに基づいて、マスク処理を行う。
マスク処理は、前処理部15から出力された画像のうち、マスク処理領域に対応する部分に対する、塗りつぶしのための塗りつぶしパターンの重畳、別に用意された画像での置き換え、モザイク処理などにより行われる。
The post-processing unit 17 performs the imaging after setting the mask region based on the information MPB indicating the mask processing region output from the mask processing device 20 for the image output from the pre-processing unit 15. Perform mask processing.
The mask processing is performed by superimposing a fill pattern for filling, replacing with a separately prepared image, mosaic processing, or the like on a portion corresponding to the mask processing area in the image output from the preprocessing unit 15.

後処理部17は、前処理部15から出力される撮像画像に対して、上記のように指定されたマスク領域を示す情報の重畳又は上記のマスク処理を行った後、映像信号出力端子18に接続された表示装置22、或いはその他の出力装置の特性に応じた処理、例えば、YCbCr変換、カラーマトリクス変換、階調変換を行い、処理によって生成された映像信号Dcを映像信号出力端子18から出力する。   The post-processing unit 17 superimposes the information indicating the mask area specified as described above on the captured image output from the pre-processing unit 15 or performs the mask processing described above, and then outputs the image signal to the video signal output terminal 18. Processing corresponding to the characteristics of the connected display device 22 or other output device, for example, YCbCr conversion, color matrix conversion, and gradation conversion is performed, and the video signal Dc generated by the processing is output from the video signal output terminal 18 To do.

以下、マスク処理装置20の一例について図3を用いて説明する。
図3に示されるマスク処理装置20は、撮像条件取得部31と、指定領域変換部32と、マスク領域登録部33と、マスク領域記憶部34と、平面座標算出部35と、マスク処理領域算出部36と、指定領域逆変換部37とを備える。
Hereinafter, an example of the mask processing apparatus 20 will be described with reference to FIG.
The mask processing device 20 shown in FIG. 3 includes an imaging condition acquisition unit 31, a designated region conversion unit 32, a mask region registration unit 33, a mask region storage unit 34, a plane coordinate calculation unit 35, and a mask processing region calculation. Unit 36 and a designated region inverse transform unit 37.

撮像条件取得部31は、マスク領域の設定の際に、制御部19から出力される、撮像方向の指定値SDR、即ちカメラ部14のパン角度の指定値φd及びチルト角度の指定値θdを、マスク領域登録部33に供給し、制御部19から出力される焦点距離の指定値FLDを、指定領域変換部32に供給する。   The imaging condition acquisition unit 31 outputs the specified value SDR of the imaging direction, that is, the specified value φd of the pan angle and the specified value θd of the tilt angle of the camera unit 14 output from the control unit 19 when setting the mask area. The designated value FLD of the focal length supplied to the mask area registration unit 33 and output from the control unit 19 is supplied to the designated area conversion unit 32.

撮像条件取得部31は、マスク領域の設定後の撮像の際に、制御部19から出力される、撮像方向の指定値SDR、即ち、カメラ部14のパン角度の指定値φd及びチルト角度の指定値θdを、平面座標算出部35に供給し、制御部19から出力される焦点距離の指定値FLDを、マスク処理領域算出部36に供給する。   The imaging condition acquisition unit 31 outputs an imaging direction designation value SDR output from the control unit 19, that is, a panning angle designation value φd and a tilt angle designation, which are output from the control unit 19 at the time of imaging after setting the mask area. The value θd is supplied to the plane coordinate calculation unit 35, and the designated focal length value FLD output from the control unit 19 is supplied to the mask processing region calculation unit 36.

なお、以下の説明で、撮像方向の指定値SDRで指定される撮像方向を同じ符号「SDR」で示し、パン角度の指定値φd及びチルト角度の指定値θdで指定されるパン角度及びチルト角度を同じ符号「φd」、「θd」で示す。他の符号についても同様である。また、マスク領域の設定の際の撮像方向と、マスク領域設定後の撮像の際の撮像方向との区別のため、前者を符号「SDRm」、「φm」、「θm」で表し、後者を「SDRv」、「φv」、「θv」で表すことがある。   In the following description, the imaging direction designated by the designated value SDR of the imaging direction is indicated by the same symbol “SDR”, and the pan angle and tilt angle designated by the pan angle designated value φd and the tilt angle designated value θd. Are denoted by the same reference numerals “φd” and “θd”. The same applies to other codes. Further, in order to distinguish between the imaging direction when setting the mask area and the imaging direction when imaging after setting the mask area, the former is represented by reference numerals “SDRm”, “φm”, and “θm”, and the latter is “ It may be represented by “SDRv”, “φv”, “θv”.

指定領域変換部32は、マスク領域の設定の際に、制御部19から出力されるマスク領域指定情報MRDと焦点距離の指定値FLDとから、上記の基準焦点距離に換算したマスク指定領域を構成する4頂点の座標Pn(n=1,2,3,4)を算出し、マスク領域登録部33へ出力する。   The designated area conversion unit 32 forms a mask designated area converted into the reference focal length from the mask area designation information MRD output from the control unit 19 and the designated value FLD of the focal length when setting the mask area. The coordinates Pn (n = 1, 2, 3, 4) of the four vertices to be calculated are calculated and output to the mask area registration unit 33.

マスク領域登録部33は、マスク領域の設定の際に、指定領域変換部32から出力されるマスク指定領域を構成する4頂点の座標Pnに対して後述する処理を行い、処理の結果得られる4頂点の座標Rnを、設定マスク領域の4頂点の座標として、マスク領域記憶部34に記憶させる。   When setting the mask area, the mask area registration unit 33 performs a process to be described later on the coordinates Pn of the four vertices constituting the mask designation area output from the designation area conversion unit 32, and 4 obtained as a result of the process. The vertex coordinates Rn are stored in the mask area storage unit 34 as the coordinates of the four vertices of the set mask area.

平面座標算出部35は、マスク領域の設定後の撮像の際に、マスク領域記憶部34に記憶されている設定マスク領域の4頂点の座標Rnを読み出し、撮像条件取得部31から出力される現在のパン角度の指定値φdとチルト角度の指定値θdから、上記の基準焦点距離に換算された平面座標Tn(n=1,2,3,4)を算出する。   The plane coordinate calculation unit 35 reads the coordinates Rn of the four vertices of the set mask area stored in the mask area storage unit 34 at the time of imaging after setting the mask area, and is output from the imaging condition acquisition unit 31 The plane coordinates Tn (n = 1, 2, 3, 4) converted to the reference focal length are calculated from the pan angle specified value φd and the tilt angle specified value θd.

マスク処理領域算出部36は、平面座標算出部35が出力する平面座標Tnに対して、撮像条件取得部31から出力される現在の焦点距離の指定値FLDに応じた変換を行い、現在の撮像画像中のマスク処理領域を算出し、その開始座標(SUx,SUy)と終了座標(EUx,EUy)を算出し、マスク処理領域を示す情報MPBとして後処理部17へ出力する。   The mask processing area calculation unit 36 performs conversion according to the designated value FLD of the current focal length output from the imaging condition acquisition unit 31 with respect to the plane coordinate Tn output from the plane coordinate calculation unit 35, and performs current imaging. The mask processing area in the image is calculated, the start coordinates (SUx, SUy) and the end coordinates (EUx, EUy) are calculated, and output to the post-processing unit 17 as information MPB indicating the mask processing area.

以下に指定領域変換部32、マスク領域登録部33、マスク領域記憶部34、平面座標算出部35、及びマスク処理領域算出部36の動作をより詳細に説明する。   Hereinafter, the operations of the designated region conversion unit 32, the mask region registration unit 33, the mask region storage unit 34, the plane coordinate calculation unit 35, and the mask processing region calculation unit 36 will be described in more detail.

上記のように、マスク領域の指定は、撮像画像中の隠したい領域を、操作入力部23を用いて指定することで行われる。領域の指定は、領域の頂点の位置を入力することで行われる。   As described above, the mask area is specified by specifying the area to be hidden in the captured image using the operation input unit 23. The area is specified by inputting the position of the vertex of the area.

指定領域変換部32には、上記のマスク領域の指定により生成されたマスク領域指定情報MRDが制御部19から与えられ、これとともに、撮像条件取得部31から、当該マスク領域の指定に用いられた画像の撮像の際の焦点距離の指定値FLDが与えられる。
マスク領域指定情報MRDとしては、撮像画像中の撮像画像内のマスク指定領域の4頂点の座標Jn(Jnx,Jny)(n=1,2,3,4)を示す情報が与えられる。
The designated area conversion unit 32 is provided with mask area designation information MRD generated by designation of the mask area from the control unit 19 and is used for designation of the mask area from the imaging condition acquisition unit 31. A designated value FLD of a focal length at the time of imaging is given.
As the mask area designation information MRD, information indicating the coordinates Jn (Jnx, Jny) (n = 1, 2, 3, 4) of the four vertices of the mask designation area in the captured image in the captured image is given.

指定領域変換部32は、与えられたマスク領域指定情報MRDと、焦点距離の指定値FLDとから、上記の基準焦点距離に換算したマスク指定領域を構成する4頂点の座標Pn(Pnx,Pny,Pnz)(n=1,2,3,4)を算出し、マスク領域登録部33へ出力する。   The designated area conversion unit 32 uses the given mask area designation information MRD and the designated focal length value FLD to set the coordinates Pn (Pnx, Pny, Pny, 4 vertexes) of the mask designated area converted to the reference focal length. Pnz) (n = 1, 2, 3, 4) is calculated and output to the mask area registration unit 33.

基準焦点距離に換算したマスク指定領域とは、ズームレンズ12の焦点距離を基準焦点距離としたとき(ズームレンズ12を最広角にしたとき)のマスク指定領域である。   The mask designation area converted into the reference focal length is a mask designation area when the focal length of the zoom lens 12 is set as the reference focal length (when the zoom lens 12 is at the widest angle).

以下、指定領域変換部32における処理及び後述のマスク領域登録部33における処理を、図4を参照して説明する。   Hereinafter, a process in the designated area conversion unit 32 and a process in a mask area registration unit 33 described later will be described with reference to FIG.

図4には、カメラ部14の位置を原点として、互いに直交するX軸、Y軸及びZ軸を座標軸とする三次元座標空間内に位置し、原点を中心とし、半径が1である仮想球面SPが示されている。以下では、Z軸の方向を基準方向とする。   FIG. 4 shows a virtual spherical surface that is located in a three-dimensional coordinate space with the position of the camera unit 14 as the origin and the X, Y, and Z axes orthogonal to each other as the coordinate axes, the origin is the center, and the radius is 1. SP is shown. In the following, the direction of the Z-axis is the reference direction.

ズームレンズ12の焦点距離が基準焦点距離に等しいときには、撮像画像が上記の仮想球面SPに接する平面上に形成される。従って、上記の基準焦点距離に換算されたマスク指定領域を構成する4頂点の座標Pn(n=1,2,3,4)は、上記の仮想球面SPに接する平面上の座標である。
また、撮像方向(撮像画像の中心の方向)が基準方向(Z軸方向)に一致する場合、上記の4頂点の座標Pnは、Z軸に垂直で、上記の仮想球面SPに接する平面PLr上の座標である。
When the focal length of the zoom lens 12 is equal to the reference focal length, the captured image is formed on a plane that is in contact with the virtual spherical surface SP. Accordingly, the coordinates Pn (n = 1, 2, 3, 4) of the four vertices constituting the mask designation area converted into the reference focal length are coordinates on the plane that is in contact with the virtual spherical surface SP.
When the imaging direction (the direction of the center of the captured image) matches the reference direction (Z-axis direction), the coordinates Pn of the four vertices are on the plane PLr that is perpendicular to the Z-axis and touches the virtual spherical surface SP. Coordinates.

仮想平面PLrは、Z軸に垂直で、仮想球面SPに接しているので、仮想平面PLrでは、Z=1である。また仮想平面PLrは、その座標軸Px及びPyが三次元座標空間のX軸及びY軸に平行である。
仮想平面PLrはZ軸に垂直であるので、撮像画像JLの撮像の際の撮像方向(ここではZ軸方向であると仮定している)に垂直であり、従って撮像画像(撮像画像が形成される面)JLに平行であると見ることができ、仮想平面PLrの水平方向の座標軸Px及び垂直方向の座標軸Pyが、撮像画像JLの水平方向の座標軸Jx及び垂直方向の座標軸Jyとそれぞれ平行である。
但し、仮想平面PLrでは、原点の位置及び座標軸の向きが、撮像画像とは異なる。
Since the virtual plane PLr is perpendicular to the Z axis and touches the virtual spherical surface SP, Z = 1 in the virtual plane PLr. The virtual plane PLr has its coordinate axes Px and Py parallel to the X axis and Y axis of the three-dimensional coordinate space.
Since the virtual plane PLr is perpendicular to the Z-axis, the virtual plane PLr is perpendicular to the imaging direction (here, assumed to be the Z-axis direction) when the captured image JL is captured, and thus the captured image (captured image is formed). The horizontal coordinate axis Px and the vertical coordinate axis Py of the virtual plane PLr are parallel to the horizontal coordinate axis Jx and the vertical coordinate axis Jy of the captured image JL, respectively. is there.
However, in the virtual plane PLr, the position of the origin and the direction of the coordinate axis are different from the captured image.

撮像画像JLの座標軸と仮想平面PLrの座標軸の関係を図5(a)及び(b)を参照して説明する。図5(a)及び(b)は、図4の撮像画像JL及び仮想平面PLrを下方から見た図である。   The relationship between the coordinate axis of the captured image JL and the coordinate axis of the virtual plane PLr will be described with reference to FIGS. 5 (a) and 5 (b). 5A and 5B are views of the captured image JL and the virtual plane PLr of FIG. 4 as viewed from below.

撮像画像JL上の座標は、図5(a)に示すように、撮像画像JLの左上隅を原点として、水平方向の座標軸Jxが右向きに延び、垂直方向の座標軸Jyが下向きに延びている。
一方、仮想平面PLr上の座標は、図5(b)に示すように、Z軸との交点を原点とし、水平方向の座標軸Pxが左向きに延び、垂直方向の座標軸Pyが上向きに延びている。
As shown in FIG. 5A, the coordinates on the captured image JL are such that the horizontal coordinate axis Jx extends rightward and the vertical coordinate axis Jy extends downward, with the upper left corner of the captured image JL as the origin.
On the other hand, as shown in FIG. 5B, the coordinates on the virtual plane PLr have the intersection with the Z axis as the origin, the horizontal coordinate axis Px extends leftward, and the vertical coordinate axis Py extends upward. .

撮像画像JL上の4頂点の座標Jn(Jnx,Jny)から仮想平面PLr上の座標Pn(Pnx,Pny,Pnz)への変換(射影)は下記の式(1)により表される。

Figure 0006403628
Conversion (projection) from the coordinates Jn (Jnx, Jny) of the four vertices on the captured image JL to the coordinates Pn (Pnx, Pny, Pnz) on the virtual plane PLr is expressed by the following equation (1).
Figure 0006403628

式(1)で、
Hsは、撮像画像JLの水平方向のサイズ、即ち水平方向の画素数である。
Vsは、撮像画像JLの垂直方向のサイズ、即ち垂直方向の画素数である。
Fwはズームレンズ12が最広角の状態にある時の焦点距離(基準焦点距離)である。
Fmはマスク領域の指定のために用いられた画像の撮像の際の焦点距離の指定値Fdである。
補正係数Cfx及びCfyは事前に決定される調整値であり、後述する。
In equation (1),
Hs is the horizontal size of the captured image JL, that is, the number of pixels in the horizontal direction.
Vs is the vertical size of the captured image JL, that is, the number of pixels in the vertical direction.
Fw is a focal length (reference focal length) when the zoom lens 12 is in the widest angle state.
Fm is a designated value Fd of the focal length when the image used for designating the mask area is captured.
The correction coefficients Cfx and Cfy are adjustment values determined in advance and will be described later.

式(1)の演算により、撮像画像JL中のマスク指定領域を構成する4頂点の座標J1(J1x,J1y)、J2(J2x,J2y)、J3(J3x,J3y)及びJ4(J4x,J4y)に対応する仮想平面PLr上の座標P1(P1x,P1y,1)、P2(P2x,P2y,1)、P3(P3x,P3y,1)、及びP4(P4x,P4y,1)が求められる。マスク指定領域を、水平方向及び垂直方向の座標軸に平行な辺で構成される矩形に限定すると、P1x=P4x、P2x=P3x、P1y=P2y、P3y=P4yとなる。   By the calculation of Expression (1), the coordinates of the four vertices J1 (J1x, J1y), J2 (J2x, J2y), J3 (J3x, J3y), and J4 (J4x, J4y) constituting the mask designation area in the captured image JL are obtained. The coordinates P1 (P1x, P1y, 1), P2 (P2x, P2y, 1), P3 (P3x, P3y, 1), and P4 (P4x, P4y, 1) on the virtual plane PLr are obtained. If the mask designation area is limited to a rectangle composed of sides parallel to the horizontal and vertical coordinate axes, P1x = P4x, P2x = P3x, P1y = P2y, and P3y = P4y.

マスク領域登録部33は、複数の頂点の平面座標P1〜P4で定義されるマスク指定領域を補正し、補正後のマスク指定領域の頂点座標を上記の仮想球面SP上の座標(球面座標)に変換し、変換後の座標を、マスク領域記憶部34に記憶させる。   The mask area registration unit 33 corrects the mask designation area defined by the plane coordinates P1 to P4 of the plurality of vertices, and changes the vertex coordinates of the mask designation area after correction to the coordinates (spherical coordinates) on the virtual spherical surface SP. The converted coordinates are stored in the mask area storage unit 34.

マスク領域登録部33は、指定領域補正部331及び球面座標算出部332を有する。
指定領域補正部331は、マスク指定領域を補正して、その形状を正方形にする。この正方形は、補正前のマスク指定領域の、短い方の辺の長さを一辺とするものである。
そのような補正のために、指定領域補正部331はまず、マスク指定領域を構成する4頂点の座標Pn(n=1,2,3,4)からマスク指定領域の中央の座標CP=(CPx,CPy,1)を次式(2)により算出する。
CPx=(P1x+P3x)/2
CPy=(P1y+P3y)/2
(2)
The mask area registration unit 33 includes a designated area correction unit 331 and a spherical coordinate calculation unit 332.
The designated area correction unit 331 corrects the mask designated area so as to make the shape square. This square has the shorter side of the mask designation area before correction as one side.
For such correction, the designated area correction unit 331 firstly determines the coordinates CP = (CPx at the center of the mask designation area from the coordinates Pn (n = 1, 2, 3, 4) of the four vertices constituting the mask designation area. , CPy, 1) is calculated by the following equation (2).
CPx = (P1x + P3x) / 2
CPy = (P1y + P3y) / 2
(2)

指定領域補正部331は次に、マスク指定領域の水平方向の辺の長さ(水平方向の長さ)と垂直方向の辺の長さ(垂直方向の長さ)を比較し、比較結果に基づく補正をする。
比較のためにまず、水平方向の長さLNXと垂直方向の長さLNYを次式(3)により算出する(図5(b))。次式(3)におけるABS()は括弧内の絶対値を算出する処理である。
LNX=ABS(P1x−P3x)
LNY=ABS(P1y−P3y)
(3)
Next, the designated area correction unit 331 compares the horizontal side length (horizontal length) of the mask designated area with the vertical side length (vertical length), and based on the comparison result. Make corrections.
For comparison, first, the horizontal length LNX and the vertical length LNY are calculated by the following equation (3) (FIG. 5B). ABS () in the following equation (3) is a process for calculating an absolute value in parentheses.
LNX = ABS (P1x-P3x)
LNY = ABS (P1y-P3y)
(3)

指定領域補正部331は続いて、水平方向の長さLNXと垂直方向の長さLNYを比較し、マスク指定領域が長さLNXと長さLNYのうちの短い方を一辺の長さとする正方形となるようにマスク指定領域の頂点の座標Pnを補正する(図6(a)及び(b))。この補正は、次式(4)で表される。次式(4)で、補正後の座標をPc1x〜Pc4x、Pc1y〜Pc4yで示す。
if(LNX>LNY){
Pc1x=CPx−LNY/2
Pc4x=Pc1x
Pc3x=CPx+LNY/2
Pc2x=Pc3x
}else{
Pc1y=CPy−LNX/2
Pc2y=Pc1y
Pc3y=CPy+LNX/2
Pc4y=Pc3y

(4)
なお、Z軸方向の座標は補正によって変化せず、補正後の座標Pcnzは補正前の座標Pnzと等しい。
Subsequently, the designated area correction unit 331 compares the horizontal length LNX with the vertical length LNY, and the mask designation area has a square whose side is the shorter of the length LNX and the length LNY. The coordinates Pn of the vertices of the mask designation area are corrected so as to be (FIGS. 6A and 6B). This correction is expressed by the following equation (4). In the following equation (4), the corrected coordinates are indicated by Pc1x to Pc4x and Pc1y to Pc4y.
if (LNX> LNY) {
Pc1x = CPx−LNY / 2
Pc4x = Pc1x
Pc3x = CPx + LNY / 2
Pc2x = Pc3x
} Else {
Pc1y = CPy-LNX / 2
Pc2y = Pc1y
Pc3y = CPy + LNX / 2
Pc4y = Pc3y
}
(4)
Note that the coordinates in the Z-axis direction are not changed by the correction, and the corrected coordinates Pcnz are equal to the uncorrected coordinates Pnz.

上記の補正により、水平方向又は垂直方向に長いマスク領域が設定されることを防ぐことが可能となる。その結果、マスク領域の設定時とその後の撮像時とで撮像方向が異なるために、マスク処理を施す領域が極めて大きくなってしまい、そのため、本来隠したくない領域が覆い隠されてしまうことを防ぐことができる。   By the above correction, it is possible to prevent a mask area that is long in the horizontal direction or the vertical direction from being set. As a result, since the imaging direction is different between the setting of the mask area and the subsequent imaging, the area to be masked becomes extremely large, thereby preventing the area that is not originally intended to be hidden from being covered. be able to.

球面座標算出部332は、指定領域補正部331から出力される、補正された指定領域を構成する4頂点の座標Pcn(n=1,2,3,4)を、図7に示される仮想球面SPに射影し、球面座標Qn(Qnx,Qny,Qnz)(n=1,2,3,4)を算出する。この算出は、式(5)で表される。

Figure 0006403628
The spherical coordinate calculation unit 332 outputs the coordinates Pcn (n = 1, 2, 3, 4) of the four vertices constituting the corrected designated area, which are output from the designated area correction unit 331, to the virtual spherical surface shown in FIG. Project to SP and calculate spherical coordinates Qn (Qnx, Qny, Qnz) (n = 1, 2, 3, 4). This calculation is expressed by equation (5).
Figure 0006403628

以上の説明では、マスク領域の指定に用いられた画像の撮像の際の撮像方向が、基準方向、即ちカメラ部14を原点とする三次元座標空間のZ軸方向にあると仮定して座標Qn(n=1,2,3,4)を算出している。   In the above description, the coordinate Qn is assumed on the assumption that the imaging direction when the image used for specifying the mask area is in the reference direction, that is, the Z-axis direction of the three-dimensional coordinate space with the camera unit 14 as the origin. (N = 1, 2, 3, 4) is calculated.

マスク領域の指定に用いられた画像の撮像の際の撮像方向SDRmが、図8及び図9に示すように、基準方向(Z軸方向)以外の方向にある場合、即ちパン角度φm及びチルト角度θmの少なくとも一方がゼロではない場合には、当該撮像方向SDRmに対して垂直で、仮想球面SPに接する平面を仮想平面PLaとして、撮像画像JL上で指定されたマスク領域の頂点座標を、当該仮想平面PLa上に射影し、領域の形状を正方形に補正した後、仮想球面SP上に射影する。   As shown in FIGS. 8 and 9, when the image capturing direction SDRm at the time of capturing the image used for specifying the mask area is in a direction other than the reference direction (Z-axis direction), that is, the pan angle φm and the tilt angle. When at least one of θm is not zero, the vertex coordinate of the mask area designated on the captured image JL is defined as a virtual plane PLa that is perpendicular to the imaging direction SDRm and touches the virtual spherical surface SP. After projecting onto the virtual plane PLa and correcting the shape of the region to a square, it projects onto the virtual spherical surface SP.

そのような射影により形成される球面座標Rn(Rnx,Rny,Rnz)は、上記のように、撮像方向がZ軸方向であると仮定して求められた球面座標Qnに対して、実際の撮像方向SDRmを表すパン角度Φm及びチルト角度θmに応じた回転を加えることで求められる。その場合、撮像画像JLから仮想平面PLへの射影、及び仮想平面PLから仮想球面PSへの射影の結果得られる座標は、撮像方向がZ軸方向に一致しているものとして射影を行い、その後で回転を加えることで得られる。この回転は相対的なものであって、Z軸を、パン角度φm及びチルト角度θmと同じ大きさで、向きが逆の角度だけ回転させる処理と見ることもできる。回転を加える処理は、パン角度φm及びチルト角度θmを要素とする回転行列MTmと、上記の球面座標Qnx、Qny及びQnxを要素とする行列との積を求める演算により行われる。この演算は下記の式(6)で表される。   As described above, the spherical coordinates Rn (Rnx, Rny, Rnz) formed by such projection are the actual imaging with respect to the spherical coordinates Qn obtained on the assumption that the imaging direction is the Z-axis direction. It is obtained by applying rotation according to the pan angle Φm and the tilt angle θm representing the direction SDRm. In that case, the coordinates obtained as a result of the projection from the captured image JL to the virtual plane PL and the projection from the virtual plane PL to the virtual spherical surface PS are projected assuming that the imaging direction matches the Z-axis direction, and then It can be obtained by adding rotation. This rotation is relative, and can be regarded as a process of rotating the Z axis by the same magnitude as the pan angle φm and the tilt angle θm and by the opposite direction. The process of adding rotation is performed by calculating the product of the rotation matrix MTm having the pan angle φm and the tilt angle θm as elements and the matrix having the spherical coordinates Qnx, Qny, and Qnx as elements. This calculation is expressed by the following equation (6).

Figure 0006403628
Figure 0006403628

回転行列MTmは次式(7)により算出される。

Figure 0006403628
The rotation matrix MTm is calculated by the following equation (7).
Figure 0006403628

図8には、回転後の球面座標Rn(Rnx,Rny,Rnz)に対応する仮想平面PLa上の座標を符号Pdn(Pdnx,Pdny,Pdnz)で示す。
マスク領域登録部33は、上記のようにして算出した三次元座標空間での座標Rnを、マスク領域記憶部34に、設定マスク領域の4頂点の座標として登録する。
In FIG. 8, coordinates on the virtual plane PLa corresponding to the spherical coordinates Rn (Rnx, Rny, Rnz) after rotation are indicated by a symbol Pdn (Pdnx, Pdny, Pdnz).
The mask area registration unit 33 registers the coordinates Rn in the three-dimensional coordinate space calculated as described above in the mask area storage unit 34 as the coordinates of the four vertices of the set mask area.

なお、指定領域補正部331による補正の結果得られたマスク指定領域を、指定領域逆変換部37で、撮像画像上の対応する領域に変換し、逆変換後の領域を示す情報を後処理部17に送り、後処理部17で逆変換後の領域を示す情報、例えば逆変換後の領域を示す輪郭線を、撮像画像に重畳して表示装置22に表示させ、表示装置22を見ているユーザーによる承認を受けた後にマスク領域記憶部34に上記の登録を行う。ユーザーによる承認は、例えば操作入力部23を用いて行われる。   It should be noted that the specified mask area obtained as a result of the correction by the specified area correction unit 331 is converted into a corresponding area on the captured image by the specified area inverse conversion unit 37, and information indicating the area after the reverse conversion is converted into a post-processing unit. 17, information indicating the region after reverse conversion by the post-processing unit 17, for example, a contour line indicating the region after reverse conversion is superimposed on the captured image and displayed on the display device 22, and the display device 22 is viewed. After receiving approval from the user, the above registration is performed in the mask area storage unit 34. The approval by the user is performed using the operation input unit 23, for example.

撮像装置では、以上のようにしてマスク領域記憶部34に登録された、設定マスク領域の4頂点の座標を、その後の撮像の際に読み出して利用する。   In the imaging apparatus, the coordinates of the four vertices of the set mask area registered in the mask area storage unit 34 as described above are read and used at the time of subsequent imaging.

以下、マスク領域の設定後の撮像の際の平面座標算出部35における処理、及びマスク処理領域算出部36における処理をより詳細に説明する。   Hereinafter, the processing in the plane coordinate calculation unit 35 and the processing in the mask processing region calculation unit 36 at the time of imaging after setting the mask region will be described in more detail.

平面座標算出部35は、撮像装置が撮像を行っているとき、マスク領域記憶部34から、設定マスク領域の頂点の座標Rnを読み出して、撮像条件取得部31から、そのときの撮像方向SDRvを示す情報、即ち、パン角度の指定値φv及びチルト角度の指定値θvを受けて、設定マスク領域の頂点の座標Rnを、撮像方向SDRvに垂直な仮想平面TL上の座標Tn(Tnx,Tny,Tnz)に変換する。図10に撮像方向SDRv、パン角度φv、及びチルト角度θvの例を示す。
仮想平面TLは撮像方向SDRvに垂直であるので、撮像画像ULに平行であると見ることができる。
The plane coordinate calculation unit 35 reads the coordinates Rn of the vertex of the set mask area from the mask area storage unit 34 when the imaging apparatus is imaging, and determines the imaging direction SDRv at that time from the imaging condition acquisition unit 31. In response to the indicated information, that is, the pan angle specified value φv and the tilt angle specified value θv, the coordinates Rn of the apex of the setting mask region are converted into coordinates Tn (Tnx, Tny, Tnz). FIG. 10 shows an example of the imaging direction SDRv, the pan angle φv, and the tilt angle θv.
Since the virtual plane TL is perpendicular to the imaging direction SDRv, it can be viewed as being parallel to the captured image UL.

上記の座標変換に当たっては、撮像方向SDRvに垂直な仮想平面TLに、図10に示すように、パン角度φv及びチルト角度θvと大きさが同じで逆向きの回転を与えることで、上記の仮想平面TLをZ軸の方向に移動させ、これとともに、設定マスク領域の頂点の座標Rnに対してパン角度φv及びチルト角度θvと大きさが同じで逆向きの回転を与えることで、球面上での移動後の座標Snを求め、撮像方向SDRvに垂直な仮想平面TLに、上記と同じ回転を与えて移動させ、移動後の座標Snを移動後の仮想平面TLに射影することで、移動後の仮想平面TL上の座標Tnを求める。   In the above coordinate conversion, the virtual plane TL perpendicular to the imaging direction SDRv is rotated in the same direction as the pan angle φv and tilt angle θv as shown in FIG. By moving the plane TL in the direction of the Z-axis and simultaneously rotating the coordinate Rn of the apex of the set mask area with the same angle as the pan angle φv and the tilt angle θv, the rotation is reversed on the spherical surface. After the movement, the coordinate Sn after the movement is obtained, the virtual plane TL perpendicular to the imaging direction SDRv is moved by giving the same rotation as described above, and the coordinate Sn after the movement is projected onto the virtual plane TL after the movement. The coordinates Tn on the virtual plane TL are obtained.

式(6)について上記したのと同様に、回転は相対的なものであり、上記の処理は、Z軸を撮像方向SDRmに回転させることで、座標Rnから回転移動後の座標Snを求め、Z軸が撮像方向SDRmに一致する三次元座標空間において、球面座標Snから平面座標Tnへの変換を行う処理であると見ることができる。   As described above with respect to equation (6), the rotation is relative, and the above processing calculates the coordinate Sn after the rotational movement from the coordinate Rn by rotating the Z axis in the imaging direction SDRm. In the three-dimensional coordinate space in which the Z-axis coincides with the imaging direction SDRm, it can be regarded as a process for converting the spherical coordinate Sn to the planar coordinate Tn.

上記の変換のため、平面座標算出部35は、撮像条件取得部31から出力される現在のカメラ部14の撮像方向SDRv(パン角度φv及びチルト角度θv)に基づいて、上記の回転を与えるための回転行列MTvを下記の式(8)により算出する。

Figure 0006403628
For the above conversion, the plane coordinate calculation unit 35 gives the above rotation based on the current imaging direction SDRv (pan angle φv and tilt angle θv) of the camera unit 14 output from the imaging condition acquisition unit 31. The rotation matrix MTv is calculated by the following equation (8).
Figure 0006403628

平面座標算出部35は、マスク領域記憶部34に格納されている、設定マスク領域の頂点の座標R1〜R4と、回転行列MTvとの積を求める演算を行う。この演算は下記の式(9)で表される。

Figure 0006403628
The plane coordinate calculation unit 35 performs an operation for obtaining a product of the coordinates R1 to R4 of the vertexes of the set mask area and the rotation matrix MTv stored in the mask area storage unit 34. This calculation is expressed by the following equation (9).
Figure 0006403628

この演算により得られる座標S1〜S4は、図11に示すように、現在の撮像方向SDRvをZ軸方向に移動させたとき、言い換えると、撮像画像の中心を、仮想球面SPのZ軸との交点に移動させたときの、仮想球面SP上の設定マスク領域の頂点の座標である。   As shown in FIG. 11, the coordinates S1 to S4 obtained by this calculation are obtained by moving the current imaging direction SDRv in the Z-axis direction, in other words, the center of the captured image with the Z-axis of the virtual spherical surface SP. This is the coordinates of the vertex of the setting mask area on the virtual spherical surface SP when moved to the intersection.

平面座標算出部35は更に、仮想球面SP上の座標S1〜S4を、図11に示される三次元座標空間内の仮想平面TLに射影する。
仮想平面TLは、マスク領域の設定の際に用いられる仮想平面PLrと同じ位置にある。即ち、仮想平面TLは、上記の三次元座標空間において、Z軸に垂直で仮想球面SPに接する平面である。従って、仮想平面TLは、Z=1の位置にある。仮想平面TLはまた、Z軸との交点を原点とし、その座標軸Tx及びTyが、X軸及びY軸と平行である。
Further, the plane coordinate calculation unit 35 projects the coordinates S1 to S4 on the virtual spherical surface SP onto the virtual plane TL in the three-dimensional coordinate space shown in FIG.
The virtual plane TL is at the same position as the virtual plane PLr used when setting the mask area. That is, the virtual plane TL is a plane that is perpendicular to the Z axis and is in contact with the virtual spherical surface SP in the three-dimensional coordinate space. Therefore, the virtual plane TL is at the position of Z = 1. The virtual plane TL also has an origin at the intersection with the Z axis, and its coordinate axes Tx and Ty are parallel to the X axis and the Y axis.

仮想球面上の4頂点の座標Sn(Snx,Sny,Snz)(n=1,2,3,4)から、仮想平面TL上の4頂点の座標Tn(Tnx,Tny,Tnz)への変換(射影)は下記の式(10)により表される。
Tnx=Snx/ABS(Snz)
Tny=Sny/ABS(Snz)
Tnz=1
(n=1,2,3,4)
(10)
Conversion from coordinates Sn (Snx, Sny, Snz) (n = 1, 2, 3, 4) of the four vertices on the virtual sphere to coordinates Tn (Tnx, Tny, Tnz) of the four vertices on the virtual plane TL ( (Projection) is expressed by the following equation (10).
Tnx = Snx / ABS (Snz)
Tny = Sny / ABS (Snz)
Tnz = 1
(N = 1, 2, 3, 4)
(10)

マスク処理領域算出部36は、平面座標算出部35で算出された仮想平面TL上の頂点座標Tnから、撮像画像UL中の対応する座標Unを算出し、該座標Unで定義される領域に外接する矩形の領域をマスク処理領域と決定する。
ここで言う矩形の領域は、撮像画像の水平方向に延びた辺と、垂直方向に延びた辺とで構成される。「座標Unで定義される領域に外接する矩形の領域」とは、座標Unで定義される領域の全体をその内部に含み、かつ最も小さい矩形の領域である。
The mask processing area calculation unit 36 calculates the corresponding coordinates Un in the captured image UL from the vertex coordinates Tn on the virtual plane TL calculated by the plane coordinate calculation unit 35, and circumscribes the area defined by the coordinates Un. A rectangular area to be processed is determined as a mask processing area.
The rectangular area referred to here is composed of a side extending in the horizontal direction and a side extending in the vertical direction of the captured image. The “rectangular area circumscribing the area defined by the coordinates Un” is the smallest rectangular area that includes the entire area defined by the coordinates Un within the interior.

上記の処理のため、マスク処理領域算出部36はまず、仮想平面TL上の座標Tn=(Tnx,Tny,Tnz)(n=1,2,3,4)を、撮像画像UL上の座標Un(Unx,Uny)(n=1,2,3,4)に変換する。   For the above processing, the mask processing area calculation unit 36 first sets the coordinates Tn = (Tnx, Tny, Tnz) (n = 1, 2, 3, 4) on the virtual plane TL to the coordinates Un on the captured image UL. Conversion to (Unx, Uny) (n = 1, 2, 3, 4).

この変換は、図5(a)及び(b)を参照して説明した、撮像画像JL上の座標から仮想平面PLr上の座標への変換の逆である。   This conversion is the reverse of the conversion from the coordinates on the captured image JL to the coordinates on the virtual plane PLr described with reference to FIGS. 5 (a) and 5 (b).

仮想平面TL上の座標は、図12(a)に示すように、該平面の中心(Z軸との交点)を中心とし、水平方向の座標軸Txが左向きに延び、垂直方向の座標軸Tyが上向きに延びている。
一方、撮像画像UL上の座標は、図12(b)に示すように、撮像画像ULの左上隅を原点として、水平方向の座標軸Uxが右向きに延び、垂直方向の座標軸Uyが下向きに延びている。
As shown in FIG. 12A, the coordinates on the virtual plane TL are centered on the center of the plane (intersection with the Z axis), the horizontal coordinate axis Tx extends leftward, and the vertical coordinate axis Ty faces upward. It extends to.
On the other hand, as shown in FIG. 12B, the coordinates on the captured image UL are such that the horizontal coordinate axis Ux extends rightward and the vertical coordinate axis Uy extends downward with the upper left corner of the captured image UL as the origin. Yes.

上記のように、仮想平面TLは撮像画像ULと平行と見ることができる。
撮像画像UL上の座標は、左上隅の座標が(0,0,1)、右下隅の座標(Hs−1,Vs−1,1)である。ここでHsは、撮像画像ULの水平方向のサイズ、即ち水平方向の画素数であり、Vsは、撮像画像ULの垂直方向のサイズ、即ち垂直方向の画素数である。
As described above, the virtual plane TL can be viewed as being parallel to the captured image UL.
As for the coordinates on the captured image UL, the coordinates of the upper left corner are (0, 0, 1) and the coordinates of the lower right corner (Hs-1, Vs-1, 1). Here, Hs is the horizontal size of the captured image UL, that is, the number of pixels in the horizontal direction, and Vs is the vertical size of the captured image UL, that is, the number of pixels in the vertical direction.

仮想平面TLの4頂点の座標の撮像画像UL上の座標への変換(射影)は、下記の式(11)により表される。

Figure 0006403628
The conversion (projection) of the coordinates of the four vertices of the virtual plane TL to the coordinates on the captured image UL is expressed by the following equation (11).
Figure 0006403628

上記の式(11)で、
Fvは撮像画像ULの撮像に用いられた焦点距離であり、
Fwは、基準焦点距離、即ちズームレンズ12が最広角状態にあるときの焦点距離であり、
Cfx,Cfyは、予め定められた補正係数である。
In the above equation (11),
Fv is a focal length used for imaging the captured image UL,
Fw is a reference focal length, that is, a focal length when the zoom lens 12 is in the widest angle state,
Cfx and Cfy are predetermined correction coefficients.

マスク処理領域算出部36はさらに、マスク処理領域の左上の頂点及び右下の頂点の座標を、それぞれマスク処理領域の開始点座標(SUx,SUy)、及び終了点座標(EUx,EUy)として求める。   The mask processing area calculation unit 36 further obtains the coordinates of the upper left vertex and the lower right vertex of the mask processing area as the start point coordinates (SUx, SUy) and the end point coordinates (EUx, EUy), respectively. .

具体的には、マスク処理領域算出部36は、撮像画像UL上のマスク処理領域の4頂点の座標Un(n=1,2,3,4)から、下記の式(12)で示すように、水平方向の最小値SUx及び最大値EUx、並びに垂直方向の最小値SUy及び最大値EUyを求め、水平方向の最小値と垂直方向の最小値の組合せを、マスク処理領域の開始点座標(SUx,SUy)と定め、水平方向の最大値と垂直方向の最大値の組合せを、マスク処理領域の終了点座標(EUx,EUy)と定める。
SUx=min(U1x,U2x,U3x,U4x)
SUy=min(U1y,U2y,U3y,U4y)
EUx=max(U1x,U2x,U3x,U4x)
EUy=max(U1y,U2y,U3y,U4y)
(12)
Specifically, the mask processing area calculation unit 36 uses the coordinates Un (n = 1, 2, 3, 4) of the four vertices of the mask processing area on the captured image UL as shown in the following formula (12). , The horizontal minimum value SUx and the maximum value EUx, the vertical minimum value SUy and the maximum value EUy are obtained, and the combination of the horizontal minimum value and the vertical minimum value is determined as the start point coordinates (SUx , SUy), and the combination of the maximum value in the horizontal direction and the maximum value in the vertical direction is defined as the end point coordinates (EUx, EUy) of the mask processing area.
SUx = min (U1x, U2x, U3x, U4x)
SUy = min (U1y, U2y, U3y, U4y)
EUx = max (U1x, U2x, U3x, U4x)
EUy = max (U1y, U2y, U3y, U4y)
(12)

式(1)及び式(11)で用いられる補正係数Cfx,Cfyは、撮像方向を、パン角度φm、φvが0度、チルト角度θm、θvが90度となるように設定し、ズームレンズ12の焦点距離Fm、Fvを基準焦点距離Fwに設定し、撮像画像全体をマスク指定領域とし、指定領域変換部32から出力される座標Pn(n=1,2,3,4)に対して、指定領域補正部331での補正を行わずに、座標Un(n=1,2,3,4)を算出したときに、式(12)で求められるマスク処理領域の開始点座標(SUx,SUy)が(0,0)となり、終了点座標が(Hs−1,Vs−1)となるように事前に定められる。   The correction coefficients Cfx and Cfy used in the equations (1) and (11) set the imaging direction so that the pan angles φm and φv are 0 degrees, the tilt angles θm and θv are 90 degrees, and the zoom lens 12 Are set as the reference focal length Fw, the entire captured image is set as the mask designation area, and the coordinates Pn (n = 1, 2, 3, 4) output from the designation area conversion unit 32 are When the coordinates Un (n = 1, 2, 3, 4) are calculated without performing correction by the designated area correction unit 331, the start point coordinates (SUx, SUy) of the mask processing area obtained by Expression (12) ) Becomes (0,0), and the end point coordinates become (Hs-1, Vs-1) in advance.

マスク処理領域算出部36はさらに、マスク処理領域の開始点座標(SUx,SUy)を最小値でクリップし、終了点座標(EUx,EUy)を最大値でクリップする。
水平方向の最小値及び垂直方向の最小値はともに0である。
水平方向の最大値はHs−1であり、垂直方向の最大値はVs−1である。
この処理は下記の式(13)で表される。
SUbx=min{max(SUx,0),(Hs−1)}
SUby=min{max(SUy,0),(Vs−1)}
EUbx=min{max(EUx,0),(Hs−1)}
EUby=min{max(EUy,0),(Vs−1)}
(13)
The mask processing area calculation unit 36 further clips the start point coordinates (SUx, SUy) of the mask processing area with the minimum value and clips the end point coordinates (EUx, EUy) with the maximum value.
Both the minimum value in the horizontal direction and the minimum value in the vertical direction are zero.
The maximum value in the horizontal direction is Hs-1, and the maximum value in the vertical direction is Vs-1.
This process is expressed by the following equation (13).
SUbx = min {max (SUx, 0), (Hs-1)}
SUby = min {max (SUy, 0), (Vs-1)}
EUbx = min {max (EUx, 0), (Hs-1)}
EUby = min {max (EUy, 0), (Vs−1)}
(13)

上記のクリップ処理を経たマスク処理領域の開始点座標(SUbx,SUby)及び終了点座標(EUbx,EUby)は、マスク処理領域を示す情報MPBとして後処理部17に出力される。後処理部17では、開始点座標(SUbx,SUby)及び終了点座標(EUbx,EUby)で定義されるマスク処理領域に対対してマスク処理が行われる。   The start point coordinates (SUbx, SUby) and end point coordinates (EUbx, EUby) of the mask processing area that has undergone the above clipping process are output to the post-processing unit 17 as information MPB indicating the mask processing area. The post-processing unit 17 performs mask processing on the mask processing area defined by the start point coordinates (SUbx, SUby) and the end point coordinates (EUbx, EUby).

本実施の形態によれば、領域指定時と領域設定後の撮像時とで撮像方向が異なるために、本来隠したくない領域もが覆い隠されてしまうことを防ぐことができる。また、指定領域補正部331におけるマスク指定領域の補正は、マスク指定領域を構成する矩形の水平方向の長さと垂直方向の長さをの差分を比較し、比較結果に基づく加減算を行う処理のみによって行うことが可能であり、少ない演算で所望の効果を得ることができる。   According to the present embodiment, since the imaging direction is different between the area designation and the imaging after the area setting, it is possible to prevent an area that is not originally intended to be hidden from being covered. In addition, the correction of the mask designation area in the designation area correction unit 331 is performed only by the process of comparing the difference between the horizontal length and the vertical length of the rectangle constituting the mask designation area and performing addition / subtraction based on the comparison result. The desired effect can be obtained with few operations.

実施の形態2.
上記の実施の形態1では、指定領域補正部331では、マスク指定領域(指定領域変換部32で算出された座標Pnで定義される領域)を、正方形の領域に補正することとしているが、マスク指定領域の水平方向の辺と垂直方向の辺のうち、短い方の長さに対する長い方の長さの比(以下この比をアスペクト比と言う)を、予め定められた上限値UR以下に制限するように補正を行う構成としても良い。
なお、実施の形態1で説明した、マスク指定領域を正方形に補正する構成は、上記の上限値URを1にした場合に相当する。
Embodiment 2. FIG.
In the first embodiment, the designated area correction unit 331 corrects the mask designated area (the area defined by the coordinates Pn calculated by the designated area conversion unit 32) to a square area. Of the horizontal and vertical sides of the designated area, the ratio of the longer length to the shorter length (hereinafter referred to as the aspect ratio) is limited to a predetermined upper limit UR or less. It is also possible to employ a configuration for performing correction so as to do this.
The configuration for correcting the mask designation area to a square described in the first embodiment corresponds to the case where the upper limit value UR is set to 1.

この場合、図3の指定領域補正部331で、指定領域変換部32で算出された、仮想平面PL上の座標Pnで定義される矩形の領域の水平方向の辺と垂直方向の辺のうち、長い方の長さを、短い方の長さに対する比が予め定められた上限値URに一致するように変更する。   In this case, among the horizontal side and the vertical side of the rectangular area defined by the coordinates Pn on the virtual plane PL calculated by the specified area conversion unit 32 by the specified area correction unit 331 in FIG. The longer length is changed so that the ratio to the shorter length matches the predetermined upper limit value UR.

具体的には、指定領域補正部331は、図6(a)及び(b)に示す処理の代わりに、図13(a)及び(b)の処理を行う。
即ち、水平方向の長さLNXと垂直方向の長さLNYとを比較し、図13(a)に示すように、LNX/LNY>URであれば、水平方向の長さLNXを小さくして補正後の水平方向の長さLNXcの垂直方向の長さLNYに対する比が上限値URに等しくなるようにする。この場合、矩形の領域の中心の位置が変わらないようにする。そのため、中心から左右の辺までの距離が(LNY/2)×URとなるように補正を行う。
Specifically, the designated area correction unit 331 performs the processes shown in FIGS. 13A and 13B instead of the processes shown in FIGS. 6A and 6B.
That is, the horizontal length LNX is compared with the vertical length LNY, and as shown in FIG. 13A, if LNX / LNY> UR, the horizontal length LNX is reduced and corrected. The ratio of the subsequent horizontal length LNXc to the vertical length LNY is made equal to the upper limit value UR. In this case, the position of the center of the rectangular area is not changed. Therefore, correction is performed so that the distance from the center to the left and right sides becomes (LNY / 2) × UR.

一方、図13(b)に示すように、LNY/LNX>URであれば、垂直方向の長さLNYを小さくして補正後の垂直方向の長さLNYcの水平方向の長さLNXに対する比が上限値URに等しくなるようにする。この場合にも、矩形の領域の中心の位置が変わらないようにする。LNY/LNX=URとなるようにする。そのため、中心から上限の辺までの距離が(LNX/2)×URとなるように補正を行う。   On the other hand, as shown in FIG. 13B, if LNY / LNX> UR, the vertical length LNY is reduced and the corrected vertical length LNYc to the horizontal length LNX is It is made equal to the upper limit value UR. Also in this case, the position of the center of the rectangular area is not changed. LNY / LNX = UR. Therefore, correction is performed so that the distance from the center to the upper limit side becomes (LNX / 2) × UR.

以上のように、マスク指定領域を、正方形以外の、アスペクト比が制限された矩形の領域であっても、実施の形態1で述べたのと同様に、領域指定時と領域設定後の撮像時とで撮像方向が異なるために、本来隠したくない領域が隠されてしまうことを防ぐことができる。   As described above, even when the mask designation area is a rectangular area other than a square and whose aspect ratio is limited, as described in the first embodiment, at the time of area designation and at the time of imaging after setting the area. Since the image capturing directions are different, it is possible to prevent an area that is not originally intended to be hidden from being hidden.

実施の形態3.
図14は本発明の実施の形態3の撮像装置で用いられるマスク処理装置20bの構成を示す図である。図14のマスク処理装置20bは、図1の撮像装置において、図3のマスク処理装置20の代わりに用い得るものである。図14のマスク処理装置20bは、図3のマスク処理装置20と概して同じであるが、図3のマスク領域登録部33、マスク領域記憶部34、平面座標算出部35、マスク処理領域算出部36、及び指定領域逆変換部37の代わりに、マスク領域登録部33b、マスク領域記憶部34b、平面座標算出部35b、マスク処理領域算出部36b、及び指定領域逆変換部37bが設けられている点で異なる。マスク領域登録部33bは、指定領域補正部331b及び球面座標算出部332bを有する。
Embodiment 3 FIG.
FIG. 14 is a diagram showing a configuration of a mask processing apparatus 20b used in the imaging apparatus according to Embodiment 3 of the present invention. The mask processing apparatus 20b in FIG. 14 can be used in the imaging apparatus in FIG. 1 instead of the mask processing apparatus 20 in FIG. 14 is generally the same as the mask processing apparatus 20 in FIG. 3, but the mask area registration unit 33, the mask area storage unit 34, the plane coordinate calculation unit 35, and the mask processing area calculation unit 36 in FIG. In addition, a mask region registration unit 33b, a mask region storage unit 34b, a plane coordinate calculation unit 35b, a mask processing region calculation unit 36b, and a specified region reverse conversion unit 37b are provided instead of the specified region reverse conversion unit 37. It is different. The mask area registration unit 33b includes a designated area correction unit 331b and a spherical coordinate calculation unit 332b.

上記のように、実施の形態1では、マスク領域が一つ指定されると、それに対応して一つのマスク領域が設定される。このようにする代わりに、指定されたマスク領域が横方向に長い場合、或いは縦方向に長い場合に、該マスク領域を、複数個の、アスペクト比が制限された形状の矩形の領域(小領域)に分割して、分割で生成された小領域をそれぞれ設定マスク領域として登録する。ここで言うアスペクト比が制限された矩形には正方形が含まれる。   As described above, in the first embodiment, when one mask area is designated, one mask area is set correspondingly. Instead of doing this, if the specified mask area is long in the horizontal direction or long in the vertical direction, the mask area is divided into a plurality of rectangular areas (small areas having a limited aspect ratio). ) And the small areas generated by the division are registered as setting mask areas. The rectangle whose aspect ratio is limited here includes a square.

そのような処理を行うため、指定領域補正部331bは、マスク指定領域(指定領域変換部32で算出された、仮想平面PL上の座標Pnで定義される矩形の領域)が、水平方向又は垂直方向に長く、そのアスペクト比が予め定められた閾値URcよりも大きい場合に、マスク指定領域を、複数個のアスペクト比が制限された矩形の小領域に分割し、分割により生成された複数の小領域の各々について頂点の座標を生成する。   In order to perform such processing, the designated area correction unit 331b determines that the mask designation area (rectangular area defined by the coordinates Pn on the virtual plane PL calculated by the designated area conversion unit 32) is horizontal or vertical. When the direction is long and the aspect ratio is larger than a predetermined threshold value URc, the mask designation area is divided into a plurality of small rectangular areas with limited aspect ratios, and a plurality of small areas generated by the division are divided. Generate vertex coordinates for each of the regions.

そのような処理は以下のようにして行われる。
まず、指定領域補正部331bは、図5(b)に示される、水平方向の長さLNXと垂直方向の長さLNYを上記の式(3)により算出する。
Such processing is performed as follows.
First, the designated area correction unit 331b calculates the horizontal length LNX and the vertical length LNY shown in FIG. 5B by the above equation (3).

指定領域補正部331bは続いて、水平方向の長さLNXと垂直方向の長さLNYを比較する。
長さLNXと長さLNYのうちの短い方の長い方に対する比(アスペクト比)
MAX(LNX,LNY)/MIN(LNX,LNY)
を求め、閾値URcよりも大きいか否かの判定を行う。
アスペクト比が閾値URc以下であるときは、指定領域に対する補正を行わずに、指定領域の頂点の座標Pnを球面座標算出部332に供給する。
アスペクト比が閾値URcよりも大きいときは、指定領域を分割する。
Subsequently, the designated area correction unit 331b compares the horizontal length LNX with the vertical length LNY.
Ratio of the shorter one of the length LNX and the length LNY to the longer one (aspect ratio)
MAX (LNX, LNY) / MIN (LNX, LNY)
And whether or not it is larger than the threshold value URc is determined.
When the aspect ratio is equal to or less than the threshold value URc, the coordinates Pn of the apex of the designated area are supplied to the spherical coordinate calculation unit 332 without correcting the designated area.
When the aspect ratio is larger than the threshold value URc, the designated area is divided.

この場合、分割後の領域(小領域)のアスペクト比が、予め定められた閾値URd以下になるように領域の分割を行い、小領域の各々の頂点の座標を球面座標算出部332に供給する。   In this case, the region is divided so that the aspect ratio of the divided region (small region) is equal to or less than a predetermined threshold URd, and the coordinates of each vertex of the small region are supplied to the spherical coordinate calculation unit 332. .

図15(a)は、アスペクト比が閾値URcよりも大きい領域Maの例を示す。
図15(d)は、図15(a)の領域を分割することで形成された複数の、例えば4つの小領域Md1〜Md4を示す。
分割で形成された小領域Md1〜Md4の各々に対して、実施の形態1で説明したのと同様の処理を行う。
即ち、球面座標算出部332bは、指定領域補正部331bで生成された、複数の小領域の各々についての頂点の座標Pcnを、仮想球面SP上の座標Rnに変換し、マスク領域記憶部34bに記憶させる。
この結果、マスク領域記憶部34bには、複数の小領域の各々についての、仮想球面SP上の座標Rnがそれぞれ設定マスク領域の4頂点の座標として登録される。
FIG. 15A shows an example of a region Ma having an aspect ratio larger than the threshold value URc.
FIG. 15D shows a plurality of, for example, four small areas Md1 to Md4 formed by dividing the area of FIG.
The same processing as described in the first embodiment is performed on each of the small regions Md1 to Md4 formed by division.
That is, the spherical coordinate calculation unit 332b converts the vertex coordinates Pcn for each of the plurality of small regions generated by the designated region correction unit 331b into coordinates Rn on the virtual spherical surface SP, and stores them in the mask region storage unit 34b. Remember.
As a result, the coordinates Rn on the virtual spherical surface SP for each of the plurality of small areas are registered in the mask area storage unit 34b as the coordinates of the four vertices of the set mask area.

なお、指定領域補正部331bによる分割の結果得られた小領域を、指定領域逆変換部37bで、撮像画像上の対応する領域に変換し、逆変換後の領域を示す情報を後処理部17に送り、後処理部で逆変換後の領域を示す情報、例えば逆変換後の領域を示す輪郭線を、撮像画像に重畳して表示装置22に表示させ、表示装置22を見ているユーザーによる承認を受けた後にマスク領域記憶部34bに記憶させる。   The small area obtained as a result of the division by the designated area correction unit 331b is converted into a corresponding area on the captured image by the designated area inverse transformation unit 37b, and information indicating the area after the inverse transformation is converted to the post-processing unit 17. The information indicating the region after inverse transformation in the post-processing unit, for example, the contour line indicating the region after inverse transformation is superimposed on the captured image and displayed on the display device 22, and the user viewing the display device 22 After receiving the approval, it is stored in the mask area storage unit 34b.

マスク領域の設定後の撮像の際には、複数個の設定マスク領域の頂点の座標が読み出され、それぞれに対してマスク処理領域が算出される。
即ち、平面座標算出部35bは、マスク領域記憶部34bから複数の小領域の各々についての仮想球面上の座標Rnを読出し、仮想平面TL上の座標Tnに変換する。
この変換に当たっては、実施の形態1で述べたのと同様、当該撮像(設定後の撮像)の際の撮像方向及び焦点距離に応じた座標の回転及び射影が行われる。
At the time of imaging after setting the mask area, the coordinates of the vertices of the plurality of set mask areas are read, and a mask processing area is calculated for each.
In other words, the plane coordinate calculation unit 35b reads the coordinates Rn on the virtual spherical surface for each of the plurality of small areas from the mask area storage unit 34b, and converts them to the coordinates Tn on the virtual plane TL.
In this conversion, as described in the first embodiment, rotation and projection of coordinates according to the imaging direction and focal length in the imaging (imaging after setting) are performed.

複数の小領域についての、変換後の座標Tnで定義される領域の例が図15(e)に符号Me1〜Me4で示される。図15(e)に示される領域は、図15(d)に示される領域とは形状が異なる。特に、図15(d)では、4つの小領域Md1〜Md4が水平方向につながっているが、図15(e)では4つの小領域Md1〜Md4に対応する領域Me1〜Me4が斜め方向につながっている。
これは、マスク領域指定時と、設定後の撮像時とでパン角度或いはチルト角度が異なる結果生じた領域の変形による。
An example of a region defined by the coordinate Tn after conversion for a plurality of small regions is indicated by reference numerals Me1 to Me4 in FIG. The region shown in FIG. 15E is different in shape from the region shown in FIG. In particular, in FIG. 15D, the four small areas Md1 to Md4 are connected in the horizontal direction, but in FIG. 15E, the areas Me1 to Me4 corresponding to the four small areas Md1 to Md4 are connected in the oblique direction. ing.
This is due to the deformation of the region that occurs as a result of the difference in pan angle or tilt angle between when the mask region is designated and when imaging is performed after setting.

マスク処理領域算出部36bは、平面座標算出部35bにおける変換で得られた、複数の小領域の各々についての、仮想平面TL上の座標Tnを、撮像画像UL内の座標Unに変換し、この変換により得られた座標Unで定義される複数の小領域の各々に外接する複数の矩形の領域を複数のマスク処理領域として算出する。
複数のマスク処理領域の例が図15(f)に符号Mf1〜Mf4で示される。
The mask processing area calculation unit 36b converts the coordinates Tn on the virtual plane TL for each of the plurality of small areas obtained by the conversion in the plane coordinate calculation unit 35b into coordinates Un in the captured image UL. A plurality of rectangular areas circumscribing each of the plurality of small areas defined by the coordinates Un obtained by the conversion are calculated as a plurality of mask processing areas.
An example of a plurality of mask processing areas is indicated by symbols Mf1 to Mf4 in FIG.

仮に指定領域補正部331bによる領域の分割を行わず、水平方向に長いマスク領域Maに対応する領域がそのままマスク領域記憶部に記憶された場合には、上記と同様に、マスク領域指定時と領域設定後の撮像時との撮像方向の違いのために、設定後の撮像で得られた画像上の頂点座標Tnで表されるマスク領域が図15(b)に符号Mbで示すようになることがあり、その場合、図15(b)に示す領域に外接する矩形で構成されるマスク処理領域は図15(c)に符号Mcで示すように、極めて大きくなる。   If the region corresponding to the mask region Ma that is long in the horizontal direction is stored in the mask region storage unit as it is without dividing the region by the designated region correction unit 331b, as in the case described above, Due to the difference in the imaging direction from the time of imaging after setting, the mask area represented by the vertex coordinates Tn on the image obtained by imaging after setting becomes as indicated by the symbol Mb in FIG. 15B. In this case, the mask processing area constituted by a rectangle circumscribing the area shown in FIG. 15B becomes extremely large as indicated by reference numeral Mc in FIG.

図15(c)と図15(f)とを比較すれば分かるように、図15(c)に示されるマスク処理領域Mcは、図15(f)に示される複数のマスク処理領域Mf1〜Mf4をすべて合わせた領域よりも広く、本来隠したくない領域Mcaを多く含むものとなっている。   As can be seen from a comparison between FIG. 15C and FIG. 15F, the mask processing area Mc shown in FIG. 15C includes a plurality of mask processing areas Mf1 to Mf4 shown in FIG. It is wider than the region where all of the above are combined, and includes many regions Mca that are not originally intended to be hidden.

本実施の形態では、設定後の撮像時のマスク処理領域Mf1〜Mf4の組合せが、図15(f)に示すように、全体として細長い形状となっており、図15(c)のマスク処理領域Mcのように大きくなることを回避することができる。   In the present embodiment, the combination of the mask processing areas Mf1 to Mf4 at the time of imaging after setting has an elongated shape as shown in FIG. 15 (f), and the mask processing area shown in FIG. 15 (c). It can be avoided that it becomes large like Mc.

上記の例では、指定領域のすべての部分が、分割後の小領域のいずれかに属することとなるように等分割を行っている。例えば、閾値URc及びURdをともに√2≒1.4に等しく設定し、分割数を以下のように決定することで、上記の等分割を行うことができる。   In the above example, equal division is performed so that all parts of the designated area belong to one of the divided small areas. For example, the equal division can be performed by setting both the thresholds URc and URd to be equal to √2≈1.4 and determining the number of divisions as follows.

まず、上記のアスペクト比(MAX(LNX,LNY)/MIN(LNX,LNY)を超えない最大の整数Nを求める。
次に、
(MAX(LNX,LNY)/{MIN(LNX,LNY)×N}

{MIN(LNX,LNY)×(N+1)}/(MAX(LNX,LNY)
とを比較し、前者が後者以下であれば、指定領域をN分割する。そうでなければ、指定領域を(N+1)分割する。このようにすることで、指定領域を、そのすべての部分が分割後の小領域のいずれかに属するように等分割し、かつ分割で形成される小領域のアスペクト比を最小にすることができる。
First, the maximum integer N that does not exceed the above aspect ratio (MAX (LNX, LNY) / MIN (LNX, LNY) is obtained.
next,
(MAX (LNX, LNY) / {MIN (LNX, LNY) × N}
And {MIN (LNX, LNY) × (N + 1)} / (MAX (LNX, LNY)
If the former is less than the latter, the designated area is divided into N. Otherwise, the designated area is divided (N + 1). In this way, the designated area can be equally divided so that all of its parts belong to any of the divided small areas, and the aspect ratio of the small areas formed by the division can be minimized. .

上記のように、アスペクト比が制限された複数の矩形の領域は、正方形であっても良い。矩形の領域を正方形の領域とする場合、分割前の指定領域の長い方の辺の長さが短い方の辺の長さの整数倍であれば、元の指定領域のすべての部分が、分割後の小領域のいずれか一つにのみ属することとなる。   As described above, the plurality of rectangular regions with limited aspect ratios may be square. If the rectangular area is a square area, all parts of the original specified area will be divided if the longer side of the specified area before division is an integral multiple of the shorter side length. It belongs to only one of the subsequent small areas.

分割前の指定領域の長い方の辺の長さが短い方の辺の長さの整数倍でなければ、図16(a)又は(b)に示すように、元の指定領域の一部が分割後の小領域のいずれにも属さないこととなるようにしても良く、図16(c)に示すように、元の指定領域の一部が分割後の隣接する小領域に重複して属することになるようにしても良い。   If the length of the longer side of the designated area before division is not an integral multiple of the length of the shorter side, as shown in FIG. 16 (a) or (b), a part of the original designated area is It may be configured not to belong to any of the divided small areas. As shown in FIG. 16C, a part of the original designated area belongs to the adjacent small areas after the division. You may make it happen.

図16(a)に示す例では、複数の正方形の小領域Md1〜Md4への分割に際し、元の細長い指定領域Maの両端部分Mdeを切り落としている(除外している)。
図16(b)に示す例では、複数の正方形の小領域Md1〜Md4への分割に際し、小領域Md1〜Md4相互間に隙間Mdgをあけ、隙間Mdgに位置する部分を切り落としている(除外している)。
図16(c)に示す例では、複数の正方形の小領域Md1〜Md5への分割に際し、隣接する小領域Md1〜Md5の端部同士が重なるようにしている。図16(c)には、隣接する小領域が互いに重なる部分が符号Mdoで示されている。
In the example shown in FIG. 16A, both end portions Mde of the original elongated designated area Ma are cut off (excluded) when dividing into a plurality of square small areas Md1 to Md4.
In the example shown in FIG. 16B, when dividing into a plurality of square small areas Md1 to Md4, a gap Mdg is opened between the small areas Md1 to Md4, and a portion located in the gap Mdg is cut off (excluded). ing).
In the example shown in FIG. 16C, the end portions of the adjacent small regions Md1 to Md5 overlap each other when dividing into a plurality of square small regions Md1 to Md5. In FIG. 16C, a portion where adjacent small regions overlap each other is indicated by a symbol Mdo.

なお、指定領域を、正方形以外の、アスペクト比が制限された矩形の小領域とする場合にも、上記と同様に、元の指定領域の一部が分割後の小領域のいずれにも属さないこととなるようにしても良く、元の指定領域の一部が分割後の隣接する小領域に重複して属することになるようにしても良い。   Note that when the designated area is a rectangular small area other than a square and whose aspect ratio is limited, as in the above, part of the original designated area does not belong to any of the divided small areas. Alternatively, a part of the original designated area may belong to an adjacent small area after being divided.

以上述べた指定領域の分割を行うことで、水平方向又は垂直方向に長いマスク領域が設定されることを防ぐことが可能となり、マスク領域の設定時とその後の撮像時とで撮像方向が異なるために、マスク処理を施す領域が極めて大きくなってしまい、そのため、本来隠したくない領域が覆い隠されてしまうことを防ぐことができる。   By dividing the designated area as described above, it becomes possible to prevent a long mask area from being set in the horizontal direction or the vertical direction, and the imaging direction differs between the setting of the mask area and the subsequent imaging. In addition, the area to be masked becomes extremely large, so that it is possible to prevent the area that is not originally intended to be hidden from being obscured.

なお、実施の形態3の構成の特徴と実施の形態2の構成の特徴を組合せても良い。即ち、上記の例では、アスペクト比が閾値URc以下であれば、座標Pnをそのまま球面座標算出部332に出力することとしている。この構成で、閾値URcを実施の形態2の上限値URよりも大きい値に定めておき、アスペクト比が閾値URc以下であれば、次に上限値URよりも大きいか否かの判定を行い、アスペクト比が閾値URcよりも大きい場合には、上記のように、指定領域の分割を行う。一方、アスペクト比が上限値URよりも大きければ、アスペクト比が上限値UR以下となるように指定領域の形状を変更する。この処理は実施の形態2で説明したのと同じである。
このようにすることで、指定領域の形状に応じて最適の補正を加えることができる。
Note that the configuration features of the third embodiment and the configuration features of the second embodiment may be combined. That is, in the above example, if the aspect ratio is equal to or less than the threshold value URc, the coordinates Pn are output to the spherical coordinate calculation unit 332 as they are. With this configuration, the threshold value URc is set to a value larger than the upper limit value UR of Embodiment 2, and if the aspect ratio is equal to or less than the threshold value URc, it is next determined whether or not it is larger than the upper limit value UR. When the aspect ratio is larger than the threshold value URc, the designated area is divided as described above. On the other hand, if the aspect ratio is larger than the upper limit value UR, the shape of the designated area is changed so that the aspect ratio is equal to or less than the upper limit value UR. This process is the same as that described in the second embodiment.
In this way, an optimal correction can be applied according to the shape of the designated area.

実施の形態4.
図17は本発明の実施の形態4の撮像装置で用いられるマスク処理装置20cの構成を示す図である。図17のマスク処理装置20cは、図1の撮像装置において、図3のマスク処理装置20の代わりに用い得るものである。図17のマスク処理装置20cは、図3のマスク処理装置20と概して同じであるが、図3のマスク処理領域算出部36の代わりに、マスク処理領域算出部36cが設けられている点で異なる。
Embodiment 4 FIG.
FIG. 17 is a diagram showing a configuration of a mask processing apparatus 20c used in the imaging apparatus according to Embodiment 4 of the present invention. A mask processing apparatus 20c in FIG. 17 can be used in the imaging apparatus in FIG. 1 instead of the mask processing apparatus 20 in FIG. The mask processing apparatus 20c of FIG. 17 is generally the same as the mask processing apparatus 20 of FIG. 3, but differs in that a mask processing area calculation unit 36c is provided instead of the mask processing area calculation unit 36 of FIG. .

マスク処理領域算出部36cは、上記の式(12)で示す処理で算出したマスク処理領域の開始点座標(SUx,SUy)と終了点座標(EUx,EUy)に対して、必要に応じて補正を加える。   The mask processing area calculation unit 36c corrects the start point coordinates (SUx, SUy) and the end point coordinates (EUx, EUy) of the mask processing area calculated by the process expressed by the above formula (12) as necessary. Add

この補正は、マスク処理領域が正方形になるようにするための補正である。具体的には、水平方向の辺の長さ及び垂直方向の辺の長さを比較し、より短い方の辺の長さをより長い方の辺の長さに変更する補正を行う。このような補正の例を図18及び図19に示す。
この処理のため、まず下記の式(14)により、水平方向の辺の長さと垂直方向の辺の長さの差DLNを算出する。
DLN=(EUx−SUx)−(EUy−SUy) (14)
This correction is a correction for making the mask processing area square. Specifically, the length of the side in the horizontal direction is compared with the length of the side in the vertical direction, and correction is performed to change the length of the shorter side to the length of the longer side. Examples of such correction are shown in FIGS.
For this processing, first, a difference DLN between the horizontal side length and the vertical side length is calculated by the following equation (14).
DLN = (EUx−SUx) − (EUy−SUy) (14)

図18に示す例では、水平方向の長さの方が長く、従って、差DLNが0よりも大きくなる。この場合、下記の式(15)で示すように、垂直方向の補正を行う。但し、垂直方向の開始点座標SUyが0未満であり、又は終了点座標EUyがVs−1より大きい場合には補正を行わない。下記の式(15)で、補正後のSUx、SUy、EUx、EUyをSUcx、SUcy、EUcx、EUcyで表す。
SUcy=SUy−DLN/2
SUcx=SUx
EUcy=EUy+DLN/2
EUcx=EUx
(15)
In the example shown in FIG. 18, the length in the horizontal direction is longer, and therefore the difference DLN is greater than zero. In this case, vertical correction is performed as shown in the following equation (15). However, no correction is performed when the vertical start point coordinate SUy is less than 0 or the end point coordinate EUy is greater than Vs-1. In the following equation (15), the corrected SUx, SUy, EUx, EUy are represented by SUcx, SUcy, EUcx, EUcy.
SUcy = SUy-DLN / 2
SUcx = SUx
EUcy = EUy + DLN / 2
EUcx = EUx
(15)

図19に示す例では、垂直方向の長さの方が長く、従って、差DLNが0よりも小さくなる。この場合、下記の式(16)で示すように水平方向の補正を行う。但し、水平方向の開始点座標SUxが0未満であり、又は終了点座標EUxがHs−1より大きい場合には補正を行わない。下記の式(16)で、補正後のSUx、SUy、EUx、EUyをSUcx、SUcy、EUcx、EUcyで表す。
SUcx=SUx+DLN/2
SUcy=SUy
EUcx=EUx−DLN/2
EUcy=EUy
(16)
In the example shown in FIG. 19, the length in the vertical direction is longer, and therefore the difference DLN is smaller than zero. In this case, correction in the horizontal direction is performed as shown by the following equation (16). However, no correction is performed when the horizontal start point coordinate SUx is less than 0 or the end point coordinate EUx is greater than Hs-1. In the following equation (16), the corrected SUx, SUy, EUx, EUy are represented by SUcx, SUcy, EUcx, EUcy.
SUcx = SUx + DLN / 2
SUcy = SUy
EUcx = EUx-DLN / 2
EUcy = EUy
(16)

マスク処理領域算出部36はさらに、マスク処理領域の開始点座標(SUcx,SUcy)を最小値でクリップし、終了点座標(EUcx,EUcy)を最大値でクリップする。
水平方向の最小値及び垂直方向の最小値はともに0である。
水平方向の最大値はHs−1であり、垂直方向の最大値はVs−1である。
この処理は下記の式(17)で表される。
SUdx=min{max(SUcx,0),(Hs−1)}
SUdy=min{max(SUcy,0),(Vs−1)}
EUdx=min{max(EUcx,0),(Hs−1)}
EUdy=min{max(EUcy,0),(Vs−1)}
(17)
Further, the mask processing area calculation unit 36 clips the start point coordinates (SUcx, SUcy) of the mask processing area with the minimum value and clips the end point coordinates (EUcx, EUcy) with the maximum value.
Both the minimum value in the horizontal direction and the minimum value in the vertical direction are zero.
The maximum value in the horizontal direction is Hs-1, and the maximum value in the vertical direction is Vs-1.
This process is expressed by the following equation (17).
SUdx = min {max (SUcx, 0), (Hs-1)}
SUdy = min {max (SUcy, 0), (Vs-1)}
EUdx = min {max (EUcx, 0), (Hs-1)}
EUdy = min {max (EUcy, 0), (Vs−1)}
(17)

上記のクリップ処理を経たマスク処理領域の開始点座標(SUdx,SUdy)及び終了点座標(EUdx,EUdy)は、後処理部17に出力される。後処理部17では、開始点座標(SUdx,SUdy)及び終了点座標(EUdx,EUdy)で定義されるマスク領域に対してマスク処理が行われる。   The start point coordinates (SUdx, SUdy) and the end point coordinates (EUdx, EUdy) of the mask processing area that has undergone the above clipping process are output to the post-processing unit 17. The post-processing unit 17 performs mask processing on the mask area defined by the start point coordinates (SUdx, SUdy) and the end point coordinates (EUdx, EUdy).

以上のように、マスク処理領域算出部36cでは、カメラ部14のパン回転後、チルト動作後も、マスク領域の矩形の水平方向の辺の長さと垂直方向の辺の長さを比較し、長い方の辺を一辺とする正方形に補正する構成としたので、マスク領域は補正しない場合と比べて、若干大きくなり、マスク領域の境界近辺をより確実に覆い隠すことが可能となる効果が得られる。   As described above, the mask processing area calculation unit 36c compares the length of the horizontal side of the rectangle in the mask area with the length of the vertical side after the pan rotation of the camera unit 14 and the tilting operation. Since the correction is made to a square with one side as one side, the mask area is slightly larger than the case where correction is not performed, and an effect of more reliably covering the vicinity of the boundary of the mask area can be obtained. .

また、マスク処理領域算出部36cは、カメラ部14のパン回転後、チルト動作後のマスク領域も、正方形に補正する構成としたので、マスク領域の設定時の正方形という形状を維持したマスク領域をユーザーに提供することが可能となり、形状の不一致による違和感をユーザーに抱かせないという効果が得られる。   Further, since the mask processing area calculation unit 36c is configured to correct the mask area after the tilting operation after the pan rotation of the camera unit 14 to a square, the mask area maintaining the shape of the square when the mask area is set is selected. It can be provided to the user, and an effect of not causing the user to feel uncomfortable due to the shape mismatch is obtained.

なお、上記の例では、修正後のマスク処理領域が正方形になるようにしているが、実施の形態2に関して述べたのと同様に、マスク処理領域に対し、そのアスペクト比(水平方向の長さと垂直方向の長さのうちの小さい方に対する大きい方の比)が、予め定められた上限値以下の矩形となるような修正を加えても良い。   In the above example, the corrected mask processing area is square, but the aspect ratio (the length in the horizontal direction and the length of the mask processing area is similar to that described in the second embodiment. Modification may be made so that the ratio of the larger one of the lengths in the vertical direction to the smaller one is equal to or less than a predetermined upper limit value.

実施の形態4で説明したマスク処理領域算出部36cの特徴を、実施の形態3で説明した特徴と組み合わせても良い。即ち、実施の形態3のように、マスク指定領域を複数の小領域に分割する場合、複数の小領域に対応して生成される複数のマスク処理領域の各々に対して、実施の形態4で説明したように形状の補正を行うこととしても良い。形状の補正は、正方形への変形に限らず、正方形以外の、アスペクト比が制限された矩形となるような補正であっても良い。   The features of the mask processing region calculation unit 36c described in the fourth embodiment may be combined with the features described in the third embodiment. That is, when the mask designation area is divided into a plurality of small areas as in the third embodiment, each of the plurality of mask processing areas generated corresponding to the plurality of small areas is described in the fourth embodiment. As described above, the shape may be corrected. The shape correction is not limited to the deformation to the square, but may be a correction other than the square so that the rectangle has a limited aspect ratio.

以上本発明をマスク処理装置及び該マスク処理装置を含む撮像装置として説明したが、上記のマスク処理装置で実施されるマスク処理方法及び上記の撮像装置で実施される撮像方法もまた本発明の一部を成す。   Although the present invention has been described as a mask processing apparatus and an imaging apparatus including the mask processing apparatus, the mask processing method implemented by the mask processing apparatus and the imaging method implemented by the imaging apparatus are also one aspect of the present invention. Form part.

上記のマスク処理装置又は撮像装置の構成の一部又は全部で行われる処理、或いは上記のマスク処理方法又は撮像方法で行われる処理の一部又は全部はプロセッサを備えたコンピュータに実行させることができる。従って、コンピュータに上記のマスク処理装置又は撮像装置の構成の一部又は全部で行われる処理、及び上記のマスク処理方法又は撮像方法で行われる処理の一部又は全部を実行させるためのプログラム、並びに該プログラムを記録した、コンピュータで読み取り可能な記録媒体もまた本発明の一部を成す。   A part or all of the processing performed in part or all of the configuration of the mask processing apparatus or the imaging apparatus, or part or all of the processing performed in the mask processing method or the imaging method can be executed by a computer including a processor. . Therefore, a program for causing a computer to execute part or all of the processing performed in part or all of the configuration of the mask processing apparatus or imaging apparatus, and the processing performed in the mask processing method or imaging method, and A computer-readable recording medium on which the program is recorded also forms part of the present invention.

上記のコンピュータの一例を図20に示す。図20のコンピュータは、図1の後処理部17、制御部19及びマスク処理装置20の機能を実行するものであり、
プロセッサ51と、プログラムメモリ52と、データメモリ53と、画像入力インターフェース54と、制御入力インターフェース55と、出力インターフェース56とを備え、これらはデータバス57で接続されている。
画像入力インターフェース54には、例えば図1の前処理部15から出力されるデジタル画像信号Dbが供給される。
制御入力インターフェース55には、操作入力部23からのマスク領域指定情報MRDが供給される。
An example of the computer is shown in FIG. The computer in FIG. 20 executes the functions of the post-processing unit 17, the control unit 19, and the mask processing apparatus 20 in FIG.
A processor 51, a program memory 52, a data memory 53, an image input interface 54, a control input interface 55, and an output interface 56 are provided, and these are connected by a data bus 57.
For example, a digital image signal Db output from the preprocessing unit 15 of FIG. 1 is supplied to the image input interface 54.
The control input interface 55 is supplied with mask region designation information MRD from the operation input unit 23.

プロセッサ51は、プログラムメモリ52に記憶されたプログラムに従って動作し、制御入力インターフェース55を介して入力されたマスク領域指定情報MRDに基づいて、実施の形態1、2、3又は4で記載のように、制御部19及びマスク処理装置20、20b又は20cと同じ処理を行い、画像入力インターフェース54から供給された撮像画像Dbに対して後処理部17と同じ処理を行う。   The processor 51 operates in accordance with a program stored in the program memory 52 and, as described in the first, second, third, or fourth embodiment, based on the mask area designation information MRD input via the control input interface 55. The same processing as that of the control unit 19 and the mask processing device 20, 20b, or 20c is performed, and the same processing as that of the post-processing unit 17 is performed on the captured image Db supplied from the image input interface 54.

即ち、制御部19と同じ処理として、回転駆動機構11及びカメラ部14に対する制御を行うとともに、マスク領域指定情報MRDを出力し、マスク処理装置20、20b又は20cと同じ処理として、マスク処理領域の算出を行い、後処理部17と同じ処理として、撮像画像Dbに対するマスク処理を行う。
マスク処理の結果生成された画像Dcは出力インターフェース56から出力され、例えば表示装置22に供給される。
That is, as the same processing as the control unit 19, the rotational drive mechanism 11 and the camera unit 14 are controlled, and the mask region designation information MRD is output. Calculation is performed, and mask processing for the captured image Db is performed as the same processing as the post-processing unit 17.
The image Dc generated as a result of the mask process is output from the output interface 56 and supplied to the display device 22, for example.

プロセッサ51による処理の内容は、実施の形態1、2、3又は4で説明したのと同様である。処理の過程で生成されるデータはデータメモリ53に保持される。   The contents of processing by the processor 51 are the same as those described in the first, second, third, or fourth embodiment. Data generated in the course of processing is held in the data memory 53.

なお、図20に示されるコンピュータを複数台設け、それぞれに、マスク処理装置又は撮像装置の各部の処理を行わせることとしても良い。マスク処理方法又は撮像方法の処理の一部又は全部をコンピュータに実行させる場合も同様である。   Note that a plurality of computers shown in FIG. 20 may be provided, and each unit may perform processing of each part of the mask processing apparatus or the imaging apparatus. The same applies to a case where a part or all of the mask processing method or the imaging method is executed by a computer.

11 回転駆動機構、 12 ズームレンズ、 13 撮像素子、 14 カメラ部、 15 前処理部、 16 撮像部、 17 後処理部、 18 映像信号出力端子、 19 制御部、 20 マスク処理装置、 31 撮像条件取得部、 32 指定領域変換部、 33、33b マスク領域登録部、 34、34b マスク領域記憶部、 35、35b 平面座標算出部、 36、36b、36c マスク処理領域算出部、 37、37b 指定領域逆変換部、 331、331b 指定領域補正部、 332、332b 球面座標算出部。   DESCRIPTION OF SYMBOLS 11 Rotation drive mechanism, 12 Zoom lens, 13 Imaging device, 14 Camera part, 15 Pre-processing part, 16 Imaging part, 17 Post-processing part, 18 Video signal output terminal, 19 Control part, 20 Mask processing apparatus, 31 Acquisition of imaging conditions 32, designated area conversion section, 33, 33b mask area registration section, 34, 34b mask area storage section, 35, 35b plane coordinate calculation section, 36, 36b, 36c mask processing area calculation section, 37, 37b reverse conversion of specified area 331, 331b designated area correction unit, 332, 332b spherical coordinate calculation unit.

Claims (20)

焦点距離が変更可能で、被写体からの光を集光して光学像を形成するズームレンズと、前記ズームレンズで形成された光学像を電気信号に変換して撮像画像を出力する撮像素子とを含むカメラ部と、前記カメラ部に対してパン駆動及びチルト駆動を行う回転駆動機構とを有する撮像装置のマスク処理装置であって、
前記カメラ部の撮像方向を示す方向情報と、前記ズームレンズの焦点距離を示す焦点距離情報とを取得する撮像条件取得部と、
前記カメラ部が前記ズームレンズの焦点距離を第1の焦点距離とし、撮像方向を第1の撮像方向として、撮像を行うことで得られた第1の撮像画像内で、マスク領域として指定された矩形の領域の座標を、第1の仮想平面上の座標に変換する指定領域変換部と、
前記第1の仮想平面上の座標で定義される矩形の領域の水平方向の辺及び垂直方向の辺の内の短い方に対する長い方の比が予め定められた上限値よりも大きいときに、前記矩形の領域の形状を変更し、変更によって生成された矩形の領域の頂点の座標を生成する指定領域補正部と、
前記指定領域補正部で生成された頂点の座標を、仮想球面上の座標に変換する球面座標算出部と、
前記球面座標算出部で算出された前記仮想球面上の座標を記憶するマスク領域記憶部と、
前記カメラ部が前記ズームレンズの焦点距離を第2の焦点距離とし、撮像方向を第2の撮像方向として、撮像を行うことで第2の撮像画像が生成されたとき、前記マスク領域記憶部から前記仮想球面上の座標を読出し、第2の仮想平面上の座標に変換する平面座標算出部と、
前記平面座標算出部における変換で得られた、前記第2の仮想平面上の座標を、前記第2の撮像画像内の座標に変換し、この変換により得られた座標で定義される領域に外接する矩形の領域をマスク処理領域として算出するマスク処理領域算出部とを有し、
前記指定領域補正部は、前記第1の仮想平面上の座標で定義される矩形の領域の水平方向の辺と垂直方向の辺のうち、長い方の長さを短い方の長さに一致するように変更する
ことを特徴とするマスク処理装置。
A zoom lens that can change a focal length, collects light from a subject to form an optical image, and an imaging device that converts the optical image formed by the zoom lens into an electrical signal and outputs a captured image A mask processing apparatus for an imaging apparatus, comprising: a camera unit including: a rotation driving mechanism that performs pan driving and tilt driving with respect to the camera unit;
An imaging condition acquisition unit that acquires direction information indicating an imaging direction of the camera unit and focal length information indicating a focal length of the zoom lens;
The camera unit is designated as a mask region in a first captured image obtained by performing imaging with the focal length of the zoom lens as the first focal length and the imaging direction as the first imaging direction. A designated area conversion unit for converting the coordinates of the rectangular area into coordinates on the first virtual plane;
When the ratio of the longer side to the shorter side of the horizontal side and the vertical side of the rectangular region defined by the coordinates on the first virtual plane is larger than a predetermined upper limit value, A designated area correction unit that changes the shape of the rectangular area and generates the coordinates of the vertices of the rectangular area generated by the change;
A spherical coordinate calculation unit that converts the coordinates of the vertex generated by the specified region correction unit into coordinates on a virtual sphere,
A mask area storage unit for storing coordinates on the virtual sphere calculated by the spherical coordinate calculation unit;
When the camera unit generates a second captured image by performing imaging with the focal length of the zoom lens as the second focal length and the imaging direction as the second imaging direction, from the mask area storage unit A plane coordinate calculation unit that reads coordinates on the virtual sphere and converts them into coordinates on a second virtual plane;
The coordinates on the second virtual plane obtained by the conversion in the plane coordinate calculation unit are converted into coordinates in the second captured image, and circumscribed in the area defined by the coordinates obtained by the conversion. A mask processing area calculation unit that calculates a rectangular area to be used as a mask processing area,
The designated area correction unit matches a longer length with a shorter length of a horizontal side and a vertical side of a rectangular region defined by coordinates on the first virtual plane. The mask processing apparatus is characterized by being modified as follows.
前記指定領域補正部は、前記第1の仮想平面上の座標で定義される矩形の領域の水平方向の辺及び垂直方向の辺の長さのうち、長い方の長さを変更する際に、前記第1の仮想平面上の座標で定義される前記矩形のマスク指定領域の中心の位置を維持する
ことを特徴とする請求項1に記載のマスク処理装置。
The designated area correction unit, when changing the length of the longer of the horizontal side and the vertical side of the rectangular region defined by the coordinates on the first virtual plane, The mask processing apparatus according to claim 1, wherein a position of a center of the rectangular mask designation area defined by coordinates on the first virtual plane is maintained.
前記マスク処理領域算出部は、前記矩形のマスク処理領域の水平方向の辺と、垂直方向の辺のうち、短い方の長さに対する長い方の長さの比が予め定められた閾値以下となるように、前記水平方向の辺の長さ及び前記垂直方向の辺の長さの少なくとも一方を変更する
ことを特徴とする請求項1又は2に記載のマスク処理装置。
The mask processing area calculation unit has a ratio of a longer length to a shorter length of a horizontal side and a vertical side of the rectangular mask processing area equal to or less than a predetermined threshold value. as such, mask processing apparatus according to claim 1 or 2, characterized in that changing at least one length of the horizontal side length and the vertical sides.
前記マスク処理領域算出部は、前記矩形のマスク処理領域の水平方向の辺と、垂直方向の辺のうち、短い方の長さを、長い方の長さに一致するように変更する
ことを特徴とする請求項に記載のマスク処理装置。
The mask processing area calculation unit is configured to change a shorter length of a horizontal side and a vertical side of the rectangular mask processing area so as to coincide with a longer length. The mask processing apparatus according to claim 3 .
前記マスク処理領域算出部は、前記矩形のマスク処理領域の水平方向の辺又は垂直方向の辺の長さを変更する際に、前記矩形のマスク処理領域の中心の位置を維持する
ことを特徴とする請求項3又は4に記載のマスク処理装置。
The mask processing region calculation unit maintains the position of the center of the rectangular mask processing region when changing the length of a horizontal side or a vertical side of the rectangular mask processing region. The mask processing apparatus according to claim 3 or 4 .
焦点距離が変更可能で、被写体からの光を集光して光学像を形成するズームレンズと、前記ズームレンズで形成された光学像を電気信号に変換して撮像画像を出力する撮像素子とを含むカメラ部と、前記カメラ部に対してパン駆動及びチルト駆動を行う回転駆動機構とを有する撮像装置のマスク処理装置であって、
前記カメラ部の撮像方向を示す方向情報と、前記ズームレンズの焦点距離を示す焦点距離情報とを取得する撮像条件取得部と、
前記カメラ部が前記ズームレンズの焦点距離を第1の焦点距離とし、撮像方向を第1の撮像方向として、撮像を行うことで得られた第1の撮像画像内で、マスク領域として指定された矩形の領域の座標を、第1の仮想平面上の座標に変換する指定領域変換部と、
前記第1の仮想平面上の座標で定義される矩形の領域の水平方向の辺及び垂直方向の辺の内の短い方に対する長い方の比が予め定められた上限値よりも大きいときに、前記矩形の領域を複数の矩形の小領域に分割し、前記複数の小領域の各々の頂点の座標を生成する指定領域補正部と、
前記指定領域補正部で生成された、前記複数の小領域の各々についての前記頂点の座標を、仮想球面上の座標に変換する球面座標算出部と、
前記球面座標算出部で算出された、前記複数の小領域の各々についての、前記仮想球面上の座標を記憶するマスク領域記憶部と、
前記カメラ部が前記ズームレンズの焦点距離を第2の焦点距離とし、撮像方向を第2の撮像方向として、撮像を行うことで第2の撮像画像が生成されたとき、前記マスク領域記憶部から前記複数の小領域の各々についての前記仮想球面上の座標を読出し、第2の仮想平面上の座標に変換する平面座標算出部と、
前記平面座標算出部における変換で得られた、前記複数の小領域の各々についての、前記第2の仮想平面上の座標を、前記第2の撮像画像内の座標に変換し、この変換により得られた座標で定義される複数の小領域の各々に外接する複数の矩形の領域を複数のマスク処理領域として算出するマスク処理領域算出部とを有し、
前記指定領域補正部は、前記第1の仮想平面上の座標で定義される矩形の領域を、複数の矩形の小領域に分割し、
前記分割を、前記小領域の各々において、水平方向の辺と垂直方向の辺のうち、短い方の長さに対する長い方の長さの比が、予め定められた閾値以下となるように行う
ことを特徴とするマスク処理装置。
A zoom lens that can change a focal length, collects light from a subject to form an optical image, and an imaging device that converts the optical image formed by the zoom lens into an electrical signal and outputs a captured image A mask processing apparatus for an imaging apparatus, comprising: a camera unit including: a rotation driving mechanism that performs pan driving and tilt driving with respect to the camera unit;
An imaging condition acquisition unit that acquires direction information indicating an imaging direction of the camera unit and focal length information indicating a focal length of the zoom lens;
The camera unit is designated as a mask region in a first captured image obtained by performing imaging with the focal length of the zoom lens as the first focal length and the imaging direction as the first imaging direction. A designated area conversion unit for converting the coordinates of the rectangular area into coordinates on the first virtual plane;
When the ratio of the longer side to the shorter side of the horizontal side and the vertical side of the rectangular region defined by the coordinates on the first virtual plane is larger than a predetermined upper limit value, A designated area correction unit that divides a rectangular area into a plurality of rectangular small areas and generates coordinates of each vertex of the plurality of small areas;
A spherical coordinate calculation unit that converts the coordinates of the vertex for each of the plurality of small regions generated by the designated region correction unit into coordinates on a virtual sphere,
A mask area storage unit for storing coordinates on the virtual sphere for each of the plurality of small areas calculated by the spherical coordinate calculation unit;
When the camera unit generates a second captured image by performing imaging with the focal length of the zoom lens as the second focal length and the imaging direction as the second imaging direction, from the mask area storage unit A plane coordinate calculation unit that reads coordinates on the virtual sphere for each of the plurality of small regions and converts the coordinates to coordinates on a second virtual plane;
The coordinates on the second virtual plane for each of the plurality of small regions obtained by the conversion in the plane coordinate calculation unit are converted into coordinates in the second captured image, and obtained by this conversion. A mask processing area calculation unit that calculates a plurality of rectangular areas circumscribing each of the plurality of small areas defined by the given coordinates as a plurality of mask processing areas;
The designated area correction unit divides a rectangular area defined by coordinates on the first virtual plane into a plurality of rectangular small areas,
The division is performed so that, in each of the small regions, a ratio of a longer length to a shorter length of a horizontal side and a vertical side is equal to or less than a predetermined threshold value. A mask processing apparatus.
前記複数の矩形の小領域が正方形の領域であることを特徴とする請求項に記載のマスク処理装置。 The mask processing apparatus according to claim 6 , wherein the plurality of rectangular small areas are square areas. 前記マスク処理領域算出部は、前記複数の矩形のマスク処理領域の各々について、その水平方向の辺と、垂直方向の辺のうち、短い方の長さに対する長い方の長さの比が予め定められた閾値以下となるように、前記水平方向の辺の長さ及び前記垂直方向の辺の長さの少なくとも一方を変更する
ことを特徴とする請求項6又は7に記載のマスク処理装置。
The mask processing region calculation unit determines in advance a ratio of a longer length to a shorter length of a horizontal side and a vertical side of each of the plurality of rectangular mask processing regions. The mask processing apparatus according to claim 6, wherein at least one of the horizontal side length and the vertical side length is changed so as to be equal to or less than a predetermined threshold value.
前記マスク処理領域算出部は、前記複数の矩形のマスク処理領域の各々について、その水平方向の辺と、垂直方向の辺のうち、短い方の長さを、長い方の長さに一致するように変更する
ことを特徴とする請求項に記載のマスク処理装置。
For each of the plurality of rectangular mask processing regions, the mask processing region calculation unit is configured so that the shorter one of the horizontal side and the vertical side matches the longer side. The mask processing apparatus according to claim 8 , wherein the mask processing apparatus is changed to:
前記マスク処理領域算出部は、前記複数の矩形のマスク処理領域の各々について、その水平方向の辺又は垂直方向の辺の長さを変更する際に、当該矩形のマスク処理領域の中心の位置を維持する
ことを特徴とする請求項8又は9に記載のマスク処理装置。
The mask processing area calculation unit determines the position of the center of the rectangular mask processing area when changing the length of the horizontal side or the vertical side of each of the plurality of rectangular mask processing areas. The mask processing apparatus according to claim 8 , wherein the mask processing apparatus is maintained.
前記第1の仮想平面及び前記第2の仮想平面は、前記ズームレンズの焦点距離が基準焦点距離であるときの前記撮像画像の位置にあり、
前記仮想球面は、三次元座標空間においてカメラ部の位置を原点とし半径が1である仮想球面であり、
前記第1の仮想平面は、前記第1の撮像方向に垂直で、前記仮想球面に接する平面であり、
前記第2の仮想平面は、前記第2の撮像方向に垂直で、前記仮想球面に接する平面であり、
前記球面座標算出部は、前記第1の仮想平面上の、前記指定領域補正部で生成された頂点の座標を、前記仮想球面上に射影し、前記第1の撮像方向に対応する角度だけ回転させることで、前記仮想球面上の座標を求め、
前記平面座標算出部は、前記仮想球面上の座標を、前記第2の撮像方向に対応する角度と大きさが同じで向きが逆の角度だけ回転させ、前記第2の仮想平面上に射影することで、前記第2の仮想平面上の座標を算出する
ことを特徴とする請求項1から10のいずれか1項に記載のマスク処理装置。
The first virtual plane and the second virtual plane are at the position of the captured image when the focal length of the zoom lens is a reference focal length,
The virtual spherical surface is a virtual spherical surface having a radius of 1 with the position of the camera unit as the origin in a three-dimensional coordinate space,
The first virtual plane is a plane perpendicular to the first imaging direction and in contact with the virtual spherical surface;
The second virtual plane is a plane perpendicular to the second imaging direction and in contact with the virtual spherical surface,
The spherical coordinate calculation unit projects the vertex coordinates generated by the designated region correction unit on the first virtual plane onto the virtual spherical surface, and rotates by an angle corresponding to the first imaging direction. To obtain the coordinates on the virtual sphere,
The plane coordinate calculation unit rotates the coordinates on the virtual sphere by an angle that is the same as the angle corresponding to the second imaging direction and has the opposite direction, and projects it onto the second virtual plane. it is, mask processing apparatus according to any one of claims 1 to 10, and calculates the coordinates on the second virtual plane.
請求項1から、及び11のいずれか1項に記載のマスク処理装置と、
前記カメラ部で生成された撮像画像のうち、前記マスク処理領域算出部で算出されたマスク処理領域に対応する部分をマスクして出力する画像処理部とを有する
ことを特徴とする撮像装置。
The mask processing apparatus according to any one of claims 1 to 5 and 11 ,
An image processing apparatus comprising: an image processing unit that masks and outputs a portion corresponding to the mask processing region calculated by the mask processing region calculation unit of the captured image generated by the camera unit.
請求項6から11のいずれか1項に記載のマスク処理装置と、
前記カメラ部で生成された撮像画像のうち、前記マスク処理領域算出部で算出された前記複数のマスク処理領域に対応する部分をマスクして出力する画像処理部とを有する
ことを特徴とする撮像装置。
The mask processing apparatus according to any one of claims 6 to 11 ,
An image processing unit that masks and outputs portions corresponding to the plurality of mask processing regions calculated by the mask processing region calculation unit out of the captured images generated by the camera unit. apparatus.
焦点距離が変更可能で、被写体からの光を集光して光学像を形成するズームレンズと、前記ズームレンズで形成された光学像を電気信号に変換して撮像画像を出力する撮像素子とを含むカメラ部と、前記カメラ部に対してパン駆動及びチルト駆動を行う回転駆動機構とを有する撮像装置で実施されるマスク処理方法であって、
前記カメラ部の撮像方向を示す方向情報と、前記ズームレンズの焦点距離を示す焦点距離情報とを取得する撮像条件取得ステップと、
前記カメラ部が前記ズームレンズの焦点距離を第1の焦点距離とし、撮像方向を第1の撮像方向として、撮像を行うことで得られた第1の撮像画像内で、マスク領域として指定された矩形の領域の座標を、第1の仮想平面上の座標に変換する指定領域変換ステップと、
前記第1の仮想平面上の座標で定義される矩形の領域の水平方向の辺及び垂直方向の辺の内の短い方に対する長い方の比が予め定められた上限値よりも大きいときに、前記矩形の領域の形状を変更し、変更によって生成された矩形の領域の頂点の座標を生成する指定領域補正ステップと、
前記指定領域補正ステップで生成された頂点の座標を、仮想球面上の座標に変換する球面座標算出ステップと、
前記球面座標算出ステップで算出された前記仮想球面上の座標をマスク領域記憶部に記憶させる記憶ステップと、
前記カメラ部が前記ズームレンズの焦点距離を第2の焦点距離とし、撮像方向を第2の撮像方向として、撮像を行うことで第2の撮像画像が生成されたとき、前記マスク領域記憶部から前記仮想球面上の座標を読出し、第2の仮想平面上の座標に変換する平面座標算出ステップと、
前記平面座標算出ステップにおける変換で得られた、前記第2の仮想平面上の座標を、前記第2の撮像画像内の座標に変換し、この変換により得られた座標で定義される領域に外接する矩形の領域をマスク処理領域として算出するマスク処理領域算出ステップとを有し、
前記指定領域補正ステップは、前記第1の仮想平面上の座標で定義される矩形の領域の水平方向の辺と垂直方向の辺のうち、長い方の長さを短い方の長さに一致するように変更する
ことを特徴とするマスク処理方法。
A zoom lens that can change a focal length, collects light from a subject to form an optical image, and an imaging device that converts the optical image formed by the zoom lens into an electrical signal and outputs a captured image A mask processing method implemented by an imaging apparatus having a camera unit including a rotation driving mechanism that performs pan driving and tilt driving with respect to the camera unit,
An imaging condition acquisition step of acquiring direction information indicating an imaging direction of the camera unit and focal length information indicating a focal length of the zoom lens;
The camera unit is designated as a mask region in a first captured image obtained by performing imaging with the focal length of the zoom lens as the first focal length and the imaging direction as the first imaging direction. A designated area conversion step of converting the coordinates of the rectangular area into coordinates on the first virtual plane;
When the ratio of the longer side to the shorter side of the horizontal side and the vertical side of the rectangular region defined by the coordinates on the first virtual plane is larger than a predetermined upper limit value, A designated area correction step for changing the shape of the rectangular area and generating the coordinates of the vertices of the rectangular area generated by the change;
A spherical coordinate calculation step for converting the coordinates of the vertex generated in the specified region correction step into coordinates on a virtual sphere,
A storage step of storing the coordinates on the virtual sphere calculated in the spherical coordinate calculation step in a mask area storage unit;
When the camera unit generates a second captured image by performing imaging with the focal length of the zoom lens as the second focal length and the imaging direction as the second imaging direction, from the mask area storage unit A plane coordinate calculation step of reading coordinates on the virtual sphere and converting them to coordinates on a second virtual plane;
The coordinates on the second virtual plane obtained by the conversion in the plane coordinate calculating step are converted into coordinates in the second captured image, and circumscribed in the area defined by the coordinates obtained by the conversion. And a mask processing area calculation step for calculating a rectangular area to be used as a mask processing area,
In the designated area correction step, the longer one of the horizontal side and the vertical side of the rectangular area defined by the coordinates on the first virtual plane is made equal to the shorter one. The mask processing method characterized by changing as follows.
請求項14に記載のマスク処理方法と、
前記カメラ部で生成された撮像画像のうち、前記マスク処理領域算出ステップで算出されたマスク処理領域をマスクして出力する画像処理ステップとを有する
ことを特徴とする撮像方法。
The mask processing method according to claim 14 ;
An image processing method comprising: an image processing step of masking and outputting the mask processing region calculated in the mask processing region calculation step in the captured image generated by the camera unit.
焦点距離が変更可能で、被写体からの光を集光して光学像を形成するズームレンズと、前記ズームレンズで形成された光学像を電気信号に変換して撮像画像を出力する撮像素子とを含むカメラ部と、前記カメラ部に対してパン駆動及びチルト駆動を行う回転駆動機構とを有する撮像装置で実施されるマスク処理方法であって、
前記カメラ部の撮像方向を示す方向情報と、前記ズームレンズの焦点距離を示す焦点距離情報とを取得する撮像条件取得ステップと、
前記カメラ部が前記ズームレンズの焦点距離を第1の焦点距離とし、撮像方向を第1の撮像方向として、撮像を行うことで得られた第1の撮像画像内で、マスク領域として指定された矩形の領域の座標を、第1の仮想平面上の座標に変換する指定領域変換ステップと、
前記第1の仮想平面上の座標で定義される矩形の領域の水平方向の辺及び垂直方向の辺の内の短い方に対する長い方の比が予め定められた上限値よりも大きいときに、前記矩形の領域を複数の矩形の小領域に分割し、前記複数の小領域の各々の頂点の座標を生成する指定領域補正ステップと、
前記指定領域補正ステップで生成された、前記複数の小領域の各々についての前記頂点の座標を、仮想球面上の座標に変換する球面座標算出ステップと、
前記球面座標算出ステップで算出された、前記複数の小領域の各々についての、前記仮想球面上の座標をマスク領域記憶部に記憶させる記憶ステップと、
前記カメラ部が前記ズームレンズの焦点距離を第2の焦点距離とし、撮像方向を第2の撮像方向として、撮像を行うことで第2の撮像画像が生成されたとき、前記マスク領域記憶部から前記複数の小領域の各々についての前記仮想球面上の座標を読出し、第2の仮想平面上の座標に変換する平面座標算出ステップと、
前記平面座標算出ステップにおける変換で得られた、前記複数の小領域の各々についての、前記第2の仮想平面上の座標を、前記第2の撮像画像内の座標に変換し、この変換により得られた座標で定義される複数の小領域の各々に外接する複数の矩形の領域を複数のマスク処理領域として算出するマスク処理領域算出ステップとを有し、
前記指定領域補正ステップは、前記第1の仮想平面上の座標で定義される矩形の領域を、複数の矩形の小領域に分割し、
前記分割を、前記小領域の各々において、水平方向の辺と垂直方向の辺のうち、短い方の長さに対する長い方の長さの比が、予め定められた閾値以下となるように行う
ことを特徴とするマスク処理方法
A zoom lens that can change a focal length, collects light from a subject to form an optical image, and an imaging device that converts the optical image formed by the zoom lens into an electrical signal and outputs a captured image A mask processing method implemented by an imaging apparatus having a camera unit including a rotation driving mechanism that performs pan driving and tilt driving with respect to the camera unit,
An imaging condition acquisition step of acquiring direction information indicating an imaging direction of the camera unit and focal length information indicating a focal length of the zoom lens;
The camera unit is designated as a mask region in a first captured image obtained by performing imaging with the focal length of the zoom lens as the first focal length and the imaging direction as the first imaging direction. A designated area conversion step of converting the coordinates of the rectangular area into coordinates on the first virtual plane;
When the ratio of the longer side to the shorter side of the horizontal side and the vertical side of the rectangular region defined by the coordinates on the first virtual plane is larger than a predetermined upper limit value, A designated area correction step of dividing a rectangular area into a plurality of rectangular small areas and generating coordinates of vertices of each of the plurality of small areas;
A spherical coordinate calculation step for converting the coordinates of the vertex for each of the plurality of small regions generated in the specified region correction step into coordinates on a virtual sphere;
A storage step of storing coordinates on the virtual sphere for each of the plurality of small regions calculated in the spherical coordinate calculation step in a mask region storage unit;
When the camera unit generates a second captured image by performing imaging with the focal length of the zoom lens as the second focal length and the imaging direction as the second imaging direction, from the mask area storage unit A plane coordinate calculation step of reading coordinates on the virtual spherical surface for each of the plurality of small regions and converting the coordinates to coordinates on a second virtual plane;
The coordinates on the second virtual plane for each of the plurality of small areas obtained by the conversion in the plane coordinate calculation step are converted into coordinates in the second captured image, and obtained by this conversion. A mask processing area calculating step for calculating a plurality of rectangular areas circumscribing each of the plurality of small areas defined by the coordinates as a plurality of mask processing areas,
The designated area correction step divides a rectangular area defined by coordinates on the first virtual plane into a plurality of rectangular small areas;
The division is performed so that, in each of the small regions, a ratio of a longer length to a shorter length of a horizontal side and a vertical side is equal to or less than a predetermined threshold value. A mask processing method characterized by the above.
請求項16に記載のマスク処理方法と、
前記カメラ部で生成された撮像画像のうち、前記マスク処理領域算出ステップで算出された前記複数のマスク処理領域に対応する部分をマスクして出力する画像処理ステップとを有する
ことを特徴とする撮像方法。
The mask processing method according to claim 16 ,
An image processing step of masking and outputting portions corresponding to the plurality of mask processing regions calculated in the mask processing region calculation step of the captured image generated by the camera unit. Method.
請求項14又は16に記載のマスク処理方法の各ステップの処理をコンピュータに実行させるためのプログラム。 The program for making a computer perform the process of each step of the mask processing method of Claim 14 or 16 . 請求項15又は17に記載の撮像方法の各ステップの処理をコンピュータに実行させるためのプログラム。 The program for making a computer perform the process of each step of the imaging method of Claim 15 or 17 . 請求項18又は19に記載のプログラムを記録したコンピュータで読取り可能な記録媒体。 A computer-readable recording medium on which the program according to claim 18 or 19 is recorded.
JP2015084985A 2015-04-17 2015-04-17 Mask processing apparatus and method, imaging apparatus and method, program, and recording medium Expired - Fee Related JP6403628B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2015084985A JP6403628B2 (en) 2015-04-17 2015-04-17 Mask processing apparatus and method, imaging apparatus and method, program, and recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015084985A JP6403628B2 (en) 2015-04-17 2015-04-17 Mask processing apparatus and method, imaging apparatus and method, program, and recording medium

Publications (3)

Publication Number Publication Date
JP2016208147A JP2016208147A (en) 2016-12-08
JP2016208147A5 JP2016208147A5 (en) 2017-11-30
JP6403628B2 true JP6403628B2 (en) 2018-10-10

Family

ID=57490510

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015084985A Expired - Fee Related JP6403628B2 (en) 2015-04-17 2015-04-17 Mask processing apparatus and method, imaging apparatus and method, program, and recording medium

Country Status (1)

Country Link
JP (1) JP6403628B2 (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5812593B2 (en) * 2010-10-28 2015-11-17 キヤノン株式会社 VIDEO PROCESSING DEVICE, IMAGING DEVICE, VIDEO PROCESSING METHOD, AND PROGRAM
JP5389879B2 (en) * 2011-09-20 2014-01-15 株式会社日立製作所 Imaging apparatus, surveillance camera, and camera screen masking method
JP2013093673A (en) * 2011-10-24 2013-05-16 Canon Marketing Japan Inc Information processing apparatus, control method, information processing system, program
JP6234015B2 (en) * 2012-07-30 2017-11-22 キヤノン株式会社 IMAGING DEVICE, MASK AREA DISPLAY METHOD, AND IMAGING DEVICE CONTROL METHOD

Also Published As

Publication number Publication date
JP2016208147A (en) 2016-12-08

Similar Documents

Publication Publication Date Title
US10366477B2 (en) Image processing apparatus and image processing method
WO2018214365A1 (en) Image correction method, apparatus, device, and system, camera device, and display device
JP5088018B2 (en) Image processing apparatus and control program
US20150178897A1 (en) Method And System For Correcting A Distorted Input Image
JP4899803B2 (en) Image processing apparatus, camera apparatus, image processing method, and program
JP4811462B2 (en) Image processing method, image processing program, image processing apparatus, and imaging apparatus
US20140375762A1 (en) Information processing apparatus and method, image processing apparatus and method, and program
JP2010183386A (en) Apparatus and method of processing image, and imaging apparatus
CN108805807B (en) Splicing method and system for ring scene images
JP2007142495A (en) Planar projector and planar projection program
WO2018066760A1 (en) Method for acquiring optimal spherical image by using multiple cameras
US8937676B2 (en) Video processing apparatus, imaging apparatus, video processing method, and storage medium
JP2010072813A (en) Image processing device and image processing program
JP6403628B2 (en) Mask processing apparatus and method, imaging apparatus and method, program, and recording medium
KR101529820B1 (en) Method and apparatus for determing position of subject in world coodinate system
JP6736916B2 (en) Information processing apparatus, information processing method, and program
CN115174878B (en) Projection picture correction method, apparatus and storage medium
CN114900675A (en) Laser projection apparatus and projected image correction method
JP2016142991A (en) Image processing system, information processing device, image processing method and program
CN111428707B (en) Method and device for identifying pattern identification code, storage medium and electronic equipment
CN114979600A (en) Laser projection apparatus and projected image correction method
CN113902644A (en) Image processing method, device, equipment and storage medium
JP4212430B2 (en) Multiple image creation apparatus, multiple image creation method, multiple image creation program, and program recording medium
CN109214983B (en) Image acquisition device and image splicing method thereof
JP2020194532A (en) Method, system, and device for detecting object in distorted image

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20171017

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20171017

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20180726

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20180911

R150 Certificate of patent or registration of utility model

Ref document number: 6403628

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees