JP6031961B2 - Contour detection device, contour detection method, and contour detection program - Google Patents

Contour detection device, contour detection method, and contour detection program Download PDF

Info

Publication number
JP6031961B2
JP6031961B2 JP2012254803A JP2012254803A JP6031961B2 JP 6031961 B2 JP6031961 B2 JP 6031961B2 JP 2012254803 A JP2012254803 A JP 2012254803A JP 2012254803 A JP2012254803 A JP 2012254803A JP 6031961 B2 JP6031961 B2 JP 6031961B2
Authority
JP
Japan
Prior art keywords
pixel
search
edge
area
region
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2012254803A
Other languages
Japanese (ja)
Other versions
JP2014102711A (en
Inventor
悟 牛嶋
悟 牛嶋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2012254803A priority Critical patent/JP6031961B2/en
Publication of JP2014102711A publication Critical patent/JP2014102711A/en
Application granted granted Critical
Publication of JP6031961B2 publication Critical patent/JP6031961B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、輪郭検出装置、輪郭検出方法および輪郭検出プログラムに関する。   The present invention relates to a contour detection device, a contour detection method, and a contour detection program.

写真などの画像から画像処理によって特定の物体の輪郭を検出する技術が知られている。このような技術は、例えば、人物の輪郭を検出して、輪郭外の背景画像を消去する、あるいは差し替えることなどに利用されている。   A technique for detecting the contour of a specific object from an image such as a photograph by image processing is known. Such a technique is used, for example, for detecting the outline of a person and erasing or replacing a background image outside the outline.

また、人物などの所望の物体の輪郭を正確に検出するための技術として、輪郭を検出させる領域をマウスなどの入力デバイスを用いてユーザに指定させ、輪郭の検出範囲を指定された領域またはその近傍領域に限定する技術がある。例えば、ユーザ操作によって指定された始点と終点との間において、終点に向かってエッジ検出強度の大きい画素を探索していく方法がある。また、ユーザ操作によって指定された帯状領域において、その中心線と交差する幅方向に画素を走査することで輪郭点を探索する方法もある。   In addition, as a technique for accurately detecting the contour of a desired object such as a person, the user can designate a region for detecting a contour using an input device such as a mouse, and the contour detection range is designated or There is a technique for limiting to a nearby region. For example, there is a method of searching for a pixel having a high edge detection intensity toward the end point between the start point and the end point specified by the user operation. There is also a method for searching for a contour point by scanning a pixel in a width direction intersecting with the center line in a belt-like region designated by a user operation.

特開2000−209430号公報JP 2000-209430 A 特開平7−92650号公報JP-A-7-92650 特開2000−339483号公報JP 2000-339483 A

輪郭の検出領域をユーザに指定させる方法では、検出領域をできるだけ輪郭の形状に沿って設定することで、輪郭の検出精度が向上する。例えば、人の顔を正面から見たときの耳の領域のように輪郭線が急峻に曲がっている部分では、その輪郭線の曲線に沿うように検出領域を設定することで、輪郭の検出精度が向上する。しかしながら、輪郭の形状に沿うように検出領域を設定するための操作は非常に手間がかかり、作業効率が低いという問題があった。   In the method of allowing the user to designate the contour detection region, the contour detection accuracy is improved by setting the detection region as much as possible along the contour shape. For example, in a portion where the contour line is sharply bent like the ear region when the human face is viewed from the front, the detection region is set along the contour curve, thereby detecting the contour detection accuracy. Will improve. However, there is a problem that the operation for setting the detection region so as to follow the shape of the contour is very troublesome and the work efficiency is low.

1つの側面では、本発明は、高精度の輪郭検出を効率よく実行可能な輪郭検出装置、輪郭検出方法および輪郭検出プログラムを提供することを目的とする。   In one aspect, an object of the present invention is to provide a contour detection device, a contour detection method, and a contour detection program capable of efficiently performing highly accurate contour detection.

1つの案では、次のような輪郭検出装置が提供される。この輪郭検出装置は、領域設定手段、入力受付手段および探索手段を有する。領域設定手段は、入力画像上に特定領域を設定する。入力受付手段は、入力操作に応じて、開始領域から終了領域に向かって延伸された、一定以上の幅を有する探索領域を入力画像上に設定する。探索手段は、探索領域の中から設定した着目画素の位置での探索領域の延伸方向の角度を判別し、延伸方向の角度ごとにエッジを探索するためのエッジ探索範囲が対応付けられた探索範囲情報に基づいて、判別した延伸方向の角度に対応するエッジ探索範囲を判別し、設定した着目画素の周囲画素のうち判別したエッジ探索範囲内に位置する画素から、エッジである可能性が高い画素を判定して次の着目画素に設定するエッジ探索処理を、着目画素が開始領域から終了領域に達するまで繰り返す。また、探索手段は、着目画素が特定領域に含まれる場合には、この着目画素について判別したエッジ探索範囲を拡張し、この着目画素の周囲画素のうち拡張したエッジ探索範囲内に位置する画素から、エッジである可能性が高い画素を次の着目画素に設定する。   In one proposal, the following contour detection apparatus is provided. The contour detection apparatus includes an area setting unit, an input reception unit, and a search unit. The area setting means sets a specific area on the input image. The input receiving unit sets a search area having a certain width or more on the input image that is extended from the start area to the end area in response to an input operation. The search means determines the angle in the extension direction of the search region at the position of the target pixel set from the search region, and the search range in which an edge search range for searching for an edge is associated with each angle in the extension direction Based on the information, an edge search range corresponding to the determined angle in the extending direction is determined, and a pixel that is highly likely to be an edge from the pixels located within the determined edge search range among the surrounding pixels of the set target pixel And the edge search process for setting the next target pixel is repeated until the target pixel reaches the end region from the start region. In addition, when the target pixel is included in the specific region, the search unit extends the edge search range determined for the target pixel, and from the pixels located in the extended edge search range among the surrounding pixels of the target pixel. Then, a pixel that is highly likely to be an edge is set as the next pixel of interest.

また、1つの案では、上記の輪郭検出装置と同様の処理が実行される輪郭検出方法、および、上記の輪郭検出装置と同様の処理をコンピュータに実行させる輪郭検出プログラムが提供される。   Further, in one proposal, there are provided a contour detection method in which processing similar to that in the above contour detection device is executed, and a contour detection program for causing a computer to execute processing similar to that in the above contour detection device.

1態様によれば、高精度の輪郭検出を効率よく実行できる。   According to one aspect, highly accurate contour detection can be performed efficiently.

第1の実施の形態に係る輪郭検出装置の構成例および処理例を示す図である。It is a figure which shows the structural example and processing example of the outline detection apparatus which concern on 1st Embodiment. 第2の実施の形態に係る輪郭検出装置のハードウェア構成例を示す図である。It is a figure which shows the hardware structural example of the outline detection apparatus which concerns on 2nd Embodiment. 輪郭検出装置が備える処理機能の構成例を示すブロック図である。It is a block diagram which shows the structural example of the processing function with which an outline detection apparatus is provided. トレース操作実行時における状態遷移の例を示す図である。It is a figure which shows the example of the state transition at the time of trace operation execution. トレース方向角度の算出方法について説明するための図である。It is a figure for demonstrating the calculation method of a trace direction angle. トレース領域情報に登録される情報の例を示す図である。It is a figure which shows the example of the information registered into trace area information. トレース方向角度の分類の例を示す図である。It is a figure which shows the example of the classification | category of a trace direction angle. 角度範囲とエッジ探索範囲との関係の例について示す図である。It is a figure shown about the example of the relationship between an angle range and an edge search range. エッジ強度の算出例を示す図である。It is a figure which shows the example of calculation of edge strength. 上記の輪郭検出処理による問題点について説明するための図である。It is a figure for demonstrating the problem by said outline detection process. 耳領域の検出例を示す図である。It is a figure which shows the example of a detection of an ear area | region. トレース領域の設定例を示す図である。It is a figure which shows the example of a setting of a trace area | region. 耳領域での探索範囲の設定例を示す図である。It is a figure which shows the example of a setting of the search range in an ear | edge area | region. 第2の実施の形態に係る輪郭検出装置の処理手順の例を示すフローチャートである。It is a flowchart which shows the example of the process sequence of the outline detection apparatus which concerns on 2nd Embodiment. 第3の実施の形態に係る輪郭検出装置の処理機能の構成例を示すブロック図である。It is a block diagram which shows the structural example of the processing function of the outline detection apparatus which concerns on 3rd Embodiment. 耳の輪郭線の一例を示す図である。It is a figure which shows an example of the outline of an ear | edge. 耳領域における探索範囲の設定例を示す図である。It is a figure which shows the example of a setting of the search range in an ear area | region. 第3の実施の形態に係る輪郭検出装置の処理手順の例を示すフローチャートである。It is a flowchart which shows the example of the process sequence of the outline detection apparatus which concerns on 3rd Embodiment. 第3の実施の形態に係る輪郭検出装置の処理手順の例を示すフローチャートである。It is a flowchart which shows the example of the process sequence of the outline detection apparatus which concerns on 3rd Embodiment.

以下、本発明の実施の形態について図面を参照して説明する。
〔第1の実施の形態〕
図1は、第1の実施の形態に係る輪郭検出装置の構成例および処理例を示す図である。図1の輪郭検出装置1は、入力画像から物体の輪郭線を検出する処理を実行する装置であり、領域設定手段2、入力受付手段および探索手段4を有する。また、探索手段4は、探索範囲情報5を参照可能になっている。
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[First Embodiment]
FIG. 1 is a diagram illustrating a configuration example and a processing example of the contour detection apparatus according to the first embodiment. The contour detection device 1 in FIG. 1 is a device that executes processing for detecting a contour line of an object from an input image, and includes a region setting unit 2, an input reception unit, and a search unit 4. Further, the search means 4 can refer to the search range information 5.

なお、領域設定手段2、入力受付手段3および探索手段4の各処理は、例えば、輪郭検出装置1が備えるプロセッサが所定のプログラムを実行することで実現される。あるいは、領域設定手段2、入力受付手段3および探索手段4の処理の少なくとも一部は、専用回路によって実現されてもよい。また、探索範囲情報5は、例えば、輪郭検出装置1が備える不揮発性記憶装置に記憶される。   Each process of the area setting unit 2, the input receiving unit 3, and the search unit 4 is realized by, for example, a processor included in the contour detection device 1 executing a predetermined program. Alternatively, at least a part of the processing of the area setting unit 2, the input reception unit 3, and the search unit 4 may be realized by a dedicated circuit. The search range information 5 is stored in, for example, a nonvolatile storage device included in the contour detection device 1.

領域設定手段2は、入力画像上に特定領域を設定する。図1には例として矩形の特定領域10を示したが、特定領域の設定の仕方はこの例に限らない。例えば、特定領域は、入力画像上の横方向(x軸方向)の範囲のみ規定された領域、あるいは、縦方向(y軸方向)の範囲のみ規定された領域であってもよい。   The area setting unit 2 sets a specific area on the input image. FIG. 1 shows a rectangular specific area 10 as an example, but the method of setting the specific area is not limited to this example. For example, the specific region may be a region defined only in the horizontal direction (x-axis direction) range on the input image or a region defined only in the vertical direction (y-axis direction).

特定領域としては、例えば、物体の輪郭線が急峻に曲がっている部分を含むように設定される。具体的な例としては、人の耳を含む領域を特定領域とすることができる。顔が正面に向いた状態での人の輪郭線を検出する場合、耳の上端や下端の部分において輪郭線が急峻に曲がる場合がある。   For example, the specific region is set so as to include a portion where the outline of the object is sharply bent. As a specific example, a region including a human ear can be set as a specific region. When detecting the outline of a person with the face facing forward, the outline may be sharply bent at the upper and lower ends of the ear.

なお、特定領域は、ユーザの操作入力によって設定されてもよいし、輪郭検出装置1によって自動的に設定されてもよい。後者の例として、人の顔の検出結果に基づいて、耳を含む領域を特定領域に設定する方法が考えられる。   The specific area may be set by a user operation input, or may be automatically set by the contour detection device 1. As an example of the latter, a method of setting a region including an ear as a specific region based on a human face detection result is conceivable.

入力受付手段3は、ユーザの入力操作に応じて、エッジを探索するための探索領域を入力画像上に設定する。探索領域は、開始領域から終了領域に向かって延伸された、一定以上の幅を有する領域である。図1では、開始領域21から終了領域22に向かって緩やかに湾曲した探索領域20の例を示している。   The input receiving unit 3 sets a search area for searching for an edge on the input image in accordance with a user input operation. The search area is an area having a certain width or more that extends from the start area toward the end area. FIG. 1 shows an example of the search area 20 that is gently curved from the start area 21 toward the end area 22.

探索領域は、できるだけ簡易な操作によって設定できることが望ましい。探索領域の設定方法の例としては、ユーザが指示位置を連続的に移動させる操作を行うと、その移動軌跡に沿って一定の幅の探索領域が設定されるという方法が考えられる。この場合の指示位置とは、例えば、マウスカーソルの位置や、タッチパネルに対する接触位置とすることができる。また、類似する例として、ユーザが一定の大きさのアイコン画像を移動させる操作を行うと、アイコン画像が移動した領域が探索領域に設定されるという方法も考えられる。   It is desirable that the search area can be set by a simple operation as much as possible. As an example of the search area setting method, a method in which a search area having a certain width is set along the movement locus when the user performs an operation of continuously moving the designated position is considered. In this case, the designated position can be, for example, the position of the mouse cursor or the touch position on the touch panel. As a similar example, a method in which when the user performs an operation of moving an icon image having a certain size, a region where the icon image has moved can be set as a search region.

探索手段4は、設定された探索領域において、その開始領域のいずれかの画素を起点として着目画素を設定し、着目画素の周囲画素の中からエッジである可能性が高い画素を次の着目画素に設定するエッジ探索処理を、着目画素が終了領域に達するまで繰り返す。これにより、設定された着目画素群が輪郭線として検出される。   In the set search region, the search unit 4 sets a pixel of interest starting from one of the pixels in the start region, and selects a pixel that is likely to be an edge from the surrounding pixels of the pixel of interest. The edge search process set to is repeated until the target pixel reaches the end region. Thereby, the set pixel group of interest is detected as a contour line.

探索手段4は、より具体的には次のような処理を行う。探索手段4は、設定した着目画素の位置での探索領域の延伸方向の角度を判別する。この延伸方向の角度は、例えば、着目画素から探索領域の中心線に下ろした垂線と、中心線との交点における接線の傾きとして定義することができる。   More specifically, the search means 4 performs the following processing. The search means 4 determines the angle in the extension direction of the search region at the set position of the target pixel. This angle in the extending direction can be defined as, for example, the inclination of the tangent at the intersection of the vertical line drawn from the pixel of interest to the center line of the search area and the center line.

また、探索手段4は、探索範囲情報5を参照する。探索範囲情報5には、探索領域の延伸方向の角度ごとに、エッジを探索するためのエッジ探索範囲が対応付けられている。探索手段4は、探索範囲情報5に基づき、着目画素について判別した延伸方向の角度に対応する探索範囲角度を判別する。そして、探索手段4は、着目画素の周囲画素のうち、探索範囲情報5を基に判別したエッジ探索範囲内に位置する画素から、エッジである可能性が高い画素を判定して、その画素を次の着目画素に設定する。探索手段4は、このようなエッジ探索処理を、着目画素が開始領域から終了領域に達するまで繰り返す。   The search means 4 refers to the search range information 5. The search range information 5 is associated with an edge search range for searching for an edge for each angle in the extension direction of the search region. Based on the search range information 5, the search unit 4 determines a search range angle corresponding to the extension direction angle determined for the pixel of interest. Then, the search unit 4 determines a pixel that is highly likely to be an edge from pixels located within the edge search range determined based on the search range information 5 among the surrounding pixels of the pixel of interest, and selects the pixel. Set to the next pixel of interest. The search means 4 repeats such edge search processing until the target pixel reaches the end region from the start region.

例えば、図1の画素31を着目画素に設定した場合、探索手段4は、画素31についての延伸方向A1の角度を判別し、探索範囲情報5に基づいて、延伸方向A1の角度に対応するエッジ探索範囲B1を判別する。そして、探索手段4は、画素31の周囲画素のうち、エッジ探索範囲B1内に位置する画素の中から、エッジである可能性が高い画素32を判定して、画素32を次の着目画素に設定する。   For example, when the pixel 31 in FIG. 1 is set as the target pixel, the search unit 4 determines the angle of the stretching direction A1 for the pixel 31 and, based on the search range information 5, the edge corresponding to the angle of the stretching direction A1. The search range B1 is determined. And the search means 4 determines the pixel 32 with high possibility of being an edge from the pixels located in the edge search range B1 among the surrounding pixels of the pixel 31, and makes the pixel 32 the next pixel of interest. Set.

ここで、エッジ探索範囲の内角の大きさは、基本的に、延伸方向の角度に関係なく略一定値とされる。そして、エッジ探索範囲は、例えば、次に設定され得る着目画素(すなわち、エッジであるかの判定対象とされる画素)が、現在の着目画素から探索領域の延伸方向に向かう範囲に限定されるように設定される。これにより、探索領域に沿って伸びている輪郭線、すなわちユーザが意図する輪郭線を、正確に検出できるようになる。   Here, the size of the inner angle of the edge search range is basically a substantially constant value regardless of the angle in the stretching direction. The edge search range is, for example, limited to a range in which a pixel of interest that can be set next (that is, a pixel that is a determination target of an edge) is directed from the current pixel of interest toward the extension direction of the search region. Is set as follows. As a result, the contour line extending along the search area, that is, the contour line intended by the user can be accurately detected.

また、探索手段4は、着目画素が、領域設定手段2により設定された特定領域に含まれる場合には、この着目画素について判別されたエッジ探索範囲を拡張する。そして、探索手段4は、この着目画素の周囲画素のうち、拡張したエッジ探索範囲内に位置する画素の中から、エッジである可能性が高い画素を判定して次の着目画素に設定する。   In addition, when the pixel of interest is included in the specific region set by the region setting unit 2, the search unit 4 extends the edge search range determined for the pixel of interest. Then, the search means 4 determines a pixel having a high possibility of being an edge from pixels located within the extended edge search range from the surrounding pixels of the target pixel, and sets it as the next target pixel.

例えば、図1の画素41は、設定された特定領域10に含まれる。この画素41を着目画素に設定した場合、探索手段4は、画素41についての延伸方向A2の角度を判別し、探索範囲情報5に基づいて、延伸方向A2の角度に対応するエッジ探索範囲B2を判別する。さらに、探索手段4は、判別されたエッジ探索範囲B2を拡張して、新たなエッジ探索範囲B3とする。そして、画素41の周囲画素のうち、拡張後のエッジ探索範囲B3内に位置する画素の中から、エッジである可能性が高い画素42を判定して、画素42を次の着目画素に設定する。   For example, the pixel 41 in FIG. 1 is included in the set specific area 10. When this pixel 41 is set as the pixel of interest, the search means 4 determines the angle of the extending direction A2 for the pixel 41 and, based on the search range information 5, determines the edge search range B2 corresponding to the angle of the extending direction A2. Determine. Further, the search means 4 extends the determined edge search range B2 to a new edge search range B3. Then, a pixel 42 that is highly likely to be an edge is determined from the pixels located within the expanded edge search range B3 among the surrounding pixels of the pixel 41, and the pixel 42 is set as the next pixel of interest. .

このようなエッジ探索範囲の拡張が行われることで、探索手段4は、物体の輪郭線が急峻に曲がっている場合でも、その輪郭線を正確に検出することができるようになる。すなわち、特定領域10においては、物体の輪郭線の方向が探索領域の延伸方向から大きくずれていても、その輪郭線を正確に検出できるようになる。このため、ユーザは、輪郭線が急峻に曲がっている部分についても、その輪郭線の形状に正確に沿うように探索領域を設定せずに、大まかな輪郭線の形状に沿うように探索領域を設定すればよくなり、ユーザの作業効率が向上する。従って、高精度の輪郭検出を効率よく実行可能になる。   By extending the edge search range in this way, the search means 4 can accurately detect the contour line even when the contour line of the object is sharply bent. That is, in the specific area 10, even if the direction of the contour line of the object is greatly deviated from the extending direction of the search area, the contour line can be accurately detected. For this reason, the user does not set the search region so that the contour line accurately follows the shape of the contour line, but also sets the search region so as to follow the rough contour shape. It is only necessary to set this, and the user's work efficiency is improved. Therefore, highly accurate contour detection can be performed efficiently.

〔第2の実施の形態〕
次に、人の輪郭線を検出するための輪郭検出装置の例について説明する。図2は、第2の実施の形態に係る輪郭検出装置のハードウェア構成例を示す図である。輪郭検出装置100は、例えば、図2に示すようなコンピュータとして実現される。
[Second Embodiment]
Next, an example of a contour detection apparatus for detecting a human contour will be described. FIG. 2 is a diagram illustrating a hardware configuration example of the contour detection apparatus according to the second embodiment. The contour detection apparatus 100 is realized as a computer as shown in FIG. 2, for example.

輪郭検出装置100は、プロセッサ101によって装置全体が制御されている。プロセッサ101には、バス109を介してRAM(Random Access Memory)102と複数の周辺機器が接続されている。プロセッサ101は、マルチプロセッサであってもよい。プロセッサ101は、例えばCPU(Central Processing Unit)、MPU(Micro Processing Unit)、DSP(Digital Signal Processor)、ASIC(Application Specific Integrated Circuit)、またはPLD(Programmable Logic Device)である。またプロセッサ101は、CPU、MPU、DSP、ASIC、PLDのうちの2以上の要素の組み合わせであってもよい。   The entire contour detection apparatus 100 is controlled by a processor 101. A RAM (Random Access Memory) 102 and a plurality of peripheral devices are connected to the processor 101 via a bus 109. The processor 101 may be a multiprocessor. The processor 101 is, for example, a central processing unit (CPU), a micro processing unit (MPU), a digital signal processor (DSP), an application specific integrated circuit (ASIC), or a programmable logic device (PLD). The processor 101 may be a combination of two or more elements among CPU, MPU, DSP, ASIC, and PLD.

RAM102は、輪郭検出装置100の主記憶装置として使用される。RAM102には、プロセッサ101に実行させるOS(Operating System)のプログラムやアプリケーションプログラムの少なくとも一部が一時的に格納される。また、RAM102には、プロセッサ101による処理に必要な各種データが格納される。   The RAM 102 is used as a main storage device of the contour detection device 100. The RAM 102 temporarily stores at least part of an OS (Operating System) program and application programs to be executed by the processor 101. The RAM 102 stores various data necessary for processing by the processor 101.

バス109に接続されている周辺機器としては、例えば、HDD(Hard Disk Drive)103、グラフィック処理装置104、入力インタフェース105、光学ドライブ装置106、機器接続インタフェース107およびネットワークインタフェース108がある。   Examples of peripheral devices connected to the bus 109 include an HDD (Hard Disk Drive) 103, a graphic processing device 104, an input interface 105, an optical drive device 106, a device connection interface 107, and a network interface 108.

HDD103は、内蔵したディスクに対して磁気的にデータの書き込みおよび読み出しを行う。HDD103は、輪郭検出装置100の補助記憶装置として使用される。HDD103には、OSのプログラム、アプリケーションプログラム、および各種データが格納される。なお、補助記憶装置としては、SSD(Solid State Drive)などの他の種類の不揮発性記憶装置を使用することもできる。   The HDD 103 magnetically writes and reads data to and from the built-in disk. The HDD 103 is used as an auxiliary storage device of the contour detection apparatus 100. The HDD 103 stores an OS program, application programs, and various data. As the auxiliary storage device, other types of nonvolatile storage devices such as SSD (Solid State Drive) can be used.

グラフィック処理装置104には、モニタ104aが接続されている。グラフィック処理装置104は、プロセッサ101からの命令に従って、画像をモニタ104aの画面に表示させる。モニタ104aとしては、CRT(Cathode Ray Tube)を用いた表示装置や液晶表示装置などがある。   A monitor 104 a is connected to the graphic processing device 104. The graphic processing device 104 displays an image on the screen of the monitor 104a in accordance with an instruction from the processor 101. Examples of the monitor 104a include a display device using a CRT (Cathode Ray Tube) and a liquid crystal display device.

入力インタフェース105には、キーボード105aとマウス105bとが接続されている。入力インタフェース105は、キーボード105aやマウス105bから送られてくる信号をプロセッサ101に送信する。なお、マウス105bは、ポインティングデバイスの一例であり、他のポインティングデバイスを使用することもできる。他のポインティングデバイスとしては、タッチパネル、タブレット、タッチパッド、トラックボールなどがある。   A keyboard 105 a and a mouse 105 b are connected to the input interface 105. The input interface 105 transmits signals sent from the keyboard 105a and the mouse 105b to the processor 101. Note that the mouse 105b is an example of a pointing device, and other pointing devices can also be used. Examples of other pointing devices include a touch panel, a tablet, a touch pad, and a trackball.

光学ドライブ装置106は、レーザ光などを利用して、光ディスク106aに記録されたデータの読み取りを行う。光ディスク106aは、光の反射によって読み取り可能なようにデータが記録された可搬型の記録媒体である。光ディスク106aには、DVD(Digital Versatile Disc)、DVD−RAM、CD−ROM(Compact Disc Read Only Memory)、CD−R(Recordable)/RW(ReWritable)などがある。   The optical drive device 106 reads data recorded on the optical disc 106a using laser light or the like. The optical disk 106a is a portable recording medium on which data is recorded so that it can be read by reflection of light. The optical disk 106a includes a DVD (Digital Versatile Disc), a DVD-RAM, a CD-ROM (Compact Disc Read Only Memory), a CD-R (Recordable) / RW (ReWritable), and the like.

機器接続インタフェース107は、輪郭検出装置100に周辺機器を接続するための通信インタフェースである。例えば機器接続インタフェース107には、メモリ装置107aやメモリリーダライタ107bを接続することができる。メモリ装置107aは、機器接続インタフェース107との通信機能を搭載した記録媒体である。メモリリーダライタ107bは、メモリカード107cへのデータの書き込み、またはメモリカード107cからのデータの読み出しを行う装置である。メモリカード107cは、カード型の記録媒体である。   The device connection interface 107 is a communication interface for connecting peripheral devices to the contour detection apparatus 100. For example, a memory device 107 a and a memory reader / writer 107 b can be connected to the device connection interface 107. The memory device 107a is a recording medium equipped with a communication function with the device connection interface 107. The memory reader / writer 107b is a device that writes data to the memory card 107c or reads data from the memory card 107c. The memory card 107c is a card type recording medium.

ネットワークインタフェース108は、ネットワーク108aに接続されている。ネットワークインタフェース108は、ネットワーク108aを介して、他のコンピュータまたは通信機器との間でデータの送受信を行う。   The network interface 108 is connected to the network 108a. The network interface 108 transmits / receives data to / from other computers or communication devices via the network 108a.

以上のようなハードウェア構成によって、第2の実施の形態の処理機能を実現することができる。なお、第1の実施の形態に示した輪郭検出装置1も、図2に示した輪郭検出装置100と同様のハードウェアにより実現することができる。   With the hardware configuration described above, the processing functions of the second embodiment can be realized. Note that the contour detection apparatus 1 shown in the first embodiment can also be realized by the same hardware as the contour detection apparatus 100 shown in FIG.

図3は、輪郭検出装置が備える処理機能の構成例を示すブロック図である。輪郭検出装置100は、ユーザの入力操作に応じて入力画像上に設定された、一定以上の幅を有する探索領域において、その探索領域の延伸方向に対してエッジ強度が強い画素を順次探索していくことで、入力画像上の人の輪郭線を検出する。特に、輪郭検出装置100は、顔が正面を向いた人の頭部近傍の輪郭線を高精度に検出可能とするものである。また、探索領域は、所定の大きさのアイコン画像をユーザがドラッグ操作により移動させる操作を行ったときに、アイコン画像が移動した領域として設定されるものとする。さらに、輪郭検出装置100は、顔検出によって抽出された、耳を含む領域においては、エッジ強度が強い画素の探索処理手順をそれ以外での手順から変更することで、耳を含む領域における輪郭線の検出精度を向上させる。   FIG. 3 is a block diagram illustrating a configuration example of processing functions included in the contour detection apparatus. The contour detection apparatus 100 sequentially searches for a pixel having a strong edge strength with respect to the extending direction of the search region in a search region set on the input image according to the input operation of the user and having a certain width or more. As a result, the outline of the person on the input image is detected. In particular, the contour detection apparatus 100 is capable of detecting a contour line near the head of a person whose face is facing the front with high accuracy. The search area is set as an area where the icon image has moved when the user performs an operation of moving an icon image of a predetermined size by a drag operation. Furthermore, in the region including the ears extracted by face detection, the contour detection apparatus 100 changes the search processing procedure for pixels with high edge strength from the other procedures, thereby contour lines in the region including the ears. Improve detection accuracy.

輪郭検出装置100は、画像読み込み部111、顔検出部112、トレース入力部113および輪郭検出部114を有する。画像読み込み部111、顔検出部112、トレース入力部113および輪郭検出部114の各処理は、プロセッサ101が所定のプログラムを実行することで実現される。ただし、これらの処理の少なくとも一部が、例えばグラフィック処理装置104内の回路などの専用回路によって実現されてもよい。   The contour detection apparatus 100 includes an image reading unit 111, a face detection unit 112, a trace input unit 113, and a contour detection unit 114. Each process of the image reading unit 111, the face detection unit 112, the trace input unit 113, and the contour detection unit 114 is realized by the processor 101 executing a predetermined program. However, at least a part of these processes may be realized by a dedicated circuit such as a circuit in the graphic processing device 104, for example.

また、輪郭検出装置100の記憶装置には、耳領域情報121、トレース領域情報122、探索範囲情報123および輪郭情報124が記憶される。これらの情報のうち、探索範囲情報123は、HDD103などの不揮発性記憶装置にあらかじめ記憶される。一方、耳領域情報121、トレース領域情報122および輪郭情報124は、少なくとも、RAM102などの揮発性記憶装置に一時的に記憶される。   The storage device of the contour detection apparatus 100 stores ear region information 121, trace region information 122, search range information 123, and contour information 124. Among these pieces of information, the search range information 123 is stored in advance in a nonvolatile storage device such as the HDD 103. On the other hand, the ear region information 121, the trace region information 122, and the contour information 124 are temporarily stored in at least a volatile storage device such as the RAM 102.

画像読み込み部111は、人が映った入力画像を、HDD103などの輪郭検出装置100に接続された不揮発性記憶装置や、ネットワーク108a上の情報処理装置などからRAM102へ読み込む。本実施の形態では、入力画像には、少なくとも、顔が正面を向いた人の頭部が映っているものとする。   The image reading unit 111 reads an input image showing a person into the RAM 102 from a nonvolatile storage device connected to the contour detection device 100 such as the HDD 103 or an information processing device on the network 108a. In the present embodiment, it is assumed that at least the head of a person whose face is facing the front is reflected in the input image.

顔検出部112は、入力画像から人の顔を検出し、その顔検出結果から耳を含む領域(耳領域)を抽出する。耳領域を示す情報は、耳領域情報121としてRAM102に記憶される。   The face detection unit 112 detects a human face from the input image, and extracts a region including an ear (ear region) from the face detection result. Information indicating the ear region is stored in the RAM 102 as ear region information 121.

トレース入力部113は、所定の大きさのアイコン画像をユーザがドラッグ操作により移動させる「トレース操作」を行ったとき、アイコン画像が移動した領域を探索領域に設定する。以下、アイコン画像が移動した領域を「トレース領域」と呼ぶ。トレース領域を示す情報は、トレース領域情報122としてRAM102に記憶される。   When the user performs a “trace operation” in which an icon image of a predetermined size is moved by a drag operation, the trace input unit 113 sets the area where the icon image has moved as a search area. Hereinafter, an area where the icon image has moved is referred to as a “trace area”. Information indicating the trace area is stored in the RAM 102 as the trace area information 122.

トレース入力部113は、設定したトレース領域内の画素のそれぞれについて、「トレース方向角度」を算出し、算出したトレース方向角度を各画素に対応付けてトレース領域情報122に登録する。トレース方向角度は、画素ごとにエッジ探索のための進行可能方向を判定するための基準角度である。トレース方向角度の詳細については後述する。   The trace input unit 113 calculates a “trace direction angle” for each pixel in the set trace area, and registers the calculated trace direction angle in the trace area information 122 in association with each pixel. The trace direction angle is a reference angle for determining a travelable direction for edge search for each pixel. Details of the trace direction angle will be described later.

探索範囲情報123には、トレース方向角度ごとに、エッジ探索を行う範囲を示すエッジ探索範囲が対応付けて記憶されている。
輪郭検出部114は、トレース領域における開始領域から終了領域に向かって、エッジ強度が大きい画素を順次辿っていくことで、輪郭線を検出する。このようなエッジ探索処理において、輪郭検出部114は、耳領域情報121、トレース領域情報122および探索範囲情報123を参照する。輪郭検出部114は、検出された輪郭線の情報を輪郭情報124として出力する。
The search range information 123 stores an edge search range indicating a range in which an edge search is performed for each trace direction angle in association with each other.
The contour detection unit 114 detects a contour line by sequentially tracing pixels with high edge strength from the start region to the end region in the trace region. In such edge search processing, the contour detection unit 114 refers to the ear region information 121, the trace region information 122, and the search range information 123. The contour detection unit 114 outputs the detected contour information as contour information 124.

また、輪郭検出部114は、処理対象とする着目画素が、耳領域情報121が示す耳領域に含まれる場合には、着目画素を起点とした探索の進行方向の範囲(エッジ強度の判定対象とする画素の範囲)を、それ以外の領域における範囲より拡張する。これにより、輪郭線が急峻に曲がっている耳付近の領域でも、輪郭線を正確に検出できるようにする。   In addition, when the target pixel to be processed is included in the ear region indicated by the ear region information 121, the contour detection unit 114 determines the range of the search progress direction starting from the target pixel (the determination target of edge strength). The range of pixels to be expanded) is expanded from the range in other regions. Thus, the contour line can be accurately detected even in a region near the ear where the contour line is sharply bent.

次に、輪郭検出装置100の基本的な輪郭検出処理手順について説明する。基本的な輪郭検出処理は、次のような処理ステップを含む。
(1)トレース操作に応じてトレース領域を設定する。
Next, a basic contour detection processing procedure of the contour detection apparatus 100 will be described. The basic contour detection process includes the following processing steps.
(1) Set the trace area according to the trace operation.

(2)トレース領域の各画素について、トレース方向角度を算出する。
(3)トレース領域の開始領域内のいずれかの画素を着目画素に設定し、着目画素がトレース領域の終了領域に達するまで、次の(3−1)〜(3−3)を繰り返す。
(2) The trace direction angle is calculated for each pixel in the trace area.
(3) Any pixel in the start area of the trace area is set as the target pixel, and the following (3-1) to (3-3) are repeated until the target pixel reaches the end area of the trace area.

(3−1)着目画素についてのトレース方向角度に対応するエッジ探索範囲を、探索範囲情報123を基に判別する。
(3−2)着目画素の周囲画素のうちエッジ探索範囲に含まれる画素のエッジ強度を算出する。
(3-1) The edge search range corresponding to the trace direction angle for the target pixel is determined based on the search range information 123.
(3-2) The edge strength of the pixels included in the edge search range among the surrounding pixels of the target pixel is calculated.

(3−3)エッジ強度が最も強い画素を次の着目画素に設定する。
なお、トレース方向角度の算出は、(2)の時点でトレース領域内の全画素について行われるのではなく、(3−1)の時点で、設定された着目画素について行われてもよい。
(3-3) The pixel with the strongest edge strength is set as the next pixel of interest.
The calculation of the trace direction angle is not performed for all the pixels in the trace area at the time (2), but may be performed for the set target pixel at the time (3-1).

以下、図4〜図9を用いて、上記の(1)〜(3)の処理について説明する。
まず、図4は、トレース操作実行時における状態遷移の例を示す図である。この図4を用いて、トレース操作およびトレース領域について説明する。
Hereinafter, the processes (1) to (3) will be described with reference to FIGS.
First, FIG. 4 is a diagram illustrating an example of state transition at the time of executing a trace operation. The trace operation and the trace area will be described with reference to FIG.

本実施の形態では例として、ユーザは、トレース領域を指定するためのトレース操作を、マウスを用いて行うものとする。そして、ユーザが、矩形のアイコン画像201をドラッグ操作により移動させることで、トレース領域210が設定されるものとする。   In this embodiment, as an example, it is assumed that the user performs a trace operation for designating a trace area using a mouse. Then, it is assumed that the trace area 210 is set by the user moving the rectangular icon image 201 by a drag operation.

図4において、トレース領域210は、破線によって囲まれた領域である。また、図4中の点線矢印は、アイコン画像201の中心点が移動した軌跡を示し、以下、この軌跡を「トレース領域の中心線」と呼ぶ。   In FIG. 4, a trace area 210 is an area surrounded by a broken line. In addition, a dotted line arrow in FIG. 4 indicates a trajectory in which the center point of the icon image 201 has moved, and this trajectory is hereinafter referred to as a “trace area center line”.

図4の状態1のように、ユーザが、マウスカーソルを入力画像200上の所望の位置に配した状態でマウスボタンを押下すると、マウスカーソルの位置にアイコン画像201が表示される。なお、アイコン画像201は、マウスボタン押下の前からマウスカーソルの位置に表示されていてもよい。   When the user presses the mouse button with the mouse cursor placed at a desired position on the input image 200 as in state 1 in FIG. 4, an icon image 201 is displayed at the position of the mouse cursor. The icon image 201 may be displayed at the position of the mouse cursor before the mouse button is pressed.

ユーザが、マウスボタンを押下したままでマウスを動かして画面上の指示位置を移動させると、その移動に伴ってアイコン画像201も移動する。このとき、図4の状態2のように、アイコン画像201が移動した領域がトレース領域210に設定されるとともに、設定されたトレース領域210が画面上に識別可能な状態で表示される。その後、ユーザが所望の位置でマウスボタンの押下を終了すると、図4の状態3に示すように、トレース領域210の設定が完了する。   When the user moves the designated position on the screen by moving the mouse while holding down the mouse button, the icon image 201 is also moved along with the movement. At this time, as in state 2 in FIG. 4, the area where the icon image 201 has moved is set as the trace area 210 and the set trace area 210 is displayed in an identifiable state on the screen. Thereafter, when the user finishes pressing the mouse button at a desired position, the setting of the trace area 210 is completed as shown in state 3 of FIG.

人の頭部の輪郭線を検出させる場合、ユーザは、アイコン画像201の内部に常に入力画像200上の人の頭部の輪郭が含まれるように、アイコン画像201を移動させればよい。   When detecting the outline of the human head, the user may move the icon image 201 so that the outline of the human head on the input image 200 is always included in the icon image 201.

なお、タッチパネルが用いられる場合、ユーザは例えば、入力画像上の所望の位置に指を接触させ、指が接触された状態を保ったまま接触位置を移動させ、その後、所望の位置で指を離す、という操作により、トレース領域210を指定することができる。   When the touch panel is used, for example, the user touches a desired position on the input image, moves the contact position while keeping the finger in contact, and then releases the finger at the desired position. , The trace area 210 can be specified.

また、図4の例では、アイコン画像201が移動した領域がトレース領域210に設定されているが、その他に例えば、マウスカーソルの軌跡または指の接触位置の軌跡を中心とした一定幅の領域が、トレース領域210に設定されてもよい。   In the example of FIG. 4, the area where the icon image 201 has been moved is set as the trace area 210. However, for example, there is an area having a certain width centered on the locus of the mouse cursor or the locus of the finger contact position. The trace area 210 may be set.

