JP2014147034A - Image processing apparatus, image processing method, and program - Google Patents
Image processing apparatus, image processing method, and program Download PDFInfo
- Publication number
- JP2014147034A JP2014147034A JP2013015839A JP2013015839A JP2014147034A JP 2014147034 A JP2014147034 A JP 2014147034A JP 2013015839 A JP2013015839 A JP 2013015839A JP 2013015839 A JP2013015839 A JP 2013015839A JP 2014147034 A JP2014147034 A JP 2014147034A
- Authority
- JP
- Japan
- Prior art keywords
- image
- correction
- processing
- region
- area
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000012545 processing Methods 0.000 title claims abstract description 109
- 238000003672 processing method Methods 0.000 title claims abstract description 32
- 238000012937 correction Methods 0.000 claims abstract description 147
- 238000004364 calculation method Methods 0.000 claims abstract description 65
- 230000004075 alteration Effects 0.000 claims abstract description 11
- 238000000034 method Methods 0.000 claims description 82
- 230000008569 process Effects 0.000 claims description 70
- 238000003384 imaging method Methods 0.000 claims description 58
- 238000006243 chemical reaction Methods 0.000 description 21
- 238000005520 cutting process Methods 0.000 description 11
- 241000226585 Antennaria plantaginifolia Species 0.000 description 7
- 238000010586 diagram Methods 0.000 description 6
- 238000004590 computer program Methods 0.000 description 4
- 230000007547 defect Effects 0.000 description 4
- 230000008859 change Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000009466 transformation Effects 0.000 description 3
- 238000013459 approach Methods 0.000 description 2
- 238000007796 conventional method Methods 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000012447 hatching Effects 0.000 description 1
- 230000011514 reflex Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Images
Landscapes
- Image Processing (AREA)
- Studio Devices (AREA)
Abstract
Description
本発明は、画像処理装置、画像処理方法、プログラムに関する。詳しくは、本発明は、撮像装置によって撮影された画像を補正する画像処理装置、画像処理方法、プログラムに関するものであり、特に、画像処理装置の収差補正時における画像の切り出し方法に関する。 The present invention relates to an image processing apparatus, an image processing method, and a program. Specifically, the present invention relates to an image processing device, an image processing method, and a program for correcting an image captured by an imaging device, and more particularly, to an image clipping method at the time of aberration correction of the image processing device.
従来、撮像装置によって撮影された画像に対して、歪曲収差と呼ばれる主にレンズによる光学的な歪みを補正する技術が知られている。また、歪曲収差を補正する場合には、補正処理後の画像が、大きく分類して、糸巻き型(図9参照)と樽型(図10参照)と呼ばれる2種類のいずれかの形状に変形することも知られている。
撮像装置により撮像されたデジタル画像は、一般的に矩形である。このため、例えば特許文献1または特許文献2のように、歪曲収差補正処理後の画像から矩形領域を切り出す手法が検討されてきた。この方法は、総じて、補正処理後の変形した画像から、できる限り最大の矩形領域を切り出すことに重点をおいたものであった。
ところで、一般的に利用されているレンズの1つに、魚眼レンズがある。魚眼レンズの中でも、特に円周魚眼(または全周魚眼)と呼ばれるレンズを用いる場合には、撮像素子などの撮像面は、全域が撮影領域として使用されるものではなく、中心からある半径の円の領域内が撮影領域として使用される。そして、この円の外の領域は、画像ではあるが被写体が写っていない黒い領域として記録される。
円周魚眼レンズを用いて撮影された画像の歪曲収差を補正する場合にも、前述の歪曲収差補正と、その後の画像の切り出しが必要となる。しかしながら、従来と同様に、変形後の画像から切り出し可能な最大の矩形の領域を切り出す処理を行うと、樽型に変形した場合には、円形の撮影領域の一部が切り取られてしまうことがある(図10参照)。円周魚眼レンズ以外の一般的なレンズでは、撮像面の全域が撮影領域となるため、樽型の画像に内接する最大の矩形の領域を切り取る処理であっても問題がない。これに対して、円周魚眼レンズを用いた場合には、被写体は、撮像面の中心の円形の領域にのみ写っている。このため、樽型に変形した画像に対して前述のような従来の方法を用いると、被写体が写っている円形の撮影領域の一部が切り取られるという問題が生じる。
2. Description of the Related Art Conventionally, a technique for correcting optical distortion caused mainly by a lens called distortion is known for an image taken by an imaging apparatus. Further, when correcting distortion, the image after correction processing is roughly classified and transformed into one of two types of shapes called a pincushion type (see FIG. 9) and a barrel type (see FIG. 10). It is also known.
A digital image captured by the imaging device is generally rectangular. For this reason, for example, as in Patent Document 1 or Patent Document 2, a method of cutting out a rectangular region from an image after distortion correction processing has been studied. This method generally focused on cutting out the largest rectangular area possible from a deformed image after correction processing.
Incidentally, there is a fish-eye lens as one of the lenses that are generally used. Among the fish-eye lenses, particularly when using a lens called a circumferential fish-eye (or all-round fish-eye), the entire imaging surface such as an image sensor is not used as an imaging region, and has a radius from the center. The area within the circle is used as the imaging area. The area outside the circle is recorded as a black area that is an image but does not show the subject.
Even when correcting distortion of an image shot using a circumferential fisheye lens, it is necessary to correct the distortion and cut out the image thereafter. However, as in the conventional case, when the maximum rectangular area that can be cut out from the deformed image is cut out, a part of the circular shooting area may be cut out when the barrel is deformed. Yes (see FIG. 10). In a general lens other than the circumferential fisheye lens, since the entire imaging surface is a shooting area, there is no problem even in the process of cutting out the largest rectangular area inscribed in the barrel-shaped image. On the other hand, when the circumferential fisheye lens is used, the subject is reflected only in the circular area at the center of the imaging surface. For this reason, when the conventional method as described above is used for an image deformed into a barrel shape, there arises a problem that a part of a circular photographing region in which a subject is captured is cut off.
上記実情に鑑み、本発明が解決しようとする課題は、円周魚眼レンズを用いた場合など、撮影領域が画像の全域ではない場合であっても、歪曲収差補正処理後の画像から撮影領域の欠損が少なくなるような矩形領域を算出することである。 In view of the above situation, the problem to be solved by the present invention is that the shooting area is missing from the image after the distortion correction processing even when the shooting area is not the entire area of the image, such as when using a circumferential fisheye lens. Is to calculate a rectangular region that reduces the number of
前記課題を解決するため、本発明の画像処理装置は、画像に歪曲収差補正処理を行う補正手段と、あらかじめ定められた複数の処理方法のうちの1つを、前記画像の撮影条件と前記補正手段による補正条件に応じて選択し、補正処理後の画像から切り出す領域のサイズを算出する算出手段と、を有することを特徴とする。
本発明の画像処理方法は、画像に歪曲収差補正処理を行う補正ステップと、前記補正ステップにおいて補正された画像から切り出す領域を、前記画像の撮影条件と前記補正ステップにおける補正条件によって算出するステップと、を有することを特徴とする。
本発明のプログラムは、コンピュータに、画像に歪曲収差補正処理を行う補正ステップと、前記補正ステップにおいて補正された画像から切り出す領域を、前記画像の撮影条件と前記補正ステップにおける補正条件によって算出するステップと、をコンピュータに実行させることを特徴とする。
In order to solve the above problems, an image processing apparatus according to the present invention includes a correction unit that performs distortion correction processing on an image, and one of a plurality of predetermined processing methods, the image capturing condition and the correction. And calculating means for calculating a size of a region to be cut out from the image after correction processing, which is selected according to the correction condition by the means.
The image processing method of the present invention includes a correction step for performing distortion correction processing on an image, and a step of calculating a region to be cut out from the image corrected in the correction step based on the image capturing condition and the correction condition in the correction step. It is characterized by having.
A program according to the present invention includes a correction step for performing distortion correction processing on an image on a computer, and a step of calculating a region to be cut out from the image corrected in the correction step according to the image capturing condition and the correction condition in the correction step. And making the computer execute.
本発明によれば、画像の撮影に用いられたレンズや補正条件によらず、補正処理後の画像から撮影領域が極力含まれるような矩形の領域を決定することができる。したがって、切出された領域の画像において、撮影領域が欠損することを防止または抑制できる。 According to the present invention, it is possible to determine a rectangular region that includes a photographing region as much as possible from an image after correction processing, regardless of the lens used for photographing the image and the correction conditions. Therefore, it is possible to prevent or suppress the shooting area from being lost in the image of the clipped area.
以下に、本発明の好ましい実施の形態を、添付の図面に基づいて詳細に説明する。 Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings.
(第1実施形態)
まず、図1を参照して、本発明の第1実施形態にかかる画像処理装置1の概略構成について説明する。図1は、本発明の第1実施形態にかかる画像処理装置1の構成の一例を示すブロック図である。画像処理装置1は、入力部101と、補正部102と、算出部103と、出力部104とを有する。
入力部101には、外部から画像(画像データ)が入力される。
補正部102は、入力部101から入力された画像に対して、歪曲収差補正処理を実行する。説明の便宜上、補正部102により歪曲収差補正処理が実行される前の画像を「元画像」と称し、補正された画像を「補正処理後の画像」と称することがある。
算出部103は、補正処理後の画像から切り出す矩形領域のサイズを算出する。説明の便宜上、補正処理後の画像から切り出す矩形領域を「切出し領域」と称する。切出し領域のサイズの算出のため、撮影条件に応じた複数の処理方法が予め定められている。そして、算出部103は、複数の処理方法から一つの処理方法を選択し、選択した当該一つの処理方法を用いて切出し領域のサイズを算出する。さらに、算出部103は、切出し領域の算出結果を用いて、補正処理後の画像から切り出し領域を切り出す。説明の便宜上、画像を切り出す処理を「切出し処理」と称する。
出力部104は、算出部103が切出した領域の画像を出力する。
(First embodiment)
First, a schematic configuration of an image processing apparatus 1 according to the first embodiment of the present invention will be described with reference to FIG. FIG. 1 is a block diagram showing an example of the configuration of the image processing apparatus 1 according to the first embodiment of the present invention. The image processing apparatus 1 includes an
An image (image data) is input to the
The
The
The
次に、本実施形態にかかる処理フローについて説明する。本実施形態では、通常と異なる撮影条件として、円周魚眼レンズを用いた撮影を挙げる。図2は、撮影条件の判定と、歪曲収差補正処理と、切出し処理との一連の流れを示すフローチャートである。 Next, a processing flow according to the present embodiment will be described. In the present embodiment, photographing using a circumferential fisheye lens is given as an unusual photographing condition. FIG. 2 is a flowchart showing a series of flows of determination of imaging conditions, distortion correction processing, and clipping processing.
ステップS201において、算出部103は、入力部101に入力された画像(元画像)の撮影条件を確認し、この画像が円周魚眼レンズを用いて撮影された画像であるかどうかを判定する。この画像が円周魚眼レンズを用いて撮影された画像であればステップS202に進み、そうでなければステップS203に進む。
In step S201, the
ステップS203においては、補正部102は、入力部101に入力された画像に対して、通常の歪曲収差補正処理を実行する。ここでは、変換テーブルを用いて補正前画像の画素の座標を変換するという、従来一般の歪曲収差補正処理が適用できる。
In step S <b> 203, the
ステップS202においては、補正部102は、入力部101に入力された画像に対して、円周魚眼レンズを用いて撮影された画像用の歪曲収差補正処理(以下、「円周魚眼用の歪曲収差補正処理」と称する)を実行する。なお、円周魚眼用の歪曲収差補正処理の内容は、通常の歪曲収差補正処理と同じであってもよい。ただし、円周魚眼用の歪曲収差補正処理においては、特別の注意を要することがある。
具体的な次のとおりである。円周魚眼レンズの円形の露光領域(イメージサークルと称することもある)は、撮像装置のセンサの矩形の撮像面(結像した光学像を画像データに変換できる面をいう)よりも小さい。このため、円周魚眼レンズを用いて撮影された画像は、矩形の画像の中央に、被写体が写っている円形の領域が存在する。この領域を「撮影領域」と称する。撮影領域は、レンズの露光領域が投影される領域である。そして、撮影領域の外側の領域は黒色の領域となる。
このように、全周魚眼レンズを用いて撮影された画像は、その全域が撮影領域となるわけではなく、画像には撮影領域ではない領域が含まれる。
黒色の領域は、通常は撮影領域外であるため、設計上、変換テーブルが存在しないことがある。しかしながら、何の補正も行わないと、画像内の連続性が保持できないことがある。また、黒色の領域にも、通常のノイズなどといった、ユーザが意識していない情報が存在している場合がある。このように、歪曲収差補正処理においては、この黒色の領域の扱いに特別の注意を要する。
そこで、本実施形態においては、円周魚眼用の歪曲収差補正処理を、通常の歪曲収差補正処理とは別の処理とする。たとえば、補正部102は、撮影領域の中心から円形の領域の外縁にかけて使用した変換テーブルの補正量を、その傾向を維持したまま仮想的に使用する。
In step S <b> 202, the
The specific is as follows. The circular exposure area (sometimes referred to as an image circle) of the circumferential fisheye lens is smaller than the rectangular imaging surface of the sensor of the imaging device (referred to as a surface that can convert the formed optical image into image data). For this reason, an image photographed using a circumferential fisheye lens has a circular area in which the subject appears in the center of the rectangular image. This area is referred to as a “photographing area”. The imaging area is an area where the exposure area of the lens is projected. The area outside the shooting area is a black area.
As described above, the image captured using the all-around fisheye lens does not have the entire imaging region, and the image includes a region that is not the imaging region.
Since the black area is usually outside the imaging area, there may be no conversion table by design. However, if no correction is performed, continuity within the image may not be maintained. In addition, there are cases where information that the user is not conscious of, such as normal noise, also exists in the black area. As described above, in the distortion correction processing, special attention is required for handling the black region.
Therefore, in the present embodiment, the distortion correction process for the circumferential fisheye is a process different from the normal distortion correction process. For example, the
ステップS204においては、算出部103は、歪曲収差補正処理により画像が樽型に変形するかどうかを判定する。前記のとおり、歪曲収差補正処理の条件(補正条件)によって、補正処理後の画像が樽型または糸巻型に変形する。画像が樽型に変形する補正条件である場合にはステップS206に進み、そうでない場合にはステップS205に進む。
In step S204, the
ステップS205においては、算出部103は、複数の処理方法から、補正処理後の画像に内接する最大の矩形の領域を切り出す切出し処理を選択する。すなわち、撮影時の画像の一部が切り捨てられる切り出し処理を選択する。そして、算出部103は、選択した処理方法を用いて切出し処理を実行する。
In step S205, the
ステップS206においては、算出部103は、複数の処理方法から、撮影領域の全域を含むように矩形の領域を切り出す切出し処理を選択する。そして、算出部103は、選択した処理方法を用いて切出し処理を実行する。
In step S <b> 206, the
ステップS208においては、算出部103は、切出し画像の撮影領域の外側の領域を黒く塗りつぶす処理を実行する。
In step S <b> 208, the
ステップS207において、出力部104は、切り出した領域の画像を出力する。
In step S207, the
このように、あらかじめ、切出し処理のための複数の処理方法が定められている。複数の処理方法には、少なくとも次の2つが含まれる。(1)補正処理後の画像に内接する最大の矩形の領域を切り出す処理方法。(2)補正処理後の画像に含まれる撮影領域の全域を含むように矩形の領域を切り出す処理方法。(2)の処理方法には、補正条件に応じてさらに複数の処理方法が含まれる。そして、算出部103は、画像の撮影条件と補正条件に応じて、複数の処理方法から1つを選択し、選択した処理方法を用いて切出し処理を実行する。なお、(1)の処理方法には、従来公知の処理方法が適用できる。(2)の処理方法の詳細については後述する。
As described above, a plurality of processing methods for the cutting process are determined in advance. The plurality of processing methods include at least the following two. (1) A processing method of cutting out the maximum rectangular area inscribed in the corrected image. (2) A processing method of cutting out a rectangular area so as to include the entire photographing area included in the corrected image. The processing method (2) further includes a plurality of processing methods according to the correction conditions. Then, the
次に、歪曲収差補正処理について、図3を参照して説明する。図3は、図2のステップS202とS203における歪曲収差補正処理を示すフローチャートである。
歪曲収差補正処理は、上で説明したように通常の場合と、円周魚眼レンズの場合とで異なる部分はあるが、ここでは、共通する処理について説明する。
Next, distortion correction processing will be described with reference to FIG. FIG. 3 is a flowchart showing the distortion correction processing in steps S202 and S203 of FIG.
As described above, the distortion correction processing differs between the normal case and the case of the circumferential fisheye lens, but here, common processing will be described.
ステップS301において、補正部102は、元画像の先頭画素を選択する。
ステップS302においては、補正部102は、撮影領域の中心から選択した画素までの距離を算出する。
ステップS303においては、補正部102は、選択した画素の補正処理後における撮影領域の中心からの距離を算出する。
ステップS304においては、補正部102は、算出した距離から選択した画素の補正処理後の座標を算出する。
ステップS305においては、補正部102は、算出した座標を、選択した画素の補正処理後の座標として記録する。
ステップS306においては、補正部102は、ステップS302〜S305の処理が行われた画素が最後の画素であるかどうかを判定する。最後の画素でない場合にはステップS307に進み、最後の画素である場合にはステップS308に進む。
ステップS307においては、補正部102は、次の画素を補正対象の画素として選択する。そしてステップS302に進み、ステップS302以下の処理を繰り返す。これにより、補正部102は、元画像に含まれる全ての画素について、ステップS302〜S305の処理を実行する。
ステップS308においては、全ての画素について上記処理が終了したため、補正部102は、補正した画像を算出部103に出力する。
In step S301, the
In step S302, the
In step S303, the
In step S304, the
In step S305, the
In step S306, the
In step S307, the
In step S <b> 308, since the above processing has been completed for all pixels, the
次に、図4〜図6を参照して、切出し領域のサイズを算出する処理について説明する。図4は、補正処理後の画像の切出し領域のサイズを算出する処理を示すフローチャートである。図5は、図4のサブプロセスAの内容を示すフローチャートである。図6は、元画像と撮影領域と切り出し領域の関係を模式的に示す図である。算出部103は、切出し領域のサイズの算出を、元画像と変換テーブルとを用いて行う。
Next, processing for calculating the size of the cutout area will be described with reference to FIGS. FIG. 4 is a flowchart showing a process for calculating the size of the cutout area of the image after the correction process. FIG. 5 is a flowchart showing the contents of sub-process A in FIG. FIG. 6 is a diagram schematically illustrating the relationship among the original image, the imaging region, and the cutout region. The
ステップS401〜S406において、算出部103は、元画像の左上の画素と、上辺中点の画素と、左辺中点の画素とを選択し、選択した画素のそれぞれについて、サブプロセスAを実行する。なお、前記の選択される画素は一例であり、他の画素が選択されてもよい。たとえば、左上の画素ではなく、元画像の左上以外の四隅に位置する画素であってもよい。また、上辺中点の画素ではなく下辺中点の画素であってもよい。さらに、左辺中点の画素ではなく、右辺中点の画素であってもよい。
In steps S <b> 401 to S <b> 406, the
ここで、サブプロセスAについて、図5を参照して説明する。
ステップS501において、算出部103は、選択したそれぞれの画素の撮影領域の中心からの距離を算出する。
ステップS502において、算出部103は、変換テーブルを用いて、選択したそれぞれの画素の補正処理後における座標を算出する。
ステップS503において、算出部103は、算出した座標を用いて、選択したそれぞれの画素の補正処理後における撮影領域の中心からの縦方向と横方向の距離を算出する。
ステップS504において、算出部103は、算出した縦方向と横方向の距離を返す。
そして、図4のステップS407に進む。
Here, the sub-process A will be described with reference to FIG.
In step S501, the
In step S502, the
In step S <b> 503, the
In step S504, the
Then, the process proceeds to step S407 in FIG.
ステップS407においては、算出部103は、画像の左辺が短辺であるかどうかを判定する。左辺が短辺である場合には、画像が横長である。この場合には、ステップS408に進む。一方、左辺が短辺でない場合には、画像が縦長である。この場合には、ステップS412に進む。
In step S407, the
ステップS408においては、算出部103は、撮影領域の中心から補正処理後における上辺中点の画素までの縦方向の距離の2倍の寸法を、切出し領域の縦方向のサイズに設定する。この距離は、ステップS404のサブプロセスAにおいて算出される。
図10に示すように、従来の方法では、樽型に変形した補正処理後の画像Qから内接する最大の矩形の領域Pを切り出すと、円形の撮影領域Rの上下の部分S(ハッチングが施された領域)が欠損することがある。
これに対して、本発明の実施形態では、図6に示すように、切出し領域Dの縦方向のサイズは、円形の撮影領域Cと同じかそれより大きくなる。したがって、円形の撮影領域Cの上下の部分に欠損が生じないようにできる。
In step S <b> 408, the
As shown in FIG. 10, in the conventional method, when the largest rectangular area P that is inscribed is cut out from the corrected image Q transformed into a barrel shape, the upper and lower portions S (hatching is performed on the circular imaging area R). Area) may be lost.
On the other hand, in the embodiment of the present invention, as shown in FIG. 6, the vertical size of the cutout area D is the same as or larger than the circular imaging area C. Accordingly, it is possible to prevent a defect from occurring in the upper and lower portions of the circular imaging region C.
ステップS409において、算出部103は、補正処理後の左上の画素と補正処理後の左辺中点の画素について、撮影領域の中心からの横方向の距離を比較する。これらの距離はステップS402とS406のサブプロセスAにおいて算出される。
補正処理後の左上の画素の撮影領域の中心からの横方向距離が、補正処理後の左辺中点の画素の当該距離よりも大きい場合には、ステップS410に進む。一方、補正処理後の左上の画素の撮影領域の中心からの横方向距離が、補正処理後の左辺中点の画素の当該距離よりも小さい場合には、ステップS411に進む。
In step S409, the
If the lateral distance from the center of the imaging region of the upper left pixel after the correction process is larger than the distance of the pixel at the midpoint of the left side after the correction process, the process proceeds to step S410. On the other hand, when the lateral distance from the center of the imaging region of the upper left pixel after the correction process is smaller than the distance of the pixel at the midpoint of the left side after the correction process, the process proceeds to step S411.
ステップS410において、算出部103は、補正処理後における左辺中点の画素の撮影領域の中心からの横方向距離の2倍の寸法を、切出し領域の横方向のサイズに設定する。
ステップS411において、算出部103は、補正処理後における左上の画素の撮影領域の中心からの横方向距離の2倍の寸法を、切出し領域の横方向のサイズに設定する。
In step S410, the
In step S411, the
一方、ステップS407において左辺が短辺でなく、画像が縦長である場合には、円形の撮影領域のうちで左右にのみ欠損が生じうる。すなわち、図10を左右いずれかに90度回転させた状態となる。この場合には、ステップS412に進む。ステップS412〜S415の処理は、ステップS408〜S411の処理において、画像の縦方向と横方向とを入れ替えた内容の処理である。具体的には、次のとおりである。
ステップS412においては、算出部103は、撮影領域の中心から補正処理後の左辺中点の画素までの横方向の距離の2倍の寸法を、切出し領域の横方向のサイズに設定する。前記のとおり、画像が縦長である場合には、円形の撮影領域のうちで左右にのみ欠損が生じうる。そこで、切出し領域の横方向のサイズを前記のように設定することにより、円形の撮影領域の左右に欠損が生じないようにできる。
ステップS413において、算出部103は、補正処理後の左上の画素と補正処理後の上辺中点の画素について、撮影領域の中心からの縦方向の距離を比較する。補正処理後の左上の画素の撮影領域の中心からの縦方向の距離が、補正処理後の上辺中点の画素の当該距離よりも大きい場合には、ステップS414に進む。一方、補正処理後の左上の画素の撮影領域の中心からの縦方向距離が、補正処理後の上辺中点の画素の当該距離よりも小さい場合には、ステップS415に進む。
ステップS414において、算出部103は、補正処理後における上辺中点の画素の撮影領域の中心からの縦方向の距離の2倍の寸法を、切出し領域の縦方向のサイズに設定する。
ステップS411において、算出部103は、補正処理後における左上の画素の撮影領域の中心からの縦方向距離の2倍の寸法を、切出し領域の縦方向のサイズに設定する。
On the other hand, if the left side is not a short side and the image is vertically long in step S407, a defect may occur only on the left and right of the circular shooting area. That is, FIG. 10 is rotated 90 degrees left or right. In this case, the process proceeds to step S412. The processing of steps S412 to S415 is processing of the content in which the vertical direction and the horizontal direction of the image are interchanged in the processing of steps S408 to S411. Specifically, it is as follows.
In step S412, the
In step S413, the
In step S414, the
In step S411, the
ステップS416において、算出部103は、設定した縦横それぞれのサイズで、補正処理後の画像Bから切出し領域Dを切り出す。図6において、ハッチングが施された領域Eは、元画像には存在しない領域である。このように、算出部103は、切出し領域Dに、元画像には存在しない領域を付加する。なお、元画像における撮影領域Cの外側の領域は、円周魚眼レンズを用いて撮影された画像であれば、黒色となる。そこで、算出部103は、追加された領域Eを黒色で塗り潰す処理を行う。これにより、切り出された画像が不自然にならないようにできる。
In step S416, the
なお、切出し領域のサイズの算出には、次のような方法も適用できる。
算出部103は、画像の撮影に用いられたセンサとレンズの情報を取得する。センサに関する情報には撮像面のサイズに関する情報が含まれる。レンズに関する情報には、撮影領域(イメージサークル)のサイズが含まれる。なお、画像処理装置1が、撮像装置のセンサに関する情報と、各種レンズの撮影領域に関する情報を保持している構成であってもよい。この場合には、算出部103は、撮像装置の型式(型番)や、画像の撮影に使用されたレンズの型式(型番)などの情報を取得し、当該撮像装置とレンズに対応する情報を読み出して切出し処理に用いる。また、撮像に用いられたレンズが倍率変更可能なズームレンズである場合には、倍率によって露光領域のサイズが変わることがあるため、算出部103は、レンズの倍率に関する情報も取得する。
次いで算出部103は、センサの撮像面のサイズとレンズの露光領域のサイズとから、撮影された画像(元画像)に含まれる撮影領域の位置およびサイズを判定する。
次いで算出部は、補正処理後の画像における撮影領域の外縁の位置を算出し、算出結果に基づいて、さらに補正処理後の画像における撮影領域の全体が含まれる矩形の領域を算出する。このようにして算出された矩形の領域が、切出し領域となる。
次いで算出部103は、算出した切出し領域を補正処理後の画像から切り出す。
The following method can also be applied to calculate the size of the cutout area.
The
Next, the
Next, the calculation unit calculates the position of the outer edge of the shooting area in the image after the correction process, and further calculates a rectangular area including the entire shooting area in the image after the correction process based on the calculation result. The rectangular area calculated in this way becomes a cutout area.
Next, the
さらに、画像処理装置1は、図4と図5に示す処理と、前述の撮影領域のサイズの算出結果を用いる処理とを合せて用いてもよい。
例えば、算出部103は、図4と図5に示す処理と、前述の撮影領域のサイズの算出結果を用いる処理とによって、切出し領域のサイズを算出する。そして、算出部103は、図4と図5に示す処理によって算出した切出し領域のサイズと、前述の撮影領域のサイズを用いて算出した切出し領域のサイズとを比較する。そして、算出部103は、サイズの大きい方を、最終的な切出しサイズに決定する。その後、算出部103は、決定した切出し領域のサイズを用いて、補正処理後の画像に対して切出し処理を実行する。
または、算出部103は、比較の結果、図4と図5に示す処理によって算出した切出し領域のサイズが、前述の撮影領域のサイズを用いて算出した切出し領域のサイズより小さい場合には、図4と図5に示す処理によって算出した切出し領域のサイズを拡大する。次いで、算出部103は、再びサイズを比較する。そして、算出部103は、図4と図5に示す処理によって算出した切出し領域のサイズが、前述の撮影領域のサイズを用いて算出した切出し領域のサイズ以上になった場合には、拡大した切出し領域のサイズを、最終的な切出し領域のサイズに決定する。
Furthermore, the image processing apparatus 1 may use the processing shown in FIGS. 4 and 5 together with the processing using the above-described calculation result of the size of the imaging region.
For example, the
Alternatively, as a result of the comparison, if the size of the cutout area calculated by the processing shown in FIGS. 4 and 5 is smaller than the size of the cutout area calculated using the above-described shooting area size, 4 and the size of the cutout area calculated by the processing shown in FIG. Next, the
次に、歪曲収差補正処理で用いられる変換テーブルについて、図7と図8を参照して説明する。
図7(a)は、糸巻型の変形が生じる場合の変換テーブルの例を示す。図7(a)に示すように、変換テーブルは、センサ上におけるサイズとして、撮影領域の中心からの距離の射影を離散的に有している。そして、実際には、補正部102は、このテーブルに規定される値を補間して用いる。なお、補正の精度を高めるためには、変換テーブルがより多くの射影を有していることが好ましい。図7(b)は、図7(a)に示す変換テーブルをグラフに示した図である。図7(b)に示すように、撮影領域の周辺に近づくにしたがって、変化量が大きくなる。これは、補正により画像が糸巻型に変形する場合の変換テーブルの特徴である。
図8(a)は、樽型の変形が生じる場合の変換テーブルの例を示す。図8(b)は、図8(a)の変換テーブルをグラフ化した図である。図8(b)に示すように、樽型の変形が生じる場合の変換テーブルは、撮影領域の周辺に近づくにしたがって、変化量が小さくなる傾向を有する。
前記のとおり、歪曲収差補正処理による画像の変形は、大きく分類すると、糸巻型と樽型の2種類に分類される。このため、変換テーブルも大きく分類して前記の2種類に分類できる。
Next, a conversion table used in the distortion correction process will be described with reference to FIGS.
FIG. 7A shows an example of a conversion table when a pincushion type deformation occurs. As shown in FIG. 7A, the conversion table has discrete projections of distances from the center of the imaging region as the size on the sensor. In practice, the
FIG. 8A shows an example of a conversion table when barrel-shaped deformation occurs. FIG. 8B is a graph showing the conversion table of FIG. As shown in FIG. 8B, the conversion table in the case of barrel-shaped deformation has a tendency for the amount of change to decrease as it approaches the periphery of the imaging region.
As described above, image deformation by distortion correction processing is roughly classified into two types: pincushion type and barrel type. For this reason, the conversion table can also be broadly classified into the above two types.
以上説明したとおり、本発明の実施形態によれば、円周魚眼レンズを用いて撮影された画像に歪曲収差補正を施した場合であっても、それ以外の場合であっても、撮像領域が極力切出し領域に含まれるように、切り出し領域のサイズを算出できる。 As described above, according to the embodiment of the present invention, the imaging region is as much as possible regardless of whether or not distortion correction is performed on an image captured using a circumferential fisheye lens. The size of the cutout area can be calculated so as to be included in the cutout area.
(第2実施形態)
前記第1実施形態においては、円周魚眼レンズを用いて撮影された画像に対する処理を例に示して説明したが、本発明は、このような構成に限定されない。本発明は、たとえば、所定のサイズのセンサを有する撮像装置に、当該所定のサイズとは異なるセンサを有する撮像装置用のレンズを装着して撮影した画像に対しても適用できる。
たとえば、撮像面のサイズが36mm×24mmのセンサ(以下、「36mmセンサ」と称する)を有する撮像装置に、それよりも小さいサイズのセンサ用のレンズを装着して撮影することがある。このような組み合わせでは、レンズの露光領域が36mmセンサの撮像面よりも小さくなることがある。この場合には、レンズの露光領域のサイズとセンサの撮像面のサイズとがあらかじめ明らかであれば、算出部103は、切り出し領域のサイズを算出できる。例えば36mmセンサの全域に露光するためには、露光領域が半径21.635mm以上の円形の領域のレンズが必要である。これに対し、撮像面のサイズが24mm×16mmのセンサ(以下、「24mmセンサ」と称する)用のレンズでは、露光領域の半径が14.42mmであると仮定できる。
そこで、算出部103は、36mmセンサを有する撮像装置に24mmセンサ用のレンズが装着されたことを撮影条件から判定できた場合には、次のように処理を行う。すなわち、算出部103は、センサの撮影面のうち、半径が14.42mmの円の内側の領域、またはこの円に内接する矩形の領域が撮影領域であると判定する。そして、算出部103は、この円の内側の領域またはこの円に内接する矩形の領域を、実施例1と同様の処理によって切り出し領域として算出することができる。このように、実施例1に示した円周魚眼レンズの例とは異なるが、画像処理装置1は、センササイズがレンズと異なる場合においても、算出処理の内容を切り替えることが可能である。
また、これらは、撮影条件が決定されれば一意に決まるものであるが、撮影条件に応じて複数の処理方法(切出し領域のサイズの算出のアルゴリズム)を選択的に利用すべきものである。
(Second Embodiment)
In the first embodiment, the processing for an image photographed using the circumferential fisheye lens has been described as an example, but the present invention is not limited to such a configuration. The present invention can also be applied to, for example, an image captured by mounting an imaging device lens having a sensor different from the predetermined size on an imaging device having a sensor of a predetermined size.
For example, an image pickup apparatus having a sensor having an image pickup surface size of 36 mm × 24 mm (hereinafter referred to as “36 mm sensor”) may be photographed with a sensor lens having a smaller size attached thereto. In such a combination, the exposure area of the lens may be smaller than the imaging surface of the 36 mm sensor. In this case, if the size of the exposure area of the lens and the size of the imaging surface of the sensor are known in advance, the
Therefore, the
These are uniquely determined when the shooting conditions are determined, but a plurality of processing methods (algorithms for calculating the size of the cutout area) should be selectively used according to the shooting conditions.
ここで、本発明の実施形態にかかる画像処理装置1のハードウェア構成について簡単に説明する。本発明の実施形態にかかる画像処理装置1は、CPUとRAMとROMと外部とデータの送受信を行うインターフェースとを有するコンピュータである。さらに、本発明の実施形態にかかる画像処理装置1は、外部から入力された画像や補正処理を施した画像を格納できる記憶デバイスや、このような記憶デバイスを接続できるインターフェースを有していてもよい。記憶デバイスとしては、たとえば、HDDやSSDなどが適用できる。そして、歪曲収差補正処理と切出し処理を実行するためのコンピュータプログラム(コンピュータソフトウェア)はあらかじめROMに格納されている。さらに、ROMには、外部から画像を入力する処理を実行するためのコンピュータプログラムと、切出した領域の画像を外部に出力する処理を実行するためのプログラムとが格納される。
CPUは、ROMに格納されるコンピュータプログラムを読み出し、RAMを作業領域として用いて実行する。これにより、コンピュータが前記各部として機能するとともに前記各処理が実行される。
歪曲収差補正処理に用いられる変換テーブルは、コンピュータ読取り可能なテーブルとして、ROMに格納されている。そして、CPUは、歪曲収差補正処理においては、この変換テーブルをROMから読み出して用いる。
同様に、切出し処理のための複数の処理方法も、これら複数の処理を実行するためのコンピュータプログラムとして、あらかじめROMに格納されている。また、歪曲収差補正処理に必要な各種情報も、コンピュータ読取り可能なデータとして、ROMに格納される。そして、CPUは、画像の撮影条件と補正条件に応じて複数の処理方法のうちの一つを選択して読み出し、実行する。これにより、複数の処理方法が選択的に実行される。
Here, a hardware configuration of the image processing apparatus 1 according to the embodiment of the present invention will be briefly described. An image processing apparatus 1 according to an embodiment of the present invention is a computer having a CPU, a RAM, a ROM, and an interface for transmitting and receiving data to and from the outside. Furthermore, the image processing apparatus 1 according to the embodiment of the present invention may include a storage device that can store an image input from the outside or an image that has been subjected to correction processing, and an interface that can connect such a storage device. Good. As the storage device, for example, an HDD or an SSD can be applied. A computer program (computer software) for executing the distortion correction process and the cutting process is stored in the ROM in advance. Further, the ROM stores a computer program for executing a process for inputting an image from the outside and a program for executing a process for outputting an image of the clipped area to the outside.
The CPU reads a computer program stored in the ROM and executes it using the RAM as a work area. As a result, the computer functions as each unit and the processes are executed.
The conversion table used for the distortion correction process is stored in the ROM as a computer-readable table. The CPU reads this conversion table from the ROM and uses it in the distortion correction process.
Similarly, a plurality of processing methods for the cutting process are stored in advance in the ROM as computer programs for executing the plurality of processes. Various information necessary for distortion correction processing is also stored in the ROM as computer-readable data. Then, the CPU selects, reads out and executes one of a plurality of processing methods according to the image capturing condition and the correction condition. Thereby, a plurality of processing methods are selectively executed.
また、本発明の実施形態にかかる画像処理装置1は、センサと、撮像した画像を格納可能な記録媒体を有する撮像装置に組み込まれる構成であってもよい。たとえば、本発明の実施形態にかかる画像処理装置は、デジタル一眼レフカメラに組み込まれる構成が適用できる。 Further, the image processing apparatus 1 according to the embodiment of the present invention may be configured to be incorporated in an imaging apparatus having a sensor and a recording medium capable of storing a captured image. For example, an image processing apparatus according to an embodiment of the present invention can be configured to be incorporated in a digital single lens reflex camera.
また、前記実施形態の機能を実現するプログラムを、記録媒体から直接、または有線/無線通信を用いてプログラムを実行可能なコンピュータを有するシステムまたは装置に供給して実行する構成も、本発明に含まれる。従って、本発明の機能処理をコンピュータで実現するために、当該コンピュータに供給されてインストールされるプログラムコード自体も、本発明を実現するものである。つまり、本発明の機能処理を実現するためのプログラム自体も本発明に含まれる。その場合、プログラムの機能を有していれば、オブジェクトコード、インタプリタにより実行されるプログラム、OSに供給するスクリプトデータ等、プログラムの形態を問わない。プログラムを供給するための記録媒体としては、例えば、フレキシブルディスク、ハードディスク、磁気テープ等の磁気記録媒体、MO、CD−ROM、CD−R、CD−RW、DVD−ROM、DVD−R、DVD−RW等が適用できる。また、光/光磁気記憶媒体、不揮発性の半導体メモリも適用できる。 Further, the present invention includes a configuration in which a program that realizes the functions of the above-described embodiments is supplied to a system or apparatus having a computer that can execute the program directly from a recording medium or using wired / wireless communication and executed. It is. Accordingly, the program code itself supplied and installed in the computer in order to implement the functional processing of the present invention by the computer also realizes the present invention. That is, the program itself for realizing the functional processing of the present invention is also included in the present invention. In this case, the program may be in any form as long as it has a program function, such as an object code, a program executed by an interpreter, or script data supplied to the OS. As a recording medium for supplying the program, for example, a magnetic recording medium such as a flexible disk, a hard disk, a magnetic tape, MO, CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-R, DVD- RW etc. are applicable. Further, an optical / magneto-optical storage medium and a non-volatile semiconductor memory can also be applied.
以上、本発明の実施形態(実施例)について詳細に説明したが、前記実施形態(実施例)は、本発明を実施するにあたっての具体例を示したに過ぎない。本発明の技術的範囲は、前記実施形態(実施例)に限定されるものではない。本発明は、その趣旨を逸脱しない範囲において種々の変更が可能であり、それらも本発明の技術的範囲に含まれる。 As mentioned above, although embodiment (Example) of this invention was described in detail, the said embodiment (Example) only showed the specific example in implementing this invention. The technical scope of the present invention is not limited to the above-described embodiment (example). The present invention can be variously modified without departing from the gist thereof, and these are also included in the technical scope of the present invention.
本発明は、補正により変形した画像から切出し領域を切り出すことができる画像処理装置、画像処理方法およびプログラムに関する。そして、本発明によれば、撮影に用いられるレンズや幾何学的な変換の種類によらず、補正処理後の画像から撮影領域をできるだけ含むような矩形領域を算出できる。 The present invention relates to an image processing apparatus, an image processing method, and a program that can cut out a cutout region from an image deformed by correction. According to the present invention, it is possible to calculate a rectangular area that includes the shooting area as much as possible from the image after the correction process, regardless of the lens used for shooting and the type of geometric transformation.
1:画像処理装置、101:入力部、102:補正部、103:算出部、104:出力部 1: Image processing apparatus 101: Input unit 102: Correction unit 103: Calculation unit 104: Output unit
Claims (11)
あらかじめ定められた複数の処理方法のうちの1つを、前記画像の撮影条件と前記補正手段による補正条件に応じて選択し、補正処理後の画像から切り出す領域のサイズを算出する算出手段と、
を有することを特徴とする画像処理装置。 Correction means for performing distortion correction processing on the image;
Calculating means for selecting one of a plurality of predetermined processing methods according to the photographing condition of the image and a correction condition by the correction means, and calculating a size of a region to be cut out from the image after the correction processing;
An image processing apparatus comprising:
前記補正ステップにおいて補正された画像から切り出す領域を、前記画像の撮影条件と前記補正ステップにおける補正条件に応じて算出するステップと、
を有することを特徴とする画像処理方法。 A correction step for performing distortion correction processing on the image;
Calculating a region to be cut out from the image corrected in the correction step according to the imaging condition of the image and the correction condition in the correction step;
An image processing method comprising:
画像に歪曲収差補正処理を行う補正ステップと、
前記補正ステップにおいて補正された画像から切り出す領域を、前記画像の撮影条件と前記補正ステップにおける補正条件に応じて算出するステップと、
を実行させることを特徴とするプログラム。 On the computer,
A correction step for performing distortion correction processing on the image;
Calculating a region to be cut out from the image corrected in the correction step according to the imaging condition of the image and the correction condition in the correction step;
A program characterized by having executed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013015839A JP2014147034A (en) | 2013-01-30 | 2013-01-30 | Image processing apparatus, image processing method, and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013015839A JP2014147034A (en) | 2013-01-30 | 2013-01-30 | Image processing apparatus, image processing method, and program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2014147034A true JP2014147034A (en) | 2014-08-14 |
Family
ID=51426943
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2013015839A Pending JP2014147034A (en) | 2013-01-30 | 2013-01-30 | Image processing apparatus, image processing method, and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2014147034A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2017045312A (en) * | 2015-08-27 | 2017-03-02 | 株式会社デンソー | Image generation device, image generation method, and program |
JP2019165372A (en) * | 2018-03-20 | 2019-09-26 | 株式会社リコー | Imaging sensor fixing structure |
CN112655196A (en) * | 2018-09-12 | 2021-04-13 | 索尼公司 | Image processing apparatus, program, and image processing method |
-
2013
- 2013-01-30 JP JP2013015839A patent/JP2014147034A/en active Pending
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2017045312A (en) * | 2015-08-27 | 2017-03-02 | 株式会社デンソー | Image generation device, image generation method, and program |
WO2017033691A1 (en) * | 2015-08-27 | 2017-03-02 | 株式会社デンソー | Image generation device, image generation method, and program |
JP2019165372A (en) * | 2018-03-20 | 2019-09-26 | 株式会社リコー | Imaging sensor fixing structure |
JP7124366B2 (en) | 2018-03-20 | 2022-08-24 | 株式会社リコー | Imaging element fixing structure and imaging device |
CN112655196A (en) * | 2018-09-12 | 2021-04-13 | 索尼公司 | Image processing apparatus, program, and image processing method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JPWO2008139577A1 (en) | Image processing apparatus, imaging apparatus, and image distortion correction method | |
US10244155B2 (en) | Image capturing apparatus | |
JP2005229200A (en) | Distortion correcting circuit | |
US10395337B2 (en) | Image processing apparatus, image processing method, and storage medium | |
JP2013218654A (en) | Image processing device | |
JP4919836B2 (en) | Image processing apparatus, image pickup apparatus, and image distortion correction method for correcting image distortion | |
JP2014147034A (en) | Image processing apparatus, image processing method, and program | |
JP2014127773A5 (en) | ||
US11024015B2 (en) | Image processing apparatus and distortion correction coefficient calculation method | |
JP2010103840A (en) | Imaging apparatus | |
JP5309940B2 (en) | Image processing apparatus and imaging apparatus | |
JP2007122328A (en) | Distortion aberration correction device and distortion aberration correction method | |
US8629925B2 (en) | Image processing apparatus, image processing method, and computer program | |
US9917972B2 (en) | Image processor, image-processing method and program | |
US10244179B2 (en) | Image processing apparatus, image capturing apparatus, control method, and recording medium | |
JP2008067176A (en) | Image correction device, and image correction method | |
JP6622546B2 (en) | Image processing apparatus and method | |
JP6440465B2 (en) | Image processing apparatus, image processing method, and program | |
KR102655332B1 (en) | Device and method for image correction | |
JP2015220662A (en) | Information processing apparatus, method for the same, and program | |
JP6354217B2 (en) | Image processing apparatus, system, image processing method, and program | |
JP2018098612A (en) | Image processing system, image processing method, imaging apparatus, program, and storage medium | |
JP6136248B2 (en) | Image processing apparatus, image processing method, and program | |
JP5141960B2 (en) | Image processing device | |
JP6365386B2 (en) | Image processing device |