JP4926877B2 - Image processing apparatus and method, and program - Google Patents
Image processing apparatus and method, and program Download PDFInfo
- Publication number
- JP4926877B2 JP4926877B2 JP2007201954A JP2007201954A JP4926877B2 JP 4926877 B2 JP4926877 B2 JP 4926877B2 JP 2007201954 A JP2007201954 A JP 2007201954A JP 2007201954 A JP2007201954 A JP 2007201954A JP 4926877 B2 JP4926877 B2 JP 4926877B2
- Authority
- JP
- Japan
- Prior art keywords
- image
- area
- trimming
- trimming area
- shape
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Landscapes
- Image Processing (AREA)
- Editing Of Facsimile Originals (AREA)
Description
本発明は、画像処理装置及び方法、並びにプログラムに関し、特にデジタルカメラにより撮影して得られた画像を処理する画像処理装置及び方法、並びにプログラムに関する。 The present invention relates to an image processing apparatus, method, and program, and more particularly, to an image processing apparatus, method, and program for processing an image obtained by photographing with a digital camera.
近年、デジタルカメラの性能向上により、撮影される画像の解像度は非常に高くなり、銀塩写真に勝るとも劣らない高品質の写真画像を得ることが可能となった。ユーザは、デジタルカメラで撮影した画像をパーソナルコンピュータ等に搭載された画像処理アプリケーションを使用して閲覧したり、トリミング等の編集処理を施したりすることができる。 In recent years, due to the improvement in performance of digital cameras, the resolution of captured images has become very high, and it has become possible to obtain high-quality photographic images that are not inferior to silver halide photographs. A user can view an image captured by a digital camera using an image processing application installed in a personal computer or the like, or can perform editing processing such as trimming.
一般に、カメラで撮影して得られる画像には、撮影レンズの歪曲収差に起因する幾何学的歪みが生ずる。この歪みを補正するために、撮影レンズのレンズ特性を利用して収差補正を行う画像処理アプリケーションが登場している。このように、歪曲収差補正を行うことでより均質で高画質な画像を得ることができる。 In general, an image obtained by photographing with a camera has a geometric distortion caused by distortion of the photographing lens. In order to correct this distortion, image processing applications that perform aberration correction using the lens characteristics of the taking lens have appeared. In this way, a more uniform and high-quality image can be obtained by performing distortion correction.
画像に対して歪曲収差補正した場合の一例を図13(a)及び図13(b)に示す。図13(a)は樽形に歪んだ画像を補正した場合、図13(b)は糸巻形に歪んだ画像を補正した場合を表している。歪曲収差補正は画素位置の移動を伴う補正であるため、画像の外縁の形状が変化してしまう。画像の外縁の形状は一般的に矩形状であり、トリミング領域もこれに合わせて矩形状となっている。そのため、図14に示すように、補正前の画像に対してトリミング領域が設定されていた場合、画像の外縁形状の変化により、トリミング領域が歪曲収差補正後の画像からはみ出してしまう場合がある。この結果、トリミング後の画像の一部に空白又は画素値が不確定の部分が生ずるという問題がある。この問題を防止するためには、例えば、歪曲収差補正を行った後の画像に対してのみトリミング領域の設定を可能にする必要がある。 An example when distortion correction is performed on an image is shown in FIGS. 13 (a) and 13 (b). FIG. 13A shows a case where an image distorted in a barrel shape is corrected, and FIG. 13B shows a case where an image distorted in a pincushion shape is corrected. Since distortion aberration correction is correction accompanied by movement of the pixel position, the shape of the outer edge of the image changes. The shape of the outer edge of the image is generally rectangular, and the trimming area is also rectangular. Therefore, as shown in FIG. 14, when a trimming region is set for an image before correction, the trimming region may protrude from the image after distortion correction due to a change in the outer edge shape of the image. As a result, there is a problem that a blank or a pixel value is indeterminate in a part of the image after trimming. In order to prevent this problem, for example, it is necessary to make it possible to set a trimming region only for an image after distortion correction.
また、上記問題を解決するために、トリミング領域を設定する際に、歪曲収差補正に伴う画欠け領域を明示し、ユーザに画欠け領域をトリミング領域として指定させないようにする技術が提案されている(例えば、特許文献1参照)。
しかしながら、上述した歪曲収差補正後の画像に対してのみトリミング領域を設定する方法では、トリミング領域の設定を必ず歪曲収差補正後に行わなければならない。また、上記特許文献1に記載された方法では、歪曲収差補正を実行するか否かを必ずトリミング領域の設定を行う前に決定しなくてはならない。このように、上記従来の方法では、歪曲収差補正を行う画像処理アプリケーション自体がユーザの画像編集に対する操作を制限することとなり、望ましくない。
However, in the method of setting the trimming region only for the image after the distortion aberration correction described above, the trimming region must be set after the distortion aberration correction. In the method described in
また、近年では、撮影時に自動的にトリミング領域を設定するようなカメラも存在する。そのようなカメラで撮影された画像を画像処理アプリケーションで扱う場合、歪曲収差補正を実行する前に、必ずトリミング領域が設定されていることになり、上記従来の方法では対応できない。 In recent years, there is a camera that automatically sets a trimming area at the time of shooting. When an image captured by such a camera is handled by an image processing application, the trimming area is always set before the distortion correction is executed, which cannot be handled by the conventional method.
本発明は、上記問題に鑑みて成されたものであり、画像編集に対するユーザの操作を制限することなく、画像処理により画像の外縁形状が変形しても、設定されたトリミング領域が画像処理後の画像からはみ出さずに、トリミング画像を適正化することを目的とする。 The present invention has been made in view of the above-described problem. Even if the outer edge shape of an image is deformed by image processing without restricting the user's operation for image editing, the set trimming region is not processed after image processing. The purpose is to optimize the trimmed image without protruding from the image.
また、本発明は、予めトリミング領域が設定された画像が画像処理により外縁形状を変形されても、ユーザが意図したトリミング領域をトリミングすることを他の目的とする。 Another object of the present invention is to trim a trimming region intended by a user even when an image in which a trimming region is set in advance is deformed in outer edge shape by image processing.
上記目的を達成するために、請求項1記載の画像処理装置は、ユーザーの指示に応じて画像のトリミング対象であるトリミング領域を設定する設定手段と、前記トリミング領域が設定された後に、前記画像に対して、前記画像を撮影する際に用いたレンズの歪曲収差に起因する歪みを補正するために形状を変化させる補正を行い、かつ、形状を変化させた画像に内接する矩形領域に相当する有効画像領域における画像を出力する歪曲補正処理を行う画像処理手段と、前記画像に対して前記歪曲補正処理を行うことにより形状を変化させた後の前記トリミング領域が、前記有効画像領域からはみ出すか否かを判定する判定手段と、前記判定手段によってはみ出すと判定された場合は、前記歪曲補正処理が行われることにより形状を変化させた後の前記トリミング領域の画像が、前記有効画像領域に含まれるように、当該トリミング領域を移動する、および、変倍することの少なくともいずれかを行う変更手段とを備えることを特徴とする。 In order to achieve the above object, an image processing apparatus comprising: a setting unit to set the trimming area which is an image of the trimming according to the user's instructions, after the trimming area is set, on the image, performs a correction to change the shape in order to correct the distortion due to the distortion of the lens used when taking the images, and, in the rectangular area inscribed in the image by changing the shape Image processing means for performing distortion correction processing for outputting an image in a corresponding effective image region, and the trimming region after the shape is changed by performing the distortion correction processing on the image, from the effective image region a determination unit configured to determine whether to run-off, the case where it is determined that protrudes by the determining means, after changing the shape by the distortion correction processing is performed Image of the trimming area, so as to be included in the effective image area, to move the crop region, and characterized in that it comprises at least changing means for performing any of the scaling.
上記目的を達成するために、請求項3記載の画像処理装置は、ユーザーの指示に応じて画像のトリミング対象である第1のトリミング領域を設定する設定手段と、前記第1のトリミング領域が設定された後に、前記画像に対して、前記画像を撮影する際に用いたレンズの歪曲収差に起因する歪みを補正するために形状を変化させる補正を行い、かつ、形状を変化させた画像に内接する矩形領域に相当する有効画像領域における画像を出力する歪曲補正処理を行う画像処理手段と、前記画像に対して前記歪曲補正処理を行うことにより形状を変化させた後の前記第1のトリミング領域に内接または外接する第2のトリミング領域を算出する算出手段と、前記第2のトリミング領域が、前記有効画像領域からはみ出すか否かを判定する判定手段と、前記判定手段によってはみ出すと判定された場合は、前記第2のトリミング領域の画像が、前記有効画像領域に含まれるように、前記第2のトリミング領域を移動する、および、変倍することの少なくともいずれかを行う変更手段とを備えることを特徴とする。 In order to achieve the above object, the image processing apparatus according to claim 3 , wherein the first trimming area is set by setting means for setting a first trimming area which is a target of image trimming according to a user instruction. After that, the image is subjected to correction for changing the shape in order to correct distortion caused by the distortion of the lens used when taking the image, and the image is changed. Image processing means for performing distortion correction processing for outputting an image in an effective image region corresponding to a rectangular region in contact with the first trimming region after the shape is changed by performing the distortion correction processing on the image Calculating means for calculating a second trimming area that is inscribed or circumscribed at the same time, and determination means for determining whether or not the second trimming area protrudes from the effective image area; If it is determined by the determination means that the second trimming area is included in the effective image area, the second trimming area is moved and scaled so that the image of the second trimming area is included in the effective image area. And changing means for performing any one of them.
上記目的を達成するために、請求項5記載の画像処理方法は、ユーザーの指示に応じて画像のトリミング対象であるトリミング領域を設定する設定工程と、前記トリミング領域が設定された後に、前記画像に対して、前記画像を撮影する際に用いたレンズの歪曲収差に起因する歪みを補正するために形状を変化させる補正を行い、かつ、形状を変化させた画像に内接する矩形領域に相当する有効画像領域における画像を出力する歪曲補正処理を行う画像処理工程と、前記画像に対して前記歪曲補正処理を行うことにより形状を変化させた後の前記トリミング領域が、前記有効画像領域からはみ出すか否かを判定する判定工程と、前記判定工程においてはみ出すと判定された場合は、前記歪曲補正処理が行われることにより形状を変化させた後の前記トリミング領域の画像が、前記有効画像領域に含まれるように、当該トリミング領域を移動する、および、変倍することの少なくともいずれかを行う変更工程とを備えることを特徴とする。 In order to achieve the above object, an image processing method of claim 5, the setting process to set the trimming area which is trimmed target image according to the user's instructions, after the trimming area is set, on the image, performs a correction to change the shape in order to correct the distortion due to the distortion of the lens used when taking the images, and, in the rectangular area inscribed in the image by changing the shape An image processing step for performing distortion correction processing for outputting an image in a corresponding effective image region, and the trimming region after the shape is changed by performing the distortion correction processing on the image, from the effective image region and protruding to whether the determining step, wherein when it is determined that protrudes in the determination step, after changing the shape by the distortion correction processing is performed Image of the trimming area, so as to be included in the effective image area, to move the crop region, and characterized by comprising a changing step of performing at least one of the scaling.
上記目的を達成するために、請求項6記載の画像処理方法は、ユーザーの指示に応じて画像のトリミング対象である第1のトリミング領域を設定する設定工程と、前記第1のトリミング領域が設定された後に、前記画像に対して、前記画像を撮影する際に用いたレンズの歪曲収差に起因する歪みを補正するために形状を変化させる補正を行い、かつ、形状を変化させた画像に内接する矩形領域に相当する有効画像領域における画像を出力する歪曲補正処理を行う画像処理工程と、前記画像に対して前記歪曲補正処理を行うことにより形状を変化させた後の前記第1のトリミング領域に内接または外接する第2のトリミング領域を算出する算出工程と、前記第2のトリミング領域が、前記有効画像領域からはみ出すか否かを判定する判定工程と、前記判定工程においてはみ出すと判定された場合は、前記第2のトリミング領域の画像が、前記有効画像領域に含まれるように、前記第2のトリミング領域を移動する、および、変倍することの少なくともいずれかを行う変更工程とを備えることを特徴とする。 In order to achieve the above object , according to an image processing method according to claim 6 , a setting step of setting a first trimming area which is a trimming target of an image according to a user instruction, and the first trimming area are set. After that, the image is subjected to correction for changing the shape in order to correct distortion caused by the distortion of the lens used when taking the image, and the image is changed. An image processing step of performing distortion correction processing for outputting an image in an effective image region corresponding to a rectangular region in contact with the first trimming region after the shape is changed by performing the distortion correction processing on the image A calculation step of calculating a second trimming region that is inscribed or circumscribed at the same time, and a determination step of determining whether or not the second trimming region protrudes from the effective image region; If it is determined in the determination step that at least the second trimming area is moved and scaled so that the image of the second trimming area is included in the effective image area And a changing step for performing any one of them.
本発明によれば、トリミング領域が設定された画像に外縁の形状変化を伴う画像処理が実行されても、設定されたトリミング領域が画像処理された画像からはみ出ないように、トリミング領域の形状を変形させる。これにより、画像編集に対するユーザの操作を制限することなく、画像処理により画像の外縁形状が変形しても、設定されたトリミング領域が画像処理後の画像からはみ出さずに、トリミング画像を適正化することができる。 According to the present invention, the shape of the trimming area is set so that the set trimming area does not protrude from the image-processed image even when image processing with a change in the shape of the outer edge is performed on the image in which the trimming area is set. Deform. This makes it possible to optimize the trimming image without restricting the trimming area that has been set out of the image after image processing, even if the outer edge shape of the image is deformed by image processing, without restricting user operations for image editing. can do.
本発明によれば、予めトリミング領域が設定された画像に外縁の形状変化を伴う画像処理を行い、画像処理により変形したトリミング領域に基づいて新しいトリミング領域を算出する。そして、新しいトリミング領域が画像処理された画像からはみ出ないように、トリミング領域の形状を変形させる。これにより、予めトリミング領域が設定された画像が画像処理により外縁形状を変形されても、ユーザが意図したトリミング領域をトリミングすることができる。 According to the present invention, image processing with a change in the shape of the outer edge is performed on an image in which a trimming region is set in advance, and a new trimming region is calculated based on the trimming region deformed by the image processing. Then, the shape of the trimming area is deformed so that the new trimming area does not protrude from the image-processed image. As a result, even if an image in which a trimming area is set in advance has its outer edge shape deformed by image processing, the trimming area intended by the user can be trimmed.
以下、本発明の実施の形態を図面を参照して詳細に説明する。 Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
[第1の実施形態]
図1は、本発明の第1の実施形態に係る画像処理装置の構成例を示すブロック図である。
[First Embodiment]
FIG. 1 is a block diagram illustrating a configuration example of an image processing apparatus according to the first embodiment of the present invention.
CPU101は、画像処理装置1のシステム全体の動作をコントロールすると共に、一次記憶装置102に格納されたプログラムを実行する。一次記憶装置102はRAM(Random Access Memory)であり、ハードディスク等の二次記憶装置103に記憶されたプログラムやデータなどが一時的に格納される。一般的に、一次記憶装置102の記憶容量は二次記憶装置103の記憶容量よりも小さく、一次記憶装置102に格納しきれないプログラムやデータなどが二次記憶装置103に格納される。また、長時間記憶しなくてはならないデータなども二次記憶装置103に格納される。本実施の形態では、後述する画像処理アプリケーションのプログラムは二次記憶装置103に格納されるが、プログラム実行時には一次記憶装置102に読み込まれ、CPU101により実行される。
The
入力デバイス104は、例えば、マウスやキーボードなどが該当する。出力デバイス105は、例えば、モニタやプリンタなどが該当する。ユーザは、入力デバイス104を操作することにより、出力デバイス105のGUI上の画像に対してトリミング領域を設定したり、所望の動作を選択したりすることができる。その際、入力デバイス104は実行中のプログラムなどに割り込み信号を送る。読込デバイス106は、撮影レンズやCCD(Charge Coupled Device)素子などで構成される撮像装置であり、撮像した画像を直接又は間接的に一次記憶装置102や二次記憶装置103へ格納する。
The
特性データ供給部107は、撮像装置の各種レンズに応じた特性データすなわち撮影レンズに対応した補正係数を、内蔵するメモリ(不図示)に格納し、必要に応じてCPU101に供給する。なお、レンズ特性の情報は、特性データ供給部107が有するメモリに限定されず、二次記憶装置103や図示しない外部記憶装置に格納されていてもよい。
The characteristic
画像処理装置1には、画像を閲覧したり、画像に対してトリミングや歪曲収差補正等の編集処理を施したりすることが可能な画像処理アプリケーションが搭載されている。本実施の形態における歪曲収差補正処理では、補正関数が予め定められ、補正関数に特性データ供給部107から供給された補正係数を適用することで補正量が算出され、算出された補正量に応じて画像が変形される。
The
図2は、図1の画像処理装置1におけるGUIの一例を示す図である。
FIG. 2 is a diagram illustrating an example of a GUI in the
図2に示すGUIは、画像処理アプリケーションを実行するCPU101により出力デバイス105に表示された画面である。画像処理アプリケーション上では、画像表示部401に処理対象となる画像がフィット表示される。ユーザは、オペレーティングシステム(OS)のファイル管理システム上から画像表示部401に画像ファイルをドラッグアンドドロップすることで処理対象画像を指定することができる。また、画像処理アプリケーション上では、処理対象画像に画像処理が施された結果の画像が画像表示部401に表示される。
The GUI shown in FIG. 2 is a screen displayed on the
トリミング実行ボタン402が押下されると、ユーザにより設定されたトリミング領域に従って処理対象画像がトリミングされ、結果の画像が画像表示部401に表示される。
When the trimming
歪曲収差補正実行ボタン403が押下されると、処理対象画像に対して、後述する図3の歪曲収差補正を含む画像処理が施され、その結果の画像が画像表示部401に表示される。後述する図3の画像処理には、歪曲収差補正が含まれるため、結果画像の外縁の形状が矩形でない場合がある。その際は、図13(a)及び図13(b)に示すように、歪曲収差補正を施した画像の外縁に内接する矩形領域で結果画像を切り出し、切り出した画像を結果画像としてもよい。
When a distortion aberration
リセットボタン404が押下されると、トリミングや歪曲収差補正処理を施す前の画像が画像表示部401に表示される。終了ボタン405が押下されると、画像処理アプリケーションが終了する。
When the
トリミング領域406は、ユーザが入力デバイス104であるマウスを操作して、画像表示部401に表示された画像の所望範囲をドラッグ指定することにより設定される。画像上でマウスをクリックした点とアンクリックした点とを結ぶ線を対角線とする矩形をトリミング領域406とする。
The trimming
画像処理アプリケーション上では、設定されたトリミング領域406の情報が画像ファイルに埋め込まれて保存される。なお、トリミング領域406の情報は、画像ファイルに関連付けられた上で、画像ファイルとは別に保存されてもよい。
On the image processing application, information on the
トリミング領域406の情報は、図4に示すように、トリミング領域設定有無40、左端X座標xt141及び上端Y座標yt142、右端X座標xt243及び下端Y座標yt244の値で構成される。
As shown in FIG. 4, the information of the
トリミング領域設定有無40は、トリミング領域が設定されているか否かを示し、その設定値が「YES」の場合はトリミング領域が設定済みであり、「NO」の場合はトリミング領域が未設定である。以降の説明では、トリミング領域の情報を取得する場合は、処理対象画像のトリミング領域の情報を取得するものとする。
The trimming area setting presence /
左端X座標xt141及び上端Y座標yt142は、トリミング領域の左上座標(xt1,yt1)を示す。右端X座標xt243及び下端Y座標yt244は、トリミング領域の右下座標(xt2,yt2)を示す。
The left end X coordinate x t1 41 and the upper end Y coordinate
図3は、歪曲収差補正実行ボタン押下時に実行される歪曲収差補正を含む処理の流れを示すフローチャートである。 FIG. 3 is a flowchart showing a flow of processing including distortion correction performed when the distortion correction execution button is pressed.
ステップS601では、画像処理アプリケーションを実行するCPU101は、処理対象画像に対して歪曲収差補正処理を施す。本実施の形態では、CPU101は、撮影時光学情報を用いて特性データ供給部107から特性データを取得し、予め定められた補正関数に適用することで像高(画像中心からの距離)に対する補正量を算出し、歪曲収差補正処理を実行する。補正関数は像高をパラメータとする3次関数とする。
In step S601, the
撮影時光学情報は、撮影レンズを識別するための識別情報、ズーム位置を特定するための撮影時焦点距離情報、F値などで構成される。本実施の形態では、これらの情報がExif規格で定められたMakerNoteタグに格納される。なお、補正精度を上げるために、上記情報に加えて被写体距離情報などの情報を用いても構わない。 The optical information at the time of photographing includes identification information for identifying the photographing lens, focal length information at the time of photographing for specifying the zoom position, F value, and the like. In the present embodiment, these pieces of information are stored in a MakerNote tag defined by the Exif standard. In order to improve the correction accuracy, information such as subject distance information may be used in addition to the above information.
ステップS602では、CPU101は、歪曲収差補正後の画像の外縁の形状に内接する矩形領域(以下、「有効画像領域」という。)の情報を取得する。有効画像領域の情報は、図5に示すように、有効画像領域501の左上座標(xd1,yd1)、右下座標(xd2,yd2)の値である。
In step S602, the
ステップS603では、CPU101は、処理対象画像のトリミング領域の情報を取得する。トリミング領域の情報は、図5に示すように、トリミング領域406の左上座標(xt1,yt1)、右下座標(xt2,yt2)の値である。
In step S603, the
ステップS604では、CPU101は、処理対象画像にトリミング領域が設定されているか否かを判定する。ステップS603でトリミング領域の情報を取得できなかった場合は、トリミング領域が設定されていないものとする。トリミング領域が設定されている場合は、ステップS605へ進む。一方、トリミング領域が設定されていなければ、ステップS609へ進む。
In step S604, the
ステップS605では、CPU101は、ステップS603で取得したトリミング領域が、ステップS602で取得した有効画像領域からはみ出しているか否かを判定する。この結果、(xt1,yt1)<(xd1,yd1)又は(xt2,yt2)>(xd2,yd2)となり、CPU101はトリミング領域が有効画像領域からはみ出していると判定した場合、ステップS606に進む。一方、CPU101は、トリミング領域が有効画像領域に完全に含まれていると判定した場合、ステップS608に進む。
In step S605, the
ステップS606では、CPU101は、トリミング領域が有効画像領域に完全に含まれるように、当該トリミング領域を変形する(トリミング領域変形処理)。トリミング領域変形処理の詳細については図6を用いて後述する。続いて、ステップS607では、変形したトリミング領域の情報を保存する。
In step S606, the
ステップS608では、CPU101は、歪曲補正処理後の画像からステップS606で変形したトリミング領域を切り出し、切り出した画像を結果画像として、一次記憶装置102又は二次記憶装置103に保存して、本処理を終了する。
In step S608, the
ステップS609では、CPU101は、歪曲補正処理された画像から有効画像領域を切り出し、切り出した画像を結果画像として、一次記憶装置102又は二次記憶装置103に保存して、本処理を終了する。なお、ステップS609において、歪曲補正処理された画像から有効画像領域を切り出すようにしたが、有効画像領域を切り出さずに歪曲補正処理された画像をそのまま結果画像としてもよい。
In step S609, the
図6は、図3におけるステップS606のトリミング領域変形処理の詳細を示すフローチャートである。以下に説明する座標値は、図5に示すように、歪曲補正処理後の画像の左上座標を原点(0,0)とし、図の左右方向がX軸、上下方向がY軸となる座標系によるものとする。 FIG. 6 is a flowchart showing details of the trimming region deformation processing in step S606 in FIG. As shown in FIG. 5, the coordinate values described below are coordinate systems in which the upper left coordinate of the image after distortion correction processing is the origin (0, 0), the horizontal direction in the figure is the X axis, and the vertical direction is the Y axis. According to.
図6において、ステップS801では、CPU101はトリミング領域の大きさ(幅Wt,高さHt)を算出する。トリミング領域の幅Wt及び高さHtは下式により算出される。
In FIG. 6, in step S801, the
Wt=xt2−xt1
Ht=yt2−yt1
ステップS802では、CPU101は、有効画像領域の大きさ(幅Wd,高さHd)を算出する。有効画像領域の幅Wd及び高さHdは下式により算出される。
Wt = x t2 −x t1
Ht = y t2 −y t1
In step S802, the
Wd=xd2−xd1
Hd=yd2−yd1
ステップS803では、CPU101は、算出したトリミング領域の大きさと有効画像領域の大きさを比較する。この結果、Wt>Wd又はHt>Hdとなり、トリミング領域が有効画像領域よりも大きい場合は、ステップS804へ進む。一方、トリミング領域が有効画像領域と同じか又は小さい場合、ステップS806へ進む。
Wd = x d2 -x d1
Hd = y d2 −y d1
In step S803, the
ステップS804,S805では、CPU101は、下式により、トリミング領域をアスペクト比を保ちながら有効画像領域に内接するように変倍する。なお、このとき、アスペクト比を保たずに変倍するようにしてもよい。
In steps S804 and S805, the
if(Wt/Ht>Wd/Hd):Wt=Wd,Ht=Wd×Ht/Wt
if(Wt/Ht≦Wd/Hd):Wt=Hd×Wt/Ht,Ht=Hd
xt2=xt1+Wt
yt2=yt1+Ht
ステップS806では、CPU101は、トリミング領域の左端X座標xt1と有効画像領域の左端X座標xd1を比較する。この結果、xt1<xd1であれば、ステップS807へ進む。一方、xt1≧xd1であれば、ステップS808へ進む。ステップS807では、CPU101は、トリミング領域の左端X座標の値が有効画像領域の左端X座標の値になるように、下式により、トリミング領域を+x方向に移動する。
if (Wt / Ht> Wd / Hd): Wt = Wd, Ht = Wd × Ht / Wt
if (Wt / Ht ≦ Wd / Hd): Wt = Hd × Wt / Ht, Ht = Hd
x t2 = x t1 + Wt
y t2 = y t1 + Ht
In step S806,
xt1=xt1+(xd1−xt1)
xt2=xt2+(xd1−xt1)
ステップS808では、CPU101は、トリミング領域の上端Y座標yt1と有効画像領域の上端Y座標yd1を比較する。この結果、yt1<yd1であれば、ステップS809へ進む。一方、yt1≧yd1であれば、ステップS810へ進む。ステップS809では、CPU101は、トリミング領域の上端Y座標の値が有効画像領域の上端Y座標の値になるように、下式により、トリミング領域を+y方向に移動する。
x t1 = x t1 + (x d1 −x t1 )
x t2 = x t2 + (x d1 −x t1 )
In step S808, the
yt1=yt1+(yd1−yt1)
yt2=yt2+(yd1−yt1)
ステップS810では、CPU101は、トリミング領域の右端X座標xt2と有効画像領域の右端X座標xd2を比較する。この結果、xt2>xd2であれば、ステップS811へ進む。一方、xt2≦xd2であれば、ステップS812へ進む。ステップS811では、CPU101は、トリミング領域の右端X座標の値が有効画像領域の右端X座標の値になるように、下式により、トリミング領域を−x方向に移動する。
y t1 = y t1 + (y d1 −y t1 )
y t2 = y t2 + (y d1 −y t1 )
In step S810,
xt1=xt1−(xt2−xd2)
xt2=xt2−(xt2−xd2)
ステップS812では、CPU101は、トリミング領域の下端Y座標yt2と、有効画像領域の下端Y座標yd2を比較する。この結果、yt2>yd2であれば、ステップS813へ進む。一方、yt2≦yd2であれば、リターンする。ステップS813では、CPU101は、トリミング領域の下端Y座標の値が有効画像領域の下端Y座標の値になるように、下式により、トリミング領域を−y方向に移動する。
x t1 = x t1 - (x t2 -x d2)
x t2 = x t2 - (x t2 -x d2)
In step S812, the
yt1=yt1−(yt2−yd2)
yt2=yt2−(yt2−yd2)
上記実施の形態によれば、ユーザにより設定されたトリミング領域が、歪曲収差補正処理された画像からはみ出しているか否かを判定する。そして、はみ出していると判定されたときは、トリミング領域が歪曲収差補正処理された画像に含まれるように、トリミング領域の形状を変形させる。これにより、画像編集に対するユーザの操作を制限することなく、画像処理により画像の外縁形状が変形しても、設定されたトリミング領域が画像処理後の画像からはみ出さずに、トリミング画像を適正化することができる。
y t1 = y t1 − (y t2 −y d2 )
y t2 = y t2 − (y t2 −y d2 )
According to the above-described embodiment, it is determined whether or not the trimming area set by the user protrudes from the distortion-corrected image. When it is determined that the image is protruding, the shape of the trimming area is deformed so that the trimming area is included in the distortion-corrected image. This makes it possible to optimize the trimming image without restricting the trimming area that has been set out of the image after image processing, even if the outer edge shape of the image is deformed by image processing, without restricting user operations for image editing. can do.
[第2の実施形態]
本発明の第2の実施の形態に係る画像処理装置は、その構成(図1)が上記第1の実施の形態に係る画像処理装置と同じであり、第1の実施の形態と同様の部分については、同一の符号を用いてその説明を省略する。以下に、上記第1の実施の形態と異なる点のみを説明する。
[Second Embodiment]
The image processing apparatus according to the second embodiment of the present invention has the same configuration (FIG. 1) as that of the image processing apparatus according to the first embodiment, and is the same as the first embodiment. The description is omitted using the same reference numerals. Only differences from the first embodiment will be described below.
上記第1の実施形態では、画像に歪曲収差補正処理を施した後、トリミング領域が補正処理された画像領域からはみ出している場合、トリミング領域が補正処理後の画像領域に含まれるようにトリミング領域を並行移動又は変倍して、その形状を変形させた。これにより、ユーザがトリミング領域を設定した際に意図した大きさ(画素数)を変えずに、トリミング領域の形状を変形することができる。 In the first embodiment, after the distortion correction process is performed on the image, when the trimming area protrudes from the corrected image area, the trimming area is included in the image area after the correction process. The shape was deformed by parallel movement or scaling. Thereby, the shape of the trimming region can be changed without changing the size (number of pixels) intended when the user sets the trimming region.
しかしながら、ユーザが意図した画像の意味をなるべく変えずに、トリミング領域の形状を変更するようにしてもよい。すなわち、補正処理前の画像のトリミング領域に含まれる画素が移動した先の座標を含むようにトリミング領域の形状を変形する。 However, the shape of the trimming area may be changed without changing the meaning of the image intended by the user as much as possible. In other words, the shape of the trimming area is deformed so that the pixel included in the trimming area of the image before the correction process includes the previous coordinates moved.
図7は、本発明の第2の実施形態における歪曲収差補正を含む処理の流れを示すフローチャートである。本処理は、上記第1の実施形態と同様に、歪曲収差補正実行ボタン403が押下されたときに実行される処理である。
FIG. 7 is a flowchart showing a flow of processing including distortion correction in the second embodiment of the present invention. This process is a process that is executed when the distortion
ステップS901では、画像処理アプリケーションを実行するCPU101は、処理対象画像に対して歪曲収差補正処理を施す。歪曲収差補正処理は、図3のステップS601と同様の方法により行われる。
In step S901, the
ステップS902では、CPU101は、歪曲収差補正後の画像の外縁の形状に内接する矩形領域(以下、「有効画像領域」という。)の情報を取得する。有効画像領域の情報は、図3のステップS602と同様に、有効画像領域501の左上座標(xd1,yd1),右下座標(xd2,yd2)の値である。
In step S <b> 902, the
ステップS903では、CPU101は、処理対象画像のトリミング領域の情報を取得する。トリミング領域の情報は、図3のステップS603と同様に、トリミング領域406の左上座標(xt1,yt1)、右下座標(xt2,yt2)の値である。
In step S903, the
ステップS904では、CPU101は、処理対象画像にトリミング領域が設定されているか否かを判定する。ステップS903でトリミング領域の情報を取得できなかった場合は、トリミング領域が設定されていないものとする。トリミング領域が設定されている場合は、ステップS905へ進む。一方、トリミング領域が設定されていなければ、ステップS912へ進む。
In step S904, the
ステップS905では、CPU101は、ステップS903で取得したトリミング領域が、ステップS902で取得した有効画像領域からはみ出しているか否かを判定する。この結果、(xt1,yt1)<(xd1,yd1)又は(xt2,yt2)>(xd2,yd2)となり、CPU101はトリミング領域が有効画像領域からはみ出していると判定した場合、ステップS906に進む。一方、CPU101は、トリミング領域が有効画像領域に完全に含まれていると判定した場合、ステップS911に進む。
In step S905, the
ステップS906では、CPU101は、図8に示すように、画像に対して施した歪曲収差補正の補正関数に従ってトリミング領域を変形し、変形したトリミング領域に内接又は外接する矩形領域を新しいトリミング領域とする。新しいトリミング領域は、左上座標値(x”t1,y”t1)、右下座標値(x”t2,y”t2)となる。この処理の詳細については、図9〜図11を用いて後述する。
In step S906, as shown in FIG. 8, the
ステップS907では、CPU101は、現在のトリミング領域の情報を、ステップS905で取得した新しいトリミング領域の情報に置き換える(xt1=x”t1,yt1=y”t1,xt2=x”t2,yt2=y”t2)。
In step S907, the
ステップS908では、CPU101は、ステップS907で置き換えた新しいトリミング領域が有効画像領域からはみ出しているか否かを判定する。この結果、(xt1,yt1)<(xd1,yd1)又は(xt2,yt2)>(xd2,yd2)となり、CPU101はトリミング領域が有効画像領域からはみ出していると判定した場合、ステップS909に進む。一方、CPU101は、トリミング領域が有効画像領域に完全に含まれていると判定した場合、ステップS911に進む。
In step S908, the
ステップS909では、CPU101は、トリミング領域が有効画像領域に完全に含まれるように、当該トリミング領域を変形する(トリミング領域変形処理)。このトリミング領域変形処理は図6に示したものである。続いて、ステップS910では、変形したトリミング領域の情報を保存する。
In step S909, the
ステップS911では、CPU101は、歪曲補正処理後の画像からステップS909で変形したトリミング領域を切り出し、切り出した画像を結果画像として、一次記憶装置102又は二次記憶装置103に保存して、本処理を終了する。
In step S911, the
ステップS912では、CPU101は、歪曲補正処理後の画像から有効画像領域を切り出し、切り出した画像を結果画像として、一次記憶装置102又は二次記憶装置103に保存して、本処理を終了する。
In step S912, the
本実施の形態では、ステップS906で歪曲収差補正の補正関数に基づいてトリミング領域の形状を変形した後、ステップS907,S908で再度トリミング領域のチェックを行う。これにより、ステップS906の処理の結果、トリミング領域が有効画像領域の外を含んでいても、その後の処理により、トリミング領域が有効画像領域の内部に含まれるように、再度変形することができる。 In the present embodiment, after the shape of the trimming area is deformed based on the correction function for distortion aberration correction in step S906, the trimming area is checked again in steps S907 and S908. As a result, even if the trimming area includes the outside of the effective image area as a result of the processing in step S906, it can be deformed again so that the trimming area is included inside the effective image area by the subsequent processing.
また、本実施の形態では、ステップS905でトリミング領域が有効画像領域からはみ出している場合に限り、ステップS906のトリミング領域の変形を実行するようにしている。しかし、ステップS906をステップS605の前に実行し、歪曲収差補正の補正関数に基づくトリミング領域の変形を必ず行うようにしてもよい。 In the present embodiment, only when the trimming area protrudes from the effective image area in step S905, the modification of the trimming area in step S906 is executed. However, step S906 may be performed before step S605, and the trimming region may be necessarily deformed based on the distortion aberration correction function.
図9及び図10は、図7におけるステップS906の新しいトリミング領域の算出処理の詳細を示すフローチャートである。 FIGS. 9 and 10 are flowcharts showing details of the new trimming area calculation process in step S906 in FIG.
以下に説明する座標値は、図11に示すように、歪曲補正処理後の画像の左上座標を原点(0,0)とし、図の左右方向がX軸、上下方向がY軸となる座標系によるものとする。また、以下に説明する処理で得られる新しいトリミング領域の左上座標値を(x”t1,y”t1)、右下座標値を(x”t2,y”t2)とする。また、以下の説明では、座標値(x,y)=(i,j)の位置の画素を、歪曲収差補正処理の補正関数により移動した先の座標値(x,y)=(i’,j’)として表す。 As shown in FIG. 11, the coordinate values described below are coordinate systems in which the upper left coordinate of the image after distortion correction processing is the origin (0, 0), the horizontal direction in the figure is the X axis, and the vertical direction is the Y axis. According to. Further, the upper left coordinate value of the new trimming area obtained by the processing described below is (x ″ t1 , y ″ t1 ), and the lower right coordinate value is (x ″ t2 , y ″ t2 ). In the following description, the pixel value at the position of the coordinate value (x, y) = (i, j) is moved to the previous coordinate value (x, y) = (i ′, j ′).
図9において、ステップS1201〜S1208では、CPU101は、新しいトリミング領域の上端のY座標y”t1を決定する。
In FIG. 9, in steps S1201 to S1208, the
ステップS1201では、y”t1にyt1を代入する。次に、ステップS1202では、変数jにyt1を代入する。次に、ステップS1203では、変数iにxt1を代入する。 In step S1201, y t1 is substituted for y ″ t1 . Next, in step S1202, y t1 is substituted for variable j. Next, in step S1203, x t1 is substituted for variable i.
ステップS1204では、CPU101は、歪曲収差補正の補正関数により、座標値(x,y)=(i,j)の画素の移動先の座標値(x,y)=(i’,j’)を算出する。次に、ステップS1205では、CPU101は、y”t1とj’の値を比較する。この結果、y”t1<j’であれば、ステップS1206に進む。一方、y”t1≧j’であれば、ステップS1207に進む。ステップS1206では、y”t1にj’を代入する。
In step S1204, the
ステップS1207では、CPU101は、変数iの値に1を追加する。次に、ステップS1208では、変数iとxt2の値を比較する。この結果、i>xt2であれば、ステップS1209に進む。一方、i≦xt2であれば、ステップS1204に戻る。
In step S1207, the
ステップS1209〜S1216では、CPU101は、新しいトリミング領域の下端のY座標y”t2を決定する。
In steps S1209 to S1216, the
ステップS1209では、y”t2にyt2を代入する。次に、ステップS1210では、変数jにyt2を代入する。次に、ステップS1211では、変数iにxt1を代入する。 In step S1209, y t2 is substituted for y ″ t2 . Next, in step S1210, y t2 is substituted for variable j. Next, in step S1211, x t1 is substituted for variable i.
ステップS1212では、CPU101は、歪曲収差補正の補正関数により、座標値(x,y)=(i,j)の画素の移動先の座標値(x,y)=(i’,j’)を算出する。次に、ステップS1213では、CPU101は、y”t2とj’の値を比較する。この結果、y”t2>j’であれば、ステップS1214に進む。一方、y”t2≦j’であれば、ステップS1215に進む。ステップS1214では、y”t2にj’を代入する。
In step S <b> 1212, the
ステップS1215では、CPU101は、変数iの値に1を追加する。次に、ステップS1216では、変数iとxt2の値を比較する。この結果、i>xt2であれば、図10のステップS1217に進む。一方、i≦xt2であれば、ステップS1212に戻る。
In step S1215, the
図10において、ステップS1217〜S1224では、CPU101は、新しいトリミング領域の左端のX座標x”t1を決定する。
In FIG. 10, in steps S1217 to S1224, the
ステップS1217では、x”t1にxt1を代入する。次に、ステップS1218では、変数iにxt1を代入する。次に、ステップS1219では、変数jにyt1を代入する。 In step S1217, x t1 is substituted for x ″ t1 . Next, in step S1218, x t1 is substituted for variable i. Next, in step S1219, y t1 is substituted for variable j.
ステップS1220では、CPU101は、歪曲収差補正の補正関数により、座標値(x,y)=(i,j)の画素の移動先の座標値(x,y)=(i’,j’)を算出する。次に、ステップS1221では、CPU101は、x”t1とi’の値を比較する。この結果、x”t1<i’であれば、ステップS1222に進む。一方、x”t1≧i’であれば、ステップS1223に進む。ステップS1222では、x”t1にi’を代入する。
In step S1220, the
ステップS1223では、CPU101は、変数jの値に1を追加する。次に、ステップS1224では、変数jとyt2の値を比較する。この結果、j>yt2であれば、ステップS1225に進む。一方、j≦yt2であれば、ステップS1220に戻る。
In step S1223, the
ステップS1225〜S1232では、CPU101は、新しいトリミング領域の右端のX座標x”t2を決定する。
In steps S1225 to S1232, the
ステップS1225では、x”t2にxt2を代入する。次に、ステップS1226では、変数iにxt2を代入する。次に、ステップS1227では、変数jにyt1を代入する。 In step S1225, x t2 is substituted for x ″ t2 . Next, in step S1226, x t2 is substituted for variable i. In step S1227, y t1 is substituted for variable j.
ステップS1228では、CPU101は、歪曲収差補正の補正関数により、座標値(x,y)=(i,j)の画素の移動先の座標値(x,y)=(i’,j’)を算出する。ステップS1229では、CPU101は、x”t2とi’の値を比較する。この結果、x”t2>i’であれば、ステップS1230に進む。一方、x”t2≦i’であれば、ステップS1231に進む。ステップS1230では、x”t2にi’を代入する。
In step S <b> 1228, the
ステップS1231では、CPU101は、変数jの値に1を追加する。次に、ステップS1232では、変数jとyt2の値を比較する。この結果、j>yt2であれば、本処理を終了する。一方、j≦yt2であれば、ステップS1228に戻る。
In step S1231, the
上記実施の形態によれば、予めトリミング領域が設定された画像に外縁の形状変化を伴う画像処理を行い、画像処理により変形したトリミング領域に基づいて新しいトリミング領域を算出する。そして、新しいトリミング領域が画像処理された画像からはみ出ないように、トリミング領域の形状を変形させる。これにより、予めトリミング領域が設定された画像が画像処理により外縁形状を変形されても、ユーザが意図した領域をトリミングすることができる。 According to the above-described embodiment, image processing with a change in the shape of the outer edge is performed on an image in which a trimming region is set in advance, and a new trimming region is calculated based on the trimming region deformed by the image processing. Then, the shape of the trimming area is deformed so that the new trimming area does not protrude from the image-processed image. Thus, even if an image in which a trimming area is set in advance has its outer edge shape deformed by image processing, the area intended by the user can be trimmed.
上記実施の形態では、歪曲収差補正で変形したトリミング領域の内接する矩形領域を新しいトリミング領域として用いることで、ユーザの意図した画像を残しながら、トリミング領域が有効画像領域の外に出ないようにした。しかしながら、変形したトリミング領域の外接矩形を新しいトリミング領域として用いて、ユーザの意図した画像の範囲を完全に残すようにしてもよい。 In the above-described embodiment, by using a rectangular area inscribed in the trimming area deformed by the distortion correction as a new trimming area, the trimming area does not go out of the effective image area while leaving the image intended by the user. did. However, the circumscribed rectangle of the deformed trimming area may be used as a new trimming area to completely leave the image range intended by the user.
また、単純に変形したトリミング領域の内接又は外接をとるのではなく、元のトリミング領域のアスペクト比を保ちつつ内接又は外接をとってもよい。 In addition, instead of taking the inscribed or circumscribed area of the trimmed area simply deformed, the inscribed or circumscribed area may be taken while maintaining the aspect ratio of the original trimmed area.
また、変形したトリミング領域の内部に、元のトリミング領域を平行移動し、平行移動したトリミング領域を新しいトリミング領域としてもよい。 Further, the original trimming area may be translated into the deformed trimming area, and the translated trimming area may be set as a new trimming area.
上記実施の形態では、トリミング領域を変形する際、歪曲収差補正後の画像の外縁の形状に内接する矩形領域を有効画像領域とし、トリミング領域が有効画像領域に完全に含まれるようにした。しかしながら、図12に示すように、トリミング領域の形状によっては、有効画像領域からはみ出していても、歪曲収差補正後の画像の内部に含まれる場合がある。そのような場合は、有効画像領域からはみ出すように、トリミング領域を変形してもよい。 In the above embodiment, when the trimming area is deformed, the rectangular area inscribed in the shape of the outer edge of the image after distortion correction is set as the effective image area, and the trimming area is completely included in the effective image area. However, as shown in FIG. 12, depending on the shape of the trimming area, it may be included in the image after distortion correction even if it protrudes from the effective image area. In such a case, the trimming area may be deformed so as to protrude from the effective image area.
また、本発明の目的は、以下の処理を実行することによって達成される。即ち、上述した実施形態の機能を実現するソフトウェアのプログラムコードを記録した記憶媒体を、システム或いは装置に供給し、そのシステム或いは装置のコンピュータ(またはCPUやMPU等)が記憶媒体に格納されたプログラムコードを読み出す処理である。この場合、記憶媒体から読み出されたプログラムコード自体が前述した実施の形態の機能を実現することになり、そのプログラムコード及び該プログラムコードを記憶した記憶媒体は本発明を構成することになる。 The object of the present invention is achieved by executing the following processing. That is, a storage medium that records a program code of software that realizes the functions of the above-described embodiments is supplied to a system or apparatus, and a computer (or CPU, MPU, etc.) of the system or apparatus is stored in the storage medium. This is the process of reading the code. In this case, the program code itself read from the storage medium realizes the functions of the above-described embodiments, and the program code and the storage medium storing the program code constitute the present invention.
また、プログラムコードを供給するための記憶媒体としては、次のものを用いることができる。例えば、フロッピー(登録商標)ディスク、ハードディスク、光磁気ディスク、CD−ROM、CD−R、CD−RW、DVD−ROM、DVD−RAM、DVD−RW、DVD+RW、磁気テープ、不揮発性のメモリカード、ROM等である。または、プログラムコードをネットワークを介してダウンロードしてもよい。 Moreover, the following can be used as a storage medium for supplying the program code. For example, floppy (registered trademark) disk, hard disk, magneto-optical disk, CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD + RW, magnetic tape, nonvolatile memory card, ROM or the like. Alternatively, the program code may be downloaded via a network.
また、コンピュータが読み出したプログラムコードを実行することにより、上記実施の形態の機能が実現される場合も本発明に含まれる。加えて、そのプログラムコードの指示に基づき、コンピュータ上で稼動しているOS(オペレーティングシステム)等が実際の処理の一部または全部を行い、その処理によって前述した実施形態の機能が実現される場合も含まれる。 Further, the present invention includes a case where the function of the above-described embodiment is realized by executing the program code read by the computer. In addition, an OS (operating system) running on the computer performs part or all of the actual processing based on an instruction of the program code, and the functions of the above-described embodiments are realized by the processing. Is also included.
更に、前述した実施形態の機能が以下の処理によって実現される場合も本発明に含まれる。即ち、記憶媒体から読み出されたプログラムコードが、コンピュータに挿入された機能拡張ボードやコンピュータに接続された機能拡張ユニットに備わるメモリに書き込まれる。その後、そのプログラムコードの指示に基づき、その機能拡張ボードや機能拡張ユニットに備わるCPU等が実際の処理の一部または全部を行う場合である。 Furthermore, a case where the functions of the above-described embodiment are realized by the following processing is also included in the present invention. That is, the program code read from the storage medium is written in a memory provided in a function expansion board inserted into the computer or a function expansion unit connected to the computer. Thereafter, based on the instruction of the program code, the CPU or the like provided in the function expansion board or function expansion unit performs part or all of the actual processing.
また、コンピュータが読み出したプログラムコードを実行することにより、前述した各実施の形態の機能が実現される場合も本発明に含まれる。加えて、そのプログラムコードの指示に基づき、コンピュータ上で稼働しているOSなどが実際の処理の一部又は全部を行い、その処理によって前述した実施の形態の機能が実現する場合も含まれる。この場合、上記プログラムは、該プログラムを記憶した記憶媒体から直接、又はインターネット、商用ネットワーク、若しくはローカルエリアネットワーク等に接続された不図示の他のコンピュータやデータベース等からダウンロードすることにより供給される。 Further, the present invention includes a case where the functions of the above-described embodiments are realized by executing the program code read by the computer. In addition, there is a case where the OS running on the computer performs part or all of the actual processing based on the instruction of the program code, and the functions of the above-described embodiments are realized by the processing. In this case, the program is supplied by downloading directly from a storage medium storing the program or from another computer or database (not shown) connected to the Internet, a commercial network, a local area network, or the like.
1 画像処理装置
101 CPU
102 一次記憶装置
103 二次記憶装置
104 入力デバイス
105 出力デバイス
106 読込デバイス
107 レンズ特性データ供給部
401 画像表示部
402 トリミング実行ボタン
403 歪曲収差補正実行ボタン
404 リセットボタン
405 終了ボタン
1
102
Claims (7)
前記トリミング領域が設定された後に、前記画像に対して、前記画像を撮影する際に用いたレンズの歪曲収差に起因する歪みを補正するために形状を変化させる補正を行い、かつ、形状を変化させた画像に内接する矩形領域に相当する有効画像領域における画像を出力する歪曲補正処理を行う画像処理手段と、
前記画像に対して前記歪曲補正処理を行うことにより形状を変化させた後の前記トリミング領域が、前記有効画像領域からはみ出すか否かを判定する判定手段と、
前記判定手段によってはみ出すと判定された場合は、前記歪曲補正処理が行われることにより形状を変化させた後の前記トリミング領域の画像が、前記有効画像領域に含まれるように、当該トリミング領域を移動する、および、変倍することの少なくともいずれかを行う変更手段とを備えることを特徴とする画像処理装置。 And setting means to set the trimming area which is trimmed target image in response to user instructions,
After said trimming area is set, with respect to the image, it performs a correction to change the shape in order to correct the distortion due to the distortion of the lens used when taking the image, and change shape Image processing means for performing distortion correction processing for outputting an image in an effective image area corresponding to a rectangular area inscribed in the image ,
The trimming area after changing the shape by performing the distortion correction process on the image, a determination unit configured to determine whether to run-off from the effective image area,
If it is determined by the determination means that the trimming area is moved so that the image of the trimming area after the shape is changed by performing the distortion correction processing is included in the effective image area An image processing apparatus comprising: changing means that performs at least one of scaling and scaling .
前記設定手段は、前記画像表示手段に表示された画像に対して前記トリミング領域を設定することを特徴とする請求項1に記載の画像処理装置。The image processing apparatus according to claim 1, wherein the setting unit sets the trimming region for an image displayed on the image display unit.
前記第1のトリミング領域が設定された後に、前記画像に対して、前記画像を撮影する際に用いたレンズの歪曲収差に起因する歪みを補正するために形状を変化させる補正を行い、かつ、形状を変化させた画像に内接する矩形領域に相当する有効画像領域における画像を出力する歪曲補正処理を行う画像処理手段と、
前記画像に対して前記歪曲補正処理を行うことにより形状を変化させた後の前記第1のトリミング領域に内接または外接する第2のトリミング領域を算出する算出手段と、
前記第2のトリミング領域が、前記有効画像領域からはみ出すか否かを判定する判定手段と、
前記判定手段によってはみ出すと判定された場合は、前記第2のトリミング領域の画像が、前記有効画像領域に含まれるように、前記第2のトリミング領域を移動する、および、変倍することの少なくともいずれかを行う変更手段とを備えることを特徴とする画像処理装置。 Setting means for setting a first trimming area that is a target of image trimming according to a user instruction;
After the first trimming area is set, the image is corrected to change its shape in order to correct distortion caused by distortion of a lens used when the image is captured, and Image processing means for performing distortion correction processing for outputting an image in an effective image area corresponding to a rectangular area inscribed in the image whose shape has been changed;
Calculating means for calculating a second trimming area that is inscribed or circumscribed to the first trimming area after the shape is changed by performing the distortion correction processing on the image;
Determination means for determining whether or not the second trimming area protrudes from the effective image area;
If it is determined by the determination means that the second trimming area is included in the effective image area, the second trimming area is moved and scaled so that the image of the second trimming area is included in the effective image area. An image processing apparatus comprising: changing means for performing any of the above .
前記設定手段は、前記画像表示手段に表示された画像に対して前記第1のトリミング領域を設定することを特徴とする請求項3に記載の画像処理装置。 Further comprising image display means for displaying the image,
The image processing apparatus according to claim 3 , wherein the setting unit sets the first trimming region for an image displayed on the image display unit .
前記トリミング領域が設定された後に、前記画像に対して、前記画像を撮影する際に用いたレンズの歪曲収差に起因する歪みを補正するために形状を変化させる補正を行い、かつ、形状を変化させた画像に内接する矩形領域に相当する有効画像領域における画像を出力する歪曲補正処理を行う画像処理工程と、
前記画像に対して前記歪曲補正処理を行うことにより形状を変化させた後の前記トリミング領域が、前記有効画像領域からはみ出すか否かを判定する判定工程と、
前記判定工程においてはみ出すと判定された場合は、前記歪曲補正処理が行われることにより形状を変化させた後の前記トリミング領域の画像が、前記有効画像領域に含まれるように、当該トリミング領域を移動する、および、変倍することの少なくともいずれかを行う変更工程とを備えることを特徴とする画像処理方法。 And configuration process to set the trimming area which is trimmed target image in response to user instructions,
After said trimming area is set, with respect to the image, it performs a correction to change the shape in order to correct the distortion due to the distortion of the lens used when taking the image, and change shape An image processing step for performing distortion correction processing for outputting an image in an effective image area corresponding to a rectangular area inscribed in the image ,
The trimming area after changing the shape by performing the distortion correction process on the image, a determination step of determining whether to protrude from the effective image area,
If it is determined in the determination step that the trimming area is moved , the image of the trimming area after the shape is changed by performing the distortion correction processing is included in the effective image area. And a changing step for performing at least one of scaling and scaling .
前記第1のトリミング領域が設定された後に、前記画像に対して、前記画像を撮影する際に用いたレンズの歪曲収差に起因する歪みを補正するために形状を変化させる補正を行い、かつ、形状を変化させた画像に内接する矩形領域に相当する有効画像領域における画像を出力する歪曲補正処理を行う画像処理工程と、
前記画像に対して前記歪曲補正処理を行うことにより形状を変化させた後の前記第1のトリミング領域に内接または外接する第2のトリミング領域を算出する算出工程と、
前記第2のトリミング領域が、前記有効画像領域からはみ出すか否かを判定する判定工程と、
前記判定工程においてはみ出すと判定された場合は、前記第2のトリミング領域の画像が、前記有効画像領域に含まれるように、前記第2のトリミング領域を移動する、および、変倍することの少なくともいずれかを行う変更工程とを備えることを特徴とする画像処理方法。 A setting step of setting a first trimming area that is a target of image trimming according to a user instruction;
After the first trimming area is set, the image is corrected to change its shape in order to correct distortion caused by distortion of a lens used when the image is captured, and An image processing step for performing distortion correction processing for outputting an image in an effective image area corresponding to a rectangular area inscribed in the image whose shape has been changed;
A calculation step of calculating a second trimming area that is inscribed or circumscribed to the first trimming area after the shape is changed by performing the distortion correction processing on the image;
A determination step of determining whether or not the second trimming region protrudes from the effective image region;
If it is determined in the determination step that at least the second trimming area is moved and scaled so that the image of the second trimming area is included in the effective image area An image processing method comprising: a changing step for performing any one of the steps.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007201954A JP4926877B2 (en) | 2007-08-02 | 2007-08-02 | Image processing apparatus and method, and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007201954A JP4926877B2 (en) | 2007-08-02 | 2007-08-02 | Image processing apparatus and method, and program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2009038646A JP2009038646A (en) | 2009-02-19 |
JP4926877B2 true JP4926877B2 (en) | 2012-05-09 |
Family
ID=40440175
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2007201954A Active JP4926877B2 (en) | 2007-08-02 | 2007-08-02 | Image processing apparatus and method, and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4926877B2 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5269914B2 (en) | 2009-01-22 | 2013-08-21 | パナソニック株式会社 | Stereo acoustic signal encoding apparatus, stereo acoustic signal decoding apparatus, and methods thereof |
DE112013000762T5 (en) | 2012-01-31 | 2014-12-11 | Panasonic Corporation | Image processing apparatus and image processing method |
Family Cites Families (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH10261066A (en) * | 1997-03-18 | 1998-09-29 | Fuji Photo Film Co Ltd | Image trimming method |
JP2000106623A (en) * | 1998-07-27 | 2000-04-11 | Fuji Photo Film Co Ltd | Image processing unit |
JP3894050B2 (en) * | 2002-06-05 | 2007-03-14 | ノーリツ鋼機株式会社 | Image processing apparatus, image processing method, image processing program, and recording medium on which image processing program is recorded |
JP2004046632A (en) * | 2002-07-12 | 2004-02-12 | Minolta Co Ltd | Image processor |
JP3888257B2 (en) * | 2002-08-01 | 2007-02-28 | セイコーエプソン株式会社 | Image processing apparatus and image processing method |
JP2005339218A (en) * | 2004-05-27 | 2005-12-08 | Seiko Epson Corp | Image processing apparatus, and method and program thereof |
JP2006129101A (en) * | 2004-10-29 | 2006-05-18 | Casio Comput Co Ltd | Method of trimming image, imaging apparatus, image processing unit and program |
JP2006229455A (en) * | 2005-02-16 | 2006-08-31 | Konica Minolta Photo Imaging Inc | Program and image processing apparatus |
JP2007142639A (en) * | 2005-11-16 | 2007-06-07 | Casio Comput Co Ltd | Imaging apparatus and program therefor |
-
2007
- 2007-08-02 JP JP2007201954A patent/JP4926877B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2009038646A (en) | 2009-02-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR101820349B1 (en) | Picture presentation method and apparatus | |
JP6763417B2 (en) | Electronics | |
JP6044134B2 (en) | Image area dividing apparatus, method, and program according to optimum image size | |
JP4605458B2 (en) | Image processing apparatus and image processing program | |
TWI387935B (en) | Image generation method, program therefor, and storage medium for storing the program | |
JP6682559B2 (en) | Image processing apparatus, image processing method, image processing program, and storage medium | |
EP3048787A1 (en) | Image processing apparatus, image pickup apparatus, image processing method, program, and storage medium | |
US20060227384A1 (en) | Image processing apparatus and image processing program | |
JP5812716B2 (en) | Image processing apparatus and method | |
JP2006270918A (en) | Image correction method, photographing apparatus, image correction apparatus, program and recording medium | |
JP6332951B2 (en) | Image processing apparatus, image processing method, and program | |
US10154241B2 (en) | Depth map based perspective correction in digital photos | |
US20100067749A1 (en) | Image processing apparatus, image processing method, and program | |
JP4926877B2 (en) | Image processing apparatus and method, and program | |
JP2009047498A (en) | Stereoscopic imaging device, control method of stereoscopic imaging device, and program | |
US20230209182A1 (en) | Automatic photography composition recommendation | |
JP2015207090A (en) | Image processor, and control method thereof | |
JP2001250114A (en) | Method and device for image processing and computer- readable recording medium | |
JP5887974B2 (en) | Similar image region search device, similar image region search method, and similar image region search program | |
JP2010074312A (en) | Image processing apparatus and method, and program | |
JP5336798B2 (en) | Image processing apparatus, image processing method, and program | |
JP2014036429A (en) | Subject tracking device and camera | |
JP5176857B2 (en) | Movie editing device | |
JP2008278347A (en) | Image display system | |
JP2009064247A (en) | Program, image processor, and image processing method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20100726 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20111004 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20111012 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20111212 |
|
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: 20120110 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20120208 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20150217 Year of fee payment: 3 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 4926877 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20150217 Year of fee payment: 3 |