また、アイコン画像201の形状は、図4のような矩形に限らない。
ところで、後述するように、エッジ探索の始点および終点を判別するために、トレース領域210の開始領域および終了領域が設定される。開始領域としては、トレース領域210の始点側の端部に隣接する複数画素が設定され、終了領域としては、トレース領域210の終点側の端部に隣接する複数画素が設定される。
Further, the shape of the icon image 201 is not limited to a rectangle as shown in FIG.
By the way, as will be described later, a start area and an end area of the trace area 210 are set in order to determine the start point and end point of the edge search. As the start region, a plurality of pixels adjacent to the end on the start point side of the trace region 210 are set, and as the end region, a plurality of pixels adjacent to the end on the end point side of the trace region 210 are set.

図4のように矩形のアイコン画像201が用いられる場合、例えば、開始領域としては、トレース領域210においてアイコン画像201が最初に配置された領域のうち、端部に面する1辺または2辺の画素が設定される。アイコン画像201が初期位置から左右方向(x軸方向)または上下方向(y軸方向)に移動した場合、開始領域としては、端部に面する1辺の画素が設定される。一方、アイコン画像201が初期位置から斜めに移動した場合、開始領域としては、端部に面する2辺の画素が設定される。図4は後者の例を示しており、辺211,212に隣接する画素が開始領域に設定される。   When the rectangular icon image 201 is used as shown in FIG. 4, for example, as the start area, one or two sides facing the end of the area where the icon image 201 is first arranged in the trace area 210 are used. Pixel is set. When the icon image 201 moves from the initial position in the left-right direction (x-axis direction) or the up-down direction (y-axis direction), a pixel on one side facing the end is set as the start area. On the other hand, when the icon image 201 is moved obliquely from the initial position, pixels on two sides facing the end are set as the start area. FIG. 4 shows the latter example, and a pixel adjacent to the sides 211 and 212 is set as a start region.

また、終了領域についても同様であり、トレース領域210においてアイコン画像201が最後に配置された領域のうち、端部に面する1辺または2辺の画素が設定される。アイコン画像201が最終位置に対して左右方向(x軸方向)または上下方向(y軸方向)に移動した場合、終了領域としては、端部に面する1辺の画素が設定される。一方、アイコン画像201が最終位置に対して斜めに移動した場合、終了領域としては、端部に面する2辺の画素が設定される。図4は後者の例を示しており、辺213,214に隣接する画素が終了領域に設定される。   The same applies to the end region. Among the regions where the icon image 201 is finally arranged in the trace region 210, pixels on one or two sides facing the end are set. When the icon image 201 moves in the horizontal direction (x-axis direction) or the vertical direction (y-axis direction) with respect to the final position, a pixel on one side facing the end is set as the end region. On the other hand, when the icon image 201 moves obliquely with respect to the final position, pixels on two sides facing the end are set as the end region. FIG. 4 shows the latter example, and a pixel adjacent to the sides 213 and 214 is set as an end region.

図5は、トレース方向角度の算出方法について説明するための図である。なお、図5では、図4と同様に、破線によって囲まれた領域がトレース領域210を示し、点線矢印はトレース領域210の中心線を示している。   FIG. 5 is a diagram for explaining a method of calculating the trace direction angle. In FIG. 5, as in FIG. 4, the area surrounded by the broken line indicates the trace area 210, and the dotted arrow indicates the center line of the trace area 210.

図4に示したようにトレース領域210が設定されると、トレース入力部113は、トレース領域210内の各画素に対してトレース方向角度を算出し、トレース領域情報122に登録する。トレース方向角度は、各画素の位置におけるトレース領域210の延伸方向の角度を示す。トレース方向角度は、対応する画素に着目したとき、その周囲画素のうちどの画素を探索対象とするかを決定するための基準角度となる。   When the trace area 210 is set as shown in FIG. 4, the trace input unit 113 calculates the trace direction angle for each pixel in the trace area 210 and registers it in the trace area information 122. The trace direction angle indicates an angle in the extending direction of the trace region 210 at the position of each pixel. The trace direction angle is a reference angle for determining which of the surrounding pixels is a search target when focusing on the corresponding pixel.

具体的な算出方法の例を、図5における画素221を例に挙げて説明する。トレース方向角度θ1は、画面上の所定の基準方向(本実施の形態では垂直方向)に対する角度として設定される。画素221についてのトレース方向角度θ1は、画素221から中心線に対して下ろした垂線と中心線との交点222における、中心線の接線223の傾きθ2として算出することができる。   An example of a specific calculation method will be described using the pixel 221 in FIG. 5 as an example. The trace direction angle θ1 is set as an angle with respect to a predetermined reference direction (vertical direction in the present embodiment) on the screen. The trace direction angle θ1 for the pixel 221 can be calculated as the slope θ2 of the tangent line 223 of the center line at the intersection 222 between the perpendicular line and the center line drawn from the pixel 221 with respect to the center line.

なお、上記の接線223の傾きθ2は、演算負荷の軽減や処理速度の向上を目的として、より簡易な計算方法によって近似的に算出されてもよい。例えば、交点222の座標と、交点222を起点として終点側に所定距離だけ離れた中心線上の座標とを結ぶ直線の角度が、接線223の傾きθ2の近似値として算出されてもよい。   The slope θ2 of the tangent 223 may be approximately calculated by a simpler calculation method for the purpose of reducing the calculation load and improving the processing speed. For example, the angle of a straight line connecting the coordinates of the intersection point 222 and the coordinates on the center line that is separated from the end point side by a predetermined distance from the intersection point 222 may be calculated as an approximate value of the slope θ2 of the tangent line 223.

図6は、トレース領域情報に登録される情報の例を示す図である。トレース入力部113は、ユーザの操作入力によってトレース領域210が設定されると、トレース領域情報122に、トレース領域210に含まれる画素ごとにレコードを作成する。各レコードには、例えば、座標、トレース方向角度、開始領域フラグおよび終了領域フラグの欄が設けられる。   FIG. 6 is a diagram illustrating an example of information registered in the trace area information. When the trace area 210 is set by the user's operation input, the trace input unit 113 creates a record for each pixel included in the trace area 210 in the trace area information 122. Each record is provided with columns of, for example, coordinates, trace direction angle, start area flag, and end area flag.

座標の欄には、各画素の座標が登録される。トレース方向角度の欄には、図5で説明した画素ごとのトレース方向角度が登録される。開始領域フラグは、該当の画素が図4で説明した開始領域に属するか否かを示すフラグであり、開始領域に属する場合は「1」が登録され、属さない場合は「0」が登録される。終了領域フラグは、該当の画素が図4で説明した終了領域に属するか否かを示すフラグであり、終了領域に属する場合は「1」が登録され、属さない場合は「0」が登録される。なお、終了領域に属する画素は、その画素が着目画素に設定されたときにそれ以上のエッジ探索が行われないので、その画素についてはトレース方向角度が登録されていなくてよい。   The coordinates of each pixel are registered in the coordinate column. In the column of the trace direction angle, the trace direction angle for each pixel described in FIG. 5 is registered. The start area flag is a flag indicating whether or not the corresponding pixel belongs to the start area described with reference to FIG. 4. If the start area flag belongs to the start area, “1” is registered, and if not, “0” is registered. The The end region flag is a flag indicating whether or not the corresponding pixel belongs to the end region described with reference to FIG. 4. If the end region flag belongs to the end region, “1” is registered, and if not, “0” is registered. The It should be noted that for the pixel belonging to the end region, no further edge search is performed when the pixel is set as the pixel of interest, and therefore the trace direction angle need not be registered for that pixel.

図7は、トレース方向角度の分類の例を示す図である。前述のように、探索範囲情報123には、トレース方向角度ごとに、エッジ探索を行う範囲を示すエッジ探索範囲が対応付けて記憶されている。本実施の形態では、トレース方向角度が図7に示す8つの角度範囲D0〜D7に分類され、分類された角度範囲ごとにエッジ探索範囲が対応付けられる。   FIG. 7 is a diagram illustrating an example of classification of trace direction angles. As described above, the search range information 123 stores an edge search range indicating a range in which edge search is performed for each trace direction angle in association with each other. In the present embodiment, the trace direction angle is classified into eight angle ranges D0 to D7 shown in FIG. 7, and an edge search range is associated with each classified angle range.

ここで、トレース方向角度が8つの角度範囲D0〜D7に分類される理由は、トレース領域内の着目画素の周囲に8つの画素が存在することと関係する。角度範囲D0〜D7は、それぞれ着目画素の上側、右上側、右側、右下側、下側、左下側、左側、左上側に対して、それぞれ略均等の角度を有するように設定されればよい。   Here, the reason why the trace direction angle is classified into the eight angle ranges D0 to D7 is related to the presence of eight pixels around the pixel of interest in the trace region. The angle ranges D0 to D7 may be set so as to have substantially equal angles with respect to the upper side, upper right side, right side, lower right side, lower side, lower left side, left side, and upper left side of the target pixel, respectively. .

図7の例では、表示画面の上側を角度の基準方向として、338°以上360°未満および0°以上24°未満の範囲を角度範囲D0に、24°以上68°未満の範囲を角度範囲D1に、68°以上114°未満の範囲を角度範囲D2に、114°以上158°未満の範囲を角度範囲D3に、158°以上204°未満の範囲を角度範囲D4に、204°以上248°未満の範囲を角度範囲D5に、248°以上294°未満の範囲を角度範囲D6に、294°以上338°未満の範囲を角度範囲D7に、それぞれ設定している。   In the example of FIG. 7, the upper side of the display screen is the angle reference direction, the range of 338 ° to less than 360 ° and the range of 0 ° to less than 24 ° is the angle range D0, and the range of 24 ° to less than 68 ° is the angle range D1. The range from 68 ° to less than 114 ° is the angle range D2, the range from 114 ° to less than 158 ° is the angle range D3, the range from 158 ° to less than 204 ° is the angle range D4, and the range is from 204 ° to less than 248 °. Is set to an angle range D5, a range of 248 ° to less than 294 ° is set to an angle range D6, and a range of 294 ° to less than 338 ° is set to an angle range D7.

図8は、角度範囲とエッジ探索範囲との関係の例について示す図である。なお、図8では、着目画素の周囲画素について、上側、右上側、右側、右下側、下側、左下側、左側、左上側の順にN0,N1,N2,N3,N4,N5,N6,N7という符号を付して示している。   FIG. 8 is a diagram illustrating an example of the relationship between the angle range and the edge search range. In FIG. 8, with respect to the surrounding pixels of the pixel of interest, N0, N1, N2, N3, N4, N5, N6, N0, N1, N2, N3, N4, N5, N6 in the order of upper side, upper right side, right side, lower right side, lower side, lower left side, left side, upper left side. The reference numeral N7 is attached.

図8に示す「探索対象画素」とは、エッジ探索の対象とする画素、より具体的には、エッジ強度の計算を行う対象の画素を示す。エッジ探索範囲とは、着目画素の周囲画素のうち探索対象画素が含まれる範囲を示す。輪郭検出部114によるエッジ探索範囲は、着目画素について算出されたトレース方向角度が示す方向の近傍範囲に限定される。換言すると、次の着目画素として設定可能な画素は、現在の着目画素の周囲画素のうちエッジ探索範囲に含まれる画素に限定される。これにより、トレース領域の延伸方向から大きく外れた方向に位置するエッジが検出されなくなり、ユーザが意図する輪郭線が検出されやすくなる。   The “search target pixel” illustrated in FIG. 8 indicates a pixel that is a target of edge search, more specifically, a pixel that is a target of calculation of edge strength. The edge search range indicates a range in which the search target pixel is included among the surrounding pixels of the target pixel. The edge search range by the contour detection unit 114 is limited to the vicinity range of the direction indicated by the trace direction angle calculated for the pixel of interest. In other words, the pixels that can be set as the next target pixel are limited to the pixels included in the edge search range among the peripheral pixels of the current target pixel. Thereby, the edge located in the direction largely deviated from the extending direction of the trace area is not detected, and the contour line intended by the user is easily detected.

本実施の形態では例として、図8に示すように、エッジ探索範囲は図7に示した角度範囲ごとに設定される。トレース方向角度が角度範囲D0に含まれる場合、エッジ探索範囲は着目画素の上方向の近傍に設定され、画素N7,N0,N1が探索対象画素となる。トレース方向角度が角度範囲D1に含まれる場合、エッジ探索範囲は着目画素の右上方向の近傍に設定され、画素N0,N1,N2が探索対象画素となる。トレース方向角度が角度範囲D2に含まれる場合、エッジ探索範囲は着目画素の右方向の近傍に設定され、画素N1,N2,N3が探索対象画素となる。トレース方向角度が角度範囲D3に含まれる場合、エッジ探索範囲は着目画素の右下方向の近傍に設定され、画素N2,N3,N4が探索対象画素となる。   In the present embodiment, as an example, as shown in FIG. 8, the edge search range is set for each angle range shown in FIG. When the trace direction angle is included in the angle range D0, the edge search range is set in the vicinity of the upward direction of the pixel of interest, and the pixels N7, N0, and N1 are search target pixels. When the trace direction angle is included in the angle range D1, the edge search range is set near the upper right direction of the pixel of interest, and the pixels N0, N1, and N2 are search target pixels. When the trace direction angle is included in the angle range D2, the edge search range is set in the vicinity of the target pixel in the right direction, and the pixels N1, N2, and N3 are search target pixels. When the trace direction angle is included in the angle range D3, the edge search range is set near the lower right direction of the pixel of interest, and the pixels N2, N3, and N4 are search target pixels.

