JP2005267454A - Image trimming device and method - Google Patents

Image trimming device and method Download PDF

Info

Publication number
JP2005267454A
JP2005267454A JP2004081530A JP2004081530A JP2005267454A JP 2005267454 A JP2005267454 A JP 2005267454A JP 2004081530 A JP2004081530 A JP 2004081530A JP 2004081530 A JP2004081530 A JP 2004081530A JP 2005267454 A JP2005267454 A JP 2005267454A
Authority
JP
Japan
Prior art keywords
image
trimming
face
face area
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.)
Granted
Application number
JP2004081530A
Other languages
Japanese (ja)
Other versions
JP4513369B2 (en
Inventor
Takashi Tani
宇 谷
Hitoshi Yamakado
均 山門
Toru Miyamoto
徹 宮本
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2004081530A priority Critical patent/JP4513369B2/en
Publication of JP2005267454A publication Critical patent/JP2005267454A/en
Application granted granted Critical
Publication of JP4513369B2 publication Critical patent/JP4513369B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Image Processing (AREA)
  • Editing Of Facsimile Originals (AREA)
  • Image Analysis (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide an image trimming device capable of automatically and properly trimming a portrait. <P>SOLUTION: This trimming device for photographic image including portrait comprises a face and person area specification means 14 detecting the face of a person from a photographic image and calculating a face area including all the detected face; a means 13 for setting a predetermined ratio for face position, which sets the vertical and horizontal positions of the face area in the photographic image after trimming; and a trimming means 16 for trimming the photographic image so that the face area is located in the set vertical and horizontal positions. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は、人物写真を含む写真画像に対して人物の顔が適正な位置に置かれるようにトリミング処理を行う際に用いて好適な画像トリミング装置及び方法に関する。   The present invention relates to an image trimming apparatus and method suitable for use in performing trimming processing so that a human face is placed at an appropriate position on a photographic image including a human photograph.

デジタルカメラなどで撮影した電子写真を所定の画像解像度(画像の縦横サイズ)にあわせ、適宜にトリミングして、電子アルバムにまとめることが行われている。電子写真のトリミングは、手作業で行うのが一般的である。   An electronic photograph taken with a digital camera or the like is appropriately trimmed in accordance with a predetermined image resolution (vertical and horizontal size of the image) and collected into an electronic album. The electrophotographic trimming is generally performed manually.

これに関する従来技術の一例として、特許文献1に記載されている方法がある。この方法では、パソコンなど写真編集機器のディスプレイに表示されているトリミング枠に、電子写真から切り出したい部分を重ねあわせるように、電子写真をマウスでドラッギングする。編集者が所望する画像領域をトリミング枠内に入れることで、電子写真のトリミング範囲が決定される。
特開平10−261066号公報
As an example of the related art regarding this, there is a method described in Patent Document 1. In this method, an electronic photograph is dragged with a mouse so that a portion to be cut out from the electronic photograph is superimposed on a trimming frame displayed on a display of a photo editing apparatus such as a personal computer. The trimming range of the electrophotographic image is determined by placing an image area desired by the editor in the trimming frame.
JP-A-10-261066

しかしながら、上記の方法では、写真内のトリミング範囲を決定するのに、編集者が手作業を行わなければならない煩わしさがある。これは、人物写真からなる写真アルバムを自動的に生成する等のアプリケーションにとっては障害となる。   However, in the above method, there is an inconvenience that the editor has to perform manual work to determine the trimming range in the photograph. This is an obstacle for applications such as automatically generating a photo album consisting of portraits.

本発明は、従来例の問題点を鑑み、人物写真を含む写真画像に対する画像処理操作の簡単化を図ることを目的とするものであって、人物写真を自動的且つ適切にトリミングすることができる画像トリミング装置及び方法を提供することを目的とする。   SUMMARY OF THE INVENTION In view of the problems of the conventional example, the present invention aims to simplify the image processing operation for a photographic image including a human photograph, and can automatically and appropriately trim a human photograph. An object of the present invention is to provide an image trimming apparatus and method.

上記課題を解決するため、本発明は、人物画像を含む写真画像のトリミング装置であって、写真画像から人物の顔を検出し、検出されたすべての顔を含む顔領域を算出する顔領域算出手段と、トリミング後の写真画像における顔領域の垂直及び水平方向の位置を設定する画像位置設定手段と、前記顔領域算出手段が算出した顔領域が前記画像位置設定手段で設定した垂直及び水平方向の位置に置かれるように写真画像をトリミングするトリミング手段とを備えることを特徴とする。   In order to solve the above-described problems, the present invention is a photographic image trimming apparatus including a person image, which detects a human face from a photographic image and calculates a face area including all detected faces. Means, image position setting means for setting the vertical and horizontal positions of the face area in the cropped photographic image, and the vertical and horizontal directions set by the image position setting means for the face area calculated by the face area calculation means Trimming means for trimming a photographic image so as to be placed at the position.

上記構成によれば、トリミング手段によって、顔領域算出手段が算出した顔領域が画像位置設定手段で設定した垂直及び水平方向の位置に置かれるように写真画像がトリミングされる。すなわち、本発明によれば、写真画像における顔の位置に合わせてトリミングが行われるので、人物写真のトリミングを適切に、人手によらず、自動的に行うことができる。   According to the above configuration, the photographic image is trimmed by the trimming means so that the face area calculated by the face area calculating means is placed at the vertical and horizontal positions set by the image position setting means. In other words, according to the present invention, trimming is performed in accordance with the position of the face in the photographic image, so that it is possible to automatically perform trimming of a human photograph appropriately and not manually.

本発明は、前記トリミング手段が、顔領域の中心点がトリミング後画像の垂直方向における黄金分割点に位置し、且つ、水平方向における中央点に位置するように、写真画像をトリミングすることを特徴とする。これによれば、トリミング後の写真画像における人物の顔の位置を水平及び垂直方向においてバランス良く配置することができる。   The present invention is characterized in that the trimming means trims a photographic image so that the center point of the face region is located at the golden division point in the vertical direction of the image after trimming and at the center point in the horizontal direction. And According to this, it is possible to arrange the positions of human faces in the photographic image after trimming with good balance in the horizontal and vertical directions.

本発明は、前記顔領域算出手段の算出結果に基づいて人物がすべて含まれるであろう人物領域を特定する人物領域特定手段をさらに備え、前記トリミング手段が、前記人物領域推定手段が特定した人物領域がトリミング後の写真画像にすべて含まれるように写真画像をトリミングすることを特徴とする。これによれば、トリミング後の写真画像における人物の顔及び人物全体位置をバランス良く配置することができる。   The present invention further includes person area specifying means for specifying a person area that will include all persons based on the calculation result of the face area calculating means, wherein the trimming means is the person specified by the person area estimating means. The photographic image is trimmed so that the region is entirely included in the trimmed photographic image. According to this, the face of the person and the entire position of the person in the photographic image after trimming can be arranged with good balance.

また、本発明の他の形態は、人物画像を含む写真画像のトリミング方法であって、写真画像から人物の顔を検出し、検出されたすべての顔を含む顔領域を算出する顔領域算出過程と、トリミング後の写真画像における顔領域の垂直及び水平方向の位置を設定する画像位置設定過程と、前記顔領域算出過程で算出した顔領域が前記画像位置設定過程で設定した垂直及び水平方向の位置に置かれるように写真画像をトリミングするトリミング過程とを含んでいることを特徴とする。   According to another aspect of the present invention, there is provided a method for trimming a photographic image including a person image, wherein a face area calculation process for detecting a human face from a photographic image and calculating a face area including all detected faces is provided. An image position setting process for setting the vertical and horizontal positions of the face area in the cropped photographic image, and the face area calculated in the face area calculation process in the vertical and horizontal directions set in the image position setting process. And a trimming process for trimming the photographic image to be placed in position.

また、本発明のさらに他の形態は、人物画像を含む写真画像をトリミングするためのプログラムであって、写真画像から人物の顔を検出し、検出されたすべての顔を含む顔領域を算出する顔領域算出過程と、トリミング後の写真画像における顔領域の垂直及び水平方向の位置を設定する画像位置設定過程と、前記顔領域算出過程で算出した顔領域が前記画像位置設定過程で設定した垂直及び水平方向の位置に置かれるように写真画像をトリミングするトリミング過程とをコンピュータによって実行するための記述を含んでいることを特徴とする。   According to still another aspect of the present invention, there is provided a program for trimming a photographic image including a person image, detecting a human face from the photographic image, and calculating a face area including all detected faces. A face area calculation process, an image position setting process for setting the vertical and horizontal positions of the face area in the cropped photographic image, and the face area calculated in the face area calculation process is set in the image position setting process. And a description for performing by a computer a trimming process for trimming a photographic image to be placed in a horizontal position.

以下、図面を参照して本発明による画像トリミング装置の実施の形態について説明する。本実施の形態は、パーソナルコンピュータ、携帯電話端末、デジタルカメラ、個人情報端末を構成するコンピュータおよび周辺装置と、コンピュータで実行されるプログラムとから構成される。画像処理対象の写真画像データは、デジタルカメラ等で撮影され、所定の記録媒体や、通信回線を介して、本実施の形態を構成する情報機器に入力され、所定の記憶装置に記憶されているものとする。   Embodiments of an image trimming apparatus according to the present invention will be described below with reference to the drawings. The present embodiment includes a personal computer, a mobile phone terminal, a digital camera, a computer and peripheral devices constituting the personal information terminal, and a program executed by the computer. Photo image data subject to image processing is taken by a digital camera or the like, input to an information device constituting this embodiment via a predetermined recording medium or a communication line, and stored in a predetermined storage device. Shall.

図1に示す本実施の形態の構成を機能毎にブロック分けして示すブロック図と、図2に示す本実施の形態の処理の流れを示すフローチャートを参照して、本実施の形態の構成および動作について説明する。   With reference to the block diagram showing the configuration of the present embodiment shown in FIG. 1 divided into blocks for each function and the flowchart showing the flow of processing of the present embodiment shown in FIG. 2, the configuration of the present embodiment and The operation will be described.

人物写真の画像入力手段11は、ユーザーの所定の操作に応じて処理対象となる写真画像データを入力する(図2のステップS10)。所望画像解像度の入力手段12は、トリミング後の出力画像の縦横サイズを入力する(図2のステップS11)。単位は画素である。本実施の形態を利用あるいは構成するアプリケーションプログラムのユーザインターフェースまたはその他の方法を用いて、ユーザーの指示に従って、あるいは所定の出力形式に対応する様に予め定められた定義に従って、画像処理前(トリミング処理)前に設定される。   The person photograph image input means 11 inputs photograph image data to be processed in accordance with a predetermined operation of the user (step S10 in FIG. 2). The input means 12 for the desired image resolution inputs the vertical and horizontal sizes of the output image after trimming (step S11 in FIG. 2). The unit is a pixel. Before image processing (trimming processing) in accordance with a user instruction or a predetermined definition so as to correspond to a predetermined output format using a user interface or other method of an application program that uses or constitutes the present embodiment ) Set before.

本実施の形態は、写真画像のトリミング機能を提供するものである。すなわち、写真画像から人物の顔(または全体)の周囲の不要な部分を省いて出力画像を作成するものである。したがって、本実施の形態では、写真解像度(入力画像サイズ)が所望画像解像度(出力画像サイズ)よりも小さい場合には処理を終了するようにしている(図2のステップS12で「いいえ」)。   The present embodiment provides a photographic image trimming function. That is, an output image is created by omitting unnecessary portions around a person's face (or the whole) from a photographic image. Therefore, in the present embodiment, the process is terminated when the photo resolution (input image size) is smaller than the desired image resolution (output image size) (“No” in step S12 in FIG. 2).

顔位置に関する所定比率の設定手段13は、出力画像における顔領域の位置に関する所定比率を、予め決められた値から設定したり、あるいはユーザーの操作に応じて設定する(図2のステップS13)。顔領域とは、人物領域のうち顔(または頭)が占める領域であって、複数の人物が撮影された写真画像においてはすべての人物の顔領域を網羅する領域が顔領域となる。すなわち、検出された1または複数の人物の顔の外接矩形が、顔領域である。顔位置に関する所定比率の設定手段13は、出力画像の垂直方向上における顔領域の位置を指定する。具体的には、出力画像の上端から顔領域の中心点までの長さと、顔領域の中心点から出力画像の下端までの長さの比率で設定する。   The predetermined ratio setting means 13 for the face position sets a predetermined ratio for the position of the face area in the output image from a predetermined value or according to a user operation (step S13 in FIG. 2). The face area is an area occupied by the face (or head) of the person area. In a photographic image in which a plurality of persons are photographed, an area that covers the face areas of all persons is the face area. That is, a circumscribed rectangle of the detected face of one or more persons is a face area. The predetermined ratio setting means 13 for the face position designates the position of the face area in the vertical direction of the output image. Specifically, it is set by the ratio of the length from the upper end of the output image to the center point of the face area and the length from the center point of the face area to the lower end of the output image.

図3は、写真画像1、出力画像(トリミング後写真画像)2等の関係の一例を示す図である。図3に示す例では、3人の人物の顔5が写真画像1に含まれていて、それらの外接矩形4が顔領域となる。人物領域3は、人物の顔5の大きさや向きに応じて、人物の全体像が含まれるであろうと推定された領域である。そして、図3の例では、顔位置に関する所定比率の設定手段13で設定された顔位置に関する比率が、顔領域4の垂直方向の位置の出力画像2の垂直方向の高さhに対する割合(38.2%/61.8%)で設定されている。この比率は、本実施の形態を利用あるいは構成するアプリケーションプログラムのユーザインターフェースまたはその他の方法で予め設定されるものであり、トリミング処理をする前に取得される。本実施の形態では、この比率が0.382:0.618で決まる、黄金分割点に設定されている。この黄金分割点は、黄金比(1+√5)/2で決定される分割点である。この場合、顔領域4の中心点Cが、出力画像2の垂直方向上の黄金分割点に当たる。   FIG. 3 is a diagram illustrating an example of the relationship between the photographic image 1, the output image (trimmed photographic image) 2, and the like. In the example shown in FIG. 3, the faces 5 of three persons are included in the photographic image 1, and their circumscribed rectangles 4 are the face areas. The person area 3 is an area that is estimated to contain the whole image of the person according to the size and orientation of the face 5 of the person. In the example of FIG. 3, the ratio relating to the face position set by the setting means 13 for the predetermined ratio relating to the face position is the ratio of the vertical position of the face area 4 to the height h in the vertical direction of the output image 2 (38 .2% / 61.8%). This ratio is set in advance by the user interface of an application program that uses or configures the present embodiment or other methods, and is acquired before the trimming process. In this embodiment, this ratio is set to the golden division point determined by 0.382: 0.618. This golden dividing point is a dividing point determined by the golden ratio (1 + √5) / 2. In this case, the center point C of the face area 4 corresponds to the golden division point in the vertical direction of the output image 2.

顔および人物領域の特定手段14は、顔5の検出および顔領域4の計算を行うとともに(図2のステップS14)、顔領域4の検出結果に基づいて人物領域3を特定(推定)する処理を行う(図2のステップS15)。   The face and person area specifying means 14 performs processing for detecting the face 5 and calculating the face area 4 (step S14 in FIG. 2) and specifying (estimating) the person area 3 based on the detection result of the face area 4. (Step S15 in FIG. 2).

顔5の検出は、例えば肌色領域の検出結果に基づいて行う。顔検出は、写真画像1中に含まれる1または複数人分のすべての顔の検出を、単一の顔5の検出を繰り返すことで実現する。単一の顔5の検出は、顔肌色領域の検出と、この顔肌色領域と顔パターンテンプレートとの照合の二つのステップで実現される。顔の候補となる肌色領域の検出方法としては、よく用いられるHSV色空間での検出方法がある。これは、肌色画素のH成分(色相)とS成分(彩度)がHSV色空間のH−S平面上において一定範囲内に収束している特徴を利用する検出方法である。ここでVは明度である。具体的には、RGB(Red Green Blue)形式等で表された入力画像をHSV表色系に変換して、HSV色空間にて肌色画素を検出する。そして、隣接する肌色画素同士を連結することで、肌色領域を形成して行く。   The face 5 is detected based on the detection result of the skin color area, for example. The face detection is realized by repeating the detection of a single face 5 to detect all faces of one or more persons included in the photographic image 1. The detection of a single face 5 is realized in two steps: detection of a face skin color area and comparison between the face skin color area and a face pattern template. As a method for detecting a skin color region that is a candidate for a face, there is a commonly used detection method in the HSV color space. This is a detection method that uses the feature that the H component (hue) and S component (saturation) of the skin color pixel converge within a certain range on the HS plane of the HSV color space. Here, V is lightness. Specifically, an input image expressed in RGB (Red Green Blue) format or the like is converted into an HSV color system, and skin color pixels are detected in the HSV color space. And a flesh-color area | region is formed by connecting adjacent flesh-color pixels.

次に、検出された肌色領域が顔領域かどうかを判定する。事前に用意された向き別の複数の顔パターンと照合することで、判定を行う。具体的には、まず、肌色画素同士を連結することで検出された顔の候補領域を顔パターンの寸法にあわせるように拡大/縮小したうえ、顔パターンとの相関度を求める。そして、顔パターンのうちのいずれかの相関度が予め決められた閾値以上の相関度を持つ顔の候補領域を顔5の画像であると判定する。   Next, it is determined whether the detected skin color area is a face area. Judgment is performed by collating with a plurality of face patterns for different orientations prepared in advance. Specifically, first, the face candidate area detected by connecting the skin color pixels is enlarged / reduced to match the size of the face pattern, and the correlation with the face pattern is obtained. Then, it determines that a face candidate region having a correlation degree equal to or greater than a predetermined threshold value among the face patterns is an image of the face 5.

顔領域4の計算に関しては、1または複数の顔5の検出結果に基づいて、それを網羅するように、例えば外接矩形として算出する。すなわち、写真画像1から検出された顔5の数によって、写真画像1から一人しか検出されない場合では、顔領域4はその人物の顔5を外接する矩形とする。他方、写真画像1に複数の人物(顔)5がいる(ある)場合では、顔領域4は、検出された顔5すべてを網羅する最小矩形とする。   Regarding the calculation of the face region 4, based on the detection result of one or more faces 5, for example, it is calculated as a circumscribed rectangle. That is, when only one person is detected from the photographic image 1 due to the number of faces 5 detected from the photographic image 1, the face area 4 is a rectangle that circumscribes the person's face 5. On the other hand, when there are a plurality of persons (faces) 5 in the photographic image 1, the face area 4 is a minimum rectangle that covers all the detected faces 5.

次に、人物領域3の特定は、顔領域4の算出結果に基づいて行われる。すなわち、顔領域4の中から、顔領域4の増分値となる基準顔(複数の顔5の1つ)を求めて、顔領域4を上下左右の4方向にそれぞれ、予め決められた基準顔5bの個数分で増分する。そして、増分された領域を人物領域3とする基準顔5bは、例えば、顔領域4のうち、最大面積を持つ顔5を基準顔とする。基準顔5bの個数は、例えば平均的な身長と顔の長さとの比率等に応じて決定する。   Next, the person area 3 is specified based on the calculation result of the face area 4. That is, a reference face (one of a plurality of faces 5) that is an increment value of the face area 4 is obtained from the face area 4, and the face area 4 is determined in advance in four directions, up, down, left, and right. Increment by the number of 5b. The reference face 5b having the incremented area as the person area 3 is, for example, the face 5 having the largest area in the face area 4 as the reference face. The number of reference faces 5b is determined according to, for example, the ratio of average height to face length.

顔および人物領域の特定手段14は、さらに人物領域3の大きさが出力画像2の大きさよりも大きい場合には(図2のステップS16で「はい」)、顔領域2と人物領域3を縮小する処理を行う(図2のステップS17)。図3は、人物領域3が出力画像2よりも小さい場合を示し、図4が人物領域3が出力画像2よりも大きい場合を示し、そして図5が顔領域2と人物領域3を縮小した後の人物領域3等を示している。   The face and person area specifying means 14 further reduces the face area 2 and the person area 3 when the size of the person area 3 is larger than the size of the output image 2 (“Yes” in step S16 in FIG. 2). Is performed (step S17 in FIG. 2). 3 shows the case where the person area 3 is smaller than the output image 2, FIG. 4 shows the case where the person area 3 is larger than the output image 2, and FIG. 5 shows the face area 2 and the person area 3 after being reduced. The person area 3 of FIG.

次に図1のトリミング手段15は、トリミング領域の計算を行う(図2のステップS18)。図3を参照して、トリミング処理の内容について説明する。ただし、処理対象の写真画像1に対しては、図2のステップS16およびS17の処理によって、顔および人物領域の特定手段14から渡される画像データにおいて人物領域3が出力画像2よりも小さくなるように調整されているものとする。   Next, the trimming means 15 in FIG. 1 calculates a trimming area (step S18 in FIG. 2). The contents of the trimming process will be described with reference to FIG. However, for the photographic image 1 to be processed, the person area 3 is smaller than the output image 2 in the image data passed from the face and person area specifying means 14 by the processing in steps S16 and S17 of FIG. It shall be adjusted to.

図3は、並んでいる3人が写っている写真を表している。上述したように、網掛けした三つの丸は、3人の顔5を表し、これらを外接する矩形が顔領域4である。この顔領域4を囲む破線矩形は人物領域3を表す。人物領域3を囲む矩形は所望の画像解像度であり、即ち、トリミング領域(出力画像)2である。   FIG. 3 shows a photograph showing three people in a line. As described above, the three shaded circles represent the three faces 5, and the rectangle that circumscribes them is the face area 4. A broken-line rectangle surrounding the face area 4 represents the person area 3. A rectangle surrounding the person area 3 has a desired image resolution, that is, a trimming area (output image) 2.

図3に示された諸寸法の内、WとH及びwとhは、それぞれ、入力画像(写真画像)1及び所望の出力画像(トリミング領域)2の解像度(縦横の画素数)であり、トリミングする前に入力された既知値である。xとyは、特定された人物領域3の縦横サイズであり、顔および人物領域の特定手段14から得た結果である。vとuは、それぞれ、顔領域4の中心点から人物領域3の上端と下端までの長さであり、顔検出および人物領域の特定手段14から得た結果。y1は、人物領域3の上端からトリミング領域2の上端までの長さであり、y2は人物領域3の下端からトリミング領域2の下端までの長さである。   Of the dimensions shown in FIG. 3, W and H, and w and h are the resolution (number of pixels in the vertical and horizontal directions) of the input image (photo image) 1 and the desired output image (trimming area) 2, respectively. It is a known value input before trimming. x and y are the vertical and horizontal sizes of the specified person area 3, and are the results obtained from the face and person area specifying means 14. v and u are the lengths from the center point of the face area 4 to the upper end and lower end of the person area 3, respectively, and the results obtained from the face detection and person area specifying means 14. y1 is the length from the upper end of the person area 3 to the upper end of the trimming area 2, and y2 is the length from the lower end of the person area 3 to the lower end of the trimming area 2.

顔領域4の中心点を指定された比率の位置に置くようにトリミングするには、y1とy2を計算する必要がある。図3から、u、v、y、y1、y2、hの諸量の間では、次の式[1]、[2]、[3]からなる連立方程式が成り立つ。   In order to perform trimming so that the center point of the face area 4 is placed at a specified ratio, it is necessary to calculate y1 and y2. From FIG. 3, among the various quantities u, v, y, y1, y2, and h, the simultaneous equations consisting of the following equations [1], [2], and [3] hold.

Figure 2005267454
Figure 2005267454

ここでは、k(=0.618)は所定比率を記述するための定数である。この連立式を解くと、次に示される、y1とy2の計算式を得られる:   Here, k (= 0.618) is a constant for describing the predetermined ratio. Solving this simultaneous equation yields the following equations for y1 and y2:

Figure 2005267454
Figure 2005267454

また、水平方向においては、x1=x2=(w−x)/2で計算する。上記のy1とy2の計算式を利用することにより、トリミング領域(出力画像)2を計算できる。   In the horizontal direction, calculation is performed using x1 = x2 = (w−x) / 2. The trimming area (output image) 2 can be calculated by using the calculation formulas of y1 and y2.

そして、図1のトリミングした画像の出力手段16は、トリミング領域(出力画像)2を所定の出力先(あるいは記録先)に出力する(図2のステップS19)。   Then, the trimmed image output means 16 in FIG. 1 outputs the trimming area (output image) 2 to a predetermined output destination (or recording destination) (step S19 in FIG. 2).

次に、図2のステップS17で、画像を縮小し、顔領域と人物領域を再計算する処理について説明する。人物領域の特定処理で得た領域が、縦横のいずれかの方向で所望の画像解像度よりも大きい場合は、入力画像1に対して縮小操作を行い、人物領域3を所望の画像2の解像度以下で、かつ、顔領域4の中心点が出力画像2の縦方向上の黄金分割点に位置するようにy1とy2を計算する。図4および図5ならびに図6を参照して、縮小する際に行う計算例について説明する。   Next, a process for reducing the image and recalculating the face area and the person area in step S17 of FIG. 2 will be described. When the area obtained by the person area specifying process is larger than the desired image resolution in either the vertical or horizontal direction, a reduction operation is performed on the input image 1 so that the human area 3 is equal to or lower than the resolution of the desired image 2. And y1 and y2 are calculated so that the center point of the face region 4 is positioned at the golden division point in the vertical direction of the output image 2. With reference to FIG. 4, FIG. 5, and FIG.

図4は縮小前の図である。図4は人物領域3の縦方向の長さがトリミング領域2のそれより長い例を示している。図5は縮小後の図である。縮小前の図4に示された場合での垂直方向におけるy1とy2を計算は、次のように行う。   FIG. 4 is a diagram before reduction. FIG. 4 shows an example in which the length of the person area 3 in the vertical direction is longer than that of the trimming area 2. FIG. 5 is a diagram after reduction. Calculation of y1 and y2 in the vertical direction in the case shown in FIG. 4 before reduction is performed as follows.

(a)人物領域3の縦方向の長さとトリミング領域のそれとの比で写真全体(写真画像1全体)を縮小する。縮小後の人物領域3の横方向の長さx0はx*(h/y)であり、 縦方向の長さy’はhである(図6のステップS20)。 (A) The entire photograph (the entire photograph image 1) is reduced by the ratio of the length in the vertical direction of the person area 3 to that of the trimming area. The length x0 in the horizontal direction of the reduced human area 3 is x * (h / y), and the length y ′ in the vertical direction is h (step S20 in FIG. 6).

(b)顔領域4の中心点がトリミング領域2の黄金分割点に位置すれば(即ち、「v0/u0=K」が成立すれば(図6のステップS21で「はい」)、計算が終了する。 (B) If the center point of the face area 4 is located at the golden division point of the trimming area 2 (that is, if “v0 / u0 = K” is satisfied (“Yes” in step S21 in FIG. 6), the calculation is completed. To do.

(c)顔領域4の中心点がトリミング領域2の黄金分割点に位置しなければ(図6のステップS21で「いいえ」)、y’を2画素減分して、x’(=x0*y’/h)と、u’(= u0*y’/h)及びv’(=v0*y’/h)を再計算する(図6のステップS22)。そして、y1とy2を上記で示された式で算出する(図6のステップS23)。 (C) If the center point of the face area 4 is not located at the golden division point of the trimming area 2 (“No” in step S21 in FIG. 6), y ′ is decremented by 2 pixels and x ′ (= x0 *) y ′ / h), u ′ (= u0 * y ′ / h) and v ′ (= v0 * y ′ / h) are recalculated (step S22 in FIG. 6). Then, y1 and y2 are calculated by the formula shown above (step S23 in FIG. 6).

(d)(v’+y1)と(u’+y2)との比が黄金分割比であれば、計算が終了する(図6のステップS24で「はい」)。でなければ、(c)の再計算を適切なy1とy2が見つかるまでに繰り返す(図6のステップS24で「いいえ」からステップS22)。 (D) If the ratio of (v ′ + y1) to (u ′ + y2) is the golden division ratio, the calculation ends (“Yes” in step S24 in FIG. 6). Otherwise, the recalculation in (c) is repeated until appropriate y1 and y2 are found (from “No” in step S24 in FIG. 6 to step S22).

上述したように、本実施の形態では、画像解像度がトリミング領域2より大きい人物写真画像1をトリミングするにあたって、写真画像1から顔5を検出して、人物領域3を特定した上で、顔領域4をトリミング領域2の縦方向の黄金分割点、且つ横方向の中央点に位置するようにトリミングするようにした。これによって従来の方法と比べ、人物写真のバランスの良いトリミングを人手によらず、自動的に行うことができるようになった。   As described above, in the present embodiment, when trimming a human photographic image 1 whose image resolution is higher than the trimming area 2, the face 5 is detected from the photographic image 1 and the person area 3 is specified. 4 is trimmed so that it is located at the golden dividing point in the vertical direction of the trimming region 2 and at the central point in the horizontal direction. As a result, compared to the conventional method, it is possible to automatically perform trimming with a better balance of a human photograph without human intervention.

なお、本発明の実施の形態は、上記のものに限定されず、各処理過程を統合したり、分散したり、各処理過程を実行するためのハードウェアを統合、分割あるいは分散したりすることができる。また、本発明の実施の形態を構成するプログラムは、コンピュータ読み取り可能な記録媒体または通信回線を介して頒布することができる。   The embodiment of the present invention is not limited to the above-described one, and the processing steps are integrated or distributed, and the hardware for executing the processing steps is integrated, divided, or distributed. Can do. Moreover, the program which comprises embodiment of this invention can be distributed via a computer-readable recording medium or a communication line.

本発明の実施の形態を説明するためのブロック図。The block diagram for demonstrating embodiment of this invention. 図1の実施の形態の処理を説明するためのフローチャート。The flowchart for demonstrating the process of embodiment of FIG. 図1の実施の形態を説明するための写真画像1を示す説明図。Explanatory drawing which shows the photograph image 1 for demonstrating embodiment of FIG. 図1の実施の形態を説明するための写真画像1を示す他の説明図。The other explanatory view which shows the photograph image 1 for demonstrating embodiment of FIG. 図1の実施の形態を説明するための写真画像1を示す他の説明図。The other explanatory view which shows the photograph image 1 for demonstrating embodiment of FIG. 図2のステップS17を説明するためのフローチャート。The flowchart for demonstrating step S17 of FIG.

符号の説明Explanation of symbols

1 写真画像、2 出力画像(トリミング領域)、3 人物領域、4 顔領域、5 顔、11 人物写真の画像入力手段、12 所望画像解像度の入力手段、13 顔位置に関する所定比率の設定手段、14 顔および人物領域の特定手段、15 トリミング手段、16 トリミングした画像の出力手段
1 photographic image, 2 output image (trimming area), 3 person area, 4 face area, 5 face, 11 human photograph image input means, 12 desired image resolution input means, 13 predetermined ratio setting means for face position, 14 Face and person area specifying means, 15 trimming means, 16 trimmed image output means

Claims (5)

人物画像を含む写真画像のトリミング装置であって、
写真画像から人物の顔を検出し、検出されたすべての顔を含む顔領域を算出する顔領域算出手段と、
トリミング後の写真画像における顔領域の垂直及び水平方向の位置を設定する画像位置設定手段と、
前記顔領域算出手段が算出した顔領域が前記画像位置設定手段で設定した垂直及び水平方向の位置に置かれるように写真画像をトリミングするトリミング手段と
を備えることを特徴とする画像トリミング装置。
A trimming device for a photographic image including a person image,
A face area calculating means for detecting a human face from a photographic image and calculating a face area including all the detected faces;
Image position setting means for setting the vertical and horizontal position of the face area in the cropped photographic image;
An image trimming apparatus comprising: trimming means for trimming a photographic image so that the face area calculated by the face area calculating means is placed at a vertical and horizontal position set by the image position setting means.
前記トリミング手段が、顔領域の中心点がトリミング後画像の垂直方向における黄金分割点に位置し、且つ、水平方向における中央点に位置するように、写真画像をトリミングすることを特徴とする請求項1記載の画像トリミング装置。   The trimming means trims a photographic image so that a center point of a face region is located at a golden division point in a vertical direction of the image after trimming and a central point in a horizontal direction. The image trimming apparatus according to 1. 前記顔領域算出手段の算出結果に基づいて人物がすべて含まれるであろう人物領域を特定する人物領域特定手段をさらに備え、
前記トリミング手段が、前記人物領域推定手段が特定した人物領域がトリミング後の写真画像にすべて含まれるように写真画像をトリミングする
ことを特徴とする請求項1又は2記載の画像トリミング装置。
Further comprising a person area specifying means for specifying a person area that would include all persons based on the calculation result of the face area calculating means;
The image trimming apparatus according to claim 1, wherein the trimming unit trims a photographic image so that the person region specified by the person region estimation unit is included in the trimmed photographic image.
人物画像を含む写真画像のトリミング方法であって、
写真画像から人物の顔を検出し、検出されたすべての顔を含む顔領域を算出する顔領域算出過程と、
トリミング後の写真画像における顔領域の垂直及び水平方向の位置を設定する画像位置設定過程と、
前記顔領域算出過程で算出した顔領域が前記画像位置設定過程で設定した垂直及び水平方向の位置に置かれるように写真画像をトリミングするトリミング過程と
を含んでいることを特徴とする画像トリミング方法。
A method for trimming a photographic image including a person image,
A face area calculation process for detecting a human face from a photographic image and calculating a face area including all detected faces;
An image position setting process for setting the vertical and horizontal position of the face area in the cropped photographic image;
A trimming process for trimming a photographic image so that the face area calculated in the face area calculation process is placed at the vertical and horizontal positions set in the image position setting process. .
人物画像を含む写真画像をトリミングするためのプログラムであって、
写真画像から人物の顔を検出し、検出されたすべての顔を含む顔領域を算出する顔領域算出過程と、
トリミング後の写真画像における顔領域の垂直及び水平方向の位置を設定する画像位置設定過程と、
前記顔領域算出過程で算出した顔領域が前記画像位置設定過程で設定した垂直及び水平方向の位置に置かれるように写真画像をトリミングするトリミング過程と
をコンピュータによって実行するための記述を含んでいることを特徴とする画像トリミングプログラム。
A program for trimming a photographic image including a person image,
A face area calculation process for detecting a human face from a photographic image and calculating a face area including all detected faces;
An image position setting process for setting the vertical and horizontal position of the face area in the cropped photographic image;
And a trimming process for trimming a photographic image so that the face area calculated in the face area calculation process is placed at the vertical and horizontal positions set in the image position setting process. An image trimming program characterized by that.
JP2004081530A 2004-03-19 2004-03-19 Image trimming apparatus and method Expired - Fee Related JP4513369B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004081530A JP4513369B2 (en) 2004-03-19 2004-03-19 Image trimming apparatus and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004081530A JP4513369B2 (en) 2004-03-19 2004-03-19 Image trimming apparatus and method

Publications (2)

Publication Number Publication Date
JP2005267454A true JP2005267454A (en) 2005-09-29
JP4513369B2 JP4513369B2 (en) 2010-07-28

Family

ID=35091918

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004081530A Expired - Fee Related JP4513369B2 (en) 2004-03-19 2004-03-19 Image trimming apparatus and method

Country Status (1)

Country Link
JP (1) JP4513369B2 (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008065793A (en) * 2006-09-11 2008-03-21 Sony Corp Image processing apparatus and method, and program
JP2008225720A (en) * 2007-03-12 2008-09-25 Fujifilm Corp Image trimming apparatus, method, and program
US7869632B2 (en) 2006-03-31 2011-01-11 Fujifilm Corporation Automatic trimming method, apparatus and program
US7912254B2 (en) 2006-03-30 2011-03-22 Fujifilm Corporation Automatic trimming method, apparatus and program
US8467580B2 (en) 2006-09-11 2013-06-18 Sony Corporation Image data processing apparatus, method, program and recording medium
US8692846B2 (en) 2010-12-14 2014-04-08 Canon Kabushiki Kaisha Image processing apparatus, method for retouching images based upon user applied designated areas and annotations
CN111382612A (en) * 2018-12-28 2020-07-07 北京市商汤科技开发有限公司 Animal face detection method and device

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000261644A (en) * 1999-03-05 2000-09-22 Fuji Photo Film Co Ltd Image conversion method, system and recording medium thereof

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000261644A (en) * 1999-03-05 2000-09-22 Fuji Photo Film Co Ltd Image conversion method, system and recording medium thereof

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7912254B2 (en) 2006-03-30 2011-03-22 Fujifilm Corporation Automatic trimming method, apparatus and program
US7869632B2 (en) 2006-03-31 2011-01-11 Fujifilm Corporation Automatic trimming method, apparatus and program
US7995807B2 (en) 2006-03-31 2011-08-09 Fujifilm Corporation Automatic trimming method, apparatus and program
JP2008065793A (en) * 2006-09-11 2008-03-21 Sony Corp Image processing apparatus and method, and program
US8306331B2 (en) 2006-09-11 2012-11-06 Sony Corporation Image processing apparatus and method, and program
US8467580B2 (en) 2006-09-11 2013-06-18 Sony Corporation Image data processing apparatus, method, program and recording medium
JP2008225720A (en) * 2007-03-12 2008-09-25 Fujifilm Corp Image trimming apparatus, method, and program
US8692846B2 (en) 2010-12-14 2014-04-08 Canon Kabushiki Kaisha Image processing apparatus, method for retouching images based upon user applied designated areas and annotations
CN111382612A (en) * 2018-12-28 2020-07-07 北京市商汤科技开发有限公司 Animal face detection method and device

Also Published As

Publication number Publication date
JP4513369B2 (en) 2010-07-28

Similar Documents

Publication Publication Date Title
US8660381B2 (en) Image processing apparatus, method, and computer readable medium for arranging images based on size ratio
US8374458B2 (en) Tone correcting method, tone correcting apparatus, tone correcting program, and image equipment
US6389155B2 (en) Image processing apparatus
US7486808B2 (en) Image processing device, image processing method and image processing program
US7082211B2 (en) Method and system for enhancing portrait images
JP4710550B2 (en) Comment layout in images
US8055011B2 (en) Hair style simulation image creating method
US20050041111A1 (en) Frame adjustment device and image-taking device and printing device
JP4513369B2 (en) Image trimming apparatus and method
US10387744B2 (en) Method and system for identifying extended contours within digital images
US7212674B1 (en) Method, apparatus and recording medium for face extraction
JP2009237977A (en) Image output control device, image output control method, image output control program, and printer
JP4702534B2 (en) Image processing apparatus, image processing method, and image processing program
JP2004240622A (en) Image processing method, image processor and image processing program
JP2022069931A (en) Automated trimming program, automated trimming apparatus, and automated trimming method
JP2009237976A (en) Unit, method and program for controlling face image output, and print unit
JP3869635B2 (en) Image processing apparatus, image processing method, recording medium, and print system
KR20020084321A (en) real-time character composition method using template
JP2011175309A (en) Image processing apparatus and program
JP3480370B2 (en) Automatic face image processing device
JP2005208732A (en) Image processing apparatus and method
JP4380268B2 (en) Image region selection method and apparatus
JP2005128774A (en) Image area extracting device and method
JPH07182522A (en) Image processor for detecting line-symmetric object area at high speed
JPH09161086A (en) Face picture preparing device and picture generator

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20070305

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20070305

RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20070305

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100112

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100119

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20100318

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100318

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

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

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130521

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees