【0001】
【発明の属する技術分野】
本発明は画像処理装置に係わり、特に画像を出力画像のアスぺクト比に合わせてトリミングする際に用いるトリミング枠の自動決定方法ができる画像処理装置に関するものである。
【0002】
【従来の技術】
入力画像を出力画像のアスぺクト比に合わせてトリミングする場合、従来のトリミング枠の指定方法では、画像の中心部分を残すように画像の上下若しくは左右を均等に切り取るか、マウス等の座標入力機器を用いてトリミング枠を細かく手動で調整するかのどちらかしかなかった。
【0003】
【発明が解決しようとする課題】
しかし上記のような方法では、均等に切り取る場合においては画像の端に重要な部分が有った時に、その重要な部分が切り取られてしまうことになり、また、マウス等の座標入力機器で調整する場合は操作が煩雑になる上、そのような機器を備えることのできない装置やシステムでは実現が不可能であった。
【0004】
本発明は、以上に点に着目して成されたもので、出力画像とアスぺクト比が違う入力画像を出力画像のアスベクト比に合わせてトリミングする場合において、自動的に主被写体を切り落とさないようなトリミング枠でトリミングをする画像処理装置を提供することを目的とする。
【0005】
【課題を解決するための手段】
上記の問題点を解決するために本発明の請求項1の画像処理装置は、入力画像と出力画像のアスペクト比から入力画像の切り取られる方向を算出し、その方向に合わせたトリミング枠を特開平01−128173号公報や特開平03−154576号公報、特開平05−210739号公報等で知られているような入力画像中の主被写体の位置を認識した結果にしたがって決定する。
【0006】
以上のような処理を行うことによって、自動的に画像中の重要な部分を切り取られることなくトリミングを行うことができる。
【0007】
すなわち、本発明の技術内容は以下の構成を備えることにより前記課題を解決できた。
【0008】
(1)画像データを入力する入力手段と入力手段より入力した画像データの主被写体の位置を画像データから認識する主被写体認識手段と、入力手段より入力した画像データをトリミングするトリミング手段とトリミング手段によってトリミングする枠を自動的に決定するトリミング枠決定手段と、該トリミング枠決定手段によって決定されたトリミング枠に基づいて、前記トリミング手段にてトリミングした画像データを出力する出力手段とを備えた画像処理装置であって、前記トリミング手段は入力画像データと出力手段より出力すべきデータのアスペクト比を演算し、縦、または横の少なくとも一方のトリミングを行うようにトリミングサイズを決定し、トリミングサイズにより決定されるトリミング枠を前記主被写体の認識手段の結果により決定することを特徴とする画像処理装置。
【0009】
(2)前記(1)記載の画像処理装置において、トリミング枠を自動的に決定する方法として認識した主被写体を可能な限り画像の中心に来るように決定することを特徴とする画像処理装置。
【0010】
(3)前記(1)記載の画像処理装置において、主被写体の位置を認識する方法として画像データ中に予め埋め込まれている主被写体位置情報から認識することを特徴とする画像処理装置。
【0011】
(4)前記(1)記載の画像処理装置において、主被写体の位置を認識する方法として画像データのエッジを解析して認識することを特徴とする画像処理装置。
【0012】
(5)前記(4)記載の画像処理装置において、画像データを任意のエリアに分割し、それぞれのエリアにあるエッジ部の統計によって認識をすることを特徴とする画像処理装置。
【0013】
(6)前記(1)記載の画像処理装置において、主被写体の位置を認識する方法として画像データの色情報の偏りを解析して認識する画像処理装置。
【0014】
(7)前記(6)記載の画像処理装置において、画像データ中の特定の範囲にある色情報に重みをつけて、その色情報の統計から認識することを特徴とする画像処理装置。
【0015】
(8)前記(1)記載の画像処理装置において、画像をトリミングする際に画像を変倍することを特徴とする画像処理装置。
【0016】
(9)前記(1)記載の画像処理装置において、デジタルカメラからの入力手段を有することを特徴とする画像処理装置。
【0017】
(10)前記(1)記載の画像処理装置において、スキャナからの入力手段を有することを特徴とする画像処理装置。
【0018】
(11)前記(1)記載の画像処理装置において、汎用的な記録媒体(例えば、フロッピー(R)ディスク、ハードディスク、光ディスク、光磁気ディスク、CD−ROM、CD−R、磁気テープ、不揮発性のメモリーカード)からの入力手段を有することを特徴とする画像処理装置。
【0019】
【発明の実施の形態】
以下、発明の実施の形態を、具体例を用いて詳細に説明する。
【0020】
本実施例における画像処理装置は、デジタルカメラからの入力画像を300dpiでL版と10”×8”のサイズにプリント出力ができる、キー入力のみが可能なデジタルプリントシステムであるとする。また、このときのアスペクト比とは画像の高さ÷幅で算出されるものとする。
【0021】
【実施例】
以下、本発明に係る実施形態について、図面を参照して詳細に説明する。
【0022】
図1に本発明のトリミング枠編集装置を示す。
【0023】
この装置は画像入力及び保持部(102)、画像出力部(103)、パラメータ保持部(104)、アスペクト比算出部(105)、主被写体認識部(106)、トリミング枠算出部(107)、トリミング処理部(108)から構成される。
【0024】
画像入力及び保持部(102)は、画像データ(101)を読み込んでその内容を保持する。
【0025】
アスペクト比算出部(105)は、画像入力及び保持部(102)に格納されている画像のアスペクト比と出力画像のアスペクト比を算出してパラメータ保持部(104)に結果を格納する。
【0026】
パラメータ保持部(104)は、各種パラメータデータを保持している。
【0027】
主被写体認識部(106)は入力画像(101)内の主被写体の位置を認識し、パラメータ保持部(104)に結果を格納する。
【0028】
トリミング枠算出部(107)はパラメータ保持部(104)に保持されている入力画像(101)の主被写体の位置とアスペクト比からトリミング枠を算出し、結果をパラメータ保持部(104)に格納する。
【0029】
トリミング処理部(108)は、パラメータ保持部(104)に格納されているトリミング枠に従って画像入力及び保持部(102)にある画像をトリミングする。
【0030】
画像出力部(103)は画像入力及び保持部(102)に保持されている処理結果を出力する。
【0031】
図2に本発明の実施例における画像処理装置のフローチャートを示す。
【0032】
S201において、画像入力及び保持部(102)から入力画像(101)を読み込み、画像データを保持する。
【0033】
S202において、アスペクト比算出部(105)で、画像入力及び保持部(102)の画像データのアスペクト比と出力画像のアスペクト比を算出し、パラメータ保持部(104)に結果を格納する。
【0034】
S203において、主被写体認識部(106)で、入力画像(101)内の主被写体の位置を認識し、パラメータ保持部(104)に結果を格納する。
【0035】
S204において、トリミング枠算出部(107)で、S202で算出したアスペクト比と、S203で認識した入力画像(101)内の主被写体の位置からトリミング枠を算出し、結果をパラメータ保持部(104)に格納する。
【0036】
S205において、トリミング処理部(108)で、S204で算出したトリミング枠に従って画像を変倍及びトリミングを行い、画像入力及び保持部(102)に結果を書き込む。
【0037】
S206において、画像出力部(103)で、S205で画像入力及び保持部(102)に書き込まれたデータを出力画像(109)として出力する。
【0038】
<トリミング枠算出部(107)>
図3にトリミング枠算出部(107)での動作を示す。
【0039】
S301において、パラメータ保持部(104)に格納されている入力画像のアスペクト比と出力画像のアスペクト比を読み込む。
【0040】
S302において、読み込んだ両者を比較して以下のようにトリミング方法を決定する。
【0041】
入力画像のアスペクト比 < 出力画像のアスペクト比
の場合は、画像の幅が揃うように入力画像が変倍され、高さ方向のはみ出す部分が切り取られる(CASE1)。
【0042】
入力画像のアスペクト比 > 出力画像のアスペクト比
の場合は、画像の高さが揃うように変倍され、幅方向のはみ出す部分が切り取られる(CASE2)。
【0043】
入力画像のアスペクト比 = 出力画像のアスペクト比
の場合トリミングは行われない(CASE3)。
【0044】
例えば2048×1536pixelの入力画像をL版に出力する場合、L版は7”×5”なので、300dpiで出力すると出力画像は1500×1050pixelとなる。したがってアスペクト比は、
入力画像のアスペクト比=2048÷1536≒1.33
出力画像のアスペクト比=1500÷1050=1.50
となり、「入力画像のアスペクト比 < 出力画像のアスペクト比」なので、CASE1に相当することになる。
【0045】
また、2048×1536pixelの入力画像を10”×8”(3000×2400pixel)に出力する場合は
入力画像のアスペクト比=2048÷1536≒1.33
出力画像のアスペクト比=3000÷2400=1.25
となり、「入力画像のアスペクト比 > 出力画像のアスペクト比」なので、CASE2に相当することになる。
【0046】
S303において、パラメータ保持部(104)に格納されている入力画像(101)における主被写体の位置からトリミング枠を決定し、結果をパラメータ保持部(104)に格納する。
【0047】
図4にトリミング枠の例を示す。
【0048】
【発明の効果】
以上説明したように本発明によれば、入力画像と出力画像のアスペクト比が違う場合に、最適なトリミング枠を自動的に設定する事が可能となる。
【図面の簡単な説明】
【図1】本発明に関わる実施例における画像処理装置の構成を示すブロック図である。
【図2】同実施例における画像処理装置の処理を示すフローチャートである。
【図3】同実施例における画像処理装置のトリミング枠算出部(107)での動作の流れを示す図である。
【図4】同実施例における画像処理装置のトリミング枠の例を示す図である。
【符号の説明】
101 入力画像
102 画像入力及び保持部
103 画像出力部
104 パラメータ保持部
105 アスペクト比算出部
106 主被写体認識部
107 トリミングパターン算出部
108 トリミング処理部
109 出力画像
110 画像処理装置[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to an image processing apparatus, and more particularly to an image processing apparatus capable of automatically determining a trimming frame used when trimming an image in accordance with an aspect ratio of an output image.
[0002]
[Prior art]
When trimming an input image according to the aspect ratio of an output image, the conventional method of specifying a trimming frame is to cut the top and bottom or left and right of the image evenly so as to leave the center of the image, or to input coordinates using a mouse or the like. The only option was to finely and manually adjust the trimming frame using a device.
[0003]
[Problems to be solved by the invention]
However, in the above-mentioned method, when there is an important part at the edge of the image when the image is cut out evenly, the important part is cut out, and adjustment is performed with a coordinate input device such as a mouse. In such a case, the operation becomes complicated, and it is impossible to realize such a device or system without such a device.
[0004]
The present invention has been made by paying attention to the above points, and does not automatically cut off the main subject when trimming an input image having an aspect ratio different from that of an output image in accordance with an aspect ratio of an output image. It is an object of the present invention to provide an image processing apparatus that performs trimming in such a trimming frame.
[0005]
[Means for Solving the Problems]
In order to solve the above-mentioned problem, an image processing apparatus according to claim 1 of the present invention calculates a direction in which an input image is cut out from an aspect ratio of an input image and an output image, and sets a trimming frame in accordance with the calculated direction. It is determined according to the result of recognizing the position of the main subject in the input image as known in JP-A-01-128173, JP-A-03-154576, JP-A-05-210739 and the like.
[0006]
By performing the above processing, it is possible to perform trimming without automatically cutting out an important part in the image.
[0007]
That is, the technical contents of the present invention can solve the above problem by providing the following configuration.
[0008]
(1) Input means for inputting image data, main subject recognizing means for recognizing the position of the main subject of the image data input from the input means from the image data, trimming means for trimming the image data input from the input means, and trimming means An image comprising trimming frame determining means for automatically determining a frame to be trimmed by the output means for outputting image data trimmed by the trimming means based on the trimming frame determined by the trimming frame determining means. In the processing device, the trimming means calculates an aspect ratio of input image data and data to be output from the output means, determines a trimming size to perform at least one of vertical and horizontal trimming, and determines a trimming size. The determined trimming frame is linked to the main subject recognition means. The image processing apparatus characterized by determining by.
[0009]
(2) The image processing apparatus according to (1), wherein the recognized main subject is determined so as to be as close to the center of the image as possible as a method for automatically determining the trimming frame.
[0010]
(3) The image processing apparatus according to (1), wherein the position of the main subject is recognized from main subject position information embedded in image data in advance.
[0011]
(4) The image processing apparatus according to (1), wherein the edge of the image data is analyzed and recognized as a method of recognizing the position of the main subject.
[0012]
(5) The image processing apparatus according to (4), wherein the image data is divided into arbitrary areas, and recognition is performed based on statistics of edge portions in each area.
[0013]
(6) The image processing apparatus according to (1), wherein a method of recognizing the position of the main subject is performed by analyzing a bias of color information of image data.
[0014]
(7) The image processing apparatus according to (6), wherein color information in a specific range in the image data is weighted and recognized based on statistics of the color information.
[0015]
(8) The image processing apparatus according to (1), wherein the image is scaled when trimming the image.
[0016]
(9) The image processing apparatus according to (1), further comprising an input unit from a digital camera.
[0017]
(10) The image processing apparatus according to (1), further comprising input means from a scanner.
[0018]
(11) In the image processing apparatus according to (1), a general-purpose recording medium (for example, a floppy (R) disk, hard disk, optical disk, magneto-optical disk, CD-ROM, CD-R, magnetic tape, non-volatile An image processing apparatus comprising an input unit from a memory card.
[0019]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the invention will be described in detail using specific examples.
[0020]
It is assumed that the image processing apparatus according to the present embodiment is a digital print system capable of printing out an input image from a digital camera at 300 dpi in an L size and a size of 10 ″ × 8 ″ and capable of performing only key input. Also, the aspect ratio at this time is calculated as the height / width of the image.
[0021]
【Example】
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
[0022]
FIG. 1 shows a trimming frame editing apparatus according to the present invention.
[0023]
The apparatus includes an image input and storage unit (102), an image output unit (103), a parameter storage unit (104), an aspect ratio calculation unit (105), a main subject recognition unit (106), a trimming frame calculation unit (107), It comprises a trimming processing section (108).
[0024]
The image input / hold unit (102) reads the image data (101) and holds the contents.
[0025]
The aspect ratio calculation unit (105) calculates the aspect ratio of the image stored in the image input and storage unit (102) and the aspect ratio of the output image, and stores the result in the parameter storage unit (104).
[0026]
The parameter holding unit (104) holds various parameter data.
[0027]
The main subject recognition unit (106) recognizes the position of the main subject in the input image (101), and stores the result in the parameter holding unit (104).
[0028]
A trimming frame calculation unit (107) calculates a trimming frame from the position and aspect ratio of the main subject of the input image (101) held in the parameter holding unit (104), and stores the result in the parameter holding unit (104). .
[0029]
The trimming processing unit (108) trims an image in the image input and storage unit (102) according to a trimming frame stored in the parameter storage unit (104).
[0030]
The image output unit (103) outputs the processing result stored in the image input and storage unit (102).
[0031]
FIG. 2 shows a flowchart of the image processing apparatus according to the embodiment of the present invention.
[0032]
In step S201, the input image (101) is read from the image input and storage unit (102), and the image data is stored.
[0033]
In S202, the aspect ratio calculation unit (105) calculates the aspect ratio of the image data and the output image of the image input and storage unit (102), and stores the result in the parameter storage unit (104).
[0034]
In S203, the main subject recognition unit (106) recognizes the position of the main subject in the input image (101), and stores the result in the parameter holding unit (104).
[0035]
In S204, the trimming frame calculation unit (107) calculates a trimming frame from the aspect ratio calculated in S202 and the position of the main subject in the input image (101) recognized in S203, and stores the result in the parameter holding unit (104). To be stored.
[0036]
In S205, the trimming processing unit (108) performs scaling and trimming of the image according to the trimming frame calculated in S204, and writes the result in the image input and storage unit (102).
[0037]
In S206, the image output unit (103) outputs the data written in the image input and storage unit (102) in S205 as an output image (109).
[0038]
<Trimming frame calculation unit (107)>
FIG. 3 shows the operation of the trimming frame calculation unit (107).
[0039]
In step S301, the aspect ratio of the input image and the aspect ratio of the output image stored in the parameter storage unit (104) are read.
[0040]
In step S302, the trimming method is determined as follows by comparing the read data and the read data.
[0041]
When the aspect ratio of the input image is smaller than the aspect ratio of the output image, the input image is scaled so that the width of the image is uniform, and a portion protruding in the height direction is cut out (CASE 1).
[0042]
In the case of the aspect ratio of the input image> the aspect ratio of the output image, the image is scaled so that the height of the image is uniform, and a portion protruding in the width direction is cut out (CASE 2).
[0043]
If the aspect ratio of the input image = the aspect ratio of the output image, no trimming is performed (CASE 3).
[0044]
For example, when an input image of 2048 × 1536 pixels is output to the L plane, since the L plane is 7 ″ × 5 ″, when output at 300 dpi, the output image becomes 1500 × 1050 pixels. Therefore, the aspect ratio is
Aspect ratio of input image = 2048 ÷ 1536 ≒ 1.33
Output image aspect ratio = 1500/1050 = 1.50
Since “the aspect ratio of the input image <the aspect ratio of the output image”, it corresponds to CASE1.
[0045]
When an input image of 2048 × 1536 pixels is output at 10 ″ × 8 ″ (3000 × 2400 pixels), the aspect ratio of the input image = 2048201536 ≒ 1.33.
Output image aspect ratio = 3000/2400 = 1.25
Since “the aspect ratio of the input image> the aspect ratio of the output image”, this corresponds to CASE2.
[0046]
In S303, a trimming frame is determined from the position of the main subject in the input image (101) stored in the parameter storage unit (104), and the result is stored in the parameter storage unit (104).
[0047]
FIG. 4 shows an example of the trimming frame.
[0048]
【The invention's effect】
As described above, according to the present invention, it is possible to automatically set an optimum trimming frame when the aspect ratio of an input image is different from that of an output image.
[Brief description of the drawings]
FIG. 1 is a block diagram illustrating a configuration of an image processing apparatus according to an embodiment of the present invention.
FIG. 2 is a flowchart illustrating processing of the image processing apparatus according to the embodiment.
FIG. 3 is a diagram showing a flow of an operation in a trimming frame calculation unit (107) of the image processing apparatus according to the embodiment.
FIG. 4 is a diagram illustrating an example of a trimming frame of the image processing apparatus according to the embodiment.
[Explanation of symbols]
101 input image 102 image input and storage unit 103 image output unit 104 parameter storage unit 105 aspect ratio calculation unit 106 main subject recognition unit 107 trimming pattern calculation unit 108 trimming processing unit 109 output image 110 image processing device