トレース方向角度が角度範囲D4に含まれる場合、エッジ探索範囲は着目画素の下方向の近傍に設定され、画素N3,N4,N5が探索対象画素となる。トレース方向角度が角度範囲D5に含まれる場合、エッジ探索範囲は着目画素の左下方向の近傍に設定され、画素N4,N5,N6が探索対象画素となる。トレース方向角度が角度範囲D6に含まれる場合、エッジ探索範囲は着目画素の左方向の近傍に設定され、画素N5,N6,N7が探索対象画素となる。トレース方向角度が角度範囲D7に含まれる場合、エッジ探索範囲は着目画素の左上方向の近傍に設定され、画素N6,N7,N0が探索対象画素となる。   When the trace direction angle is included in the angle range D4, the edge search range is set near the lower direction of the pixel of interest, and the pixels N3, N4, and N5 are search target pixels. When the trace direction angle is included in the angle range D5, the edge search range is set near the lower left direction of the pixel of interest, and the pixels N4, N5, and N6 are search target pixels. When the trace direction angle is included in the angle range D6, the edge search range is set in the vicinity of the target pixel in the left direction, and the pixels N5, N6, and N7 are search target pixels. When the trace direction angle is included in the angle range D7, the edge search range is set in the vicinity of the upper left direction of the target pixel, and the pixels N6, N7, and N0 are search target pixels.

なお、図8の例では探索対象画素を着目画素の周囲1画素の範囲に設定したが、探索対象画素を着目画素の周囲複数画素の範囲に設定してもよい。
探索範囲情報123には、角度範囲ごとに、探索対象画素の位置を示す情報(例えば、図8に示すN0〜N7)があらかじめ登録される。輪郭検出部114は、着目画素を設定すると、着目画素についてのトレース角度範囲に対応する探索対象画素を、探索範囲情報123に基づいて判別する。輪郭検出部114は、判別した探索対象画素のそれぞれについてエッジ強度を算出し、エッジ強度が最も強い画素を次の着目画素に設定する。
In the example of FIG. 8, the search target pixel is set in a range of one pixel around the target pixel, but the search target pixel may be set in a range of a plurality of pixels around the target pixel.
In the search range information 123, information indicating the position of the search target pixel (for example, N0 to N7 shown in FIG. 8) is registered in advance for each angle range. When the target pixel is set, the contour detection unit 114 determines the search target pixel corresponding to the trace angle range for the target pixel based on the search range information 123. The contour detection unit 114 calculates the edge strength for each of the determined search target pixels, and sets the pixel having the strongest edge strength as the next pixel of interest.

図9は、エッジ強度の算出例を示す図である。エッジ強度は、対象の画素がエッジである可能性の高さを示す指標である。この図9では、Sobelフィルタを用いて探索対象画素のエッジ強度を算出する例について示す。   FIG. 9 is a diagram illustrating an example of calculating the edge strength. The edge strength is an index indicating the high possibility that the target pixel is an edge. FIG. 9 shows an example in which the edge intensity of the search target pixel is calculated using the Sobel filter.

Sobelフィルタを用いた方法では、x方向およびy方向のそれぞれについてのフィルタ係数が用意される。それぞれのフィルタ係数を用いて、エッジ強度のx成分、y成分が算出される。そして、x成分およびy成分を合成することでエッジ強度が算出される。   In the method using the Sobel filter, filter coefficients are prepared for each of the x direction and the y direction. Using each filter coefficient, the x component and the y component of the edge strength are calculated. Then, the edge strength is calculated by combining the x component and the y component.

x,yの各方向のフィルタ演算では、探索対象画素およびその周囲画素の合計9個の画素にそれぞれフィルタ係数が設定される。図9の例では、探索対象画素についてのx方向のフィルタ演算は、「左上画素の輝度値×(−1)+上側画素の輝度値×0+右上側画素の輝度値×1+左側画素の輝度値×(−2)+探索対象画素の輝度値×0+右側画素の輝度値×2+左下側画素の輝度値×(−1)+下側画素の輝度値×0+右下側画素の輝度値×1」なる式によって行われ、これによりエッジ強度のx成分が算出される。   In the filter calculation in each of the x and y directions, filter coefficients are set for a total of nine pixels including the search target pixel and its surrounding pixels. In the example of FIG. 9, the filter calculation in the x direction for the search target pixel is “brightness value of upper left pixel × (−1) + brightness value of upper pixel × 0 + brightness value of upper right pixel × 1 + brightness value of left pixel”. X (-2) + brightness value of search target pixel × 0 + brightness value of right pixel × 2 + brightness value of lower left pixel × (−1) + brightness value of lower pixel × 0 + brightness value of lower right pixel × 1 The x-component of the edge strength is thereby calculated.

また、図9の例では、探索対象画素についてのy方向のフィルタ演算は、「左上画素の輝度値×(−1)+上側画素の輝度値×(−2)+右上側画素の輝度値×(−1)+左側画素の輝度値×0+探索対象画素の輝度値×0+右側画素の輝度値×0+左下側画素の輝度値×1+下側画素の輝度値×2+右下側画素の輝度値×1」なる式によって行われ、これによりエッジ強度のy成分が算出される。   In the example of FIG. 9, the y-direction filter calculation for the search target pixel is “brightness value of upper left pixel × (−1) + brightness value of upper pixel × (−2) + brightness value of upper right side pixel × (-1) + Luminance value of left pixel × 0 + Luminance value of search target pixel × 0 + Brightness value of right pixel × 0 + Luminance value of lower left pixel × 1 + Luminance value of lower pixel × 2 + Luminance value of lower right pixel This is performed by the formula “× 1”, and thereby the y component of the edge strength is calculated.

そして、x成分の二乗値とy成分の二乗値とを加算した値の平方根をとることで、エッジ強度Eが算出される。
次に、図10は、上記の輪郭検出処理による問題点について説明するための図である。
Then, the edge strength E is calculated by taking the square root of the value obtained by adding the square value of the x component and the square value of the y component.
Next, FIG. 10 is a diagram for explaining a problem caused by the contour detection process.

上記の図4〜図9において説明した輪郭検出手順によれば、トレース領域の延伸方向から大きく外れた方向に位置するエッジが検出されなくなり、ユーザが意図する輪郭線が検出されやすくなる。その反面、輪郭線が急峻に曲がる領域では、輪郭線の曲がった先の部分が探索範囲に含まれなくなる可能性があり、その結果、輪郭線が正確に検出されない可能性が生じる。   According to the contour detection procedure described with reference to FIGS. 4 to 9 described above, an edge located in a direction greatly deviating from the extending direction of the trace region is not detected, and a contour line intended by the user is easily detected. On the other hand, in the region where the contour line bends sharply, there is a possibility that the portion where the contour line is bent is not included in the search range, and as a result, the contour line may not be detected accurately.

図10に示すように、顔が正面を向いた状態の人の頭部近傍の輪郭線を検出したい場合、耳の領域では輪郭線が急峻に曲がる場合がある。例えば、頭部の右側を上側から下側に向かってエッジ探索を行う場合、耳の上側の付け根では、矢印301のように輪郭線が左側に急峻に曲がる場合がある。   As shown in FIG. 10, when it is desired to detect a contour line near the head of a person with the face facing forward, the contour line may be sharply bent in the ear region. For example, when performing an edge search from the upper side to the lower side of the right side of the head, the outline may be sharply bent to the left side as indicated by an arrow 301 at the base of the upper side of the ear.

急峻に曲がった輪郭線を正確に検出するためには、ユーザは、トレース領域を輪郭線の形状に沿ってできるだけ正確に設定すればよい。図10の例では、アイコン画像201が矢印301に沿って移動するようにユーザが操作することで、耳の部分の輪郭線を検出できるようになる。しかしながら、このような操作は手間がかかり、作業効率が低い。特に、多数の入力画像のそれぞれから輪郭検出を行う場合には、作業に多くの手間と時間がかかってしまうという問題がある。   In order to accurately detect the sharply curved contour line, the user may set the trace area as accurately as possible along the shape of the contour line. In the example of FIG. 10, the contour of the ear portion can be detected by the user operating the icon image 201 to move along the arrow 301. However, such operations are time consuming and work efficiency is low. In particular, when contour detection is performed from each of a large number of input images, there is a problem that it takes a lot of work and time.

そこで、本実施の形態の輪郭検出装置100は、入力画像から耳を含む領域を抽出し、着目画素が耳を含む領域に位置する場合には、探索範囲をそれ以外の領域の範囲より拡張する。これにより、輪郭線が急峻に曲がっている場合でも、輪郭線の曲がった先の部分が探索範囲に含まれるようになる。   Therefore, the contour detection apparatus 100 according to the present embodiment extracts an area including the ear from the input image, and extends the search range from the other areas when the target pixel is located in the area including the ear. . As a result, even when the contour line is sharply bent, the portion where the contour line is bent is included in the search range.

図11は、耳領域の検出例を示す図である。本実施の形態では、顔検出部112は、入力画像から顔領域R0を検出し、検出した顔領域R0の位置に基づいて、耳を含む領域(耳領域R1)を設定する。耳領域R1は、その境界が耳の外縁部より外側に位置するように設定されることが望ましい。   FIG. 11 is a diagram illustrating an example of detection of an ear region. In the present embodiment, the face detection unit 112 detects the face region R0 from the input image, and sets a region including the ear (ear region R1) based on the detected position of the face region R0. The ear region R1 is desirably set so that its boundary is located outside the outer edge of the ear.

また、本実施の形態では例として、耳領域R1は、画面の垂直方向(y軸方向)の座標範囲として設定されるものとする。この場合、耳領域R1の上端および下端の座標は、例えば、検出された顔領域R0の垂直方向の範囲をあらかじめ決められた割合で分割した分割点として求めることができる。   In the present embodiment, as an example, the ear region R1 is set as a coordinate range in the vertical direction (y-axis direction) of the screen. In this case, the coordinates of the upper end and the lower end of the ear region R1 can be obtained, for example, as division points obtained by dividing the vertical range of the detected face region R0 at a predetermined ratio.

図12は、トレース領域の設定例を示す図である。トレース領域210の設定の際には、例えば、アイコン画像201の大きさが、少なくとも耳の水平方向の範囲より大きく設定される。ユーザは、図12に示すように、頭部の輪郭線に大まかに沿ってアイコン画像201を移動させる。このとき、耳の形状に沿ってアイコン画像201の移動方向を変化させる必要はなく、耳の水平方向の範囲がアイコン画像201の内部に包含されるようにアイコン画像201が移動されればよい。このような簡単な操作により、耳の部分についても輪郭線を正確に検出できる。   FIG. 12 is a diagram illustrating an example of setting a trace area. When setting the trace area 210, for example, the size of the icon image 201 is set to be larger than at least the horizontal range of the ear. As shown in FIG. 12, the user moves the icon image 201 roughly along the outline of the head. At this time, it is not necessary to change the moving direction of the icon image 201 along the shape of the ear, and the icon image 201 may be moved so that the horizontal range of the ear is included in the icon image 201. With such a simple operation, the contour line can be accurately detected even for the ear portion.

図13は、耳領域での探索範囲の設定例を示す図である。図8に示したように、耳領域R1以外の領域R2では、着目画素の周囲画素のうち3画素のみが、探索対象画素に設定される。これに対し、耳領域R1では、例えば、探索対象画素の設定範囲が左回りおよび右回りにそれぞれ1画素ずつ拡張される。   FIG. 13 is a diagram illustrating an example of setting a search range in the ear region. As shown in FIG. 8, in the region R2 other than the ear region R1, only three pixels among the surrounding pixels of the pixel of interest are set as search target pixels. On the other hand, in the ear region R1, for example, the setting range of the search target pixel is expanded by one pixel each counterclockwise and clockwise.

図13では、頭部の右側領域において上側から下側に向かってエッジ探索が行われ、トレース方向角度が角度範囲D4(図7,図8参照)に含まれている場合の探索範囲の設定例を示す。着目画素が耳領域R1外の領域R2に位置する場合、着目画素の周囲画素のうち、3つの画素N3〜N5が探索対象画素に設定される。これに対し、着目画素が耳領域R1に入ると、着目画素の周囲画素のうち、5つの画素N2〜N6が探索対象画素に設定される。このように、着目画素が耳領域R1に位置する場合には探索範囲が拡張されることで、耳の輪郭線を正確に検出できるようになる。   In FIG. 13, an edge search is performed from the upper side to the lower side in the right region of the head, and an example of setting the search range when the trace direction angle is included in the angle range D4 (see FIGS. 7 and 8). Indicates. When the target pixel is located in the region R2 outside the ear region R1, among the surrounding pixels of the target pixel, three pixels N3 to N5 are set as search target pixels. On the other hand, when the target pixel enters the ear region R1, among the surrounding pixels of the target pixel, five pixels N2 to N6 are set as search target pixels. As described above, when the target pixel is located in the ear region R1, the search range is expanded, so that the outline of the ear can be accurately detected.

次に、図14は、第2の実施の形態に係る輪郭検出装置の処理手順の例を示すフローチャートである。
[ステップS11]画像読み込み部111は、入力画像の画像データをRAM102に読み込む。
Next, FIG. 14 is a flowchart illustrating an example of a processing procedure of the contour detection apparatus according to the second embodiment.
[Step S <b> 11] The image reading unit 111 reads image data of an input image into the RAM 102.

[ステップS12]顔検出部112は、入力画像から顔検出を行い、顔の検出位置に基づいて耳領域を検出する。顔検出部112は、検出した耳領域を示す情報を耳領域情報121としてRAM102に保存する。   [Step S12] The face detection unit 112 performs face detection from the input image, and detects an ear region based on the face detection position. The face detection unit 112 stores information indicating the detected ear region in the RAM 102 as ear region information 121.

[ステップS13]トレース入力部113は、ユーザによるトレース操作を受け付ける。
[ステップS14]トレース入力部113は、トレース操作に基づいて、トレース領域を設定する。トレース入力部113は、トレース領域内の各画素に対応するレコードをトレース領域情報122に作成し、各画素の座標を登録する。また、トレース入力部113は、各画素についてのトレース方向角度を算出して、トレース領域情報122に登録する。さらに、トレース入力部113は、トレース領域における開始領域および終了領域を判別して、その判別結果を基にトレース領域情報122の開始領域フラグおよび終了領域フラグを設定する。
[Step S13] The trace input unit 113 accepts a trace operation by the user.
[Step S14] The trace input unit 113 sets a trace area based on the trace operation. The trace input unit 113 creates a record corresponding to each pixel in the trace area in the trace area information 122 and registers the coordinates of each pixel. Further, the trace input unit 113 calculates the trace direction angle for each pixel and registers it in the trace area information 122. Further, the trace input unit 113 discriminates the start area and the end area in the trace area, and sets the start area flag and the end area flag of the trace area information 122 based on the discrimination result.

[ステップS15]輪郭検出部114は、トレース領域における開始領域の各画素のエッジ強度を算出し、エッジ強度が最も大きい画素を最初の着目画素に設定する。
[ステップS16]輪郭検出部114は、トレース領域情報122から、現在の着目画素に対応付けられたトレース方向角度を読み出す。輪郭検出部114は、探索範囲情報123を参照し、読み出したトレース方向角度が属する角度範囲に対応する、探索対象画素の位置を判別する。
[Step S15] The contour detection unit 114 calculates the edge strength of each pixel in the start region in the trace region, and sets the pixel having the highest edge strength as the first pixel of interest.
[Step S16] The contour detection unit 114 reads the trace direction angle associated with the current pixel of interest from the trace area information 122. The contour detection unit 114 refers to the search range information 123 and determines the position of the search target pixel corresponding to the angle range to which the read trace direction angle belongs.

[ステップS17]輪郭検出部114は、耳領域情報121に基づき、現在の着目画素が耳領域に含まれるかを判定する。着目画素が耳領域に含まれる場合、ステップS18の処理が実行され、含まれない場合、ステップS19の処理が実行される。   [Step S <b> 17] The contour detection unit 114 determines whether the current pixel of interest is included in the ear region based on the ear region information 121. When the pixel of interest is included in the ear region, the process of step S18 is executed, and when it is not included, the process of step S19 is executed.

[ステップS18]輪郭検出部114は、エッジの探索範囲を拡大する。例えば、輪郭検出部114は、ステップS16で判別した探索対象画素に加えて、周囲画素のうちのさらに右回り方向および左回り方向のそれぞれの1画素を、探索対象画素とする。   [Step S18] The contour detection unit 114 expands the edge search range. For example, in addition to the search target pixel determined in step S <b> 16, the contour detection unit 114 further sets each pixel in the clockwise direction and the counterclockwise direction among the surrounding pixels as a search target pixel.

[ステップS19]輪郭検出部114は、探索対象画素のそれぞれについてのエッジ強度を算出し、最もエッジ強度が大きい探索対象画素を新たな着目画素に設定して、現在の着目画素を更新する。   [Step S19] The contour detection unit 114 calculates the edge strength for each of the search target pixels, sets the search target pixel having the highest edge strength as a new target pixel, and updates the current target pixel.

[ステップS20]輪郭検出部114は、更新された現在の着目画素が終了領域に含まれるかを判定する。着目画素が終了領域に含まれない場合、ステップS16の処理が実行され、エッジ探索処理が続行される。一方、着目画素が終了領域に含まれる場合、その着目画素が輪郭線の終端となる。この場合、輪郭検出部114は、ステップS16〜S19の繰り返しによって設定したすべての着目画素の位置を輪郭情報124に登録することで、輪郭線の情報を出力する。   [Step S20] The contour detection unit 114 determines whether or not the updated current pixel of interest is included in the end region. If the target pixel is not included in the end region, the process of step S16 is executed, and the edge search process is continued. On the other hand, when the target pixel is included in the end region, the target pixel becomes the end of the contour line. In this case, the contour detection unit 114 outputs the information of the contour line by registering the positions of all the target pixels set by repeating steps S16 to S19 in the contour information 124.

以上の図14の処理によれば、ユーザが意図する輪郭線が正確に検出されるようになる。特に、輪郭線が急峻に曲がる可能性のある耳の領域においても、輪郭線が正確に検出される。そして、ユーザが曲がった輪郭線に沿って忠実にアイコン画像を移動させなくても、輪郭線を正確に検出することができる。従って、簡単な操作によって輪郭線を効率よく検出することができる。   According to the processing in FIG. 14 described above, the contour line intended by the user is accurately detected. In particular, the contour line can be accurately detected even in the ear region where the contour line may be bent sharply. Then, the contour line can be accurately detected without faithfully moving the icon image along the curved contour line. Therefore, the contour line can be efficiently detected by a simple operation.

なお、上記の図14の処理では、エッジ探索処理を開始する前のステップS15において、事前にトレース領域内の全画素のトレース方向角度を算出した。しかし、他の例として、ステップS15の時点ではトレース方向角度を算出せずに、ステップS16の時点で着目画素のトレース方向角度を算出してもよい。   In the process of FIG. 14, the trace direction angles of all the pixels in the trace area are calculated in advance in step S15 before the edge search process is started. However, as another example, the trace direction angle of the pixel of interest may be calculated at the time of step S16 without calculating the trace direction angle at the time of step S15.

また、図14の処理では、ステップS15およびステップS19の時点でエッジ強度の計算を行った。しかし、他の例として、ステップS14でトレース領域を設定した後、ステップS15の処理を実行する前の段階で、トレース方向角度と同様に、トレース領域内の全画素のエッジ強度をあらかじめ計算し、トレース領域情報122に登録しておいてもよい。この場合、ステップS15およびステップS19では、該当する画素のエッジ強度がトレース領域情報122から読み出される。   In the process of FIG. 14, the edge strength is calculated at the time of step S15 and step S19. However, as another example, after setting the trace area in step S14 and before executing the process of step S15, the edge strengths of all the pixels in the trace area are calculated in advance, similarly to the trace direction angle, It may be registered in the trace area information 122. In this case, in step S15 and step S19, the edge intensity of the corresponding pixel is read from the trace area information 122.

また、入力画像上の全画素についてのトレース方向角度とエッジ強度のいずれか、または両方が、ステップS13でトレース操作を受け付けるより前の時点で計算されて、記憶装置に一時的に記憶されてもよい。   Further, either or both of the trace direction angle and the edge intensity for all the pixels on the input image may be calculated and temporarily stored in the storage device before the trace operation is accepted in step S13. Good.

〔第3の実施の形態〕
図15は、第3の実施の形態に係る輪郭検出装置の処理機能の構成例を示すブロック図である。この図15では、図3と共通する構成要素には同じ符号を付して示しており、ここではそれらについての説明を省略する。第3の実施の形態に係る輪郭検出装置100aは、第2の実施の形態に係る輪郭検出装置100を次のように変形したものである。
[Third Embodiment]
FIG. 15 is a block diagram illustrating a configuration example of processing functions of the contour detection apparatus according to the third embodiment. In FIG. 15, the same components as those in FIG. 3 are denoted by the same reference numerals, and description thereof is omitted here. The contour detection device 100a according to the third embodiment is obtained by modifying the contour detection device 100 according to the second embodiment as follows.

輪郭検出装置100aにおいて、耳領域情報121aは、第2の実施の形態の耳領域情報121と同様に耳を含む領域を示す情報を保持するが、耳領域情報121aは、耳を含む領域を上半分と下半分とに2分割した分割領域を示す情報を保持する。顔検出部112aは、入力画像から顔を検出し、顔の検出結果を基に上記の耳領域の上側および下側の各分割領域を判別して、各分割領域を示す位置情報を耳領域情報121aに登録する。また、顔検出部112aは、顔の検出結果を基に、顔位置情報125をRAM102に登録する。顔位置情報125は、着目画素が顔の右側または左側のどちらに位置するかを判定するための情報であり、例えば、水平方向(y方向)に対する顔の中心を示す座標が登録される。   In the contour detection apparatus 100a, the ear region information 121a holds information indicating the region including the ears, similarly to the ear region information 121 of the second embodiment, but the ear region information 121a indicates the region including the ears. Information indicating a divided area divided into two halves is held. The face detection unit 112a detects a face from the input image, discriminates the upper and lower divided regions of the ear region based on the face detection result, and obtains position information indicating the divided regions as ear region information. 121a is registered. Further, the face detection unit 112a registers the face position information 125 in the RAM 102 based on the face detection result. The face position information 125 is information for determining whether the target pixel is located on the right side or the left side of the face. For example, coordinates indicating the center of the face with respect to the horizontal direction (y direction) are registered.

輪郭検出部114aによる基本的なエッジ探索処理の手順は第1の実施の形態の輪郭検出部114と同様であるが、輪郭検出部114aは、着目画素が耳領域の上側または下側のどちらの分割領域に位置するかによって、エッジの探索範囲を拡張する方向を変える。   The basic edge search process performed by the contour detection unit 114a is the same as that of the contour detection unit 114 of the first embodiment, but the contour detection unit 114a determines whether the pixel of interest is above or below the ear region. The direction in which the edge search range is expanded is changed depending on whether it is located in the divided area.

図16は、耳の輪郭線の一例を示す図である。前述のように、顔が正面を向いた状態の人の頭部近傍の輪郭線を検出したい場合、耳の領域では輪郭線が急峻に曲がる場合がある。例えば、図16に示すように、頭部の右側を上側から下側に向かってエッジ探索を行う場合、耳の上側の付け根では、矢印302のように輪郭線が左側に急峻に曲がる場合がある。一方、耳の輪郭を上側から下側に向かってエッジ探索を行う場合、耳の下側において矢印303のように輪郭線が右側に急峻に曲がる場合がある。   FIG. 16 is a diagram illustrating an example of an outline of an ear. As described above, when it is desired to detect a contour line near the head of a person whose face is facing the front, the contour line may be sharply bent in the ear region. For example, as shown in FIG. 16, when performing an edge search from the upper side to the lower side of the right side of the head, the outline may be sharply bent to the left side as indicated by an arrow 302 at the base of the upper side of the ear. . On the other hand, when the edge search is performed from the upper side to the lower side of the outline of the ear, the outline may be sharply bent rightward as indicated by an arrow 303 on the lower side of the ear.

上記の特徴に鑑みると、耳領域のうち、耳の上半分を含む領域では、エッジの探索範囲を拡張する方向を左回りの方向に限定することができ、耳の下半分を含む領域では、エッジの探索範囲を拡張する方向を右回りの方向に限定することができる。これにより、耳の輪郭の検出精度を第2の実施の形態と同様の精度に維持しつつ、エッジ強度を計算する画素数を減らして、処理速度を向上させることができる。   In view of the above characteristics, in the region including the upper half of the ear among the ear region, the direction of extending the search range of the edge can be limited to the counterclockwise direction, and in the region including the lower half of the ear, The direction in which the edge search range is expanded can be limited to the clockwise direction. As a result, the processing speed can be improved by reducing the number of pixels for calculating the edge strength while maintaining the detection accuracy of the ear outline at the same accuracy as in the second embodiment.

図17は、耳領域における探索範囲の設定例を示す図である。図17の例では、耳領域のうちの上半分に相当する上側領域R11と、下半分に相当する下側領域R12とが設定される。上側領域R11および下側領域R12は、第2の実施の形態で判定された耳領域を上下方向に2分割することで設定することができる。   FIG. 17 is a diagram illustrating a setting example of the search range in the ear region. In the example of FIG. 17, an upper region R11 corresponding to the upper half of the ear region and a lower region R12 corresponding to the lower half are set. The upper region R11 and the lower region R12 can be set by dividing the ear region determined in the second embodiment into two in the vertical direction.

図17の例では、頭部の右側領域において上側から下側に向かってエッジ探索が行われ、トレース方向角度が角度範囲D4(図7,図8参照)に含まれている場合の探索範囲の設定例を示す。着目画素が耳領域外の領域R2に位置する場合、着目画素の周囲画素のうち、3つの画素N3〜N5が探索対象画素に設定される。   In the example of FIG. 17, the edge search is performed from the upper side to the lower side in the right region of the head, and the search range when the trace direction angle is included in the angle range D4 (see FIGS. 7 and 8). A setting example is shown. When the target pixel is located in the region R2 outside the ear region, three pixels N3 to N5 among the surrounding pixels of the target pixel are set as search target pixels.

これに対し、着目画素が耳の上側領域R11に入ると、探索範囲が左回り方向に1画素分拡張され、4つの画素N2〜N5が探索対象画素に設定される。また、着目画素が耳の下側領域R12に入ると、探索範囲が右回り方向に1画素分拡張され、4つの画素N3〜N6が探索対象画素に設定される。   On the other hand, when the target pixel enters the upper ear region R11, the search range is extended by one pixel in the counterclockwise direction, and four pixels N2 to N5 are set as search target pixels. When the target pixel enters the lower region R12 of the ear, the search range is expanded by one pixel in the clockwise direction, and four pixels N3 to N6 are set as search target pixels.

探索範囲を拡張する方向は、現在顔のどちら側に位置する耳の近傍を探索しているか(すなわち、着目画素が顔の中心より左右どちら側に位置するか)、およびエッジ探索を上下のどちらの方向に行っているかによって決められる。詳しい設定方法は、次の図18のフローチャートに示す。   The direction in which the search range is extended is that the side near the ear that is currently located on the face is searched (that is, whether the target pixel is located on the left or right side of the center of the face), and whether the edge search is up or down It depends on what you are going to. A detailed setting method is shown in the flowchart of FIG.

図18,図19は、第3の実施の形態に係る輪郭検出装置の処理手順の例を示すフローチャートである。図18,図19では、図14と同様の処理が実行される処理ステップには同じ符号を付して示し、その説明を省略する。   18 and 19 are flowcharts illustrating an example of a processing procedure of the contour detection apparatus according to the third embodiment. In FIG. 18 and FIG. 19, processing steps in which processing similar to that in FIG. 14 is executed are denoted by the same reference numerals and description thereof is omitted.

図14に示したステップS11が実行された後、次のステップS12aが実行される。
[ステップS12a]顔検出部112aは、入力画像から顔検出を行い、顔の検出位置に基づいて、顔の中心と、耳の上側領域および下側領域とを検出する。顔検出部112aは、顔の中心を示す水平方向の座標(x座標)を顔位置情報125としてRAM102に保存し、耳の上側領域および下側領域をそれぞれ示す情報を耳領域情報121aとしてRAM102に保存する。なお、耳領域情報121aには、例えば、上側領域および下側領域のそれぞれについての垂直方向の境界を示すy座標が設定される。
After step S11 shown in FIG. 14 is executed, the next step S12a is executed.
[Step S12a] The face detection unit 112a detects a face from the input image, and detects the center of the face and the upper and lower areas of the ear based on the face detection position. The face detection unit 112a stores the horizontal coordinate (x coordinate) indicating the center of the face in the RAM 102 as face position information 125, and stores information indicating the upper and lower areas of the ear in the RAM 102 as ear area information 121a. save. In the ear region information 121a, for example, y-coordinates indicating vertical boundaries for each of the upper region and the lower region are set.

このステップS12aが実行された後、図14に示したステップS13,S14が実行され、さらに輪郭検出部114aによりステップS15,S16が実行される。その後、次のステップS31以降の処理が実行される。   After step S12a is executed, steps S13 and S14 shown in FIG. 14 are executed, and steps S15 and S16 are further executed by the contour detection unit 114a. Thereafter, the processing after the next step S31 is executed.

[ステップS31]輪郭検出部114aは、耳領域情報121aに基づき、現在の着目画素が耳領域に含まれるか(すなわち、耳の上側領域または下側領域のいずれかに含まれるか)を判定する。着目画素が耳領域に含まれる場合、ステップS32の処理が実行され、含まれない場合、ステップS19の処理が実行される。   [Step S31] The contour detection unit 114a determines, based on the ear region information 121a, whether the current pixel of interest is included in the ear region (that is, whether it is included in either the upper region or the lower region of the ear). . When the pixel of interest is included in the ear region, the process of step S32 is executed, and when it is not included, the process of step S19 is executed.

[ステップS32]輪郭検出部114aは、現在のエッジ探索の方向が上方向か、または下方向かを判定する。エッジ探索の方向が上方向か、または下方向かは、例えば、現在の着目画素のy座標と、直前に設定された着目画素のy座標との差分の正負を基に判定することができる。エッジ探索の方向が上方向と判定された場合、ステップS33の処理が実行され、下方向と判定された場合、ステップS36の処理が実行される。   [Step S32] The contour detection unit 114a determines whether the current edge search direction is upward or downward. Whether the direction of the edge search is upward or downward can be determined based on, for example, the sign of the difference between the y coordinate of the current pixel of interest and the y coordinate of the pixel of interest set immediately before. If it is determined that the edge search direction is upward, the process of step S33 is executed. If it is determined downward, the process of step S36 is executed.

[ステップS33]輪郭検出部114aは、耳領域情報121aに基づき、現在の着目画素が耳の上側領域または下側領域のどちらに含まれるかを判定する。上側領域に含まれる場合、ステップS34の処理が実行され、下側領域に含まれる場合、ステップS35の処理が実行される。   [Step S33] The contour detection unit 114a determines, based on the ear region information 121a, whether the current pixel of interest is included in the upper region or the lower region of the ear. If it is included in the upper area, the process of step S34 is executed. If it is included in the lower area, the process of step S35 is executed.

[ステップS34]輪郭検出部114aは、顔位置情報125に基づき、着目画素が顔の右側または左側のどちらに位置するかを判定する。右側に位置する場合、ステップS40の処理が実行され、左側に位置する場合、ステップS39の処理が実行される。   [Step S34] The contour detection unit 114a determines whether the target pixel is located on the right side or the left side of the face based on the face position information 125. When located on the right side, the process of step S40 is executed, and when located on the left side, the process of step S39 is executed.

[ステップS35]輪郭検出部114aは、顔位置情報125に基づき、着目画素が顔の右側または左側のどちらに位置するかを判定する。右側に位置する場合、ステップS39の処理が実行され、左側に位置する場合、ステップS40の処理が実行される。   [Step S35] Based on the face position information 125, the contour detection unit 114a determines whether the target pixel is located on the right side or the left side of the face. When located on the right side, the process of step S39 is executed, and when located on the left side, the process of step S40 is executed.

[ステップS36]輪郭検出部114aは、耳領域情報121aに基づき、現在の着目画素が耳の上側領域または下側領域のどちらに含まれるかを判定する。上側領域に含まれる場合、ステップS37の処理が実行され、下側領域に含まれる場合、ステップS38の処理が実行される。   [Step S36] The contour detection unit 114a determines, based on the ear region information 121a, whether the current pixel of interest is included in the upper region or the lower region of the ear. If it is included in the upper region, the process of step S37 is executed. If it is included in the lower region, the process of step S38 is executed.

[ステップS37]輪郭検出部114aは、顔位置情報125に基づき、着目画素が顔の右側または左側のどちらに位置するかを判定する。右側に位置する場合、ステップS39の処理が実行され、左側に位置する場合、ステップS40の処理が実行される。   [Step S37] The contour detection unit 114a determines whether the target pixel is located on the right side or the left side of the face based on the face position information 125. When located on the right side, the process of step S39 is executed, and when located on the left side, the process of step S40 is executed.

[ステップS38]輪郭検出部114aは、顔位置情報125に基づき、着目画素が顔の右側または左側のどちらに位置するかを判定する。右側に位置する場合、ステップS40の処理が実行され、左側に位置する場合、ステップS39の処理が実行される。   [Step S38] The contour detection unit 114a determines whether the target pixel is located on the right side or the left side of the face based on the face position information 125. When located on the right side, the process of step S40 is executed, and when located on the left side, the process of step S39 is executed.

[ステップS39]輪郭検出部114aは、エッジの探索範囲を左回り方向に拡大する。例えば、輪郭検出部114aは、ステップS16で判別した探索対象画素に加えて、周囲画素のうちのさらに左回り方向の1画素を、探索対象画素とする。   [Step S39] The contour detection unit 114a expands the edge search range in the counterclockwise direction. For example, in addition to the search target pixel determined in step S <b> 16, the contour detection unit 114 a further sets one pixel in the counterclockwise direction among the surrounding pixels as the search target pixel.

[ステップS40]輪郭検出部114aは、エッジの探索範囲を右回り方向に拡大する。例えば、輪郭検出部114aは、ステップS16で判別した探索対象画素に加えて、周囲画素のうちのさらに右回り方向の1画素を、探索対象画素とする。   [Step S40] The contour detection unit 114a expands the edge search range clockwise. For example, in addition to the search target pixel determined in step S <b> 16, the contour detection unit 114 a sets one more clockwise pixel among the surrounding pixels as the search target pixel.

ステップS39またはステップS40が実行された後、輪郭検出部114aによりステップS19,S20が実行される。
以上の第3の実施の形態によれば、着目画素が耳領域に含まれる場合に、第2の実施の形態と比較して、エッジの探索範囲の拡張範囲が狭くなって、エッジ強度の計算対象の画素数が減少する。これにより、輪郭検出の処理速度を向上することができる。
After step S39 or step S40 is executed, steps S19 and S20 are executed by the contour detection unit 114a.
According to the third embodiment described above, when the target pixel is included in the ear region, the extended range of the edge search range is narrower than that of the second embodiment, and the edge strength is calculated. The number of target pixels decreases. Thereby, the processing speed of outline detection can be improved.

なお、第3の実施の形態では、第2の実施の形態と比較して、着目画素が耳領域に含まれる場合のエッジの探索範囲の右または左への拡張範囲を、広くしてもよい。例えば、図14のステップS18では左回り方向および右回り方向にそれぞれ1画素ずつ探索範囲を拡張したのに対し、図19のステップS39,S40では、左回り方向または右回り方向に対して2画素分、探索範囲を拡張してもよい。これにより、輪郭線がより大きく曲がった場合でも輪郭線を正確に検出できるようになる。また、第2の実施の形態において右回り方向または左回り方向へ拡張する画素数(上記の例では1画素)より、第3の実施の形態において右回り方向または左回り方向へ拡張する画素数(上記の例では2画素)を2倍以内とすることで、エッジの計算対象とする画素数は増加せず、処理速度を第2の実施の形態と同等かそれ以下に抑制することができる。   Note that, in the third embodiment, compared to the second embodiment, the extended range to the right or left of the edge search range when the target pixel is included in the ear region may be widened. . For example, in step S18 in FIG. 14, the search range is expanded by one pixel in each of the counterclockwise direction and the clockwise direction, whereas in steps S39 and S40 in FIG. 19, two pixels are set in the counterclockwise direction or the clockwise direction. And the search range may be extended. As a result, even when the contour is bent more greatly, the contour can be accurately detected. Further, the number of pixels expanded in the clockwise direction or the counterclockwise direction in the third embodiment from the number of pixels expanded in the clockwise direction or the counterclockwise direction in the second embodiment (one pixel in the above example). By setting (2 pixels in the above example) to within 2 times, the number of pixels to be calculated for edge does not increase, and the processing speed can be suppressed to the same level or lower than that of the second embodiment. .

なお、上記の各実施の形態に示した装置(輪郭検出装置1,100,100a)の処理機能は、コンピュータによって実現することができる。その場合、各装置が有すべき機能の処理内容を記述したプログラムが提供され、そのプログラムをコンピュータで実行することにより、上記処理機能がコンピュータ上で実現される。処理内容を記述したプログラムは、コンピュータで読み取り可能な記録媒体に記録しておくことができる。コンピュータで読み取り可能な記録媒体としては、磁気記憶装置、光ディスク、光磁気記録媒体、半導体メモリなどがある。磁気記憶装置には、ハードディスク装置(HDD)、フレキシブルディスク(FD)、磁気テープなどがある。光ディスクには、DVD、DVD−RAM、CD−ROM、CD−R/RWなどがある。光磁気記録媒体には、MO(Magneto-Optical disk)などがある。   The processing functions of the devices (contour detection devices 1, 100, 100a) described in the above embodiments can be realized by a computer. In that case, a program describing the processing contents of the functions that each device should have is provided, and the processing functions are realized on the computer by executing the program on the computer. The program describing the processing contents can be recorded on a computer-readable recording medium. Examples of the computer-readable recording medium include a magnetic storage device, an optical disk, a magneto-optical recording medium, and a semiconductor memory. Examples of the magnetic storage device include a hard disk device (HDD), a flexible disk (FD), and a magnetic tape. Examples of the optical disc include a DVD, a DVD-RAM, a CD-ROM, and a CD-R / RW. Magneto-optical recording media include MO (Magneto-Optical disk).

プログラムを流通させる場合には、例えば、そのプログラムが記録されたDVD、CD−ROMなどの可搬型記録媒体が販売される。また、プログラムをサーバコンピュータの記憶装置に格納しておき、ネットワークを介して、サーバコンピュータから他のコンピュータにそのプログラムを転送することもできる。   When distributing the program, for example, a portable recording medium such as a DVD or a CD-ROM in which the program is recorded is sold. It is also possible to store the program in a storage device of a server computer and transfer the program from the server computer to another computer via a network.

プログラムを実行するコンピュータは、例えば、可搬型記録媒体に記録されたプログラムまたはサーバコンピュータから転送されたプログラムを、自己の記憶装置に格納する。そして、コンピュータは、自己の記憶装置からプログラムを読み取り、プログラムに従った処理を実行する。なお、コンピュータは、可搬型記録媒体から直接プログラムを読み取り、そのプログラムに従った処理を実行することもできる。また、コンピュータは、ネットワークを介して接続されたサーバコンピュータからプログラムが転送されるごとに、逐次、受け取ったプログラムに従った処理を実行することもできる。   The computer that executes the program stores, for example, the program recorded on the portable recording medium or the program transferred from the server computer in its own storage device. Then, the computer reads the program from its own storage device and executes processing according to the program. The computer can also read the program directly from the portable recording medium and execute processing according to the program. In addition, each time a program is transferred from a server computer connected via a network, the computer can sequentially execute processing according to the received program.

1 輪郭検出装置
2 領域設定手段
3 入力受付手段
4 探索手段
5 探索範囲情報
10 特定領域
20 探索領域
21 開始領域
22 終了領域
31,32,41,42 画素
A1,A2 延伸方向
B1〜B3 エッジ探索範囲
DESCRIPTION OF SYMBOLS 1 Contour detection apparatus 2 Area | region setting means 3 Input reception means 4 Search means 5 Search range information 10 Specific area 20 Search area 21 Start area 22 End area 31, 32, 41, 42 Pixel A1, A2 Stretch direction B1-B3 Edge search range

Claims (8)

入力画像上に特定領域を設定する領域設定手段と、
入力操作に応じて、開始領域から終了領域に向かって延伸された、一定以上の幅を有する探索領域を前記入力画像上に設定する入力受付手段と、
前記探索領域の中から設定した着目画素の位置での前記探索領域の延伸方向の角度を判別し、延伸方向の角度ごとにエッジを探索するためのエッジ探索範囲が対応付けられ、前記各エッジ探索範囲が前記探索領域の延伸方向を含むように設定された探索範囲情報に基づいて、前記判別した延伸方向の角度に対応するエッジ探索範囲を判別し、前記設定した着目画素の周囲画素のうち前記判別したエッジ探索範囲内に位置する画素から、エッジである可能性が高い画素を判定して当該画素を次の着目画素に設定するエッジ探索処理を、着目画素が前記開始領域から前記終了領域に達するまで繰り返す探索手段と、
を有し、
前記探索手段は、着目画素が前記特定領域に含まれる場合には、当該着目画素について判別したエッジ探索範囲を拡張し、当該着目画素の周囲画素のうち前記拡張した前記エッジ探索範囲内に位置する画素から、エッジである可能性が高い画素を次の着目画素に設定する、
ことを特徴とする輪郭検出装置。
Area setting means for setting a specific area on the input image;
In response to an input operation, an input receiving unit that sets a search area having a certain width or more extended from the start area toward the end area on the input image;
An edge search range for searching for an edge is associated with each angle in the extension direction by determining an angle in the extension direction of the search area at the position of the target pixel set from the search area , and each edge search Based on search range information set so that the range includes the extension direction of the search region, an edge search range corresponding to the determined angle of the extension direction is determined, and the surrounding pixels of the set target pixel Edge search processing for determining a pixel that is highly likely to be an edge from the pixels located within the determined edge search range and setting the pixel as the next target pixel is performed from the start area to the end area. Search means to repeat until it reaches,
Have
When the pixel of interest is included in the specific region, the search means expands the edge search range determined for the pixel of interest, and is located within the expanded edge search range among the surrounding pixels of the pixel of interest. From a pixel, a pixel that is likely to be an edge is set as the next pixel of interest.
A contour detection apparatus characterized by the above.
前記特定領域は、人の耳を含む領域であることを特徴とする請求項1記載の輪郭検出装置。   The contour detection apparatus according to claim 1, wherein the specific region is a region including a human ear. 前記領域設定手段は、前記入力画像から人の顔を検出し、前記顔の検出結果を基に前記耳を含む領域を設定することを特徴とする請求項2記載の輪郭検出装置。 The region setting means, said detecting a human face from the input image, edge detection apparatus according to claim 2, wherein the setting a region including the ear on the basis of the detection result of the face. 前記領域設定手段は、前記耳を含む領域を前記耳の上下方向に分割した第1の領域と第2の領域とを前記入力画像上に設定し、
前記探索手段は、着目画素が前記第1の領域と前記第2の領域のどちらに含まれるかに応じて、当該着目画素について判別したエッジ探索範囲を、当該着目画素について判別した延伸方向を基準として右側または左側に対して選択的に拡張する、
ことを特徴とする請求項2または3に記載の輪郭検出装置。
It said area setting means sets a first region and a second region obtained by dividing the area including the ear in the vertical direction of the ear on the input image,
The search means uses the edge search range determined for the target pixel as a reference based on the extension direction determined for the target pixel, depending on whether the target pixel is included in the first region or the second region. As selectively expand against the right or left side,
The contour detection apparatus according to claim 2 or 3,
前記入力受付手段は、前記入力画像上において指示位置を連続的に移動させる入力操作を受け付け、前記指示位置の軌跡に沿った一定以上の幅を有する領域を前記探索領域に設定することを特徴とする請求項1〜4のいずれか1項に記載の輪郭検出装置。   The input receiving means receives an input operation for continuously moving a designated position on the input image, and sets an area having a certain width or more along a locus of the designated position as the search area. The contour detection apparatus according to any one of claims 1 to 4. 前記入力受付手段は、前記入力画像上において一定の大きさを有するアイコン画像を連続的に移動させる入力操作を受け付け、前記アイコン画像が移動した領域を前記探索領域に設定することを特徴とする請求項1〜4のいずれか1項に記載の輪郭検出装置。   The input accepting means accepts an input operation for continuously moving an icon image having a certain size on the input image, and sets an area where the icon image has moved to the search area. Item 5. The contour detection device according to any one of items 1 to 4. 輪郭検出装置が、
入力画像上に特定領域を設定し、
入力操作に応じて、開始領域から終了領域に向かって延伸された、一定以上の幅を有する探索領域を前記入力画像上に設定し、
前記探索領域の中から設定した着目画素の位置での前記探索領域の延伸方向の角度を判別し、延伸方向の角度ごとにエッジを探索するためのエッジ探索範囲が対応付けられ、前記各エッジ探索範囲が前記探索領域の延伸方向を含むように設定された探索範囲情報に基づいて、前記判別した延伸方向の角度に対応するエッジ探索範囲を判別し、前記設定した着目画素の周囲画素のうち前記判別したエッジ探索範囲内に位置する画素から、エッジである可能性が高い画素を判定して当該画素を次の着目画素に設定するエッジ探索処理を、着目画素が前記開始領域から前記終了領域に達するまで繰り返す、
処理を実行し、
前記エッジ探索処理では、着目画素が前記特定領域に含まれる場合には、当該着目画素について判別したエッジ探索範囲を拡張し、当該着目画素の周囲画素のうち前記拡張した前記エッジ探索範囲内に位置する画素から、エッジである可能性が高い画素を次の着目画素に設定する、
ことを特徴とする輪郭検出方法。
Contour detection device
Set a specific area on the input image,
In response to an input operation, a search area having a certain width or more extended from the start area to the end area is set on the input image,
An edge search range for searching for an edge is associated with each angle in the extension direction by determining an angle in the extension direction of the search area at the position of the target pixel set from the search area , and each edge search Based on search range information set so that the range includes the extension direction of the search region, an edge search range corresponding to the determined angle of the extension direction is determined, and the surrounding pixels of the set target pixel Edge search processing for determining a pixel that is highly likely to be an edge from the pixels located within the determined edge search range and setting the pixel as the next target pixel is performed from the start area to the end area. Repeat until it reaches,
Execute the process,
In the edge search process, when the target pixel is included in the specific region, the edge search range determined for the target pixel is expanded, and the position within the expanded edge search range among the surrounding pixels of the target pixel A pixel that is likely to be an edge is set as the next pixel of interest from
A contour detection method characterized by the above.
コンピュータに、
入力画像上に特定領域を設定し、
入力操作に応じて、開始領域から終了領域に向かって延伸された、一定以上の幅を有する探索領域を前記入力画像上に設定し、
前記探索領域の中から設定した着目画素の位置での前記探索領域の延伸方向の角度を判別し、延伸方向の角度ごとにエッジを探索するためのエッジ探索範囲が対応付けられ、前記各エッジ探索範囲が前記探索領域の延伸方向を含むように設定された探索範囲情報に基づいて、前記判別した延伸方向の角度に対応するエッジ探索範囲を判別し、前記設定した着目画素の周囲画素のうち前記判別したエッジ探索範囲内に位置する画素から、エッジである可能性が高い画素を判定して当該画素を次の着目画素に設定するエッジ探索処理を、着目画素が前記開始領域から前記終了領域に達するまで繰り返す、
処理を実行させ、
前記エッジ探索処理では、着目画素が前記特定領域に含まれる場合には、当該着目画素について判別したエッジ探索範囲を拡張し、当該着目画素の周囲画素のうち前記拡張した前記エッジ探索範囲内に位置する画素から、エッジである可能性が高い画素を次の着目画素に設定する、
ことを特徴とする輪郭検出プログラム。
On the computer,
Set a specific area on the input image,
In response to an input operation, a search area having a certain width or more extended from the start area to the end area is set on the input image,
An edge search range for searching for an edge is associated with each angle in the extension direction by determining an angle in the extension direction of the search area at the position of the target pixel set from the search area , and each edge search Based on search range information set so that the range includes the extension direction of the search region, an edge search range corresponding to the determined angle of the extension direction is determined, and the surrounding pixels of the set target pixel Edge search processing for determining a pixel that is highly likely to be an edge from the pixels located within the determined edge search range and setting the pixel as the next target pixel is performed from the start area to the end area. Repeat until it reaches,
Let the process run,
In the edge search process, when the target pixel is included in the specific region, the edge search range determined for the target pixel is expanded, and the position within the expanded edge search range among the surrounding pixels of the target pixel A pixel that is likely to be an edge is set as the next pixel of interest from
A contour detection program.
JP2012254803A 2012-11-21 2012-11-21 Contour detection device, contour detection method, and contour detection program Expired - Fee Related JP6031961B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012254803A JP6031961B2 (en) 2012-11-21 2012-11-21 Contour detection device, contour detection method, and contour detection program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012254803A JP6031961B2 (en) 2012-11-21 2012-11-21 Contour detection device, contour detection method, and contour detection program

Publications (2)

Publication Number Publication Date
JP2014102711A JP2014102711A (en) 2014-06-05
JP6031961B2 true JP6031961B2 (en) 2016-11-24

Family

ID=51025158

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012254803A Expired - Fee Related JP6031961B2 (en) 2012-11-21 2012-11-21 Contour detection device, contour detection method, and contour detection program

Country Status (1)

Country Link
JP (1) JP6031961B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6654798B2 (en) * 2014-11-10 2020-02-26 三星ディスプレイ株式會社Samsung Display Co.,Ltd. Image processing apparatus, image processing method, and program
CN108469224A (en) * 2018-03-16 2018-08-31 河南东陆高科实业股份有限公司 Pipeline engineering fluting dimension measurement method based on image recognition

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0877336A (en) * 1994-09-06 1996-03-22 Fuji Photo Film Co Ltd Area extracting method
JP2000209430A (en) * 1999-01-18 2000-07-28 Canon Inc Contour extraction device and method and storage medium
JP2001319239A (en) * 2000-05-10 2001-11-16 Nec Corp Device and method for extracting object contour
JP2008123086A (en) * 2006-11-09 2008-05-29 Matsushita Electric Ind Co Ltd Image processor and image processing method
JP5034623B2 (en) * 2007-04-06 2012-09-26 富士通株式会社 Image processing method, image processing apparatus, image processing system, and computer program
JP2011188315A (en) * 2010-03-10 2011-09-22 Casio Computer Co Ltd Image reproduction device and program

Also Published As

Publication number Publication date
JP2014102711A (en) 2014-06-05

Similar Documents

Publication Publication Date Title
US8749497B2 (en) Multi-touch shape drawing
JP6194777B2 (en) Operation determination method, operation determination apparatus, and operation determination program
US8836649B2 (en) Information processing apparatus, information processing method, and program
JP2010176332A (en) Information processing apparatus, information processing method, and program
WO2011142317A1 (en) Gesture recognition device, method, program, and computer-readable medium upon which program is stored
US20120280898A1 (en) Method, apparatus and computer program product for controlling information detail in a multi-device environment
JP4900361B2 (en) Image processing apparatus, image processing method, and program
CN106527915B (en) A kind of information processing method and electronic equipment
US9916043B2 (en) Information processing apparatus for recognizing user operation based on an image
US10318629B2 (en) Adaptive content rendering for optimizing page layout
US9836130B2 (en) Operation input device, operation input method, and program
CN102236409A (en) Motion gesture recognition method and motion gesture recognition system based on image
KR20150091365A (en) Multi-touch symbol recognition
US8243101B2 (en) Image display processing apparatus, image display processing method, and recording medium
JP6031961B2 (en) Contour detection device, contour detection method, and contour detection program
JP2020170297A (en) Input device
TWI410880B (en) Computer program product related to digital image analyzing
WO2022123929A1 (en) Information processing device and information processing method
TW201617793A (en) Wearable device and method of operating the same
JP6031962B2 (en) Contour detection device, contour detection method, and contour detection program
US20100245266A1 (en) Handwriting processing apparatus, computer program product, and method
US20140201687A1 (en) Information processing apparatus and method of controlling information processing apparatus
JP2015007844A (en) User interface device, user interface method, and program
JP2008040663A (en) System, method and program for evaluating land based on shape
JP5845932B2 (en) Character string arrangement changing method, program, and information processing apparatus

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150706

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160622

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20160705

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20160905

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20161010

R150 Certificate of patent or registration of utility model

Ref document number: 6031961

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees